| | |
| | | */ |
| | | @DataResolver |
| | | public void saveData(SH2023Api2104 data) { |
| | | |
| | | ApiInfoData infoData = new ApiInfoData(); |
| | | infoData.setId(data.getBydh()); |
| | | infoData.setKqdm(data.getKqdm()); |
| | | infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2104); |
| | | infoData.setUpdateTime(new Date()); |
| | | infoData.setDataId(data.getBydh()); |
| | | infoData.setData(JSON.toJSONString(data)); |
| | | infoData.setCzbz(data.getCzbz()); |
| | | infoData.setRemarks("备注信息"); |
| | | |
| | | ApiInfoData infoData; |
| | | List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2101, data.getBydh(),data.getKqdm()); |
| | | if (apiInfoList.size() != 0) { |
| | | infoData = apiInfoList.get(0); |
| | | infoData.setData(JSON.toJSONString(data)); |
| | | } else { |
| | | infoData = new ApiInfoData(); |
| | | infoData.setId(ContextUtil.getUUID()); |
| | | infoData.setKqdm(data.getKqdm()); |
| | | infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2104); |
| | | infoData.setUpdateTime(new Date()); |
| | | infoData.setDataId(data.getBydh()); |
| | | infoData.setData(JSON.toJSONString(data)); |
| | | infoData.setCzbz(data.getCzbz()); |
| | | infoData.setRemarks("备注信息"); |
| | | } |
| | | apiInfoDataRep.save(infoData); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Expose |
| | | public void delData(SH2023Api2104 data) { |
| | | apiInfoDataRep.deleteById(data.getBydh()); |
| | | List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2104, data.getBydh(),data.getKqdm()); |
| | | apiInfoDataRep.deleteById(apiInfoList.get(0).getId()); |
| | | } |
| | | |
| | | /** |
| | | * sHApi2104PR#delUpdate |
| | | */ |
| | | @Expose |
| | | public String delUpdate(SH2023Api2104 entity) { |
| | | if (null == entity) { |
| | | public String delUpdate(SH2023Api2104 data) { |
| | | if (null == data) { |
| | | return "无数据执行"; |
| | | } |
| | | entity.setCzbz(Constant.CZBZ_D); |
| | | apiInfoDataRep.updateStatus(entity.getBydh(), JSON.toJSONString(entity), Constant.CZBZ_D); |
| | | List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2104, data.getBydh(),data.getKqdm()); |
| | | data.setCzbz(Constant.CZBZ_D); |
| | | apiInfoDataRep.updateStatus(apiInfoList.get(0).getId(), JSON.toJSONString(data), Constant.CZBZ_D); |
| | | return null; |
| | | } |
| | | |
| | |
| | | responseDto = apiService.pushData(param, apiConf, items); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | |
| | | ApiInfoData infoData; |
| | | for (SH2023Api2104 data : items) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | infoData = new ApiInfoData(); |
| | | infoData.setId(data.getBydh()); |
| | | infoData.setKqdm(data.getKqdm()); |
| | | infoData.setInteType("21"); |
| | | infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2104); |
| | | infoData.setUpdateTime(new Date()); |
| | | infoData.setDataId(data.getBydh()); |
| | | |
| | | //推送成功,更新数据上传状态 |
| | | List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2104, data.getBydh(),data.getKqdm()); |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | infoData = apiInfoList.get(0); |
| | | infoData.setUpdateTime(new Date()); |
| | | infoData.setCzbz(Constant.CZBZ_U); |
| | | infoData.setData(JSON.toJSONString(data)); |
| | | |
| | | apiInfoDataRep.save(infoData); |
| | | } |
| | | } |