|
@@ -73,9 +73,6 @@ public class WxCusDeclare extends AbstractCusDeclare implements CusDeclare{
|
|
|
@Autowired
|
|
|
private MerchNotiService merchNotiService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private MerchCusService merchCusService;
|
|
|
-
|
|
|
/**
|
|
|
* 海关报关接口
|
|
|
*/
|
|
@@ -184,7 +181,7 @@ public class WxCusDeclare extends AbstractCusDeclare implements CusDeclare{
|
|
|
//通知商户
|
|
|
MerchNoti merchNoti = builder.code(WxContants.ERROR_FAIL)
|
|
|
.msg(wxResponseMsgDto.getReturnMsg())
|
|
|
- .cusDeclStatus(WxDict.MerchNoticeStatus.i_12.getItem())
|
|
|
+ .cusDeclStatus(WxDict.MerchNoticeStatus.i_13.getItem())
|
|
|
.build();
|
|
|
merchNotis.add(merchNoti);
|
|
|
}
|
|
@@ -212,7 +209,7 @@ public class WxCusDeclare extends AbstractCusDeclare implements CusDeclare{
|
|
|
|
|
|
MerchNoti merchNoti = builder.code(WxContants.ERROR_FAIL)
|
|
|
.msg("未申报")
|
|
|
- .cusDeclStatus(WxDict.MerchNoticeStatus.i_12.getItem())
|
|
|
+ .cusDeclStatus(WxDict.MerchNoticeStatus.i_10.getItem())
|
|
|
.build();
|
|
|
merchNotis.add(merchNoti);
|
|
|
}
|
|
@@ -245,7 +242,7 @@ public class WxCusDeclare extends AbstractCusDeclare implements CusDeclare{
|
|
|
|
|
|
MerchNoti merchNoti = builder.code(wxResponseMsgDto.getErrCode())
|
|
|
.msg(wxResponseMsgDto.getErrCodeDes())
|
|
|
- .cusDeclStatus(WxDict.MerchNoticeStatus.i_13.getItem())
|
|
|
+ .cusDeclStatus(WxDict.MerchNoticeStatus.i_12.getItem())
|
|
|
.build();
|
|
|
merchNotis.add(merchNoti);
|
|
|
}
|
|
@@ -255,7 +252,7 @@ public class WxCusDeclare extends AbstractCusDeclare implements CusDeclare{
|
|
|
|
|
|
MerchNoti merchNoti = builder.code(WxContants.ERROR_FAIL)
|
|
|
.msg("海关申报失败")
|
|
|
- .cusDeclStatus(WxDict.MerchNoticeStatus.i_12.getItem())
|
|
|
+ .cusDeclStatus(WxDict.MerchNoticeStatus.i_13.getItem())
|
|
|
.build();
|
|
|
merchNotis.add(merchNoti);
|
|
|
}
|
|
@@ -265,7 +262,7 @@ public class WxCusDeclare extends AbstractCusDeclare implements CusDeclare{
|
|
|
|
|
|
MerchNoti merchNoti = builder.code(WxContants.ERROR_EXCEPT)
|
|
|
.msg("海关接口异常")
|
|
|
- .cusDeclStatus(WxDict.MerchNoticeStatus.i_12.getItem())
|
|
|
+ .cusDeclStatus(WxDict.MerchNoticeStatus.i_13.getItem())
|
|
|
.build();
|
|
|
merchNotis.add(merchNoti);
|
|
|
}
|
|
@@ -282,12 +279,12 @@ public class WxCusDeclare extends AbstractCusDeclare implements CusDeclare{
|
|
|
|
|
|
MerchNoti merchNoti = builder.code(wxResponseMsgDto.getErrCode())
|
|
|
.msg(wxResponseMsgDto.getErrCodeDes())
|
|
|
- .cusDeclStatus(WxDict.MerchNoticeStatus.i_12.getItem())
|
|
|
+ .cusDeclStatus(WxDict.MerchNoticeStatus.i_13.getItem())
|
|
|
.build();
|
|
|
merchNotis.add(merchNoti);
|
|
|
}
|
|
|
|
|
|
- } catch (IOException e) {
|
|
|
+ } catch (Exception e) {
|
|
|
logger.error("数据请求异常的支付单请求数据为xml:"+xml, e);
|
|
|
WxPayError wxPayError = createWxPayError(wxCbPayDoc);
|
|
|
errors.add(wxPayError);
|
|
@@ -316,7 +313,7 @@ public class WxCusDeclare extends AbstractCusDeclare implements CusDeclare{
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.error("持久化支付申报异常信息数据失败data:" + errors, e);
|
|
|
- return;
|
|
|
+ throw new RuntimeException("持久化支付申报异常信息数据失败data:",e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -407,11 +404,13 @@ public class WxCusDeclare extends AbstractCusDeclare implements CusDeclare{
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
+
|
|
|
+ String queryURL = "https://api.mch.weixin.qq.com/cgi-bin/mch/customs/customdeclarequery";
|
|
|
WxCbPayDoc wxCbPayDoc = new WxCbPayDoc();
|
|
|
wxCbPayDoc.setAppid("wx24013b34e349db3c");
|
|
|
wxCbPayDoc.setMchId("1501125641");
|
|
|
- wxCbPayDoc.setOutTradeNo("669918012250");
|
|
|
- wxCbPayDoc.setTransactionId("4200000120201805021020091366");
|
|
|
+ wxCbPayDoc.setOutTradeNo("670219011050");
|
|
|
+ wxCbPayDoc.setTransactionId("4200000137201805171532382342");
|
|
|
wxCbPayDoc.setCustoms("SHENZHEN");
|
|
|
wxCbPayDoc.setMchCustomsNo("4403160Z3Y");//中网科技(深圳)有限公司
|
|
|
|
|
@@ -423,6 +422,11 @@ public class WxCusDeclare extends AbstractCusDeclare implements CusDeclare{
|
|
|
sorted.put("transaction_id", wxCbPayDoc.getTransactionId());
|
|
|
sorted.put("customs", wxCbPayDoc.getCustoms());
|
|
|
sorted.put("mch_customs_no", wxCbPayDoc.getMchCustomsNo());
|
|
|
+ //sorted.put("action_type", "MODIFY ");
|
|
|
+ sorted.put("cert_type", "IDCARD");
|
|
|
+ sorted.put("cert_id", "440301198012261939");
|
|
|
+ sorted.put("name", "司晓峰");
|
|
|
+
|
|
|
|
|
|
//2.生成签名
|
|
|
StringBuilder sb = new StringBuilder();
|