From f76300b29d55277090628b3cdb2e901a7b6d0414 Mon Sep 17 00:00:00 2001 From: CZT <czt18638530771@163.com> Date: 星期二, 05 十二月 2023 10:56:39 +0800 Subject: [PATCH] 广东省平台接口-增加上传前赋值最后更新时间。保证数据实时性 --- src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1211PR.java | 45 +++++++++++++++++++++------------------------ 1 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1211PR.java b/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1211PR.java index 22e7470..27d5d92 100644 --- a/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1211PR.java +++ b/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1211PR.java @@ -18,7 +18,9 @@ import com.fzzy.api.view.repository.ApiInfoDataRep; import com.fzzy.otherview.whhpjl.WhjlConstant; import com.fzzy.otherview.whhpjl.dto.WhjlApi1211; +import com.fzzy.otherview.whhpjl.dto.WhjlApi1211; import com.fzzy.otherview.whhpjl.dto.WhjlQDItem; +import com.fzzy.otherview.whhpjl.dto.WhjlZCMX; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; @@ -113,8 +115,8 @@ * @return */ @DataProvider - public List<WhjlQDItem> listItem(String id) { - return null; + public List<WhjlZCMX> listItem(String code) { + return JSON.parseArray(code, WhjlZCMX.class); } /** @@ -126,17 +128,23 @@ */ @DataResolver public void saveData(WhjlApi1211 data) { - ApiInfoData infoData = new ApiInfoData(); - infoData.setId(data.getBizId()); - infoData.setKqdm(data.getKqdm()); - infoData.setInteType(WhjlConstant.API_CATEGORY_12); - infoData.setInteId(WhjlConstant.API_CODE_1211); - infoData.setUpdateTime(new Date()); - infoData.setDataId(data.getBizId()); - infoData.setData(JSON.toJSONString(data)); - infoData.setCzbz(data.getCzbz()); - infoData.setRemarks("澶囨敞淇℃伅"); - + data.setZcmxList(JSON.toJSONString(data.getZcmx())); + ApiInfoData infoData; + List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(WhjlConstant.API_CODE_1211, data.getBizId(), data.getKqdm()); + if (apiInfoList.size() != 0) { + infoData = apiInfoList.get(0); + infoData.setData(JSON.toJSONString(data)); + } else { + infoData = new ApiInfoData(); + infoData.setId(data.getBizId()); + infoData.setKqdm(data.getKqdm()); + infoData.setInteId(WhjlConstant.API_CODE_1211); + infoData.setUpdateTime(new Date()); + infoData.setDataId(data.getBizId()); + infoData.setData(JSON.toJSONString(data)); + infoData.setCzbz(Constant.CZBZ_I); + infoData.setRemarks("澶囨敞淇℃伅"); + } apiInfoDataRep.save(infoData); } @@ -154,17 +162,6 @@ return null; } - /** - * 鍒犻櫎鍚堝悓鍟嗗搧娓呭崟 - * whjlApi1211PR#delItem - * - * @param data - * @return - */ - @Expose - public String delItem(WhjlQDItem data) { - return null; - } /** * 涓婁紶 -- Gitblit v1.9.3