| | |
| | | int updateStatus(@Param("id") String id, @Param("data") String data, @Param("czbz") String czbz); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥å£ç¼ç åæ°æ®å
容IDæ¥è¯¢æ°æ® |
| | | * æ ¹æ®åºåºä»£ç ãæ¥å£ç¼ç ãæ°æ®idæ¥è¯¢ |
| | | * |
| | | * @param inteId |
| | | * @return |
| | | */ |
| | | @Query("from ApiInfoData where inteId=:inteId and dataId=:dataId ") |
| | | List<ApiInfoData> getDataByInteAndData(@Param("inteId") String inteId, @Param("dataId") String dataId); |
| | | @Query("from ApiInfoData where inteId=:inteId and dataId=:dataId and kqdm=:kqdm") |
| | | List<ApiInfoData> getDataByInteAndData(@Param("inteId") String inteId, @Param("dataId") String dataId, @Param("kqdm") String kqdm); |
| | | } |
| | |
| | | package com.fzzy.async.fzzy35; |
| | | |
| | | import com.fzzy.api.data.ApiParam; |
| | | import com.fzzy.api.data.PushProtocol; |
| | | import com.fzzy.api.data.SyncProtocol; |
| | | import com.fzzy.api.service.SyncService13; |
| | | import com.fzzy.async.fzzy35.impl.Fzzy35Sync1302; |
| | | import com.fzzy.async.fzzy35.impl.Fzzy35Sync1303; |
| | | import com.fzzy.async.fzzy35.impl.Fzzy35Sync1304; |
| | | import com.fzzy.async.fzzy35.impl.Fzzy35Sync1310; |
| | | import com.fzzy.async.fzzy35.impl.*; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | private Fzzy35Sync1304 fzzySync1304; |
| | | @Autowired |
| | | private Fzzy35Sync1310 fzzySync1310; |
| | | @Autowired |
| | | private Fzzy35Sync1023 fzzySync1023; |
| | | |
| | | |
| | | @Override |
| | |
| | | //è´¨æ£åæ¥ |
| | | fzzySync1310.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd()); |
| | | |
| | | // /*-----åçç¬ææ¥å£ä¿¡æ¯åæ¥-----*/ |
| | | // if (StringUtils.isNotEmpty(param.getPushProtocol()) && PushProtocol.SB_GD_2022.getCode().equals(param.getPushProtocol())) { |
| | | // //广ä¸çå¹³å°2022çï¼éè¦åæ¥çè¸å¤æ¡ä¿¡æ¯ |
| | | // //çè¸å¤æ¡æ°æ®åæ¥ |
| | | // fzzySync1023.syncData(param.getDeptId(), param.getStart(), param.getEnd()); |
| | | // |
| | | // } |
| | | /*-----åçç¬ææ¥å£ä¿¡æ¯åæ¥-----*/ |
| | | if (StringUtils.isNotEmpty(param.getPushProtocol()) && PushProtocol.SB_GD_2022.getCode().equals(param.getPushProtocol())) { |
| | | //广ä¸çå¹³å°2022çï¼éè¦åæ¥çè¸å¤æ¡ä¿¡æ¯ |
| | | //çè¸å¤æ¡æ°æ®åæ¥ |
| | | fzzySync1023.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd()); |
| | | |
| | | } |
| | | // |
| | | // //éé£ä½ä¸ä¿¡æ¯åæ¥ |
| | | // fzzySync1305.syncData(param.getDeptId(), param.getStart(), param.getEnd()); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.async.fzzy35.entity; |
| | | |
| | | import com.bstek.dorado.annotation.PropertyDef; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fzzy.async.fzzy40.entity.Fz40DrugLogDtl; |
| | | import com.fzzy.async.fzzy40.entity.Fz40DrugLogPeople; |
| | | import com.fzzy.async.fzzy40.entity.Fz40DrugLogWay; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.*; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çè¸å¤æ¡ä¸»è¡¨ä¿¡æ¯ |
| | | * |
| | | * @author czt |
| | | */ |
| | | @Entity |
| | | @Data |
| | | @Table(name = "D_DRUG_LOG_APPLY") |
| | | public class Fz35DrugLogApply implements Serializable { |
| | | |
| | | @Id |
| | | @Column(name = "xzbm", length = 4) |
| | | @PropertyDef(label = "çè¸å¤æ¡ç¼å·", description = " yyyyMMdd + 4ä½é¡ºåºå·") |
| | | private String xzbm; |
| | | |
| | | @Column(name = "DEPT_ID_", length = 21) |
| | | @PropertyDef(label = "åºåºä»£ç ") |
| | | private String deptId; |
| | | |
| | | @Column(name = "COMPANY_ID_", length = 10) |
| | | @PropertyDef(label = "ç»ç»ç¼ç ") |
| | | private String companyId; |
| | | |
| | | @Column(name = "tbrq") |
| | | @PropertyDef(label = "å¡«æ¥æ¥æ") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date tbrq; |
| | | |
| | | @Column(name = "dwdm", length = 18) |
| | | @PropertyDef(label = "åä½ä»£ç ", description = "ä¼ä¸ä¿¡ç¨ä»£ç ") |
| | | private String dwdm; |
| | | |
| | | @Column(name = "sqxzrq") |
| | | @PropertyDef(label = "ç³è¯·çè¸æ¥æ") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date sqxzrq; |
| | | |
| | | @Column(name = "fzr", length = 20) |
| | | @PropertyDef(label = "è´è´£äºº") |
| | | private String fzr; |
| | | |
| | | @Column(name = "fzrdh", length = 11) |
| | | @PropertyDef(label = "è´è´£äººçµè¯") |
| | | private String fzrdh; |
| | | |
| | | @Column(name = "xcfzr", length = 20) |
| | | @PropertyDef(label = "ç°åºè´è´£äºº") |
| | | private String xcfzr; |
| | | |
| | | @Column(name = "fzrzw", length = 10) |
| | | @PropertyDef(label = "ç°åºè´è´£äººèå¡") |
| | | private String xcfzrzw; |
| | | |
| | | @Column(name = "xcfzrdh", length = 11) |
| | | @PropertyDef(label = "ç°åºè´è´£äººçµè¯") |
| | | private String xcfzrdh; |
| | | |
| | | @Column(name = "tbr", length = 20) |
| | | @PropertyDef(label = "填表人") |
| | | private String tbr; |
| | | |
| | | @Column(name = "tbrdh", length = 11) |
| | | @PropertyDef(label = "填表人çµè¯") |
| | | private String tbrdh; |
| | | |
| | | @Column(name = "sfszjjxd", length = 2) |
| | | @PropertyDef(label = "æ¯å¦è®¾ç½®è¦æçº¿(ä¸)", description = "æ¯æå¦") |
| | | private String sfszjjxd; |
| | | |
| | | @Column(name = "sfszjjxx", length = 2) |
| | | @PropertyDef(label = "æ¯å¦è®¾ç½®è¦æçº¿(西)", description = "æ¯æå¦") |
| | | private String sfszjjxx; |
| | | |
| | | @Column(name = "sfszjjxn", length = 2) |
| | | @PropertyDef(label = "æ¯å¦è®¾ç½®è¦æçº¿(å)", description = "æ¯æå¦") |
| | | private String sfszjjxn; |
| | | |
| | | @Column(name = "sfszjjxb", length = 2) |
| | | @PropertyDef(label = "æ¯å¦è®¾ç½®è¦æçº¿(å)", description = "æ¯æå¦") |
| | | private String sfszjjxb; |
| | | |
| | | @Column(name = "ssxzzystqybqk", length = 1024) |
| | | @PropertyDef(label = "宿½çè¸ä½ä¸æ¶å¤©æ°é¢æ¥æ
åµ") |
| | | private String ssxzzystqybqk; |
| | | |
| | | @Column(name = "xzssgcap", length = 1024) |
| | | @PropertyDef(label = "çè¸å®æå宿½è¿ç¨") |
| | | private String xzssgcap; |
| | | |
| | | @Column(name = "aqfhjyjcccs", length = 1024) |
| | | @PropertyDef(label = "å®å
¨é²æ¤ååºæ¥å¤ç½®æªæ½") |
| | | private String aqfhjyjcccs; |
| | | |
| | | @Column(name = "xzzysx", length = 1024) |
| | | @PropertyDef(label = "çè¸æ³¨æäºé¡¹") |
| | | private String xzzysx; |
| | | |
| | | @Column(name = "FILE_STORAGE_ID_", length = 19) |
| | | @PropertyDef(label = "æä»¶åå¨ID") |
| | | private String fileStorageId; |
| | | |
| | | @Column(name = "DRUG_NAME_", length = 64) |
| | | @PropertyDef(label = "è¯ååç§°") |
| | | private String drugName; |
| | | |
| | | @Column(name = "DRUG_TYPE_", length = 10) |
| | | @PropertyDef(label = "è¯åç±»å/åå·") |
| | | private String drugType; |
| | | |
| | | @Column(name = "yjyxqz") |
| | | @PropertyDef(label = "è¯åæææè³") |
| | | private Date yjyxqz; |
| | | |
| | | @Column(name = "lqsl", precision = 20, scale = 3) |
| | | @PropertyDef(label = "é¢åæ°é", description = "å
¬æ¤") |
| | | private Double lqsl; |
| | | |
| | | @Column(name = "sysbjfs", length = 20) |
| | | @PropertyDef(label = "æ½è¯è®¾å¤åæ¹å¼") |
| | | private String sysbjfs; |
| | | |
| | | @Column(name = "zcdd", length = 30) |
| | | @PropertyDef(label = "æåå°ç¹") |
| | | private String zcdd; |
| | | |
| | | @Column(name = "lqr", length = 20) |
| | | @PropertyDef(label = "é¢å人") |
| | | private String lqr; |
| | | |
| | | @Column(name = "lqsj") |
| | | @PropertyDef(label = "é¢åæ¶é´") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date lqsj; |
| | | |
| | | @Column(name = "UPDATE_TIME_") |
| | | @PropertyDef(label = "æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * å¨ç²®ç²®æ
æç»è¡¨ |
| | | */ |
| | | @Transient |
| | | private List<Fz40DrugLogDtl> drugLogDtls; |
| | | |
| | | /** |
| | | * çè¸å¤æ¡æ¹å¼ |
| | | */ |
| | | @Transient |
| | | private List<Fz40DrugLogWay> drugLogWays; |
| | | |
| | | /** |
| | | * çè¸ä½ä¸äººå |
| | | */ |
| | | @Transient |
| | | private List<Fz40DrugLogPeople> drugLogPeople; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.async.fzzy35.entity; |
| | | |
| | | import com.alibaba.fastjson.annotation.JSONField; |
| | | import com.bstek.dorado.annotation.PropertyDef; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 宿½çè¸ä½ä¸çå¨ç²®ç²®æ
æç»è¡¨ |
| | | * |
| | | * @Author:YAN |
| | | */ |
| | | @Entity |
| | | @Data |
| | | @Table(name = "D_DRUG_LOG_DTL") |
| | | public class Fz35DrugLogDtl implements Serializable { |
| | | |
| | | @Id |
| | | @Column(name = "DTL_ID_", length = 40) |
| | | @PropertyDef(label = "dtlId") |
| | | private String dtlId; |
| | | |
| | | @Column(name = "ID_", length = 40) |
| | | @PropertyDef(label = "id") |
| | | @JSONField |
| | | private String id; |
| | | |
| | | @Column(name = "DRUG_LOG_ID_", length = 4) |
| | | @PropertyDef(label = "çè¸å¤æ¡ç¼å·", description = "4ä½é¡ºåºå·") |
| | | @JSONField |
| | | private String drugLogId; |
| | | |
| | | @Column(name = "DEPT_ID_", length = 21) |
| | | @PropertyDef(label = "åºåºä»£ç ") |
| | | @JSONField |
| | | private String deptId; |
| | | |
| | | @Column(name = "tbrq") |
| | | @PropertyDef(label = "å¡«æ¥æ¥æ") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date tbrq; |
| | | |
| | | @Column(name = "DEPOT_ID_", length = 50) |
| | | @PropertyDef(label = "仿¿/æ²¹ç½ä»£ç ") |
| | | private String depotId; |
| | | |
| | | @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_LEVEL_", length = 10) |
| | | @PropertyDef(label = "ç²®é£ç级") |
| | | private String foodLevel; |
| | | |
| | | @Column(name = "NUMBER_", precision = 20, scale = 3) |
| | | @PropertyDef(label = "ç²®é£æ°é", description = "åä½ï¼å¨") |
| | | private Double number = 0.0; |
| | | |
| | | @Column(name = "PER_WET_", precision = 20, scale = 3) |
| | | @PropertyDef(label = "æ°´å", description = "åä½ï¼%") |
| | | private Double perWet; |
| | | |
| | | @Column(name = "PER_IMPURITY_", precision = 20, scale = 3) |
| | | @PropertyDef(label = "æè´¨", description = "åä½ï¼%") |
| | | private Double perImpurity; |
| | | |
| | | @Column(name = "lw", precision = 20, scale = 3) |
| | | @PropertyDef(label = "粮温") |
| | | private Double lw; |
| | | |
| | | @Column(name = "cw", precision = 20, scale = 3) |
| | | @PropertyDef(label = "仿¸©") |
| | | private Double cw; |
| | | |
| | | @Column(name = "cnsd", precision = 20, scale = 3) |
| | | @PropertyDef(label = "ä»å
湿度") |
| | | private Double cnsd; |
| | | |
| | | @Column(name = "clfs", length = 1) |
| | | @PropertyDef(label = "åç²®æ¹å¼", description = "1ï¼æ£è£
å¨ç²®;2ï¼å
è£
;3ï¼å´å
æ£å;9ï¼å
¶ä»") |
| | | private String clfs; |
| | | |
| | | @Column(name = "rkrq") |
| | | @PropertyDef(label = "å
¥åºæ¥æ") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date rkrq; |
| | | |
| | | @Column(name = "hc", length = 30) |
| | | @PropertyDef(label = "害è«") |
| | | private String hc; |
| | | |
| | | @Column(name = "cldjpd", length = 3) |
| | | @PropertyDef(label = "è«ç²®ç级å¤å®") |
| | | private String cldjpd; |
| | | |
| | | @Column(name = "ldtj", precision = 20, scale = 3) |
| | | @PropertyDef(label = "ç²®å ä½ç§¯", description = "m³") |
| | | private Double ldtj; |
| | | |
| | | @Column(name = "kjtj", precision = 20, scale = 3) |
| | | @PropertyDef(label = "空é´ä½ç§¯", description = "m³") |
| | | private Double kjtj; |
| | | |
| | | @Column(name = "lddwyyl", precision = 20, scale = 3) |
| | | @PropertyDef(label = "ç²®å åä½ç¨è¯é") |
| | | private Double lddwyyl; |
| | | |
| | | @Column(name = "kjdwyyl", precision = 20, scale = 3) |
| | | @PropertyDef(label = "空é´åä½ç¨è¯é") |
| | | private Double kjdwyyl; |
| | | |
| | | @Column(name = "zyyl", precision = 20, scale = 3) |
| | | @PropertyDef(label = "æ»ç¨è¯é") |
| | | private Double zyyl; |
| | | /** |
| | | * 仿¿æ°å¯æ§ä»¥ 500 Pa çåååè¡° æ t å为å个ç级ã |
| | | * 1ï¼ â
级ï¼tâ¥300sã |
| | | * 2ï¼ â
¡çº§ï¼120sâ¤t<300sã |
| | | * 3ï¼â
¢çº§ï¼40sâ¤t<120s (å¹³æ¿ä») ï¼ 60s⤠t<120s (ç«çä»ãæµ
åä») ã 4ï¼â
£çº§ï¼t<40s (å¹³æ¿ä») ï¼t<60s (ç«çä»ãæµ
åä») ã |
| | | */ |
| | | @Column(name = "qmx", length = 1) |
| | | @PropertyDef(label = "æ°å¯æ§") |
| | | private String qmx; |
| | | |
| | | @Column(name = "jhxzksrq") |
| | | @PropertyDef(label = "计åçè¸å¼å§æ¥æ") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date jhxzksrq; |
| | | |
| | | @Column(name = "jhxzjsrq") |
| | | @PropertyDef(label = "计åçè¸ç»ææ¥æ") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date jhxzjsrq; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.async.fzzy35.entity; |
| | | |
| | | import com.bstek.dorado.annotation.PropertyDef; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * çè¸ä½ä¸äººåä¿¡æ¯è¡¨ |
| | | * |
| | | * @Author:YAN |
| | | */ |
| | | @Data |
| | | @Entity |
| | | @Table(name = "D_DRUG_LOG_PEOPLE") |
| | | public class Fz35DrugLogPeople implements Serializable { |
| | | |
| | | @Id |
| | | @Column(name = "PEOPLE_ID_", length = 40) |
| | | @PropertyDef(label = "propleId") |
| | | private String propleId; |
| | | |
| | | @Column(name = "ID_", length = 40) |
| | | @PropertyDef(label = "id") |
| | | private String id; |
| | | |
| | | @Column(name = "DRUG_LOG_ID_", length = 4) |
| | | @PropertyDef(label = "çè¸å¤æ¡ç¼å·", description = "4ä½é¡ºåºå·") |
| | | private String drugLogId; |
| | | |
| | | @Column(name = "DEPT_ID_", length = 21) |
| | | @PropertyDef(label = "åºåºä»£ç ") |
| | | private String deptId; |
| | | |
| | | @Column(name = "tbrq") |
| | | @PropertyDef(label = "å¡«æ¥æ¥æ") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date tbrq; |
| | | |
| | | @Column(name = "mx", length = 20) |
| | | @PropertyDef(label = "å§å") |
| | | private String mx; |
| | | |
| | | @Column(name = "zw", length = 10) |
| | | @PropertyDef(label = "èå¡") |
| | | private String zw; |
| | | |
| | | @Column(name = "zyzg", length = 6) |
| | | @PropertyDef(label = "èä¸èµæ ¼", description = "å级/ä¸çº§/é«çº§") |
| | | private String zyzg; |
| | | |
| | | @Column(name = "stzk", length = 10) |
| | | @PropertyDef(label = "身ä½ç¶åµ") |
| | | private String stzk; |
| | | |
| | | @Column(name = "xzrwfg", length = 30) |
| | | @PropertyDef(label = "çè¸ä»»å¡åå·¥") |
| | | private String xzrwfg; |
| | | |
| | | @Column(name = "sfwb", length = 2) |
| | | @PropertyDef(label = "æ¯å¦å¤å
", description = "æ¯/å¦") |
| | | private String sfwb; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.async.fzzy35.entity; |
| | | |
| | | import com.alibaba.fastjson.annotation.JSONField; |
| | | import com.bstek.dorado.annotation.PropertyDef; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * çè¸å¤æ¡æ¹å¼è¡¨ |
| | | * |
| | | * @Author:YAN |
| | | */ |
| | | @Data |
| | | @Entity |
| | | @Table(name = "D_DRUG_LOG_WAY") |
| | | public class Fz35DrugLogWay implements Serializable { |
| | | |
| | | @Id |
| | | @Column(name = "WAY_ID_", length = 40) |
| | | @PropertyDef(label = "wayId") |
| | | private String wayId; |
| | | |
| | | @Column(name = "ID_", length = 40) |
| | | @PropertyDef(label = "id") |
| | | @JSONField |
| | | private String id; |
| | | |
| | | @Column(name = "DRUG_LOG_ID_", length = 4) |
| | | @PropertyDef(label = "çè¸å¤æ¡ç¼å·", description = "4ä½é¡ºåºå·") |
| | | @JSONField |
| | | private String drugLogId; |
| | | |
| | | @Column(name = "DEPT_ID_", length = 21) |
| | | @PropertyDef(label = "åºåºä»£ç ") |
| | | @JSONField |
| | | private String deptId; |
| | | |
| | | @Column(name = "tbrq") |
| | | @PropertyDef(label = "å¡«æ¥æ¥æ") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date tbrq; |
| | | |
| | | @Column(name = "xznd", precision = 20, scale = 3) |
| | | @PropertyDef(label = "设å®çè¸æµåº¦", description = "åä½ï¼ml/m³") |
| | | private Double xznd; |
| | | |
| | | @Column(name = "mbsj") |
| | | @PropertyDef(label = "å¯éæ¶é´", description = "åä½ï¼å¤©") |
| | | private Integer mbsj; |
| | | |
| | | @Column(name = "xzfs", length = 30) |
| | | @PropertyDef(label = "çè¸æ¹å¼") |
| | | private String xzfs; |
| | | |
| | | @Column(name = "sqfs", length = 30) |
| | | @PropertyDef(label = "æ£æ°æ¹å¼") |
| | | private String sqfs; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.async.fzzy35.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.data.PushProtocol; |
| | | import com.fzzy.api.entity.Api1105; |
| | | import com.fzzy.api.entity.ApiInfoData; |
| | | import com.fzzy.api.entity.ApiLog; |
| | | import com.fzzy.api.service.ApiCommonService; |
| | | import com.fzzy.api.utils.ContextUtil; |
| | | import com.fzzy.api.view.repository.ApiInfoDataRep; |
| | | import com.fzzy.api.view.repository.ApiLogRep; |
| | | import com.fzzy.async.fzzy35.entity.Fz35DrugLogApply; |
| | | import com.fzzy.async.fzzy35.repository.Fzzy35Sync1023Rep; |
| | | import com.fzzy.async.fzzy35.entity.Fz35DrugLogDtl; |
| | | import com.fzzy.async.fzzy35.entity.Fz35DrugLogPeople; |
| | | import com.fzzy.async.fzzy35.entity.Fz35DrugLogWay; |
| | | import com.fzzy.async.fzzy35.repository.Fzzy35SyncDrugLogDtlRep; |
| | | import com.fzzy.async.fzzy35.repository.Fzzy35SyncDrugLogPeopleRep; |
| | | import com.fzzy.async.fzzy35.repository.Fzzy35SyncDrugLogWayRep; |
| | | import com.fzzy.otherview.gd2022.dto.GdApi1023; |
| | | import com.fzzy.otherview.gd2022.dto.GdApi1023Dtl; |
| | | import com.fzzy.otherview.gd2022.dto.GdApi1023People; |
| | | import com.fzzy.otherview.gd2022.dto.GdApi1023Way; |
| | | import com.fzzy.push.gd2022.ApiCodeConstant; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çè¸å¤æ¡ä¿¡æ¯ |
| | | * |
| | | * @author czt |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class Fzzy35Sync1023 { |
| | | @Autowired |
| | | private Fzzy35Sync1023Rep fzzy35Sync1023Rep; |
| | | @Autowired |
| | | private Fzzy35SyncDrugLogPeopleRep drugLogPeopleRep; |
| | | @Autowired |
| | | private Fzzy35SyncDrugLogWayRep drugLogWayRep; |
| | | @Autowired |
| | | private Fzzy35SyncDrugLogDtlRep drugLogDtlRep; |
| | | @Autowired |
| | | private ApiLogRep apiLogRep; |
| | | @Autowired |
| | | private ApiInfoDataRep apiInfoDataRep; |
| | | @Autowired |
| | | private ApiCommonService commonService; |
| | | |
| | | /** |
| | | * 忥çè¸å¤æ¡ä¿¡æ¯ |
| | | * |
| | | * @param deptId |
| | | * @param start |
| | | * @param end |
| | | */ |
| | | public void syncData(String kqdm, String deptId, Date start, Date end) { |
| | | log.info("-------------1023æ¥å£è®¾å¤ä¿¡æ¯å¼å§åæ¥------------------"); |
| | | |
| | | //åæ¥æ°æ®ï¼åªè®°å½å¤±è´¥çä¿¡æ¯ |
| | | ApiLog apiLog = new ApiLog(); |
| | | apiLog.setType(ApiLog.TYPE_SYNC); |
| | | apiLog.setKqdm(deptId); |
| | | apiLog.setUploadTime(new Date()); |
| | | apiLog.setInteId(ApiCodeConstant.API_1023); |
| | | apiLog.setStatus(99); |
| | | apiLog.setId(ContextUtil.getUUID()); |
| | | try { |
| | | List<Fz35DrugLogApply> list = fzzy35Sync1023Rep.listDrugLogApply(deptId, start, end); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.info("-------------没æè·åå°çè¸å¤æ¡ä¿¡æ¯------------------"); |
| | | return; |
| | | } |
| | | |
| | | GdApi1023 gdApi1023; |
| | | GdApi1023Way gdApi1023Way; |
| | | GdApi1023People gdApi1023People; |
| | | GdApi1023Dtl gdApi1023Dtl; |
| | | |
| | | List<GdApi1023Dtl> dtlList; |
| | | List<GdApi1023Way> wayList; |
| | | List<GdApi1023People> peopleList; |
| | | |
| | | List<ApiInfoData> apiInfoList; |
| | | ApiInfoData infoData; |
| | | Api1105 api1105; |
| | | |
| | | for (Fz35DrugLogApply data : list) { |
| | | gdApi1023 = new GdApi1023(); |
| | | BeanUtils.copyProperties(data, gdApi1023); |
| | | gdApi1023.setXzbm(data.getXzbm().substring(7)); |
| | | gdApi1023.setKqdm(kqdm); |
| | | gdApi1023.setDwdm(kqdm.substring(0, 18)); |
| | | gdApi1023.setYjmc(data.getDrugName()); |
| | | gdApi1023.setYjlx(data.getDrugType()); |
| | | gdApi1023.setZhgxsj(data.getUpdateTime()); |
| | | |
| | | //å¨ç²®ç²®æ
æç»è¡¨ |
| | | List<Fz35DrugLogDtl> dtls = drugLogDtlRep.listDrugLogDtl(data.getXzbm()); |
| | | if (null != dtls && dtls.size() > 0) { |
| | | dtlList = new ArrayList<>(); |
| | | for (Fz35DrugLogDtl dtl : dtls) { |
| | | gdApi1023Dtl = new GdApi1023Dtl(); |
| | | BeanUtils.copyProperties(dtl, gdApi1023Dtl); |
| | | //è·åè´§ä½ä¿¡æ¯ |
| | | api1105 = commonService.getApi1105Cache(dtl.getDepotId()); |
| | | if (null == api1105) { |
| | | continue; |
| | | } |
| | | gdApi1023Dtl.setCfdm(api1105.getHwdm().substring(0, 25)); |
| | | gdApi1023Dtl.setLspzdm(dtl.getFoodVariety()); |
| | | gdApi1023Dtl.setLsxzdm(dtl.getFoodType()); |
| | | gdApi1023Dtl.setLsdjdm(dtl.getFoodLevel()); |
| | | gdApi1023Dtl.setLssl(dtl.getNumber()); |
| | | gdApi1023Dtl.setSf(dtl.getPerWet()); |
| | | gdApi1023Dtl.setZz(dtl.getPerImpurity()); |
| | | dtlList.add(gdApi1023Dtl); |
| | | } |
| | | gdApi1023.setDtls(dtlList); |
| | | } |
| | | |
| | | List<Fz35DrugLogWay> ways = drugLogWayRep.listDrugLogWay(data.getXzbm()); |
| | | if (null != ways && ways.size() > 0) { |
| | | wayList = new ArrayList<>(); |
| | | for (Fz35DrugLogWay way : ways) { |
| | | gdApi1023Way = new GdApi1023Way(); |
| | | BeanUtils.copyProperties(way, gdApi1023Way); |
| | | wayList.add(gdApi1023Way); |
| | | } |
| | | |
| | | gdApi1023.setWays(wayList); |
| | | } |
| | | |
| | | List<Fz35DrugLogPeople> peoples = drugLogPeopleRep.listDrugLogPeople(data.getXzbm()); |
| | | if (null != peoples && peoples.size() > 0) { |
| | | peopleList = new ArrayList<>(); |
| | | for (Fz35DrugLogPeople people : peoples) { |
| | | gdApi1023People = new GdApi1023People(); |
| | | BeanUtils.copyProperties(people, gdApi1023People); |
| | | peopleList.add(gdApi1023People); |
| | | |
| | | } |
| | | gdApi1023.setPeoples(peopleList); |
| | | } |
| | | |
| | | //æä¹
åä¿åï¼åç¬åå
¥é彿 æ¥å£è¡¨ |
| | | infoData = new ApiInfoData(); |
| | | infoData.setId(ContextUtil.getUUID()); |
| | | infoData.setKqdm(kqdm); |
| | | infoData.setInteType(Constant.API_CATEGORY_13); |
| | | infoData.setInteId(ApiCodeConstant.API_1023); |
| | | infoData.setBizType(PushProtocol.SB_GD_2022.getCode()); |
| | | infoData.setUpdateTime(new Date()); |
| | | infoData.setDataId(data.getXzbm()); |
| | | |
| | | apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm(), kqdm); |
| | | if (null == apiInfoList || apiInfoList.isEmpty()) { |
| | | gdApi1023.setCzbz(Constant.CZBZ_I); |
| | | infoData.setCzbz(Constant.CZBZ_I); |
| | | } else { |
| | | gdApi1023.setCzbz(apiInfoList.get(0).getCzbz()); |
| | | infoData.setCzbz(apiInfoList.get(0).getCzbz()); |
| | | } |
| | | |
| | | infoData.setData(JSON.toJSONString(gdApi1023)); |
| | | |
| | | //ä¿åæ°æ® |
| | | apiInfoDataRep.save(infoData); |
| | | log.info("1023---åæ¥æ°æ®ï¼{}", gdApi1023.toString()); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | log.error("---çè¸å¤æ¡ä¿¡æ¯åæ¥æ§è¡å¤±è´¥----{}", e.toString()); |
| | | apiLog.setResult("çè¸å¤æ¡ä¿¡æ¯åæ¥æ§è¡å¤±è´¥ï¼" + e.getMessage()); |
| | | apiLogRep.save(apiLog); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.async.fzzy35.repository; |
| | | |
| | | import com.fzzy.async.fzzy35.entity.Fz35DrugLogApply; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.Query; |
| | | import org.springframework.data.repository.query.Param; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çè¸å¤æ¡ä¿¡æ¯ |
| | | * |
| | | * @author czt |
| | | */ |
| | | public interface Fzzy35Sync1023Rep extends JpaRepository<Fz35DrugLogApply, String> { |
| | | |
| | | //æ¥è¯¢çè¸å¤æ¡ä¸»è¡¨ |
| | | @Query("from Fz35DrugLogApply where deptId =:deptId and updateTime >=:start and updateTime <:end order by updateTime ") |
| | | List<Fz35DrugLogApply> listDrugLogApply(@Param("deptId") String deptId, @Param("start") Date start, @Param("end") Date end); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.async.fzzy35.repository; |
| | | |
| | | import com.fzzy.async.fzzy35.entity.Fz35DrugLogDtl; |
| | | 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 |
| | | */ |
| | | public interface Fzzy35SyncDrugLogDtlRep extends JpaRepository<Fz35DrugLogDtl, String> { |
| | | |
| | | |
| | | @Query("from Fz35DrugLogDtl where id =:id") |
| | | List<Fz35DrugLogDtl> listDrugLogDtl(@Param("id") String id); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.async.fzzy35.repository; |
| | | |
| | | import com.fzzy.async.fzzy35.entity.Fz35DrugLogPeople; |
| | | 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 |
| | | */ |
| | | public interface Fzzy35SyncDrugLogPeopleRep extends JpaRepository<Fz35DrugLogPeople, String> { |
| | | |
| | | @Query("from Fz35DrugLogPeople where id =:id") |
| | | List<Fz35DrugLogPeople> listDrugLogPeople(@Param("id") String id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.async.fzzy35.repository; |
| | | |
| | | import com.fzzy.async.fzzy35.entity.Fz35DrugLogWay; |
| | | 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 |
| | | */ |
| | | public interface Fzzy35SyncDrugLogWayRep extends JpaRepository<Fz35DrugLogWay, String> { |
| | | |
| | | @Query("from Fz35DrugLogWay where id =:id") |
| | | List<Fz35DrugLogWay> listDrugLogWay(@Param("id") String id); |
| | | } |
| | |
| | | List<GdApi1023Way> wayList = new ArrayList<>(); |
| | | List<GdApi1023People> peopleList = new ArrayList<>(); |
| | | for (Fz40DrugLogApply data : list) { |
| | | List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm()); |
| | | List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(ApiCodeConstant.API_1023, data.getXzbm(),kqdm); |
| | | if (apiInfoList.size() != 0) { |
| | | continue; |
| | | } |