| | |
| | | import com.fzzy.api.service.ApiRemoteService; |
| | | import com.fzzy.api.utils.ContextUtil; |
| | | import com.fzzy.api.view.repository.ApiInfoDataRep; |
| | | import com.fzzy.otherview.gd2022.dto.GdApi1023; |
| | | import com.fzzy.otherview.whhpjl.WhjlConstant; |
| | | import com.fzzy.otherview.whhpjl.dto.WhjlApi1101; |
| | | import com.fzzy.push.gd2022.ApiCodeConstant; |
| | | import com.fzzy.push.sh2023.SH2023Constant; |
| | | import com.fzzy.push.sh2023.dto.SH2023Api2101; |
| | | import org.apache.commons.lang.StringUtils; |
| | |
| | | if (null == data.getPch() || data.getPch() == "") { |
| | | data.setPch(data.getHwdm() + DateFormatUtils.format(data.getJjrq(), "yyyy")); |
| | | } |
| | | ApiInfoData infoData = new ApiInfoData(); |
| | | infoData.setId(data.getJjdh()); |
| | | ApiInfoData infoData; |
| | | List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2101, data.getJjdh()); |
| | | 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_2101); |
| | | infoData.setUpdateTime(new Date()); |
| | |
| | | infoData.setData(JSON.toJSONString(data)); |
| | | infoData.setCzbz(data.getCzbz()); |
| | | infoData.setRemarks("备注信息"); |
| | | } |
| | | |
| | | apiInfoDataRep.save(infoData); |
| | | } |
| | |
| | | */ |
| | | @Expose |
| | | public void delData(SH2023Api2101 data) { |
| | | apiInfoDataRep.deleteById(data.getJjdh()); |
| | | List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2101, data.getJjdh()); |
| | | apiInfoDataRep.deleteById(apiInfoList.get(0).getId()); |
| | | } |
| | | |
| | | /** |
| | | * sHApi2101PR#delUpdate |
| | | */ |
| | | @Expose |
| | | public String delUpdate(SH2023Api2101 entity) { |
| | | if (null == entity) { |
| | | public String delUpdate(SH2023Api2101 data) { |
| | | if (null == data) { |
| | | return "无数据执行"; |
| | | } |
| | | entity.setCzbz(Constant.CZBZ_D); |
| | | apiInfoDataRep.updateStatus(entity.getJjdh(), JSON.toJSONString(entity), Constant.CZBZ_D); |
| | | List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2101, data.getJjdh()); |
| | | 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 (SH2023Api2101 data : items) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | infoData = new ApiInfoData(); |
| | | infoData.setId(data.getJjdh()); |
| | | infoData.setKqdm(data.getKqdm()); |
| | | infoData.setInteType("21"); |
| | | infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2101); |
| | | infoData.setUpdateTime(new Date()); |
| | | infoData.setDataId(data.getJjdh()); |
| | | |
| | | //推送成功,更新数据上传状态 |
| | | List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2101, data.getJjdh()); |
| | | 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); |
| | | } |
| | | } |