From 18967104565d14fc04d848aa8cb54653b84b19ce Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期六, 29 六月 2024 17:42:21 +0800 Subject: [PATCH] 广东省平台v5.1-增加封仓确认单和出清确认单 --- src/main/java/com/fzzy/otherview/gd2022/pr/GDApi1023PR.java | 46 +++++++++++++++++++++------------------------- 1 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/fzzy/otherview/gd2022/pr/GDApi1023PR.java b/src/main/java/com/fzzy/otherview/gd2022/pr/GDApi1023PR.java index d0cdada..afa744e 100644 --- a/src/main/java/com/fzzy/otherview/gd2022/pr/GDApi1023PR.java +++ b/src/main/java/com/fzzy/otherview/gd2022/pr/GDApi1023PR.java @@ -16,15 +16,9 @@ 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.gd2022.dto.GdApi1023Dtl; -import com.fzzy.otherview.gd2022.dto.GdApi1023People; -import com.fzzy.otherview.gd2022.dto.GdApi1023Way; +import com.fzzy.push.gd2022.dto.Gd2022Api1023; import com.fzzy.push.gd2022.ApiCodeConstant; -import com.fzzy.push.sh2023.SH2023Constant; -import com.fzzy.push.sh2023.dto.SH2023Api2103; import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.time.DateFormatUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; @@ -61,7 +55,7 @@ * @return */ @DataProvider - public void listData(Page<GdApi1023> page, ApiParam param) { + public void listData(Page<Gd2022Api1023> page, ApiParam param) { Pageable pageable = PageRequest.of(page.getPageNo() - 1, page.getPageSize(), Sort.Direction.DESC, "updateTime"); @@ -98,11 +92,11 @@ }; org.springframework.data.domain.Page<ApiInfoData> japPage = apiInfoDataRep.findAll(specification, pageable); page.setEntityCount((int) japPage.getTotalElements()); - List<GdApi1023> list = new ArrayList<>(); - GdApi1023 gdApi1023; + List<Gd2022Api1023> list = new ArrayList<>(); + Gd2022Api1023 GD2022Api1023; for (ApiInfoData infoData : japPage.getContent()) { - gdApi1023 = JSONObject.parseObject(infoData.getData(), GdApi1023.class); - list.add(gdApi1023); + GD2022Api1023 = JSONObject.parseObject(infoData.getData(), Gd2022Api1023.class); + list.add(GD2022Api1023); } page.setEntities(list); @@ -112,7 +106,7 @@ * gDApi1023PR#saveData */ @DataResolver - public void saveData(GdApi1023 data) { + public void saveData(Gd2022Api1023 data) { ApiInfoData infoData; List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm(), data.getKqdm()); if (apiInfoList.size() != 0) { @@ -136,7 +130,7 @@ * gDApi1023PR#delData */ @Expose - public void delData(GdApi1023 data) { + public void delData(Gd2022Api1023 data) { List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm(), data.getKqdm()); apiInfoDataRep.deleteById(apiInfoList.get(0).getId()); } @@ -145,7 +139,7 @@ * gDApi1023PR#delUpdate */ @Expose - public String delUpdate(GdApi1023 data) { + public String delUpdate(Gd2022Api1023 data) { if (null == data) { return "鏃犳暟鎹墽琛�"; } @@ -162,7 +156,7 @@ * @return */ @Expose - public String pushData(List<GdApi1023> items) { + public String pushData(List<Gd2022Api1023> items) { ResponseDto responseDto; String result = ""; @@ -183,18 +177,20 @@ } ApiInfoData infoData; - for (GdApi1023 data : items) { + for (Gd2022Api1023 data : items) { //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� responseDto = apiService.pushData(param, apiConf, data); if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm(), 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); + if (Constant.CZBZ_I.equals(data.getCzbz())) { + //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� + List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm(), 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); + } } result += responseDto.toString(); } -- Gitblit v1.9.3