|
@@ -237,6 +237,14 @@ public class WxCusDeclareQueryBiz extends AbstractCusDeclareBiz implements Cuspa
|
|
|
.cusDeclStatus(WxDict.MerchNoticeStatus.i_13.getItem())
|
|
|
.build();
|
|
|
}
|
|
|
+ wxCbPayDocService.updateWxCbPay(wxCbPayDoc);
|
|
|
+
|
|
|
+ MerchNoti noti = new MerchNoti();
|
|
|
+ noti.setCode(wxQueryResponseMsg.getErrCode());
|
|
|
+ noti.setAllPayNo(wxQueryResponseMsg.getTransactionId());
|
|
|
+ noti.setCusDeclStatus(merchNoti.getCusDeclStatus());
|
|
|
+ noti.setAllSubOrderNo(allSubOrderNo);
|
|
|
+ updateMerchNoti(noti,allSubOrderId,merchNoti);//更新商户通知
|
|
|
}
|
|
|
}else{//业务状态码失败
|
|
|
wxCbPayDoc.setErrCode(wxQueryResponseMsg.getErrCode());
|
|
@@ -247,6 +255,14 @@ public class WxCusDeclareQueryBiz extends AbstractCusDeclareBiz implements Cuspa
|
|
|
.msg(wxQueryResponseMsg.getErrCodeDes())
|
|
|
.cusDeclStatus(WxDict.MerchNoticeStatus.i_13.getItem())
|
|
|
.build();
|
|
|
+ wxCbPayDocService.updateWxCbPay(wxCbPayDoc);
|
|
|
+
|
|
|
+ MerchNoti noti = new MerchNoti();
|
|
|
+ noti.setCode(wxQueryResponseMsg.getErrCode());
|
|
|
+ noti.setAllPayNo(wxQueryResponseMsg.getTransactionId());
|
|
|
+ noti.setCusDeclStatus(merchNoti.getCusDeclStatus());
|
|
|
+ noti.setAllSubOrderNo(allSubOrderNo);
|
|
|
+ updateMerchNoti(noti,allSubOrderId,merchNoti);//更新商户通知
|
|
|
}
|
|
|
}
|
|
|
///返回状态码为失败
|
|
@@ -258,42 +274,18 @@ public class WxCusDeclareQueryBiz extends AbstractCusDeclareBiz implements Cuspa
|
|
|
.msg(wxQueryResponseMsg.getReturnMsg())
|
|
|
.cusDeclStatus(WxDict.MerchNoticeStatus.i_13.getItem())
|
|
|
.build();
|
|
|
- }
|
|
|
-
|
|
|
- wxCbPayDocService.updateWxCbPay(wxCbPayDoc);
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("更新支付单证入库信息状态异常", e);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- List<MerchNoti> mchNotiList = null;
|
|
|
- try {
|
|
|
- MerchNoti noti = new MerchNoti();
|
|
|
- noti.setCode(wxQueryResponseMsg.getErrCode());
|
|
|
- noti.setAllPayNo(wxQueryResponseMsg.getTransactionId());
|
|
|
- noti.setCusDeclStatus(merchNoti.getCusDeclStatus());
|
|
|
- mchNotiList = merchNotiService.getMerchNotiByCodeAndOrderNo(noti);
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("根据code查询商户通知信息异常", e);
|
|
|
- return;
|
|
|
- }
|
|
|
+ wxCbPayDocService.updateWxCbPay(wxCbPayDoc);
|
|
|
|
|
|
- try {
|
|
|
- if(mchNotiList != null && mchNotiList.size() > 0){
|
|
|
- MerchNoti noti = mchNotiList.get(0);
|
|
|
- noti.setTstm(new Date());
|
|
|
- noti.setAllSubOrderId(allSubOrderId);
|
|
|
+ MerchNoti noti = new MerchNoti();
|
|
|
+ noti.setCode(wxQueryResponseMsg.getErrCode());
|
|
|
+ noti.setAllPayNo(wxQueryResponseMsg.getTransactionId());
|
|
|
+ noti.setCusDeclStatus(merchNoti.getCusDeclStatus());
|
|
|
noti.setAllSubOrderNo(allSubOrderNo);
|
|
|
- merchNotiService.update(noti);
|
|
|
- }else{
|
|
|
- merchNoti.setNotiSn(TablePrimaryKeyPrefix.merch_pay_noti_type + IdWorkerAide.nextId());
|
|
|
- merchNotiService.insert(merchNoti);
|
|
|
+ updateMerchNoti(noti,allSubOrderId,merchNoti);//更新商户通知
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- logger.error("操作商户通知数据异常", e);
|
|
|
- WxPayError wxPayError = createWxPayError(wxCbPayDoc, querySuccessResponseDto);
|
|
|
- wxPayError.setErrMsg("操作商户通知数据异常");
|
|
|
- errorList.add(wxPayError);
|
|
|
+ logger.error("更新支付单证入库信息状态异常", e);
|
|
|
+ return;
|
|
|
}
|
|
|
});
|
|
|
//存储异常记录
|
|
@@ -311,6 +303,18 @@ public class WxCusDeclareQueryBiz extends AbstractCusDeclareBiz implements Cuspa
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ private void updateMerchNoti(MerchNoti noti,String allSubOrderId,MerchNoti merchNoti){
|
|
|
+ List<MerchNoti> merchNotiList = merchNotiService.getMerchNotiByCodeAndOrderNo(noti);
|
|
|
+ if(merchNotiList != null && merchNotiList.size()>0){
|
|
|
+ MerchNoti merchNoti1 = merchNotiList.get(0);
|
|
|
+ merchNoti1.setTstm(new Date());
|
|
|
+ merchNoti1.setAllSubOrderId(allSubOrderId);
|
|
|
+ merchNotiService.update(merchNoti1);
|
|
|
+ }else{
|
|
|
+ merchNoti.setNotiSn(TablePrimaryKeyPrefix.merch_pay_noti_type + IdWorkerAide.nextId());
|
|
|
+ merchNotiService.insert(merchNoti);
|
|
|
+ }
|
|
|
+ }
|
|
|
/**
|
|
|
* 记录异常的支付单证信息
|
|
|
* @param wxCbPayDoc
|
|
@@ -349,6 +353,9 @@ public class WxCusDeclareQueryBiz extends AbstractCusDeclareBiz implements Cuspa
|
|
|
sorted.put("mch_id", wxCbPayDoc.getMchId());
|
|
|
sorted.put("out_trade_no", wxCbPayDoc.getOutTradeNo());
|
|
|
sorted.put("transaction_id", wxCbPayDoc.getTransactionId());
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isNotEmpty(wxCbPayDoc.getSubOrderNo())) {
|
|
|
+ sorted.put("sub_order_no", wxCbPayDoc.getSubOrderNo());
|
|
|
+ }
|
|
|
sorted.put("customs", wxCbPayDoc.getCustoms());
|
|
|
|
|
|
//2.生成签名
|