diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java index a7d198499..939192067 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java @@ -144,14 +144,14 @@ public class WxProfitSharingReceiverApplyController extends BaseController { @SystemControllerLog(description = "修改") public ResultData delReceiverApply(@RequestBody WxProfitSharingReceiverApply receiverApply) { log.debug("[" + getIpAddr() + "] merchantProfitSharingReceiver::delReceiverApply"); - if(receiverApply.getId() == null || receiverApply.getFunctionState() == null){ + if(receiverApply.getId() == null){ return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } WxProfitSharingReceiverApply delApply = wxProfitSharingReceiverApplyService.selectById(receiverApply.getId()); if(receiverApply == null){ return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到进件数据"); } - if(!EnumSharingReceiverApplymentState.APPLYMENT_STATE_CANCELED.getCode().equals(receiverApply.getApplymentState())){ + if(EnumSharingReceiverApplymentState.APPLYMENT_STATE_CANCELED.getCode().equals(receiverApply.getApplymentState())){ return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "已作废,才能删除"); } return wxProfitSharingReceiverApplyService.updateDel(delApply); diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/TtCouponGoodsController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/TtCouponGoodsController.java index cabdd4b35..4b35ca3e5 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/TtCouponGoodsController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/TtCouponGoodsController.java @@ -170,7 +170,6 @@ public class TtCouponGoodsController extends BaseController { if (id == null) { return new ResultData(ResultData.ERROR, "缺少id"); } - return ttCouponGoodsService.productOperate(getTenantInfo(),id); } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java index f9d3010b5..19707d183 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java @@ -96,6 +96,8 @@ public class WxCouponChannelController extends BaseController { //生成二维码 if(couponChannel!=null){ wxCouponChannelService.updateQrCode(couponChannel,couponChannel.getId(),couponChannel.getType()); + + wxCouponChannelService.spuStatusSyncByCoupon(couponChannel,couponChannel.getCouponId()); } CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId()); CouponCacheUtils.removeDouyinLivePageCache(redisTemplate, wxCouponChannel.getTenantId(), null, null); diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxCouponChannelController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxCouponChannelController.java index 023e2caa4..33c021485 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxCouponChannelController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxCouponChannelController.java @@ -83,6 +83,8 @@ public class WxCouponChannelController extends BaseController { //生成二维码 if(couponChannel!=null){ wxCouponChannelService.updateQrCode(couponChannel,couponChannel.getId(),couponChannel.getType()); + + wxCouponChannelService.spuStatusSyncByCoupon(couponChannel,couponChannel.getCouponId()); } CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId()); return resultData; diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java index 7c8ce2288..96250850f 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java @@ -53,14 +53,14 @@ public class WxMerchantReceiverApplyVo extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="微信支付申请单号",name="applymentId") private String applymentId; @Excel(name="进件状态",width = 20,orderNum = "8",replace = {"编辑中_1", "提交审核成功_11", "资料效验中_2", "审核中_3", "已驳回_4", - "待账户验证_5", "待签约_6", "功能开通中_7", "完成_8", "已冻结_9", "已作废_10"}) + "待账户验证_5", "待签约_6", "功能开通中_7", "已完成_8", "已冻结_9", "已作废_10"}) @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverApplymentState 申请状态",name="applymentState") private Integer applymentState; @Excel(name="进件状态描述",width = 20,orderNum = "9") @io.swagger.annotations.ApiModelProperty(value="申请状态描述",name="applymentStateDesc") private String applymentStateDesc; - @Excel(name="功能开通状态",width = 20,orderNum = "10",replace = {"开通中_1", "未开通_0", "已开通_2"}) + @Excel(name="功能开通状态",width = 20,orderNum = "10",replace = {"开通中_1", "未开通_0", "开通完成_2"}) @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverApplyFunctionStatus 功能开通状态",name="functionState") private Integer functionState; @io.swagger.annotations.ApiModelProperty(value="功能开通状态描述",name="functionStateDesc") diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumSharingReceiverApplymentState.java b/mallinkService/src/main/java/com/iformall/enums/EnumSharingReceiverApplymentState.java index e5b98b12c..625bed1d8 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumSharingReceiverApplymentState.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumSharingReceiverApplymentState.java @@ -26,7 +26,7 @@ public enum EnumSharingReceiverApplymentState { APPLYMENT_STATE_TO_BE_CONFIRMED(5, ApplymentStateEnum.APPLYMENT_STATE_TO_BE_CONFIRMED,"待账户验证"), APPLYMENT_STATE_TO_BE_SIGNED(6, ApplymentStateEnum.APPLYMENT_STATE_TO_BE_SIGNED,"待签约"), APPLYMENT_STATE_SIGNING(7, ApplymentStateEnum.APPLYMENT_STATE_SIGNING,"开通权限中"), - APPLYMENT_STATE_FINISHED(8, ApplymentStateEnum.APPLYMENT_STATE_FINISHED,"完成"), + APPLYMENT_STATE_FINISHED(8, ApplymentStateEnum.APPLYMENT_STATE_FINISHED,"已完成"), // APPLYMENT_STATE_FROZEN(9, "FROZEN", "已冻结"), APPLYMENT_STATE_CANCELED(10, ApplymentStateEnum.APPLYMENT_STATE_CANCELED,"已作废"), ; diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java index 9401e19be..925811575 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java @@ -22,4 +22,6 @@ public interface WxProfitSharingReceiverApplyMapper extends CommonMapper findListVo(WxMerchantReceiverApplyVo receiver); int updateDelById(@Param("id") Long id); + + WxProfitSharingReceiverApply findOne(WxProfitSharingReceiverApply receiverApply); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java index 86dc86f00..98ea8fbae 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java @@ -5,16 +5,14 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.iformall.common.IdWorker; import com.iformall.common.ResultData; +import com.iformall.domain.po.*; import com.iformall.domain.po.base.TenantEntity; -import com.iformall.domain.po.WxBusiness; -import com.iformall.domain.po.WxPropertyContract; -import com.iformall.domain.po.WxRentContract; -import com.iformall.domain.po.WxScoreRules; import com.iformall.enums.*; import com.iformall.mapper.WxBusinessMapper; import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxRentContractMapper; import com.iformall.service.WxBusinessService; +import com.iformall.service.WxMallService; import com.iformall.utils.Constant; import com.iformall.utils.DateUtils; import org.apache.commons.collections.CollectionUtils; @@ -45,6 +43,9 @@ public class WxBusinessServiceImpl implements WxBusinessService { private WxRentContractMapper wxRentContractMapper; @Autowired private WxPropertyContractMapper wxPropertyContractMapper; + + @Autowired + private WxMallService wxMallService; @Autowired @Qualifier("scoreRuleRedisTemplate") @@ -326,23 +327,51 @@ public class WxBusinessServiceImpl implements WxBusinessService { } //删除积分规则,成长值规则缓存 - String key = Constant.SCORE_RULES_KEY_PREV + record.getFinalTenantId(); + delRulesRedis(record.getFinalTenantId()); + } + + private void delRulesRedis(String finalTenantId){ + //删除积分规则,成长值规则缓存 + String key = Constant.SCORE_RULES_KEY_PREV + finalTenantId; boolean hasKey = scoreRulesRedisTemplate.hasKey(key); if (hasKey) { scoreRulesRedisTemplate.delete(key); } - - String key1 = Constant.CREDIT_RULES_KEY_PREV + record.getFinalTenantId(); + + String key1 = Constant.CREDIT_RULES_KEY_PREV + finalTenantId; boolean hasKey1 = scoreRulesRedisTemplate.hasKey(key1); if (hasKey1) { scoreRulesRedisTemplate.delete(key1); } - - String key2 = Constant.CREDIT_DOUBLE_RULES_KEY_PREV + record.getFinalTenantId(); + + String key2 = Constant.CREDIT_DOUBLE_RULES_KEY_PREV + finalTenantId; boolean hasKey2 = scoreRulesRedisTemplate.hasKey(key2); if (hasKey2) { scoreRulesRedisTemplate.delete(key2); } - } + + TenantEntity tenantEntity = new TenantEntity(); + tenantEntity.setTenantId(finalTenantId); + List tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); + if(tenantEntitys != null && tenantEntitys.size() > 0){ + for (TenantEntity entity:tenantEntitys) { + String scorekey = Constant.SCORE_RULES_KEY_PREV + entity.getTenantId(); + if (scoreRulesRedisTemplate.hasKey(scorekey)) { + scoreRulesRedisTemplate.delete(scorekey); + } + + String creditkey = Constant.CREDIT_RULES_KEY_PREV + entity.getTenantId(); + if (scoreRulesRedisTemplate.hasKey(creditkey)) { + scoreRulesRedisTemplate.delete(creditkey); + } + + String creditDoublekey = Constant.CREDIT_DOUBLE_RULES_KEY_PREV + entity.getTenantId(); + if (scoreRulesRedisTemplate.hasKey(creditDoublekey)) { + scoreRulesRedisTemplate.delete(creditDoublekey); + } + } + } + + } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index a019ee4ee..068c6fbe3 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -144,6 +144,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { }else{ WxCouponChannel old = getById(record.getId(),record.getTenantId()); wxCoupon = wxCouponService.getById(old.getCouponId(),old.getTenantId()); + if(EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode().equals(old.getStatus()) && EnumCouponChannelStatus.STATUS_THROW_IN.getCode().equals(record.getStatus())){ if(record.getTargetAd() == null){ @@ -168,6 +169,9 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该券未提交审核或审核未通过"); } } + if(record.getCouponId() == null){ + record.setCouponId(wxCoupon.getId()); + } if(isThrowIn){ //查找是否该券 在该频道有其他上架 @@ -228,7 +232,10 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { updCC.setUpdateDate(new Date()); wxCouponChannelMapper.updateStatusByTargetAd(updCC); - spuStatusSyncByCoupon(wxCoupon,wxCoupon.getId()); + /** + * 事务原因可能导致状态不一致, 放到事务完成之后 + */ +// spuStatusSyncByCoupon(wxCoupon,wxCoupon.getId()); } /** @@ -255,7 +262,11 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { updCC.setUpdateDate(new Date()); wxCouponChannelMapper.updateStatusByTargetAd(updCC); - spuStatusSyncByCoupon(wxCoupon,wxCoupon.getId()); + /** + * + * 事务原因可能导致状态不一致, 放到事务完成之后 + */ +// spuStatusSyncByCoupon(wxCoupon,wxCoupon.getId()); } } @@ -709,12 +720,15 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { wxCouponChannel.setChannelStock(channelStock); ResultData resultData = saveOrUpdate(wxCouponChannel); WxCouponChannel channel = (WxCouponChannel)resultData.data; - vo.setId(channel.getId()); - vo.setType(channel.getType()); - vo.setSuc(true); + if(channel != null){ + vo.setId(channel.getId()); + vo.setType(channel.getType()); + vo.setSuc(true); - this.updateQrCode(channel,channel.getId(),channel.getType()); + this.updateQrCode(channel,channel.getId(),channel.getType()); + this.spuStatusSyncByCoupon(channel,channel.getCouponId()); + } return vo; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 179a25b6a..59a005a0e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -1439,13 +1439,6 @@ public class WxCouponServiceImpl implements WxCouponService { } private void spuStockSync(TenantEntity tenantEntity,Long couponId){ -// new Thread(() -> { -// //1秒之后同步poi -// try { -// Thread.currentThread().sleep(1000); -// } catch (Exception e) { -// logger.error("sleep error: " + e.getMessage()); -// } FmInsideProductPushMsg productPush = new FmInsideProductPushMsg(); productPush.setDelayTimeLevel(3); @@ -1456,18 +1449,10 @@ public class WxCouponServiceImpl implements WxCouponService { logger.info(">>>>>>>>>>>send FmInsideProductPushMsg :"+productPush); mqBaseProducer.sendMessage(productPush, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); -// }).start(); } private void spuFreeAuditSync(TenantEntity tenantEntity,Long couponId){ -// new Thread(() -> { -// //1秒之后同步poi -// try { -// Thread.currentThread().sleep(1000); -// } catch (Exception e) { -// logger.error("sleep error: " + e.getMessage()); -// } FmInsideProductPushMsg productPush = new FmInsideProductPushMsg(); productPush.setDelayTimeLevel(3); @@ -1478,8 +1463,6 @@ public class WxCouponServiceImpl implements WxCouponService { logger.info(">>>>>>>>>>>send FmInsideProductPushMsg :"+productPush); mqBaseProducer.sendMessage(productPush, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); -// }).start(); - } @Override diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java index f9500b135..9343802a6 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java @@ -265,7 +265,7 @@ public class WxMallServiceImpl implements WxMallService { return wxMallMapper.getTenantEntitys(tenantEntity); }else{ List list = new ArrayList<>(); - list.add(tenantEntity); + list.add(mall); return list; } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java index 58247d618..c01096664 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java @@ -77,7 +77,7 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR receiverApply.setMerchantId(merchantId); receiverApply.setPlat(plat.getCode()); // receiverApply.setStatus(EnumSharingReceiverApplyStatus.PROFIT_RECEIVER_APPLY_STATUS_VALID.getCode()); - return wxProfitSharingReceiverApplyMapper.selectOne(new QueryWrapper<>(receiverApply)); + return wxProfitSharingReceiverApplyMapper.findOne(receiverApply); } @Override diff --git a/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml b/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml index a277a6e10..0d69a31c3 100644 --- a/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml @@ -142,6 +142,13 @@ + +