From 254da24705ba4daa8bf289a2c10b912fb8c53ad2 Mon Sep 17 00:00:00 2001 From: CZT <czt18638530771@163.com> Date: 星期二, 18 七月 2023 21:18:37 +0800 Subject: [PATCH] 增加V40接口-粮情、出入库 --- src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1208.java | 24 src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutNoticeIn.java | 117 +++ src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1202.java | 196 ++++++ src/main/resources/application-pro.yml | 4 src/main/java/com/fzzy/api/view/repository/Api1212Rep.java | 10 src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutNoticeOut.java | 120 +++ src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1212Rep.java | 26 src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java | 187 +++++ src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1212.java | 114 +++ src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncNoticeInRep.java | 26 src/main/resources/application-dev.yml | 19 src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java | 57 + src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncNoticeOutRep.java | 26 src/main/java/com/fzzy/api/view/repository/Api1101Rep.java | 5 src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1201.java | 151 ++++ src/main/java/com/fzzy/api/service/ApiTriggerService.java | 1 src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutRecord.java | 285 ++++++++ src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1202Rep.java | 37 + src/main/resources/application-pro5321.yml | 57 + src/main/java/com/fzzy/api/entity/Api1212.java | 3 src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1201Rep.java | 25 src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutCustomer.java | 100 +++ src/main/java/com/fzzy/async/fzzy40/package-info.java | 6 src/main/resources/application-pro5326.yml | 57 + src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutContract.java | 230 +++++++ src/main/java/com/fzzy/api/data/SyncProtocol.java | 1 26 files changed, 1,859 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/fzzy/api/data/SyncProtocol.java b/src/main/java/com/fzzy/api/data/SyncProtocol.java index b4e1d2c..ded06eb 100644 --- a/src/main/java/com/fzzy/api/data/SyncProtocol.java +++ b/src/main/java/com/fzzy/api/data/SyncProtocol.java @@ -11,6 +11,7 @@ GB_DEFAULT("GB_DEFAULT", "绯荤粺榛樿鍗忚"), FZZY_V30_GB("FZZY_V30_GB", "椋庢鑷磋繙V3.0"), FZZY_V35_GB("FZZY_V35_GB", "椋庢鑷磋繙V3.5"), + FZZY_V40_GB("FZZY_V40_GB", "椋庢鑷磋繙V4.0"), FZZY_V35_SHYZ("FZZY_V35_SHYZ", "椋庢鑷磋繙2涓婃捣浣戝崜瑙勮寖"); diff --git a/src/main/java/com/fzzy/api/entity/Api1212.java b/src/main/java/com/fzzy/api/entity/Api1212.java index 3e27754..1fb2bc0 100644 --- a/src/main/java/com/fzzy/api/entity/Api1212.java +++ b/src/main/java/com/fzzy/api/entity/Api1212.java @@ -36,9 +36,8 @@ @JSONField(serialize = false) @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") - private Integer id; + private String id; @PropertyDef(label = "鍗曚綅浠g爜",required =true ) @Column(name = "dwdm", length = 18) diff --git a/src/main/java/com/fzzy/api/service/ApiTriggerService.java b/src/main/java/com/fzzy/api/service/ApiTriggerService.java index e4d43a1..eee5322 100644 --- a/src/main/java/com/fzzy/api/service/ApiTriggerService.java +++ b/src/main/java/com/fzzy/api/service/ApiTriggerService.java @@ -201,6 +201,7 @@ list.add(new ApiTrigger(SyncProtocol.GB_DEFAULT.getCode(), SyncProtocol.GB_DEFAULT.getName())); list.add(new ApiTrigger(SyncProtocol.FZZY_V30_GB.getCode(), SyncProtocol.FZZY_V30_GB.getName())); list.add(new ApiTrigger(SyncProtocol.FZZY_V35_GB.getCode(), SyncProtocol.FZZY_V35_GB.getName())); + list.add(new ApiTrigger(SyncProtocol.FZZY_V40_GB.getCode(), SyncProtocol.FZZY_V40_GB.getName())); list.add(new ApiTrigger(SyncProtocol.FZZY_V35_SHYZ.getCode(), SyncProtocol.FZZY_V35_SHYZ.getName())); return list; } diff --git a/src/main/java/com/fzzy/api/view/repository/Api1101Rep.java b/src/main/java/com/fzzy/api/view/repository/Api1101Rep.java index 9365832..7aaa4a0 100644 --- a/src/main/java/com/fzzy/api/view/repository/Api1101Rep.java +++ b/src/main/java/com/fzzy/api/view/repository/Api1101Rep.java @@ -1,9 +1,6 @@ package com.fzzy.api.view.repository; - import com.fzzy.api.entity.Api1101; - -import com.fzzy.api.entity.Api1111; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; @@ -28,7 +25,7 @@ int updateStatus(@Param("id") String id, @Param("czbz") String czbz); /** - * 鏌ヨ鎵�鏈夌殑鐩戞帶鐐逛綅淇℃伅 + * 鍗曚綅淇℃伅 * @param kqdm * @return */ diff --git a/src/main/java/com/fzzy/api/view/repository/Api1212Rep.java b/src/main/java/com/fzzy/api/view/repository/Api1212Rep.java index 924b748..be14ba5 100644 --- a/src/main/java/com/fzzy/api/view/repository/Api1212Rep.java +++ b/src/main/java/com/fzzy/api/view/repository/Api1212Rep.java @@ -1,18 +1,22 @@ package com.fzzy.api.view.repository; import com.fzzy.api.entity.Api1212; - import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.transaction.annotation.Transactional; +import java.util.List; -public interface Api1212Rep extends JpaRepository<Api1212, Integer>, JpaSpecificationExecutor<Api1212> { +public interface Api1212Rep extends JpaRepository<Api1212, String>, JpaSpecificationExecutor<Api1212> { + @Transactional @Modifying @Query("update Api1212 set czbz =:czbz where id=:id") - void updateStatus(@Param("id") Integer id, @Param("czbz") String czbz); + void updateStatus(@Param("id") String id, @Param("czbz") String czbz); + + @Query("from Api1212 where id=:id ") + List<Api1212> getDataById(@Param("id") String id); } diff --git a/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1208.java b/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1208.java index 47ecd1c..3ea6123 100644 --- a/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1208.java +++ b/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1208.java @@ -46,18 +46,18 @@ */ public void syncData(String kqdm, String deptId, Date start, Date end) { - //淇敼搴撳瓨鏁版嵁涓烘瘡澶�2鐐瑰悓姝ワ紝姣忓ぉ鍙悓姝ヤ竴鏉� - Date nowTime = new Date(); - int hour = ContextUtil.getHourOfDay(nowTime); - if (!String.valueOf(hour).equals("2")) { - log.info("-------------褰撳墠鏃堕棿涓嶅湪2鐐归挓锛�1208搴撳瓨鎺ュ彛鏁版嵁鎺ュ彛涓嶅悓姝�------------------"); - return; - } - int minute = ContextUtil.getMinuteOfHour(nowTime); - if (!String.valueOf(minute).equals("00")) { - log.info("-------------褰撳墠鏃堕棿涓嶅湪2鐐归挓0鍒嗭紝1208搴撳瓨鎺ュ彛鏁版嵁鎺ュ彛涓嶅悓姝�------------------"); - return; - } +// //淇敼搴撳瓨鏁版嵁涓烘瘡澶�2鐐瑰悓姝ワ紝姣忓ぉ鍙悓姝ヤ竴鏉� +// Date nowTime = new Date(); +// int hour = ContextUtil.getHourOfDay(nowTime); +// if (!String.valueOf(hour).equals("2")) { +// log.info("-------------褰撳墠鏃堕棿涓嶅湪2鐐归挓锛�1208搴撳瓨鎺ュ彛鏁版嵁鎺ュ彛涓嶅悓姝�------------------"); +// return; +// } +// int minute = ContextUtil.getMinuteOfHour(nowTime); +// if (!String.valueOf(minute).equals("00")) { +// log.info("-------------褰撳墠鏃堕棿涓嶅湪2鐐归挓0鍒嗭紝1208搴撳瓨鎺ュ彛鏁版嵁鎺ュ彛涓嶅悓姝�------------------"); +// return; +// } log.info("-------------1208鎺ュ彛鏁版嵁寮�濮嬪悓姝�------------------"); //鍚屾鏁版嵁锛屽彧璁板綍澶辫触鐨勪俊鎭� diff --git a/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java b/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java new file mode 100644 index 0000000..35a414f --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java @@ -0,0 +1,57 @@ +package com.fzzy.async.fzzy40; + +import com.fzzy.api.data.ApiParam; +import com.fzzy.api.data.SyncProtocol; +import com.fzzy.api.service.SyncService12; +import com.fzzy.async.fzzy40.impl.Fzzy40Sync1201; +import com.fzzy.async.fzzy40.impl.Fzzy40Sync1202; +import com.fzzy.async.fzzy40.impl.Fzzy40Sync1205; +import com.fzzy.async.fzzy40.impl.Fzzy40Sync1212; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import java.util.Date; + +/** + * @Desc: 绮璐攢鐩稿叧鏁版嵁鍚屾 + * @author: czt + * @update-time: 2023/6/29 + */ +@Component +public class Fzzy40SyncService12 implements SyncService12 { + + @Autowired + private Fzzy40Sync1201 fzzySync1201; + @Autowired + private Fzzy40Sync1202 fzzySync1202; + @Autowired + private Fzzy40Sync1205 fzzySync1205; + @Autowired + private Fzzy40Sync1212 fzzySync1212; + + @Override + public String getProtocol() { + return SyncProtocol.FZZY_V40_GB.getCode(); + } + + @Override + public void syncData(ApiParam param) { + + String kqdm = param.getKqdm(); + String deptId = param.getDeptId(); + Date start = param.getStart(); + Date end = param.getEnd(); + + //瀹㈡埛鍚屾 +// fzzySync1212.syncData(kqdm, deptId, start, end); + //鍚堝悓鍚屾 +// fzzySync1201.syncData(kqdm, deptId, start, end); + + //绮鍏ュ簱鍚屾 + fzzySync1202.syncData(kqdm, deptId, start, end); + + //绮鍑哄簱鍚屾 + fzzySync1205.syncData(kqdm, deptId, start, end); + + } + +} diff --git a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutContract.java b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutContract.java new file mode 100644 index 0000000..e70520b --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutContract.java @@ -0,0 +1,230 @@ +package com.fzzy.async.fzzy40.entity; + +import com.bstek.dorado.annotation.PropertyDef; +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; + +/** + * @Desc: + * @author: Andy + * @update-time: 2023/5/22 鏍规嵁鏂板浗鏍囪皟鏁村悕绉帮紝浼樺寲瀛楁 + */ +@Data +@Entity +@Table(name = "D_INOUT_CONTRACT") +public class Fz40InoutContract implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "ID_", length = 40) + @PropertyDef(label = "ID_") + 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 = "NAME_", length = 50) + @PropertyDef(label = "鍚堝悓鍚嶇О") + private String name; + + @Column(name = "PLAN_ID_", length = 40) + @PropertyDef(label = "璁″垝缂栫爜") + private String planId; + + @Column(name = "PLAN_NAME_", length = 50) + @PropertyDef(label = "璁″垝鍚嶇О") + private String planName; + + @Column(name = "TYPE_", length = 10) + @PropertyDef(label = "涓氬姟绫诲埆", description = "1:閿�鍞悎鍚� 2:閲囪喘鍚堝悓 3:浠e偍鍚堝悓") + private String type; + + @Column(name = "CUSTOMER_TYPE_", length = 10) + @PropertyDef(label = "瀹㈡埛绫诲瀷", description = "1:浼佷笟 2:涓汉") + private String customerType; + + @Column(name = "YEAR_", length = 10) + @PropertyDef(label = "骞翠唤") + private String year; + + @Column(name = "CUSTOMER_ID_", length = 20) + @PropertyDef(label = "绀句細淇$敤鐮�", description = "濡傛灉鏄紒涓�=瀹㈡埛缁熶竴绀句細淇$敤浠g爜") + private String customerId; + + @Column(name = "CUSTOMER_NAME_", length = 50) + @PropertyDef(label = "瀹㈡埛鍚嶇О") + private String customerName; + + @Column(name = "fddbr", length = 50) + @PropertyDef(label = "娉曞畾浠h〃浜�") + private String fddbr; + + @Column(name = "txdz", length = 200) + @PropertyDef(label = "閫氳鍦板潃") + private String txdz; + + @Column(name = "yzbm", length = 6) + @PropertyDef(label = "閭斂缂栫爜") + private String yzbm; + + @PropertyDef(label = "鑱旂郴浜哄鍚�") + @Column(name = "lxrxm", length = 50) + private String lxrxm; + + @PropertyDef(label = "鑱旂郴鐢佃瘽") + @Column(name = "lxrdh", length = 20) + private String lxrdh; + + @PropertyDef(label = "韬唤璇佸彿") + @Column(name = "sfzh", length = 20) + private String sfzh; + + @PropertyDef(label = "鐢靛瓙淇$") + @Column(name = "dzyx", length = 50) + private String dzyx; + + @Column(name = "SIGNING_TIME_") + @PropertyDef(label = "绛捐鏃堕棿", description = "鏍煎紡锛歽yyy-MM-dd") + private Date signingTime; + + @Column(name = "SIGN_ADDRESS_", length = 100) + @PropertyDef(label = "绛剧害鍦扮偣") + private String signAddress; + + @Column(name = "BEGIN_TIME_") + @PropertyDef(label = "绾﹀畾寮�濮嬫椂闂�") + private Date beginTime; + + @Column(name = "END_TIME_") + @PropertyDef(label = "绾﹀畾瀹屾垚鏃堕棿") + private Date endTime; + + @Column(name = "REL_END_TIME_") + @PropertyDef(label = "瀹為檯瀹屾垚鏃堕棿") + private Date relEndTime; + + @Column(name = "FOOD_VARIETY_", length = 20) + @PropertyDef(label = "绮鍝佺") + private String foodVariety; + + @Column(name = "FOOD_TYPE_", length = 20) + @PropertyDef(label = "绮鎬ц川") + private String foodType; + + @Column(name = "PRICE_") + @PropertyDef(label = "鍚堝悓鍗曚环锛屽厓/鍚�") + private Double price; + + @Column(name = "MONEY_") + @PropertyDef(label = "鍚堝悓鎬婚噾棰�", description = "鍗曚綅锛氬厓") + private Double money; + + @Column(name = "CONTRACT_AMOUNT_") + @PropertyDef(label = "鍚堝悓鏁伴噺", description = "鍗曚綅锛氬叕鏂�") + private Double contactAmount; + + @Column(name = "COMPLETE_NUM_") + @PropertyDef(label = "灞ョ害鏁伴噺", description = "鍗曚綅锛氬叕鏂�") + private Double completeNum; + + @Column(name = "lybzj") + @PropertyDef(label = "灞ョ害淇濊瘉閲�", description = "鍗曚綅锛氬厓") + private Double lybzj; + + @PropertyDef(label = "灞ョ害鐜�", description = "鍗曚綅锛�%") + @Column(name = "lyl") + private Double lyl; + + @Column(name = "jsjg") + @PropertyDef(label = "缁撶畻浠锋牸锛屽厓/鍚�") + private Double jsjg; + + @PropertyDef(label = "缁撶畻鎬婚噾棰�", description = "鍗曚綅锛氬厓") + @Column(name = "jszje") + private Double jszje; + + @PropertyDef(label = "缁撶畻涓庡悎鍚屼竴鑷存��", description = "1锛氱鍚� 2锛氫笉绗﹀悎") + @Column(name = "jsyhtyzx", length = 1) + private String jsyhtyzx; + + @PropertyDef(label = "涓嶄竴鑷村師鍥�") + @Column(name = "jsyhtbyzyy", length = 250) + private String jsyhtbyzyy; + + @Column(name = "CUSTOMER_BANK_", length = 10) + @PropertyDef(label = "瀹㈡埛寮�鎴疯") + private String customerBank; + + @Column(name = "CUSTOMER_BANK_ACCOUNT_", length = 40) + @PropertyDef(label = "瀹㈡埛鏂硅处鍙�") + private String customerBankAccount; + + @Column(name = "CUSTOMER_SIGN_USER_", length = 50) + @PropertyDef(label = "瀹㈡埛绛剧害浜�") + private String customerSignUser; + + @Column(name = "BANK_", length = 50) + @PropertyDef(label = "鏈柟寮�鎴疯") + private String bank; + + @Column(name = "BANK_ACCOUNT_", length = 40) + @PropertyDef(label = "鏈柟璐﹀彿") + private String bankAccount; + + @Column(name = "SIGN_USER_", length = 50) + @PropertyDef(label = "鏈柟绛剧害浜�") + private String signUser; + + @Column(name = "PAY_TYPE_", length = 6) + @PropertyDef(label = "鏀粯鏂瑰紡") + private String payType; + + /** + * --------瀹℃壒淇℃伅-------- + **/ + + @Column(name = "CREATE_USER_", length = 50) + @PropertyDef(label = "鍒涘缓浜�") + private String createUser; + + @Column(name = "AUDIT_USER_", length = 50) + @PropertyDef(label = "瀹℃壒浜�") + private String auditUser; + + @Column(name = "AUDIT_DATE_") + @PropertyDef(label = "瀹℃壒鏃堕棿", description = "鏍煎紡锛歽yyy-MM-dd HH:mm:ss") + private String auditDate; + + @Column(name = "AUDIT_STATUS_", length = 10) + @PropertyDef(label = "瀹℃壒鐘舵��") + private String auditStatus; + + @Column(name = "CREATE_TIME_") + @PropertyDef(label = "鍒涘缓鏃堕棿") + private Date createTime; + + @Column(name = "wcrq") + @PropertyDef(label = "瀹屾垚鏃堕棿") + private Date wcrq; + + @Column(name = "hqzz", length = 30) + @PropertyDef(label = "璐ф潈缁勭粐") + private String hqzz; + + @Column(name = "UPDATE_TIME_") + @PropertyDef(label = "鏇存柊鏃堕棿") + private Date updateTime; + +} diff --git a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutCustomer.java b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutCustomer.java new file mode 100644 index 0000000..e6a755a --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutCustomer.java @@ -0,0 +1,100 @@ +package com.fzzy.async.fzzy40.entity; + +import com.bstek.dorado.annotation.PropertyDef; +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; + +/** + * 鍑哄叆搴撳鎴�-寰�鏉ュ崟浣嶄俊鎭� 2023骞�5鏈�26鏃� 鏍规嵁鏂板浗绮浼樺寲 + * + * @author czt + * @description 鐗堟湰4.0瀛楁宸插 + * @date 2023-05-25 17:16 + */ +@Data +@Entity +@Table(name = "D_INOUT_CUSTOMER") +public class Fz40InoutCustomer implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "ID_", length = 40) + @PropertyDef(label = "涓婚敭id缂栫爜", description = "绯荤粺鍐呯紪鐮�") + 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 = "TYPE_", length = 4) + @PropertyDef(label = "涓氬姟鍒嗙被", description = "绯荤粺鍐呬娇鐢細鎻愯揣鍟嗐�佷緵璐у晢") + private String type; + + @Column(name = "khlx", length = 50) + @PropertyDef(label = "瀹㈡埛绫诲瀷", description = "1-浼佷笟锛�2-涓汉") + private String khlx; + + @PropertyDef(label = "瀹㈡埛缂栫爜锛氫紒涓氬鎴峰~鍐欑粺涓�绀句細淇$敤浠g爜锛屼釜浜哄鎴峰~鍐欒韩浠借瘉鍙�") + @Column(name = "khbh", length = 18) + private String khbh; + + @Column(name = "NAME_", length = 50) + @PropertyDef(label = "瀹㈡埛鍚嶇О") + private String name; + + @PropertyDef(label = "娉曞畾浠h〃浜�") + @Column(name = "fddbr", length = 64) + private String fddbr; + + @Column(name = "ADDRESS_", length = 200) + @PropertyDef(label = "閫氳鍦板潃") + private String address; + + @PropertyDef(label = "閭斂缂栫爜") + @Column(name = "yzbm", length = 6) + private String yzbm; + + @Column(name = "CONTACT_USER_", length = 50) + @PropertyDef(label = "鑱旂郴浜�") + private String contactUser; + + @Column(name = "PHONE_", length = 20) + @PropertyDef(label = "鑱旂郴鐢佃瘽") + private String phone; + + @Column(name = "CARD_ID_", length = 20) + @PropertyDef(label = "鑱旂郴浜鸿韩浠借瘉鍙�") + private String cardId; + + @PropertyDef(label = "鐢靛瓙淇$") + @Column(name = "dzyx", length = 64) + private String dzyx; + + @Column(name = "BANK_", length = 50) + @PropertyDef(label = "寮�鎴烽摱琛�") + private String bank; + + @Column(name = "BANK_NUM_", length = 30) + @PropertyDef(label = "閾惰璐﹀彿") + private String bankNum; + + @Column(name = "FOOD_AREA_", length = 30) + @PropertyDef(label = "绉嶆闈㈢Н") + private Double foodArea = 0.0; + + @Column(name = "UPDATE_TIME_") + @PropertyDef(label = "鏁版嵁鏇存柊鏃堕棿") + private Date updateTime; + +} diff --git a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutNoticeIn.java b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutNoticeIn.java new file mode 100644 index 0000000..544c14c --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutNoticeIn.java @@ -0,0 +1,117 @@ +package com.fzzy.async.fzzy40.entity; + +import com.bstek.dorado.annotation.PropertyDef; +import lombok.Data; +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * 鍑哄叆搴�-鍏ュ簱閫氱煡鍗曪紝2023骞�5鏈�26鏃� 浼樺寲璋冩暣 + * + * @author czt + */ +@Data +@Entity +@Table(name = "D_INOUT_NOTICE_IN") +public class Fz40InoutNoticeIn implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "ID_", length = 40) + @PropertyDef(label = "閫氱煡鍗曞彿") + private String id; + + @Column(name = "COMPANY_ID_", length = 10) + @PropertyDef(label = "缁勭粐缂栫爜") + private String companyId; + + @Column(name = "DEPT_ID_", length = 50) + @PropertyDef(label = "搴撳尯缂栫爜") + private String deptId; + + @Column(name = "NAME_", length = 50) + @PropertyDef(label = "閫氱煡鍗曞悕绉�") + private String name; + + @Column(name = "PLAN_ID_", length = 40) + @PropertyDef(label = "璁″垝鏄庣粏鍙�", description = "閽堝杞崲绮蹇呭~") + private String planId; + + @Column(name = "CONTRACT_ID_", length = 40) + @PropertyDef(label = "鍚堝悓缂栫爜", description = "閽堝杞崲绮蹇呭~") + private String contractId; + + @Column(name = "CONTRACT_NAME_", length = 50) + @PropertyDef(label = "鍚堝悓鍚嶇О", description = "閽堝杞崲绮蹇呭~") + private String contractName; + + @Column(name = "DEPOT_ID_", length = 50) + @PropertyDef(label = "鐩爣浠撳簱") + private String depotId; + + @Column(name = "CUSTOMER_ID_", length = 40) + @PropertyDef(label = "鍙戣揣瀹㈡埛") + private String customerId; + + @Column(name = "CUSTOMER_NAME_", length = 50) + @PropertyDef(label = "鍙戣揣瀹㈡埛") + private String customerName; + + @Column(name = "UNIT_NAME_", length = 50) + @PropertyDef(label = "鏀惰揣鍗曚綅", description = "搴撳尯鎵�灞炲叕鍙革紝鎵嬪姩褰曞叆") + private String unitName; + + @Column(name = "FOOD_VARIETY_", length = 10) + @PropertyDef(label = "绮鍝佺") + private String foodVariety; + + @Column(name = "YEAR_", length = 10) + @PropertyDef(label = "骞翠唤") + private String year; + + @Column(name = "TARGET_NUMBER_") + @PropertyDef(label = "鐩爣鏁伴噺", description = "鍗曚綅锛氬惃锛屾墜鍔ㄥ~鎶�") + private double targetNumber = 0.0; + + @Column(name = "COMPLETE_NUMBER_") + @PropertyDef(label = "瀹屾垚鏁伴噺", description = "鍗曚綅锛氬惃锛岀郴缁熻嚜鍔ㄥ悎璁�") + private double completeNumber = 0.0; + + @Column(name = "AUDIT_STATUS_", length = 10) + @PropertyDef(label = "瀹℃牳鐘舵��", description = "涓哄鏍革紝瀹℃牳閫氳繃锛屾嫆鎺�") + private String auditStatus; + + @Column(name = "AUDIT_USER_", length = 50) + @PropertyDef(label = "瀹℃牳浜�") + private String auditUser; + + @Column(name = "AUDIT_DATE_") + @PropertyDef(label = "瀹℃壒鏃堕棿", description = "鏍煎紡锛歽yyy-MM-dd HH:mm:ss") + private String auditDate; + + @Column(name = "COMPLETE_STATUS_", length = 10) + @PropertyDef(label = "瀹屾垚鐘舵��", description = "鏈畬鎴愶紝宸插畬鎴�") + private String completeStatus; + + @Column(name = "COMPLETE_TIME_") + @PropertyDef(label = "瀹屾垚鏃堕棿") + private Date completeTime; + + @Column(name = "CREATE_TIME_") + @PropertyDef(label = "鍒涘缓鏃堕棿") + private Date createTime = new Date(); + + @Column(name = "CREATE_USER_", length = 50) + @PropertyDef(label = "鍒涘缓浜�") + private String createUser; + + @Column(name = "REMARK_", length = 200) + @PropertyDef(label = "澶囨敞淇℃伅") + private String remark; + + @Column(name = "TYPE_", length = 2) + @PropertyDef(label = "涓氬姟璇存槑", description = "杞崲绮锛岄潪杞崲绮紝濡傛灉涓鸿疆鎹㈢伯椋燂紝璁″垝鏄庣粏鍜屽悎鍚屽繀濉�") + private String type; +} diff --git a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutNoticeOut.java b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutNoticeOut.java new file mode 100644 index 0000000..a4c7e75 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutNoticeOut.java @@ -0,0 +1,120 @@ +package com.fzzy.async.fzzy40.entity; + +import com.bstek.dorado.annotation.PropertyDef; +import lombok.Data; +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * 鍑哄叆搴�-鍑哄簱閫氱煡鍗曪紝鏍规嵁鏂板浗鏍囧凡鏍稿 2023骞�5鏈�26鏃� 09:35:23 + * + * @author czt + */ +@Data +@Entity +@Table(name = "D_INOUT_NOTICE_OUT") +public class Fz40InoutNoticeOut implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "ID_", length = 40) + @PropertyDef(label = "閫氱煡鍗曞彿") + private String id; + + @Column(name = "COMPANY_ID_", length = 10) + @PropertyDef(label = "缁勭粐缂栫爜") + private String companyId; + + @Column(name = "DEPT_ID_", length = 50) + @PropertyDef(label = "搴撳尯缂栫爜") + private String deptId; + + @Column(name = "NAME_", length = 50) + @PropertyDef(label = "閫氱煡鍗曞悕绉�") + private String name; + + @Column(name = "PLAN_ID_", length = 40) + @PropertyDef(label = "璁″垝鏄庣粏鍙�", description = "閽堝杞崲绮蹇呭~") + private String planId; + + @Column(name = "CONTRACT_ID_", length = 40) + @PropertyDef(label = "鍚堝悓缂栫爜", description = "閽堝杞崲绮蹇呭~") + private String contractId; + + @Column(name = "CONTRACT_NAME_", length = 50) + @PropertyDef(label = "鍚堝悓鍚嶇О", description = "閽堝杞崲绮蹇呭~") + private String contractName; + + @Column(name = "DEPOT_ID_", length = 50) + @PropertyDef(label = "鐩爣浠撳簱") + private String depotId; + + @Column(name = "CUSTOMER_ID_", length = 40) + @PropertyDef(label = "鍙戣揣瀹㈡埛") + private String customerId; + + @Column(name = "CUSTOMER_NAME_", length = 50) + @PropertyDef(label = "鍙戣揣瀹㈡埛") + private String customerName; + + @Column(name = "UNIT_NAME_", length = 50) + @PropertyDef(label = "鏀惰揣鍗曚綅", description = "搴撳尯鎵�灞炲叕鍙革紝鎵嬪姩褰曞叆") + private String unitName; + + @Column(name = "FOOD_VARIETY_", length = 10) + @PropertyDef(label = "绮鍝佺") + private String foodVariety; + + @Column(name = "YEAR_", length = 10) + @PropertyDef(label = "骞翠唤") + private String year; + + @Column(name = "TARGET_NUMBER_") + @PropertyDef(label = "鐩爣鏁伴噺", description = "鍗曚綅锛欿G锛屾墜鍔ㄥ~鎶�") + private double targetNumber = 0.0; + + @Column(name = "COMPLETE_NUMBER_") + @PropertyDef(label = "瀹屾垚鏁伴噺", description = "鍗曚綅锛欿G锛岀郴缁熻嚜鍔ㄥ悎璁�") + private double completeNumber = 0.0; + + @Column(name = "AUDIT_STATUS_", length = 10) + @PropertyDef(label = "瀹℃牳鐘舵��", description = "涓哄鏍革紝瀹℃牳閫氳繃锛屾嫆鎺�") + private String auditStatus; + + @Column(name = "AUDIT_USER_", length = 50) + @PropertyDef(label = "瀹℃牳浜�") + private String auditUser; + + @Column(name = "AUDIT_DATE_") + @PropertyDef(label = "瀹℃壒鏃堕棿", description = "鏍煎紡锛歽yyy-MM-dd HH:mm:ss") + private String auditDate; + + @Column(name = "COMPLETE_STATUS_", length = 10) + @PropertyDef(label = "瀹屾垚鐘舵��", description = "鏈畬鎴愶紝宸插畬鎴�") + private String completeStatus; + + @Column(name = "COMPLETE_TIME_") + @PropertyDef(label = "瀹屾垚鏃堕棿") + private Date completeTime; + + @Column(name = "CREATE_TIME_") + @PropertyDef(label = "鍒涘缓鏃堕棿") + private Date createTime = new Date(); + + @Column(name = "CREATE_USER_", length = 50) + @PropertyDef(label = "鍒涘缓浜�") + private String createUser; + + @Column(name = "REMARK_", length = 200) + @PropertyDef(label = "澶囨敞淇℃伅") + private String remark; + + @Column(name = "TYPE_", length = 2) + @PropertyDef(label = "涓氬姟璇存槑", description = "杞崲绮锛岄潪杞崲绮紝濡傛灉涓鸿疆鎹㈢伯椋燂紝璁″垝鏄庣粏鍜屽悎鍚屽繀濉�") + private String type; +} diff --git a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutRecord.java b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutRecord.java new file mode 100644 index 0000000..926a8fd --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutRecord.java @@ -0,0 +1,285 @@ +package com.fzzy.async.fzzy40.entity; + +import com.bstek.dorado.annotation.PropertyDef; +import lombok.Data; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import java.util.Date; + +/** + * @Desc: 鍑哄叆搴撴祦姘磋〃锛屾牴鎹柊鍥界伯瑙勮皟鏁翠紭鍖栧瓧娈碉紝2023骞�5鏈�26鏃� 鏍规嵁鏂板浗绮浼樺寲 + * @author: Andy + * @update-time: 2023/5/26 + */ +@Data +@Entity +@Table(name = "D_INOUT_RECORD") +public class Fz40InoutRecord { + + @Id + @Column(name = "ID_", length = 40) + @PropertyDef(label = "娴佹按鍙�", description = "鏍规嵁涓�瀹氱殑瑙勫垯鐢熸垚") + private String id; + + @Column(name = "COMPANY_ID_", length = 10) + @PropertyDef(label = "缁勭粐缂栫爜") + private String companyId; + + @Column(name = "DEPT_ID_", length = 50) + @PropertyDef(label = "搴撳尯缂栫爜") + private String deptId; + + @Column(name = "NOTICE_ID_", length = 40) + @PropertyDef(label = "閫氱煡鍗曠紪鐮�") + private String noticeId; + + @Column(name = "DEPOT_ID_", length = 50) + @PropertyDef(label = "瑁呭嵏浠撳簱") + private String depotId; + + @Column(name = "TYPE_", length = 10) + @PropertyDef(label = "鍑哄叆搴撶被鍨�", description = "IN=鍏ュ簱锛孫UT=鍑哄簱") + private String type; + + @Column(name = "PROGRESS_", length = 20) + @PropertyDef(label = "娴佺▼杩涘害") + private String progress; + + @Column(name = "RECORD_STATUS_", length = 10) + @PropertyDef(label = "鏁版嵁鐘舵��", description = "鏁版嵁鐘舵�侊紝姝e父锛屽紓甯革紙2灏忔椂鍐呴噸澶嶅嚭鍏ュ簱绛夛級锛岃ˉ褰�") + private String recordStatus; + + @Column(name = "CUSTOMER_NAME_", length = 50) + @PropertyDef(label = "寰�鏉ュ崟浣�", description = "鍏宠仈閫氱煡鍗曡幏鍙�") + private String customerName; + + @Column(name = "INTEL_CARD_", length = 20) + @PropertyDef(label = "鏅烘収鍗″彿") + private String intelCard; + + /*** ------------------------鐧昏-------------------------------------**/ + @Column(name = "REGISTER_TIME_") + @PropertyDef(label = "鐧昏鏃堕棿") + private Date registerTime; + + @Column(name = "REGISTER_USER_", length = 50) + @PropertyDef(label = "鐧昏浜�") + private String registerUser; + + @Column(name = "USER_NAME_", length = 40) + @PropertyDef(label = "鎵胯繍浜�") + private String userName; + + @Column(name = "USER_CONTACT_", length = 20) + @PropertyDef(label = "鑱旂郴鏂瑰紡") + private String userContact; + + @Column(name = "USER_ID_", length = 20) + @PropertyDef(label = "韬唤璇佸彿") + private String userId; + + @Column(name = "USER_ADDRESS_", length = 100) + @PropertyDef(label = "鎵胯繍浜哄湴鍧�") + private String userAddress; + + @Column(name = "USER_BIRTHDAY_") + @PropertyDef(label = "鍑虹敓鏃ユ湡") + private Date userBirthday; + + @Column(name = "USER_SEX_", length = 10) + @PropertyDef(label = "鎬у埆") + private String userSex; + + @Column(name = "USER_NATION_", length = 10) + @PropertyDef(label = "姘戞棌") + private String userNation; + + @Column(name = "PLATE_NUM_", length = 20) + @PropertyDef(label = "杞﹁埞鍙�", description = "杞︾墝鍙�+鏍囪瘑绗�") + private String plateNum; + + @Column(name = "TRANS_TYPE_", length = 6) + @PropertyDef(label = "杩愯緭宸ュ叿") + private String transType; + + + /*** ------------------------绮鍩虹淇℃伅-------------------------------------**/ + @Column(name = "FOOD_VARIETY_", length = 20) + @PropertyDef(label = "绮鍝佺") + private String foodVariety; + + @Column(name = "FOOD_TYPE_", length = 20) + @PropertyDef(label = "绮鎬ц川") + private String foodType; + + @Column(name = "FOOD_LOCATION_ID_", length = 20) + @PropertyDef(label = "浜у湴鍚嶇О浠g爜") + private String foodLocationId; + + @Column(name = "FOOD_LOCATION_", length = 40) + @PropertyDef(label = "浜у湴鍚嶇О") + private String foodLocation; + + @Column(name = "FOOD_YEAR_", length = 10) + @PropertyDef(label = "鏀惰揣骞村害") + private String foodYear; + + /*** ------------------------鎵︽牱璐ㄦ淇℃伅-------------------------------------**/ + @Column(name = "FOOD_LEVEL_", length = 20) + @PropertyDef(label = "绮瀹氱瓑") + private String foodLevel; + + @Column(name = "CHECK_STATUS_", length = 10) + @PropertyDef(label = "璐ㄦ缁撴灉") + private String checkStatus; + + @Column(name = "CHECK_USER_", length = 50) + @PropertyDef(label = "璐ㄦ浜�") + private String checkUser; + + @Column(name = "CHECK_TIME_") + @PropertyDef(label = "璐ㄦ鏃堕棿") + private Date checkTime; + + @Column(name = "SAMPLE_USER_", length = 50) + @PropertyDef(label = "鎵︽牱浜�") + private String sampleUser; + + @Column(name = "SAMPLE_TIME_") + @PropertyDef(label = "鎵︽牱鏃堕棿") + private Date sampleTime; + + @Column(name = "SAMPLE_TYPE_", length = 1) + @PropertyDef(label = "鎵︽牱鏂瑰紡", description = "0-浜哄伐锛�1=鑷姩锛�2=鏅鸿兘闅忔満") + private String sampleType; + + @Column(name = "CHECK_ID_", length = 12) + @PropertyDef(label = "璐ㄦ鍗曞彿") + private String checkId; + + @Column(name = "DE_CHECK_") + @PropertyDef(label = "璐ㄦ鎵i噸", description = "鍗曚綅KG") + private double deCheck = 0.0; + + @Column(name = "ADD_CHECK_") + @PropertyDef(label = "璐ㄦ澧為噸", description = "鍗曚綅KG") + private double addCheck = 0.0; + + /*** ------------------------绉伴噸鐜妭-------------------------------------**/ + + @Column(name = "jjlx", length = 2) + @PropertyDef(label = "妫�鏂ょ被鍨�", description = "0锛氱О閲嶅叆搴� 1锛氭爣鍑嗗寘鍏ュ簱 榛樿涓虹О閲嶅叆搴擄紝鏍囧噯鍖呭叆搴撶浉鍏冲瓧娈靛彲涓虹┖") + private String jjlx = "0"; + + @Column(name = "FULL_WEIGHT_") + @PropertyDef(label = "婊¤溅绉伴噸", description = "鍏ュ簱鏃跺�欒〃绀虹涓�娆$О閲嶏紝鍑哄簱鏃跺�欒〃绀虹浜屾绉伴噸锛屽崟浣岾G") + private Double fullWeight = 0.0; + + @Column(name = "FULL_WEIGHT_TIME_") + @PropertyDef(label = "婊¤溅绉伴噸鏃堕棿") + private Date fullWeightTime; + + @Column(name = "FULL_WEIGHT_USER_", length = 40) + @PropertyDef(label = "婊¤溅绉伴噸浜�") + private String fullWeightUser; + + @Column(name = "EMPTY_WEIGHT_") + @PropertyDef(label = "绌鸿溅绉伴噸", description = "鍏ュ簱鏃惰〃绀虹浜屾绉伴噸锛屽嚭搴撴椂鍊欒〃绀虹涓�娆$О閲嶏紝鍗曚綅KG") + private Double emptyWeight = 0.0; + + @Column(name = "EMPTY_WEIGHT_TIME_") + @PropertyDef(label = "绌鸿溅绉伴噸鏃堕棿") + private Date emptyWeightTime; + + @Column(name = "EMPTY_WEIGHT_USER_", length = 50) + @PropertyDef(label = "绌鸿溅绉伴噸浜�") + private String emptyWeightUser; + + @Column(name = "NET_WEIGHT_") + @PropertyDef(label = "鍑�姣涢噸", description = "鍗曚綅KG锛岀瓑浜庢弧杞� - 绌鸿溅") + private double netWeight = 0.0; + + @Column(name = "DE_HANDLE_") + @PropertyDef(label = "鐜板満鎵i噸", description = "鍗曚綅KG") + private double deHandle = 0.0; + + @Column(name = "DE_PACKAGE_") + @PropertyDef(label = "鍖呰鎵i噸", description = "鍗曚綅KG") + private double dePackage = 0.0; + + @Column(name = "DE_OTHER_") + @PropertyDef(label = "鍏朵粬鎵i噸", description = "鍗曚綅KG") + private double deOther = 0.0; + + @Column(name = "DE_OTHER_INTO_", length = 200) + @PropertyDef(label = "鍏朵粬鎵i噸鍘熷洜") + private String deOtherInfo; + + @Column(name = "SETTLE_WEIGHT_") + @PropertyDef(label = "缁撶畻閲嶉噺", description = "鎵i噸鍚庡噣閲嶏紝缁撶畻鍑�閲嶏紝鍗曚綅KG") + private Double settleWeight = 0.0; + + @Column(name = "RECORD_WEIGHT_") + @PropertyDef(label = "鍏ュ簱閲嶉噺", description = "鎵i噸鍚庡噣閲嶏紝缁撶畻鍑�閲嶏紝琛ュ寘鎷閲嶏紝鍗曚綅KG") + private Double recordWeight = 0.0; + + + /** + * -----------缁撶畻淇℃伅----------------------- + **/ + @Column(name = "PRICE_") + @PropertyDef(label = "鍗曚环", description = "鍗曚綅锛氬厓/鍏枻") + private Double price = 0.0; + + @Column(name = "SETTLE_MONEY_") + @PropertyDef(label = "缁撶畻閲戦", description = "鍗曚綅锛氬厓") + private Double settleMoney = 0.00; + + @Column(name = "SETTLE_ID_", length = 50) + @PropertyDef(label = "缁撶畻鍗曞彿", description = "濡傛灉鏄崟杞︾粨绠楀繀濉�") + private String settleId; + + /** + * ----------- 鍊间粨淇℃伅----------------------- + **/ + @Column(name = "HANDLE_USER_", length = 40) + @PropertyDef(label = "鍊间粨鎿嶄綔浜�") + private String handleUser; + + // 鍑哄簱 + @Column(name = "COMPLETE_TIME_") + @PropertyDef(label = "瀹屾垚鏃堕棿") + private Date completeTime; + + @Column(name = "COMPLETE_USER_", length = 40) + @PropertyDef(label = "瀹屾垚纭浜�") + private String completeUser; + + // 澶囨敞 + @Column(name = "REMARKS_", length = 200) + @PropertyDef(label = "澶囨敞淇℃伅") + private String remarks; + + + /** + * ----------- 鍏朵粬淇℃伅锛岄拡瀵规鏂ょ被鍨嬫爣鍑嗗寘鍏ュ簱濉啓----------------------- + **/ + @Column(name = "bzw", length = 2) + @PropertyDef(label = "鍖呰鐗�", description = "1锛氶夯琚�2锛氱紪缁囪3锛氭暎瑁�9锛氬叾浠�") + private String bzw; + + @Column(name = "dbz") + @PropertyDef(label = "鍗曞寘閲�", description = "鍗曚綅锛氬叕鏂�") + private Double dbz; + + @Column(name = "bzbjs") + @PropertyDef(label = "鍖呬欢鏁�", description = "鍗曚綅锛氫欢") + private int bzbjs; + + @Column(name = "UPDATE_TIME_") + @PropertyDef(label = "鏁版嵁鏇存柊鏃堕棿") + private Date updateTime; + +} diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1201.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1201.java new file mode 100644 index 0000000..0ef1b56 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1201.java @@ -0,0 +1,151 @@ +package com.fzzy.async.fzzy40.impl; + +import com.fzzy.api.Constant; +import com.fzzy.api.entity.Api1102; +import com.fzzy.api.entity.Api1201; +import com.fzzy.api.entity.ApiLog; +import com.fzzy.api.service.ApiTriggerService; +import com.fzzy.api.utils.ContextUtil; +import com.fzzy.api.view.repository.Api1102Rep; +import com.fzzy.api.view.repository.Api1201Rep; +import com.fzzy.api.view.repository.ApiLogRep; +import com.fzzy.async.fzzy40.entity.Fz40InoutContract; +import com.fzzy.async.fzzy40.repository.Fzzy40Sync1201Rep; +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.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 鍚堝悓淇℃伅鏁版嵁鎺ュ彛 + */ +@Slf4j +@Component +public class Fzzy40Sync1201 { + + @Autowired + private Fzzy40Sync1201Rep fzzySync1201Rep; + @Autowired + private ApiTriggerService apiTriggerService; + @Autowired + private Api1201Rep api1201Rep; + @Autowired + private Api1102Rep api1102Rep; + @Autowired + private ApiLogRep apiLogRep; + + + /** + * 鍚屾鍚堝悓鎺ュ彛 + * + * @param deptId + * @param start + * @param end + */ + public void syncData(String kqdm, String deptId, Date start, Date end) { + + log.info("-------------1201鎺ュ彛鏁版嵁寮�濮嬪悓姝�------------------"); + + //鍚屾鏁版嵁锛屽彧璁板綍澶辫触鐨勪俊鎭� + ApiLog apiLog = new ApiLog(); + apiLog.setType(ApiLog.TYPE_SYNC); + apiLog.setKqdm(deptId); + apiLog.setUploadTime(new Date()); + apiLog.setInteId(Constant.API_CODE_1201); + apiLog.setStatus(99); + apiLog.setId(ContextUtil.getUUID()); + try { + List<Fz40InoutContract> list = fzzySync1201Rep.listContract(deptId); + + if (null == list || list.isEmpty()) { + log.debug("-------------娌℃湁鑾峰彇鍒板悎鍚屼俊鎭�------------------"); + return; + } + + //鏍规嵁搴撳尯浠g爜鑾峰彇鍗曚綅浠g爜 + Api1102 api1201 = api1102Rep.findById(kqdm).get(); + + Api1201 apiData; + List<Api1201> api1201List; + for (Fz40InoutContract sysData : list) { + + apiData = new Api1201(); + //鍗曚綅浠g爜锛� 1101 鎺ュ彛鐨勫崟浣嶄唬 鐮侊級 +鑷畾涔夌紪鐮� + apiData.setHth(api1201.getDwdm() + sysData.getId()); + apiData.setHtmc(sysData.getName()); + apiData.setDwdm(api1201.getDwdm()); + + //涓氬姟绫诲瀷 + String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_HT_YWLX, sysData.getType()); + apiData.setYwlx(mappingCode); + //瀹㈡埛绫诲瀷 + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_KHLX, sysData.getCustomerType()); + apiData.setKhlx(mappingCode); + + apiData.setKhtyshxydm(StringUtils.isEmpty(sysData.getCustomerId()) ? "100000000000000000" :sysData.getCustomerId()); + + apiData.setKhmc(sysData.getCustomerName()); + apiData.setFddbr(sysData.getCustomerSignUser()); + + apiData.setQdrq(sysData.getSigningTime()); + + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety()); + apiData.setLspzdm(mappingCode); + + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, sysData.getFoodVariety()); + apiData.setLsxzdm(mappingCode); + + //鍗曚环锛氬厓/鍏枻-->鍏�/鍚� + apiData.setHtdj(sysData.getPrice() == null ? 0.0 : sysData.getPrice()*1000); + apiData.setYdgxlssl(sysData.getContactAmount() == null ? 0.0 : sysData.getContactAmount()); + + apiData.setHtzje(new BigDecimal(sysData.getMoney())); + + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_JSYHTYZX, ""); + apiData.setJsyhtyzx(mappingCode); + + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_BANK, sysData.getCustomerBank()); + apiData.setKhfkhh(mappingCode); + + apiData.setKhfzh(sysData.getCustomerBankAccount()); + + apiData.setKhqyr(sysData.getCustomerSignUser()); + + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_BANK, sysData.getBank()); + apiData.setBfkhh(mappingCode == null ? "999" : mappingCode); + + apiData.setBfzh(StringUtils.isEmpty(sysData.getBankAccount()) ? "1000000000000000000" : sysData.getBankAccount()); + + apiData.setWcrq(sysData.getEndTime()); + + apiData.setZhgxsj(sysData.getCreateTime()); + + apiData.setSyncTime(new Date()); + apiData.setBizId(sysData.getId()); + + apiLog.setDataId(apiData.getBizId()); + apiLog.setKqdm(kqdm); + + api1201List = api1201Rep.getDataById(apiData.getHth()); + if(null == api1201List || api1201List.isEmpty()){ + apiData.setCzbz(Constant.CZBZ_I); + }else { + apiData.setCzbz(api1201List.get(0).getCzbz()); + } + + //淇濆瓨鏁版嵁 + api1201Rep.save(apiData); + + + log.info("1201---鍚屾鏁版嵁锛歿}", apiData.toString()); + } + } catch (Exception e) { + log.error("---鍚堝悓鍚屾鎵ц澶辫触----{}", e); + apiLog.setResult("鍚屾鍚堝悓淇℃伅澶辫触锛�" + e.getMessage()); + apiLogRep.save(apiLog); + } + } +} diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1202.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1202.java new file mode 100644 index 0000000..0b09017 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1202.java @@ -0,0 +1,196 @@ +package com.fzzy.async.fzzy40.impl; + +import com.fzzy.api.Constant; +import com.fzzy.api.entity.Api1105; +import com.fzzy.api.entity.Api1202; +import com.fzzy.api.entity.ApiLog; +import com.fzzy.api.service.ApiCommonService; +import com.fzzy.api.service.ApiTriggerService; +import com.fzzy.api.utils.ContextUtil; +import com.fzzy.api.view.repository.Api1202Rep; +import com.fzzy.api.view.repository.ApiLogRep; +import com.fzzy.async.fzzy40.entity.Fz40InoutNoticeIn; +import com.fzzy.async.fzzy40.entity.Fz40InoutRecord; +import com.fzzy.async.fzzy40.repository.Fzzy40Sync1202Rep; +import com.fzzy.async.fzzy40.repository.Fzzy40SyncNoticeInRep; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.time.DateFormatUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +/** + * 绮鍏ュ簱淇℃伅 + */ +@Slf4j +@Component +public class Fzzy40Sync1202 { + + /** + * 鍏ュ簱绫诲瀷 + */ + private final static String INOUT_TYPE_IN = "IN"; + + @Autowired + private Fzzy40Sync1202Rep fzzySync1202Rep; + @Autowired + private Fzzy40SyncNoticeInRep fzzySyncNoticeInRep; + @Autowired + private ApiTriggerService apiTriggerService; + @Autowired + private Api1202Rep api1202Rep; + @Autowired + private ApiCommonService commonService; + @Autowired + private ApiLogRep apiLogRep; + + /** + * 绮鍏ュ簱淇℃伅 + * + * @param deptId + * @param start + * @param end + */ + public void syncData(String kqdm, String deptId, Date start, Date end) { + log.info("-------------1202鎺ュ彛鏁版嵁寮�濮嬪悓姝�------------------"); + + //鍚屾鏁版嵁锛屽彧璁板綍澶辫触鐨勪俊鎭� + ApiLog apiLog = new ApiLog(); + apiLog.setType(ApiLog.TYPE_SYNC); + apiLog.setKqdm(deptId); + apiLog.setUploadTime(new Date()); + apiLog.setInteId(Constant.API_CODE_1202); + apiLog.setStatus(99); + apiLog.setId(ContextUtil.getUUID()); + try { + //鑾峰彇绮鍏ュ簱璁板綍淇℃伅锛屾牴鎹祦绋嬪畬鎴愭椂闂磋幏鍙� + List<Fz40InoutRecord> list = fzzySync1202Rep.listInoutRecord(deptId, INOUT_TYPE_IN, start, end); + + if (null == list || list.isEmpty()) { + log.info("-------------娌℃湁鑾峰彇鍒扮伯椋熷叆搴撲俊鎭�------------------"); + return; + } + + Api1202 apiData; + Api1105 api1105; + List<Fz40InoutNoticeIn> listInoutNotice; + List<Api1202> api1202List; + Calendar c = Calendar.getInstance(); + for (Fz40InoutRecord sysData : list) { + if(null == sysData.getRecordWeight() || sysData.getRecordWeight() == 0){ + sysData.setRecordWeight(sysData.getSettleWeight()); + } + //鍒ゆ柇鍑�閲嶆槸鍚﹀ぇ浜�0锛岀瓑浜�0琛ㄧず涓嶅悎鏍硷紝涓嶈繘琛屽悓姝ヤ笂浼� + if(null == sysData.getRecordWeight() || sysData.getRecordWeight() == 0){ + continue; + } + //鑾峰彇璐т綅淇℃伅 + api1105 = commonService.getApi1105Cache(sysData.getDepotId()); + if (null == api1105) { + continue; + } + apiData = new Api1202(); + + apiData.setRkywdh(Constant.INOUT_TYPE_14 + sysData.getId().substring(4)); + + //璐т綅浠g爜 + apiData.setHwdm(api1105.getHwdm()); + apiData.setYwlx(Constant.INOUT_TYPE_2); + apiData.setYwrq(sysData.getRegisterTime()); + apiData.setCyr(sysData.getUserName()); + + //榛樿涓�涓殢渚垮�� + apiData.setLxdh(StringUtils.isEmpty(sysData.getUserContact()) ? "13012345678" : sysData.getUserContact()); + + apiData.setSfzh(null == sysData.getUserId() ? "410183200010100000" : sysData.getUserId()); + + //鑾峰彇鍚堝悓鍙� + listInoutNotice = fzzySyncNoticeInRep.listInoutNoticeInById(sysData.getNoticeId()); + if(null != listInoutNotice && listInoutNotice.size() >0){ + apiData.setHth(api1105.getHwdm().substring(0,18) + listInoutNotice.get(0).getContractId()); + }else { + apiData.setHth(api1105.getHwdm().substring(0,18) + apiData.getRkywdh()); + } + + apiData.setXxdz(sysData.getUserAddress()); + + //杩愯緭宸ュ叿锛岃嫢涓虹┖锛屽垯榛樿缁�1-姹借溅 + apiData.setYsgj(StringUtils.isEmpty(sysData.getTransType()) ? "1":sysData.getTransType()); + + //杞﹁埞鍙� + apiData.setCch(sysData.getPlateNum()); + c.setTime(sysData.getRegisterTime()); + c.add(Calendar.MINUTE,-3); + apiData.setDjsj(c.getTime()); + + //绮鍝佺 + String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety()); + apiData.setLspzdm(mappingCode); + + //绮鎬ц川 + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, sysData.getFoodType()); + apiData.setLsxzdm(mappingCode); + + apiData.setShnd(StringUtils.isEmpty(sysData.getFoodYear())? DateFormatUtils.format(new Date(), "yyyy") :sysData.getFoodYear()); + + //浜у湴浠g爜 + String cddm = commonService.getFoodLocationIdFromCache(sysData.getFoodLocation()); + apiData.setCddm(cddm); + + //妫�鏂ょ被鍨嬶紝榛樿0-绉伴噸鍏ュ簱 + apiData.setJjlx("0"); + + //姣涢噸淇℃伅 + apiData.setMz(sysData.getFullWeight()); + apiData.setMzjlsj(sysData.getFullWeightTime()); + apiData.setMzjby(sysData.getFullWeightUser()); + apiData.setMzjly(sysData.getFullWeightUser()); + + apiData.setZcy(sysData.getHandleUser()); + + //鐨噸淇℃伅 + apiData.setPz(sysData.getEmptyWeight()); + apiData.setPzjlsj(sysData.getEmptyWeightTime()); + apiData.setPzjby(sysData.getEmptyWeightUser()); + apiData.setPzjly(sysData.getEmptyWeightUser()); + + //鎵i噸 鍖栭獙鎬绘墸閲� + apiData.setZjklxj(sysData.getDeCheck()); + + //鍏跺畠 + apiData.setQtkl( 0 - sysData.getDeOther()); + //鍊间粨 鐜板満鎵i噸 + apiData.setXckl( 0 - sysData.getDeHandle()); + + apiData.setJz(sysData.getRecordWeight()); + c.setTime(sysData.getCompleteTime()); + c.add(Calendar.MINUTE,3); + apiData.setCmsj(c.getTime()); + + //鎿嶄綔鏍囧織鍙婃渶鍚庢洿鏂版椂闂� + apiData.setZhgxsj(c.getTime()); + + //涓氬姟id銆佸簱鍖虹紪鐮併�佸悓姝ユ椂闂� + apiData.setBizId(sysData.getId()); + apiData.setKqdm(kqdm); + apiData.setSyncTime(new Date()); + api1202List = api1202Rep.getDataById(apiData.getRkywdh()); + if(null == api1202List || api1202List.isEmpty()){ + apiData.setCzbz(Constant.CZBZ_I); + }else { + apiData.setCzbz(api1202List.get(0).getCzbz()); + } + //淇濆瓨鏁版嵁 + api1202Rep.save(apiData); + log.info("1202---鍚屾鏁版嵁锛歿}", apiData.toString()); + } + } catch (Exception e) { + log.error("---鍚屾澶辫触----{}", e); + apiLog.setResult("鍚屾澶辫触锛�" + e.getMessage()); + apiLogRep.save(apiLog); + } + } +} diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java new file mode 100644 index 0000000..29cd89c --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java @@ -0,0 +1,187 @@ +package com.fzzy.async.fzzy40.impl; + +import com.fzzy.api.Constant; +import com.fzzy.api.entity.Api1105; +import com.fzzy.api.entity.Api1205; +import com.fzzy.api.entity.ApiLog; +import com.fzzy.api.service.ApiCommonService; +import com.fzzy.api.service.ApiTriggerService; +import com.fzzy.api.utils.ContextUtil; +import com.fzzy.api.view.repository.Api1205Rep; +import com.fzzy.api.view.repository.ApiLogRep; +import com.fzzy.async.fzzy40.entity.Fz40InoutNoticeOut; +import com.fzzy.async.fzzy40.entity.Fz40InoutRecord; +import com.fzzy.async.fzzy40.repository.Fzzy40Sync1202Rep; +import com.fzzy.async.fzzy40.repository.Fzzy40SyncNoticeOutRep; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.time.DateFormatUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +/** + * 绮鍑哄簱淇℃伅 + */ +@Slf4j +@Component +public class Fzzy40Sync1205 { + + /** + * 鍑哄簱绫诲瀷 + */ + private final static String INOUT_TYPE_OUT = "OUT"; + @Autowired + private Fzzy40Sync1202Rep fzzySync1202Rep; + @Autowired + private Fzzy40SyncNoticeOutRep fzzySyncNoticeOutRep; + @Autowired + private ApiTriggerService apiTriggerService; + @Autowired + private Api1205Rep api1205Rep; + @Autowired + private ApiCommonService commonService; + @Autowired + private ApiLogRep apiLogRep; + + /** + * 绮鍑哄簱淇℃伅 + * + * @param deptId + * @param start + * @param end + */ + public void syncData(String kqdm, String deptId, Date start, Date end) { + + log.info("-------------1205鎺ュ彛鏁版嵁寮�濮嬪悓姝�------------------"); + + //鍚屾鏁版嵁锛屽彧璁板綍澶辫触鐨勪俊鎭� + ApiLog apiLog = new ApiLog(); + apiLog.setType(ApiLog.TYPE_SYNC); + apiLog.setKqdm(deptId); + apiLog.setUploadTime(new Date()); + apiLog.setInteId(Constant.API_CODE_1205); + apiLog.setStatus(99); + apiLog.setId(ContextUtil.getUUID()); + try { + //鑾峰彇绮鍑哄簱淇℃伅锛屾牴鎹祦绋嬪畬鎴愭椂闂磋幏鍙� + List<Fz40InoutRecord> list = fzzySync1202Rep.listInoutRecord(deptId, INOUT_TYPE_OUT, start, end); + + if (null == list || list.isEmpty()) { + log.info("-------------娌℃湁鑾峰彇鍒扮伯椋熷嚭搴撲俊鎭�------------------"); + return; + } + + Api1205 apiData; + Api1105 api1105; + List<Fz40InoutNoticeOut> listInoutNotice; + List<Api1205> api1205List; + Calendar c = Calendar.getInstance(); + for (Fz40InoutRecord sysData : list) { + if(null == sysData.getRecordWeight() || sysData.getRecordWeight() == 0){ + sysData.setRecordWeight(sysData.getSettleWeight()); + } + //鍒ゆ柇鍑�閲嶆槸鍚﹀ぇ浜�0锛岀瓑浜�0琛ㄧず涓嶅悎鏍硷紝涓嶈繘琛屽悓姝ヤ笂浼� + if(null == sysData.getRecordWeight() || sysData.getRecordWeight() == 0){ + continue; + } + //鑾峰彇璐т綅淇℃伅 + api1105 = commonService.getApi1105Cache(sysData.getDepotId()); + if(null == api1105){ + continue; + } + apiData = new Api1205(); + apiData.setCkywdh(Constant.INOUT_TYPE_15 + sysData.getId().substring(4)); + + + //璐т綅浠g爜 + apiData.setHwdm(api1105.getHwdm()); + apiData.setYwlx(Constant.INOUT_TYPE_1); + + //閫氱煡鍗曞彿 + apiData.setCktzdh(sysData.getNoticeId()); + + apiData.setYwrq(sysData.getRegisterTime()); + + //鑾峰彇鍚堝悓鍙� + listInoutNotice = fzzySyncNoticeOutRep.listInoutNoticeOutById(sysData.getNoticeId()); + if(null != listInoutNotice && listInoutNotice.size() >0){ + apiData.setHth(api1105.getHwdm().substring(0,18) + listInoutNotice.get(0).getContractId()); + }else { + apiData.setHth(api1105.getHwdm().substring(0,18) + apiData.getCkywdh()); + } + + + //杩愯緭宸ュ叿锛岃嫢涓虹┖锛屽垯榛樿缁�1-姹借溅 + apiData.setYsgj(StringUtils.isEmpty(sysData.getTransType()) ? "1":sysData.getTransType()); + + //杞﹁埞鍙� + apiData.setCch(sysData.getPlateNum()); + c.setTime(sysData.getRegisterTime()); + c.add(Calendar.MINUTE,-3); + apiData.setDjsj(c.getTime()); + + //绮鍝佺 + String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety()); + apiData.setLspzdm(mappingCode); + + //绮绛夌骇 + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSDJ, sysData.getFoodLevel()); + apiData.setLsdjdm(mappingCode); + + //绮鎬ц川 + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, sysData.getFoodType()); + apiData.setLsxzdm(mappingCode); + + apiData.setShnd(StringUtils.isEmpty(sysData.getFoodYear())? DateFormatUtils.format(new Date(), "yyyy") :sysData.getFoodYear()); + + //浜у湴浠g爜 + String cddm = commonService.getFoodLocationIdFromCache(sysData.getFoodLocation()); + apiData.setCddm(cddm); + + //鐨噸淇℃伅 + apiData.setPz(sysData.getEmptyWeight()); + apiData.setPzjlsj(sysData.getEmptyWeightTime()); + apiData.setPzjby(sysData.getEmptyWeightUser()); + apiData.setPzjly(sysData.getEmptyWeightUser()); + + //姣涢噸淇℃伅 + apiData.setMz(sysData.getFullWeight()); + apiData.setMzjlsj(sysData.getFullWeightTime()); + apiData.setMzjby(sysData.getFullWeightUser()); + apiData.setMzjly(sysData.getFullWeightUser()); + + //鍑�閲� + apiData.setJz(sysData.getRecordWeight()); + c.setTime(sysData.getCompleteTime()); + c.add(Calendar.MINUTE,3); + apiData.setCmsj(c.getTime()); + + //鎿嶄綔鏍囧織鍙婃渶鍚庢洿鏂版椂闂� + apiData.setZhgxsj(c.getTime()); + + //涓氬姟id銆佸簱鍖虹紪鐮併�佸悓姝ユ椂闂� + apiData.setBizId(sysData.getId()); + apiData.setKqdm(kqdm); + apiData.setSyncTime(new Date()); + log.info("1201---鍚屾鏁版嵁锛歿}",apiData.toString()); + + api1205List = api1205Rep.getDataById(apiData.getCkywdh()); + if(null == api1205List || api1205List.isEmpty()){ + apiData.setCzbz(Constant.CZBZ_I); + }else { + apiData.setCzbz(api1205List.get(0).getCzbz()); + } + //淇濆瓨鏁版嵁 + api1205Rep.save(apiData); + } + } catch (Exception e) { + log.error("---鍚屾澶辫触----{}", e); + apiLog.setResult("鍚屾澶辫触锛�" + e.getMessage()); + apiLogRep.save(apiLog); + } + } +} diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1212.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1212.java new file mode 100644 index 0000000..adb09e6 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1212.java @@ -0,0 +1,114 @@ +package com.fzzy.async.fzzy40.impl; + +import com.fzzy.api.Constant; +import com.fzzy.api.entity.*; +import com.fzzy.api.utils.ContextUtil; +import com.fzzy.api.view.repository.Api1101Rep; +import com.fzzy.api.view.repository.Api1102Rep; +import com.fzzy.api.view.repository.Api1212Rep; +import com.fzzy.api.view.repository.ApiLogRep; +import com.fzzy.async.fzzy40.entity.Fz40InoutCustomer; +import com.fzzy.async.fzzy40.repository.Fzzy40Sync1212Rep; +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.Date; +import java.util.List; + +/** + * 瀹㈡埛淇℃伅鏁版嵁鎺ュ彛 + */ +@Slf4j +@Component +public class Fzzy40Sync1212 { + + @Autowired + private Fzzy40Sync1212Rep fzzySync1212Rep; + @Autowired + private Api1102Rep api1102Rep; + @Autowired + private Api1101Rep api1101Rep; + @Autowired + private Api1212Rep api1212Rep; + @Autowired + private ApiLogRep apiLogRep; + + /** + * 鍚屾瀹㈡埛鎺ュ彛 + * + * @param deptId + * @param start + * @param end + */ + public void syncData(String kqdm, String deptId, Date start, Date end) { + + log.info("-------------1201鎺ュ彛鏁版嵁寮�濮嬪悓姝�------------------"); + + //鍚屾鏁版嵁锛屽彧璁板綍澶辫触鐨勪俊鎭� + ApiLog apiLog = new ApiLog(); + apiLog.setType(ApiLog.TYPE_SYNC); + apiLog.setKqdm(deptId); + apiLog.setUploadTime(new Date()); + apiLog.setInteId(Constant.API_CODE_1201); + apiLog.setStatus(99); + apiLog.setId(ContextUtil.getUUID()); + try { + List<Fz40InoutCustomer> list = fzzySync1212Rep.listInoutCustomer(deptId); + + if (null == list || list.isEmpty()) { + log.debug("-------------娌℃湁鑾峰彇鍒板悎鍚屼俊鎭�------------------"); + return; + } + + //鏍规嵁搴撳尯浠g爜鑾峰彇搴撳尯浠g爜 + Api1102 api1201 = api1102Rep.findById(kqdm).get(); + List<Api1101> list1 = api1101Rep.findPushData(kqdm); + Api1101 api1101 = list1.get(0); + + Api1212 apiData; + List<Api1212> api1212List; + for (Fz40InoutCustomer sysData : list) { + + apiData = new Api1212(); + + apiData.setId(sysData.getId()); + //鍗曚綅浠g爜锛� 1101 鎺ュ彛鐨勫崟浣嶄唬 鐮侊級 +鑷畾涔夌紪鐮� + apiData.setDwdm(api1101.getDwdm()); + apiData.setDwmc(api1101.getDwmc()); + apiData.setKqmc(api1201.getKqmc()); + apiData.setKqdm(kqdm); + apiData.setKhlx(StringUtils.isEmpty(sysData.getKhlx()) ? "1":sysData.getKhlx()); + apiData.setKhtyshxydmhsfzh(sysData.getCardId()); + apiData.setKhmc(sysData.getName()); + + apiData.setFddbr(StringUtils.isEmpty(sysData.getFddbr())? "娉曞畾浜�" : sysData.getFddbr()); + + apiData.setTxdz(sysData.getAddress()); + apiData.setYzbm(sysData.getYzbm()); + apiData.setLxrdh(sysData.getContactUser()); + apiData.setKhfkhh(sysData.getBank()); + apiData.setKhfzh(sysData.getBankNum()); + apiData.setBizId(sysData.getId()); + apiData.setZhgxsj(new Date()); + + api1212List = api1212Rep.getDataById(apiData.getId()); + + if(null == api1212List || api1212List.isEmpty()){ + apiData.setCzbz(Constant.CZBZ_I); + }else { + apiData.setCzbz(api1212List.get(0).getCzbz()); + } + + //淇濆瓨鏁版嵁 + api1212Rep.save(apiData); + + log.info("1201---鍚屾鏁版嵁锛歿}", apiData.toString()); + } + } catch (Exception e) { + log.error("---鍚堝悓鍚屾鎵ц澶辫触----{}", e); + apiLog.setResult("鍚屾鍚堝悓淇℃伅澶辫触锛�" + e.getMessage()); + apiLogRep.save(apiLog); + } + } +} diff --git a/src/main/java/com/fzzy/async/fzzy40/package-info.java b/src/main/java/com/fzzy/async/fzzy40/package-info.java new file mode 100644 index 0000000..a513adc --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/package-info.java @@ -0,0 +1,6 @@ +/** + * 椋庢鑷磋繙4.0鐗堟湰鏁版嵁鍚屾 + * + * 涓昏閫傜敤绮簱锛氭墍鏈夊凡鍗囩骇4.0鐗堟湰鐨勭伯搴� + */ +package com.fzzy.async.fzzy40; diff --git a/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1201Rep.java b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1201Rep.java new file mode 100644 index 0000000..ede04a4 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1201Rep.java @@ -0,0 +1,25 @@ +package com.fzzy.async.fzzy40.repository; + +import com.fzzy.async.fzzy40.entity.Fz40InoutContract; +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; + +/** + * 绮璐攢-鍚堝悓淇℃伅鏁版嵁鎺ュ彛鏁版嵁鑾峰彇 + */ +public interface Fzzy40Sync1201Rep extends JpaRepository<Fz40InoutContract, String> { + + /** + * 鏍规嵁淇℃伅鑾峰彇鍚堝悓淇℃伅 + * + * @param start + * @param end + * @return + */ +// @Query("from Fz40InoutContract where deptId=:deptId and updateTime >=:start and updateTime <:end order by updateTime ") +// List<Fz40InoutContract> listContract(@Param("deptId") String deptId, @Param("start") Date start, @Param("end") Date end); + @Query("from Fz40InoutContract where deptId=:deptId order by updateTime ") + List<Fz40InoutContract> listContract(@Param("deptId") String deptId); +} diff --git a/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1202Rep.java b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1202Rep.java new file mode 100644 index 0000000..1ab8136 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1202Rep.java @@ -0,0 +1,37 @@ +package com.fzzy.async.fzzy40.repository; + +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 chen + * @date 2022-09-23 17:10 + */ +public interface Fzzy40Sync1202Rep extends JpaRepository<Fz40InoutRecord, String> { + + /** + * 鏍规嵁淇℃伅鑾峰彇鍑哄叆搴撲俊鎭� + * @param deptId + * @param type + * @param start + * @param end + * @return + */ + @Query("from Fz40InoutRecord where deptId=:deptId and type=:type and updateTime >=:start and updateTime <:end order by updateTime ") + List<Fz40InoutRecord> listInoutRecord(@Param("deptId") String deptId, @Param("type") String type, @Param("start") Date start, @Param("end") Date end); + + /** + * 鏍规嵁id鑾峰彇绮鍑哄叆搴撲俊鎭� + * @param id + * @return + */ + @Query("from Fz40InoutRecord where id=:id order by updateTime ") + List<Fz40InoutRecord> listInoutRecordById(@Param("id") String id); + +} diff --git a/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1212Rep.java b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1212Rep.java new file mode 100644 index 0000000..9fab138 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1212Rep.java @@ -0,0 +1,26 @@ +package com.fzzy.async.fzzy40.repository; + +import com.fzzy.async.fzzy40.entity.Fz40InoutCustomer; +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; + +/** + * 绮璐攢-瀹㈡埛淇℃伅鏁版嵁鎺ュ彛鏁版嵁鑾峰彇 + */ +public interface Fzzy40Sync1212Rep extends JpaRepository<Fz40InoutCustomer, String> { + + /** + * 鏍规嵁淇℃伅鑾峰彇瀹㈡埛淇℃伅 + * + * @param start + * @param end + * @return + */ +// @Query("from Fz40InoutCustomer where deptId=:deptId and updateTime >=:start and updateTime <:end order by updateTime ") +// List<Fz40InoutCustomer> listInoutCustomer(@Param("deptId") String deptId, @Param("start") Date start, @Param("end") Date end); + @Query("from Fz40InoutCustomer where deptId=:deptId order by updateTime ") + List<Fz40InoutCustomer> listInoutCustomer(@Param("deptId") String deptId); +} diff --git a/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncNoticeInRep.java b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncNoticeInRep.java new file mode 100644 index 0000000..c33906a --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncNoticeInRep.java @@ -0,0 +1,26 @@ +package com.fzzy.async.fzzy40.repository; + +import com.fzzy.async.fzzy40.entity.Fz40InoutNoticeIn; +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-04-06 10:10 + */ +public interface Fzzy40SyncNoticeInRep extends JpaRepository<Fz40InoutNoticeIn, String> { + + + /** + * 鏍规嵁id鑾峰彇鍏ュ簱閫氱煡鍗曚俊鎭� + * @param id + * @return + */ + @Query("from Fz40InoutNoticeIn where id=:id ") + List<Fz40InoutNoticeIn> listInoutNoticeInById(@Param("id") String id); + +} diff --git a/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncNoticeOutRep.java b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncNoticeOutRep.java new file mode 100644 index 0000000..71e09c9 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncNoticeOutRep.java @@ -0,0 +1,26 @@ +package com.fzzy.async.fzzy40.repository; + +import com.fzzy.async.fzzy40.entity.Fz40InoutNoticeOut; +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-04-06 10:10 + */ +public interface Fzzy40SyncNoticeOutRep extends JpaRepository<Fz40InoutNoticeOut, String> { + + + /** + * 鏍规嵁id鑾峰彇鍑哄簱閫氱煡鍗曚俊鎭� + * @param id + * @return + */ + @Query("from Fz40InoutNoticeOut where id=:id ") + List<Fz40InoutNoticeOut> listInoutNoticeOutById(@Param("id") String id); + +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index fb7210d..38f74c0 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -6,20 +6,35 @@ #涓绘暟鎹簮 primary: # url: jdbc:mysql://127.0.0.1:3306/igds_api_5016?useUnicode=true&useSSL=false&characterEncoding=utf-8 - url: jdbc:mysql://127.0.0.1:3306/igds_api_5303?useUnicode=true&useSSL=false&characterEncoding=utf-8 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5303?useUnicode=true&useSSL=false&characterEncoding=utf-8 # url: jdbc:mysql://127.0.0.1:3306/igds_api_5311?useUnicode=true&useSSL=false&characterEncoding=utf-8 # url: jdbc:mysql://127.0.0.1:3306/igds_api_5317?useUnicode=true&useSSL=false&characterEncoding=utf-8 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_1?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娓彛鏂颁粨 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_2?useUnicode=true&useSSL=false&characterEncoding=utf-8 #鍏冲煚鑰佷粨 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_3?useUnicode=true&useSSL=false&characterEncoding=utf-8 #鐩村睘浠撳簱 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_4?useUnicode=true&useSSL=false&characterEncoding=utf-8 #瑗胯儶-鏂颁粨绮簱 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_4_2?useUnicode=true&useSSL=false&characterEncoding=utf-8 #瑗胯儶-鏂板嚖绮簱 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_5?useUnicode=true&useSSL=false&characterEncoding=utf-8 #閲戠伓涓�鎵�绮簱 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_6?useUnicode=true&useSSL=false&characterEncoding=utf-8 #閲戠伓浜屾墍绮簱 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_7?useUnicode=true&useSSL=false&characterEncoding=utf-8 #绮补杞繍绔� +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_8?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娌虫邯绮墍 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_9?useUnicode=true&useSSL=false&characterEncoding=utf-8 #娴烽棬绮墍 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5317_10?useUnicode=true&useSSL=false&characterEncoding=utf-8 #鍜屽钩绮墍 # url: jdbc:mysql://127.0.0.1:3306/igds_api_5320?useUnicode=true&useSSL=false&characterEncoding=utf-8 +# url: jdbc:mysql://127.0.0.1:3306/igds_api_5321?useUnicode=true&useSSL=false&characterEncoding=utf-8 #骞夸笢闊跺叧 + url: jdbc:mysql://127.0.0.1:3306/igds_api_5326?useUnicode=true&useSSL=false&characterEncoding=utf-8 #鎯犲窞鎯犳柊 username: root password: Abc123.. driver-class-name: com.mysql.jdbc.Driver #娆℃暟鎹簮 secondary: # url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5016?useUnicode=true&useSSL=false&characterEncoding=utf-8 - url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5303?useUnicode=true&useSSL=false&characterEncoding=utf-8 +# url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5303?useUnicode=true&useSSL=false&characterEncoding=utf-8 # url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5311?useUnicode=true&useSSL=false&characterEncoding=utf-8 # url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5317?useUnicode=true&useSSL=false&characterEncoding=utf-8 # url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5320?useUnicode=true&useSSL=false&characterEncoding=utf-8 +# url: jdbc:mysql://127.0.0.1:3306/igds_3.5_5321?useUnicode=true&useSSL=false&characterEncoding=utf-8 + url: jdbc:mysql://127.0.0.1:3306/igds_4.0_5326?useUnicode=true&useSSL=false&characterEncoding=utf-8 #鎯犲窞鎯犳柊 username: root password: Abc123.. driver-class-name: com.mysql.jdbc.Driver diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml index 249c112..90c9bf5 100644 --- a/src/main/resources/application-pro.yml +++ b/src/main/resources/application-pro.yml @@ -1,4 +1,4 @@ -########################## 骞夸笢娼槼 ########################## +########################## 骞夸笢闊跺叧 ########################## server: port: 8090 jetty: @@ -51,7 +51,7 @@ timeout: 6000 igds: default: - companyId: 5317 + companyId: 5321 file-path: D:/IGDS-API/FILE/ img-path: D:/IGDS/FILE/ \ No newline at end of file diff --git a/src/main/resources/application-pro5321.yml b/src/main/resources/application-pro5321.yml new file mode 100644 index 0000000..90c9bf5 --- /dev/null +++ b/src/main/resources/application-pro5321.yml @@ -0,0 +1,57 @@ +########################## 骞夸笢闊跺叧 ########################## +server: + port: 8090 + jetty: + max-http-post-size: 209715200 + tomcat: + max-http-post-size: 209715200 +spring: + datasource: + #涓绘暟鎹簮 + primary: + url: jdbc:mysql://127.0.0.1:3306/igds_api?useUnicode=true&characterEncoding=utf-8 + username: root + password: Abc123.. + driver-class-name: com.mysql.jdbc.Driver + #娆℃暟鎹簮 + secondary: + url: jdbc:mysql://127.0.0.1:3306/igds_master?useUnicode=true&characterEncoding=utf-8 + username: root + password: Abc123.. + driver-class-name: com.mysql.jdbc.Driver + jpa: + #涓籮pa閰嶇疆 + primary: + show-sql: true + properties: + hibernate: + hbm2ddl: + auto: update + dialect: org.hibernate.dialect.MySQL5InnoDBDialect + #娆pa閰嶇疆 + secondary: + show-sql: true + properties: + hibernate: + hbm2ddl: + auto: none + dialect: org.hibernate.dialect.MySQL5InnoDBDialect + # Redis鐩稿叧閰嶇疆 + redis: + database: 0 + host: 127.0.0.1 + port: 6379 + password: Abc123.. + # 杩炴帴姹犳渶澶ц繛鎺ユ暟锛堜娇鐢ㄨ礋鍊艰〃绀烘病鏈夐檺鍒讹級 + pool: + max-active: 200 + max-wait: -1 + max-idle: 10 + min-idle: 0 + timeout: 6000 +igds: + default: + companyId: 5321 + + file-path: D:/IGDS-API/FILE/ + img-path: D:/IGDS/FILE/ \ No newline at end of file diff --git a/src/main/resources/application-pro5326.yml b/src/main/resources/application-pro5326.yml new file mode 100644 index 0000000..46074c8 --- /dev/null +++ b/src/main/resources/application-pro5326.yml @@ -0,0 +1,57 @@ +########################## 骞夸笢鎯犲窞鎯犻槼 ########################## +server: + port: 8090 + jetty: + max-http-post-size: 209715200 + tomcat: + max-http-post-size: 209715200 +spring: + datasource: + #涓绘暟鎹簮 + primary: + url: jdbc:mysql://127.0.0.1:3306/igds_api?useUnicode=true&characterEncoding=utf-8 + username: root + password: Abc123.. + driver-class-name: com.mysql.jdbc.Driver + #娆℃暟鎹簮 + secondary: + url: jdbc:mysql://127.0.0.1:3306/igds_master?useUnicode=true&characterEncoding=utf-8 + username: root + password: Abc123.. + driver-class-name: com.mysql.jdbc.Driver + jpa: + #涓籮pa閰嶇疆 + primary: + show-sql: true + properties: + hibernate: + hbm2ddl: + auto: update + dialect: org.hibernate.dialect.MySQL5InnoDBDialect + #娆pa閰嶇疆 + secondary: + show-sql: true + properties: + hibernate: + hbm2ddl: + auto: none + dialect: org.hibernate.dialect.MySQL5InnoDBDialect + # Redis鐩稿叧閰嶇疆 + redis: + database: 1 + host: 127.0.0.1 + port: 6379 + password: Abc123.. + # 杩炴帴姹犳渶澶ц繛鎺ユ暟锛堜娇鐢ㄨ礋鍊艰〃绀烘病鏈夐檺鍒讹級 + pool: + max-active: 200 + max-wait: -1 + max-idle: 10 + min-idle: 0 + timeout: 6000 +igds: + default: + companyId: 5326 + + file-path: D:/IGDS-API/FILE/ + img-path: D:/IGDS/FILE/ \ No newline at end of file -- Gitblit v1.9.3