From 6ebd69a44b36e1f68651c4c09bbc0fe70ff691ee Mon Sep 17 00:00:00 2001 From: "maxw@mesnac.com" Date: Wed, 4 Dec 2024 11:40:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E4=B8=89=E4=BA=94=E6=A5=BC=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E4=BB=93=E5=82=A8=E7=9C=8B=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FirstMesBorderController.java | 23 ++ .../controller/FouthMesBorderController.java | 45 +++ .../hw/mes/board/domain/RecordDnbInstant.java | 349 ++++++++++++++++++ .../board/service/FirstMesBorderService.java | 9 + .../board/service/FouthMesBorderService.java | 18 + .../impl/FirstMesBorderServiceImpl.java | 19 + .../impl/FouthMesBorderServiceImpl.java | 40 ++ .../impl/ThirdMesBorderServiceImpl.java | 4 +- .../domain/MesProduceStatisticsDetail.java | 8 + .../com/hw/mes/domain/MesProductOrder.java | 8 + .../hw/mes/mapper/MesProductOrderMapper.java | 8 + .../mapper/mes/MesProductOrderMapper.xml | 116 ++++-- .../controller/FourthWmsBorderController.java | 4 +- .../impl/FifthWmsBoardServiceImpl.java | 2 +- .../impl/FouthWmsBoardServiceImpl.java | 16 +- .../impl/SecondWmsBoardServiceImpl.java | 4 +- .../com/hw/wms/domain/WmsProductOutstock.java | 8 + .../wms/mapper/WmsProductInstockMapper.java | 3 + .../hw/wms/mapper/WmsProductStockMapper.java | 2 + .../hw/wms/mapper/WmsRawInstockMapper.java | 2 +- .../hw/wms/mapper/WmsRawOutstockMapper.java | 2 +- .../mapper/wms/WmsProductInstockMapper.xml | 8 + .../mapper/wms/WmsProductOutstockMapper.xml | 4 +- .../mapper/wms/WmsProductStockMapper.xml | 39 +- .../mapper/wms/WmsRawInstockMapper.xml | 23 +- .../mapper/wms/WmsRawOutstockMapper.xml | 21 +- .../mapper/wms/WmsRawStockMapper.xml | 6 +- 27 files changed, 720 insertions(+), 71 deletions(-) create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FirstMesBorderController.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FouthMesBorderController.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RecordDnbInstant.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FirstMesBorderService.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FouthMesBorderService.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FirstMesBorderServiceImpl.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FouthMesBorderServiceImpl.java diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FirstMesBorderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FirstMesBorderController.java new file mode 100644 index 00000000..895815d5 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FirstMesBorderController.java @@ -0,0 +1,23 @@ +package com.hw.mes.board.controller; + +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.mes.board.service.FirstMesBorderService; +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("firstMesBorder") +public class FirstMesBorderController { + @Autowired + private FirstMesBorderService firstMesBorderService; + /** + * 提升机状态 + */ + + @GetMapping("/elevatorStatus") + public AjaxResult elevatorStatus(){ + return AjaxResult.success(firstMesBorderService.elevatorStatus()); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FouthMesBorderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FouthMesBorderController.java new file mode 100644 index 00000000..7f1a4cec --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/controller/FouthMesBorderController.java @@ -0,0 +1,45 @@ +package com.hw.mes.board.controller; + +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.mes.board.service.FirstMesBorderService; +import com.hw.mes.board.service.FouthMesBorderService; +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("fouthMesBorder") +public class FouthMesBorderController { + @Autowired + private FouthMesBorderService fouthMesBorderService; + /** + * 提升机状态 + */ + + @GetMapping("/elevatorStatus") + public AjaxResult elevatorStatus(){ + return AjaxResult.success(fouthMesBorderService.elevatorStatus()); + } + /** + * 工序名称占比 + */ + @GetMapping("/processPercentage") + public AjaxResult processPercentage(){ + return AjaxResult.success(fouthMesBorderService.processPercentage()); + } + /** + * 最新一周的计划,差异 + */ + @GetMapping("/weekProductInfo") + public AjaxResult weekProductInfo(){ + return AjaxResult.success(fouthMesBorderService.weekProductInfo()); + } + /** + * 能耗设备 + */ + @GetMapping("energeEquiptment") + private AjaxResult energeEquiptment(){ + return AjaxResult.success(fouthMesBorderService.energeEquiptment()); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RecordDnbInstant.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RecordDnbInstant.java new file mode 100644 index 00000000..f9b6b0e3 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/domain/RecordDnbInstant.java @@ -0,0 +1,349 @@ +package com.hw.mes.board.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 电实时数据对象 record_dnb_instant + * + * @author YinQ + * @date 2023-04-07 + */ +public class RecordDnbInstant extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Long objid; + + /** 计量设备编号 */ + @Excel(name = "计量设备编号") + private String monitorId; + + /** 计量设备名称 */ + @Excel(name = "计量设备名称") + private String monitorName; + + /** 计量设备地址 */ +// @Excel(name = "计量设备地址") + private String address; + + /** 采集时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date collectTime; + + /** A项电压 */ + @Excel(name = "A项电压") + private BigDecimal vA; + + /** B项电压 */ + @Excel(name = "B项电压") + private BigDecimal vB; + + /** C项电压 */ + @Excel(name = "C项电压") + private BigDecimal vC; + + /** A项电流 */ + @Excel(name = "A项电流") + private BigDecimal iA; + + /** B项电流 */ + @Excel(name = "B项电流") + private BigDecimal iB; + + /** C项电流 */ + @Excel(name = "C项电流") + private BigDecimal iC; + + /** 记录时间 */ + private Date recordTime; + + /** 功率因数 */ + @Excel(name = "功率因数") + private BigDecimal glys; + + /** 正向有功 */ + @Excel(name = "正向有功") + private BigDecimal zxyg; + + /** 有功功率 */ + @Excel(name = "有功功率") + private BigDecimal activePower; + + /** 无功功率 */ + @Excel(name = "无功功率") + private BigDecimal reactivePower; + + /** 电耗量 */ +// @Excel(name = "电耗量") + private BigDecimal consumption; + + /** 采集方式 */ + @Excel(name = "采集方式", dictType="collect_type") + private Long collectType; + + /** 权限标识(部门) */ +// @Excel(name = "权限标识", readConverterExp = "部=门") + private Long deptId; + + /** 权限标识(用户) */ +// @Excel(name = "权限标识", readConverterExp = "用=户") + private Long userId; + + + /** + * 查询子集 + */ + private String monitorSubset; + + /** + * 在线状态 + */ + private Integer onlineState; + + private String startTime; + private String endTime; + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public Integer getOnlineState() { + return onlineState; + } + + public void setOnlineState(Integer onlineState) { + this.onlineState = onlineState; + } + + public String getMonitorSubset() { + return monitorSubset; + } + + public void setMonitorSubset(String monitorSubset) { + this.monitorSubset = monitorSubset; + } + + public String getMonitorName() { + return monitorName; + } + + public void setMonitorName(String monitorName) { + this.monitorName = monitorName; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public void setObjid(Long objid) + { + this.objid = objid; + } + + public Long getObjid() + { + return objid; + } + public void setMonitorId(String monitorId) + { + this.monitorId = monitorId; + } + + public String getMonitorId() + { + return monitorId; + } + public void setCollectTime(Date collectTime) + { + this.collectTime = collectTime; + } + + public Date getCollectTime() + { + return collectTime; + } + public void setVA(BigDecimal vA) + { + this.vA = vA; + } + + public BigDecimal getVA() + { + return vA; + } + public void setVB(BigDecimal vB) + { + this.vB = vB; + } + + public BigDecimal getVB() + { + return vB; + } + public void setVC(BigDecimal vC) + { + this.vC = vC; + } + + public BigDecimal getVC() + { + return vC; + } + public void setIA(BigDecimal iA) + { + this.iA = iA; + } + + public BigDecimal getIA() + { + return iA; + } + public void setIB(BigDecimal iB) + { + this.iB = iB; + } + + public BigDecimal getIB() + { + return iB; + } + public void setIC(BigDecimal iC) + { + this.iC = iC; + } + + public BigDecimal getIC() + { + return iC; + } + public void setRecordTime(Date recordTime) + { + this.recordTime = recordTime; + } + + public Date getRecordTime() + { + return recordTime; + } + public void setGlys(BigDecimal glys) + { + this.glys = glys; + } + + public BigDecimal getGlys() + { + return glys; + } + public void setZxyg(BigDecimal zxyg) + { + this.zxyg = zxyg; + } + + public BigDecimal getZxyg() + { + return zxyg; + } + public void setActivePower(BigDecimal activePower) + { + this.activePower = activePower; + } + + public BigDecimal getActivePower() + { + return activePower; + } + public void setReactivePower(BigDecimal reactivePower) + { + this.reactivePower = reactivePower; + } + + public BigDecimal getReactivePower() + { + return reactivePower; + } + public void setConsumption(BigDecimal consumption) + { + this.consumption = consumption; + } + + public BigDecimal getConsumption() + { + return consumption; + } + public void setCollectType(Long collectType) + { + this.collectType = collectType; + } + + public Long getCollectType() + { + return collectType; + } + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getDeptId() + { + return deptId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("objid", getObjid()) + .append("monitorId", getMonitorId()) + .append("collectTime", getCollectTime()) + .append("vA", getVA()) + .append("vB", getVB()) + .append("vC", getVC()) + .append("iA", getIA()) + .append("iB", getIB()) + .append("iC", getIC()) + .append("recordTime", getRecordTime()) + .append("glys", getGlys()) + .append("zxyg", getZxyg()) + .append("activePower", getActivePower()) + .append("reactivePower", getReactivePower()) + .append("consumption", getConsumption()) + .append("collectType", getCollectType()) + .append("deptId", getDeptId()) + .append("userId", getUserId()) + .toString(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FirstMesBorderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FirstMesBorderService.java new file mode 100644 index 00000000..223188ba --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FirstMesBorderService.java @@ -0,0 +1,9 @@ +package com.hw.mes.board.service; + +import com.hw.mes.domain.WcsPlcpoint; + +import java.util.List; + +public interface FirstMesBorderService { + List elevatorStatus(); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FouthMesBorderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FouthMesBorderService.java new file mode 100644 index 00000000..38a7adf2 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/FouthMesBorderService.java @@ -0,0 +1,18 @@ +package com.hw.mes.board.service; + +import com.hw.mes.board.domain.RecordDnbInstant; +import com.hw.mes.domain.MesProduceStatisticsDetail; +import com.hw.mes.domain.MesProductOrder; +import com.hw.mes.domain.WcsPlcpoint; + +import java.util.List; + +public interface FouthMesBorderService { + List elevatorStatus(); + + List processPercentage(); + + MesProductOrder weekProductInfo(); + + List energeEquiptment(); +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FirstMesBorderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FirstMesBorderServiceImpl.java new file mode 100644 index 00000000..8ece42d4 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FirstMesBorderServiceImpl.java @@ -0,0 +1,19 @@ +package com.hw.mes.board.service.impl; + +import com.hw.mes.board.service.FirstMesBorderService; +import com.hw.mes.domain.WcsPlcpoint; +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 FirstMesBorderServiceImpl implements FirstMesBorderService { + @Autowired + private MesProductOrderMapper mesProductOrderMapper; + @Override + public List elevatorStatus() { + return mesProductOrderMapper.elevatorStatus(); + } +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FouthMesBorderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FouthMesBorderServiceImpl.java new file mode 100644 index 00000000..31fde624 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/board/service/impl/FouthMesBorderServiceImpl.java @@ -0,0 +1,40 @@ +package com.hw.mes.board.service.impl; + +import com.hw.mes.board.domain.RecordDnbInstant; +import com.hw.mes.board.service.FirstMesBorderService; +import com.hw.mes.board.service.FouthMesBorderService; +import com.hw.mes.domain.MesProduceStatisticsDetail; +import com.hw.mes.domain.MesProductOrder; +import com.hw.mes.domain.WcsPlcpoint; +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 FouthMesBorderServiceImpl implements FouthMesBorderService { + @Autowired + private MesProductOrderMapper mesProductOrderMapper; + + @Override + public List elevatorStatus() { + return mesProductOrderMapper.elevatorStatus(); + } + + @Override + public List processPercentage() { + return mesProductOrderMapper.orderTime(); + } + + @Override + public MesProductOrder weekProductInfo() { + return mesProductOrderMapper.weekProductInfo(); + } + + @Override + public List energeEquiptment() { + + return mesProductOrderMapper.energeEquiptment(); + } +} 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 index 964c2698..41b9b619 100644 --- 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 @@ -34,9 +34,9 @@ public class ThirdMesBorderServiceImpl implements ThirdMesBorderService { for (RawAmount map : maps) { for (RawAmount decimalMap : maps1) { RawAmount rawAmount = new RawAmount(); - rawAmount.setMaterialId(map.getMaterialId()); + rawAmount.setWeek(map.getWeek()); rawAmount.setInStock(map.getInStock()); - if (map.getMaterialId().equals(decimalMap.getMaterialId())){ + if (map.getWeek().equals(decimalMap.getWeek())){ rawAmount.setOutStock(decimalMap.getOutStock()); rawAmounts.add(rawAmount); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProduceStatisticsDetail.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProduceStatisticsDetail.java index 97fdc643..863506bb 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProduceStatisticsDetail.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProduceStatisticsDetail.java @@ -36,6 +36,7 @@ public class MesProduceStatisticsDetail extends BaseEntity /** 销售订单号 */ @Excel(name = "销售订单号") private String saleorderCode; + private String orderCode; /** 生产计划ID */ @Excel(name = "生产计划ID") @@ -138,6 +139,13 @@ public class MesProduceStatisticsDetail extends BaseEntity public void setDispatchType(String dispatchType) { this.dispatchType = dispatchType; } + public String getOrderCode() { + return orderCode; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } public Long getDispatchId() { return dispatchId; diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java index a64a06fa..29f831f0 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java @@ -123,6 +123,7 @@ public class MesProductOrder extends BaseEntity { */ @Excel(name = "完成数量") private BigDecimal completeAmount; + private BigDecimal diffAmount; /** * 发布时间 @@ -473,6 +474,13 @@ public class MesProductOrder extends BaseEntity { public BigDecimal getCompleteAmount() { return completeAmount; } + public void setDiffAmount(BigDecimal diffAmount) { + this.diffAmount = diffAmount; + } + + public BigDecimal getDiffAmount() { + return diffAmount; + } public void setReleaseTime(Date releaseTime) { this.releaseTime = releaseTime; 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 d3a93b21..e164da49 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 @@ -7,9 +7,11 @@ import java.util.Map; import com.hw.mes.board.domain.DmsRealtimeStatusHistory; import com.hw.mes.board.domain.RawAmount; +import com.hw.mes.board.domain.RecordDnbInstant; import com.hw.mes.board.domain.RecordIotenvInstant; import com.hw.mes.domain.MesProduceStatisticsDetail; import com.hw.mes.domain.MesProductOrder; +import com.hw.mes.domain.WcsPlcpoint; import org.apache.ibatis.annotations.Mapper; /** @@ -129,4 +131,10 @@ public interface MesProductOrderMapper List orderTime(); String getLineThirdStatus(); + + List elevatorStatus(); + + MesProductOrder weekProductInfo(); + + List energeEquiptment(); } 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 602c0578..f8e42aab 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 @@ -389,9 +389,14 @@ order by mpo.product_order_id desc + + + diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/board/controller/FourthWmsBorderController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/board/controller/FourthWmsBorderController.java index acf8e299..5bdcbf5b 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/board/controller/FourthWmsBorderController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/board/controller/FourthWmsBorderController.java @@ -14,14 +14,14 @@ public class FourthWmsBorderController { @Autowired private FourthWmsBorderService fouthWmsBorderService; /** - * 当日原材料出、入库详情 + * 当年板材料出、入库,成品库存数量 */ @GetMapping("/inAndOutInfo") public AjaxResult inAndOutInfo(){ return AjaxResult.success(fouthWmsBorderService.inAndOutInfo()); } /** - * 原材料库存占比 + * 成品库存占比 */ @GetMapping("stockPercentage") public AjaxResult stockPercentage(){ diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/FifthWmsBoardServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/FifthWmsBoardServiceImpl.java index fd73f01d..397d51bb 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/FifthWmsBoardServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/FifthWmsBoardServiceImpl.java @@ -51,7 +51,7 @@ public class FifthWmsBoardServiceImpl implements FifthWmsBorderService { map.put("furawInStock",wmsProductInstock.getInstockAmount()); } } - map.put("rawOutStock",list1.get(0).getOutstockAmount()); + map.put("rawOutStock",list1.get(0).getRealOutstockAmount()); map.put("productInStock",list2.get(0).getInstockAmount()); map.put("productOutStock",list3.get(0).getOutstockQty()); return map; diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/FouthWmsBoardServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/FouthWmsBoardServiceImpl.java index ecacc8f0..c719b34f 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/FouthWmsBoardServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/FouthWmsBoardServiceImpl.java @@ -2,10 +2,7 @@ package com.hw.wms.board.service.impl; import com.hw.wms.board.service.FirstWmsBorderService; import com.hw.wms.board.service.FourthWmsBorderService; -import com.hw.wms.domain.MesProductOrder; -import com.hw.wms.domain.WmsProductInstock; -import com.hw.wms.domain.WmsRawInstock; -import com.hw.wms.domain.WmsRawOutstock; +import com.hw.wms.domain.*; import com.hw.wms.mapper.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -26,14 +23,18 @@ public class FouthWmsBoardServiceImpl implements FourthWmsBorderService { private WmsProductInstockMapper wmsProductInstockMapper; @Autowired private WmsProductOutstockMapper wmsProductOutstockMapper; + @Autowired + private WmsProductStockMapper wmsProductStockMapper; @Override public Map inAndOutInfo() { - List rawOutstock = wmsRawOutstockMapper.fourthOutstockList(); - List inStocks = wmsRawInstockMapper.fourthInstockList(); - HashMap> map = new HashMap<>(); + WmsRawOutstock rawOutstock = wmsRawOutstockMapper.fourthOutstockList(); + WmsRawOutstock inStocks = wmsRawInstockMapper.fourthInstockList(); + WmsRawOutstock product = wmsProductInstockMapper.fourthProduct(); + HashMap map = new HashMap<>(); map.put("rawOutstock",rawOutstock); map.put("inStocks",inStocks); + map.put("product",product); return map; } @@ -43,6 +44,7 @@ public class FouthWmsBoardServiceImpl implements FourthWmsBorderService { Integer nostockAmount = wmsBaseLocationMapper.selectFourthNostockLocation(); Integer fustockLocation = wmsBaseLocationMapper.selectFourthFustockLocation(); Integer noFustockLocation = wmsBaseLocationMapper.selectFourthNoFustockLocation(); + List productStocks = wmsProductStockMapper.selectFourthProductStockPercentage(); HashMap map = new HashMap<>(); map.put("stockAmount",stockAmount); map.put("nostockAmount",nostockAmount); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/SecondWmsBoardServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/SecondWmsBoardServiceImpl.java index 5c935810..23b396e4 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/SecondWmsBoardServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/board/service/impl/SecondWmsBoardServiceImpl.java @@ -62,10 +62,10 @@ public class SecondWmsBoardServiceImpl implements SecondWmsBorderService { public List inAndOutStockInfo() { List instocks = wmsProductStockMapper.selectInStock(); List outstocks = wmsProductStockMapper.selectOutStock(); - Map> map = outstocks.stream().collect(Collectors.groupingBy(WmsProductOutstock::getProductId)); + Map> map = outstocks.stream().collect(Collectors.groupingBy(WmsProductOutstock::getDay)); for (WmsProductInstock instock : instocks) { if (map != null&&map.keySet().size()>0) { - WmsProductOutstock wmsProductOutstock = map.get(instock.getProductId()).get(0); + WmsProductOutstock wmsProductOutstock = map.get(instock.getDay()).get(0); instock.setOutStockAmount(wmsProductOutstock.getOutstockQty()); }else { instock.setOutStockAmount(new BigDecimal(0)); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductOutstock.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductOutstock.java index 4744978d..d2f7355f 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductOutstock.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductOutstock.java @@ -138,6 +138,7 @@ public class WmsProductOutstock extends BaseEntity { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "执行结束时间", width = 30, dateFormat = "yyyy-MM-dd") private Date endTime; + private Date day; /** 同步ERP状态(0:失败,1成功) */ @Excel(name = "同步ERP状态(0:失败,1成功)") @@ -403,6 +404,13 @@ public class WmsProductOutstock extends BaseEntity { public Date getEndTime() { return endTime; } + public void setDay(Date day) { + this.day = day; + } + + public Date getDay() { + return day; + } public String getErpStatus() { return erpStatus; diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductInstockMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductInstockMapper.java index 04a5b512..eaf320e4 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductInstockMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductInstockMapper.java @@ -3,6 +3,7 @@ package com.hw.wms.mapper; import java.util.List; import com.hw.wms.domain.WmsProductInstock; import com.hw.wms.domain.WmsProductInstockDetail; +import com.hw.wms.domain.WmsRawOutstock; /** * 成品入库记录;成品入库记录Mapper接口 @@ -104,4 +105,6 @@ public interface WmsProductInstockMapper List productInInfo(); List productFirstInInfo(); + + WmsRawOutstock fourthProduct(); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductStockMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductStockMapper.java index 29b6e3c9..35c249f0 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductStockMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsProductStockMapper.java @@ -159,4 +159,6 @@ public interface WmsProductStockMapper int selectOpplyLocation(); BigDecimal monthInstockAmount(); + + List selectFourthProductStockPercentage(); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawInstockMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawInstockMapper.java index 9f548e91..3ccaaf02 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawInstockMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawInstockMapper.java @@ -98,7 +98,7 @@ public interface WmsRawInstockMapper List selectInAndOutInfo(); - List fourthInstockList(); + WmsRawOutstock fourthInstockList(); List purchaseInfo(); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawOutstockMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawOutstockMapper.java index 6c5d74de..aad12e51 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawOutstockMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsRawOutstockMapper.java @@ -165,7 +165,7 @@ public interface WmsRawOutstockMapper List selectInAndOutInfo(); - List fourthOutstockList(); + WmsRawOutstock fourthOutstockList(); List productOutInfo(); diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml index 611ba560..906c11c7 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml @@ -327,4 +327,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" group by day + diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml index 4404d9ef..245ecb47 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml @@ -416,11 +416,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml index 7986bb6d..7c0b8b29 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml @@ -235,7 +235,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mbmi.material_unit_id is not null and mbmi.material_unit_id !='' diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml index 8fa9dc64..58cbb5a5 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml @@ -397,10 +397,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from wms_raw_outstock where - DATE_FORMAT( apply_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) and warehouse_id = 311 + apply_date > now() - interval 1 month and warehouse_id = 311 diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml index c2205b5e..be82d696 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml @@ -374,14 +374,14 @@