Przeglądaj źródła

//update

release_toaliyun_real
xhxu 4 lat temu
rodzic
commit
fff652414d
11 zmienionych plików z 103 dodań i 20 usunięć
  1. +7
    -2
      mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java
  2. +9
    -0
      mallinkMQConsumer/src/main/java/com/iformall/mq/MqBaseConsumer.java
  3. +15
    -0
      mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideBasicUserPushMsg.java
  4. +0
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumMsgRecordType.java
  5. +2
    -1
      mallinkService/src/main/java/com/iformall/service/MallCooUserInfoService.java
  6. +6
    -2
      mallinkService/src/main/java/com/iformall/service/cuser/BasicCUserService.java
  7. +21
    -8
      mallinkService/src/main/java/com/iformall/service/impl/MallCooUserInfoServiceImpl.java
  8. +0
    -1
      mallinkService/src/main/java/com/iformall/service/impl/OrderSnapshotServiceImpl.java
  9. +11
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
  10. +0
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java
  11. +32
    -0
      mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideBasicUserPushMsgServiceImpl.java

+ 7
- 2
mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java Wyświetl plik

@@ -696,8 +696,13 @@ public class WxUserGrantController extends BaseController {
record.setUpdChild(true);
wxCUserBasicInfoService.update(record);

//推送猫酷
mallCooUserInfoService.pullByMobile(tenantEntity, record);
try{
//推送猫酷
mallCooUserInfoService.pullByMobileMsg(tenantEntity, record.getId());
}catch(Exception e){
logger.error("发送同步会员消息异常");
}


wxScoreRulesService.addScore(tenantEntity,EnumScoreType.COMPLETE_INFO, record);
//增加积分


+ 9
- 0
mallinkMQConsumer/src/main/java/com/iformall/mq/MqBaseConsumer.java Wyświetl plik

@@ -55,6 +55,9 @@ public class MqBaseConsumer {

@Autowired
private FmInsideProductPushMsgServiceImpl fmInsideProductPushMsgServiceImpl;

@Autowired
private FmInsideBasicUserPushMsgServiceImpl fmInsideBasicUserPushMsgServiceImpl;


@@ -140,6 +143,12 @@ public class MqBaseConsumer {
fmInsideProductPushMsgServiceImpl.send(msg);
}

else if(EnumMsgRecordType.MALL_COO_USER_PUSH.getCode().equals(baseMsg.getMsgType())) {
// 内部消息 - 同步会员
FmInsideBasicUserPushMsg msg = (FmInsideBasicUserPushMsg)JsonUtil.readValue(message,FmInsideBasicUserPushMsg.class);
fmInsideBasicUserPushMsgServiceImpl.send(msg);
}

}catch (Throwable e){
log.error("consum received error: ", e);
/**


+ 15
- 0
mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideBasicUserPushMsg.java Wyświetl plik

@@ -0,0 +1,15 @@
package com.iformall.domain.po.msg;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class FmInsideBasicUserPushMsg extends BaseMsg{

@io.swagger.annotations.ApiModelProperty(value = "会员Id", name = "basicUserId")
private Long basicUserId;

}

+ 0
- 1
mallinkService/src/main/java/com/iformall/enums/EnumMsgRecordType.java Wyświetl plik

@@ -25,7 +25,6 @@ public enum EnumMsgRecordType {
INSIDE_PRODUCT_PUSH(109, "商品状态或库存同步"),

MALL_COO_USER_PUSH(110, "猫酷同步会员"),
ORDER_SNAPSHOT_PUSH(111, "订单快照"),
;

public static EnumMsgRecordType getEnum(Integer code) {


+ 2
- 1
mallinkService/src/main/java/com/iformall/service/MallCooUserInfoService.java Wyświetl plik

@@ -26,7 +26,8 @@ public interface MallCooUserInfoService {

MallCooUserInfo getByPhone(String phone,String finalTenantId);

void pullByMobile(TenantEntity tenantEntity, WxCUserBasicInfo basicInfo);
void pullByMobile(TenantEntity tenantEntity, Long basicUserId);

void pullByMobileMsg(TenantEntity tenantEntity, Long id);
}


+ 6
- 2
mallinkService/src/main/java/com/iformall/service/cuser/BasicCUserService.java Wyświetl plik

@@ -159,8 +159,12 @@ public class BasicCUserService {
// 外部注券
memCouponFromDspService.couponOrderFromDsp(tenantEntity, userPhone);

//推送猫酷
mallCooUserInfoService.pullByMobile(tenantEntity, basicInfo);
try{
//推送猫酷
mallCooUserInfoService.pullByMobileMsg(tenantEntity, basicInfo.getId());
}catch(Exception e){
logger.error("发送同步会员消息异常");
}

return basicInfo.getId();
}


+ 21
- 8
mallinkService/src/main/java/com/iformall/service/impl/MallCooUserInfoServiceImpl.java Wyświetl plik

@@ -1,21 +1,21 @@
package com.iformall.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumThirdPartyConfigType;
import com.iformall.domain.po.msg.FmInsideBasicUserPushMsg;
import com.iformall.enums.*;
import com.iformall.mallcoo.MallcooHelper;
import com.iformall.mallcoo.McUserInfo;
import com.iformall.mapper.*;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.Date;
@@ -34,6 +34,9 @@ public class MallCooUserInfoServiceImpl implements MallCooUserInfoService {
@Autowired
WxThirdPartyConfigMapper wxThirdPartyConfigMapper;

@Autowired
private MqBaseProducer mqBaseProducer;


@Override
public PageInfo<MallCooUserInfo> listAsPage(MallCooUserInfo record, Integer pageIndex, Integer pageSize) {
@@ -54,18 +57,18 @@ public class MallCooUserInfoServiceImpl implements MallCooUserInfoService {
return mallCooUserInfoMapper.selectOne(new QueryWrapper<>(userInfo));
}

@Async
@Override
public void pullByMobile(TenantEntity tenantEntity, WxCUserBasicInfo basicInfo) {
public void pullByMobile(TenantEntity tenantEntity, Long basicUserId) {
try{
WxThirdPartyConfig config = getThirdPartyConfig(tenantEntity);
if(config == null){
logger.error("未找到猫酷配置信息");
return;
}
if(StringUtils.isBlank(basicInfo.getPhone())){
basicInfo = wxCUserBasicInfoMapper.selectById(basicInfo.getId(),basicInfo.getFinalTenantId());

WxCUserBasicInfo basicInfo = wxCUserBasicInfoMapper.selectById(basicUserId, tenantEntity.getFinalTenantId());
if(null == basicInfo){
logger.error("未找到会员信息"+basicUserId);
return;
}
MallCooUserInfo mallCooUserInfo = this.getByPhone(basicInfo.getPhone(), basicInfo.getFinalTenantId());
if(mallCooUserInfo == null){
@@ -109,6 +112,16 @@ public class MallCooUserInfoServiceImpl implements MallCooUserInfoService {

}

@Override
public void pullByMobileMsg(TenantEntity tenantEntity, Long id) {
FmInsideBasicUserPushMsg basicUserPushMsg = new FmInsideBasicUserPushMsg();
basicUserPushMsg.setMsgType(EnumMsgRecordType.MALL_COO_USER_PUSH.getCode());
basicUserPushMsg.updateTenantInfo(tenantEntity);
basicUserPushMsg.setBasicUserId(id);
logger.info(">>>>>>>>>>>send pullByMobileMsg :"+basicUserPushMsg);
mqBaseProducer.sendMessage(basicUserPushMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}

private WxThirdPartyConfig getThirdPartyConfig(TenantEntity tenantEntity){
WxThirdPartyConfig configQ = new WxThirdPartyConfig();
configQ.updateTenantInfo(tenantEntity);


+ 0
- 1
mallinkService/src/main/java/com/iformall/service/impl/OrderSnapshotServiceImpl.java Wyświetl plik

@@ -67,7 +67,6 @@ public class OrderSnapshotServiceImpl implements OrderSnapshotService {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到订单数据");
}

@Async
@Override
public void saveOrderSnapshot(WxOrder order) {
try{


+ 11
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java Wyświetl plik

@@ -213,6 +213,9 @@ public class WxOrderServiceImpl implements WxOrderService {
@Lazy
@Autowired
private WxMsgService wxMsgService;

@Autowired
private OrderSnapshotService orderSnapshotService;
@Override
public PageInfo<WxOrder> listAsPage(WxOrder record, Integer pageIndex, Integer pageSize) {
@@ -2064,6 +2067,8 @@ public class WxOrderServiceImpl implements WxOrderService {
* @param user
*/
public void actionAfterCouponOrderSuccess(WxOrder order, WxCoupon coupon, WxCUserBasicInfo user) {


if(EnumCouponType.COUPON_GIFT.getCode().equals(coupon.getType())){
WxCouponOrder couponOrderQ = new WxCouponOrder();
couponOrderQ.setOrderId(order.getId());
@@ -2078,7 +2083,13 @@ public class WxOrderServiceImpl implements WxOrderService {
logger.error("系统券包核销异常:" + e.getMessage(),e);
}
}
}

//订单快照
try {
orderSnapshotService.saveOrderSnapshot(order);
} catch (Exception e) {
logger.error("订单快照error:" + e.getMessage(),e);
}
/// TODO 晚上会定时打一下tag
wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_BUY, user,order,null);


+ 0
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java Wyświetl plik

@@ -935,11 +935,6 @@ public class WxPayOrderServiceImpl implements WxPayOrderService {
}
}

try{
orderSnapshotService.saveOrderSnapshot(order);
}catch(Exception e){
logger.error("订单快照 error"+e.getMessage());
}

}
}


+ 32
- 0
mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideBasicUserPushMsgServiceImpl.java Wyświetl plik

@@ -0,0 +1,32 @@
package com.iformall.service.msg.impl;

import com.iformall.domain.po.msg.BaseMsg;
import com.iformall.domain.po.msg.FmInsideBasicUserPushMsg;
import com.iformall.service.MallCooUserInfoService;
import com.iformall.service.msg.MsgSendService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
*
* @author Stormeye Wu
* @date 2019/5/10
*/
@Service
public class FmInsideBasicUserPushMsgServiceImpl implements MsgSendService {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private MallCooUserInfoService mallCooUserInfoService;

@Override
public void send(BaseMsg baseMsg) throws Exception{
FmInsideBasicUserPushMsg msg = (FmInsideBasicUserPushMsg)baseMsg;

mallCooUserInfoService.pullByMobile(msg.getTenantInfo(),msg.getBasicUserId());

}
}

Ładowanie…
Anuluj
Zapisz