Просмотр исходного кода

[卡消费][修改]:满20次后,自动调用分账完结,卡消费状态标为未分账

release_toaliyun_real
Stormeye Wu 7 лет назад
Родитель
Сommit
074e4411d3
1 измененных файлов: 16 добавлений и 1 удалений
  1. +16
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java

+ 16
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java Просмотреть файл

@@ -141,6 +141,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService {
record.setCardRemainAmount(remaingAmount);
record.setCardBeforeRealAmount(cardInfo.getRemainingShareFeeAmount());
record.setCardRemainRealAmount(remain_real_pament);
record.setPayStatus(EnumCardSpendStatus.NOT_PAY.getCode());
record.setCreateDate(curDate);
record.setUpdateDate(curDate);
try {
@@ -316,6 +317,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService {
WxMerchant merchant = wxMerchantMapper.selectByPrimaryKey(cardSpend.getMerchantId());

if (cardSpend != null && cardInfo != null && merchant != null) {
// 分账
WxSharingOrderDto shareOrder = new WxSharingOrderDto();
shareOrder.setcUserId(cardSpend.getOwnerId());
shareOrder.setMerchantId(cardSpend.getMerchantId());
@@ -332,7 +334,20 @@ public class WxCardSpendServiceImpl implements WxCardSpendService {
// 分账异常
throw new MallinkException(resultData.code, resultData.message);
}
if(cardSpend.getCardRemainAmount().equals(0)) {

// 卡消费记录状态更新
{
WxCardSpend updateRecord = new WxCardSpend();
updateRecord.setId(cardSpend.getId());
updateRecord.setPayStatus(EnumCardSpendStatus.PS_SHARED.getCode());
updateRecord.setUpdateDate(new Date());
wxCardSpendMapper.updateByPrimaryKeySelective(updateRecord);
}


if(cardSpend.getCardRemainAmount().equals(0)
|| psNum == 19) {
// 卡余额为0,或者卡已分账20次,发起分账完结
if (cardSpend.getCardRemainRealAmount() > 0) {
// 卡已被抵扣,但是分账还有余额
cardShareFinished(cardInfo, shareOrder);


Загрузка…
Отмена
Сохранить