|
|
|
@@ -13,6 +13,7 @@ import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.pay.*; |
|
|
|
import com.iformall.service.WxBillAllService; |
|
|
|
import com.iformall.service.WxBillSettleService; |
|
|
|
import com.iformall.service.WxPayBillService; |
|
|
|
import com.iformall.utils.*; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
@@ -51,6 +52,9 @@ public class WxPayBillServiceImpl implements WxPayBillService { |
|
|
|
@Autowired |
|
|
|
WxMerchantBUserMapper wxMerchantBUserMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxBillSettleService wxBillSettleService; |
|
|
|
|
|
|
|
JSONObject errorMap = JSON.parseObject("{" + |
|
|
|
"\"NOAUTH\":{\"detail\":\"商户无此接口权限\",\"reason\":\"商户未开通此接口权限\",\"resolution\":\"请商户前往申请此接口权限\"}," + |
|
|
|
"\"NOTENOUGH\":{\"detail\":\"余额不足\",\"reason\":\"用户帐号余额不足\",\"resolution\":\"用户帐号余额不足,请用户充值或更换支付卡后再支付\"}," + |
|
|
|
@@ -98,6 +102,13 @@ public class WxPayBillServiceImpl implements WxPayBillService { |
|
|
|
//获取账单数据 |
|
|
|
Map<String, Object> bill = bills.get(0); |
|
|
|
Long owe = (Long) bill.get("owe"); |
|
|
|
Integer billTypeValue = (Integer) bill.get("billTypeValue"); |
|
|
|
|
|
|
|
if(EnumBillType.SETTLE.getCode().equals(billTypeValue)){ |
|
|
|
WxBillSettle wxBillSettle = wxBillSettleService.getById(record.getBillId()); |
|
|
|
owe = wxBillSettle.getBalance(); |
|
|
|
logger.info("wxBillSettle.balance:{}",owe); |
|
|
|
} |
|
|
|
if (owe.longValue() <= 0) { |
|
|
|
logger.info("账单欠缴为0"); |
|
|
|
return new ResultData(ErrorCode.BILL_OWE_ZERO); |
|
|
|
|