From 13b6ad41f0b057f8405f7976a990e9057547443a Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期一, 09 六月 2025 20:01:00 +0800 Subject: [PATCH] 提交首页实现 --- igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/ScreenSerRepository.java | 17 + igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Depot.java | 4 igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/HScreenSer.java | 27 + igds-dzhwk-view/src/main/java/com/fzzy/igds/dzhwk/ScreenSer.view.xml | 6 igds-dzhwk-web/src/main/resources/templates/dzhwk/index.html | 46 ++++ igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DoorRecord.java | 107 ++++++++++ igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/HwkDepotDto.java | 67 ++++++ igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/DepotService.java | 24 ++ igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java | 24 + igds-dzhwk-web/src/main/resources/static/dzhwk/common.js | 2 igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/AiAnalysis.java | 76 +++++++ igds-dzhwk-view/src/main/java/com/fzzy/igds/dzhwk/pr/ScreenSerPR.java | 12 igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/PatrolTask.java | 75 +++++++ igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java | 36 +++ igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/ScreenSerService.java | 24 + 15 files changed, 506 insertions(+), 41 deletions(-) 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 new file mode 100644 index 0000000..3432c58 --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/data/HwkDepotDto.java @@ -0,0 +1,67 @@ +package com.fzzy.igds.dzhwk.data; + +import com.bstek.dorado.annotation.PropertyDef; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 璐т綅鍗′俊鎭�-灏佽 + * @Author CZT + * @Date 2025/06/06 15:39 + */ +@Data +public class HwkDepotDto implements Serializable { + + @PropertyDef(label = "寤掗棿鍚�") + private String granary; + + @PropertyDef(label = "璐т綅鍚�") + private String depot; + + @PropertyDef(label = "浠撴俯") + private Double inTemp; + + @PropertyDef(label = "浠撴箍") + private Double inHumidity; + + @PropertyDef(label = "姘ф皵") + private String perO2; + + @PropertyDef(label = "纾峰寲姘�") + private String perPh3; + + @PropertyDef(label = "浠撳簱绫诲瀷") + private String depotType; + + @PropertyDef(label = "浠撳簱鐘舵��") + private String depotStatus; + + @PropertyDef(label = "绮鍝佺") + private String foodVariety; + + @PropertyDef(label = "绮绛夌骇") + private String foodLevel; + + @PropertyDef(label = "绮鎬ц川") + private String foodType; + + @PropertyDef(label = "鍏ュ簱鏃堕棿") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date storeDate; + + @PropertyDef(label = "绮骞翠唤") + private String foodYear; + + @PropertyDef(label = "淇濈鍛�", description = "涓枃鍚嶇О") + private String storeKeeperName; + + @PropertyDef(label = "淇濈鍛樼數璇�") + private String storeKeeperPhone = "---"; + + @PropertyDef(label = "淇濈鍛樺ご鍍忚矾寰�") + private String userImgPath; + +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/AiAnalysis.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/AiAnalysis.java new file mode 100644 index 0000000..89322db --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/AiAnalysis.java @@ -0,0 +1,76 @@ +package com.fzzy.igds.dzhwk.domain; + +import com.bstek.dorado.annotation.PropertyDef; +import lombok.Data; +import org.apache.commons.lang3.time.DateFormatUtils; +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * @Description AI鍐崇瓥鍒嗘瀽 + * @Author CZT + * @Date 2025/6/06 10:59 + */ +@Data +@Entity +@Table(name = "H_AI_ANALYSIS") +public class AiAnalysis implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public static String SORT_PROP = "id"; + + @Id + @Column(name = "ID_") + private String id; + + @Column(name = "COMPANY_ID_", length = 10) + @PropertyDef(label = "缁勭粐缂栫爜") + private String companyId; + + @Column(name = "DEPT_ID_", length = 30) + @PropertyDef(label = "鎵�灞炲垎搴�") + private String deptId; + + @Column(name = "DEPOT_ID_", length = 50) + @PropertyDef(label = "鎵�灞炰粨搴�") + private String depotId; + + @Column(name = "TYPE_", length = 50) + @PropertyDef(label = "鍒嗘瀽绫诲瀷", description = "01-绮儏鍒嗘瀽锛�02-浣滀笟鍒嗘瀽锛�03-鍏朵粬") + private String type; + + @Column(name = "MODE_", length = 50) + @PropertyDef(label = "鍒嗘瀽鏂瑰紡", description = "01-绮儏澶ф暟鎹姣旓紝02-浣滀笟鏁版嵁瀵规瘮锛�03-鍏朵粬") + private String mode; + + @Column(name = "TIME_") + @PropertyDef(label = "鍒嗘瀽鏃堕棿") + private Date time; + + @Column(name = "RESULT_", length = 50) + @PropertyDef(label = "鍒嗘瀽缁撴灉") + private String result; + + @Column(name = "INFO_", length = 254) + @PropertyDef(label = "鍒嗘瀽璇︽儏") + private String info; + + @Column(name = "UPDATE_TIME_") + @PropertyDef(label = "鏇存柊鏃堕棿") + private Date updateTime; + + @Transient + private String timeStr; + + public String getTimeStr() { + if(null == this.time){ + return ""; + } + return DateFormatUtils.format(this.time, "yy-MM-dd HH:mm"); + } +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Depot.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Depot.java index 01d7ce0..95c4c95 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Depot.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Depot.java @@ -182,6 +182,10 @@ @PropertyDef(label = "淇濈鍛樼瓑绾�") private String storeKeeperPhone = "####"; + @Transient + @PropertyDef(label = "淇濈鍛樺ご鍍忚矾寰�") + private String userImgPath; + public String getFoodLevelName() { if (null != this.foodLevel) { return FoodLevel.getMsg(this.foodLevel); diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DoorRecord.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DoorRecord.java new file mode 100644 index 0000000..65a093e --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/DoorRecord.java @@ -0,0 +1,107 @@ +package com.fzzy.igds.dzhwk.domain; + +import com.bstek.dorado.annotation.PropertyDef; +import com.ruoyi.common.utils.StringUtils; +import lombok.Data; +import org.apache.commons.lang3.time.DateFormatUtils; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 闂ㄧ璁板綍 + * @Author CZT + * @Date 2025/6/06 09:23 + */ +@Data +@Entity +@Table(name = "H_DOOR_RECORD") +public class DoorRecord implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public static String SORT_PROP = "id"; + + @Id + @Column(name = "ID_") + private String id; + + @Column(name = "COMPANY_ID_", length = 10) + @PropertyDef(label = "缁勭粐缂栫爜") + private String companyId; + + @Column(name = "DEPT_ID_", length = 30) + @PropertyDef(label = "鎵�灞炲垎搴�") + private String deptId; + + @Column(name = "DEPOT_ID_", length = 50) + @PropertyDef(label = "鎵�灞炰粨搴�", description = "浠撳簱缂栧彿") + private String depotId; + + @Column(name = "DOOR_ID_", length = 50) + @PropertyDef(label = "闂ㄧ璁惧ID") + private String doorId; + + @Column(name = "USER_NAME_", length = 30) + @PropertyDef(label = "寮�闂ㄤ汉") + private String userName; + + @Column(name = "DOOR_TYPE_", length = 10) + @PropertyDef(label = "寮�闂ㄦ柟寮�", description = "01-鍒峰崱锛�02-鎸囩汗璇嗗埆锛�03-浜鸿劯璇嗗埆锛�04-瀵嗙爜杈撳叆锛�05-杩滅▼鎺堟潈锛�09-鍏朵粬") + private String doorType; + + @Column(name = "TIME_") + @PropertyDef(label = "寮�闂ㄦ椂闂�") + private Date time; + + @Column(name = "INFO_", length = 100) + @PropertyDef(label = "寮�闂ㄨ鏄�") + private String info; + + @Column(name = "IS_NORMAL", length = 10) + @PropertyDef(label = "鏄惁姝e父寮�闂�", description = "01-姝e父锛�02-璀﹀憡") + private String isNormal; + + @Column(name = "UPDATE_TIME_") + @PropertyDef(label = "鏇存柊鏃堕棿") + private Date updateTime; + + @Transient + private String doorTypeName; + + @Transient + private String timeStr; + + public String getTimeStr() { + if(null == this.time){ + return ""; + } + return DateFormatUtils.format(this.time, "MM/dd HH:mm"); + } + + public String getDoorTypeName() { + if(StringUtils.isEmpty(doorType)){ + return "鍏朵粬"; + } + if("01".equals(doorType)){ + return "鍒峰崱"; + } + if("02".equals(doorType)){ + return "鎸囩汗璇嗗埆"; + } + if("03".equals(doorType)){ + return "浜鸿劯璇嗗埆"; + } + if("04".equals(doorType)){ + return "瀵嗙爜杈撳叆"; + } + if("05".equals(doorType)){ + return "杩滅▼鎺堟潈"; + } + return "鍏朵粬"; + } +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/ScreenSer.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/HScreenSer.java similarity index 66% rename from igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/ScreenSer.java rename to igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/HScreenSer.java index 250ca35..76210b4 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/ScreenSer.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/HScreenSer.java @@ -1,6 +1,7 @@ package com.fzzy.igds.dzhwk.domain; import com.bstek.dorado.annotation.PropertyDef; +import com.fzzy.igds.dzhwk.constant.Constant; import lombok.Data; import javax.persistence.Column; import javax.persistence.Entity; @@ -17,14 +18,14 @@ @Data @Entity @Table(name = "H_SCREEN_SER") -public class ScreenSer implements Serializable { +public class HScreenSer implements Serializable { - public static String SORT_PROP = "id"; + public static String SORT_PROP = "sn"; @Id - @PropertyDef(label = "涓婚敭ID") - @Column(name = "ID_", length = 40) - private String id; + @PropertyDef(label = "璐т綅鍗N") + @Column(name = "SN_", length = 100) + private String sn; @Column(name = "COMPANY_ID_", length = 10) @PropertyDef(label = "缁勭粐缂栫爜") @@ -34,10 +35,6 @@ @PropertyDef(label = "鎵�灞炲垎搴�") private String deptId; - @PropertyDef(label = "璐т綅鍗N") - @Column(name = "SN_", length = 100) - private String sn; - @PropertyDef(label = "璁惧鍚嶇О") @Column(name = "NAME_", length = 100) private String name; @@ -46,6 +43,18 @@ @Column(name = "ajdh", length = 25) private String ajdh; + @PropertyDef(label = "鏄惁寮�鍚�", description = "闂ㄥ紑鐏寒") + @Column(name = "IS_OPEN1_", length = 25) + private String isOpen1 = Constant.YN_Y; + + @PropertyDef(label = "鏄惁寮�鍚�", description = "闂ㄥ叧绛夌伃") + @Column(name = "IS_OPEN2_", length = 25) + private String isOPen2 = Constant.YN_Y; + + @PropertyDef(label = "鏄惁寮�鍚�", description = "瀹夊叏杩涗粨鎻愰啋") + @Column(name = "IS_OPEN3", length = 25) + private String isOpen3 = Constant.YN_Y; + @Column(name = "REMARK_", length = 200) @PropertyDef(label = "澶囨敞", description = "澶囨敞淇℃伅") private String remark; diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/PatrolTask.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/PatrolTask.java new file mode 100644 index 0000000..f0ffcd2 --- /dev/null +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/PatrolTask.java @@ -0,0 +1,75 @@ +package com.fzzy.igds.dzhwk.domain; + +import com.bstek.dorado.annotation.PropertyDef; +import lombok.Data; +import org.apache.commons.lang3.time.DateFormatUtils; + +import javax.persistence.*; +import java.util.Date; + +/** + * @Description 宸℃浠诲姟 + */ +@Data +@Entity +@Table(name = "H_PATROL_TASK") +public class PatrolTask { + + public static String SORT_PROP = "id"; + + @Id + @Column(name = "ID_", length = 40) + @PropertyDef(label = "涓婚敭ID") + private String id; + + @Column(name = "COMPANY_ID_", length = 20) + @PropertyDef(label = "缁勭粐缂栫爜", description = "") + private String companyId; + + @Column(name = "DEPT_ID_", length = 50) + @PropertyDef(label = "鎵�灞炲簱鍖�") + private String deptId; + + @Column(name = "TYPE_", length = 50) + @PropertyDef(label = "宸℃绫诲瀷") + private String type; + + @Column(name = "CHECK_USER_", length = 50) + @PropertyDef(label = "宸℃浜�") + private String checkUser; + + @Column(name = "CHECK_TIME_") + @PropertyDef(label = "宸℃鏃堕棿") + private Date checkTime; + + @Column(name = "LOCATION_", length = 50) + @PropertyDef(label = "宸℃浣嶇疆") + private String location; + + @Column(name = "FILE_ID_", length = 30) + @PropertyDef(label = "宸℃浜虹収鐗噄d") + private String fileId; + + @Column(name = "FILE_NAME_", length = 50) + @PropertyDef(label = "宸℃浜虹収鐗�") + private String fileName; + + @Column(name = "INFO_", length = 200) + @PropertyDef(label = "宸℃璇存槑") + private String info; + + @Column(name = "REMARK_", length = 250) + @PropertyDef(label = "澶囨敞", description = "澶囨敞淇℃伅") + private String remark; + + @Transient + @PropertyDef(label = "宸℃鏃堕棿", description = "鏇存柊鏃堕棿锛歽yyy-MM-dd HH:mm") + private String checkTimeStr; + + public String getCheckTimeStr() { + if(null == this.checkTime){ + return ""; + } + return DateFormatUtils.format(this.checkTime, "yy/MM/dd HH:mm"); + } +} diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/ScreenSerService.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/ScreenSerService.java index b1c1774..83bb8fc 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/ScreenSerService.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/ScreenSerService.java @@ -1,9 +1,7 @@ package com.fzzy.igds.dzhwk.service; -import com.fzzy.igds.dzhwk.domain.Granary; -import com.fzzy.igds.dzhwk.domain.ScreenSer; +import com.fzzy.igds.dzhwk.domain.HScreenSer; import com.fzzy.igds.dzhwk.service.repository.ScreenSerRepository; -import com.fzzy.igds.sys.repository.GranaryRepository; import com.fzzy.igds.util.ContextUtil; import com.ruoyi.common.utils.StringUtils; import lombok.extern.slf4j.Slf4j; @@ -25,7 +23,7 @@ @Resource private ScreenSerRepository screenSerRepository; - public List<ScreenSer> listData(String companyId, String deptId) { + public List<HScreenSer> listData(String companyId, String deptId) { if (StringUtils.isEmpty(companyId)) { companyId = ContextUtil.getCompanyId(); @@ -36,21 +34,33 @@ return screenSerRepository.listData(companyId, deptId); } - public void saveOrUpdate(ScreenSer data) { + /** + * + * @param sn + * @return + */ + public HScreenSer getDataBySn(String sn) { + if(StringUtils.isEmpty(sn)){ + return null; + } + return screenSerRepository.getDataBySn(sn); + } + + public void saveOrUpdate(HScreenSer data) { if (StringUtils.isEmpty(data.getCompanyId())) { data.setCompanyId(ContextUtil.getCompanyId()); } if (StringUtils.isEmpty(data.getDeptId())) { data.setDeptId(ContextUtil.subDeptId(null)); } - if (StringUtils.isEmpty(data.getId())) { + if (StringUtils.isEmpty(data.getSn())) { data.setDeptId(ContextUtil.getUUID()); } data.setUpdateTime(new Date()); screenSerRepository.save(data); } - public String delData(ScreenSer data) { + public String delData(HScreenSer data) { screenSerRepository.delete(data); return null; } diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/ScreenSerRepository.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/ScreenSerRepository.java index 1923d78..e8f4c30 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/ScreenSerRepository.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/service/repository/ScreenSerRepository.java @@ -1,6 +1,6 @@ package com.fzzy.igds.dzhwk.service.repository; -import com.fzzy.igds.dzhwk.domain.ScreenSer; +import com.fzzy.igds.dzhwk.domain.HScreenSer; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; @@ -13,7 +13,7 @@ * @Date 2025/06/03 17:45 */ @Service -public interface ScreenSerRepository extends JpaRepository<ScreenSer, String> { +public interface ScreenSerRepository extends JpaRepository<HScreenSer, String> { /** * 鏍规嵁缁勭粐缂栫爜鍜屽簱鍖虹紪鐮佽幏鍙栧粧闂翠俊鎭� @@ -22,7 +22,16 @@ * @param deptId * @return */ - @Query("from ScreenSer where companyId =:companyId and deptId =:deptId order by ajdh") - List<ScreenSer> listData(@Param("companyId") String companyId, @Param("deptId") String deptId); + @Query("from HScreenSer where companyId =:companyId and deptId =:deptId order by ajdh") + List<HScreenSer> listData(@Param("companyId") String companyId, @Param("deptId") String deptId); + + /** + * 鏍规嵁缁勭粐缂栫爜鍜屽簱鍖虹紪鐮佽幏鍙栧粧闂翠俊鎭� + * + * @param sn + * @return + */ + @Query("from HScreenSer where sn =:sn") + HScreenSer getDataBySn(@Param("sn") String sn); } diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/DepotService.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/DepotService.java index 032dc06..0c688bb 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/DepotService.java +++ b/igds-dzhwk-core/src/main/java/com/fzzy/igds/sys/DepotService.java @@ -261,6 +261,30 @@ } /** + * 鏍规嵁褰撳墠寤掗棿缂栫爜鑾峰彇涓嬪睘鎵�鏈変粨搴撲俊鎭� + * @param companyId + * @param ajdh + * @return + */ + public List<Depot> getCacheByAjdn(String companyId, String ajdh) { + //鑻ヤ粨搴撴湭閰嶇疆浠撴埧缂栫爜锛屽垯鐩存帴杩斿洖瀵瑰簲浠撳簱 + List<Depot> list = getCacheDepotList(companyId); + + if(null == list || list.isEmpty()){ + return null; + } + List<Depot> result = new ArrayList<>(); + for (Depot depot : list) { + if (StringUtils.isNotEmpty(depot.getGranaryId()) && ajdh.equals(depot.getGranaryId())) { + result.add(depot); + } + } + //閲嶆柊鎺掑簭 + Collections.sort(result, (p1, p2) -> p1.getOrderNum() - p2.getOrderNum()); + return result; + } + + /** * 鏍规嵁搴撳瓨淇℃伅鏇存柊浠撳簱淇℃伅 * @param data */ diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/dzhwk/ScreenSer.view.xml b/igds-dzhwk-view/src/main/java/com/fzzy/igds/dzhwk/ScreenSer.view.xml index 5cbfdc6..4aca4bf 100644 --- a/igds-dzhwk-view/src/main/java/com/fzzy/igds/dzhwk/ScreenSer.view.xml +++ b/igds-dzhwk-view/src/main/java/com/fzzy/igds/dzhwk/ScreenSer.view.xml @@ -4,11 +4,7 @@ <Context/> <Model> <DataType name="dtMain"> - <Property name="creationType">com.fzzy.igds.dzhwk.domain.ScreenSer</Property> - <PropertyDef name="id"> - <Property></Property> - <Property name="label">涓婚敭ID</Property> - </PropertyDef> + <Property name="creationType">com.fzzy.igds.dzhwk.domain.HScreenSer</Property> <PropertyDef name="companyId"> <Property></Property> <Property name="label">缁勭粐缂栫爜</Property> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/dzhwk/pr/ScreenSerPR.java b/igds-dzhwk-view/src/main/java/com/fzzy/igds/dzhwk/pr/ScreenSerPR.java index e4d5cd6..bdf05ed 100644 --- a/igds-dzhwk-view/src/main/java/com/fzzy/igds/dzhwk/pr/ScreenSerPR.java +++ b/igds-dzhwk-view/src/main/java/com/fzzy/igds/dzhwk/pr/ScreenSerPR.java @@ -3,7 +3,7 @@ import com.bstek.dorado.annotation.DataProvider; import com.bstek.dorado.annotation.DataResolver; import com.bstek.dorado.annotation.Expose; -import com.fzzy.igds.dzhwk.domain.ScreenSer; +import com.fzzy.igds.dzhwk.domain.HScreenSer; import com.fzzy.igds.dzhwk.service.ScreenSerService; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; @@ -26,7 +26,7 @@ * @return */ @DataProvider - public List<ScreenSer> listData() { + public List<HScreenSer> listData() { return screenSerService.listData(null, null); } @@ -36,8 +36,8 @@ * @param data */ @DataResolver - public void saveData(ScreenSer data) { - ScreenSer item = new ScreenSer(); + public void saveData(HScreenSer data) { + HScreenSer item = new HScreenSer(); BeanUtils.copyProperties(data, item); screenSerService.saveOrUpdate(item); } @@ -48,8 +48,8 @@ * @param data */ @Expose - public String delData(ScreenSer data){ - ScreenSer item = new ScreenSer(); + public String delData(HScreenSer data){ + HScreenSer item = new HScreenSer(); BeanUtils.copyProperties(data, item); return screenSerService.delData(item); } 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 24533a2..596636f 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,6 +1,6 @@ package com.fzzy.igds.dzhwk.controller; -import com.fzzy.igds.dzhwk.data.DzhwkConfigData; +import com.fzzy.igds.dzhwk.domain.Depot; import com.fzzy.igds.dzhwk.domain.Dept; import com.fzzy.igds.dzhwk.manager.WebManager; import com.ruoyi.common.utils.StringUtils; @@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import javax.annotation.Resource; +import java.util.List; /** * @Description @@ -22,21 +23,30 @@ private static final String prefix = "dzhwk/"; @Resource - private DzhwkConfigData dzhwkConfigData; - @Resource private WebManager webManager; /** * 棣栭〉 - * @param gid 寤掗棿id + * @param sid 璐т綅鍗¤澶嘢N * @param view * @return */ @RequestMapping("/index") - public String index(@RequestParam(value = "gid", required = false) String gid, ModelMap view) { + public String index(@RequestParam(value = "sid", required = false) String sid, ModelMap view) { - String videoUrl = dzhwkConfigData.getDzhwkVideo().replace(dzhwkConfigData.getProfile(),"/profile/"); - view.put("videoUrl", videoUrl); + //鑾峰彇搴撳尯淇℃伅锛屾煡鐪嬭棰戣矾寰勫拰楦熺灠鍥捐矾寰� + Dept dept = webManager.getDeptFile("1000001001"); + view.put("videoUrl", dept.getVideoFilePath()); + view.put("imgUrl", dept.getImgFilePath()); + + //鏍规嵁璐т綅鍗N锛岃幏鍙栧搴斿粧闂翠笅鐨勮揣浣嶅垪琛ㄤ俊鎭� + if(StringUtils.isEmpty(sid)){ + sid = "FZZY0001"; + } + List<Depot> list = webManager.getDepotsByGid(sid); + view.put("depotList", list); + + view.put("flag", "index"); return prefix + "index"; } 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 eb2ead8..ac83aa2 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 @@ -1,9 +1,14 @@ package com.fzzy.igds.dzhwk.manager; import com.fzzy.igds.dzhwk.data.DzhwkConfigData; +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.HScreenSer; +import com.fzzy.igds.dzhwk.service.ScreenSerService; import com.fzzy.igds.file.FileService; import com.fzzy.igds.sys.CoreDeptService; +import com.fzzy.igds.sys.DepotService; import com.ruoyi.common.config.FrameworkConfig; import com.ruoyi.common.utils.StringUtils; import lombok.extern.slf4j.Slf4j; @@ -11,6 +16,7 @@ import javax.annotation.Resource; import java.io.File; +import java.util.List; /** * @Description @@ -27,6 +33,12 @@ private FileService fileService; @Resource private DzhwkConfigData dzhwkConfigData; + @Resource + private ScreenSerService screenSerService; + @Resource + private DepotService depotService; + + /** * 鏍规嵁鍗曚綅ID鑾峰彇鍗曚綅淇℃伅 * @@ -59,4 +71,28 @@ } return dept; } + + /** + * + * @param sid + * @return + */ + public List<Depot> getDepotsByGid(String sid) { + + if(StringUtils.isEmpty(sid)){ + return null; + } + //鑾峰彇sid瀵瑰簲鐨勫粧闂翠俊鎭紱 + HScreenSer screenSer = screenSerService.getDataBySn(sid); + + if(null == screenSer || StringUtils.isEmpty(screenSer.getAjdh())){ + return null; + } + List<Depot> list = depotService.getCacheByAjdn(screenSer.getCompanyId(), screenSer.getAjdh()); + if(null == list || list.isEmpty()){ + return null; + } + + return list; + } } diff --git a/igds-dzhwk-web/src/main/resources/static/dzhwk/common.js b/igds-dzhwk-web/src/main/resources/static/dzhwk/common.js index 115e556..3b77062 100644 --- a/igds-dzhwk-web/src/main/resources/static/dzhwk/common.js +++ b/igds-dzhwk-web/src/main/resources/static/dzhwk/common.js @@ -8,7 +8,7 @@ console.log('鐢ㄦ埛娌℃湁鎿嶄綔'); // 濡傛灉娌℃湁鎿嶄綔瓒呰繃1鍒嗛挓锛岃烦杞埌閿佸睆椤甸潰 window.location.href = "../dzhwk/lock?flag=" + flag; - }, 1000*60); // 1鍒嗛挓 + }, 1000*60*60); // 1鍒嗛挓 } /** 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 b1f9ca4..04fe01b 100644 --- a/igds-dzhwk-web/src/main/resources/templates/dzhwk/index.html +++ b/igds-dzhwk-web/src/main/resources/templates/dzhwk/index.html @@ -110,7 +110,7 @@ <div class="videobox"> <!-- <video src="http://player.alicdn.com/video/aliyunmedia.mp4" class="img"--> <video th:src="${videoUrl}" style="width: 100%;height: 100%;" - poster="/img/dzhwk/imgl4.jpg" muted preload controls + th:poster="${imgUrl}" muted preload controls webkit-playsinline="true" playsinline="true">鎮ㄧ殑娴忚鍣ㄤ笉鏀寔video鏍囩 </video> </div> @@ -176,7 +176,7 @@ <div class="col-r g-boxl1"> <div class="m-swiperl1"> <div class="swiper"> - <div class="swiper-wrapper"> + <div class="swiper-wrapper" id="depotList"> <div class="swiper-slide"> <div class="top"> <div class="tit">璐т綅鍚嶇О <em>P01-01</em></div> @@ -1122,6 +1122,44 @@ <script th:src="@{/dzhwk/common.js}"></script> <script th:inline="javascript"> var flag = [[${flag}]]; + var depotList = [[${depotList}]]; + 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="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"><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 += '<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>'; + + }) + }else{ + html += '<div class="swiper-slide"><div class="top"><div class="tit">璐т綅鍚嶇О <em>--</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="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">--</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"><div class="btn g-statel"><div class="icon"><img src="/img/dzhwk/iconl22.png" alt=""></div>--</div></div></div> </li>'; + html += '<li><div class="con"><div class="ll">绮鍌ㄩ噺</div><div class="rr">--鍚�</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">--</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">--</div></div></li><li><div class="con"><div class="ll">绮骞翠唤</div><div class="rr">--</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 += '<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">--</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>'; + } + $("#depotList").html(html); + var swiper = new Swiper('.m-swiperl1 .swiper', { slidesPerView: 1, // autoplay: { @@ -1129,6 +1167,10 @@ // disableOnInteraction: false, // }, loop: true, + autoplay:{ + delay: 3000, + disableOnInteraction: false + }, pagination: { el: '.m-swiperl1 .swiper-pagination', type: 'fraction', -- Gitblit v1.9.3