diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserBasicInfoController.java b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserBasicInfoController.java index 6ee97355c..4ddc7b56d 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserBasicInfoController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserBasicInfoController.java @@ -202,19 +202,20 @@ public class WxCUserBasicInfoController extends BaseController { wxCUserBasicInfo.setTagId(record.getId()); } wxCUserBasicInfoService.update(wxCUserBasicInfo); + wxCUserBasicInfo.updateTenantInfo(oldInfo); wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, wxCUserBasicInfo); return new ResultData(); } - @ApiOperation("根据id删除接口") - @GetMapping("/del") - @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) - @SystemControllerLog(description = "会员管理-删除") - public ResultData delete(Long id) { - logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::delete"); - wxCUserBasicInfoService.deleteById(id); - return new ResultData(Result.SUCCESS, "删除成功", null); - } +// @ApiOperation("根据id删除接口") +// @GetMapping("/del") +// @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) +// @SystemControllerLog(description = "会员管理-删除") +// public ResultData delete(Long id) { +// logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::delete"); +// wxCUserBasicInfoService.deleteById(id); +// return new ResultData(Result.SUCCESS, "删除成功", null); +// } @ApiOperation("根据id查询接口") @GetMapping("/findById") diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java index 730500817..89a97f7c1 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java @@ -85,7 +85,7 @@ public class WxCreditHistoryController extends BaseController { wxCreditHistory.updateTenantInfo(user); wxCreditHistory.setOperatorId(user.getId()); try { - wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId()) ; + wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),wxCreditHistory) ; WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); return new ResultData(Result.SUCCESS, "操作成功", credit); } catch (MallinkException e) { diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java index 53a84226b..625d5c380 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java @@ -119,12 +119,12 @@ public class WxCreditHistoryController extends BaseController { //B端操作用户 wxCreditHistory.setOperatorType(EnumUserType.BUSER.getCode()); try { - wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId()); + wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),wxCreditHistory); wxCreditHistory.setBuserId(getBuser().getId()); WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); //更新标签 if (wxCreditHistory.getTags() != null && !wxCreditHistory.getTags().isEmpty()) { - wxCUserTagsService.updateTagByUserId(wxCreditHistory.getCUserId(), wxCreditHistory.getTags()); + wxCUserTagsService.updateTagByUserId(wxCreditHistory.getCUserId(),wxCreditHistory, wxCreditHistory.getTags()); } return new ResultData(Result.SUCCESS, "操作成功", credit); } catch (MallinkException e) { diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java index f50a04cdf..b1e85d3d8 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java @@ -300,7 +300,7 @@ public class WxCouponOrderController extends BaseController { } catch (Exception e) { return new ResultData(Result.ERROR,e.getMessage()); } - return wxCouponOrderService.cardDetailCUserVo(memberId, couponOrderId); + return wxCouponOrderService.cardDetailCUserVo(memberId,getTenantInfo(), couponOrderId); } @ApiOperation(value = "卡转赠领取") diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java index 158762ef4..09ff7cf57 100755 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java @@ -964,6 +964,7 @@ public class WxUserGrantController extends BaseController { record.setSex(wxCUserBasicInfo.getSex()); record.setAddress(wxCUserBasicInfo.getAddress()); record.setUpdateDate(new Date()); + record.updateTenantInfo(wxCUserBasicInfo); wxCUserBasicInfoService.update(record); wxScoreRulesService.addScore(tenantEntity,EnumScoreType.COMPLETE_INFO, record); //增加积分 diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java index 04117c30e..d48109237 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java @@ -191,7 +191,7 @@ public class CouponSendSchedule { // 发放免费券 try { - WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(), cs.getTenantId(),cs.getCouponId(), null,EnumPayWay.PAY_WAY_NOT_UNPAY_SYSTEM_SEND); + WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(), cs,cs.getCouponId(), null,EnumPayWay.PAY_WAY_NOT_UNPAY_SYSTEM_SEND); wxCouponActionLogService.addOne(tenantEntity, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); } catch (Exception e) { logger.error("定时发券:发券失败 levelId=" + l.getId() + " couponId=" + cs.getCouponId() + " userId=" + cu.getId() + e.getMessage()); @@ -321,7 +321,7 @@ public class CouponSendSchedule { for (WxCUserBasicInfo cu : newUserList) { // 发放生日券 try { - WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(),cs.getTenantId(), cs.getCouponId(), null,EnumPayWay.PAY_WAY_NOT_UNPAY_SYSTEM_SEND); + WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(),cs, cs.getCouponId(), null,EnumPayWay.PAY_WAY_NOT_UNPAY_SYSTEM_SEND); wxCouponActionLogService.addOne(tenantEntity, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); couponSendedUsers.add(cu); } catch (Exception e) { diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/OrderExpiringSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/OrderExpiringSchedule.java index c5fd706de..e921ae31e 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/OrderExpiringSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/OrderExpiringSchedule.java @@ -244,7 +244,7 @@ public class OrderExpiringSchedule { if (null == wxpayOrder) { return false; } - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(wxpayOrder.getCUserId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(wxpayOrder.getCUserId(),wxpayOrder.getFinalTenantId()); //找不到用户,问题单,不能删 if (null == user) { return true; diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java index 452f410f7..6d1b5d274 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java @@ -81,7 +81,7 @@ public interface WxCUserBasicInfoService { * * @param id */ - void deleteById(Long id); + //void deleteById(Long id); List findByPhone(TenantEntity tenantEntity, String phone); WxCUserBasicInfo findInfoByPhone(TenantEntity tenantEntity, String phone); diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserTagsService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserTagsService.java index 7b950ef7e..452384012 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCUserTagsService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserTagsService.java @@ -50,6 +50,6 @@ public interface WxCUserTagsService { List assignTags(List tagIdList, WxCUserBasicInfo user); List triggerAssignTags(EnumAssignTagsTrigger trigger, Object obj); - void updateTagByUserId(Long cUserId, List tags); + void updateTagByUserId(Long cUserId,TenantEntity tenantinfo, List tags); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java index c86cb414f..728abc977 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java @@ -193,7 +193,7 @@ public interface WxCouponOrderService { * * @param ownerId C端用户 */ - ResultData cardDetailCUserVo(Long ownerId, String couponOrderId); + ResultData cardDetailCUserVo(Long ownerId, TenantEntity tenantinfo,String couponOrderId); ResultData cardAccept(WxCouponOrder wxCouponOrder); diff --git a/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java b/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java index d53f182f6..e1bb2e4cc 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java @@ -45,7 +45,7 @@ public interface WxCreditHistoryService { * 规则:有手机号增加积分,无手机号提示授权手机号 * @param cUserId */ - void creditUsercheck(Long cUserId); + void creditUsercheck(Long cUserId,TenantEntity tenantinfo); /** * 保存或更新实体 diff --git a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java index 7e16178d5..41b5481dd 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java @@ -86,7 +86,7 @@ public interface WxOrderService { * @param wxCouponSendVo 商户注券时必须指定 * @return WxCouponOrder */ - WxCouponOrder sendFreeCouponToUser(Long userId, String tenantId,Long couponId, WxCouponSendVo wxCouponSendVo,EnumPayWay payWay); + WxCouponOrder sendFreeCouponToUser(Long userId,TenantEntity tenantinfo,Long couponId, WxCouponSendVo wxCouponSendVo,EnumPayWay payWay); /** * orderSuccess 订单已支付 diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java index f0dc9e0bd..40bc23d1e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java @@ -173,7 +173,7 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { if (count > 0) { return new ResultData(ErrorCode.ACTIVITY_JOINED); } - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(wxActivityJoin.getUserId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(wxActivityJoin.getUserId(),wxActivityJoin.getFinalTenantId()); //查询是否消耗积分 WxActivity wxActivity = wxActivityMapper.selectById(wxActivityJoin.getActivityId()); Date date = new Date(); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java index 025fc70ff..7f22c015e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java @@ -659,10 +659,10 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc // wxCUserBasicInfoMapper.updateNewId(userBaseVo); } - @Override - public void deleteById(Long id) { - wxCUserBasicInfoMapper.deleteById(id); - } +// @Override +// public void deleteById(Long id) { +// wxCUserBasicInfoMapper.deleteById(id); +// } @Override public long findCountBySex(WxCUserBasicInfoDto dto) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java index 5d5c1665f..a95279b23 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java @@ -610,7 +610,7 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { switch (trigger) { case ASSIGN_TAGS_TRIGGER_IMPORT: { WxCUserBasicInfo param = (WxCUserBasicInfo) obj; - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(param.getId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(param.getId(),param.getFinalTenantId()); if (user != null) { if (param.getSex() != null) { //性别 @@ -638,8 +638,8 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { } break; case ASSIGN_TAGS_TRIGGER_CAR:{ - Long param = (Long) obj; - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(param); + WxCUserCar userCar = (WxCUserCar) obj; + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(userCar.getCUserId(),userCar.getFinalTenantId()); if (user != null) { //车 resList = assignTypeId11(user); @@ -648,7 +648,7 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { break; case ASSIGN_TAGS_TRIGGER_PHONE: { WxCUser param = (WxCUser) obj; - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(param.getUserId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(param.getUserId(),param.getFinalTenantId()); if (user != null) { if (param.getPhone() != null) { //来源 @@ -678,7 +678,7 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { case ASSIGN_TAGS_TRIGGER_LOGIN: { WxCUser param = (WxCUser) obj; - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(param.getUserId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(param.getUserId(),param.getFinalTenantId()); if (user != null) { if (param.getGender() != null) { //性别 @@ -757,8 +757,8 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { } @Override - public void updateTagByUserId(Long cUserId, List tags) { - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); + public void updateTagByUserId(Long cUserId,TenantEntity tenantinfo, List tags) { + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId,tenantinfo.getFinalTenantId()); WxCUserTags userTags = null; if (wxCUserBasicInfo.getTagId() != null) { userTags = getById(wxCUserBasicInfo.getTagId()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponInjectServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponInjectServiceImpl.java index 2f1dff1ce..0a8508c5d 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponInjectServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponInjectServiceImpl.java @@ -274,7 +274,7 @@ public class WxCouponInjectServiceImpl implements WxCouponInjectService { // 发放免费券 WxCouponOrder couponOrder = null; try { - couponOrder = wxOrderService.sendFreeCouponToUser(tempCUser.getId(),wxCoupon.getTenantId(), wxCoupon.getId(),null,EnumPayWay.PAY_WAY_NOT_UNPAY_BATCH_SEND); + couponOrder = wxOrderService.sendFreeCouponToUser(tempCUser.getId(),wxCoupon, wxCoupon.getId(),null,EnumPayWay.PAY_WAY_NOT_UNPAY_BATCH_SEND); if (couponOrder != null) { wxCouponActionLogService.addOne(couponOrder, wxCoupon.getId(), couponOrder.getId(), EnumCouponSendSendType.INJECT.getCode(), couponInjectId); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java index b71bad4b8..b482daa5a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java @@ -1032,8 +1032,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { } @Override - public ResultData cardDetailCUserVo(Long ownerId, String couponOrderId) { - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(ownerId); + public ResultData cardDetailCUserVo(Long ownerId, TenantEntity tenantinfo, String couponOrderId) { + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(ownerId,tenantinfo.getFinalTenantId()); if (wxCUserBasicInfo == null) { logger.error("用户不存在:" + ownerId); throw new MallinkException(ErrorCode.USER_IS_EMPTY); @@ -1064,7 +1064,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { //转赠人是否存在 Long cUserId = record.getCUserId(); - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId,cardCVo.getFinalTenantId()); if (wxCUserBasicInfo == null) { logger.info("转赠人不存在:" + cUserId); return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(), "转赠人不存在"); @@ -1117,7 +1117,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { } //转赠人是否存在 Long cUserId = record.getCUserId(); - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId,cardCVo.getFinalTenantId()); if (wxCUserBasicInfo == null) { logger.info("转赠人不存在:" + cUserId); return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(), "转赠人不存在"); @@ -1470,7 +1470,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { int num = wxCouponOrderMapper.updateById(updateCouponOrder); if (num == 1) { WxCouponOrder couponOrder = wxCouponOrderMapper.selectById(couponOrderId); - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(couponOrder.getcUserId()); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(couponOrder.getcUserId(),couponOrder.getFinalTenantId()); WxCoupon coupon = wxCouponMapper.selectById(couponOrder.getCouponId(),couponOrder.getTenantId()); doAfterVerify(couponOrder, coupon, wxCUserBasicInfo); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java index cf4ebb2cb..5d0f4fd60 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java @@ -313,7 +313,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { return false; } - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId,tenantEntity.getFinalTenantId()); if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { logger.info("会员权益被锁定:cUserId:" + cUserId); return false; @@ -369,7 +369,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { // 发放免费券 WxCouponOrder couponOrder = null; try { - couponOrder = wxOrderService.sendFreeCouponToUser(cUserId,send.getTenantId(), send.getCouponId(), null,payWay); + couponOrder = wxOrderService.sendFreeCouponToUser(cUserId,send, send.getCouponId(), null,payWay); if (couponOrder != null) { bRet = true; @@ -628,7 +628,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) public void handSel(WxCouponSend wxCouponSend, Long cUserId,EnumPayWay payWay) { - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId,wxCouponSend.getFinalTenantId()); if (Objects.isNull(wxCUserBasicInfo)) { throw new MallinkException(ErrorCode.USER_NOT_AUTH_PHONE); } @@ -639,7 +639,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { } couponSendList.forEach(cs -> { // 发放免费券 - WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cUserId,cs.getTenantId(), cs.getCouponId(), cs,payWay); + WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cUserId,cs, cs.getCouponId(), cs,payWay); if (couponOrder != null) { wxCouponActionLogService.addOne(couponOrder, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); sendMsgForSendCoupon(couponOrder, cs, couponOrder, wxCUserBasicInfo); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java index 0e66ffab3..931c3d927 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java @@ -191,15 +191,15 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { } @Override - public void creditUsercheck(Long cUserId) { - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); + public void creditUsercheck(Long cUserId,TenantEntity tenantinfo) { + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId,tenantinfo.getFinalTenantId()); UserUtil.creditUserCheck(wxCUserBasicInfo); } @Override @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) public WxCreditHistory saveOrUpdate(WxCreditHistory record) { - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(record.getCUserId()); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(record.getCUserId(),record.getFinalTenantId()); if (wxCUserBasicInfo == null) { //验证此用户是否存在 throw new MallinkException(ErrorCode.USER_NOT_AUTH_PHONE); @@ -296,7 +296,7 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { return 0; } // 2. user - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(record.getCUserId()); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(record.getCUserId(),record.getFinalTenantId()); if (wxCUserBasicInfo != null) { WxCUserBasicInfo wxCUserBasicInfoNew = new WxCUserBasicInfo(); wxCUserBasicInfoNew.setId(wxCUserBasicInfo.getId()); @@ -326,7 +326,7 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { wxCreditHistory.setSpend(new BigDecimal(spendStr).multiply(new BigDecimal(100)).intValue()); credit = payAddCredit(wxCreditHistory); if (Objects.nonNull(userId)) { - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId,tenantEntity.getFinalTenantId()); creditNew = CreditUtil.calUserCredit(tenantEntity,credit, wxCUserBasicInfo, wxScoreRulesService,wxLevelConfigMapper); } else { creditNew = credit; @@ -423,7 +423,7 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { } private int infoAddCredit(WxCreditHistory record) { - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(record.getCUserId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(record.getCUserId(),record.getFinalTenantId()); if (user == null || checkCompleteInfoScoreCount(record,user) > 0) return 0; // 1. 获取score rules diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java index 3049842ce..280ffe70b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java @@ -335,7 +335,7 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { if (!orderList.isEmpty()) { List userList = new ArrayList<>(); for (WxOrder order : orderList) { - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(order.getCUserId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(order.getCUserId(),order.getFinalTenantId()); if (user != null) { userList.add(user); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java index 1f436e79a..f9f527b4b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -1235,11 +1235,11 @@ public class WxOrderServiceImpl implements WxOrderService { @Override @Transactional(propagation = Propagation.NESTED, readOnly = false, rollbackFor = {Exception.class}) - public WxCouponOrder sendFreeCouponToUser(Long userId,String tenantId, Long couponId, WxCouponSendVo wxCouponSendVo,EnumPayWay payWay) { + public WxCouponOrder sendFreeCouponToUser(Long userId,TenantEntity tenantinfo, Long couponId, WxCouponSendVo wxCouponSendVo,EnumPayWay payWay) { // check 用户状态 WxCUserBasicInfo user = null; try { - user = wxCUserBasicInfoMapper.selectById(userId); + user = wxCUserBasicInfoMapper.selectById(userId,tenantinfo.getFinalTenantId()); } catch (Exception e) { logger.error("userId : " + userId + ", e: " + e.getMessage()); } @@ -1250,7 +1250,7 @@ public class WxOrderServiceImpl implements WxOrderService { // 检查券状态 String couponIdStr = String.valueOf(couponId); - WxCoupon coupon = wxCouponMapper.selectById(couponId,tenantId); + WxCoupon coupon = wxCouponMapper.selectById(couponId,tenantinfo.getTenantId()); if (coupon == null) { logger.error("券不存在, couponId: " + couponIdStr); throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); @@ -1336,7 +1336,7 @@ public class WxOrderServiceImpl implements WxOrderService { throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); } // 检查用户 - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(updateOrder.getCUserId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(updateOrder.getCUserId(),updateOrder.getFinalTenantId()); if (user == null) { logger.error("用户不存在, userId: " + updateOrder.getCUserId()); throw new MallinkException(ErrorCode.USER_IS_EMPTY); @@ -1397,7 +1397,7 @@ public class WxOrderServiceImpl implements WxOrderService { // throw new MallinkException(ErrorCode.COUPON_IS_TAKE_OFF); // } // 检查用户 - WxCUserBasicInfo basicUser = wxCUserBasicInfoMapper.selectById(updateOrder.getCUserId()); + WxCUserBasicInfo basicUser = wxCUserBasicInfoMapper.selectById(updateOrder.getCUserId(),updateOrder.getFinalTenantId()); if (basicUser == null) { logger.error("会员不存在, userId: " + updateOrder.getCUserId()); throw new MallinkException(ErrorCode.USER_IS_EMPTY); @@ -1496,7 +1496,7 @@ public class WxOrderServiceImpl implements WxOrderService { public int microPayOrderSuccess(WxOrder updateOrder) { Date currentDate = new Date(); // C端用户 - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(updateOrder.getCUserId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(updateOrder.getCUserId(),updateOrder.getFinalTenantId()); if (user == null) { logger.error("用户不存在, userId: " + updateOrder.getCUserId()); throw new MallinkException(ErrorCode.USER_IS_EMPTY); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java index 7f8d00eca..a5b29a921 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java @@ -881,7 +881,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { }else { //扫码支付的会员固定 basicUserId = Long.parseLong(record.getTenantId()+"0001"); - WxCUserBasicInfo basicInfo = wxCUserBasicInfoMapper.selectById(basicUserId); + WxCUserBasicInfo basicInfo = wxCUserBasicInfoMapper.selectById(basicUserId,record.getFinalTenantId()); if (null == basicInfo) { basicInfo = new WxCUserBasicInfo(); basicInfo.setId(basicUserId); @@ -1096,7 +1096,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); } if (order.getType().equals(EnumOrderType.COUPON.getCode())) { - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(order.getCUserId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(order.getCUserId(),order.getFinalTenantId()); if (user == null) { logger.error("pay handle, order " + record.getOrderId() + " not found , payOrderid : " + record.getPayOrderNo()); throw new MallinkException(ErrorCode.USER_IS_EMPTY); @@ -1190,7 +1190,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); } if (order.getType().equals(EnumOrderType.COUPON.getCode())) { - WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(order.getCUserId()); + WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(order.getCUserId(),order.getFinalTenantId()); if (user == null) { logger.error("pay handle, order " + record.getOrderId() + " not found , payOrderid : " + record.getPayOrderNo()); throw new MallinkException(ErrorCode.USER_IS_EMPTY); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java index f288eb247..f0ec34236 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java @@ -283,7 +283,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { return 0; } // 2. user score back - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(record.getCUserId()); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(record.getCUserId(),record.getFinalTenantId()); if (wxCUserBasicInfo != null) { WxCUserBasicInfo wxCUserBasicInfoNew = new WxCUserBasicInfo(); wxCUserBasicInfoNew.setId(wxCUserBasicInfo.getId()); @@ -294,8 +294,8 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { return num; } - private void updateScore(Long userId, int addedScoreNumber) { - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId); + private void updateScore(Long userId, TenantEntity tenantinfo, int addedScoreNumber) { + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId,tenantinfo.getFinalTenantId()); if (wxCUserBasicInfo.getPoins() == null) { wxCUserBasicInfo.setPoins(0); } @@ -325,7 +325,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { // 2. 增长的成长值 addScoreNumber = scoreRules.getRule(EnumScoreType.LOGIN,WxScoreRules.SCORE); - updateScore(user.getId(), addScoreNumber); + updateScore(user.getId(), tenantEntity,addScoreNumber); // 3. 记录历史 recordScoreHistory(addScoreNumber, tenantEntity, user.getId(), EnumScoreType.LOGIN); @@ -383,7 +383,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { // 5. 增长的成长值 - updateScore(order.getCUserId(), addScoreNumber); + updateScore(order.getCUserId(),order, addScoreNumber); // 6. 记录历史 recordPayScoreHistory(addScoreNumber, order, EnumScoreType.CONSUMPTION); @@ -401,7 +401,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { addScoreNumber = scoreRules.getRule(EnumScoreType.BIND_CAR,WxScoreRules.SCORE); // 3. 增长的成长值 - updateScore(user.getId(), addScoreNumber); + updateScore(user.getId(),tenantEntity, addScoreNumber); // 4. 记录历史 recordScoreHistory(addScoreNumber, tenantEntity, user.getId(), EnumScoreType.BIND_CAR); @@ -417,7 +417,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { addScoreNumber = scoreRules.getRule(EnumScoreType.WECHAT_PERSION,WxScoreRules.SCORE); // 3. 增长的成长值 - updateScore(user.getId(), addScoreNumber); + updateScore(user.getId(),tenantEntity, addScoreNumber); // 4. 记录历史 recordScoreHistory(addScoreNumber, tenantEntity, user.getId(), EnumScoreType.WECHAT_PERSION); @@ -433,7 +433,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { addScoreNumber = scoreRules.getRule(EnumScoreType.WECHAT_PHONE,WxScoreRules.SCORE); // 3. 增长的成长值 - updateScore(user.getId(), addScoreNumber); + updateScore(user.getId(),tenantEntity, addScoreNumber); // 4. 记录历史 recordScoreHistory(addScoreNumber, tenantEntity, user.getId(), EnumScoreType.WECHAT_PHONE); @@ -459,7 +459,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { addScoreNumber = scoreRules.getRule(EnumScoreType.COMPLETE_INFO,WxScoreRules.SCORE); // 3. 增长的成长值 - updateScore(user.getId(), addScoreNumber); + updateScore(user.getId(),tenantEntity, addScoreNumber); // 4. 记录历史 recordScoreHistory(addScoreNumber, tenantEntity, user.getId(), EnumScoreType.COMPLETE_INFO); @@ -571,7 +571,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { logger.info("暂未成为会员:cUserId" + userId); return 0; } - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId,tenantEntity.getFinalTenantId()); if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { logger.info("会员权益被锁定:cUserId:" + userId); return 0; @@ -614,7 +614,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { userId = user.getId(); } - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId,tenantEntity.getFinalTenantId()); if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { logger.info("会员权益被锁定:cUserId:" + userId); return 0; diff --git a/mallinkService/src/main/java/com/iformall/service/park/impl/util/ParkHelper.java b/mallinkService/src/main/java/com/iformall/service/park/impl/util/ParkHelper.java index 0e4cc0222..0f35013df 100644 --- a/mallinkService/src/main/java/com/iformall/service/park/impl/util/ParkHelper.java +++ b/mallinkService/src/main/java/com/iformall/service/park/impl/util/ParkHelper.java @@ -73,7 +73,7 @@ public class ParkHelper { wxScoreRulesService.addScore(userCar,EnumScoreType.BIND_CAR, userCar); //增加积分 addCredit(park, cuUserId); - wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_CAR,cuUserId); + wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_CAR,userCar); } //-----增加积分start----- diff --git a/mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java b/mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java index f932ab471..9d301010d 100644 --- a/mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java +++ b/mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java @@ -190,7 +190,7 @@ public class DataInitController extends BaseController { log.debug(" : {}", ret.getId()); return; } - WxCUserBasicInfo userBasicInfo = cUserBasicInfoMapper.selectById(co.getcUserId()); + WxCUserBasicInfo userBasicInfo = cUserBasicInfoMapper.selectById(co.getcUserId(),co.getFinalTenantId()); //排查不存在的用户 if (Objects.isNull(userBasicInfo)) { log.debug("用户不存在 id: {}", co.getId());