From da0dfffe0c57ed3ca0c66b24a68ccc64da0873c9 Mon Sep 17 00:00:00 2001 From: CZT <czt18638530771@163.com> Date: 星期四, 19 十月 2023 20:19:51 +0800 Subject: [PATCH] 调整上海接口-船运时调整每车为一条数据 --- src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2103.java | 25 src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1212.java | 6 src/main/java/com/fzzy/async/fzzy40/entity/Fz40Quality.java | 10 src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1311.java | 15 src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1203.java | 195 +++++++------ src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1310Rep.java | 4 src/main/java/com/fzzy/otherview/sh2023/ShApi2103.view.xml | 68 +++- src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1202.java | 57 ++- src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java | 20 src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103.java | 2 src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java | 55 ++- src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java | 23 + src/main/java/com/fzzy/api/view/repository/ApiConfsRep.java | 10 /dev/null | 8 src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1212.java | 4 src/main/java/com/fzzy/push/sh2023/SH2023PushService14.java | 86 +++--- src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java | 2 src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1208.java | 2 src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutRecordItem.java | 101 +++++++ src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1201.java | 5 src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java | 80 ++-- src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncInoutRecordItemRep.java | 25 + src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java | 16 src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1201.java | 7 24 files changed, 524 insertions(+), 302 deletions(-) diff --git a/src/main/java/com/fzzy/api/view/repository/ApiConfsRep.java b/src/main/java/com/fzzy/api/view/repository/ApiConfsRep.java index 022f099..df2f371 100644 --- a/src/main/java/com/fzzy/api/view/repository/ApiConfsRep.java +++ b/src/main/java/com/fzzy/api/view/repository/ApiConfsRep.java @@ -2,8 +2,18 @@ import com.fzzy.api.entity.ApiConfs; 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 ApiConfsRep extends JpaRepository<ApiConfs, String> { + /** + * 鏍规嵁搴撳尯缂栫爜鑾峰彇閰嶇疆淇℃伅 + * @param kqdm + * @return + */ + @Query("from ApiConfs where kqdm =:kqdm ") + List<ApiConfs> getDataByKqdm(@Param("kqdm") String kqdm); } diff --git a/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1201.java b/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1201.java index ccc602e..ea3dee8 100644 --- a/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1201.java +++ b/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1201.java @@ -103,10 +103,13 @@ apiData.setQdrq(sysData.getSigningTime()); + if(StringUtils.isEmpty(sysData.getFoodVariety())){ + continue; + } String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety().substring(0,3)); apiData.setLspzdm(mappingCode); - mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, sysData.getFoodVariety()); + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, sysData.getFoodType()); apiData.setLsxzdm(mappingCode); //鍗曚环锛氬厓/鍚� diff --git a/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1212.java b/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1212.java index 3c468b3..e1fa2fd 100644 --- a/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1212.java +++ b/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1212.java @@ -91,11 +91,9 @@ if(StringUtils.isNotEmpty(sysData.getCardId())){ apiData.setLxrsfzh(sysData.getCardId()); } - if(StringUtils.isNotEmpty(sysData.getYzbm())){ - apiData.setYzbm(sysData.getYzbm()); - } + apiData.setYzbm(StringUtils.isEmpty(sysData.getYzbm()) ? "000000" :sysData.getYzbm()); apiData.setDzyx(StringUtils.isEmpty(sysData.getDzyx()) ? "" :sysData.getDzyx()); -// apiData.setKhfkhh(StringUtils.isEmpty(sysData.getBank()) ? "" :sysData.getBank()); + apiData.setKhfkhh(StringUtils.isEmpty(sysData.getBank()) ? "999" :sysData.getBank()); apiData.setKhfzh(StringUtils.isEmpty(sysData.getBankNum()) ? "" :sysData.getBankNum()); apiData.setZhgxsj(sysData.getUpdateTime() == null ? new Date() : sysData.getUpdateTime()); apiData.setBizId(sysData.getId()); diff --git a/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java b/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java index 3e204e2..6cafadf 100644 --- a/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java +++ b/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java @@ -85,7 +85,7 @@ fzzySync1207.syncData(kqdm, deptId, start, end); //鍑哄叆搴撴枃浠朵俊鎭悓姝� - fzzySync1109.syncData(kqdm, deptId, start, end); +// fzzySync1109.syncData(kqdm, deptId, start, end); //绮搴撳瓨鍚屾 fzzySync1208.syncData(kqdm, deptId, start, end); @@ -94,13 +94,13 @@ fzzySync1210.syncData(kqdm, deptId, start, end); /*-----鍚勭渷鐙湁鎺ュ彛淇℃伅鍚屾-----*/ - if (StringUtils.isNotEmpty(param.getPushProtocol()) && PushProtocol.SB_SH_2023.getCode().equals(param.getPushProtocol())) { - //涓婃捣甯傚钩鍙�2023鐗堬紝闇�瑕佸悓姝ュ競鍌ㄦ鏂ゅ崟锛屽悓姝ュ競鍌ㄩ┏杩愬崟 - //鍚屾甯傚偍妫�鏂ゅ崟 - fzzySync2101.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd()); - //鍚屾甯傚偍椹宠繍鍗� - fzzySync2104.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd()); - } +// if (StringUtils.isNotEmpty(param.getPushProtocol()) && PushProtocol.SB_SH_2023.getCode().equals(param.getPushProtocol())) { +// //涓婃捣甯傚钩鍙�2023鐗堬紝闇�瑕佸悓姝ュ競鍌ㄦ鏂ゅ崟锛屽悓姝ュ競鍌ㄩ┏杩愬崟 +// //鍚屾甯傚偍妫�鏂ゅ崟 +// fzzySync2101.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd()); +// //鍚屾甯傚偍椹宠繍鍗� +// fzzySync2104.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd()); +// } //璐﹂潰搴撳瓨淇℃伅鍚屾 TODO } diff --git a/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java b/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java index e1de3c3..05cb5f6 100644 --- a/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java +++ b/src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java @@ -51,7 +51,7 @@ //鐔忚捀澶囨鏁版嵁鍚屾 fzzySync1023.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd()); } - if (StringUtils.isNotEmpty(param.getPushProtocol()) && PushProtocol.SB_SH_2023.equals(param.getPushProtocol())) { + if (StringUtils.isNotEmpty(param.getPushProtocol()) && PushProtocol.SB_SH_2023.getCode().equals(param.getPushProtocol())) { //涓婃捣甯傚钩鍙�2023鐗堬紝闇�瑕佸悓姝ョ伯鎯呰澶囬厤缃俊鎭� //鍚屾绮儏璁惧閰嶇疆淇℃伅 diff --git a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutRecordItem.java b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutRecordItem.java new file mode 100644 index 0000000..a56fab7 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutRecordItem.java @@ -0,0 +1,101 @@ +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; + +/** + * 鍑哄叆搴撴祦姘村瓧琛� + * @author + */ +@Data +@Entity +@Table(name = "D_INOUT_RECORD_ITEM") +public class Fz40InoutRecordItem { + + @Id + @Column(name = "ID_", length = 40) + @PropertyDef(label = "涓婚敭id", description = "鏍规嵁涓�瀹氱殑瑙勫垯鐢熸垚") + private String id; + + @Column(name = "RECORD_ID_", length = 40) + @PropertyDef(label = "娴佹按Id") + private String recordId; + + @Column(name = "DEPOT_ID_", length = 50) + @PropertyDef(label = "瑁呭嵏浠撳簱") + private String depotId; + + @Column(name = "CAR_NUM_", length = 20) + @PropertyDef(label = "鑸硅繍杞﹁締搴忓彿") + private String carNum; + + @Column(name = "CAR_NAME_", length = 20) + @PropertyDef(label = "鑸硅繍杞﹁締鍚嶇О") + private String carName; + + @Column(name = "TYPE_", length = 10) + @PropertyDef(label = "鍑哄叆搴撶被鍨�", description = "鍑哄簱锛屽叆搴�") + 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 = "DE_") + @PropertyDef(label = "鎵i噸", description = "鍗曚綅KG") + private Double de = 0.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_") + @PropertyDef(label = "绌鸿溅绉伴噸浜�") + private String emptyWeightUser; + + @Column(name = "NET_WEIGHT_") + @PropertyDef(label = "鍑�閲�", description = "鍗曚綅KG") + private Double netWeight = 0.0; + + @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 = "CREATE_TIME_") + @PropertyDef(label = "鍒涘缓鏃堕棿") + private Date createTime; + + // 澶囨敞 + @Column(name = "REMARKS_", length = 200) + @PropertyDef(label = "澶囨敞淇℃伅") + private String remarks; +} diff --git a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40Quality.java b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40Quality.java index 679f70b..8d9e3bf 100644 --- a/src/main/java/com/fzzy/async/fzzy40/entity/Fz40Quality.java +++ b/src/main/java/com/fzzy/async/fzzy40/entity/Fz40Quality.java @@ -118,11 +118,11 @@ @PropertyDef(label = "鏍峰搧鏁伴噺", required = true) @Column(name = "ypsl", precision = 20, scale = 6) - private double ypsl; + private Double ypsl; @PropertyDef(label = "浠h〃鏁伴噺") @Column(name = "dbsl", precision = 20, scale = 6) - private double dbsl; + private Double dbsl; @PropertyDef(label = "鏍峰搧绛夌骇") @Column(name = "ypdj", length = 2) @@ -139,11 +139,5 @@ @Column(name = "UPDATE_TIME_") @PropertyDef(label = "鏁版嵁鏇存柊鏃堕棿") private Date updateTime; -// -// /** -// * 鍖栭獙椤圭洰鏄庣粏 -// */ -// @Transient -// private List<CheckItemData> checkItems; } diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1201.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1201.java index 6e7cbca..7e08640 100644 --- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1201.java +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1201.java @@ -104,10 +104,13 @@ apiData.setQdrq(sysData.getSigningTime()); - String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety()); + if(StringUtils.isEmpty(sysData.getFoodVariety())){ + continue; + } + String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety().substring(0,3)); apiData.setLspzdm(mappingCode); - mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, sysData.getFoodVariety()); + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, sysData.getFoodType()); apiData.setLsxzdm(mappingCode); //鍗曚环锛氬厓/鍚� diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1202.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1202.java index 993c05d..2a5e59c 100644 --- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1202.java +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1202.java @@ -12,7 +12,9 @@ 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.entity.Fz40InoutRecordItem; import com.fzzy.async.fzzy40.repository.Fzzy40Sync1202Rep; +import com.fzzy.async.fzzy40.repository.Fzzy40SyncInoutRecordItemRep; import com.fzzy.async.fzzy40.repository.Fzzy40SyncNoticeInRep; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; @@ -21,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -38,6 +41,8 @@ @Autowired private Fzzy40Sync1202Rep fzzySync1202Rep; + @Autowired + private Fzzy40SyncInoutRecordItemRep fzzy40SyncInoutRecordItemRep; @Autowired private Fzzy40SyncNoticeInRep fzzySyncNoticeInRep; @Autowired @@ -80,7 +85,11 @@ Api1105 api1105; List<Fz40InoutNoticeIn> listInoutNotice; List<Api1202> api1202List; + List<Fz40InoutRecordItem> listInoutRecordItem; for (Fz40InoutRecord sysData : list) { + if(sysData.getRecordStatus().equals("DEL") || sysData.getRecordStatus().equals("ERROR")){ + continue; + } if(null == sysData.getRecordWeight() || sysData.getRecordWeight() == 0){ sysData.setRecordWeight(sysData.getSettleWeight()); } @@ -97,20 +106,10 @@ apiData.setRkywdh(Constant.INOUT_TYPE_14 + sysData.getId().substring(4)); - //鍒ゆ柇涓氬姟鏃堕棿涓庡崟鎹彿鏄惁鍖归厤锛岃嫢涓嶅尮閰嶏紝鍒欐洿鏀逛笟鍔℃椂闂翠负鍗曟嵁鍙锋墍鍦ㄧ殑鏃堕棿 - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); - Date time = dateFormat.parse(sysData.getId().substring(2, 10)); - int numDay = DateUtil.difDay(DateUtil.getCurZero(sysData.getCompleteTime()), DateUtil.getCurZero(time)); - if(numDay != 0){ - sysData.setFullWeightTime(DateUtils.addDays(sysData.getFullWeightTime(), numDay)); - sysData.setEmptyWeightTime(DateUtils.addDays(sysData.getEmptyWeightTime(), numDay)); - sysData.setCompleteTime(DateUtils.addDays(sysData.getCompleteTime(), numDay)); - } - //璐т綅浠g爜 apiData.setHwdm(api1105.getHwdm()); apiData.setYwlx(Constant.INOUT_TYPE_2); - apiData.setYwrq(sysData.getCompleteTime()); + apiData.setYwrq(DateUtils.parseDate(sysData.getId().substring(2, 10), new String[] { "yyyyMMdd" })); apiData.setCyr(sysData.getUserName()); //榛樿涓�涓殢渚垮�� @@ -119,11 +118,15 @@ apiData.setSfzh(null == sysData.getUserId() ? "410183200010100000" : sysData.getUserId().trim()); //鑾峰彇鍚堝悓鍙� + apiData.setHth(api1105.getHwdm().substring(0,18) + apiData.getRkywdh()); 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()); + if(StringUtils.isNotEmpty(listInoutNotice.get(0).getContractId())){ + apiData.setHth(api1105.getHwdm().substring(0,18) + listInoutNotice.get(0).getContractId()); + } + if(StringUtils.isNotEmpty(listInoutNotice.get(0).getPlanId())){ + apiData.setJhmxh(listInoutNotice.get(0).getPlanId()); + } } apiData.setXxdz(StringUtils.isEmpty(sysData.getUserAddress()) ? "璇︾粏鍦板潃":sysData.getUserAddress()); @@ -137,7 +140,7 @@ apiData.setDjsj(sysData.getRegisterTime()); //绮鍝佺 - String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety()); + String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety().substring(0,3)); apiData.setLspzdm(mappingCode); //绮鎬ц川 @@ -200,9 +203,29 @@ }else { apiData.setCzbz(api1202List.get(0).getCzbz()); } + //鍒ゆ柇鏄惁涓鸿埞杩� + if(StringUtils.isNotEmpty(sysData.getTransType()) && sysData.getTransType().equals("3")){ + listInoutRecordItem = fzzy40SyncInoutRecordItemRep.findDataByRecordId(sysData.getId()); + if(null == listInoutRecordItem || listInoutRecordItem.isEmpty()){ + api1202Rep.save(apiData); + continue; + } - //淇濆瓨鏁版嵁 - api1202Rep.save(apiData); + int idNum = Integer.valueOf(sysData.getId().substring(12))*100 + 10001; + for (Fz40InoutRecordItem fz40InoutRecordItem : listInoutRecordItem) { + apiData.setRkywdh(Constant.INOUT_TYPE_14 + sysData.getId().substring(4,10) + String.valueOf(idNum).substring(1)); + apiData.setMz(fz40InoutRecordItem.getFullWeight()); + apiData.setPz(fz40InoutRecordItem.getEmptyWeight()); + apiData.setJz(fz40InoutRecordItem.getSettleWeight()); + + api1202Rep.save(apiData); + idNum ++; + } + }else { + //淇濆瓨鏁版嵁 + api1202Rep.save(apiData); + } + log.info("1202---鍚屾鏁版嵁锛歿}", apiData.toString()); } } catch (Exception e) { diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1203.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1203.java index 7607a98..227d1b6 100644 --- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1203.java +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1203.java @@ -11,8 +11,10 @@ import com.fzzy.api.view.repository.GbCheckItemRep; import com.fzzy.async.fzzy40.entity.Fz40CheckItem; import com.fzzy.async.fzzy40.entity.Fz40InoutRecord; +import com.fzzy.async.fzzy40.entity.Fz40InoutRecordItem; import com.fzzy.async.fzzy40.repository.Fzzy40Sync1202Rep; import com.fzzy.async.fzzy40.repository.Fzzy40Sync1203Rep; +import com.fzzy.async.fzzy40.repository.Fzzy40SyncInoutRecordItemRep; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.time.DateUtils; @@ -36,6 +38,8 @@ @Autowired private Fzzy40Sync1202Rep fzzySync1202Rep; + @Autowired + private Fzzy40SyncInoutRecordItemRep fzzy40SyncInoutRecordItemRep; @Autowired private Fzzy40Sync1203Rep fzzySync1203Rep; @Autowired @@ -86,11 +90,25 @@ String zkl; List<Api1203> api1203List; List<Api1202> api1102List; + List<Fz40InoutRecordItem> listInoutRecordItem; + List<String> listIds; for (Fz40InoutRecord sysData : list) { - //鏌ヨ绮鍏ュ簱淇℃伅锛岃嫢涓虹┖鍒欎笉杩涜鍚屾涓婁紶 - api1102List = api1202Rep.getDataByBizId(sysData.getId()); - if(null == api1102List || api1102List.isEmpty()){ - continue; + listIds = new ArrayList<>(); + //鍒ゆ柇鏄惁涓鸿埞杩� + if(StringUtils.isNotEmpty(sysData.getTransType()) && sysData.getTransType().equals("3")){ + listInoutRecordItem = fzzy40SyncInoutRecordItemRep.findDataByRecordId(sysData.getId()); + if(null != listInoutRecordItem && listInoutRecordItem.size() > 0){ + int idNum = Integer.valueOf(sysData.getId().substring(12))*100 + 10001; + + for (Fz40InoutRecordItem fz40InoutRecordItem : listInoutRecordItem) { + listIds.add(Constant.INOUT_TYPE_14 + sysData.getId().substring(4,10) + String.valueOf(idNum).substring(1)); + idNum ++; + } + }else { + listIds.add(Constant.INOUT_TYPE_14 + sysData.getId().substring(4)); + } + }else { + listIds.add(Constant.INOUT_TYPE_14 + sysData.getId().substring(4)); } //鑾峰彇鍏ュ簱璐ㄦ淇℃伅 @@ -100,91 +118,98 @@ continue; } - apiData = new Api1203(); - - apiData.setRkjydh(api1102List.get(0).getRkywdh()); - //璐т綅浠g爜 - apiData.setHwdm(api1102List.get(0).getHwdm()); - apiData.setRkywdh(api1102List.get(0).getRkywdh()); - if(null == sysData.getFullWeightTime()){ - sysData.setFullWeightTime(DateUtils.addMinutes(sysData.getRegisterTime(), 5)); - } - - //鍒ゆ柇涓氬姟鏃堕棿涓庡崟鎹彿鏄惁鍖归厤锛岃嫢涓嶅尮閰嶏紝鍒欐洿鏀逛笟鍔℃椂闂翠负鍗曟嵁鍙锋墍鍦ㄧ殑鏃堕棿 - SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd"); - Date time = dateFormat.parse(apiData.getRkjydh().substring(2, 8)); - int numDay = DateUtil.difDay(DateUtil.getCurZero(sysData.getRegisterTime()), DateUtil.getCurZero(time)); - if(numDay != 0){ - sysData.setRegisterTime(DateUtils.addDays(sysData.getRegisterTime(), numDay)); - } - - apiData.setQysj(sysData.getRegisterTime()); - apiData.setQyrxm(sysData.getCheckUser()); - //鎵︽牱鏂瑰紡 2-鏅鸿兘闅忔満 - apiData.setQyfs("2"); - - //妫�娴嬮」锛屾娴嬪�硷紝澧炴墸浠峰強澧炴墸閲� - jyxm = ""; - jyz = ""; - zkj = ""; - zkl = ""; - for (Fz40CheckItem fz40CheckItem : fz40CheckItems) { - gbCheckList = gbCheckItemRep.findByBizCode(fz40CheckItem.getStandardId()); - - if (gbCheckList == null || gbCheckList.isEmpty()) { + for (String listId : listIds) { + //鏌ヨ绮鍏ュ簱淇℃伅锛岃嫢涓虹┖鍒欎笉杩涜鍚屾涓婁紶 + api1102List = api1202Rep.getDataById(listId); + if(null == api1102List || api1102List.isEmpty()){ continue; } - if (StringUtils.isEmpty(fz40CheckItem.getValue())) { - continue; + + apiData = new Api1203(); + + apiData.setRkjydh(api1102List.get(0).getRkywdh()); + //璐т綅浠g爜 + apiData.setHwdm(api1102List.get(0).getHwdm()); + apiData.setRkywdh(api1102List.get(0).getRkywdh()); + if(null == sysData.getFullWeightTime()){ + sysData.setFullWeightTime(DateUtils.addMinutes(sysData.getRegisterTime(), 5)); } - jyxm += gbCheckList.get(0).getCode() + ","; - jyz += fz40CheckItem.getValue() + ","; - zkj += ",0.0"; - zkl += ",0.0"; + + //鍒ゆ柇涓氬姟鏃堕棿涓庡崟鎹彿鏄惁鍖归厤锛岃嫢涓嶅尮閰嶏紝鍒欐洿鏀逛笟鍔℃椂闂翠负鍗曟嵁鍙锋墍鍦ㄧ殑鏃堕棿 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd"); + Date time = dateFormat.parse(apiData.getRkjydh().substring(2, 8)); + int numDay = DateUtil.difDay(DateUtil.getCurZero(sysData.getRegisterTime()), DateUtil.getCurZero(time)); + if(numDay != 0){ + sysData.setRegisterTime(DateUtils.addDays(sysData.getRegisterTime(), numDay)); + } + + apiData.setQysj(sysData.getRegisterTime()); + apiData.setQyrxm(sysData.getCheckUser()); + //鎵︽牱鏂瑰紡 2-鏅鸿兘闅忔満 + apiData.setQyfs("2"); + + //妫�娴嬮」锛屾娴嬪�硷紝澧炴墸浠峰強澧炴墸閲� + jyxm = ""; + jyz = ""; + zkj = ""; + zkl = ""; + for (Fz40CheckItem fz40CheckItem : fz40CheckItems) { + gbCheckList = gbCheckItemRep.findByBizCode(fz40CheckItem.getStandardId()); + + if (gbCheckList == null || gbCheckList.isEmpty()) { + continue; + } + if (StringUtils.isEmpty(fz40CheckItem.getValue())) { + continue; + } + jyxm += gbCheckList.get(0).getCode() + ","; + jyz += fz40CheckItem.getValue() + ","; + zkj += ",0.0"; + zkl += ",0.0"; + } + + apiData.setJyxm(jyxm); + apiData.setJyz(jyz); + apiData.setZkj(StringUtils.isEmpty(zkj)?"":zkj.substring(1)); + apiData.setZkl(StringUtils.isEmpty(zkl)?"":zkl.substring(1)); + if("UNPASS".equals(sysData.getCheckStatus())){ + apiData.setJyjg("0"); + } + if("PASS".equals(sysData.getCheckStatus())){ + apiData.setJyjg("1"); + } + apiData.setJyrxm(sysData.getCheckUser()); + apiData.setJysj(DateUtils.addMinutes(sysData.getRegisterTime(), 30)); + + //绮鍝佺 + String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety().substring(0,3)); + apiData.setLspzdm(mappingCode); + + //淇濈鍛樺鏍� + apiData.setBgyfh(apiData.getJyjg()); + + //绮绛夌骇 + mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSDJ, sysData.getFoodLevel()); + apiData.setLsdd(mappingCode); + + //鎿嶄綔鏍囧織鍙婃渶鍚庢洿鏂版椂闂� + apiData.setZhgxsj(sysData.getCompleteTime()); + + //涓氬姟id銆佸簱鍖虹紪鐮併�佸悓姝ユ椂闂� + apiData.setBizId(sysData.getId()); + apiData.setKqdm(kqdm); + apiData.setSyncTime(new Date()); + + api1203List = api1203Rep.getDataById(apiData.getRkjydh()); + if(null == api1203List || api1203List.isEmpty()){ + apiData.setCzbz(Constant.CZBZ_I); + }else { + apiData.setCzbz(api1203List.get(0).getCzbz()); + } + + api1203Rep.save(apiData); + log.info("1203---鍚屾鏁版嵁锛歿}", apiData.toString()); } - - apiData.setJyxm(jyxm); - apiData.setJyz(jyz); - apiData.setZkj(zkj.substring(1)); - apiData.setZkl(zkl.substring(1)); - if("UNPASS".equals(sysData.getCheckStatus())){ - apiData.setJyjg("0"); - } - if("PASS".equals(sysData.getCheckStatus())){ - apiData.setJyjg("1"); - } - apiData.setJyrxm(sysData.getCheckUser()); - apiData.setJysj(DateUtils.addMinutes(sysData.getRegisterTime(), 30)); - - //绮鍝佺 - String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety()); - apiData.setLspzdm(mappingCode); - - //淇濈鍛樺鏍� - apiData.setBgyfh(apiData.getJyjg()); - - //绮绛夌骇 - mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSDJ, sysData.getFoodLevel()); - apiData.setLsdd(mappingCode); - - //鎿嶄綔鏍囧織鍙婃渶鍚庢洿鏂版椂闂� - apiData.setZhgxsj(sysData.getCompleteTime()); - - //涓氬姟id銆佸簱鍖虹紪鐮併�佸悓姝ユ椂闂� - apiData.setBizId(sysData.getId()); - apiData.setKqdm(kqdm); - apiData.setSyncTime(new Date()); - - api1203List = api1203Rep.getDataById(apiData.getRkjydh()); - if(null == api1203List || api1203List.isEmpty()){ - apiData.setCzbz(Constant.CZBZ_I); - }else { - apiData.setCzbz(api1203List.get(0).getCzbz()); - } - - //淇濆瓨鏁版嵁 - api1203Rep.save(apiData); - log.info("1203---鍚屾鏁版嵁锛歿}", apiData.toString()); } } catch (Exception e) { log.error("---鍚屾澶辫触----{}", e); diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java index 2eae7fc..bcfea4f 100644 --- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java @@ -12,7 +12,9 @@ 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.entity.Fz40InoutRecordItem; import com.fzzy.async.fzzy40.repository.Fzzy40Sync1202Rep; +import com.fzzy.async.fzzy40.repository.Fzzy40SyncInoutRecordItemRep; import com.fzzy.async.fzzy40.repository.Fzzy40SyncNoticeOutRep; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; @@ -37,6 +39,8 @@ private final static String INOUT_TYPE_OUT = "OUT"; @Autowired private Fzzy40Sync1202Rep fzzySync1202Rep; + @Autowired + private Fzzy40SyncInoutRecordItemRep fzzy40SyncInoutRecordItemRep; @Autowired private Fzzy40SyncNoticeOutRep fzzySyncNoticeOutRep; @Autowired @@ -80,7 +84,11 @@ Api1105 api1105; List<Fz40InoutNoticeOut> listInoutNotice; List<Api1205> api1205List; + List<Fz40InoutRecordItem> listInoutRecordItem; for (Fz40InoutRecord sysData : list) { + if(sysData.getRecordStatus().equals("DEL") || sysData.getRecordStatus().equals("ERROR")){ + continue; + } if(null == sysData.getRecordWeight() || sysData.getRecordWeight() == 0){ sysData.setRecordWeight(sysData.getSettleWeight()); } @@ -95,15 +103,6 @@ } apiData = new Api1205(); apiData.setCkywdh(Constant.INOUT_TYPE_15 + sysData.getId().substring(4)); - //鍒ゆ柇涓氬姟鏃堕棿涓庡崟鎹彿鏄惁鍖归厤锛岃嫢涓嶅尮閰嶏紝鍒欐洿鏀逛笟鍔℃椂闂翠负鍗曟嵁鍙锋墍鍦ㄧ殑鏃堕棿 - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); - Date time = dateFormat.parse(sysData.getId().substring(2, 10)); - int numDay = DateUtil.difDay(DateUtil.getCurZero(sysData.getCompleteTime()), DateUtil.getCurZero(time)); - if(numDay != 0){ - sysData.setFullWeightTime(DateUtils.addDays(sysData.getFullWeightTime(), numDay)); - sysData.setEmptyWeightTime(DateUtils.addDays(sysData.getEmptyWeightTime(), numDay)); - sysData.setCompleteTime(DateUtils.addDays(sysData.getCompleteTime(), numDay)); - } //璐т綅浠g爜 apiData.setHwdm(api1105.getHwdm()); @@ -112,16 +111,19 @@ //閫氱煡鍗曞彿 apiData.setCktzdh(sysData.getNoticeId()); - apiData.setYwrq(sysData.getRegisterTime()); + apiData.setYwrq(DateUtils.parseDate(sysData.getId().substring(2, 10), new String[] { "yyyyMMdd" })); //鑾峰彇鍚堝悓鍙� + apiData.setHth(api1105.getHwdm().substring(0,18) + apiData.getCkywdh()); 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()); + if(StringUtils.isNotEmpty(listInoutNotice.get(0).getContractId())){ + apiData.setHth(api1105.getHwdm().substring(0,18) + listInoutNotice.get(0).getContractId()); + } + if(StringUtils.isNotEmpty(listInoutNotice.get(0).getPlanId())){ + apiData.setJhmxh(listInoutNotice.get(0).getPlanId()); + } } - //杩愯緭宸ュ叿锛岃嫢涓虹┖锛屽垯榛樿缁�1-姹借溅 apiData.setYsgj(StringUtils.isEmpty(sysData.getTransType()) ? "1":sysData.getTransType()); @@ -131,7 +133,7 @@ apiData.setDjsj(sysData.getRegisterTime()); //绮鍝佺 - String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety()); + String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety().substring(0,3)); apiData.setLspzdm(mappingCode); //绮绛夌骇 @@ -188,8 +190,27 @@ }else { apiData.setCzbz(api1205List.get(0).getCzbz()); } - //淇濆瓨鏁版嵁 - api1205Rep.save(apiData); + //鍒ゆ柇鏄惁涓鸿埞杩� + if(StringUtils.isNotEmpty(sysData.getTransType()) && sysData.getTransType().equals("3")){ + listInoutRecordItem = fzzy40SyncInoutRecordItemRep.findDataByRecordId(sysData.getId()); + if(null == listInoutRecordItem || listInoutRecordItem.isEmpty()){ + api1205Rep.save(apiData); + continue; + } + + int idNum = Integer.valueOf(sysData.getId().substring(12))*100 + 10001; + for (Fz40InoutRecordItem fz40InoutRecordItem : listInoutRecordItem) { + apiData.setCkywdh(Constant.INOUT_TYPE_15 + sysData.getId().substring(4,10) + String.valueOf(idNum).substring(1)); + apiData.setMz(fz40InoutRecordItem.getFullWeight()); + apiData.setPz(fz40InoutRecordItem.getEmptyWeight()); + apiData.setJz(fz40InoutRecordItem.getSettleWeight()); + api1205Rep.save(apiData); + idNum ++; + } + }else { + //淇濆瓨鏁版嵁 + api1205Rep.save(apiData); + } } } catch (Exception e) { log.error("---鍚屾澶辫触----{}", e); diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1208.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1208.java index e07fc33..43e2902 100644 --- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1208.java +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1208.java @@ -87,7 +87,7 @@ apiData.setHwdm(api1105.getHwdm()); //绮鍝佺 - String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, fz40DepotStore.getFoodVariety()); + String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, fz40DepotStore.getFoodVariety().substring(0,3)); apiData.setLspzdm(mappingCode); //绮鎬ц川 diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1212.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1212.java index e7a1b77..6870cf9 100644 --- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1212.java +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1212.java @@ -87,9 +87,7 @@ if(StringUtils.isNotEmpty(sysData.getCardId())){ apiData.setLxrsfzh(sysData.getCardId()); } - if(StringUtils.isNotEmpty(sysData.getYzbm())){ - apiData.setYzbm(sysData.getYzbm()); - } + apiData.setYzbm(StringUtils.isEmpty(sysData.getYzbm()) ? "000000" :sysData.getYzbm()); apiData.setDzyx(StringUtils.isEmpty(sysData.getDzyx()) ? "" :sysData.getDzyx()); apiData.setKhfkhh(StringUtils.isEmpty(sysData.getBank()) ? "999" :sysData.getBank()); apiData.setKhfzh(StringUtils.isEmpty(sysData.getBankNum()) ? "" :sysData.getBankNum()); diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1311.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1311.java index 1d86dd8..27cd515 100644 --- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1311.java +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1311.java @@ -13,6 +13,7 @@ import com.fzzy.push.sh2023.SH2023Constant; import com.fzzy.push.sh2023.dto.SH2023Api1311; 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; @@ -74,12 +75,14 @@ sh2023Api1311.setJkcs("9"); } sh2023Api1311.setJkxlh(sysData.getSn()); - if (sysData.getAzwzlx().equals("08")) { - sh2023Api1311.setSpjklx("1"); - } else if (secType.indexOf(sysData.getAzwzlx()) >= 0) { - sh2023Api1311.setSpjklx("2"); - } else { - sh2023Api1311.setSpjklx("3"); + if(StringUtils.isNotEmpty(sysData.getAzwzlx())){ + if (sysData.getAzwzlx().equals("08")) { + sh2023Api1311.setSpjklx("1"); + } else if (secType.indexOf(sysData.getAzwzlx()) >= 0) { + sh2023Api1311.setSpjklx("2"); + } else { + sh2023Api1311.setSpjklx("3"); + } } sh2023Api1311.setSblxbm("1"); sh2023Api1311.setAzwzlx(sysData.getAzwzlx()); diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2103.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2103.java index 4afc291..4fdfc0f 100644 --- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2103.java +++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2103.java @@ -2,13 +2,11 @@ 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.entity.*; 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.ApiConfsRep; import com.fzzy.api.view.repository.ApiInfoDataRep; import com.fzzy.api.view.repository.ApiLogRep; import com.fzzy.async.fzzy40.entity.Fz40Depot; @@ -45,9 +43,9 @@ @Autowired private ApiCommonService commonService; @Autowired - private Api1102Rep api1102Rep; - @Autowired private ApiLogRep apiLogRep; + @Autowired + private ApiConfsRep apiConfsRep; @Autowired private ApiInfoDataRep apiInfoDataRep; @@ -72,17 +70,17 @@ apiLog.setStatus(99); apiLog.setId(ContextUtil.getUUID()); try { + //鐢变簬depotConf琛ㄤ腑娌℃湁搴撳尯缂栫爜锛屽厛鏌ヨ浠撳簱琛� List<Fz40Depot> list = fzzy40SyncDepotRep.listDepotList(deptId); if (null == list || list.isEmpty()) { log.info("2103---绮儏璁惧閰嶇疆鍚屾鏁版嵁锛氭病鏈夋煡璇㈠埌浠撳簱淇℃伅"); return; } - - List<Api1102> api1102List = api1102Rep.findPushData(kqdm); + List<ApiConfs> apiConf = apiConfsRep.getDataByKqdm(kqdm); String bjw = ""; - if (null != api1102List && api1102List.size() > 0) { - bjw = ShAreaBjw.getBjw(api1102List.get(0).getXzqhdm()); + if (null != apiConf && apiConf.size() > 0) { + bjw = apiConf.get(0).getUserName(); } SH2023Api2103 sh2023Api2103; @@ -116,10 +114,11 @@ // 1-3-5 // 8-8-8 //绛掍粨瑙勫垯 + sh2023Api2103.setDlqs("0"); if (StringUtils.isNotEmpty(depotConf.getCableCir())) { sh2023Api2103.setDlqs(String.valueOf(strs.length)); - sh2023Api2103.setDlhs(null); - sh2023Api2103.setDlls(null); + sh2023Api2103.setDlhs("0"); + sh2023Api2103.setDlls("0"); //鐢电紗鍦堟帓鍒楄鎯� listItem = new ArrayList<>(); @@ -176,8 +175,10 @@ apiInfoDataList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2103, infoData.getDataId(),kqdm); if (null == apiInfoDataList || apiInfoDataList.isEmpty()) { infoData.setCzbz(Constant.CZBZ_I); + sh2023Api2103.setCzbz(Constant.CZBZ_I); } else { infoData.setCzbz(apiInfoDataList.get(0).getCzbz()); + sh2023Api2103.setCzbz(apiInfoDataList.get(0).getCzbz()); } infoData.setData(JSON.toJSONString(sh2023Api2103)); diff --git a/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1310Rep.java b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1310Rep.java index b18067c..4533f23 100644 --- a/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1310Rep.java +++ b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1310Rep.java @@ -11,7 +11,7 @@ /** * 鏌ヨ璐ㄦ鏁版嵁 * - * @author chen + * @author czt * @date 2023-05-14 19:55 */ public interface Fzzy40Sync1310Rep extends JpaRepository<Fz40Quality, String> { @@ -22,6 +22,6 @@ * @param end * @return */ - @Query("from Fz40Quality where time >=:start and time <:end order by time ") + @Query("from Fz40Quality where updateTime >=:start and updateTime <:end order by updateTime ") List<Fz40Quality> findDateByTime(@Param("start") Date start, @Param("end") Date end); } diff --git a/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncInoutRecordItemRep.java b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncInoutRecordItemRep.java new file mode 100644 index 0000000..5b52334 --- /dev/null +++ b/src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40SyncInoutRecordItemRep.java @@ -0,0 +1,25 @@ +package com.fzzy.async.fzzy40.repository; + +import com.fzzy.async.fzzy40.entity.Fz40InoutRecordItem; +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 Fzzy40SyncInoutRecordItemRep extends JpaRepository<Fz40InoutRecordItem, String> { + + /** + * 鏍规嵁浠撳簱缂栫爜鑾峰彇绮儏鍙傛暟閰嶇疆淇℃伅 + * @param recordId + * @return + */ + @Query("from Fz40InoutRecordItem where recordId =:recordId order by createTime ") + List<Fz40InoutRecordItem> findDataByRecordId(@Param("recordId") String recordId); +} diff --git a/src/main/java/com/fzzy/async/sh2021/package-info.java b/src/main/java/com/fzzy/async/sh2021/package-info.java deleted file mode 100644 index 66c393e..0000000 --- a/src/main/java/com/fzzy/async/sh2021/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ - -/** - * @Desc: 鏁版嵁鍚屾 - * - * @author: Andy - * @update-time: 2022/10/9 - */ -package com.fzzy.async.sh2021; \ No newline at end of file diff --git a/src/main/java/com/fzzy/otherview/sh2023/ShApi2103.view.xml b/src/main/java/com/fzzy/otherview/sh2023/ShApi2103.view.xml index 615bd57..a89df46 100644 --- a/src/main/java/com/fzzy/otherview/sh2023/ShApi2103.view.xml +++ b/src/main/java/com/fzzy/otherview/sh2023/ShApi2103.view.xml @@ -125,6 +125,14 @@ <Property name="dataType">Date</Property> <Property name="label">鏈�鍚庢洿鏂版椂闂�</Property> </PropertyDef> + <PropertyDef name="czbz"> + <Property name="label">鎿嶄綔鏍囧織</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("apiTriggerService#trigger").getResult("CZBZ")}</Property> + <Property name="keyProperty">code</Property> + <Property name="valueProperty">name</Property> + </Property> + </PropertyDef> <Reference name="sh2023Api2103Items"> <Property name="dataType">[dtItem]</Property> <Property name="dataProvider">sHApi2103PR#itemList</Property> @@ -361,6 +369,10 @@ <Property name="property">bjw</Property> <Property name="align">center</Property> </DataColumn> + <DataColumn name="czbz"> + <Property name="property">czbz</Property> + <Property name="align">center</Property> + </DataColumn> <DataColumn name="zhgxsj"> <Property name="property">zhgxsj</Property> <Property name="align">center</Property> @@ -416,6 +428,21 @@ <Editor/> </AutoFormElement> <AutoFormElement> + <Property name="name">bjw</Property> + <Property name="property">bjw</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">czbz</Property> + <Property name="property">czbz</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">dlcs</Property> + <Property name="property">dlcs</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> <Property name="name">dlhs</Property> <Property name="property">dlhs</Property> <Editor/> @@ -426,23 +453,8 @@ <Editor/> </AutoFormElement> <AutoFormElement> - <Property name="name">dlcs</Property> - <Property name="property">dlcs</Property> - <Editor/> - </AutoFormElement> - <AutoFormElement> - <Property name="name">dlqs</Property> - <Property name="property">dlqs</Property> - <Editor/> - </AutoFormElement> - <AutoFormElement> <Property name="name">scqd</Property> <Property name="property">scqd</Property> - <Editor/> - </AutoFormElement> - <AutoFormElement> - <Property name="name">sczd</Property> - <Property name="property">sczd</Property> <Editor/> </AutoFormElement> <AutoFormElement> @@ -451,18 +463,28 @@ <Editor/> </AutoFormElement> <AutoFormElement> - <Property name="name">zczd</Property> - <Property name="property">zczd</Property> - <Editor/> - </AutoFormElement> - <AutoFormElement> <Property name="name">xcqd</Property> <Property name="property">xcqd</Property> <Editor/> </AutoFormElement> <AutoFormElement> + <Property name="name">sczd</Property> + <Property name="property">sczd</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">zczd</Property> + <Property name="property">zczd</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> <Property name="name">xczd</Property> <Property name="property">xczd</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">dlqs</Property> + <Property name="property">dlqs</Property> <Editor/> </AutoFormElement> <AutoFormElement> @@ -475,11 +497,7 @@ <Property name="property">yxfwjsc</Property> <Editor/> </AutoFormElement> - <AutoFormElement> - <Property name="name">bjw</Property> - <Property name="property">bjw</Property> - <Editor/> - </AutoFormElement> + <AutoFormElement> <Property name="name">zhgxsj</Property> <Property name="property">zhgxsj</Property> diff --git a/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java b/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java index ccb10da..5b6c37e 100644 --- a/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java +++ b/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java @@ -158,7 +158,7 @@ @Expose public String pushData(List<SH2023Api2103> items) { - ResponseDto responseDto; + String result = ""; String kqdm = items.get(0).getHwdm().substring(0, 21); @@ -169,7 +169,7 @@ } //灏佽鍙傛暟 - ApiParam param = new ApiParam(apiConf, "21", SH2023Constant.SH_2023_API_CODE_2103); + ApiParam param = new ApiParam(apiConf, Constant.API_CATEGORY_13, SH2023Constant.SH_2023_API_CODE_2103); //鑾峰彇瀹炵幇鎺ュ彛 ApiRemoteService apiService = apiPushManager.getApiRemoteService(param.getPushProtocol()); @@ -177,14 +177,11 @@ return "绯荤粺娌℃湁褰撳墠鎺ㄩ�佸崗璁厤缃紝鎵ц澶辫触"; } - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - responseDto = apiService.pushData(param, apiConf, items); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - - ApiInfoData infoData; - for (SH2023Api2103 data : items) { - + ResponseDto responseDto; + ApiInfoData infoData; + for (SH2023Api2103 data : items) { + responseDto = apiService.pushData(param, apiConf, data); + if (responseDto.getSuccess() == 0) { infoData = new ApiInfoData(); infoData.setId(data.getHwdm()); infoData.setKqdm(data.getHwdm().substring(0, 21)); @@ -195,13 +192,10 @@ infoData.setCzbz(Constant.CZBZ_U); infoData.setData(JSON.toJSONString(data)); - apiInfoDataRep.save(infoData); - } result += responseDto.toString(); } return result; } - } diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java index 8e3f491..2961e6b 100644 --- a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java +++ b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java @@ -621,27 +621,40 @@ return api1404; } if (SH2023Constant.SH_2023_API_CODE_2101.equals(inteId)) { + //璁剧疆绌哄睘鎬т负榛樿鍊� + changeObject(data); return data; } if (SH2023Constant.SH_2023_API_CODE_2102.equals(inteId)) { + //璁剧疆绌哄睘鎬т负榛樿鍊� + changeObject(data); return data; } if (SH2023Constant.SH_2023_API_CODE_2103.equals(inteId)) { - SH2023Api2103 api2103 = new SH2023Api2103(); - BeanUtils.copyProperties(data, api2103); - List<SH2023Api2103Item> listItems = castList(api2103.getDlqplxq(), SH2023Api2103Item.class); - api2103.setSh2023Api2103Items(listItems); - return api2103; + SH2023Api2103 apiData = new SH2023Api2103(); + BeanUtils.copyProperties(data, apiData); + //璁剧疆绌哄睘鎬т负榛樿鍊� + changeObject(apiData); + return apiData; } if (SH2023Constant.SH_2023_API_CODE_2104.equals(inteId)) { + //璁剧疆绌哄睘鎬т负榛樿鍊� + changeObject(data); return data; } if (SH2023Constant.SH_2023_API_CODE_2203.equals(inteId)) { + + //璁剧疆绌哄睘鎬т负榛樿鍊� + changeObject(data); return data; } if (SH2023Constant.SH_2023_API_CODE_2204.equals(inteId)) { + //璁剧疆绌哄睘鎬т负榛樿鍊� + changeObject(data); return data; } + //璁剧疆绌哄睘鎬т负榛樿鍊� + changeObject(data); return data; } diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java b/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java index 159c517..2ada2b2 100644 --- a/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java +++ b/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java @@ -440,26 +440,26 @@ */ public void pushData2101(ApiRemoteService apiRemoteService, ApiParam param) { //鑾峰彇 妫�鏂ゅ崟淇℃伅 - List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2101); - - param.setInteCategory(Constant.API_CATEGORY_12); - param.setInteId(SH2023Constant.SH_2023_API_CODE_2101); - - ResponseDto responseDto; - SH2023Api2101 shApi2101; - for (ApiInfoData infoData : items) { - shApi2101 = JSONObject.parseObject(infoData.getData(), SH2023Api2101.class); - shApi2101.setCzbz(infoData.getCzbz()); - shApi2101.setZhgxsj(infoData.getUpdateTime()); - param.setBizId(infoData.getDataId()); - responseDto = apiRemoteService.pushData(param, shApi2101); - if (responseDto.getSuccess() == 0) { - if (Constant.CZBZ_I.equals(infoData.getCzbz())) { - infoData.setCzbz(Constant.CZBZ_U); - apiInfoDataRep.save(infoData); - } - } - } +// List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2101); +// +// param.setInteCategory(Constant.API_CATEGORY_12); +// param.setInteId(SH2023Constant.SH_2023_API_CODE_2101); +// +// ResponseDto responseDto; +// SH2023Api2101 shApi2101; +// for (ApiInfoData infoData : items) { +// shApi2101 = JSONObject.parseObject(infoData.getData(), SH2023Api2101.class); +// shApi2101.setCzbz(infoData.getCzbz()); +// shApi2101.setZhgxsj(infoData.getUpdateTime()); +// param.setBizId(infoData.getDataId()); +// responseDto = apiRemoteService.pushData(param, shApi2101); +// if (responseDto.getSuccess() == 0) { +// if (Constant.CZBZ_I.equals(infoData.getCzbz())) { +// infoData.setCzbz(Constant.CZBZ_U); +// apiInfoDataRep.save(infoData); +// } +// } +// } } /** @@ -475,26 +475,26 @@ */ public void pushData2104(ApiRemoteService apiRemoteService, ApiParam param) { //鑾峰彇 妫�鏂ゅ崟淇℃伅 - List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2104); +// List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2104); - param.setInteCategory(Constant.API_CATEGORY_12); - param.setInteId(SH2023Constant.SH_2023_API_CODE_2104); - - ResponseDto responseDto; - SH2023Api2104 shApi2104; - for (ApiInfoData infoData : items) { - shApi2104 = JSONObject.parseObject(infoData.getData(), SH2023Api2104.class); - shApi2104.setCzbz(infoData.getCzbz()); - shApi2104.setZhgxsj(infoData.getUpdateTime()); - - param.setBizId(infoData.getDataId()); - responseDto = apiRemoteService.pushData(param, shApi2104); - if (responseDto.getSuccess() == 0) { - if (Constant.CZBZ_I.equals(infoData.getCzbz())) { - infoData.setCzbz(Constant.CZBZ_U); - apiInfoDataRep.save(infoData); - } - } - } +// param.setInteCategory(Constant.API_CATEGORY_12); +// param.setInteId(SH2023Constant.SH_2023_API_CODE_2104); +// +// ResponseDto responseDto; +// SH2023Api2104 shApi2104; +// for (ApiInfoData infoData : items) { +// shApi2104 = JSONObject.parseObject(infoData.getData(), SH2023Api2104.class); +// shApi2104.setCzbz(infoData.getCzbz()); +// shApi2104.setZhgxsj(infoData.getUpdateTime()); +// +// param.setBizId(infoData.getDataId()); +// responseDto = apiRemoteService.pushData(param, shApi2104); +// if (responseDto.getSuccess() == 0) { +// if (Constant.CZBZ_I.equals(infoData.getCzbz())) { +// infoData.setCzbz(Constant.CZBZ_U); +// apiInfoDataRep.save(infoData); +// } +// } +// } } } diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023PushService14.java b/src/main/java/com/fzzy/push/sh2023/SH2023PushService14.java index 03e700a..6f9cb69 100644 --- a/src/main/java/com/fzzy/push/sh2023/SH2023PushService14.java +++ b/src/main/java/com/fzzy/push/sh2023/SH2023PushService14.java @@ -205,27 +205,27 @@ */ public void pushData2203(ApiRemoteService apiRemoteService, ApiParam param) { //鑾峰彇浜ゆ槗涓績鍚堝悓 - List<Api1201> list = api1201Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); - - if (null == list || list.isEmpty()) { - log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌杞崲璁″垝鏄庣粏锛屼笉鎺ㄩ��-----"); - return; - } - param.setInteCategory(Constant.API_CATEGORY_14); - param.setInteId(SH2023Constant.SH_2023_API_CODE_2203); - - ResponseDto responseDto; - for (Api1201 data : list) { - param.setBizId(data.getBizId()); - responseDto = apiRemoteService.pushData(param, data); - if (responseDto.getSuccess() == 0) { - if (Constant.CZBZ_I.equals(data.getCzbz())) { - data.setCzbz(Constant.CZBZ_U); - //鏇存柊鐘舵�� - api1201Rep.save(data); - } - } - } +// List<Api1201> list = api1201Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); +// +// if (null == list || list.isEmpty()) { +// log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌杞崲璁″垝鏄庣粏锛屼笉鎺ㄩ��-----"); +// return; +// } +// param.setInteCategory(Constant.API_CATEGORY_14); +// param.setInteId(SH2023Constant.SH_2023_API_CODE_2203); +// +// ResponseDto responseDto; +// for (Api1201 data : list) { +// param.setBizId(data.getBizId()); +// responseDto = apiRemoteService.pushData(param, data); +// if (responseDto.getSuccess() == 0) { +// if (Constant.CZBZ_I.equals(data.getCzbz())) { +// data.setCzbz(Constant.CZBZ_U); +// //鏇存柊鐘舵�� +// api1201Rep.save(data); +// } +// } +// } } /** @@ -233,27 +233,27 @@ */ public void pushData2204(ApiRemoteService apiRemoteService, ApiParam param) { //鑾峰彇瀹氬寲姘存楠� - List<Api1310> list = api1310Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); - - if (null == list || list.isEmpty()) { - log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌瀹氬寲姘存楠岋紝涓嶆帹閫�-----"); - return; - } - param.setInteCategory(Constant.API_CATEGORY_14); - param.setInteId(SH2023Constant.SH_2023_API_CODE_2204); - - ResponseDto responseDto; - for (Api1310 data : list) { - param.setBizId(data.getBizId()); - responseDto = apiRemoteService.pushData(param, data); - if (responseDto.getSuccess() == 0) { - if (Constant.CZBZ_I.equals(data.getCzbz())) { - - data.setCzbz(Constant.CZBZ_U); - //鏇存柊鐘舵�� - api1310Rep.save(data); - } - } - } +// List<Api1310> list = api1310Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); +// +// if (null == list || list.isEmpty()) { +// log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌瀹氬寲姘存楠岋紝涓嶆帹閫�-----"); +// return; +// } +// param.setInteCategory(Constant.API_CATEGORY_14); +// param.setInteId(SH2023Constant.SH_2023_API_CODE_2204); +// +// ResponseDto responseDto; +// for (Api1310 data : list) { +// param.setBizId(data.getBizId()); +// responseDto = apiRemoteService.pushData(param, data); +// if (responseDto.getSuccess() == 0) { +// if (Constant.CZBZ_I.equals(data.getCzbz())) { +// +// data.setCzbz(Constant.CZBZ_U); +// //鏇存柊鐘舵�� +// api1310Rep.save(data); +// } +// } +// } } } diff --git a/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103.java b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103.java index d5e1f38..868743d 100644 --- a/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103.java +++ b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api2103.java @@ -75,7 +75,7 @@ private Date zhgxsj; @Transient - @JsonIgnore + @JSONField(serialize = false) private List<SH2023Api2103Item> sh2023Api2103Items; } \ No newline at end of file -- Gitblit v1.9.3