From d6aa5189807dbbb1532e093af075473d28f52aae Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期五, 15 九月 2023 15:24:38 +0800
Subject: [PATCH] 添加3.5版本熏蒸作业同步
---
src/main/java/com/fzzy/async/fzzy35/entity/Fz35DrugLog.java | 312 +++++++++++++++++++++++++++++++++++++++
src/main/java/com/fzzy/async/fzzy35/repository/Fzzy35Sync1306Rep.java | 27 +++
src/main/java/com/fzzy/async/fzzy35/Fzzy35SyncService13.java | 12
src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1306.java | 113 ++++++++++++++
4 files changed, 459 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/fzzy/async/fzzy35/Fzzy35SyncService13.java b/src/main/java/com/fzzy/async/fzzy35/Fzzy35SyncService13.java
index 30a75db..2747e54 100644
--- a/src/main/java/com/fzzy/async/fzzy35/Fzzy35SyncService13.java
+++ b/src/main/java/com/fzzy/async/fzzy35/Fzzy35SyncService13.java
@@ -26,6 +26,8 @@
private Fzzy35Sync1310 fzzySync1310;
@Autowired
private Fzzy35Sync1023 fzzySync1023;
+ @Autowired
+ private Fzzy35Sync1306 fzzy35Sync1306;
@Override
@@ -55,12 +57,12 @@
fzzySync1023.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd());
}
-//
-// //閫氶浣滀笟淇℃伅鍚屾
+
+ //閫氶浣滀笟淇℃伅鍚屾
// fzzySync1305.syncData(param.getDeptId(), param.getStart(), param.getEnd());
-//
-// //鐔忚捀浣滀笟淇℃伅鍚屾
-// fzzySync1306.syncData(param.getDeptId(), param.getStart(), param.getEnd());
+
+ //鐔忚捀浣滀笟淇℃伅鍚屾
+ fzzy35Sync1306.syncData(param.getDeptId(), param.getDeptId(), param.getStart(), param.getEnd());
}
}
diff --git a/src/main/java/com/fzzy/async/fzzy35/entity/Fz35DrugLog.java b/src/main/java/com/fzzy/async/fzzy35/entity/Fz35DrugLog.java
new file mode 100644
index 0000000..69b80ec
--- /dev/null
+++ b/src/main/java/com/fzzy/async/fzzy35/entity/Fz35DrugLog.java
@@ -0,0 +1,312 @@
+package com.fzzy.async.fzzy35.entity;
+
+import com.bstek.dorado.annotation.PropertyDef;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 鐜祦鐔忚捀-鐔忚捀浣滀笟璁板綍
+ *
+ * @date 2023骞�7鏈�26鏃�
+ */
+@Data
+@Entity
+@Table(name = "D_DRUG_LOG")
+public class Fz35DrugLog implements Serializable {
+
+ @Id
+ @Column(name = "ID_", length = 40)
+ @PropertyDef(label = "鐔忚捀浣滀笟鍗曞彿", description = "浠撴埧浠g爜+浣滀笟鏃ユ湡 (yyyyMMdd) +3 浣嶉『搴忓彿")
+ 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 = "DEPOT_ID_", length = 50)
+ @PropertyDef(label = "浠撳簱")
+ private String depotId;
+
+ @Column(name = "START_")
+ @PropertyDef(label = "寮�濮嬫椂闂�")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date start;
+
+ @Column(name = "END_")
+ @PropertyDef(label = "鎴嚦鏃堕棿")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date end;
+
+ @Column(name = "PEST_BATCH_ID_", length = 50)
+ @PropertyDef(label = "铏妫�娴嬪崟鍙�")
+ private String pestBatchId;
+
+ @Column(name = "NUM_")
+ @PropertyDef(label = "绗嚑娆$啅钂�")
+ private Integer num = 0;
+
+
+ @Column(name = "MODE_", length = 1)
+ @PropertyDef(label = "鐔忚捀鏂瑰紡", description = "0:绮潰娼В1:甯冭鍩嬭棌2:鎺㈢3:缁煎悎鏂借嵂")
+ private String mode;
+
+ @Column(name = "RECIR_MODE_", length = 1)
+ @PropertyDef(label = "鐜祦鐔忚捀鏂瑰紡", description = "0:鍥哄畾寮忓竷缃舰寮�1:绉诲姩寮忓竷缃舰寮�")
+ private String recirMode;
+
+ @Column(name = "hlxzynhljsjh", length = 1)
+ @PropertyDef(label = "鐜祦鐔忚捀涓庡唴鐜祦鎶�鏈粨鍚�", description = "0:鍒嗗埆浣跨敤_鍥哄畾寮�1:鍒嗗埆浣跨敤_绉诲姩寮�2:浜屽悎涓�搴旂敤_鍗曞悜鎺у埗3:浜屽悎涓�搴旂敤_鍙屽悜鎺у埗")
+ private String hlxzynhljsjh;
+
+ @PropertyDef(label = "鐔忚捀鏂规鍒跺畾")
+ @Column(name = "xzfazd", length = 128)
+ private String xzfazd;
+
+ @PropertyDef(label = "鐔忚捀鏂规璧疯崏浜�")
+ @Column(name = "xzfaqcr", length = 64)
+ private String xzfaqcr;
+
+ @PropertyDef(label = "鐔忚捀鏂规鎵瑰噯浜�")
+ @Column(name = "xzfapzr", length = 64)
+ private String xzfapzr;
+
+ @PropertyDef(label = "鐔忚捀鏂规鎶ュ鎯呭喌")
+ @Column(name = "xzfabbqk", length = 64)
+ private String xzfabbqk;
+
+ @PropertyDef(label = "鏂借嵂浜哄憳璧勮川鎯呭喌")
+ @Column(name = "syryzzqk", length = 64)
+ private String syryzzqk;
+
+ @PropertyDef(label = "鏂借嵂璧勮川瀹℃牳")
+ @Column(name = "syzzsh", length = 64)
+ private String syzzsh;
+
+ @Column(name = "DRUG_NAME_", length = 64)
+ @PropertyDef(label = "鑽墏鍚嶇О")
+ private String drugName;
+
+ @PropertyDef(label = "鍓傚瀷")
+ @Column(name = "jx", length = 64)
+ private String jx;
+
+ @Column(name = "CONCENTRATION_", length = 50)
+ @PropertyDef(label = "鑽墏娴撳害", description = "%")
+ private Double concentration = 0.0;
+
+ @Column(name = "GRAIN_DOSE_")
+ @PropertyDef(label = "绮爢鍗曚綅鐢ㄨ嵂閲�", description = "g/m鲁")
+ private Double grainDose = 0.0;
+
+ @Column(name = "SPACE_DOSE_")
+ @PropertyDef(label = "绌洪棿鍗曚綅鐢ㄨ嵂閲�", description = "g/m鲁")
+ private Double spaceDose = 0.0;
+
+ @Column(name = "DOSE_")
+ @PropertyDef(label = "鎬荤敤鑽噺", description = "kg")
+ private Double dose = 0.0;
+
+ @PropertyDef(label = "鏂借嵂鏂规硶", description = "0:娼В娉�1:浠撳鍙戠敓鍣�2:閽㈢摱姘�")
+ @Column(name = "syff", length = 1)
+ private String syff;
+
+ @PropertyDef(label = "杈呭姪鏂借嵂鎺柦")
+ @Column(name = "fzsycs", length = 128)
+ private String fzsycs;
+
+ @PropertyDef(label = "绌烘皵鍛煎惛鍣ㄥ強瀹夊叏妫�鏌ユ儏鍐�")
+ @Column(name = "kqhqjaqjcqk", length = 128)
+ private String kqhqjaqjcqk;
+
+ @PropertyDef(label = "纾峰寲姘㈡娴嬭缃皟璇曟儏鍐�")
+ @Column(name = "lhqjczztsqk", length = 128)
+ private String lhqjczztsqk;
+
+ @PropertyDef(label = "姘ф皵娣卞害妫�娴嬭缃皟璇曟儏鍐�")
+ @Column(name = "yqsdjczztsqk", length = 128)
+ private String yqsdjczztsqk;
+
+ @PropertyDef(label = "纾峰寲姘㈡姤璀︿华瀹夊叏妫�鏌�")
+ @Column(name = "lhqbjyaqjc", length = 128)
+ private String lhqbjyaqjc;
+
+ @PropertyDef(label = "姘ф皵鎶ヨ浠畨鍏ㄦ鏌�")
+ @Column(name = "yqbjyaqjc", length = 128)
+ private String yqbjyaqjc;
+
+ @PropertyDef(label = "琛ヨ嵂鍓嶄粨鍐呯7鍖栨阿娴撳害")
+ @Column(name = "byqcnlhqnd", precision = 20, scale = 3)
+ private double byqcnlhqnd;
+
+ @PropertyDef(label = "纾峰寲姘㈡祿搴﹀崟浣�", description = "1锛歡/m鲁(榛樿);2锛歱pm;3:ml/m鲁;4锛�%VOL")
+ @Column(name = "nlhqnddw", length = 1)
+ private String nlhqnddw = "1";
+
+ @PropertyDef(label = "鐩爣娴撳害", description = "鍗曚綅锛歡/m鲁")
+ @Column(name = "mbnd", precision = 20, scale = 3)
+ private double mbnd;
+
+ @PropertyDef(label = "璁$畻琛ヨ嵂閲�", description = "鍗曚綅锛歡")
+ @Column(name = "jsbyl", precision = 20, scale = 3)
+ private double jsbyl;
+
+ @PropertyDef(label = "瀹為檯琛ヨ嵂閲�", description = "鍗曚綅锛歡")
+ @Column(name = "sjbyl", precision = 20, scale = 3)
+ private double sjbyl;
+
+ @PropertyDef(label = "琛ヨ嵂鏂规硶")
+ @Column(name = "byff", length = 128)
+ private String byff;
+
+ @PropertyDef(label = "浣滀笟浜烘暟")
+ @Column(name = "zyrs")
+ private Integer zyrs;
+
+ @PropertyDef(label = "琛ヨ嵂浣滀笟鎵瑰噯浜�")
+ @Column(name = "byzypzr", length = 64)
+ private String byzypzr;
+
+ @PropertyDef(label = "鐜板満鎸囨尌浜�")
+ @Column(name = "xczhr", length = 64)
+ private String xczhr;
+
+ @PropertyDef(label = "宄板�兼祿搴�", description = "鍗曚綅锛歡/m鲁")
+ @Column(name = "fznd", precision = 20, scale = 3)
+ private double fznd;
+
+ @PropertyDef(label = "鐩爣娴撳害缁存寔澶╂暟", description = "鍗曚綅锛氬ぉ")
+ @Column(name = "mbndwcts")
+ private Integer mbndwcts;
+
+ @PropertyDef(label = "婕忔皵浣嶇疆鐩戞祴")
+ @Column(name = "lswzjc", length = 128)
+ private String lswzjc;
+
+ @PropertyDef(label = "婕忔皵閮ㄤ綅閲囧彇鐨勮ˉ鏁戞帾鏂�")
+ @Column(name = "lqbwcqdbjcs", length = 128)
+ private String lqbwcqdbjcs;
+
+ @PropertyDef(label = "瀵嗛棴鏃堕棿", description = "鍗曚綅锛氬ぉ")
+ @Column(name = "mbsj")
+ private Integer mbsj;
+
+ @PropertyDef(label = "CT鍊�")
+ @Column(name = "ctz", precision = 20, scale = 3)
+ private double ctz;
+
+ @PropertyDef(label = "鏁f皵鍓嶇7鍖栨阿娴撳害", description = "鍗曚綅锛歡/m鲁")
+ @Column(name = "sqqlhqnd", precision = 20, scale = 3)
+ private double sqqlhqnd;
+
+ @Column(name = "VENTILATE_TIME_")
+ @PropertyDef(label = "鏁f皵鏃堕棿")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date ventilateTime;
+
+ @Column(name = "VENTILATE_METHOD_", length = 100)
+ @PropertyDef(label = "鏁f皵鏂规硶")
+ private String ventilateMethod;
+
+ @PropertyDef(label = "鏁f皵鎵瑰噯浜�")
+ @Column(name = "sqpzr", length = 64)
+ private String sqpzr;
+
+ @PropertyDef(label = "鏁f皵鎸佺画澶╂暟", description = "鍗曚綅锛氬ぉ")
+ @Column(name = "sqcsts")
+ private Integer sqcsts;
+
+ @Column(name = "AFTER_PH3_")
+ @PropertyDef(label = "鏁f皵鍚庣7鍖栨阿娴撳害", description = "鍗曚綅锛歡/m鲁")
+ private Double afterPh3;
+
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ @PropertyDef(label = "娈嬫福鏀堕泦浣滀笟鏃堕棿")
+ @Column(name = "czsjzysj")
+ private Date czsjzysj;
+
+ @PropertyDef(label = "娈嬫福鏀堕泦浣滀笟浜烘暟")
+ @Column(name = "czsjzyrs")
+ private Integer czsjzyrs;
+
+ @PropertyDef(label = "娈嬫福鏀堕泦鏂规硶")
+ @Column(name = "czsjff", length = 128)
+ private String czsjff;
+
+ @PropertyDef(label = "娈嬫福鏀堕泦浣滀笟鎵瑰噯浜�")
+ @Column(name = "czsjzypzr", length = 64)
+ private String czsjzypzr;
+
+ @PropertyDef(label = "娈嬫福澶勭悊鎺柦")
+ @Column(name = "czclcs", length = 128)
+ private String czclcs;
+
+ @PropertyDef(label = "娈嬫福澶勭悊浣滀笟浜烘暟")
+ @Column(name = "czclzyrs")
+ private Integer czclzyrs;
+
+ @PropertyDef(label = "娈嬫福澶勭悊鎵瑰噯浜�")
+ @Column(name = "czclpzr", length = 64)
+ private String czclpzr;
+
+ @PropertyDef(label = "鐔忚捀鍚庢椿铏鍑烘儏鍐�")
+ @Column(name = "xzhhcjcqk", length = 128)
+ private String xzhhcjcqk;
+
+ @PropertyDef(label = "鐔忚捀鍚庤櫕鍙e瘑搴�", description = "鍗曚綅锛氬ご/kg")
+ @Column(name = "xzhckmd")
+ private Integer xzhckmd;
+
+ @PropertyDef(label = "鍩瑰吇15澶╁悗娲昏櫕鏁�", description = "鍗曚綅锛氬ご/kg")
+ @Column(name = "pyswthhcs")
+ private Integer pyswthhcs;
+
+ @PropertyDef(label = "鍩瑰吇45澶╁悗娲昏櫕鏁�", description = "鍗曚綅锛氬ご/kg")
+ @Column(name = "pysswthhcs")
+ private Integer pysswthhcs;
+
+
+ /**
+ * 0锛氳壇濂�
+ * 1锛氫竴鑸�
+ * 2锛氫笉濂�
+ */
+ @Column(name = "EVALUATE_", length = 1)
+ @PropertyDef(label = "鐔忚捀璇勪环", description = "0锛氳壇濂� 1锛氫竴鑸� 2锛氫笉濂�")
+ private String evaluate;
+
+ @PropertyDef(label = "鐔忚捀璐熻矗浜�")
+ @Column(name = "xzfzr", length = 64)
+ private String xzfzr;
+
+ @PropertyDef(label = "鐔忚捀浣滀笟浜哄憳")
+ @Column(name = "xzzyry", length = 128)
+ private String xzzyry;
+
+ @Column(name = "USER_", length = 30)
+ @PropertyDef(label = "鎿嶄綔浜�")
+ private String user;
+
+ @PropertyDef(label = "鏇存柊浜�")
+ @Column(name = "UPDATE_USER_", length = 30)
+ private String updateUser;
+
+ @PropertyDef(label = "鏇存柊鏃堕棿")
+ @Column(name = "UPDATE_TIME_")
+ private Date updateTime;
+
+ @Column(name = "REMARKS_", length = 500)
+ @PropertyDef(label = "澶囨敞璇存槑")
+ private String remarks;
+
+}
diff --git a/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1306.java b/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1306.java
new file mode 100644
index 0000000..1dfe9d9
--- /dev/null
+++ b/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1306.java
@@ -0,0 +1,113 @@
+package com.fzzy.async.fzzy35.impl;
+
+import com.fzzy.api.Constant;
+import com.fzzy.api.entity.Api1105;
+import com.fzzy.api.entity.Api1306;
+import com.fzzy.api.entity.ApiLog;
+import com.fzzy.api.service.ApiCommonService;
+import com.fzzy.api.utils.ContextUtil;
+import com.fzzy.api.view.repository.Api1306Rep;
+import com.fzzy.api.view.repository.ApiLogRep;
+import com.fzzy.async.fzzy35.entity.Fz35DrugLog;
+import com.fzzy.async.fzzy35.repository.Fzzy35Sync1306Rep;
+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.Date;
+import java.util.List;
+
+/**
+ * 鐔忚捀浣滀笟鏁版嵁鍚屾
+ *
+ * @author chen
+ * @date 2022-09-08 09:51
+ */
+@Slf4j
+@Component
+public class Fzzy35Sync1306 {
+
+ @Autowired
+ private Fzzy35Sync1306Rep fzzySync1306Rep;
+ @Autowired
+ private ApiCommonService commonService;
+ @Autowired
+ private Api1306Rep api1306Rep;
+
+ @Autowired
+ private ApiLogRep apiLogRep;
+
+ /**
+ * 鍚屾骞跺皝瑁呬繚瀛樼啅钂告暟鎹�
+ *
+ * @param deptId 绯荤粺瀵瑰簲搴撳尯缂栫爜
+ * @param start 璧峰鏃堕棿
+ * @param end 鎴鏃堕棿
+ */
+ public void syncData(String kqdm, String deptId, Date start, Date end) {
+ log.info("-------------1306鎺ュ彛鏁版嵁寮�濮嬪悓姝�------------------");
+ //鍚屾鏁版嵁锛屽彧璁板綍澶辫触鐨勪俊鎭�
+ ApiLog apiLog = new ApiLog();
+ apiLog.setType(ApiLog.TYPE_SYNC);
+ apiLog.setKqdm(kqdm);
+ apiLog.setUploadTime(new Date());
+ apiLog.setInteId(Constant.API_CODE_1306);
+ apiLog.setStatus(99);
+ apiLog.setId(ContextUtil.getUUID());
+ try {
+ List<Fz35DrugLog> list = fzzySync1306Rep.findByReceiveDate(deptId, start, end);
+ if (null == list || list.isEmpty()) {
+ return;
+ }
+
+ Api1306 api1306;
+ Api1105 api1105;
+ List<Api1306> api1306List;
+ for (Fz35DrugLog fz35DrugLog : list) {
+ //鑾峰彇璐т綅淇℃伅
+ api1105 = commonService.getApi1105Cache(fz35DrugLog.getDepotId());
+ if (null == api1105) {
+ continue;
+ }
+
+ api1306 = new Api1306();
+
+ BeanUtils.copyProperties(fz35DrugLog, api1306);
+ api1306.setXzzydh(fz35DrugLog.getId());
+ api1306.setCfdm(fz35DrugLog.getDepotId());
+ api1306.setXzkssj(fz35DrugLog.getStart());
+ api1306.setXzjssj(fz35DrugLog.getEnd());
+ api1306.setHcjcdh(fz35DrugLog.getPestBatchId());
+ api1306.setDjcxz(fz35DrugLog.getNum());
+ api1306.setCgxzfs(fz35DrugLog.getMode());
+ api1306.setHlxzfs(fz35DrugLog.getRecirMode());
+ api1306.setYjmc(fz35DrugLog.getDrugName());
+ api1306.setNd(fz35DrugLog.getConcentration());
+ api1306.setLddwyyl(fz35DrugLog.getGrainDose());
+ api1306.setKjdwyyl(fz35DrugLog.getSpaceDose());
+ api1306.setZyyl(fz35DrugLog.getDose());
+ api1306.setSqrq(fz35DrugLog.getVentilateTime());
+ api1306.setSqff(fz35DrugLog.getVentilateMethod());
+ api1306.setSqjsslhqnd(fz35DrugLog.getAfterPh3());
+ api1306.setXzxgpj(fz35DrugLog.getEvaluate());
+ api1306.setZhgxsj(fz35DrugLog.getUpdateTime());
+
+ api1306List = api1306Rep.getDataById(api1306.getXzzydh());
+ if (null == api1306List || api1306List.isEmpty()) {
+ api1306.setCzbz(Constant.CZBZ_I);
+ } else {
+ api1306.setCzbz(api1306List.get(0).getCzbz());
+ }
+
+ api1306Rep.save(api1306);
+ }
+ } catch (Exception e) {
+ log.error("---鍚屾澶辫触----{}", e);
+ apiLog.setResult("鍚屾澶辫触锛�" + e.getMessage());
+ apiLogRep.save(apiLog);
+ }
+ }
+
+
+}
diff --git a/src/main/java/com/fzzy/async/fzzy35/repository/Fzzy35Sync1306Rep.java b/src/main/java/com/fzzy/async/fzzy35/repository/Fzzy35Sync1306Rep.java
new file mode 100644
index 0000000..0c36544
--- /dev/null
+++ b/src/main/java/com/fzzy/async/fzzy35/repository/Fzzy35Sync1306Rep.java
@@ -0,0 +1,27 @@
+package com.fzzy.async.fzzy35.repository;
+
+import com.fzzy.async.fzzy35.entity.Fz35DrugLog;
+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 chen
+ * @date 2022-09-08 10:42
+ */
+public interface Fzzy35Sync1306Rep extends JpaRepository<Fz35DrugLog, String> {
+
+ /**
+ * 鏍规嵁鏃堕棿娈垫煡璇㈤�氶鏁版嵁
+ * @param start
+ * @param end
+ * @return
+ */
+ @Query("from Fz35DrugLog where deptId =:deptId and start >=:start and start <:end order by start ")
+ List<Fz35DrugLog> findByReceiveDate(@Param("deptId") String deptId, @Param("start") Date start, @Param("end") Date end);
+}
--
Gitblit v1.9.3