| @@ -248,7 +248,7 @@ public class WxCUserController extends BaseController { | |||||
| wxCreditHistory.setFinalTenantId(wxCUserBasicInfo.getFinalTenantId()); | wxCreditHistory.setFinalTenantId(wxCUserBasicInfo.getFinalTenantId()); | ||||
| wxCreditHistory.setCreateDate(new Date()); | wxCreditHistory.setCreateDate(new Date()); | ||||
| wxCreditHistory.setCreditType(enumScoreType.getCode()); | wxCreditHistory.setCreditType(enumScoreType.getCode()); | ||||
| wxCreditHistory.setChangePurpose("B端("+wxMerchant.getName()+")("+bUser.getPhone()+")操作完善个人信息"); | |||||
| wxCreditHistory.setChangePurpose("B端("+wxMerchant.getName()+")("+bUser.getName()+")操作完善个人信息"); | |||||
| wxCreditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | wxCreditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | ||||
| wxCreditHistory.setOperatorId(bUser.getId()); | wxCreditHistory.setOperatorId(bUser.getId()); | ||||
| wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | ||||
| @@ -111,17 +111,17 @@ public class WxCreditHistoryController extends BaseController { | |||||
| //消费积分:取当前人的商户ID | //消费积分:取当前人的商户ID | ||||
| if (wxCreditHistory.getCreditType() == EnumScoreType.REDUCE_CREDIT.getCode()) { | if (wxCreditHistory.getCreditType() == EnumScoreType.REDUCE_CREDIT.getCode()) { | ||||
| wxCreditHistory.setMerchantId(getLoginBUser().getMerchantId()); | wxCreditHistory.setMerchantId(getLoginBUser().getMerchantId()); | ||||
| wxCreditHistory.setChangePurpose("B端("+wxMerchant.getName()+")("+getLoginBUser().getPhone()+")消费"+wxCreditHistory.getSpendStr()); | |||||
| wxCreditHistory.setChangePurpose("B端("+wxMerchant.getName()+")("+getLoginBUser().getName()+")消费"+wxCreditHistory.getSpendStr()); | |||||
| } else { | } else { | ||||
| //新增积分: | //新增积分: | ||||
| //如果为商管商户 则消费商户按前端传入的进行记录 | //如果为商管商户 则消费商户按前端传入的进行记录 | ||||
| if (merchant != null && merchant.getIsAdmin() != null && merchant.getIsAdmin() == 1) { | if (merchant != null && merchant.getIsAdmin() != null && merchant.getIsAdmin() == 1) { | ||||
| wxCreditHistory.setMerchantId(wxCreditHistory.getMerchantId()); | wxCreditHistory.setMerchantId(wxCreditHistory.getMerchantId()); | ||||
| WxMerchant byId = wxMerchantService.getById(wxCreditHistory.getMerchantId()); | WxMerchant byId = wxMerchantService.getById(wxCreditHistory.getMerchantId()); | ||||
| wxCreditHistory.setChangePurpose("B端商管商户给("+byId.getName()+")("+getLoginBUser().getPhone()+")新增积分"); | |||||
| wxCreditHistory.setChangePurpose("B端商管商户给("+byId.getName()+")("+getLoginBUser().getName()+")新增积分"); | |||||
| } else { | } else { | ||||
| wxCreditHistory.setMerchantId(getLoginBUser().getMerchantId()); | wxCreditHistory.setMerchantId(getLoginBUser().getMerchantId()); | ||||
| wxCreditHistory.setChangePurpose("B端("+merchant.getName()+")("+getLoginBUser().getPhone()+")新增积分"); | |||||
| wxCreditHistory.setChangePurpose("B端("+merchant.getName()+")("+getLoginBUser().getName()+")新增积分"); | |||||
| } | } | ||||
| } | } | ||||
| //B端操作用户 | //B端操作用户 | ||||
| @@ -58,6 +58,7 @@ public class PosServiceImpl implements PosService { | |||||
| private final WxCouponOrderMapper couponOrderMapper; | private final WxCouponOrderMapper couponOrderMapper; | ||||
| private final WxCouponMerchantMapper couponMerchantMapper; | private final WxCouponMerchantMapper couponMerchantMapper; | ||||
| private final WxCouponMapper couponMapper; | private final WxCouponMapper couponMapper; | ||||
| private final WxMerchantMapper merchantMapper; | |||||
| /** | /** | ||||
| @@ -1357,12 +1358,12 @@ public class PosServiceImpl implements PosService { | |||||
| logger.info("核销已完成: " + couponOrderCVo.getId()); | logger.info("核销已完成: " + couponOrderCVo.getId()); | ||||
| } | } | ||||
| private int posAddCredit(WxCouponOrderCVo couponOrderCVo, WxCoupon coupon, Long merchantId, Long buUserId) { | |||||
| private int posAddCredit(WxCouponOrderCVo couponOrderCVo, WxCoupon coupon, WxMerchantBUser merchantBUser, WxMerchant wxMerchant) { | |||||
| try { | try { | ||||
| //-------此处为【现金支付】记录增加积分操作------- | //-------此处为【现金支付】记录增加积分操作------- | ||||
| WxCreditHistory creditHistory = new WxCreditHistory(); | WxCreditHistory creditHistory = new WxCreditHistory(); | ||||
| creditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | creditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | ||||
| creditHistory.setOperatorId(buUserId); | |||||
| creditHistory.setOperatorId(merchantBUser.getId()); | |||||
| creditHistory.setCUserId(couponOrderCVo.getcUserId()); | creditHistory.setCUserId(couponOrderCVo.getcUserId()); | ||||
| creditHistory.setCreateDate(new Date()); | creditHistory.setCreateDate(new Date()); | ||||
| // creditHistory.updateTenantInfo(couponOrderCVo); | // creditHistory.updateTenantInfo(couponOrderCVo); | ||||
| @@ -1373,7 +1374,8 @@ public class PosServiceImpl implements PosService { | |||||
| creditHistory.setBusinessId(coupon.getBusiness()); | creditHistory.setBusinessId(coupon.getBusiness()); | ||||
| creditHistory.setSpend(couponOrderCVo.getCouponPrice()); | creditHistory.setSpend(couponOrderCVo.getCouponPrice()); | ||||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | ||||
| creditHistory.setMerchantId(merchantId); | |||||
| creditHistory.setMerchantId(wxMerchant.getId()); | |||||
| creditHistory.setChangePurpose("pos消费 店铺("+wxMerchant.getName()+")卷("+coupon.getTitle()+")"); | |||||
| creditHistory = creditHistoryService.saveOrUpdate(creditHistory); | creditHistory = creditHistoryService.saveOrUpdate(creditHistory); | ||||
| if (creditHistory.getCreditNum() != null) { | if (creditHistory.getCreditNum() != null) { | ||||
| return creditHistory.getCreditNum(); | return creditHistory.getCreditNum(); | ||||
| @@ -1402,6 +1404,7 @@ public class PosServiceImpl implements PosService { | |||||
| creditHistory.setSpend(payment); | creditHistory.setSpend(payment); | ||||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | ||||
| creditHistory.setMerchantId(merchant.getId()); | creditHistory.setMerchantId(merchant.getId()); | ||||
| creditHistory.setChangePurpose("pos消费 店铺("+merchant.getName()+")消费("+creditHistory.getSpendStr()+")"); | |||||
| creditHistory = creditHistoryService.saveOrUpdate(creditHistory); | creditHistory = creditHistoryService.saveOrUpdate(creditHistory); | ||||
| if (creditHistory.getCreditNum() != null) { | if (creditHistory.getCreditNum() != null) { | ||||
| return creditHistory.getCreditNum(); | return creditHistory.getCreditNum(); | ||||
| @@ -2201,7 +2204,8 @@ public class PosServiceImpl implements PosService { | |||||
| // 4. 积分 | // 4. 积分 | ||||
| try { | try { | ||||
| int credit = posAddCredit(couponOrderCVo, wxCoupon, merchantBUser.getMerchantId(), merchantBUser.getId()); | |||||
| WxMerchant wxMerchant = merchantMapper.selectById(merchantBUser.getMerchantId()); | |||||
| int credit = posAddCredit(couponOrderCVo, wxCoupon, merchantBUser, wxMerchant); | |||||
| scoreCreditCalc.setCredit(scoreCreditCalc.getCredit() + credit); | scoreCreditCalc.setCredit(scoreCreditCalc.getCredit() + credit); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("交易核销积分异常:" + e.getMessage()); | logger.error("交易核销积分异常:" + e.getMessage()); | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.base.TenantEntity; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import java.math.BigDecimal; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -78,4 +79,10 @@ public class WxCreditHistory extends BaseTenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "标签", name = "tags") | @io.swagger.annotations.ApiModelProperty(value = "标签", name = "tags") | ||||
| private List<Long> tags; | private List<Long> tags; | ||||
| public String getSpendStr() { | |||||
| if(getSpend()!=null) { | |||||
| spendStr = new BigDecimal(getSpend()).divide(new BigDecimal(100)).toString(); | |||||
| } | |||||
| return spendStr; | |||||
| } | |||||
| } | } | ||||
| @@ -187,6 +187,7 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { | |||||
| wxCreditHistory.setCUserId(wxActivityJoin.getUserId()); | wxCreditHistory.setCUserId(wxActivityJoin.getUserId()); | ||||
| wxCreditHistory.setCreditNum(credit); | wxCreditHistory.setCreditNum(credit); | ||||
| wxCreditHistory.setCreditType(EnumScoreType.ACTIVITY_JOIN.getCode()); | wxCreditHistory.setCreditType(EnumScoreType.ACTIVITY_JOIN.getCode()); | ||||
| wxCreditHistory.setChangePurpose(EnumScoreType.ACTIVITY_JOIN.getMessage()+"("+wxActivity.getTitle()+")"); | |||||
| wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); | wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); | ||||
| wxCreditHistory.setOperatorId(wxActivityJoin.getUserId()); | wxCreditHistory.setOperatorId(wxActivityJoin.getUserId()); | ||||
| wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | ||||
| @@ -1101,6 +1101,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
| wxCreditHistory.setOperatorType(EnumUserType.MALLUSER.getCode()); | wxCreditHistory.setOperatorType(EnumUserType.MALLUSER.getCode()); | ||||
| } | } | ||||
| wxCreditHistory.setCreditType(EnumScoreType.MEM_IMPORT.getCode()); | wxCreditHistory.setCreditType(EnumScoreType.MEM_IMPORT.getCode()); | ||||
| wxCreditHistory.setChangePurpose(EnumScoreType.MEM_IMPORT.getMessage()+"("+mallUserInfo.getUsername()+")"); | |||||
| if (oldUserBase != null) { | if (oldUserBase != null) { | ||||
| wxCreditHistory.setCUserId(oldUserBase.getId()); | wxCreditHistory.setCUserId(oldUserBase.getId()); | ||||
| } else { | } else { | ||||
| @@ -346,6 +346,7 @@ public class WxCUserServiceImpl implements WxCUserService { | |||||
| wxCreditHistory.setFinalTenantId(user.getFinalTenantId()); | wxCreditHistory.setFinalTenantId(user.getFinalTenantId()); | ||||
| wxCreditHistory.setCreateDate(new Date()); | wxCreditHistory.setCreateDate(new Date()); | ||||
| wxCreditHistory.setCreditType(enumScoreType.getCode()); | wxCreditHistory.setCreditType(enumScoreType.getCode()); | ||||
| wxCreditHistory.setChangePurpose(enumScoreType.getMessage()); | |||||
| wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); | wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); | ||||
| wxCreditHistory.setOperatorId(user.getUserId()); | wxCreditHistory.setOperatorId(user.getUserId()); | ||||
| // wxCreditHistory.setCreditNum(user.getCredit()); | // wxCreditHistory.setCreditNum(user.getCredit()); | ||||
| @@ -310,6 +310,8 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| creditHistory.setSpend(real_payment); | creditHistory.setSpend(real_payment); | ||||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | ||||
| creditHistory.setMerchantId(record.getMerchantId()); | creditHistory.setMerchantId(record.getMerchantId()); | ||||
| WxMerchant wxMerchant = wxMerchantMapper.selectById(record.getMerchantId()); | |||||
| creditHistory.setChangePurpose("卡消费("+wxMerchant.getName()+")消费"+creditHistory.getSpendStr()); | |||||
| wxCreditHistoryService.saveOrUpdate(creditHistory); | wxCreditHistoryService.saveOrUpdate(creditHistory); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("积分值:" + e.getMessage()); | logger.error("积分值:" + e.getMessage()); | ||||
| @@ -931,6 +933,8 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| creditHistory.setSpend(record.getRealPayment()); | creditHistory.setSpend(record.getRealPayment()); | ||||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | ||||
| creditHistory.setMerchantId(record.getMerchantId()); | creditHistory.setMerchantId(record.getMerchantId()); | ||||
| // WxMerchant wxMerchant = wxMerchantMapper.selectById(record.getMerchantId()); | |||||
| creditHistory.setChangePurpose("pos卡消费("+merchant.getName()+")消费"+creditHistory.getSpendStr()); | |||||
| creditHistory = wxCreditHistoryService.saveOrUpdate(creditHistory); | creditHistory = wxCreditHistoryService.saveOrUpdate(creditHistory); | ||||
| if (creditHistory != null) { | if (creditHistory != null) { | ||||
| scoreCreditCalc.setCredit(scoreCreditCalc.getCredit() + creditHistory.getCreditNum()); | scoreCreditCalc.setCredit(scoreCreditCalc.getCredit() + creditHistory.getCreditNum()); | ||||
| @@ -465,6 +465,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | ||||
| creditHistory.setMerchantId(bUser.getMerchantId()); | creditHistory.setMerchantId(bUser.getMerchantId()); | ||||
| creditHistory.setBuserId(bUser.getBuserId()); | creditHistory.setBuserId(bUser.getBuserId()); | ||||
| WxMerchant wxMerchant = wxMerchantMapper.selectById(bUser.getMerchantId()); | |||||
| creditHistory.setChangePurpose("("+wxMerchant.getName()+")核销("+wxCoupon.getTitle()+")"); | |||||
| wxCreditHistoryService.saveOrUpdate(creditHistory); | wxCreditHistoryService.saveOrUpdate(creditHistory); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("积分值:" + e.getMessage()); | logger.error("积分值:" + e.getMessage()); | ||||
| @@ -495,6 +497,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| creditHistory.setCouponId(wxCoupon.getId()); | creditHistory.setCouponId(wxCoupon.getId()); | ||||
| creditHistory.setBusinessId(wxCoupon.getBusiness()); | creditHistory.setBusinessId(wxCoupon.getBusiness()); | ||||
| creditHistory.setSpend(couponOrder.getCouponPrice()); | creditHistory.setSpend(couponOrder.getCouponPrice()); | ||||
| creditHistory.setChangePurpose("核销停车劵("+wxCoupon.getTitle()+")"); | |||||
| wxCreditHistoryService.saveOrUpdate(creditHistory); | wxCreditHistoryService.saveOrUpdate(creditHistory); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("积分值:" + e.getMessage()); | logger.error("积分值:" + e.getMessage()); | ||||
| @@ -1566,13 +1566,14 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| creditHistory.setTenantId(wxMerchant.getFinalTenantId()); | creditHistory.setTenantId(wxMerchant.getFinalTenantId()); | ||||
| creditHistory.setFinalTenantId(wxMerchant.getFinalTenantId()); | creditHistory.setFinalTenantId(wxMerchant.getFinalTenantId()); | ||||
| creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode()); | creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode()); | ||||
| creditHistory.setBusinessId(wxMerchant.getBusinessId()); | |||||
| creditHistory.setSpend(updateOrder.getPayment()); | |||||
| creditHistory.setMerchantId(wxMerchant.getId()); | |||||
| if (updateOrder.getCouponChannelId() != null) { | if (updateOrder.getCouponChannelId() != null) { | ||||
| WxCouponChannel wxCouponChannel = wxCouponChannelMapper.selectById(updateOrder.getCouponChannelId(),updateOrder.getTenantId()); | WxCouponChannel wxCouponChannel = wxCouponChannelMapper.selectById(updateOrder.getCouponChannelId(),updateOrder.getTenantId()); | ||||
| creditHistory.setCouponId(wxCouponChannel.getCouponId()); | creditHistory.setCouponId(wxCouponChannel.getCouponId()); | ||||
| } | } | ||||
| creditHistory.setBusinessId(wxMerchant.getBusinessId()); | |||||
| creditHistory.setSpend(updateOrder.getPayment()); | |||||
| creditHistory.setMerchantId(wxMerchant.getId()); | |||||
| creditHistory.setChangePurpose("付款码消费("+wxMerchant.getName()+")消费("+creditHistory.getSpendStr()+")"); | |||||
| wxCreditHistoryService.saveOrUpdate(creditHistory); | wxCreditHistoryService.saveOrUpdate(creditHistory); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("积分值:" + e.getMessage()); | logger.error("积分值:" + e.getMessage()); | ||||
| @@ -2205,6 +2206,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| creditHistory.setTenantId(coupon.getFinalTenantId()); | creditHistory.setTenantId(coupon.getFinalTenantId()); | ||||
| creditHistory.setFinalTenantId(coupon.getFinalTenantId()); | creditHistory.setFinalTenantId(coupon.getFinalTenantId()); | ||||
| creditHistory.setCreditType(EnumScoreType.CHANGE_CREDIT.getCode()); | creditHistory.setCreditType(EnumScoreType.CHANGE_CREDIT.getCode()); | ||||
| creditHistory.setChangePurpose(EnumScoreType.CHANGE_CREDIT.getMessage()+"("+coupon.getTitle()+")"); | |||||
| creditHistory.setCouponId(coupon.getId()); | creditHistory.setCouponId(coupon.getId()); | ||||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | ||||
| setMerchantId(coupon, creditHistory); | setMerchantId(coupon, creditHistory); | ||||
| @@ -85,6 +85,7 @@ public class ParkHelper { | |||||
| wxCreditHistory.setFinalTenantId(park.getFinalTenantId()); | wxCreditHistory.setFinalTenantId(park.getFinalTenantId()); | ||||
| // wxCreditHistory.setCreateDate(new Date()); | // wxCreditHistory.setCreateDate(new Date()); | ||||
| wxCreditHistory.setCreditType(EnumScoreType.BIND_CAR.getCode()); | wxCreditHistory.setCreditType(EnumScoreType.BIND_CAR.getCode()); | ||||
| wxCreditHistory.setChangePurpose(EnumScoreType.BIND_CAR.getMessage()); | |||||
| wxCreditHistory.setOperatorType(EnumUserType.CUSER.getCode()); | wxCreditHistory.setOperatorType(EnumUserType.CUSER.getCode()); | ||||
| wxCreditHistory.setOperatorId(cuUserId); | wxCreditHistory.setOperatorId(cuUserId); | ||||
| wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | ||||