|
|
|
@@ -696,11 +696,24 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
public int microPayOrderSuccess(WxOrder updateOrder) { |
|
|
|
Date currentDate = new Date(); |
|
|
|
// C端用户 |
|
|
|
WxCUser user = wxCUserMapper.selectByPrimaryKey(updateOrder.getCUserId()); |
|
|
|
if (user == null) { |
|
|
|
logger.error("用户不存在, userId: " + updateOrder.getCUserId()); |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
// B端用户 |
|
|
|
WxMerchantBUser bUser = wxMerchantBUserMapper.selectByPrimaryKey(updateOrder.getBUserId()); |
|
|
|
if(bUser == null) { |
|
|
|
logger.error("B端用户不存在, bUserId: " + updateOrder.getBUserId()); |
|
|
|
throw new MallinkException(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
// 基于B端User查找merchant |
|
|
|
WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(bUser.getMerchantId()); |
|
|
|
if(wxMerchant == null) { |
|
|
|
logger.error("商户不存在, merchantId: " + bUser.getMerchantId()); |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); |
|
|
|
} |
|
|
|
// 已支付,更新支付时间 |
|
|
|
updateOrder.setPaymentTime(currentDate); |
|
|
|
updateOrder.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); |
|
|
|
@@ -715,7 +728,7 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
|
|
|
|
// 成长值 计算 |
|
|
|
try { |
|
|
|
wxScoreRulesService.addScore2(EnumScoreType.CONSUMPTION, updateOrder, EnumBusiness.OTHER.getCode()); |
|
|
|
wxScoreRulesService.addScore2(EnumScoreType.CONSUMPTION, updateOrder, wxMerchant.getBusinessId()); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("成长值:" + e.getMessage()); |
|
|
|
} |
|
|
|
|