From 998770ccd5fac7417c5b680b03b28c439cc31561 Mon Sep 17 00:00:00 2001 From: CZT <czt18638530771@163.com> Date: 星期一, 21 八月 2023 19:19:59 +0800 Subject: [PATCH] 上海市接口-增加粮情设备数据同步 --- src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2103.java | 195 +++++++++++++++++ src/main/java/com/fzzy/api/timer/SyncDataScheduled.java | 1 src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java | 18 + src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103Item.java | 38 +++ src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncDepotRep.java | 28 ++ src/main/java/com/fzzy/async/fzzy40/entity/Fz40Depot.java | 134 ++++++++++++ src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncDepotConfRep.java | 25 ++ src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103.java | 71 ++++++ src/main/java/com/fzzy/async/fzzy40/entity/Fz40DepotConfKey.java | 16 + src/main/java/com/fzzy/async/fzzy40/entity/Fz40DepotConf.java | 128 +++++++++++ 10 files changed, 654 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/fzzy/api/timer/SyncDataScheduled.java b/src/main/java/com/fzzy/api/timer/SyncDataScheduled.java index 8b81d8a..f232f3a 100644 --- a/src/main/java/com/fzzy/api/timer/SyncDataScheduled.java +++ b/src/main/java/com/fzzy/api/timer/SyncDataScheduled.java @@ -135,6 +135,7 @@ ApiParam param = new ApiParam(); param.setSyncProtocol(conf.getSyncProtocol()); + param.setPushProtocol(conf.getPushProtocol()); param.setKqdm(conf.getKqdm()); param.setStart(start); param.setEnd(exeDate); diff --git a/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java b/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java index 13f0fc2..2e23d5f 100644 --- a/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java +++ b/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java @@ -1,9 +1,11 @@ package com.fzzy.async.fzzy40; import com.fzzy.api.data.ApiParam; +import com.fzzy.api.data.PushProtocol; import com.fzzy.api.data.SyncProtocol; import com.fzzy.api.service.SyncService13; import com.fzzy.async.fzzy40.impl.*; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -29,6 +31,8 @@ private Fzzy40Sync1306 fzzySync1306; @Autowired private Fzzy40Sync1310 fzzySync1310; + @Autowired + private Fzzy40Sync2103 fzzy40Sync2103; @Override public String getProtocol() { @@ -38,6 +42,20 @@ @Override public void syncData(ApiParam param) { + + //鍚勭渷鐙湁鎺ュ彛淇℃伅鍚屾 + if(StringUtils.isNotEmpty(param.getPushProtocol()) && PushProtocol.SB_GD_2022.equals(param.getPushProtocol())){ + //骞夸笢鐪佸钩鍙�2022鐗堬紝闇�瑕佸悓姝ョ啅钂稿妗堜俊鎭� + //TODO 鐔忚捀澶囨鍚屾 + + } + if(StringUtils.isNotEmpty(param.getPushProtocol()) && PushProtocol.SB_SH_2023.equals(param.getPushProtocol())){ + //涓婃捣甯傚钩鍙�2023鐗堬紝闇�瑕佸悓姝ョ伯鎯呰澶囬厤缃俊鎭� + + //鍚屾绮儏璁惧閰嶇疆淇℃伅 + fzzy40Sync2103.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd()); + } + //娓╂箍搴︽娴嬫暟鎹悓姝� fzzySync1302.syncData(param.getDeptId(), param.getStart(), param.getEnd()); diff --git a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40Depot.java b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40Depot.java new file mode 100644 index 0000000..bfb2e56 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40Depot.java @@ -0,0 +1,134 @@ +package com.fzzy.async.fzzy40.entity; + +import com.bstek.dorado.annotation.PropertyDef; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + + +/** + * @Desc: 鍩虹淇℃伅-璐т綅淇℃伅 + * @author: Andy + * @update-time: 2023/5/26 + */ +@Data +@Entity +@Table(name = "D_DEPOT") +public class Fz40Depot implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + + + @Id + @Column(name = "ID_", length = 50) + @PropertyDef(label = "璐т綅缂栧彿") + private String id; + + @Column(name = "COMPANY_ID_", length = 10) + @PropertyDef(label = "缁勭粐缂栫爜") + private String companyId; + + @Column(name = "DEPT_ID_", length = 40) + @PropertyDef(label = "鎵�灞炲垎搴�") + private String deptId; + + @Column(name = "ggm", length = 50) + @PropertyDef(label = "鍥借鐮�") + private String ggm; + + @Column(name = "NAME_", length = 50) + @PropertyDef(label = "璐т綅鍚嶇О") + private String name; + + @Column(name = "BUILDING_ID_", length = 40) + @PropertyDef(label = "鎵�灞炰粨鎴�") + private String buildingId; + + @Column(name = "GRANARY_ID_", length = 40) + @PropertyDef(label = "鎵�灞炲粧闂�") + private String granaryId; + + @Column(name = "DEPOT_TYPE_", length = 10) + @PropertyDef(label = "浠撳簱绫诲瀷", description = "鏍规嵁鍥芥爣閰嶇疆绫诲瀷锛屽钩鎴夸粨銆佺珛绛掍粨銆佹祬鍦嗕粨銆佸偍娌圭綈") + private String depotType; + + @Column(name = "DEPOT_STATUS_", length = 10) + @PropertyDef(label = "浠撳簱鐘舵��", description = "涓庡簱瀛樿〃鍏宠仈锛岄�氳繃搴撳瓨鍙樻洿") + private String depotStatus; + + @Column(name = "STORE_TYPE_", length = 6) + @PropertyDef(label = "鍌ㄧ伯鏂瑰紡", description = "涓庡簱瀛樿〃鍏宠仈") + private String storeType; + + @Column(name = "STORAGE_MAX_") + @PropertyDef(label = "璁捐鍌ㄩ噺", description = "鍗曚綅锛氬惃") + private Double storageMax; + + @Column(name = "STORAGE_REAL_", insertable = true) + @PropertyDef(label = "瀹為檯鍌ㄩ噺", description = "鍗曚綅锛欿G锛岄�氳繃搴撳瓨鍙樻洿") + private Double storageReal; + + @Column(name = "FOOD_TYPE_", length = 10) + @PropertyDef(label = "绮鎬ц川", description = "涓庡簱瀛樿〃鍏宠仈锛岄�氳繃搴撳瓨鍙樻洿") + private String foodType; + + @Column(name = "FOOD_VARIETY_", length = 10) + @PropertyDef(label = "绮鍝佺", description = "涓庡簱瀛樿〃鍏宠仈锛岄�氳繃搴撳瓨鍙樻洿") + private String foodVariety; + + @Column(name = "FOOD_LEVEL_", length = 10) + @PropertyDef(label = "绮绛夌骇", description = "涓庡簱瀛樿〃鍏宠仈锛岄�氳繃搴撳瓨鍙樻洿") + private String foodLevel; + + @Column(name = "FOOD_LOCATION_", length = 50) + @PropertyDef(label = "绮浜у湴", description = "涓庡簱瀛樿〃鍏宠仈锛岄�氳繃搴撳瓨鍙樻洿") + private String foodLocation; + + @Column(name = "FOOD_YEAR_", length = 10) + @PropertyDef(label = "绮骞翠唤", description = "涓庡簱瀛樿〃鍏宠仈锛岄�氳繃搴撳瓨鍙樻洿") + private String foodYear; + + @Column(name = "PER_WET_") + @PropertyDef(label = "姘村垎", description = "鐧惧垎姣旓紝榛樿涓虹┖锛屾潵婧愯川妫�淇℃伅") + private Double perWet; + + @Column(name = "PER_IMPURITY_") + @PropertyDef(label = "鏉傝川", description = "鐧惧垎姣旓紝榛樿涓虹┖锛屾潵婧愯川妫�淇℃伅") + private Double perImpurity; + + @Column(name = "BULK_WEIGHT_") + @PropertyDef(label = "瀹归噸 g/L", description = "瀹归噸 g/L") + private Double bulkWeight; + + @Column(name = "STORE_KEEPER_", length = 30) + @PropertyDef(label = "淇濈鍛樿处鍙�") + private String storeKeeper; + + @Column(name = "STORE_KEEPER_NAME_", length = 50) + @PropertyDef(label = "淇濈鍛�", description = "涓枃鍚嶇О") + private String storeKeeperName; + + @Column(name = "STORE_DATE_") + @PropertyDef(label = "鍏ュ簱鏃堕棿", description = "榛樿绌猴紝閫氳繃搴撳瓨鍙樻洿") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date storeDate; + + @Column(name = "CHECK_DATE_") + @PropertyDef(label = "鏈�鍚庤川妫�鏃堕棿", description = "榛樿绌猴紝鏉ユ簮璐ㄦ淇℃伅") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date checkDate; + + @Column(name = "REMARK_", length = 200) + @PropertyDef(label = "澶囨敞", description = "澶囨敞淇℃伅") + private String remark; + + @Column(name = "UPDATE_TIME_") + @PropertyDef(label = "鏁版嵁鏇存柊鏃堕棿") + private Date updateTime; + +} diff --git a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40DepotConf.java b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40DepotConf.java new file mode 100644 index 0000000..a04e791 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40DepotConf.java @@ -0,0 +1,128 @@ +package com.fzzy.async.fzzy40.entity; + +import com.bstek.dorado.annotation.PropertyDef; +import lombok.Data; +import javax.persistence.*; +import java.io.Serializable; + +/** + * 浠撳簱閰嶇疆 鐢ㄤ簬閰嶇疆绮儏鍒嗘満绛夐厤缃紝姘斾綋閲囬泦閰嶇疆绛� + */ +@Data +@Entity +@Table(name = "D_DEPOT_CONF") +@IdClass(Fz40DepotConfKey.class) +public class Fz40DepotConf implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "COMPANY_ID_", length = 10) + @PropertyDef(label = "缁勭粐缂栫爜") + private String companyId; + + @Id + @Column(name = "DEPOT_ID_", length = 50) + @PropertyDef(label = "鎵�灞炰粨搴�") + private String depotId; + + @Column(name = "GRAIN_SER_", length = 40) + @PropertyDef(label = "绮儏鍒嗘満", description = "浠呬粎绮儏閲囬泦鍒嗘満") + private String grainSer; + + @Column(name = "TH_SER_", length = 40) + @PropertyDef(label = "娓╂箍搴﹀垎鏈�", description = "浠撴俯浠撴箍鐨勫垎鏈�") + private String thSer; + + @Column(name = "ES_SER_", length = 40) + @PropertyDef(label = "鑳借�楀垎鏈�") + private String esSer; + + @Column(name = "GAS_SER_", length = 40) + @PropertyDef(label = "姘斾綋鍒嗘満") + private String gasSer; + + @Column(name = "GRAIN_FREQ_", length = 4) + @PropertyDef(label = "绮儏淇濆瓨棰戠巼", description = "榛樿涓�澶╁娆�") + private String grainFreq; + + @Column(name = "TH_CONF_", length = 5) + @PropertyDef(label = "浠撴俯浠撴箍閫氶亾") + private String thConf = "1"; + + @Column(name = "CABLE_RULE_", length = 20) + @PropertyDef(label = "甯冪嚎瑙勫垯", description = "骞虫柟浠撹〃绀哄眰琛屽垪锛岀瓛浠撹〃绀烘瘡鍦堢殑鍒楁暟") + private String cableRule; + + @Column(name = "CABLE_CIR_", length = 20) + @PropertyDef(label = "绛掍粨灞傝鍒�", description = "閽堝绛掍粨") + private String cableCir; + + @Column(name = "CABLE_CONE_", length = 2) + @PropertyDef(label = "绛掍粨閿ュ舰", description = "閽堝绛掍粨閿ュ舰锛�0=鏃犲垽鏂紝1=涓婇敟褰紝2=涓嬮敟褰�") + private String cableCone; + + @Column(name = "CABLE_START_") + @PropertyDef(label = "鐢电紗寮�濮嬪垪") + private int cableStart; + + @Column(name = "CABLE_END_") + @PropertyDef(label = "鐢电紗鎴嚦鍒�") + private int cableEnd; + + @Column(name = "START_ORIENTATION_", length = 20) + @PropertyDef(label = "鐢电紗寮�濮嬫柟浣�", description = "榛樿鍙宠竟(鍙宠竟銆佸彸涓娿�佸乏杈广�佸乏涓�)") + private String startOrientation; + + @Column(name = "START_DIRECTION_", length = 20) + @PropertyDef(label = "鐢电紗寮�濮嬫柟鍚�", description = "榛樿绾靛悜(绾靛悜銆佹í鍚�)") + private String startDirection; + + @Column(name = "START_POINT_", length = 20) + @PropertyDef(label = "鐢电紗寮�濮嬬偣浣�", description = "榛樿椤堕儴(椤堕儴銆佸簳閮�)") + private String startPoint; + + @Column(name = "TEMP_MAX_") + @PropertyDef(label = "娓╁害涓婇檺") + private Double tempMax; + + @Column(name = "GAS_START_") + @PropertyDef(label = "姘斾綋閲囬泦鐐瑰紑濮�") + private int gasStart; + + @Column(name = "GAS_END_") + @PropertyDef(label = "姘斾綋閲囬泦鐐规埅鑷�") + private int gasEnd; + + @Column(name = "N2_MAX_") + @PropertyDef(label = "姘皵涓婇檺") + private Double n2Max; + + @Column(name = "CO2_MAX_") + @PropertyDef(label = "浜屾哀鍖栫⒊涓婇檺") + private Double co2Max; + + @Column(name = "O2_MAX_") + @PropertyDef(label = "姘ф皵涓婇檺") + private Double o2Max; + + @Column(name = "PH3_MAX_") + @PropertyDef(label = "纾峰寲姘笂闄�") + private Double ph3Max; + + @Column(name = "PEST_START_") + @PropertyDef(label = "铏閲囬泦鐐瑰紑濮�") + private int pestStart; + + @Column(name = "PEST_END_") + @PropertyDef(label = "铏閲囬泦鐐规埅鑷�") + private int pestEnd; + + @Column(name = "PEST_MAX_") + @PropertyDef(label = "铏涓婇檺") + private Double pestMax; + +} \ No newline at end of file diff --git a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40DepotConfKey.java b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40DepotConfKey.java new file mode 100644 index 0000000..0aa6234 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40DepotConfKey.java @@ -0,0 +1,16 @@ +package com.fzzy.async.fzzy40.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +public class Fz40DepotConfKey implements Serializable { + private String depotId; + private String companyId; + public Fz40DepotConfKey(){ + super(); + } + } \ No newline at end of file diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2103.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2103.java new file mode 100644 index 0000000..6d50dcb --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2103.java @@ -0,0 +1,195 @@ +package com.fzzy.async.fzzy40.impl; + +import com.alibaba.fastjson.JSON; +import com.fzzy.api.Constant; +import com.fzzy.api.entity.Api1102; +import com.fzzy.api.entity.Api1105; +import com.fzzy.api.entity.ApiInfoData; +import com.fzzy.api.entity.ApiLog; +import com.fzzy.api.service.ApiCommonService; +import com.fzzy.api.utils.ContextUtil; +import com.fzzy.api.view.repository.Api1102Rep; +import com.fzzy.api.view.repository.ApiInfoDataRep; +import com.fzzy.api.view.repository.ApiLogRep; +import com.fzzy.async.fzzy40.entity.Fz40Depot; +import com.fzzy.async.fzzy40.entity.Fz40DepotConf; +import com.fzzy.async.fzzy40.repository.Fzzy40SyncDepotConfRep; +import com.fzzy.async.fzzy40.repository.Fzzy40SyncDepotRep; +import com.fzzy.push.sh2023.SH2023Constant; +import com.fzzy.push.sh2023.dto.SH2023Api2103; +import com.fzzy.push.sh2023.dto.SH2023Api2103Item; +import com.fzzy.push.sh2023.dto.ShAreaBjw; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 绮儏妫�娴嬭澶囦俊鎭悓姝� + * + * @author czt + * @date 2023-08-21 + */ +@Slf4j +@Component +public class Fzzy40Sync2103 { + + @Autowired + private Fzzy40SyncDepotRep fzzy40SyncDepotRep; + @Autowired + private Fzzy40SyncDepotConfRep fzzy40SyncDepotConfRep; + @Autowired + private ApiCommonService commonService; + @Autowired + private Api1102Rep api1102Rep; + @Autowired + private ApiLogRep apiLogRep; + @Autowired + private ApiInfoDataRep apiInfoDataRep; + + + /** + * 鍚屾骞跺皝瑁呬繚瀛樻俯婀垮害妫�娴嬫暟鎹� + * + * @param kqdm + * @param deptId 绯荤粺瀵瑰簲搴撳尯缂栫爜 + * @param start 璧峰鏃堕棿 + * @param end 鎴鏃堕棿 + */ + public void syncData(String kqdm, String deptId, Date start, Date end) { + + log.info("-------------1302鎺ュ彛鏁版嵁寮�濮嬪悓姝�------------------"); + //鍚屾鏁版嵁锛屽彧璁板綍澶辫触鐨勪俊鎭� + ApiLog apiLog = new ApiLog(); + apiLog.setType(ApiLog.TYPE_SYNC); + apiLog.setKqdm(deptId); + apiLog.setUploadTime(new Date()); + apiLog.setInteId(Constant.API_CODE_1302); + apiLog.setStatus(99); + apiLog.setId(ContextUtil.getUUID()); + try { + List<Fz40Depot> list = fzzy40SyncDepotRep.listDepotList(deptId); + + if (null == list || list.isEmpty()) { + log.info("2103---绮儏璁惧閰嶇疆鍚屾鏁版嵁锛氭病鏈夋煡璇㈠埌浠撳簱淇℃伅"); + return; + } + + List<Api1102> api1102List = api1102Rep.findPushData(kqdm); + String bjw = ""; + if(null != api1102List && api1102List.size() > 0){ + bjw = ShAreaBjw.getBjw(api1102List.get(0).getXzqhdm()); + } + + SH2023Api2103 sh2023Api2103; + Api1105 api1105; + List<Fz40DepotConf> depotConfList; + Fz40DepotConf depotConf; + + List<ApiInfoData> apiInfoDataList; + SH2023Api2103Item sh2023Api2103Item; + List<SH2023Api2103Item> listItem; + for (Fz40Depot fz40Depot : list) { + //鏍规嵁浠撳簱缂栫爜鑾峰彇閰嶇疆淇℃伅 + depotConfList = fzzy40SyncDepotConfRep.findDataByDepotId(fz40Depot.getId()); + if(null == depotConfList || depotConfList.isEmpty()){ + continue; + } + //鑾峰彇璐т綅淇℃伅 + api1105 = commonService.getApi1105Cache(fz40Depot.getId()); + if (null == api1105) { + continue; + } + + sh2023Api2103 = new SH2023Api2103(); + sh2023Api2103.setHwdm(api1105.getHwdm()); + depotConf = depotConfList.get(0); + String[] strs = depotConf.getCableRule().split("-"); + + sh2023Api2103.setDlcs(strs[0]); + sh2023Api2103.setDlhs(strs[1]); + sh2023Api2103.setDlls(strs[2]); + // 1-3-5 + // 8-8-8 + //绛掍粨瑙勫垯 + if(StringUtils.isNotEmpty(depotConf.getCableCir())){ + sh2023Api2103.setDlqs(String.valueOf(strs.length)); + sh2023Api2103.setDlhs(null); + sh2023Api2103.setDlls(null); + + //鐢电紗鍦堟帓鍒楄鎯� + listItem = new ArrayList<>(); + String[] cableCir = depotConf.getCableCir().split("-"); + int num1 = 0; //璧峰鏍� + int num2 = 0; //鎴鏍� + for(int i = 0; i < cableCir.length; i ++){ + sh2023Api2103.setDlcs(cableCir[i]); + + sh2023Api2103Item = new SH2023Api2103Item(); + sh2023Api2103Item.setQh(i + 1 + ""); + if(i == 0){ + num1 += 1; + }else { + num1 = num2 + 1; + } + num2 += Integer.valueOf(strs[i]); + sh2023Api2103Item.setQsdlbh(num1 + ""); + sh2023Api2103Item.setJsdlbh(num2 + ""); + sh2023Api2103Item.setCs(cableCir[i]); + sh2023Api2103Item.setYbj((i + 1)*4 + ""); + sh2023Api2103Item.setRowId(i + ""); + listItem.add(sh2023Api2103Item); + } + sh2023Api2103.setDlqplxq(JSON.toJSONString(listItem)); + } + + sh2023Api2103.setScqd("1"); + sh2023Api2103.setSczd(Integer.valueOf(strs[1])*Integer.valueOf(strs[2]) + ""); + + sh2023Api2103.setZcqd("1"); + sh2023Api2103.setZczd(Integer.valueOf(strs[1])*Integer.valueOf(strs[2]) + ""); + + sh2023Api2103.setXcqd("1"); + sh2023Api2103.setXczd(Integer.valueOf(strs[1])*Integer.valueOf(strs[2]) + ""); + + sh2023Api2103.setYxfwqsc("1"); + sh2023Api2103.setYxfwjsc(strs[0]); + + sh2023Api2103.setBjw(bjw); + sh2023Api2103.setZhgxsj(new Date()); + + //鎸佷箙鍖栦繚瀛橈紝鍗曠嫭瀛樺叆闈炲浗鏍囨帴鍙h〃 + ApiInfoData infoData = new ApiInfoData(); + infoData.setId(sh2023Api2103.getHwdm()); + infoData.setKqdm(kqdm); + infoData.setInteType(Constant.API_CATEGORY_13); + infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2103); + infoData.setUpdateTime(new Date()); + infoData.setDataId(sh2023Api2103.getHwdm()); + infoData.setRemarks("绮儏璁惧閰嶇疆淇℃伅"); + + //璁剧疆鎿嶄綔鏍囧織 + apiInfoDataList = apiInfoDataRep.getDataByDataId(infoData.getDataId()); + if (null == apiInfoDataList || apiInfoDataList.isEmpty()) { + infoData.setCzbz(Constant.CZBZ_I); + } else { + infoData.setCzbz(apiInfoDataList.get(0).getCzbz()); + } + + infoData.setData(JSON.toJSONString(sh2023Api2103)); + apiInfoDataRep.save(infoData); + + log.info("2103---绮儏璁惧閰嶇疆-鍚屾鏁版嵁锛歿}", sh2023Api2103.toString()); + } + + } catch (Exception e) { + log.error("---鍚屾澶辫触----{}", e); + apiLog.setResult("鍚屾澶辫触锛�" + e.getMessage()); + apiLogRep.save(apiLog); + } + + } +} diff --git a/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncDepotConfRep.java b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncDepotConfRep.java new file mode 100644 index 0000000..004902d --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncDepotConfRep.java @@ -0,0 +1,25 @@ +package com.fzzy.async.fzzy40.repository; + +import com.fzzy.async.fzzy40.entity.Fz40DepotConf; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import java.util.List; + +/** + * 鏌ヨ绮儏妫�娴嬫暟鎹� + * + * @author czt + * + * @date 2023-08-21 + */ +public interface Fzzy40SyncDepotConfRep extends JpaRepository<Fz40DepotConf, String> { + + /** + * 鏍规嵁浠撳簱缂栫爜鑾峰彇绮儏鍙傛暟閰嶇疆淇℃伅 + * @param depotId + * @return + */ + @Query("from Fz40DepotConf where depotId =:depotId order by depotId ") + List<Fz40DepotConf> findDataByDepotId(@Param("depotId") String depotId); +} diff --git a/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncDepotRep.java b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncDepotRep.java new file mode 100644 index 0000000..bf9c53b --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncDepotRep.java @@ -0,0 +1,28 @@ +package com.fzzy.async.fzzy40.repository; + +import com.fzzy.async.fzzy40.entity.Fz40Depot; +import com.fzzy.async.fzzy40.entity.Fz40InoutRecord; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import java.util.Date; +import java.util.List; + +/** + * 鑾峰彇浠撳簱淇℃伅 + * + * @author czt + * @date 2023-08-21 + */ +public interface Fzzy40SyncDepotRep extends JpaRepository<Fz40Depot, String> { + + /** + * 鏍规嵁搴撳尯缂栫爜鑾峰彇璐т綅鍒楄〃 + * @param deptId + * @return + */ + @Query("from Fz40Depot where deptId=:deptId order by id ") + List<Fz40Depot> listDepotList(@Param("deptId") String deptId); + +} diff --git a/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103.java b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103.java new file mode 100644 index 0000000..2492cde --- /dev/null +++ b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103.java @@ -0,0 +1,71 @@ +package com.fzzy.push.sh2023.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.bstek.dorado.annotation.PropertyDef; +import com.fzzy.api.entity.ApiParent; +import lombok.Data; +import java.io.Serializable; +import java.util.Date; + +/** + * 绮儏璁惧閰嶇疆 + * + * @author czt + * + * @date 2023-08-21 + */ +@Data +public class SH2023Api2103 extends ApiParent implements Serializable { + + private static final long serialVersionUID = 9157617424050247565L; + + @PropertyDef(label = "璐т綅浠g爜") + private String hwdm; + + @PropertyDef(label = "鐢电紗琛屾暟") + private String dlhs; + + @PropertyDef(label = "鐢电紗鍒楁暟") + private String dlls; + + @PropertyDef(label = "鐢电紗灞傛暟") + private String dlcs; + + @PropertyDef(label = "鐢电紗鍦堟暟") + private String dlqs; + + @PropertyDef(label = "鐢电紗鍦堟帓鍒楄鎯�") + private String dlqplxq; + + @PropertyDef(label = "涓婂眰璧风偣") + private String scqd; + + @PropertyDef(label = "涓婂眰缁堢偣") + private String sczd; + + @PropertyDef(label = "涓眰璧风偣") + private String zcqd; + + @PropertyDef(label = "涓眰缁堢偣") + private String zczd; + + @PropertyDef(label = "涓嬪眰璧风偣") + private String xcqd; + + @PropertyDef(label = "涓嬪眰缁堢偣") + private String xczd; + + @PropertyDef(label = "鏈夋晥鑼冨洿璧峰灞�") + private String yxfwqsc; + + @PropertyDef(label = "鏈夋晥鑼冨洿缁撴潫灞�") + private String yxfwjsc; + + @PropertyDef(label = "鏍囪浣�") + private String bjw; + + @PropertyDef(label = "鏈�鍚庢洿鏂版椂闂�") + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date zhgxsj; + +} \ No newline at end of file diff --git a/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103Item.java b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103Item.java new file mode 100644 index 0000000..ba165d6 --- /dev/null +++ b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103Item.java @@ -0,0 +1,38 @@ +package com.fzzy.push.sh2023.dto; + +import com.bstek.dorado.annotation.PropertyDef; +import com.fzzy.api.entity.ApiParent; +import lombok.Data; +import java.io.Serializable; + +/** + * 绮儏璁惧閰嶇疆-绛掍粨鐢电紗鍦堟帓鍒楄鎯� + * + * @author czt + * + * @date 2023-08-21 + */ +@Data +public class SH2023Api2103Item extends ApiParent implements Serializable { + + private static final long serialVersionUID = 9157617424050247565L; + + @PropertyDef(label = "鍦堝彿") + private String qh; + + @PropertyDef(label = "璧峰鐢电紗缂栧彿") + private String qsdlbh; + + @PropertyDef(label = "缁撴潫鐢电紗缂栧彿") + private String jsdlbh; + + @PropertyDef(label = "鍚勫湀鎬诲眰鏁�") + private String cs; + + @PropertyDef(label = "鍦堝崐寰�") + private String ybj; + + @PropertyDef(label = "搴忓彿") + private String rowId; + +} \ No newline at end of file -- Gitblit v1.9.3