From 283da741b2429cf5a53786e5ee1b5528b757fdf6 Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期三, 11 六月 2025 11:10:42 +0800 Subject: [PATCH] 首页及电子货位卡页面 --- igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/dto/GasParam.java | 31 + igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/GranaryService.java | 8 igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/repository/GrainRepository.java | 2 igds-dzhwk-web/src/main/resources/static/dzhwk/dzhwk.js | 435 ++++++++++++------- igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/dto/GasData.java | 136 ++++++ igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/service/GrainService.java | 59 ++ igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/repository/GasRepository.java | 2 igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainIotData.java | 2 igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainParam.java | 42 + igds-dzhwk-core/src/main/resources/mapper/GasServiceMapper.xml | 57 ++ igds-dzhwk-web/pom.xml | 1 igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java | 73 +++ igds-dzhwk-core/src/main/java/com/fzzy/igds/data/BaseParam.java | 42 + igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/service/GasService.java | 54 ++ igds-dzhwk-inte/src/main/java/com/fzzy/igds/dzhwk/v1/impl/ApiV1ServiceImpl2001.java | 2 igds-dzhwk-web/src/main/resources/templates/dzhwk/index.html | 18 igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainLay.java | 2 igds-dzhwk-core/src/main/resources/mapper/GrainServiceMapper.xml | 104 ++++ igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainRow.java | 2 igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainData.java | 2 igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/HwkDepotDto.java | 51 + igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/repository/GranaryRepository.java | 9 igds-dzhwk-inte/src/main/java/com/fzzy/igds/dzhwk/v1/impl/ApiV1ServiceImpl2002.java | 2 igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java | 14 igds-dzhwk-web/src/main/resources/templates/dzhwk/dzhwk.html | 14 igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainPoint.java | 2 igds-dzhwk-web/src/main/java/com/fzzy/igds/init/SystemRunner.java | 97 ++++ igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/mapper/GrainServiceMapper.java | 27 + igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/mapper/GasServiceMapper.java | 18 29 files changed, 1,101 insertions(+), 207 deletions(-) diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/data/BaseParam.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/data/BaseParam.java new file mode 100644 index 0000000..ee3d22f --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/data/BaseParam.java @@ -0,0 +1,42 @@ +package com.fzzy.igds.data; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author: andy.jia + * @description: + * @date:2019.03.21 + **/ +@Data +public class BaseParam { + + private int limit = 10;// LAYUI 涓撶敤锛屾瘡椤垫樉绀虹殑鏉℃暟銆俵aypage灏嗕細鍊熷姪 count 鍜� limit 璁$畻鍑哄垎椤垫暟 + + private int curr = 1;// LAYUI 涓撶敤 璧峰椤点�備竴鑸敤浜庡埛鏂扮被鍨嬬殑璺抽〉浠ュ強HASH璺抽〉 + + private int page = 1;// 鐩爣椤甸潰 + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = page; + } + + private String companyId;// 缁勭粐缂栫爜 + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date start; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date end; + + private String depotId;// 浠撳簱缂栫爜 + + private String deptId;// 搴撳尯缂栫爜 + + private String key;//鍏抽敭瀛� +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/HwkDepotDto.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/HwkDepotDto.java index 3432c58..37dd16b 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/HwkDepotDto.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/HwkDepotDto.java @@ -16,37 +16,66 @@ public class HwkDepotDto implements Serializable { @PropertyDef(label = "寤掗棿鍚�") - private String granary; + private String granaryName; @PropertyDef(label = "璐т綅鍚�") - private String depot; + private String name; @PropertyDef(label = "浠撴俯") - private Double inTemp; + private String inTemp = "--"; @PropertyDef(label = "浠撴箍") - private Double inHumidity; + private String inHumidity = "--"; + + @PropertyDef(label = "浠撳娓�") + private String outTemp = "--"; + + @PropertyDef(label = "浠撳婀�") + private String outHumidity = "--"; + + @PropertyDef(label = "楂樻俯") + private String maxTemp = "--"; + + @PropertyDef(label = "浣庢俯") + private String minTemp = "--"; + + @PropertyDef(label = "鍧囨俯") + private String aveTemp = "--"; + + @PropertyDef(label = "绮俯妫�娴嬫椂闂�") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date grainDate; @PropertyDef(label = "姘ф皵") - private String perO2; + private String perO2 = "--"; @PropertyDef(label = "纾峰寲姘�") - private String perPh3; + private String perPh3 = "--"; + + @PropertyDef(label = "浜屾哀鍖栫⒊") + private String perCo2 = "--"; + + @PropertyDef(label = "姘斾綋妫�娴嬫椂闂�") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date gasDate; @PropertyDef(label = "浠撳簱绫诲瀷") - private String depotType; + private String depotTypeName; @PropertyDef(label = "浠撳簱鐘舵��") - private String depotStatus; + private String depotStatusName; @PropertyDef(label = "绮鍝佺") - private String foodVariety; + private String foodVarietyName; + + @PropertyDef(label = "瀹為檯鍌ㄩ噺") + private Double storageReal = 0.0; @PropertyDef(label = "绮绛夌骇") - private String foodLevel; + private String foodLevelName; @PropertyDef(label = "绮鎬ц川") - private String foodType; + private String foodTypeName; @PropertyDef(label = "鍏ュ簱鏃堕棿") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/dto/GasData.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/dto/GasData.java new file mode 100644 index 0000000..f26dc6c --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/dto/GasData.java @@ -0,0 +1,136 @@ +package com.fzzy.igds.gas.dto; + +import com.bstek.dorado.annotation.PropertyDef; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fzzy.igds.dzhwk.domain.Depot; +import lombok.Data; +import org.apache.commons.lang3.time.DateFormatUtils; + +import javax.persistence.Column; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 鐢ㄤ簬灏佽鐨勭伯鎯呬俊鎭紝姣忔鑾峰彇绮儏鏁版嵁锛屽皝瑁呬负褰撳墠瀵硅薄 + * + * @author jiazx + */ +@Data +public class GasData implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + + @PropertyDef(label = "鎵规ID") + private String batchId; + + @PropertyDef(label = "缁勭粐缂栫爜", description = "") + private String companyId; + + @PropertyDef(label = "浠撳簱ID", description = "浠撳簱缂栧彿") + private String depotId; + + @PropertyDef(label = "绫诲瀷", description = "0-甯歌妫�娴嬶紝1-鐔忚捀妫�娴�") + private String type; + + @PropertyDef(label = "浜屾哀鍖栫⒊娴撳害", description = "骞冲潎浜屾哀鍖栫⒊娴撳害(PPM)") + private Double perCo2 = 0.0; + + @PropertyDef(label = "姘ф皵娴撳害", description = "骞冲潎姘ф皵娴撳害(%)") + private Double perO2 = 0.0; + + @PropertyDef(label = "纾峰寲姘㈡祿搴�", description = "骞冲潎纾峰寲姘㈡祿搴�(PPM)") + private Double perPh3 = 0.0; + + @PropertyDef(label = "姘皵娴撳害", description = "姘皵娴撳害(%)") + private Double perN2 = 0.0; + + @PropertyDef(label = "浜屾哀鍖栫⒊娴撳害-鏈�澶�", description = "浜屾哀鍖栫⒊娴撳害(PPM)") + private Double perCo2Max = 0.0; + + @PropertyDef(label = "姘ф皵娴撳害-鏈�澶�", description = "姘ф皵娴撳害(%)") + private Double perO2Max = 0.0; + + @PropertyDef(label = "纾峰寲姘㈡祿搴�-鏈�澶�", description = "纾峰寲姘㈡祿搴�(PPM)") + private Double perPh3Max = 0.0; + + @PropertyDef(label = "姘皵娴撳害-鏈�澶�") + private Double perN2Max = 0.0; + + @PropertyDef(label = "浜屾哀鍖栫⒊娴撳害-鏈�灏�", description = "浜屾哀鍖栫⒊娴撳害(PPM)") + private Double perCo2Min = 0.0; + + @PropertyDef(label = "姘ф皵娴撳害-鏈�灏�", description = "姘ф皵娴撳害(%)") + private Double perO2Min = 0.0; + + @PropertyDef(label = "纾峰寲姘㈡祿搴�-鏈�灏�", description = "纾峰寲姘㈡祿搴�(PPM)") + private Double perPh3Min = 0.0; + + @PropertyDef(label = "姘皵娴撳害-鏈�灏�") + private Double perN2Min = 0.0; + + @PropertyDef(label = "妫�娴嬫椂闂�") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date receiveDate; + + @PropertyDef(label = "閲囬泦閫氶亾涓暟") + private int checkNum = 0; + + @PropertyDef(label = "閲囬泦鐐逛俊鎭�", description = "鍥哄畾涓猴細passCode,co2,o2,ph3,n2;passCode,co2,o2,ph3,n2;") + private String points; + + @Column(name = "CHECK_USER_", length = 30) + @PropertyDef(label = "妫�娴嬩汉") + private String checkUser; + + @PropertyDef(label = "澶囨敞淇℃伅") + private String remark; + + @PropertyDef(label = "绯荤粺鏃堕棿", description = "鍏崇郴瀛楁") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date sysDate = new Date(); + + @PropertyDef(label = "浠撳簱淇℃伅", description = "鍏崇郴瀛楁") + private Depot depotData; + + @PropertyDef(label = "妫�娴嬫壒娆�", description = "鍏崇郴瀛楁") + private String strReceiveDate; + + @PropertyDef(label = "鍘嬪姏淇℃伅", description = "鍏崇郴瀛楁") + private Double pressure; + + @PropertyDef(label = "鍘嬪姏妫�娴嬫椂闂�", description = "鍏崇郴瀛楁") + private Date pressureDate; + + + public GasData() { + super(); + } + + public GasData(String batchId, String companyId, String depotId, + Date receiveDate) { + super(); + this.batchId = batchId; + this.companyId = companyId; + this.depotId = depotId; + this.perCo2Max = 0.0; + this.perO2Max = 0.0; + this.perPh3Max = 0.0; + this.perCo2Min = 0.0; + this.perO2Min = 0.0; + this.perPh3Min = 0.0; + this.perCo2 = 0.0; + this.perO2 = 0.0; + this.perPh3 = 0.0; + this.receiveDate = receiveDate; + } + + public String getStrReceiveDate() { + if (this.receiveDate != null) + return DateFormatUtils.format(receiveDate, "yyyy-MM-dd HH:mm"); + return null; + } +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/dto/GasParam.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/dto/GasParam.java new file mode 100644 index 0000000..c6acd47 --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/dto/GasParam.java @@ -0,0 +1,31 @@ +package com.fzzy.igds.gas.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fzzy.igds.data.BaseParam; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * @author jiazx + */ +@Data +@EqualsAndHashCode(callSuper = false) +public class GasParam extends BaseParam { + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date checkDate;// 鐩戞祴鏃ユ湡 yyyy-MM-dd + + private String batchId;// 鎵规鍙� + + private String type;// 妫�娴嬬被鍨� + + private String checkPoints;// 鎸囧畾閲囬泦鐐癸紝鐢ㄩ�楀彿闅斿紑鐨勫瓧绗︿覆 + + private String depotIds;// 澶氫粨閲囬泦锛岀敤閫楀彿闅斿紑鐨勪粨搴撶紪鐮� + + private boolean tagUpdate = true;// 鏄惁鏇存柊閲囬泦鐐硅缁� + + private boolean tagPressure = false;//鏄惁鏌ヨ鍘嬪姏淇℃伅 +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/mapper/GasServiceMapper.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/mapper/GasServiceMapper.java new file mode 100644 index 0000000..d5ad8c0 --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/mapper/GasServiceMapper.java @@ -0,0 +1,18 @@ +package com.fzzy.igds.gas.mapper; + +import com.fzzy.igds.gas.dto.GasData; +import com.fzzy.igds.gas.dto.GasParam; +import org.apache.ibatis.annotations.Param; +import java.util.List; + + +public interface GasServiceMapper { + + /** + * 鍒嗛〉鏌ヨ鏁版嵁 + * @param param + * @return + */ + List<GasData> getGrainData(@Param("param") GasParam param); + +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/GasRepository.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/repository/GasRepository.java similarity index 89% rename from igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/GasRepository.java rename to igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/repository/GasRepository.java index 0eb2895..3b56fd0 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/GasRepository.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/repository/GasRepository.java @@ -1,4 +1,4 @@ -package com.fzzy.igds.dzhwk.service.repository; +package com.fzzy.igds.gas.repository; import com.fzzy.igds.dzhwk.domain.Gas; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/service/GasService.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/service/GasService.java new file mode 100644 index 0000000..efead5d --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/gas/service/GasService.java @@ -0,0 +1,54 @@ +package com.fzzy.igds.gas.service; + +import com.fzzy.igds.dzhwk.constant.RedisConst; +import com.fzzy.igds.gas.dto.GasData; +import com.fzzy.igds.gas.dto.GasParam; +import com.fzzy.igds.gas.mapper.GasServiceMapper; +import com.ruoyi.common.core.redis.RedisCache; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.*; + +/** + * @Description + * @Author CZT + * @Date 2024/12/09 11:05 + */ +@Slf4j +@Service +public class GasService { + + @Resource + private GasServiceMapper gasMapper; + @Resource + private RedisCache redisCache; + + /** + * + * @param companyId + * @param depotId + * @return + */ + @SuppressWarnings("unchecked") + public GasData getCacheGrainDate(String companyId, String depotId) { + + String key = RedisConst.buildKey(companyId, RedisConst.KEY_GAS_DATA, depotId); + + GasData gasData = redisCache.getCacheObject(key); + + if (null == gasData) { + GasParam param = new GasParam();; + param.setCompanyId(companyId); + param.setDepotId(depotId); + List<GasData> list = gasMapper.getGrainData(param); + if (list != null && !list.isEmpty()) { + gasData = list.get(0); + redisCache.setCacheObject(key, gasData); + } + return null; + } + return gasData; + } + +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainData.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainData.java similarity index 98% rename from igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainData.java rename to igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainData.java index 564841f..e333ea9 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainData.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainData.java @@ -1,4 +1,4 @@ -package com.fzzy.igds.dzhwk.data; +package com.fzzy.igds.grain.dto; import com.bstek.dorado.annotation.PropertyDef; import com.fasterxml.jackson.annotation.JsonFormat; diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainIotData.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainIotData.java similarity index 95% rename from igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainIotData.java rename to igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainIotData.java index ae60a60..6fb429a 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainIotData.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainIotData.java @@ -1,4 +1,4 @@ -package com.fzzy.igds.dzhwk.data; +package com.fzzy.igds.grain.dto; import lombok.Data; diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainLay.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainLay.java similarity index 96% rename from igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainLay.java rename to igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainLay.java index 27d967d..9c6642a 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainLay.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainLay.java @@ -1,4 +1,4 @@ -package com.fzzy.igds.dzhwk.data; +package com.fzzy.igds.grain.dto; import com.bstek.dorado.annotation.PropertyDef; import lombok.Data; diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainParam.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainParam.java new file mode 100644 index 0000000..3324e0d --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainParam.java @@ -0,0 +1,42 @@ +package com.fzzy.igds.grain.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fzzy.igds.data.BaseParam; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 绮儏涓氬姟鍙傛暟鍙傛暟瀹氫箟 + * + * @author jiazx + * + */ +@Data +@EqualsAndHashCode(callSuper = false) +public class GrainParam extends BaseParam { + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date checkDate;// 妫�娴嬫棩鏈� yyyy-MM-dd + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM", timezone = "GMT+8") + private Date checkMonth;// 妫�娴嬫棩鏈� + + private int checkHour;//妫�娴嬫椂闂村皬鏃讹紝0涓嶇畻 + + private String batchId;// 鎵规鍙� + + private String extBatchId;// 闇�瑕佽鎺掗櫎鎵规鍙� + + private String depotIds;// 浠ラ�楀彿闅斿紑鐨勪粨搴撶紪鐮侊紝澶氫釜浠撳簱缂栫爜 + + private boolean tagUpdate = true;// 鏄惁鏇存柊灞傛暟鎹拰琛屾暟鎹� + + private String cableRule;//甯冪嚎瑙勫垯 + + private String cableCir;//绛掍粨灞傚竷绾胯鍒� + + private String depotType;//浠撳簱绫诲瀷 + +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainPoint.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainPoint.java similarity index 95% rename from igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainPoint.java rename to igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainPoint.java index f9b5e41..871c3e6 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainPoint.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainPoint.java @@ -1,4 +1,4 @@ -package com.fzzy.igds.dzhwk.data; +package com.fzzy.igds.grain.dto; import com.bstek.dorado.annotation.PropertyDef; import lombok.Data; diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainRow.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainRow.java similarity index 94% rename from igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainRow.java rename to igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainRow.java index c4cdd1b..4e66449 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/GrainRow.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/dto/GrainRow.java @@ -1,4 +1,4 @@ -package com.fzzy.igds.dzhwk.data; +package com.fzzy.igds.grain.dto; import com.bstek.dorado.annotation.PropertyDef; import lombok.Data; diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/mapper/GrainServiceMapper.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/mapper/GrainServiceMapper.java new file mode 100644 index 0000000..988803a --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/mapper/GrainServiceMapper.java @@ -0,0 +1,27 @@ +package com.fzzy.igds.grain.mapper; + +import com.fzzy.igds.grain.dto.GrainData; +import com.fzzy.igds.grain.dto.GrainParam; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +public interface GrainServiceMapper { + + + /** + * 鏍规嵁鍙傛暟鑾峰彇绮儏淇℃伅 + * + * @param param + * @return + */ + List<GrainData> listGrainData(@Param("param") GrainParam param); + + /** + * 鏍规嵁鍙傛暟鑾峰彇绮儏淇℃伅 + * + * @param param + * @return + */ + List<GrainData> getGrainData(@Param("param") GrainParam param); + +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/GrainRepository.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/repository/GrainRepository.java similarity index 94% rename from igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/GrainRepository.java rename to igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/repository/GrainRepository.java index 4f7cc1d..18a24f4 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/GrainRepository.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/repository/GrainRepository.java @@ -1,4 +1,4 @@ -package com.fzzy.igds.dzhwk.service.repository; +package com.fzzy.igds.grain.repository; import com.fzzy.igds.dzhwk.domain.Grain; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/service/GrainService.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/service/GrainService.java new file mode 100644 index 0000000..98ac7fb --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/grain/service/GrainService.java @@ -0,0 +1,59 @@ +package com.fzzy.igds.grain.service; + +import com.fzzy.igds.dzhwk.constant.RedisConst; +import com.fzzy.igds.grain.dto.GrainData; +import com.fzzy.igds.grain.dto.GrainParam; +import com.fzzy.igds.grain.mapper.GrainServiceMapper; +import com.ruoyi.common.core.redis.RedisCache; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + +/** + * @Description 绮儏妯″潡鏍稿績鎺ュ彛 + * @Author CZT + * @Date 2024/12/02 15:33 + */ +@Slf4j +@Service("dzhwk.grainService") +public class GrainService { + + @Resource + private RedisCache redisCache; + @Resource + private GrainServiceMapper grainServiceMapper; + + + /** + * 鑾峰彇缂撳瓨涓渶鏂扮殑绮儏妫�娴嬫暟鎹� + * + * @param companyId + * @return key=鍙傝�冪紪鐮� + */ + public GrainData getCacheGrainDate(String companyId, String depotId) { + if (null == companyId || null == depotId) { + return null; + } + + String key = RedisConst.buildKey(companyId, RedisConst.KEY_GRAIN, depotId); + + GrainData grainData = redisCache.getCacheObject(key); + + if (null == grainData) { + GrainParam param = new GrainParam();; + param.setCompanyId(companyId); + param.setDepotId(depotId); + List<GrainData> list = grainServiceMapper.getGrainData(param); + if (list != null && !list.isEmpty()) { + grainData = list.get(0); + redisCache.setCacheObject(key, grainData); + } + } + + return grainData; + } + + + +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/GranaryService.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/GranaryService.java index 102c8b3..6160f53 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/GranaryService.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/GranaryService.java @@ -34,6 +34,14 @@ return granaryRepository.getGranary(companyId, deptId); } + public Granary getGranaryById(String ajdh) { + + if (StringUtils.isEmpty(ajdh)) { + return null; + } + return granaryRepository.getGranaryById(ajdh); + } + public void saveOrUpdate(Granary data) { if (StringUtils.isEmpty(data.getCompanyId())) { data.setCompanyId(ContextUtil.getCompanyId()); diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/repository/GranaryRepository.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/repository/GranaryRepository.java index d96f3a3..536957d 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/repository/GranaryRepository.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/repository/GranaryRepository.java @@ -26,4 +26,13 @@ @Query("from Granary where companyId =:companyId and deptId =:deptId order by ajdh") List<Granary> getGranary(@Param("companyId") String companyId, @Param("deptId") String deptId); + + /** + * + * @param ajdh + * @return + */ + @Query("from Granary where ajdh =:ajdh") + Granary getGranaryById(@Param("ajdh") String ajdh); + } diff --git a/igds-dzhwk-core/src/main/resources/mapper/GasServiceMapper.xml b/igds-dzhwk-core/src/main/resources/mapper/GasServiceMapper.xml new file mode 100644 index 0000000..4e2154a --- /dev/null +++ b/igds-dzhwk-core/src/main/resources/mapper/GasServiceMapper.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.fzzy.igds.gas.mapper.GasServiceMapper"> + + <!-- 鍩烘湰杩斿洖淇℃伅 --> + + <sql id="DATA_COLUMN"> + BATCH_ID_ AS batchId, + COMPANY_ID_ AS companyId, + DEPOT_ID_ AS depotId, + PER_CO2_ AS perCo2, + PER_O2_ AS perO2, + PER_PH3_ AS perPh3, + PER_N2_ AS perN2, + PER_CO2_MAX_ AS perCo2Max, + PER_O2_MAX_ AS perO2Max, + PER_PH3_MAX_ AS perPh3Max, + PER_N2_MAX_ AS perN2Max, + PER_CO2_MIN_ AS perCo2Min, + PER_O2_MIN_ AS perO2Min, + PER_PH3_MIN_ AS perPh3Min, + PER_N2_MIN_ AS perN2Min, + RECEIVE_DATE_ AS receiveDate, + POINTS_ AS points, + CHECK_USER_ AS checkUser, + CHECK_NUM_ as checkNum, + GAS_START_ as gasStart, + GAS_END_ as gasEnd, + TYPE_ as type, + REMARK_ AS remark + </sql> + + <sql id="DATA_COLUMN_INFO"> + ID_ AS id, + PASS_CODE_ AS passCode, + PER_CO2_ AS perCo2, + PER_O2_ AS perO2, + PER_PH3_ AS perPh3, + REMARK_ AS remark + </sql> + + <select id="getGrainData" resultType="com.fzzy.igds.gas.dto.GasData" parameterType="com.fzzy.igds.gas.dto.GasParam"> + select + <include refid="DATA_COLUMN"/> + from + D_GAS + <where> + <if test="param.companyId != null" >AND COMPANY_ID_ = #{param.companyId}</if> + <if test="param.depotId != null">AND DEPOT_ID_ = #{param.depotId}</if> + </where> + ORDER BY BATCH_ID_ DESC LIMIT 1 + </select> + +</mapper> \ No newline at end of file diff --git a/igds-dzhwk-core/src/main/resources/mapper/GrainServiceMapper.xml b/igds-dzhwk-core/src/main/resources/mapper/GrainServiceMapper.xml new file mode 100644 index 0000000..3626298 --- /dev/null +++ b/igds-dzhwk-core/src/main/resources/mapper/GrainServiceMapper.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.fzzy.igds.grain.mapper.GrainServiceMapper"> + + <!-- 鍩虹鏌ヨ瀛楁 --> + <sql id="DATA_REPORT_COLUMN"> + g + . + BATCH_ID_ + AS batchId, + g.COMPANY_ID_ AS companyId, + g.DEPOT_ID_ AS depotId, + g.TEMP_MIN_ AS tempMin, + g.TEMP_MAX_ AS tempMax, + g.TEMP_AVE_ AS tempAve, + g.HUMIDITY_IN_ AS humidityIn, + g.TEMP_IN_ AS tempIn, + g.HUMIDITY_OUT_ AS humidityOut, + g.TEMP_OUT_ AS tempOut, + g.CABLE_ AS cable, + g.CABLE_CIR_ AS cableCir, + g.OIL_HEIGHT_ AS oilHeight, + g.WEATHER_ AS weather, + g.RECEIVE_DATE_ AS receiveDate, + g.CHECK_USER_ AS checkUser, + g.REMARK_ AS remark, + g.POINTS_ AS points, + g.PUSH_TAG_ AS pushTag, + + d.STORE_KEEPER_NAME_ AS storeKeeperName, + d.PER_WET_ AS perWet, + d.PER_IMPURITY_ AS perImpurity, + d.DEPOT_TYPE_ AS depotType, + d.STORAGE_REAL_ AS storageReal, + d.FOOD_VARIETY_ AS foodVariety + </sql> + + <sql id="DATA_COLUMN"> + BATCH_ID_ + AS batchId, + COMPANY_ID_ AS companyId, + DEPOT_ID_ AS depotId, + TEMP_MIN_ AS tempMin, + TEMP_MAX_ AS tempMax, + TEMP_AVE_ AS tempAve, + HUMIDITY_IN_ AS humidityIn, + TEMP_IN_ AS tempIn, + HUMIDITY_OUT_ AS humidityOut, + TEMP_OUT_ AS tempOut, + CABLE_ AS cable, + CABLE_CIR_ AS cableCir, + OIL_HEIGHT_ AS oilHeight, + WEATHER_ AS weather, + RECEIVE_DATE_ AS receiveDate, + CHECK_USER_ AS checkUser, + REMARK_ AS remark, + POINTS_ AS points, + PUSH_TAG_ AS pushTag + </sql> + + + <!-- 鏍规嵁鏉′欢鑾峰彇绮儏淇℃伅 --> + <select id="listGrainData" resultType="com.fzzy.igds.grain.dto.GrainData" + parameterType="com.fzzy.igds.grain.dto.GrainParam"> + select + <include refid="DATA_COLUMN"/> + from + D_GRAIN + <where> + <if test="param.companyId != null">AND COMPANY_ID_ = + #{param.companyId} + </if> + <if test="param.start != null">AND + RECEIVE_DATE_ <![CDATA[ >= ]]> + #{param.start,jdbcType=DATE} + </if> + <if test="param.end != null">AND + RECEIVE_DATE_ <![CDATA[ <= ]]> + #{param.end,jdbcType=DATE} + </if> + <if test="param.depotId != null">AND DEPOT_ID_ = #{param.depotId}</if> + </where> + ORDER BY BATCH_ID_ DESC + </select> + + <!-- 鏍规嵁鏉′欢鑾峰彇绮儏淇℃伅 --> + <select id="getGrainData" resultType="com.fzzy.igds.grain.dto.GrainData" + parameterType="com.fzzy.igds.grain.dto.GrainParam"> + select + <include refid="DATA_COLUMN"/> + from + D_GRAIN + <where> + <if test="param.companyId != null">AND COMPANY_ID_ = + #{param.companyId} + </if> + <if test="param.depotId != null">AND DEPOT_ID_ = #{param.depotId}</if> + </where> + ORDER BY BATCH_ID_ DESC LIMIT 1 + </select> +</mapper> \ No newline at end of file diff --git a/igds-dzhwk-inte/src/main/java/com/fzzy/igds/dzhwk/v1/impl/ApiV1ServiceImpl2001.java b/igds-dzhwk-inte/src/main/java/com/fzzy/igds/dzhwk/v1/impl/ApiV1ServiceImpl2001.java index 0650048..0d8f16e 100644 --- a/igds-dzhwk-inte/src/main/java/com/fzzy/igds/dzhwk/v1/impl/ApiV1ServiceImpl2001.java +++ b/igds-dzhwk-inte/src/main/java/com/fzzy/igds/dzhwk/v1/impl/ApiV1ServiceImpl2001.java @@ -2,7 +2,7 @@ import com.alibaba.fastjson.JSONObject; import com.fzzy.igds.dzhwk.domain.Grain; -import com.fzzy.igds.dzhwk.service.repository.GrainRepository; +import com.fzzy.igds.grain.repository.GrainRepository; import com.fzzy.igds.dzhwk.v1.ApiV1Service; import com.fzzy.igds.dzhwk.v1.dto.ApiV1Data2001; import com.fzzy.igds.dzhwk.v1.dto.ApiV1ReqDto; diff --git a/igds-dzhwk-inte/src/main/java/com/fzzy/igds/dzhwk/v1/impl/ApiV1ServiceImpl2002.java b/igds-dzhwk-inte/src/main/java/com/fzzy/igds/dzhwk/v1/impl/ApiV1ServiceImpl2002.java index 3b42da4..ebab4c1 100644 --- a/igds-dzhwk-inte/src/main/java/com/fzzy/igds/dzhwk/v1/impl/ApiV1ServiceImpl2002.java +++ b/igds-dzhwk-inte/src/main/java/com/fzzy/igds/dzhwk/v1/impl/ApiV1ServiceImpl2002.java @@ -2,7 +2,7 @@ import com.alibaba.fastjson.JSONObject; import com.fzzy.igds.dzhwk.domain.Gas; -import com.fzzy.igds.dzhwk.service.repository.GasRepository; +import com.fzzy.igds.gas.repository.GasRepository; import com.fzzy.igds.dzhwk.v1.ApiV1Service; import com.fzzy.igds.dzhwk.v1.dto.ApiV1Data2002; import com.fzzy.igds.dzhwk.v1.dto.ApiV1ReqDto; diff --git a/igds-dzhwk-web/pom.xml b/igds-dzhwk-web/pom.xml index 44323f0..ff1c358 100644 --- a/igds-dzhwk-web/pom.xml +++ b/igds-dzhwk-web/pom.xml @@ -60,7 +60,6 @@ <systemPath>${project.basedir}/src/main/resources/lib/dorado-skin-ruoyi-1.0.10.jar</systemPath> </dependency> - </dependencies> <build> diff --git a/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java b/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java index 596636f..1280489 100644 --- a/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java +++ b/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java @@ -1,5 +1,6 @@ package com.fzzy.igds.dzhwk.controller; +import com.fzzy.igds.dzhwk.data.HwkDepotDto; import com.fzzy.igds.dzhwk.domain.Depot; import com.fzzy.igds.dzhwk.domain.Dept; import com.fzzy.igds.dzhwk.manager.WebManager; @@ -43,7 +44,7 @@ if(StringUtils.isEmpty(sid)){ sid = "FZZY0001"; } - List<Depot> list = webManager.getDepotsByGid(sid); + List<HwkDepotDto> list = webManager.getDepotsByGid(sid); view.put("depotList", list); view.put("flag", "index"); @@ -56,7 +57,16 @@ * @return */ @RequestMapping("/dzhwk") - public String dzhwk(ModelMap view) { + public String dzhwk(@RequestParam(value = "sid", required = false) String sid, ModelMap view) { + + //鏍规嵁璐т綅鍗N锛岃幏鍙栧搴斿粧闂翠笅鐨勮揣浣嶅垪琛ㄤ俊鎭� + if(StringUtils.isEmpty(sid)){ + sid = "FZZY0001"; + } + List<HwkDepotDto> list = webManager.getDepotsByGid(sid); + view.put("depotList", list); + view.put("name", list.get(0).getGranaryName()); + view.put("flag", "dzhwk"); return prefix + "dzhwk"; } diff --git a/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java b/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java index ac83aa2..9012022 100644 --- a/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java +++ b/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java @@ -4,18 +4,27 @@ import com.fzzy.igds.dzhwk.data.HwkDepotDto; import com.fzzy.igds.dzhwk.domain.Depot; import com.fzzy.igds.dzhwk.domain.Dept; +import com.fzzy.igds.dzhwk.domain.Granary; import com.fzzy.igds.dzhwk.domain.HScreenSer; import com.fzzy.igds.dzhwk.service.ScreenSerService; import com.fzzy.igds.file.FileService; +import com.fzzy.igds.gas.dto.GasData; +import com.fzzy.igds.gas.service.GasService; +import com.fzzy.igds.grain.dto.GrainData; +import com.fzzy.igds.grain.service.GrainService; import com.fzzy.igds.sys.CoreDeptService; import com.fzzy.igds.sys.DepotService; -import com.ruoyi.common.config.FrameworkConfig; +import com.fzzy.igds.sys.GranaryService; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.service.ISysUserService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.io.File; +import java.util.ArrayList; import java.util.List; /** @@ -37,7 +46,15 @@ private ScreenSerService screenSerService; @Resource private DepotService depotService; + @Resource + private GranaryService granaryService; + @Resource + private ISysUserService userService; + @Resource + private GrainService grainService; + @Resource + private GasService gasService; /** * 鏍规嵁鍗曚綅ID鑾峰彇鍗曚綅淇℃伅 @@ -77,7 +94,7 @@ * @param sid * @return */ - public List<Depot> getDepotsByGid(String sid) { + public List<HwkDepotDto> getDepotsByGid(String sid) { if(StringUtils.isEmpty(sid)){ return null; @@ -88,11 +105,61 @@ if(null == screenSer || StringUtils.isEmpty(screenSer.getAjdh())){ return null; } + Granary granary = granaryService.getGranaryById(screenSer.getAjdh()); + if(null == granary){ + return null; + } + List<Depot> list = depotService.getCacheByAjdn(screenSer.getCompanyId(), screenSer.getAjdh()); if(null == list || list.isEmpty()){ return null; } - return list; + List<HwkDepotDto> result = new ArrayList<>(); + HwkDepotDto hwkDepotDto; + for (Depot depot : list) { + hwkDepotDto = new HwkDepotDto(); + BeanUtils.copyProperties(depot, hwkDepotDto); + + hwkDepotDto.setGranaryName(granary.getAjmc()); + hwkDepotDto.setStoreKeeperName(StringUtils.isEmpty(depot.getStoreKeeperName())?"--":depot.getStoreKeeperName()); + hwkDepotDto.setFoodVarietyName(StringUtils.isEmpty(depot.getFoodVarietyName())?"--":depot.getFoodVarietyName()); + hwkDepotDto.setFoodTypeName(StringUtils.isEmpty(depot.getFoodTypeName())?"--":depot.getFoodTypeName()); + hwkDepotDto.setFoodLevelName(StringUtils.isEmpty(depot.getFoodLevelName())?"--":depot.getFoodLevelName()); + hwkDepotDto.setStorageReal(hwkDepotDto.getStorageReal()/1000); + + //鏌ヨ绮儏淇℃伅 + GrainData grainData = grainService.getCacheGrainDate(depot.getCompanyId(), depot.getId()); + if(null != grainData){ + hwkDepotDto.setInTemp(grainData.getTempIn() + ""); + hwkDepotDto.setInHumidity(grainData.getHumidityIn() + ""); + hwkDepotDto.setOutTemp(grainData.getTempOut() + ""); + hwkDepotDto.setOutHumidity(grainData.getHumidityOut() + ""); + hwkDepotDto.setMaxTemp(grainData.getTempMax() + ""); + hwkDepotDto.setMinTemp(grainData.getTempMin() + ""); + hwkDepotDto.setAveTemp(grainData.getTempAve() + ""); + hwkDepotDto.setGrainDate(grainData.getReceiveDate()); + + } + + //鏌ヨ姘斾綋淇℃伅 + GasData gasData = gasService.getCacheGrainDate(depot.getCompanyId(), depot.getId()); + if(null != gasData){ + hwkDepotDto.setPerO2(gasData.getPerO2() + ""); + hwkDepotDto.setPerPh3(gasData.getPerPh3() + ""); + hwkDepotDto.setPerCo2(gasData.getPerCo2() + ""); + hwkDepotDto.setGasDate(gasData.getReceiveDate()); + } + + //鏌ヨ淇濈鍛樹俊鎭� + if(StringUtils.isNotEmpty(depot.getStoreKeeper())){ + SysUser sysUser = userService.selectUserByLoginName(depot.getStoreKeeper()); + hwkDepotDto.setUserImgPath(StringUtils.isEmpty(sysUser.getAvatar())?"/img/dzhwk/imgl6.jpg":sysUser.getAvatar()); + hwkDepotDto.setStoreKeeperPhone(StringUtils.isEmpty(sysUser.getPhonenumber())?"--":sysUser.getPhonenumber()); + } + + result.add(hwkDepotDto); + } + return result; } } diff --git a/igds-dzhwk-web/src/main/java/com/fzzy/igds/init/SystemRunner.java b/igds-dzhwk-web/src/main/java/com/fzzy/igds/init/SystemRunner.java new file mode 100644 index 0000000..94eaa06 --- /dev/null +++ b/igds-dzhwk-web/src/main/java/com/fzzy/igds/init/SystemRunner.java @@ -0,0 +1,97 @@ +package com.fzzy.igds.init; + +import com.bstek.dorado.annotation.Expose; +import com.fzzy.igds.sys.*; +import com.ruoyi.system.domain.SysCompany; +import com.ruoyi.system.service.ISysCompanyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.CommandLineRunner; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 閰嶇疆绯荤粺绾у埆鐨勯」鐩惎鍔ㄥ垵濮嬪寲淇℃伅 + * + * @author Andy + */ +@Service +@Slf4j +@Order(value = 1) +public class SystemRunner implements CommandLineRunner { + + @Resource + private ISysCompanyService iSysCompanyService; + @Resource + private SysDeptService sysDeptService; + @Resource + private DicService dicService; + @Resource + private BuildingService buildingService; + @Resource + private DepotService depotService; + @Resource + private DepotConfService depotConfService; + @Resource + private SysConfService sysConfService; + + @Override + public void run(String... args) throws Exception { + //缁勭粐淇℃伅鏀惧叆缂撳瓨 + iSysCompanyService.resetCompanyCache(); + List<SysCompany> list = iSysCompanyService.selectAll(); + + for (SysCompany company : list) { + + flushCache(company.getCompanyId(), "绯荤粺璋冪敤"); + } + } + + /** + * 骞冲彴绯荤粺锛屾墜鍔ㄥ埛鏂版墍鏈夌紦瀛� + * <p> + * systemRunner#flushAllCache + * + * @param companyId + */ + @Expose + public void flushAllCache(String companyId) { + flushCache(companyId, "鎵嬪姩璋冪敤"); + } + + /** + * 鍒嗙粍缁囧垵濮嬪寲 + * + * @param companyId + * @param name + */ + public void flushCache(String companyId, String name) { + + //鍒濆鍖栫敤鎴烽儴闂ㄥ埌鍐呭瓨 + sysDeptService.initUserDeptMap(companyId); + + //鍒濆鍖栧父鐢ㄥ瓧鍏稿埌鍐呭瓨 + dicService.initDicMap(companyId); + + //鍒濆鍖栦粨鎴跨紦瀛� + buildingService.refreshCacheBuilding(companyId); + //鍒濆鍖栦粨搴撶紦瀛� + depotService.flushCache(companyId); + //鍙傛暟閰嶇疆 + depotConfService.flushConfCache(companyId); + //绯荤粺閰嶇疆 + sysConfService.flushCacheSysConf(companyId); + + log.info("* "); + log.info("* ========================"); + log.info("* "); + log.info("* 缁勭粐={}锛寋}鍒濆鍖栫紦瀛樺畬鎴愨�︹�︹�︹��", companyId, name); + log.info("* "); + log.info("* ========================"); + log.info("* "); + } + + +} diff --git a/igds-dzhwk-web/src/main/resources/static/dzhwk/dzhwk.js b/igds-dzhwk-web/src/main/resources/static/dzhwk/dzhwk.js index 0a39085..79daa55 100644 --- a/igds-dzhwk-web/src/main/resources/static/dzhwk/dzhwk.js +++ b/igds-dzhwk-web/src/main/resources/static/dzhwk/dzhwk.js @@ -1,173 +1,105 @@ +var linexData = ['06-01', '06-02', '06-03', '06-04', '06-05', '06-06', '06-07']; +var lineyData = [22, 23, 23, 23, 24, 25, 28]; +var lineyData2 = [16.5, 17.5, 18, 16.5, 18, 19, 21]; +var lineyData3 = [11, 12, 13, 10, 12, 13, 14]; $(document).ready(function () { - function initLineEchart(id, xData, yData, yData2, yData3) { - var echart = null - var dom = document.getElementById(id); - echart = echarts.init(dom); - var option = { - tooltip: { - trigger: 'axis', - }, - legend: { - right: '0', - top: '2%', - itemWidth: 12, - itemHeight: 12, - icon: 'circle', - textStyle: { - color: '#91ceff', - fontSize: 18, - paddingLeft: 5, - } - }, - grid: { - top: '15%', - left: '3%', - right: '0', - bottom: '3%', - containLabel: true - }, - xAxis: { - type: "category", - axisLine: { - show: true, - lineStyle: { - color: "rgba(255,255,255,.6)", - width: 1 - } - }, - axisTick: { - show: false - }, - axisLabel: { - show: true, - color: "#fff", - fontSize: 20, - }, - splitLine: { - show: false, - lineStyle: { - color: "rgba(255,255,255,.2)", - } - }, - data: xData - }, - yAxis: [{ - name: '(掳C)', - min: 0, - max: 40, - interval: 10, - nameTextStyle: { - color: 'rgba(145,206,255,.5)', - fontSize: 18, - padding: [0, 0, 5, -30] - }, - type: 'value', - axisTick: { - show: false - }, - axisLine: { - show: false, - }, - axisLabel: { - color: "#91ceff", //X杞存枃瀛楅鑹� - fontSize: 18, - }, - splitLine: { - show: true, - lineStyle: { - type: "dashed", - color: "rgba(255,255,255,.3)", - } - }, - }], - series: [{ - name: '绮珮娓�', - type: 'line', - symbol: 'none', - color: '#ffd12b', - lineStyle: { - width: 3 - }, - areaStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ - offset: 0, - color: 'rgba(255, 209, 43,0.3)' - }, - { - offset: 1, - color: 'rgba(255, 209, 43,0)' - }, - ]), - }, - label: { - show: false, - }, - data: yData, - }, - { - name: '绮潎娓�', - type: 'line', - symbol: 'none', - color: '#02afff', - lineStyle: { - width: 3 - }, - areaStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ - offset: 0, - color: 'rgba(2, 175, 255, .3)' - }, - { - offset: 1, - color: 'rgba(2, 175, 255,0)' - }, - ]), - }, - label: { - show: false, - }, - data: yData2, - }, - { - name: '绮綆娓�', - type: 'line', - symbol: 'none', - color: '#39ff02', - lineStyle: { - width: 3 - }, - areaStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ - offset: 0, - color: 'rgb(97,154,82)' - }, - { - offset: 1, - color: 'rgba(2, 175, 255,0)' - }, - ]), - }, - label: { - show: false, - }, - data: yData3, - }] - }; - if (option && typeof option === "object") { - echart.setOption(option, true); - } - } - var linexData = ['01', '02', '03', '04', '05', '06', '07']; - var lineyData = [22, 23, 23, 23, 24, 25, 28]; - var lineyData2 = [16.5, 17.5, 18, 16.5, 18, 19, 21]; - var lineyData3 = [11, 12, 13, 10, 12, 13, 14]; - initLineEchart('lineChart1', linexData, lineyData, lineyData2, lineyData3) - initLineEchart('lineChart2', linexData, lineyData, lineyData2, lineyData3) - initLineEchart('lineChart3', linexData, lineyData, lineyData2, lineyData3) - initLineEchart('lineChart4', linexData, lineyData, lineyData2, lineyData3) - initLineEchart('lineChart5', linexData, lineyData, lineyData2, lineyData3) - initLineEchart('lineChart6', linexData, lineyData, lineyData2, lineyData3) + var html = ""; + if(depotList){ + $.each(depotList, function (index, item) { + html += '<div class="swiper-slide"><div class="electron1"><div class="col-l"><div class="g-boxl1"><div class="g-titl1">璐т綅淇℃伅</div><ul class="ul-listl5">'; + html += '<li><div class="con"><div class="tit">'+item.name+'</div><div class="info">鍚嶇О</div></div></li>'; + html += '<li><div class="con"><div class="tit">'+item.depotStatusName+'</div><div class="info">璐т綅鐘舵��</div></div></li>'; + html += '<li><div class="con"><div class="tit">'+item.storageReal+'<em>t</em></div><div class="info">绮鍌ㄩ噺</div></div></li>'; + html += '<li><div class="con"><div class="tit">'+item.foodVarietyName+'</div><div class="info">绮鍝佺</div></div></li>'; + html += '<li><div class="con"><div class="tit">'+item.foodTypeName+'</div><div class="info">绮鎬ц川</div></div></li>'; + html += '<li><div class="con"><div class="tit">'+item.foodLevelName+'</div><div class="info">绮绛夌骇</div></div></li>'; + html += '<li><div class="con"><div class="tit">'+item.foodYear+'</div><div class="info">绮骞翠唤</div></div></li>'; + html += '<li><div class="con"><div class="tit">'+item.storeDate+'</div><div class="info">鍏ヤ粨鏃堕棿</div></div></li>'; + html += '<li><div class="con"><div class="tit">'+item.depotTypeName+'</div><div class="info">浠撴埧绫诲瀷</div></div></li></ul></div>'; + html += '<div class="g-boxl1 h378"><div class="g-titl1">绮儏涓夋俯鍥�</div><div class="m-chartl"><div class="chart" id="lineChart'+index+'"></div></div></div></div>'; + html += '<div class="col-c"><div class="g-boxl1"><div class="g-titl1">绮儏淇℃伅</div>'; + html += '<ul class="ul-listl6"><li><div class="con" style="background-color: rgba(3,77,146,.3);"><div class="icon"><img src="/img/dzhwk/iconl18.png" alt=""></div>'; + html += '<div class="rr"><div class="itm"><div class="info" style="background-color: rgba(18,110,112,.15);"><div class="num"><em>'+item.inTemp+'</em> 掳C</div><div class="tt">浠撳唴娓╁害</div></div></div>'; + html += '<div class="itm"><div class="info" style="background-color: rgba(255,255,255,.05);"><div class="num"><em>'+item.outTemp+'</em> 掳C</div><div class="tt">浠撳娓╁害</div></div></div></div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(91,104,225,.25);"><div class="icon"><img src="/img/dzhwk/iconl19.png" alt=""></div>'; + html += '<div class="rr"><div class="itm"><div class="info" style="background-color: rgba(18,110,112,.15);"><div class="num"><em>'+item.inHumidity+'</em> %</div><div class="tt">浠撳唴婀垮害</div></div></div>'; + html += '<div class="itm"><div class="info" style="background-color: rgba(255,255,255,.05);"><div class="num"><em>'+item.outHumidity+'</em> %</div><div class="tt">浠撳婀垮害</div></div></div></div></div></li></ul>'; + html += '<ul class="ul-listl5 styl3"><li><div class="con" style="background-color: rgba(254,139,76,.2);"><div class="tit">'+item.maxTemp+'<em>掳C</em></div><div class="info">绮珮娓�</div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(31,133,78,.15);"><div class="tit">'+item.aveTemp+'<em>掳C</em></div><div class="info">绮潎娓�</div></div></li>'; + html += '<li><div class="con"><div class="tit">'+item.minTemp+'<em>掳C</em></div><div class="info">绮綆娓�</div></div></li></ul><div class="date">'+item.grainDate+'</div></div>'; + html += '<div class="g-boxl1 h378"><div class="g-titl1">璐ㄦ淇℃伅</div><ul class="ul-listl5 styl2">'; + html += '<li><div class="con"><div class="tit">'+item.foodVarietyName+'</div><div class="info">绮鍝佺</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">妫�楠屼汉</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">妫�楠屾棩鏈�</div></div></li>'; + html += '<li><div class="con"><div class="tit">--%</div><div class="info">姘村垎</div></div></li>'; + html += '<li><div class="con"><div class="tit">--%</div><div class="info">鏉傝川</div></div></li>'; + html += '<li><div class="con"><div class="tit">--%</div><div class="info">涓嶅畬鍠勭被</div></div></li></ul></div></div>'; + html += '<div class="col-r"><div class="g-boxl1"><div class="g-titl1">姘斾綋淇℃伅</div><ul class="ul-listl3 styl2">'; + html += '<li><div class="con" style="background-color: rgba(3,77,146,.3);"><div class="icon"><img src="/img/dzhwk/iconl21.png" alt="">'; + html += '</div><div class="txt"><div class="num"><em>'+item.perPh3+'</em>ppm</div><div class="tt">纾峰寲姘�</div></div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(31,133,78,.15);"><div class="icon"><img src="/img/dzhwk/iconl20.png" alt="">'; + html += '</div><div class="txt"><div class="num"><em>'+item.perO2+'</em>%</div><div class="tt">姘ф皵</div></div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(91,104,225,.25);"><div class="icon"><img src="/img/dzhwk/iconl28.png" alt="">'; + html += '</div><div class="txt"><div class="num"><em>'+item.perCo2+'</em>ppm</div><div class="tt">浜屾哀鍖栫⒊</div></div></div></li><div class="date">'+item.gasDate+'</div></ul></div>'; + html += '<div class="g-boxl1 h378"><div class="g-titl1">淇濈鍛�</div><ul class="ul-intel styl2">'; + html += '<li><div class="con df-jb"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl23.png" alt=""></div>淇濈鍛�</div><div class="rr">'+item.storeKeeperName+'</div></div></li>'; + html += '<li><div class="con df-jb"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl24.png" alt=""></div>鐢佃瘽</div><div class="rr">'+item.storeKeeperPhone+'</div></div></li>'; + html += '<li><div class="con df-jb"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl26.png" alt=""></div>閮ㄩ棬</div><div class="rr">--</div></div></li>'; + html += '<li><div class="con df-jb"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl27.png" alt=""></div>鏈�杩戞墦鍗�</div><div class="rr">--</div></div></li></ul>'; + html += '</div></div></div></div>'; + }) + }else{ + html += '<div class="swiper-slide"><div class="electron1"><div class="col-l"><div class="g-boxl1"><div class="g-titl1">璐т綅淇℃伅</div><ul class="ul-listl5">'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">鍚嶇О</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">璐т綅鐘舵��</div></div></li>'; + html += '<li><div class="con"><div class="tit">--<em>t</em></div><div class="info">绮鍌ㄩ噺</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">绮鍝佺</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">绮鎬ц川</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">绮绛夌骇</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">绮骞翠唤</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">鍏ヤ粨鏃堕棿</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">浠撴埧绫诲瀷</div></div></li></ul></div>'; + html += '<div class="g-boxl1 h378"><div class="g-titl1">绮儏涓夋俯鍥�</div><div class="m-chartl"><div class="chart" id="lineChart1"></div></div></div></div>'; + html += '<div class="col-c"><div class="g-boxl1"><div class="g-titl1">绮儏淇℃伅</div>'; + html += '<ul class="ul-listl6"><li><div class="con" style="background-color: rgba(3,77,146,.3);"><div class="icon"><img src="/img/dzhwk/iconl18.png" alt=""></div>'; + html += '<div class="rr"><div class="itm"><div class="info" style="background-color: rgba(18,110,112,.15);"><div class="num"><em>--</em> 掳C</div><div class="tt">浠撳唴娓╁害</div></div></div>'; + html += '<div class="itm"><div class="info" style="background-color: rgba(255,255,255,.05);"><div class="num"><em>--</em> 掳C</div><div class="tt">浠撳娓╁害</div></div></div></div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(91,104,225,.25);"><div class="icon"><img src="/img/dzhwk/iconl19.png" alt=""></div>'; + html += '<div class="rr"><div class="itm"><div class="info" style="background-color: rgba(18,110,112,.15);"><div class="num"><em>--</em> %</div><div class="tt">浠撳唴婀垮害</div></div></div>'; + html += '<div class="itm"><div class="info" style="background-color: rgba(255,255,255,.05);"><div class="num"><em>--</em> %</div><div class="tt">浠撳婀垮害</div></div></div></div></div></li></ul>'; + html += '<ul class="ul-listl5 styl3"><li><div class="con" style="background-color: rgba(254,139,76,.2);"><div class="tit">--<em>掳C</em></div><div class="info">绮珮娓�</div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(31,133,78,.15);"><div class="tit">--<em>掳C</em></div><div class="info">绮潎娓�</div></div></li>'; + html += '<li><div class="con"><div class="tit">--<em>掳C</em></div><div class="info">绮綆娓�</div></div></li></ul></div>'; + html += '<div class="g-boxl1 h378"><div class="g-titl1">璐ㄦ淇℃伅</div><ul class="ul-listl5 styl2">'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">绮鍝佺</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">妫�楠屼汉</div></div></li>'; + html += '<li><div class="con"><div class="tit">--</div><div class="info">妫�楠屾棩鏈�</div></div></li>'; + html += '<li><div class="con"><div class="tit">--%</div><div class="info">姘村垎</div></div></li>'; + html += '<li><div class="con"><div class="tit">--%</div><div class="info">鏉傝川</div></div></li>'; + html += '<li><div class="con"><div class="tit">--%</div><div class="info">涓嶅畬鍠勭被</div></div></li></ul></div></div>'; + html += '<div class="col-r"><div class="g-boxl1"><div class="g-titl1">姘斾綋淇℃伅</div><ul class="ul-listl3 styl2">'; + html += '<li><div class="con" style="background-color: rgba(3,77,146,.3);"><div class="icon"><img src="/img/dzhwk/iconl21.png" alt="">'; + html += '</div><div class="txt"><div class="num"><em>--</em>ppm</div><div class="tt">纾峰寲姘�</div></div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(31,133,78,.15);"><div class="icon"><img src="/img/dzhwk/iconl20.png" alt="">'; + html += '</div><div class="txt"><div class="num"><em>--</em>%</div><div class="tt">姘ф皵</div></div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(91,104,225,.25);"><div class="icon"><img src="/img/dzhwk/iconl28.png" alt="">'; + html += '</div><div class="txt"><div class="num"><em>--</em>ppm</div><div class="tt">浜屾哀鍖栫⒊</div></div></div></li></ul></div>'; + html += '<div class="g-boxl1 h378"><div class="g-titl1">淇濈鍛�</div><ul class="ul-intel styl2">'; + html += '<li><div class="con df-jb"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl23.png" alt=""></div>淇濈鍛�</div><div class="rr">--</div></div></li>'; + html += '<li><div class="con df-jb"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl24.png" alt=""></div>鐢佃瘽</div><div class="rr">--</div></div></li>'; + html += '<li><div class="con df-jb"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl26.png" alt=""></div>閮ㄩ棬</div><div class="rr">--</div></div></li>'; + html += '<li><div class="con df-jb"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl27.png" alt=""></div>鏈�杩戞墦鍗�</div><div class="rr">--</div></div></li></ul>'; + html += '</div></div></div></div>'; + + initLineEchart('lineChart1', linexData, lineyData, lineyData2, lineyData3) + } + $("#depotList").html(html); + + //鍒濆鍖栦笁娓╁浘 + $.each(depotList, function (index, item) { + initLineEchart('lineChart' + index, linexData, lineyData, lineyData2, lineyData3); + }) var swiper = new Swiper('.m-swiperl2 .swiper', { slidesPerView: 1, @@ -175,7 +107,11 @@ // delay: 2500, // disableOnInteraction: false, // }, - // loop: true, + loop: true, + autoplay:{ + delay: 5000, + disableOnInteraction: false + }, pagination: { el: '.g-swbtnl .swiper-pagination', type: 'fraction', @@ -185,4 +121,163 @@ prevEl: '.g-swbtnl .swiper-button-prev', }, }); -}); \ No newline at end of file +}); + +function initLineEchart(id, xData, yData, yData2, yData3) { + var echart = null + var dom = document.getElementById(id); + echart = echarts.init(dom); + var option = { + tooltip: { + trigger: 'axis', + }, + legend: { + right: '0', + top: '2%', + itemWidth: 12, + itemHeight: 12, + icon: 'circle', + textStyle: { + color: '#91ceff', + fontSize: 18, + paddingLeft: 5, + } + }, + grid: { + top: '15%', + left: '3%', + right: '0', + bottom: '3%', + containLabel: true + }, + xAxis: { + type: "category", + axisLine: { + show: true, + lineStyle: { + color: "rgba(255,255,255,.6)", + width: 1 + } + }, + axisTick: { + show: false + }, + axisLabel: { + show: true, + color: "#fff", + fontSize: 20, + }, + splitLine: { + show: false, + lineStyle: { + color: "rgba(255,255,255,.2)", + } + }, + data: xData + }, + yAxis: [{ + name: '(掳C)', + min: 0, + max: 40, + interval: 10, + nameTextStyle: { + color: 'rgba(145,206,255,.5)', + fontSize: 18, + padding: [0, 0, 5, -30] + }, + type: 'value', + axisTick: { + show: false + }, + axisLine: { + show: false, + }, + axisLabel: { + color: "#91ceff", //X杞存枃瀛楅鑹� + fontSize: 18, + }, + splitLine: { + show: true, + lineStyle: { + type: "dashed", + color: "rgba(255,255,255,.3)", + } + }, + }], + series: [{ + name: '绮珮娓�', + type: 'line', + symbol: 'none', + color: '#ffd12b', + lineStyle: { + width: 3 + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: 'rgba(255, 209, 43,0.3)' + }, + { + offset: 1, + color: 'rgba(255, 209, 43,0)' + }, + ]), + }, + label: { + show: false, + }, + data: yData, + }, + { + name: '绮潎娓�', + type: 'line', + symbol: 'none', + color: '#02afff', + lineStyle: { + width: 3 + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: 'rgba(2, 175, 255, .3)' + }, + { + offset: 1, + color: 'rgba(2, 175, 255,0)' + }, + ]), + }, + label: { + show: false, + }, + data: yData2, + }, + { + name: '绮綆娓�', + type: 'line', + symbol: 'none', + color: '#39ff02', + lineStyle: { + width: 3 + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: 'rgb(97,154,82)' + }, + { + offset: 1, + color: 'rgba(2, 175, 255,0)' + }, + ]), + }, + label: { + show: false, + }, + data: yData3, + }] + }; + if (option && typeof option === "object") { + echart.setOption(option, true); + } +} \ No newline at end of file diff --git a/igds-dzhwk-web/src/main/resources/templates/dzhwk/dzhwk.html b/igds-dzhwk-web/src/main/resources/templates/dzhwk/dzhwk.html index c2f4f6a..4e89324 100644 --- a/igds-dzhwk-web/src/main/resources/templates/dzhwk/dzhwk.html +++ b/igds-dzhwk-web/src/main/resources/templates/dzhwk/dzhwk.html @@ -11,6 +11,15 @@ <link rel="stylesheet" th:href="@{/dzhwk/style.css}"/> <link rel="stylesheet" th:href="@{/dzhwk/swiper-bundle.min.css}"/> + <style> + .date{ + font-size: 16px; + line-height: 1.2em; + text-align: center; + overflow: hidden; + color: rgba(145, 206, 255, .5); + } + </style> </head> <body class=""> @@ -32,7 +41,7 @@ <div class="m-electronl"> <div class="m-swiperl2"> <div class="swiper"> - <div class="swiper-wrapper"> + <div class="swiper-wrapper" id="depotList"> <div class="swiper-slide"> <div class="electron1"> <div class="col-l"> @@ -1693,7 +1702,7 @@ </div> </div> <div class="electron2 g-boxl1"> - <div class="tit">璐т綅鍚嶇О<em id="depotName">P01-01</em></div> + <div class="tit">浠撳粧<em id="depotName" th:text="${name}">P01-01</em></div> <div class="g-swbtnl"> <div class="swiper-button-prev"></div> <div class="swiper-pagination"></div> @@ -1780,6 +1789,7 @@ <script th:src="@{/dzhwk/common.js}"></script> <script th:inline="javascript"> var flag = [[${flag}]]; + var depotList = [[${depotList}]]; //鐩戝惉鎿嶄綔 document.addEventListener('mousemove', resetTimeout); //榧犳爣绉诲姩 diff --git a/igds-dzhwk-web/src/main/resources/templates/dzhwk/index.html b/igds-dzhwk-web/src/main/resources/templates/dzhwk/index.html index 04fe01b..c194bba 100644 --- a/igds-dzhwk-web/src/main/resources/templates/dzhwk/index.html +++ b/igds-dzhwk-web/src/main/resources/templates/dzhwk/index.html @@ -1126,20 +1126,20 @@ var html = ""; if(depotList){ $.each(depotList, function (index, item) { - html += '<div class="swiper-slide"><div class="top"><div class="tit">璐т綅鍚嶇О <em>'+item.name+'</em></div><div class="store">浠撳粧--</div></div><ul class="ul-listl3">'; - html += '<li><div class="con" style="background-color: rgba(3,77,146,.3);"><div class="icon"><img src="/img/dzhwk/iconl18.png" alt=""></div><div class="txt"><div class="num"><em>--</em>掳C</div><div class="tt">浠撴俯</div></div></div></li>'; - html += '<li><div class="con" style="background-color: rgba(91,104,225,.25);"><div class="icon"><img src="/img/dzhwk/iconl19.png" alt=""></div><div class="txt"><div class="num"><em>--</em>%</div><div class="tt">浠撴箍</div></div></div></li>'; - html += '<li><div class="con" style="background-color: rgba(31,133,78,.15);"><div class="icon"><img src="/img/dzhwk/iconl20.png" alt=""></div><div class="txt"><div class="num"><em>--</em>%</div><div class="tt">姘ф皵</div></div></div></li>'; - html += '<li><div class="con" style="background-color: rgba(2,175,255,.15);"><div class="icon"><img src="/img/dzhwk/iconl21.png" alt=""></div><div class="txt"><div class="num"><em>--</em>ppm</div><div class="tt">纾峰寲姘�</div></div></div></li></ul>'; + html += '<div class="swiper-slide"><div class="top"><div class="tit">璐т綅鍚嶇О <em>'+item.name+'</em></div><div class="store">浠撳粧'+item.granaryName+'</div></div><ul class="ul-listl3">'; + html += '<li><div class="con" style="background-color: rgba(3,77,146,.3);"><div class="icon"><img src="/img/dzhwk/iconl18.png" alt=""></div><div class="txt"><div class="num"><em>'+item.inTemp+'</em>掳C</div><div class="tt">浠撴俯</div></div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(91,104,225,.25);"><div class="icon"><img src="/img/dzhwk/iconl19.png" alt=""></div><div class="txt"><div class="num"><em>'+item.inHumidity+'</em>%</div><div class="tt">浠撴箍</div></div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(31,133,78,.15);"><div class="icon"><img src="/img/dzhwk/iconl20.png" alt=""></div><div class="txt"><div class="num"><em>'+item.perO2+'</em>%</div><div class="tt">姘ф皵</div></div></div></li>'; + html += '<li><div class="con" style="background-color: rgba(2,175,255,.15);"><div class="icon"><img src="/img/dzhwk/iconl21.png" alt=""></div><div class="txt"><div class="num"><em>'+item.perPh3+'</em>ppm</div><div class="tt">纾峰寲姘�</div></div></div></li></ul>'; html += '<div class="m-infol"><div class="item"><div class="box" style="background-color: rgba(79,158,254,.23);"><ul class="ul-listl4">'; - html += '<li><div class="con"><div class="ll">璐т綅鍚嶇О</div><div class="rr">'+item.name+'</div></div></li><li><div class="con"><div class="ll">浠撴埧绫诲瀷</div><div class="rr">--</div></div></li>'; + html += '<li><div class="con"><div class="ll">璐т綅鍚嶇О</div><div class="rr">'+item.name+'</div></div></li><li><div class="con"><div class="ll">浠撴埧绫诲瀷</div><div class="rr">'+item.depotTypeName+'</div></div></li>'; html += '<li><div class="con"><div class="ll">璐т綅鐘舵��</div><div class="rr"><div class="btn g-statel"><div class="icon"><img src="/img/dzhwk/iconl22.png" alt=""></div>'+item.depotStatusName+'</div></div></div> </li>'; html += '<li><div class="con"><div class="ll">绮鍌ㄩ噺</div><div class="rr">'+item.storageReal+'鍚�</div></div></li><li><div class="con"><div class="ll">绮鍝佺</div><div class="rr">'+item.foodVarietyName+'</div></div></li>'; html += '<li><div class="con"><div class="ll">绮绛夌骇</div><div class="rr">'+item.foodLevelName+'</div></div></li><li><div class="con"><div class="ll">浠撳偍鎬ц川</div><div class="rr">'+item.foodTypeName+'</div> </div></li>'; html += '<li><div class="con"><div class="ll">鍏ヤ粨鏃堕棿</div><div class="rr">'+item.storeDate+'</div></div></li><li><div class="con"><div class="ll">绮骞翠唤</div><div class="rr">'+item.foodYear+'</div></div></li></ul>'; - html += '</div></div><div class="item"><div class="box" style="background-color: rgba(3,129,255,.23);"><div class="bgpic" style="background-image: url(/img/dzhwk/imgl5.jpg);"></div><div class="pic"><img src="/img/dzhwk/imgl6.jpg" alt=""></div>'; + html += '</div></div><div class="item"><div class="box" style="background-color: rgba(3,129,255,.23);"><div class="bgpic" style="background-image: url(/img/dzhwk/imgl5.jpg);"></div><div class="pic"><img src="'+item.userImgPath+'" alt=""></div>'; html += '<ul class="ul-intel"><li><div class="con"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl23.png" alt=""></div>淇濈鍛�</div><div class="rr">'+item.storeKeeperName+'</div></div></li>'; - html += '<li><div class="con"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl24.png" alt=""></div>鐢佃瘽</div><div class="rr">--</div></div></li></ul></div></div></div></div>'; + html += '<li><div class="con"><div class="ll"><div class="ico"><img src="/img/dzhwk/iconl24.png" alt=""></div>鐢佃瘽</div><div class="rr">'+item.storeKeeperPhone+'</div></div></li></ul></div></div></div></div>'; }) }else{ @@ -1168,7 +1168,7 @@ // }, loop: true, autoplay:{ - delay: 3000, + delay: 5000, disableOnInteraction: false }, pagination: { -- Gitblit v1.9.3