From f2cc6329ad768b2daa08876d2cfd7a84cbe42735 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期四, 16 十一月 2023 09:55:20 +0800
Subject: [PATCH] 设备同步-添加生产厂家
---
src/main/java/com/fzzy/push/whhpjl/WhjlPushService11.java | 263 ++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 244 insertions(+), 19 deletions(-)
diff --git a/src/main/java/com/fzzy/push/whhpjl/WhjlPushService11.java b/src/main/java/com/fzzy/push/whhpjl/WhjlPushService11.java
index 90d2f5a..c185009 100644
--- a/src/main/java/com/fzzy/push/whhpjl/WhjlPushService11.java
+++ b/src/main/java/com/fzzy/push/whhpjl/WhjlPushService11.java
@@ -1,6 +1,5 @@
package com.fzzy.push.whhpjl;
-import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fzzy.api.Constant;
import com.fzzy.api.data.ApiParam;
@@ -10,14 +9,12 @@
import com.fzzy.api.service.ApiRemoteService;
import com.fzzy.api.service.PushService11;
import com.fzzy.api.view.repository.ApiInfoDataRep;
-import com.fzzy.whjl.WhjlConstant;
-import com.fzzy.whjl.dto.WhjlApi1101;
+import com.fzzy.otherview.whhpjl.WhjlConstant;
+import com.fzzy.otherview.whhpjl.dto.*;
import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
-import java.util.Date;
import java.util.List;
/**
@@ -47,18 +44,18 @@
//鎺ㄩ�佸啗宸ヤ紒涓氫俊鎭�
this.pushData1101(apiRemoteService, param);
- //TODO 鎺ㄩ�佸啗宸ョ珯鐐逛俊鎭�
-
- //TODO 鎺ㄩ�佸啗绮汉鍛樹俊鎭�
-
- //TODO 鎺ㄩ�佷粨鎴夸俊鎭�
-
- //TODO 鎺ㄩ�佸粧闂翠俊鎭�
-
- //TODO 鎺ㄩ�佽揣浣嶄俊鎭�
-
- //TODO 鎺ㄩ�佷粨鍌ㄨ澶囦俊鎭�
-
+ // 鎺ㄩ�佸啗宸ョ珯鐐逛俊鎭�
+ this.pushData1102(apiRemoteService, param);
+ // 鎺ㄩ�佸啗绮汉鍛樹俊鎭�
+ this.pushData1103(apiRemoteService, param);
+ // 鎺ㄩ�佷粨鎴夸俊鎭�
+ this.pushData1105(apiRemoteService, param);
+ // 鎺ㄩ�佸粧闂翠俊鎭�
+ this.pushData1107(apiRemoteService, param);
+ // 鎺ㄩ�佽揣浣嶄俊鎭�
+ this.pushData1108(apiRemoteService, param);
+ // 鎺ㄩ�佷粨鍌ㄨ澶囦俊鎭�
+ this.pushData1111(apiRemoteService, param);
log.info("姝︽眽鍐涚伯鐪佸钩鍙�--->>>鍩虹淇℃伅 涓婃姤缁撴潫");
}
@@ -79,7 +76,7 @@
List<WhjlApi1101> list = new ArrayList<>();
WhjlApi1101 whjlApi1101;
for (ApiInfoData infoData : items) {
- whjlApi1101 = JSONObject.parseObject(infoData.getData().toString(), WhjlApi1101.class);
+ whjlApi1101 = JSONObject.parseObject(infoData.getData(), WhjlApi1101.class);
whjlApi1101.setKqdm(infoData.getKqdm());
whjlApi1101.setCzbz(infoData.getCzbz());
whjlApi1101.setUpdateTime(infoData.getUpdateTime());
@@ -92,7 +89,235 @@
if (responseDto.getSuccess() == 0) {
//鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
for (ApiInfoData data : items) {
- if(Constant.CZBZ_I.equals(data.getCzbz())){
+ if (Constant.CZBZ_I.equals(data.getCzbz())) {
+
+ data.setCzbz(Constant.CZBZ_U);
+ apiInfoDataRep.save(data);
+ }
+ }
+ }
+ }
+
+ /**
+ * 1102 鍐涗緵绔欑偣淇℃伅
+ */
+ private void pushData1102(ApiRemoteService apiRemoteService, ApiParam param) {
+
+ //鑾峰彇鍐涘伐浼佷笟淇℃伅
+ List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1102);
+
+ if (null == items || items.isEmpty()) {
+ return;
+ }
+ param.setInteCategory(WhjlConstant.API_CATEGORY_11);
+ param.setInteId(WhjlConstant.API_CODE_1102);
+ List<WhjlApi1102> list = new ArrayList<>();
+ WhjlApi1102 whjlApi1102;
+ for (ApiInfoData infoData : items) {
+ whjlApi1102 = JSONObject.parseObject(infoData.getData(), WhjlApi1102.class);
+ whjlApi1102.setKqdm(infoData.getKqdm());
+ whjlApi1102.setCzbz(infoData.getCzbz());
+ whjlApi1102.setUpdateTime(infoData.getUpdateTime());
+ whjlApi1102.setBizId(infoData.getDataId());
+ list.add(whjlApi1102);
+ }
+
+ //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
+ ResponseDto responseDto = apiRemoteService.pushData(param, list);
+ if (responseDto.getSuccess() == 0) {
+ //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
+ for (ApiInfoData data : items) {
+ if (Constant.CZBZ_I.equals(data.getCzbz())) {
+
+ data.setCzbz(Constant.CZBZ_U);
+ apiInfoDataRep.save(data);
+ }
+ }
+ }
+ }
+
+ /**
+ * 1103 鍐涘伐浜哄憳淇℃伅
+ */
+ private void pushData1103(ApiRemoteService apiRemoteService, ApiParam param) {
+
+ //鑾峰彇鍐涘伐浼佷笟淇℃伅
+ List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1103);
+
+ if (null == items || items.isEmpty()) {
+ return;
+ }
+ param.setInteCategory(WhjlConstant.API_CATEGORY_11);
+ param.setInteId(WhjlConstant.API_CODE_1103);
+ List<WhjlApi1103> list = new ArrayList<>();
+ WhjlApi1103 whjlApi1103;
+ for (ApiInfoData infoData : items) {
+ whjlApi1103 = JSONObject.parseObject(infoData.getData(), WhjlApi1103.class);
+ whjlApi1103.setKqdm(infoData.getKqdm());
+ whjlApi1103.setCzbz(infoData.getCzbz());
+ whjlApi1103.setUpdateTime(infoData.getUpdateTime());
+ whjlApi1103.setBizId(infoData.getDataId());
+ list.add(whjlApi1103);
+ }
+
+ //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
+ ResponseDto responseDto = apiRemoteService.pushData(param, list);
+ if (responseDto.getSuccess() == 0) {
+ //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
+ for (ApiInfoData data : items) {
+ if (Constant.CZBZ_I.equals(data.getCzbz())) {
+
+ data.setCzbz(Constant.CZBZ_U);
+ apiInfoDataRep.save(data);
+ }
+ }
+ }
+ }
+
+ /**
+ * 1105 浠撴埧淇℃伅
+ */
+ private void pushData1105(ApiRemoteService apiRemoteService, ApiParam param) {
+
+ //鑾峰彇鍐涘伐浼佷笟淇℃伅
+ List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1105);
+
+ if (null == items || items.isEmpty()) {
+ return;
+ }
+ param.setInteCategory(WhjlConstant.API_CATEGORY_11);
+ param.setInteId(WhjlConstant.API_CODE_1105);
+ List<WhjlApi1105> list = new ArrayList<>();
+ WhjlApi1105 whjlApi1105;
+ for (ApiInfoData infoData : items) {
+ whjlApi1105 = JSONObject.parseObject(infoData.getData(), WhjlApi1105.class);
+ whjlApi1105.setKqdm(infoData.getKqdm());
+ whjlApi1105.setCzbz(infoData.getCzbz());
+ whjlApi1105.setUpdateTime(infoData.getUpdateTime());
+ whjlApi1105.setBizId(infoData.getDataId());
+ list.add(whjlApi1105);
+ }
+
+ //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
+ ResponseDto responseDto = apiRemoteService.pushData(param, list);
+ if (responseDto.getSuccess() == 0) {
+ //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
+ for (ApiInfoData data : items) {
+ if (Constant.CZBZ_I.equals(data.getCzbz())) {
+
+ data.setCzbz(Constant.CZBZ_U);
+ apiInfoDataRep.save(data);
+ }
+ }
+ }
+ }
+
+ /**
+ * 1106 寤掗棿淇℃伅
+ */
+ private void pushData1107(ApiRemoteService apiRemoteService, ApiParam param) {
+
+ //鑾峰彇鍐涘伐浼佷笟淇℃伅
+ List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1107);
+
+ if (null == items || items.isEmpty()) {
+ return;
+ }
+ param.setInteCategory(WhjlConstant.API_CATEGORY_11);
+ param.setInteId(WhjlConstant.API_CODE_1107);
+ List<WhjlApi1107> list = new ArrayList<>();
+ WhjlApi1107 whjlApi1106;
+ for (ApiInfoData infoData : items) {
+ whjlApi1106 = JSONObject.parseObject(infoData.getData(), WhjlApi1107.class);
+ whjlApi1106.setKqdm(infoData.getKqdm());
+ whjlApi1106.setCzbz(infoData.getCzbz());
+ whjlApi1106.setUpdateTime(infoData.getUpdateTime());
+ whjlApi1106.setBizId(infoData.getDataId());
+ list.add(whjlApi1106);
+ }
+
+ //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
+ ResponseDto responseDto = apiRemoteService.pushData(param, list);
+ if (responseDto.getSuccess() == 0) {
+ //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
+ for (ApiInfoData data : items) {
+ if (Constant.CZBZ_I.equals(data.getCzbz())) {
+
+ data.setCzbz(Constant.CZBZ_U);
+ apiInfoDataRep.save(data);
+ }
+ }
+ }
+ }
+
+ /**
+ * 1107 璐т綅淇℃伅
+ */
+ private void pushData1108(ApiRemoteService apiRemoteService, ApiParam param) {
+
+ //鑾峰彇鍐涘伐浼佷笟淇℃伅
+ List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1108);
+
+ if (null == items || items.isEmpty()) {
+ return;
+ }
+ param.setInteCategory(WhjlConstant.API_CATEGORY_11);
+ param.setInteId(WhjlConstant.API_CODE_1108);
+ List<WhjlApi1108> list = new ArrayList<>();
+ WhjlApi1108 whjlApi1107;
+ for (ApiInfoData infoData : items) {
+ whjlApi1107 = JSONObject.parseObject(infoData.getData(), WhjlApi1108.class);
+ whjlApi1107.setKqdm(infoData.getKqdm());
+ whjlApi1107.setCzbz(infoData.getCzbz());
+ whjlApi1107.setUpdateTime(infoData.getUpdateTime());
+ whjlApi1107.setBizId(infoData.getDataId());
+ list.add(whjlApi1107);
+ }
+
+ //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
+ ResponseDto responseDto = apiRemoteService.pushData(param, list);
+ if (responseDto.getSuccess() == 0) {
+ //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
+ for (ApiInfoData data : items) {
+ if (Constant.CZBZ_I.equals(data.getCzbz())) {
+
+ data.setCzbz(Constant.CZBZ_U);
+ apiInfoDataRep.save(data);
+ }
+ }
+ }
+ }
+
+ /**
+ * 1111 浠撳偍璁惧淇℃伅
+ */
+ private void pushData1111(ApiRemoteService apiRemoteService, ApiParam param) {
+
+ //鑾峰彇鍐涘伐浼佷笟淇℃伅
+ List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1111);
+
+ if (null == items || items.isEmpty()) {
+ return;
+ }
+ param.setInteCategory(WhjlConstant.API_CATEGORY_11);
+ param.setInteId(WhjlConstant.API_CODE_1111);
+ List<WhjlApi1112> list = new ArrayList<>();
+ WhjlApi1112 whjlApi1111;
+ for (ApiInfoData infoData : items) {
+ whjlApi1111 = JSONObject.parseObject(infoData.getData(), WhjlApi1112.class);
+ whjlApi1111.setKqdm(infoData.getKqdm());
+ whjlApi1111.setCzbz(infoData.getCzbz());
+ whjlApi1111.setUpdateTime(infoData.getUpdateTime());
+ whjlApi1111.setBizId(infoData.getDataId());
+ list.add(whjlApi1111);
+ }
+
+ //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
+ ResponseDto responseDto = apiRemoteService.pushData(param, list);
+ if (responseDto.getSuccess() == 0) {
+ //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
+ for (ApiInfoData data : items) {
+ if (Constant.CZBZ_I.equals(data.getCzbz())) {
data.setCzbz(Constant.CZBZ_U);
apiInfoDataRep.save(data);
--
Gitblit v1.9.3