Browse Source

//card

release_toaliyun_real
xhxu 3 years ago
parent
commit
783bca1201
3 changed files with 30 additions and 5 deletions
  1. +0
    -2
      mallinkBApi/src/main/java/com/iformall/controller/WxPayAccountController.java
  2. +4
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumCardSpendStatus.java
  3. +26
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java

+ 0
- 2
mallinkBApi/src/main/java/com/iformall/controller/WxPayAccountController.java View File

@@ -33,8 +33,6 @@ public class WxPayAccountController extends BaseController {
@Autowired
private WxAppinfoService wxAppinfoService;



@ApiOperation(value = "获取支付设置", notes = "")
@PostMapping("/getPayAccount")
public ResultData getPayAccount(@RequestBody Map<String, String> paramMap) {


+ 4
- 1
mallinkService/src/main/java/com/iformall/enums/EnumCardSpendStatus.java View File

@@ -7,10 +7,13 @@ public enum EnumCardSpendStatus {

// 0-未支付;1-已分账;2:已人工分账;

NOT_PAY(0, "支付,开始记录"),
NOT_PAY(0, "支付,开始记录"),
PS_SHARED(1, "已分账"),
MANUAL_PAY(2, "已人工分账"),
PREV_PAY(10, "预支付(POS短期内占用)"),

PENDING_REFUND(3, "待退款"),//占库存
REFUND_SUCCESS(4,"已退款"),
;

public static EnumCardSpendStatus getEnum(Integer code) {


+ 26
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java View File

@@ -1178,6 +1178,18 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
throw new MallinkException(ErrorCode.DB_FAIL);
}

WxCardSpend cardSpendUpd = new WxCardSpend();
cardSpendUpd.setId(cardSend.getId());
cardSpendUpd.updateTenantInfo(cardSend);
cardSpendUpd.setPayStatus(EnumCardSpendStatus.PENDING_REFUND.getCode());
cardSpendUpd.setUpdateDate(currentDate);
try {
wxCardSpendMapper.updateById(cardSpendUpd);
} catch (Exception e) {
logger.error("卡退款订单修改出错: " + record.toString());
throw new MallinkException(ErrorCode.DB_FAIL);
}

refundCardOrderSuccess(record,wxOrder);

return new ResultData();
@@ -1188,7 +1200,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
public ResultData refundCardOrderSuccess(WxRefundOrder refundOrder,WxOrder wxOrder) {
Long cardSpendId = Long.parseLong(refundOrder.getPayOrderNo());
WxCardSpend cardSend = wxCardSpendMapper.selectById(cardSpendId);
if(cardSend == null || EnumPayType.PAY_PAYMENT.getCode().equals(cardSend.getPayType())){
if(cardSend == null){
logger.error("付款订单未找到, e:");
throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND);
}
@@ -1243,7 +1255,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
record.setCardRemainAmount(remaingAmount);
record.setCardBeforeRealAmount(cardInfo.getRemainingShareFeeAmount());
record.setCardRemainRealAmount(remain_real_pament);
record.setPayStatus(EnumCardSpendStatus.PS_SHARED.getCode());//已退款
record.setPayStatus(EnumCardSpendStatus.REFUND_SUCCESS.getCode());//已退款

record.setCreateDate(currentDate);
record.setUpdateDate(currentDate);
@@ -1276,6 +1288,18 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
throw new MallinkException(ErrorCode.ORDER_UPDATE_ERR);
}

WxCardSpend cardSpendUpd = new WxCardSpend();
cardSpendUpd.setId(cardSend.getId());
cardSpendUpd.updateTenantInfo(cardSend);
cardSpendUpd.setPayStatus(EnumCardSpendStatus.REFUND_SUCCESS.getCode());
cardSpendUpd.setUpdateDate(currentDate);
try {
wxCardSpendMapper.updateById(cardSpendUpd);
} catch (Exception e) {
logger.error("卡退款订单修改出错: " + record.toString());
throw new MallinkException(ErrorCode.DB_FAIL);
}


WxCardInfo updateCardInfo = new WxCardInfo();
updateCardInfo.setId(cardInfo.getId());


Loading…
Cancel
Save