From 5755eb05d809d9f298217c4a08ac8dc96d9b4873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E4=BC=9F?= Date: Thu, 21 Nov 2024 10:15:55 +0800 Subject: [PATCH] =?UTF-8?q?2,3,5=E6=A5=BC=E7=94=9F=E4=BA=A7=E7=9C=8B?= =?UTF-8?q?=E6=9D=BF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FifthMesBorderController.java | 32 +++++ .../controller/SecondMesBorderController.java | 74 ++++++++++ .../controller/ThirdMesBorderController.java | 62 ++++++++ .../domain/DmsRealtimeStatusHistory.java | 123 ++++++++++++++++ .../com/hw/mes/board/domain/RawAmount.java | 13 ++ .../mes/board/domain/RecordIotenvInstant.java | 24 ++++ .../board/service/FifthMesBorderService.java | 14 ++ .../board/service/SecondMesBorderService.java | 28 ++++ .../board/service/ThirdMesBorderService.java | 24 ++++ .../impl/FifthMesBoardServiceImpl.java | 27 ++++ .../impl/SecondMesBoardServiceImpl.java | 55 ++++++++ .../impl/ThirdMesBorderServiceImpl.java | 64 +++++++++ .../hw/mes/mapper/MesProductOrderMapper.java | 34 +++++ .../mapper/mes/MesProductOrderMapper.xml | 133 ++++++++++++++++++ 14 files changed, 707 insertions(+) create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FifthMesBorderController.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/SecondMesBorderController.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/ThirdMesBorderController.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/DmsRealtimeStatusHistory.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RawAmount.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RecordIotenvInstant.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FifthMesBorderService.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/SecondMesBorderService.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/ThirdMesBorderService.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FifthMesBoardServiceImpl.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/SecondMesBoardServiceImpl.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/ThirdMesBorderServiceImpl.java diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FifthMesBorderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FifthMesBorderController.java new file mode 100644 index 0000000..e7a0555 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FifthMesBorderController.java @@ -0,0 +1,32 @@ +package com.hw.mes.board.controller; + +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.mes.board.service.FifthMesBorderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/fifthMesBorder") +public class FifthMesBorderController { + + @Autowired + private FifthMesBorderService fifthMesBorderService; + + /** + * 五楼生产进度 + */ + @GetMapping("/productProgress") + public AjaxResult productProgress(){ + return AjaxResult.success(fifthMesBorderService.productProgress()); + } + /** + * 工单生产进度 + */ + @GetMapping("/workOrderProgress") + public AjaxResult workOrderProgress(){ + return AjaxResult.success(fifthMesBorderService.workOrderProgress()); + } + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/SecondMesBorderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/SecondMesBorderController.java new file mode 100644 index 0000000..1c1f531 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/SecondMesBorderController.java @@ -0,0 +1,74 @@ +package com.hw.mes.board.controller; + + +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.mes.board.service.SecondMesBorderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/SecondMesBorder") +public class SecondMesBorderController { + @Autowired + private SecondMesBorderService secondBorderService; + + /** + * 查询近一个月的工单数据 + */ + @GetMapping("selectOrderMonth") + public AjaxResult selectOrderMonth(){ + return AjaxResult.success(secondBorderService.selectOrderMonth()); + } + + /** + * 查询最近一条工单的完成情况 + */ + @GetMapping("/selectLatestWorkOrder") + public AjaxResult selectLatestWorkOrder(){ + return AjaxResult.success(secondBorderService.selectLatestWorkOrder()); + } + + /** + * 获取二楼风机状态 + * @return + */ + @GetMapping("/getLineStatus") + public AjaxResult getLineStatus(){ + return AjaxResult.success(secondBorderService.getLineStatus()); + } + + /** + * 获取近6小时每小时产量 + * @return + */ + @GetMapping("/getHourProduction") + public AjaxResult getHourProduction(){ + return AjaxResult.success(secondBorderService.getHourProduction()); + } + /** + * 获取近7天的产量 + */ + @GetMapping("/getDayProduction") + public AjaxResult getDayProduction(){ + return AjaxResult.success(secondBorderService.getDayProduction()); + } + /** + * 粉尘数据走势 + */ + + @GetMapping("/dustAnalysis") + public AjaxResult dustAnalysis(){ + return AjaxResult.success(secondBorderService.dustAnalysis()); + } + + /** + * 设备时长 + * @return + */ + @GetMapping("/deviceTimeCount") + public AjaxResult deviceTimeCount(){ + return AjaxResult.success(secondBorderService.deviceTimeCount()); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/ThirdMesBorderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/ThirdMesBorderController.java new file mode 100644 index 0000000..c31a998 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/ThirdMesBorderController.java @@ -0,0 +1,62 @@ +package com.hw.mes.board.controller; + +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.mes.board.service.ThirdMesBorderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/ThirdMesBorder") +public class ThirdMesBorderController { + @Autowired + private ThirdMesBorderService thirdMesBorderService; + + /** + * 工单计划 + */ + @GetMapping("/thirdOrderPlan") + public AjaxResult thirdOrderPlan(){ + return AjaxResult.success(thirdMesBorderService.thirdOrderPlan()); + } + + /** + * 获取最新一条工单 + */ + @GetMapping("/getLatestWorkOrder") + public AjaxResult getLatestWorkOrder(){ + return AjaxResult.success(thirdMesBorderService.getLatestWorkOrder()); + } + /** + * 温湿度曲线 + */ + @GetMapping("/temperatureAndhumunity") + public AjaxResult temperatureAndhumunity(){ + return AjaxResult.success(thirdMesBorderService.temperatureAndhumunity()); + } + /** + * 生产统计数据 + */ + @GetMapping("/productAmount") + public AjaxResult productAmount(){ + return AjaxResult.success(thirdMesBorderService.productAmount()); + } + /** + * 生产完成统计和3楼仓储的出入库统计一样 + */ + @GetMapping("/productCompleteCount") + public AjaxResult productCompleteCount(){ + return AjaxResult.success(thirdMesBorderService.productCompleteCount()); + } + + /** + * 原材料入库折线图 + * @return + */ + @GetMapping("/rawInstock") + public AjaxResult rawInstock(){ + return AjaxResult.success(thirdMesBorderService.rawInstock()); + } + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/DmsRealtimeStatusHistory.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/DmsRealtimeStatusHistory.java new file mode 100644 index 0000000..b7980eb --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/DmsRealtimeStatusHistory.java @@ -0,0 +1,123 @@ +package com.hw.mes.board.domain; + +import java.io.Serializable; +import java.util.Date; + +/** + * (DmsRealtimeStatusHistory)实体类 + * + * @author makejava + * @since 2024-11-06 10:57:57 + */ +public class DmsRealtimeStatusHistory implements Serializable { + private static final long serialVersionUID = 153296577307956929L; + + private Long historyId; + + private Long statusId; + /** + * 设备状态编号 + */ + private String statusCode; + /** + * 设备状态名称 + */ + private String statusName; + /** + * 设备状态值 + */ + private String statusValue; + /** + * 所属设备id + */ + private Long deviceId; + /** + * 创建时间 + */ + private Date creatTime; + /** + * 更新时间 + */ + private Date updateTime; + /** + * 同步时间 + */ + private Date syncTime; + private Date hour; + private Long timeCount; + + + public Long getHistoryId() { + return historyId; + } + + public void setHistoryId(Long historyId) { + this.historyId = historyId; + } + + public Long getStatusId() { + return statusId; + } + + public void setStatusId(Long statusId) { + this.statusId = statusId; + } + + public String getStatusCode() { + return statusCode; + } + + public void setStatusCode(String statusCode) { + this.statusCode = statusCode; + } + + public String getStatusName() { + return statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getStatusValue() { + return statusValue; + } + + public void setStatusValue(String statusValue) { + this.statusValue = statusValue; + } + + public Long getDeviceId() { + return deviceId; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } + + public Date getCreatTime() { + return creatTime; + } + + public void setCreatTime(Date creatTime) { + this.creatTime = creatTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Date getSyncTime() { + return syncTime; + } + + public void setSyncTime(Date syncTime) { + this.syncTime = syncTime; + } + +} + diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RawAmount.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RawAmount.java new file mode 100644 index 0000000..c185897 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RawAmount.java @@ -0,0 +1,13 @@ +package com.hw.mes.board.domain; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class RawAmount { + private String materialId; + private BigDecimal inStock; + private BigDecimal outStock; + private String week; +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RecordIotenvInstant.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RecordIotenvInstant.java new file mode 100644 index 0000000..9c063ce --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RecordIotenvInstant.java @@ -0,0 +1,24 @@ +package com.hw.mes.board.domain; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class RecordIotenvInstant { + private Long objId; + private String monitorId; + private BigDecimal tempreture; + private BigDecimal humidity; + private BigDecimal illuminance; + private BigDecimal noise; + private BigDecimal concentration; + private BigDecimal pm1; + private BigDecimal pm2; + private BigDecimal pm10; + private BigDecimal standBy; + private Date collectTime; + private Date recodeTime; + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FifthMesBorderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FifthMesBorderService.java new file mode 100644 index 0000000..5aaa1a3 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FifthMesBorderService.java @@ -0,0 +1,14 @@ +package com.hw.mes.board.service; + + +import com.hw.mes.domain.MesProductOrder; + +import java.util.List; +import java.util.Map; + +public interface FifthMesBorderService { + + MesProductOrder productProgress(); + + List workOrderProgress(); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/SecondMesBorderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/SecondMesBorderService.java new file mode 100644 index 0000000..0de0c28 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/SecondMesBorderService.java @@ -0,0 +1,28 @@ +package com.hw.mes.board.service; + + + +import com.hw.mes.board.domain.DmsRealtimeStatusHistory; +import com.hw.mes.board.domain.RecordIotenvInstant; +import com.hw.mes.domain.MesProductOrder; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Map; + +public interface SecondMesBorderService { + List selectOrderMonth(); + + MesProductOrder selectLatestWorkOrder(); + + Boolean getLineStatus(); + + List> getHourProduction(); + + List> getDayProduction(); + + List dustAnalysis(); + + List deviceTimeCount(); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/ThirdMesBorderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/ThirdMesBorderService.java new file mode 100644 index 0000000..fd299bb --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/ThirdMesBorderService.java @@ -0,0 +1,24 @@ +package com.hw.mes.board.service; + +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.mes.board.domain.RawAmount; +import com.hw.mes.board.domain.RecordIotenvInstant; +import com.hw.mes.domain.MesProductOrder; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +public interface ThirdMesBorderService{ + List thirdOrderPlan(); + + MesProductOrder getLatestWorkOrder(); + + List temperatureAndhumunity(); + + List> productAmount(); + + List productCompleteCount(); + + List rawInstock(); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FifthMesBoardServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FifthMesBoardServiceImpl.java new file mode 100644 index 0000000..b5da7a7 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FifthMesBoardServiceImpl.java @@ -0,0 +1,27 @@ +package com.hw.mes.board.service.impl; + + +import com.hw.mes.board.service.FifthMesBorderService; +import com.hw.mes.domain.MesProductOrder; +import com.hw.mes.mapper.MesProductOrderMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +@Service +public class FifthMesBoardServiceImpl implements FifthMesBorderService { + @Autowired + private MesProductOrderMapper mesProductOrderMapper; + + @Override + public MesProductOrder productProgress() { + return mesProductOrderMapper.productProgress(); + } + + @Override + public List workOrderProgress() { + return mesProductOrderMapper.selectFifthWorkorder(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/SecondMesBoardServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/SecondMesBoardServiceImpl.java new file mode 100644 index 0000000..4689e3a --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/SecondMesBoardServiceImpl.java @@ -0,0 +1,55 @@ +package com.hw.mes.board.service.impl; + +import com.hw.mes.board.domain.DmsRealtimeStatusHistory; +import com.hw.mes.board.domain.RecordIotenvInstant; +import com.hw.mes.board.service.SecondMesBorderService; +import com.hw.mes.domain.MesProductOrder; +import com.hw.mes.mapper.MesProductOrderMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service +public class SecondMesBoardServiceImpl implements SecondMesBorderService { + @Autowired + private MesProductOrderMapper mesProductOrderMapper; + + @Override + public List selectOrderMonth() { + return mesProductOrderMapper.selectOrderMonth(); + } + + @Override + public MesProductOrder selectLatestWorkOrder() { + return mesProductOrderMapper.selectLatestWorkOrder(); + } + + @Override + public Boolean getLineStatus() { + return mesProductOrderMapper.getLineStatus(); + } + + @Override + public List deviceTimeCount() { + return mesProductOrderMapper.deviceTimeCount(); + } + + @Override + public List dustAnalysis() { + return mesProductOrderMapper.dustAnalysis(); + } + + @Override + public List> getDayProduction() { + return mesProductOrderMapper.getDayProduction(); + } + + @Override + public List> getHourProduction() { + return mesProductOrderMapper.getHourProduction(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/ThirdMesBorderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/ThirdMesBorderServiceImpl.java new file mode 100644 index 0000000..dcdcdb7 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/ThirdMesBorderServiceImpl.java @@ -0,0 +1,64 @@ +package com.hw.mes.board.service.impl; + +import com.hw.mes.board.domain.RawAmount; +import com.hw.mes.board.domain.RecordIotenvInstant; +import com.hw.mes.board.service.ThirdMesBorderService; +import com.hw.mes.domain.MesProductOrder; +import com.hw.mes.mapper.MesProductOrderMapper; +import com.hw.wms.api.domain.vo.WmsRawStockVo; +import org.springframework.beans.factory.annotation.Autowired; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class ThirdMesBorderServiceImpl implements ThirdMesBorderService { + @Autowired + private MesProductOrderMapper mesProductOrderMapper; + + @Override + public MesProductOrder getLatestWorkOrder() { + return mesProductOrderMapper.getLatestWorkOrder(); + } + + @Override + public List temperatureAndhumunity() { + return mesProductOrderMapper.dustAnalysis(); + } + + @Override + public List productCompleteCount() { + List maps = mesProductOrderMapper.productCompleteCount(); + List maps1 = mesProductOrderMapper.productInstockCount(); + List rawAmounts = new ArrayList<>(); + for (RawAmount map : maps) { + for (RawAmount decimalMap : maps1) { + RawAmount rawAmount = new RawAmount(); + rawAmount.setMaterialId(map.getMaterialId()); + rawAmount.setInStock(map.getInStock()); + if (map.getMaterialId().equals(decimalMap.getMaterialId())){ + rawAmount.setOutStock(decimalMap.getOutStock()); + } + } + } + return rawAmounts; + + } + + @Override + public List rawInstock() { + List list = mesProductOrderMapper.rawInstock(); + return list; + } + + @Override + public List> productAmount() { + return mesProductOrderMapper.productAmount(); + } + + @Override + public List thirdOrderPlan() { + return mesProductOrderMapper.thirdOrderPlan(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductOrderMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductOrderMapper.java index 3a4567a..424dde6 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductOrderMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductOrderMapper.java @@ -1,6 +1,13 @@ package com.hw.mes.mapper; +import java.math.BigDecimal; +import java.util.Date; import java.util.List; +import java.util.Map; + +import com.hw.mes.board.domain.DmsRealtimeStatusHistory; +import com.hw.mes.board.domain.RawAmount; +import com.hw.mes.board.domain.RecordIotenvInstant; import com.hw.mes.domain.MesProductOrder; /** @@ -84,6 +91,33 @@ public interface MesProductOrderMapper public List selectMesProductOrderJoinList(MesProductOrder mesProductOrder); + List selectOrderMonth(); + + MesProductOrder selectLatestWorkOrder(); + + Boolean getLineStatus(); + + List> getHourProduction(); + + List> getDayProduction(); + + List dustAnalysis(); + + List deviceTimeCount(); + + MesProductOrder productProgress(); + + List selectFifthWorkorder(); + + MesProductOrder getLatestWorkOrder(); + + List productCompleteCount(); + + List productInstockCount(); + + List rawInstock(); + List> productAmount(); + List thirdOrderPlan(); } diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml index 57ba80f..9b6d70c 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml @@ -385,7 +385,140 @@ order by mpo.product_order_id desc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +