CZT
2023-11-11 111f952ebe91c261fa418be96226e1fa01865e3b
src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
@@ -56,6 +56,8 @@
    private Api1202Rep api1202Rep;
    @Autowired
    private Api1205Rep api1205Rep;
    @Autowired
    private Api1404Rep api1404Rep;
    @Override
    public String getProtocol() {
@@ -140,7 +142,7 @@
            reqData.setData(ShRSAUtils.encryptByPubKey(jsonData, conf.getPublicKey()));
            //摘要,数据主体的MD5值
            reqData.setDigst(MyMD5Util.encrypt(jsonData));
            log.info("上报数据信息=" + JSON.toJSONString(reqData));
            SH2023RespDto responseDto = SH2023HttpClientUtil.postPushData(conf.getApiUrl() + inteId, JSON.toJSONString(reqData), conf);
            apiLog.setStatus(responseDto.getCode() == 200 ? 0 : responseDto.getCode());
@@ -354,6 +356,12 @@
                api1202.setRkjsdh("0");
            }
            //设置粮食轮换年度
            List<Api1404> api1404List = api1404Rep.getDataByJhmxdh(apiData.getJhmxh());
            if(null != api1404List && api1404List.size() >0){
                api1202.setLhnd(api1404List.get(0).getShnd());
            }
            //设置批次号
            api1202.setPch(apiData.getHwdm() + apiData.getShnd());
            //设置空属性为默认值
@@ -391,6 +399,7 @@
            BeanUtils.copyProperties(apiData, api1204);
            api1204.setBjw(ShAreaBjw.getBjw(code));
            //TODO 查询合同获取批次号
            //设置批次号
            api1204.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getJssj(), "yyyy"));
@@ -418,8 +427,15 @@
            if (StringUtils.isEmpty(api1205.getCkjsdh())) {
                api1205.setCkjsdh("0");
            }
            //设置粮食轮换年度
            List<Api1404> api1404List = api1404Rep.getDataByJhmxdh(apiData.getJhmxh());
            if(null != api1404List && api1404List.size() >0){
                api1205.setLhnd(api1404List.get(0).getShnd());
            }
            //设置批次号
            api1205.setPch(apiData.getHwdm() + DateFormatUtils.format(apiData.getCmsj(), "yyyy"));
            api1205.setPch(apiData.getHwdm() + apiData.getShnd());
            //设置空属性为默认值
            changeObject(api1205);
@@ -430,9 +446,9 @@
            Api1206 apiData = (Api1206) data;
            BeanUtils.copyProperties(apiData, api1206);
            api1206.setBjw(ShAreaBjw.getBjw(code));
            List<Api1205> api1205List = api1205Rep.getDataById(apiData.getCkjsdh());
//            List<Api1205> api1205List = api1205Rep.getDataById(apiData.getCkjsdh());
            //设置批次号
            api1206.setPch(api1205List.get(0).getHwdm() + DateFormatUtils.format(api1205List.get(0).getCmsj(), "yyyy"));
//            api1206.setPch(api1205List.get(0).getHwdm() + DateFormatUtils.format(api1205List.get(0).getCmsj(), "yyyy"));
            //设置空属性为默认值
            changeObject(api1206);