|
|
|
@@ -58,6 +58,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
private final WxCouponOrderMapper couponOrderMapper; |
|
|
|
private final WxCouponMerchantMapper couponMerchantMapper; |
|
|
|
private final WxCouponMapper couponMapper; |
|
|
|
private final WxMerchantMapper merchantMapper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@@ -1357,12 +1358,12 @@ public class PosServiceImpl implements PosService { |
|
|
|
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 { |
|
|
|
//-------此处为【现金支付】记录增加积分操作------- |
|
|
|
WxCreditHistory creditHistory = new WxCreditHistory(); |
|
|
|
creditHistory.setOperatorType(EnumUserType.BUSER.getCode()); |
|
|
|
creditHistory.setOperatorId(buUserId); |
|
|
|
creditHistory.setOperatorId(merchantBUser.getId()); |
|
|
|
creditHistory.setCUserId(couponOrderCVo.getcUserId()); |
|
|
|
creditHistory.setCreateDate(new Date()); |
|
|
|
// creditHistory.updateTenantInfo(couponOrderCVo); |
|
|
|
@@ -1373,7 +1374,8 @@ public class PosServiceImpl implements PosService { |
|
|
|
creditHistory.setBusinessId(coupon.getBusiness()); |
|
|
|
creditHistory.setSpend(couponOrderCVo.getCouponPrice()); |
|
|
|
//如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 |
|
|
|
creditHistory.setMerchantId(merchantId); |
|
|
|
creditHistory.setMerchantId(wxMerchant.getId()); |
|
|
|
creditHistory.setChangePurpose("pos消费 店铺("+wxMerchant.getName()+")卷("+coupon.getTitle()+")"); |
|
|
|
creditHistory = creditHistoryService.saveOrUpdate(creditHistory); |
|
|
|
if (creditHistory.getCreditNum() != null) { |
|
|
|
return creditHistory.getCreditNum(); |
|
|
|
@@ -1402,6 +1404,7 @@ public class PosServiceImpl implements PosService { |
|
|
|
creditHistory.setSpend(payment); |
|
|
|
//如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 |
|
|
|
creditHistory.setMerchantId(merchant.getId()); |
|
|
|
creditHistory.setChangePurpose("pos消费 店铺("+merchant.getName()+")消费("+creditHistory.getSpendStr()+")"); |
|
|
|
creditHistory = creditHistoryService.saveOrUpdate(creditHistory); |
|
|
|
if (creditHistory.getCreditNum() != null) { |
|
|
|
return creditHistory.getCreditNum(); |
|
|
|
@@ -2201,7 +2204,8 @@ public class PosServiceImpl implements PosService { |
|
|
|
|
|
|
|
// 4. 积分 |
|
|
|
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); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("交易核销积分异常:" + e.getMessage()); |
|
|
|
|