From 4160155c7749e752ae13b935afe7a60fbbeeda6b Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期一, 30 十月 2023 11:52:44 +0800 Subject: [PATCH] 武汉接口 --- src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1206PR.java | 52 ++++++++++++++++++++++++++++++---------------------- 1 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1206PR.java b/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1206PR.java index 187c528..9c72421 100644 --- a/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1206PR.java +++ b/src/main/java/com/fzzy/otherview/whhpjl/pr/WhjlApi1206PR.java @@ -16,10 +16,13 @@ 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.GdApi1023Way; import com.fzzy.otherview.whhpjl.WhjlConstant; import com.fzzy.otherview.whhpjl.dto.WhjlApi1206; import com.fzzy.otherview.whhpjl.dto.WhjlApi1206; import com.fzzy.otherview.whhpjl.dto.WhjlQDItem; +import com.fzzy.push.gd2022.ApiCodeConstant; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; @@ -52,7 +55,7 @@ /** * 鑾峰彇鍒楄〃淇℃伅 - * whjlApi1207PR#listData + * whjlApi1206PR#listData * * @return */ @@ -110,42 +113,47 @@ /** * 鑾峰彇鍒楄〃淇℃伅 - * whjlApi1207PR#listItem + * whjlApi1206PR#listItem * * @return */ @DataProvider - public List<WhjlQDItem> listItem(String id) { - return null; + public List<WhjlQDItem> listItem(String code) { + return JSON.parseArray(code, WhjlQDItem.class); } /** * 鏇存柊鎴栦慨鏀� - * whjlApi1207PR#saveData + * whjlApi1206PR#saveData * * @param data * @return */ @DataResolver public void saveData(WhjlApi1206 data) { - ApiInfoData infoData = new ApiInfoData(); - infoData.setId(data.getBizId()); - infoData.setKqdm(data.getKqdm()); - infoData.setInteType(WhjlConstant.API_CATEGORY_12); - infoData.setInteId(WhjlConstant.API_CODE_1207); - infoData.setUpdateTime(new Date()); - infoData.setDataId(data.getBizId()); - infoData.setData(JSON.toJSONString(data)); - infoData.setCzbz(data.getCzbz()); - infoData.setRemarks("澶囨敞淇℃伅"); - + data.setHtspqdList(JSON.toJSONString(data.getHtspqd())); + ApiInfoData infoData; + List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(WhjlConstant.API_CODE_1206, 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_1206); + infoData.setUpdateTime(new Date()); + infoData.setDataId(data.getBizId()); + infoData.setData(JSON.toJSONString(data)); + infoData.setCzbz(Constant.CZBZ_I); + infoData.setRemarks("澶囨敞淇℃伅"); + } apiInfoDataRep.save(infoData); } - /** * 鍒犻櫎 - * whjlApi1207PR#delData + * whjlApi1206PR#delData * * @param data * @return @@ -158,7 +166,7 @@ /** * 鍒犻櫎鍚堝悓鍟嗗搧娓呭崟 - * whjlApi1207PR#delItem + * whjlApi1206PR#delItem * * @param data * @return @@ -170,7 +178,7 @@ /** * 涓婁紶 - * whjlApi1207PR#pushData + * whjlApi1206PR#pushData * * @param items * @return @@ -188,7 +196,7 @@ } //灏佽鍙傛暟 - ApiParam param = new ApiParam(apiConf, WhjlConstant.API_CATEGORY_12, WhjlConstant.API_CODE_1207); + ApiParam param = new ApiParam(apiConf, WhjlConstant.API_CATEGORY_12, WhjlConstant.API_CODE_1206); //鑾峰彇瀹炵幇鎺ュ彛 ApiRemoteService apiService = apiPushManager.getApiRemoteService(param.getPushProtocol()); @@ -207,7 +215,7 @@ infoData.setId(data.getBizId()); infoData.setKqdm(data.getKqdm()); infoData.setInteType(WhjlConstant.API_CATEGORY_12); - infoData.setInteId(WhjlConstant.API_CODE_1207); + infoData.setInteId(WhjlConstant.API_CODE_1206); infoData.setUpdateTime(new Date()); infoData.setDataId(data.getBizId()); -- Gitblit v1.9.3