CZT
2023-11-10 24da09489db83167c91f5920a92ea19f29d96829
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() {
@@ -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());
            //设置空属性为默认值
@@ -418,8 +426,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 +445,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);