From 04ca4eb29c540e79df78e8d0e99492dc5b53b45d Mon Sep 17 00:00:00 2001 From: xins Date: Tue, 26 Mar 2024 14:52:00 +0800 Subject: [PATCH] =?UTF-8?q?1.8.7=20WMS:PDA=E6=8E=A5=E5=8F=A3=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E7=A7=BB=E5=BA=93=E3=80=81PDA=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=A7=BB=E5=BA=93=E4=BB=BB=E5=8A=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E3=80=81PDA=E8=8E=B7=E5=8F=96=E7=A7=BB=E5=BA=93?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=98=8E=E7=BB=86=E3=80=81PDA=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=A7=BB=E5=BA=93=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hw/mes/api/domain/MesBaseBarcodeInfo.java | 12 + .../hw/common/core/constant/WmsConstants.java | 20 + .../com/hw/common/core/utils/MacUtils.java | 56 ++ .../com/hw/common/core/utils/uuid/Seq.java | 41 +- .../com/hw/common/log/enums/BusinessType.java | 11 + .../java/com/hw/wms/config/WmsConfig.java | 42 ++ .../wms/controller/WmsMobileController.java | 71 +- .../main/java/com/hw/wms/domain/WmsMove.java | 90 ++- .../java/com/hw/wms/domain/WmsMoveDetail.java | 156 ++-- .../com/hw/wms/domain/WmsProductInstock.java | 49 ++ .../com/hw/wms/domain/WmsRawOutstock.java | 51 +- .../com/hw/wms/domain/vo/WmsMoveMergeVo.java | 21 - .../java/com/hw/wms/domain/vo/WmsMoveVo.java | 36 + .../hw/wms/mapper/WmsMoveDetailMapper.java | 85 +++ .../java/com/hw/wms/mapper/WmsMoveMapper.java | 39 +- .../hw/wms/service/IWmsMoveMergeService.java | 4 +- .../com/hw/wms/service/IWmsMoveService.java | 60 +- .../service/IWmsProductOutstockService.java | 9 + .../service/impl/WmsMoveMergeServiceImpl.java | 28 +- .../wms/service/impl/WmsMoveServiceImpl.java | 692 +++++++++++++++++- .../impl/WmsProductInstockServiceImpl.java | 39 +- .../impl/WmsProductOutstockServiceImpl.java | 14 + .../impl/WmsRawOutstockServiceImpl.java | 55 +- .../mapper/wms/WmsMoveDetailMapper.xml | 170 +++++ .../resources/mapper/wms/WmsMoveMapper.xml | 49 +- .../mapper/wms/WmsProductInstockMapper.xml | 28 +- .../mapper/wms/WmsRawOutstockMapper.xml | 52 +- .../mapper/wms/WmsRawStockMapper.xml | 2 +- 28 files changed, 1744 insertions(+), 238 deletions(-) create mode 100644 hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MacUtils.java create mode 100644 hw-modules/hw-wms/src/main/java/com/hw/wms/config/WmsConfig.java delete mode 100644 hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsMoveMergeVo.java create mode 100644 hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsMoveVo.java create mode 100644 hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsMoveDetailMapper.java create mode 100644 hw-modules/hw-wms/src/main/resources/mapper/wms/WmsMoveDetailMapper.xml diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java index 462a3a2..0a61c51 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java @@ -55,6 +55,9 @@ public class MesBaseBarcodeInfo extends BaseEntity @Excel(name = "托盘RFID代码") private String palletInfoCode; + /**绑定的物料条码(用来拆分绑定使用)*/ + private String bindBarcode; + /** 物料ID,关联mes_base_material_info的material_id */ @Excel(name = "物料ID") private Long materialId; @@ -231,6 +234,15 @@ public class MesBaseBarcodeInfo extends BaseEntity { return palletInfoCode; } + + public String getBindBarcode() { + return bindBarcode; + } + + public void setBindBarcode(String bindBarcode) { + this.bindBarcode = bindBarcode; + } + public void setMaterialId(Long materialId) { this.materialId = materialId; diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java index 024eb94..7832147 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java @@ -76,6 +76,7 @@ public class WmsConstants { public static final String WMS_EXECUTE_STATUS_EXECUTING = "1";//执行中 public static final String WMS_EXECUTE_STATUS_FINISH = "2";//完成执行 + public static final String WMS_EXECUTE_STATUS_NOT_FINISH = "notFinish";//未完成执行 @@ -111,10 +112,18 @@ public class WmsConstants { public static final String WMS_WAREHOUSE_INSTOCK_TYPE_PRODUCT = "3";//成品 + /**移库类型*/ public static final String WMS_MOVEMERGE_TYPE_MOVE = "1"; //移库 public static final String WMS_MOVEMERGE_TYPE_MERGE = "2";//合库 + /**移库方式*/ + public static final String WMS_MOVEMERGE_WAY_MANUAL = "1"; //人工移库 + public static final String WMS_MOVEMERGE_WAY_AGV = "2";//agv移库 + + public static final String WMS_MOVE_DETAIL_TYPE_OUT = "1";//出库 + public static final String WMS_MOVE_DETAIL_TYPE_IN = "2";//入库 + public static final String WMS_WAREHOUSE_TYPE_NORMAL = "1";//普通仓库 public static final String WMS_WAREHOUSE_TYPE_AGV = "2";//AGV仓库 public static final String WMS_WAREHOUSE_TYPE_WORKBIN_AGV = "3";//料箱AGV仓库 @@ -206,4 +215,15 @@ public class WmsConstants { public static final String WMS_RAW_STOCK_COMPLETE_FLAY_YES = "1";//完整 public static final String WMS_RAW_STOCK_COMPLETE_FLAY_NO = "0";//拆分后的 + + + + /*移库记录(明细)执行状态*/ + public static final String WMS_MOVE_EXECUTE_STATUS_TOEXECUTE = "0";//待执行 + public static final String WMS_MOVE_EXECUTE_STATUS_EXECUTING = "1";//执行中 + + public static final String WMS_MOVE_EXECUTE_STATUS_INSTOCK_FINISH = "2";//入库完成 + public static final String WMS_MOVE_EXECUTE_STATUS_OUTSTOCK_FINISH = "3";//出库完成 + + } diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MacUtils.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MacUtils.java new file mode 100644 index 0000000..8cafd4f --- /dev/null +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/MacUtils.java @@ -0,0 +1,56 @@ +package com.hw.common.core.utils; +import java.net.NetworkInterface; +import java.net.SocketException; +import java.util.Enumeration; +import java.util.Locale; +/** + * @Description:Mac地址工具类 + * @ProjectName:HwMes + * @Author:xins + * @Date:2024-03-25 13:18 + * @Version:1.0 + */ +public class MacUtils { + + /** + * 本机MAC地址 + * @return + */ + public static String getLocalMac(){ + StringBuilder mac = new StringBuilder(""); + try { + Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); + while (networkInterfaces.hasMoreElements()){ + NetworkInterface networkInterface = networkInterfaces.nextElement(); + //过滤其他网卡 + if (networkInterface.isVirtual()||networkInterface.isLoopback()||networkInterface.isPointToPoint() || !networkInterface.isUp()){ + continue; + } + String displayName = networkInterface.getDisplayName(); + if (displayName.contains("VMware Virtual")){ + continue; + } + //获取解析网关 + byte[] hardwareAddress = networkInterface.getHardwareAddress(); + + for(int i=0; i wmsMoves = wmsMoveService.selectWmsMoveJoinList(wmsMove); + return getDataTable(wmsMoves); + } + + /** + * 获取人工移库记明细 + */ +// @RequiresPermissions("wms:rawoutstock:query") + @GetMapping(value = "/getMoveDetail/{moveId}") + public AjaxResult getMoveDetail(@PathVariable("moveId") Long moveId) { + WmsMoveDetail queryMoveDetail = new WmsMoveDetail(); + queryMoveDetail.setMoveId(moveId); + List wmsMoveDetailList = wmsMoveService.selectWmsMoveDetailJoinList(queryMoveDetail); + return success(wmsMoveDetailList); + } + + + /** + * 人工移库出库 + */ + @Log(title = "人工移库", businessType = BusinessType.OUTSTOCK) + @PostMapping(("/moveOutstock")) + public AjaxResult moveOutstock(@Validated @RequestBody WmsMoveVo wmsMoveVo) { + return toAjax(wmsMoveService.moveOutstock(wmsMoveVo)); + } + + /** - * 人工移库 + * 人工移库入库 */ - @Log(title = "人工移库", businessType = BusinessType.INSERT) - @PostMapping(("/moveRaw")) - public AjaxResult moveRaw(@Validated @RequestBody WmsMoveMergeVo wmsMoveMergeVo) { - return toAjax(wmsMoveMergeService.manualMove(wmsMoveMergeVo, WmsConstants.WMS_MOVEMERGE_TYPE_MOVE)); + @Log(title = "人工移库", businessType = BusinessType.INSTOCK) + @PostMapping(("/moveInstock")) + public AjaxResult moveInstock(@Validated @RequestBody WmsMoveVo wmsMoveVo) { + return toAjax(wmsMoveService.moveInstock(wmsMoveVo)); } + + + + + + + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMove.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMove.java index 6932bd0..91efbd9 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMove.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMove.java @@ -10,7 +10,7 @@ import com.hw.common.core.web.domain.BaseEntity; /** * 移库合库记录对象 wms_move - * + * * @author xins * @date 2024-01-09 */ @@ -98,177 +98,180 @@ public class WmsMove extends BaseEntity @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd") private Date endTime; + private String warehouseName; + + /** 移库合库记录明细;原材料入库记录对应的明细信息信息 */ private List wmsMoveDetailList; - public void setMoveId(Long moveId) + public void setMoveId(Long moveId) { this.moveId = moveId; } - public Long getMoveId() + public Long getMoveId() { return moveId; } - public void setTaskCode(String taskCode) + public void setTaskCode(String taskCode) { this.taskCode = taskCode; } - public String getTaskCode() + public String getTaskCode() { return taskCode; } - public void setWarehouseId(Long warehouseId) + public void setWarehouseId(Long warehouseId) { this.warehouseId = warehouseId; } - public Long getWarehouseId() + public Long getWarehouseId() { return warehouseId; } - public void setOriLocationCode(String oriLocationCode) + public void setOriLocationCode(String oriLocationCode) { this.oriLocationCode = oriLocationCode; } - public String getOriLocationCode() + public String getOriLocationCode() { return oriLocationCode; } - public void setTargetLocationCode(String targetLocationCode) + public void setTargetLocationCode(String targetLocationCode) { this.targetLocationCode = targetLocationCode; } - public String getTargetLocationCode() + public String getTargetLocationCode() { return targetLocationCode; } - public void setOperationType(String operationType) + public void setOperationType(String operationType) { this.operationType = operationType; } - public String getOperationType() + public String getOperationType() { return operationType; } - public void setMoveWay(String moveWay) + public void setMoveWay(String moveWay) { this.moveWay = moveWay; } - public String getMoveWay() + public String getMoveWay() { return moveWay; } - public void setMoveType(String moveType) + public void setMoveType(String moveType) { this.moveType = moveType; } - public String getMoveType() + public String getMoveType() { return moveType; } - public void setApplyReason(String applyReason) + public void setApplyReason(String applyReason) { this.applyReason = applyReason; } - public String getApplyReason() + public String getApplyReason() { return applyReason; } - public void setAuditReason(String auditReason) + public void setAuditReason(String auditReason) { this.auditReason = auditReason; } - public String getAuditReason() + public String getAuditReason() { return auditReason; } - public void setAuditStatus(String auditStatus) + public void setAuditStatus(String auditStatus) { this.auditStatus = auditStatus; } - public String getAuditStatus() + public String getAuditStatus() { return auditStatus; } - public void setExecuteStatus(String executeStatus) + public void setExecuteStatus(String executeStatus) { this.executeStatus = executeStatus; } - public String getExecuteStatus() + public String getExecuteStatus() { return executeStatus; } - public void setApplyBy(String applyBy) + public void setApplyBy(String applyBy) { this.applyBy = applyBy; } - public String getApplyBy() + public String getApplyBy() { return applyBy; } - public void setApplyDate(Date applyDate) + public void setApplyDate(Date applyDate) { this.applyDate = applyDate; } - public Date getApplyDate() + public Date getApplyDate() { return applyDate; } - public void setAuditBy(String auditBy) + public void setAuditBy(String auditBy) { this.auditBy = auditBy; } - public String getAuditBy() + public String getAuditBy() { return auditBy; } - public void setAuditDate(Date auditDate) + public void setAuditDate(Date auditDate) { this.auditDate = auditDate; } - public Date getAuditDate() + public Date getAuditDate() { return auditDate; } - public void setUpdateDate(Date updateDate) + public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } - public Date getUpdateDate() + public Date getUpdateDate() { return updateDate; } - public void setBeginTime(Date beginTime) + public void setBeginTime(Date beginTime) { this.beginTime = beginTime; } - public Date getBeginTime() + public Date getBeginTime() { return beginTime; } - public void setEndTime(Date endTime) + public void setEndTime(Date endTime) { this.endTime = endTime; } - public Date getEndTime() + public Date getEndTime() { return endTime; } @@ -283,6 +286,15 @@ public class WmsMove extends BaseEntity this.wmsMoveDetailList = wmsMoveDetailList; } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMoveDetail.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMoveDetail.java index 8c44adb..e63fed5 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMoveDetail.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsMoveDetail.java @@ -10,7 +10,7 @@ import com.hw.common.core.web.domain.BaseEntity; /** * 移库合库记录明细;原材料入库记录对应的明细信息对象 wms_move_detail - * + * * @author xins * @date 2024-01-09 */ @@ -25,10 +25,6 @@ public class WmsMoveDetail extends BaseEntity @Excel(name = "移库ID,关联移库合库记录主键") private Long moveId; - /** 库位编码 */ - @Excel(name = "库位编码") - private String locationCode; - /** 存放物料条码,入库扫描条码时,从打印条码记录表中获取,关联条码信息的barcode_info */ @Excel(name = "存放物料条码,入库扫描条码时,从打印条码记录表中获取,关联条码信息的barcode_info") private String materialBarcode; @@ -41,14 +37,21 @@ public class WmsMoveDetail extends BaseEntity @Excel(name = "物料ID") private Long materialId; + private String locationCode; + /** 计划数量 */ @Excel(name = "计划数量") private BigDecimal planAmount; - /** 实际数量 */ - @Excel(name = "实际数量") + /** 实际出库数量 */ + @Excel(name = "实际出库数量") private BigDecimal realAmount; + /** 实际入库数量 */ + @Excel(name = "实际入库数量") + private BigDecimal realInstockAmount; + + /** 执行状态(0待执行,1执行中,2执行完成) */ @Excel(name = "执行状态(0待执行,1执行中,2执行完成)") private String executeStatus; @@ -62,9 +65,11 @@ public class WmsMoveDetail extends BaseEntity @Excel(name = "执行时间", width = 30, dateFormat = "yyyy-MM-dd") private Date executeTime; - /** 移库明细类型(1出库2入库) */ - @Excel(name = "移库明细类型(1出库2入库)") - private String moveDetailType; + /** 执行时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "执行结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date executeEndTime; + /** 使用机台名称;入库扫描条码时,从打印条码记录表中获取 */ @Excel(name = "使用机台名称;入库扫描条码时,从打印条码记录表中获取") @@ -84,157 +89,199 @@ public class WmsMoveDetail extends BaseEntity @Excel(name = "有效标记") private String activeFlag; - public void setMoveDetailId(Long moveDetailId) + private String materialName; + + /**移库合库记录执行状态*/ + private String moveExecuteStatus; + + /**移库合库记录执行状态,多个值使用*/ + private String moveExecuteStatusStr; + + + + public void setMoveDetailId(Long moveDetailId) { this.moveDetailId = moveDetailId; } - public Long getMoveDetailId() + public Long getMoveDetailId() { return moveDetailId; } - public void setMoveId(Long moveId) + public void setMoveId(Long moveId) { this.moveId = moveId; } - public Long getMoveId() + public Long getMoveId() { return moveId; } - public void setLocationCode(String locationCode) - { - this.locationCode = locationCode; - } - - public String getLocationCode() - { - return locationCode; - } - public void setMaterialBarcode(String materialBarcode) + public void setMaterialBarcode(String materialBarcode) { this.materialBarcode = materialBarcode; } - public String getMaterialBarcode() + public String getMaterialBarcode() { return materialBarcode; } - public void setInstockBatch(String instockBatch) + public void setInstockBatch(String instockBatch) { this.instockBatch = instockBatch; } - public String getInstockBatch() + public String getInstockBatch() { return instockBatch; } - public void setMaterialId(Long materialId) + + public String getLocationCode() { + return locationCode; + } + + public void setLocationCode(String locationCode) { + this.locationCode = locationCode; + } + + public void setMaterialId(Long materialId) { this.materialId = materialId; } - public Long getMaterialId() + public Long getMaterialId() { return materialId; } - public void setPlanAmount(BigDecimal planAmount) + public void setPlanAmount(BigDecimal planAmount) { this.planAmount = planAmount; } - public BigDecimal getPlanAmount() + public BigDecimal getPlanAmount() { return planAmount; } - public void setRealAmount(BigDecimal realAmount) + public void setRealAmount(BigDecimal realAmount) { this.realAmount = realAmount; } - public BigDecimal getRealAmount() + public BigDecimal getRealAmount() { return realAmount; } - public void setExecuteStatus(String executeStatus) + + public BigDecimal getRealInstockAmount() { + return realInstockAmount; + } + + public void setRealInstockAmount(BigDecimal realInstockAmount) { + this.realInstockAmount = realInstockAmount; + } + + public void setExecuteStatus(String executeStatus) { this.executeStatus = executeStatus; } - public String getExecuteStatus() + public String getExecuteStatus() { return executeStatus; } - public void setExecutePerson(String executePerson) + public void setExecutePerson(String executePerson) { this.executePerson = executePerson; } - public String getExecutePerson() + public String getExecutePerson() { return executePerson; } - public void setExecuteTime(Date executeTime) + public void setExecuteTime(Date executeTime) { this.executeTime = executeTime; } - public Date getExecuteTime() + public Date getExecuteTime() { return executeTime; } - public void setMoveDetailType(String moveDetailType) - { - this.moveDetailType = moveDetailType; + + public Date getExecuteEndTime() { + return executeEndTime; } - public String getMoveDetailType() - { - return moveDetailType; + public void setExecuteEndTime(Date executeEndTime) { + this.executeEndTime = executeEndTime; } - public void setMachineName(String machineName) + + public void setMachineName(String machineName) { this.machineName = machineName; } - public String getMachineName() + public String getMachineName() { return machineName; } - public void setCreateDate(Date createDate) + public void setCreateDate(Date createDate) { this.createDate = createDate; } - public Date getCreateDate() + public Date getCreateDate() { return createDate; } - public void setUpdateDate(Date updateDate) + public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } - public Date getUpdateDate() + public Date getUpdateDate() { return updateDate; } - public void setActiveFlag(String activeFlag) + public void setActiveFlag(String activeFlag) { this.activeFlag = activeFlag; } - public String getActiveFlag() + public String getActiveFlag() { return activeFlag; } + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMoveExecuteStatus() { + return moveExecuteStatus; + } + + public void setMoveExecuteStatus(String moveExecuteStatus) { + this.moveExecuteStatus = moveExecuteStatus; + } + + public String getMoveExecuteStatusStr() { + return moveExecuteStatusStr; + } + + public void setMoveExecuteStatusStr(String moveExecuteStatusStr) { + this.moveExecuteStatusStr = moveExecuteStatusStr; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("moveDetailId", getMoveDetailId()) .append("moveId", getMoveId()) - .append("locationCode", getLocationCode()) .append("materialBarcode", getMaterialBarcode()) .append("instockBatch", getInstockBatch()) .append("materialId", getMaterialId()) @@ -243,7 +290,6 @@ public class WmsMoveDetail extends BaseEntity .append("executeStatus", getExecuteStatus()) .append("executePerson", getExecutePerson()) .append("executeTime", getExecuteTime()) - .append("moveDetailType", getMoveDetailType()) .append("machineName", getMachineName()) .append("createBy", getCreateBy()) .append("createDate", getCreateDate()) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductInstock.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductInstock.java index 962494d..0f7b252 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductInstock.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsProductInstock.java @@ -1,5 +1,6 @@ package com.hw.wms.domain; +import java.math.BigDecimal; import java.util.List; import java.util.Date; @@ -71,6 +72,22 @@ public class WmsProductInstock extends BaseEntity { @Excel(name = "入库类型(1生产入库,2移库入库,3合库入库,4出半成品库,9其他入库)") private String instockType; + /** 成品ID */ + @Excel(name = "成品ID") + private Long productId; + + /** 成品批次,等于成品条码 */ + @Excel(name = "成品批次,等于成品条码") + private String productBatch; + + /** 入库数量 */ + @Excel(name = "入库数量") + private BigDecimal instockAmount; + + /** 托盘RFID代码 */ + @Excel(name = "托盘RFID代码") + private String palletInfoCode; + /** * 申请原因 */ @@ -219,6 +236,38 @@ public class WmsProductInstock extends BaseEntity { return instockType; } + public Long getProductId() { + return productId; + } + + public void setProductId(Long productId) { + this.productId = productId; + } + + public String getProductBatch() { + return productBatch; + } + + public void setProductBatch(String productBatch) { + this.productBatch = productBatch; + } + + public BigDecimal getInstockAmount() { + return instockAmount; + } + + public void setInstockAmount(BigDecimal instockAmount) { + this.instockAmount = instockAmount; + } + + public String getPalletInfoCode() { + return palletInfoCode; + } + + public void setPalletInfoCode(String palletInfoCode) { + this.palletInfoCode = palletInfoCode; + } + public void setApplyReason(String applyReason) { this.applyReason = applyReason; } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawOutstock.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawOutstock.java index 286f7b5..e3bd748 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawOutstock.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawOutstock.java @@ -1,5 +1,6 @@ package com.hw.wms.domain; +import java.math.BigDecimal; import java.util.List; import java.util.Date; @@ -44,7 +45,7 @@ public class WmsRawOutstock extends BaseEntity { /** * 工单ID,关联pd_base_order_info的order_id */ - @Excel(name = "工单ID,关联pd_base_order_info的order_id") + @Excel(name = "销售订单ID") private Long orderId; /** @@ -71,6 +72,22 @@ public class WmsRawOutstock extends BaseEntity { @Excel(name = "成品ID,关联物料表物料id") private Long productId; + /** 物料批次 */ + @Excel(name = "物料条码") + private String materialBatch; + + /** 托盘RFID代码 */ + @Excel(name = "托盘RFID代码") + private String palletInfoCode; + + /** 出库数量 */ + @Excel(name = "出库数量") + private BigDecimal outstockAmount; + + /** 出库目的地 */ + @Excel(name = "出库目的地") + private String endStationCode; + /** * 操作类型(0自动,1手动,2强制,3调度) */ @@ -233,6 +250,38 @@ public class WmsRawOutstock extends BaseEntity { return productId; } + public String getMaterialBatch() { + return materialBatch; + } + + public void setMaterialBatch(String materialBatch) { + this.materialBatch = materialBatch; + } + + public String getPalletInfoCode() { + return palletInfoCode; + } + + public void setPalletInfoCode(String palletInfoCode) { + this.palletInfoCode = palletInfoCode; + } + + public BigDecimal getOutstockAmount() { + return outstockAmount; + } + + public void setOutstockAmount(BigDecimal outstockAmount) { + this.outstockAmount = outstockAmount; + } + + public String getEndStationCode() { + return endStationCode; + } + + public void setEndStationCode(String endStationCode) { + this.endStationCode = endStationCode; + } + public void setOperationType(String operationType) { this.operationType = operationType; } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsMoveMergeVo.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsMoveMergeVo.java deleted file mode 100644 index 1b466cc..0000000 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsMoveMergeVo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.hw.wms.domain.vo; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -@Data -public class WmsMoveMergeVo { - - //仓库ID - @NotNull(message="仓库ID必须输入") - private Long warehouseId; - - @NotBlank(message="原库位必须输入") - private String oriLocationCode; - - @NotBlank(message="目标库位必须输入") - private String targetLocationCode; - -} diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsMoveVo.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsMoveVo.java new file mode 100644 index 0000000..984a3ec --- /dev/null +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsMoveVo.java @@ -0,0 +1,36 @@ +package com.hw.wms.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +/** + * @Description: 移库合库VO对象 + * @ClassName: WmsMoveMergeVo + * @Author : xins + * @Date :2024-03-25 9:58 + * @Version :1.0 + */ +@Data +public class WmsMoveVo { + + @NotBlank(message="库位编码必须输入") + private String locationCode; + + @NotBlank(message="物料条码必须输入") + private String materialBarcode; + + //数量 + @NotNull(message="数量必须输入") + private BigDecimal applyQty; + + //数量 + @NotNull(message="moveId必须输入") + private Long moveId; + + @NotBlank(message="类型必须输入") + private String moveType; + +} diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsMoveDetailMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsMoveDetailMapper.java new file mode 100644 index 0000000..4493c30 --- /dev/null +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsMoveDetailMapper.java @@ -0,0 +1,85 @@ +package com.hw.wms.mapper; + +import java.util.List; +import com.hw.wms.domain.WmsMoveDetail; +import org.apache.ibatis.annotations.Param; + +/** + * 移库合库记录明细Mapper接口 + * + * @author xins + * @date 2024-03-25 + */ +public interface WmsMoveDetailMapper +{ + /** + * 查询移库合库记录明细 + * + * @param moveDetailId 移库合库记录明细主键 + * @return 移库合库记录明细 + */ + public WmsMoveDetail selectWmsMoveDetailByMoveDetailId(Long moveDetailId); + + /** + * 查询移库合库记录明细列表 + * + * @param wmsMoveDetail 移库合库记录明细 + * @return 移库合库记录明细集合 + */ + public List selectWmsMoveDetailList(WmsMoveDetail wmsMoveDetail); + + /** + * 新增移库合库记录明细 + * + * @param wmsMoveDetail 移库合库记录明细 + * @return 结果 + */ + public int insertWmsMoveDetail(WmsMoveDetail wmsMoveDetail); + + /** + * 修改移库合库记录明细 + * + * @param wmsMoveDetail 移库合库记录明细 + * @return 结果 + */ + public int updateWmsMoveDetail(WmsMoveDetail wmsMoveDetail); + + /** + * 删除移库合库记录明细 + * + * @param moveDetailId 移库合库记录明细主键 + * @return 结果 + */ + public int deleteWmsMoveDetailByMoveDetailId(Long moveDetailId); + + /** + * 批量删除移库合库记录明细 + * + * @param moveDetailIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWmsMoveDetailByMoveDetailIds(Long[] moveDetailIds); + + + + + /** + * 查询移库合库记录明细 + * + * @param moveId 移库合库记录主键 + * @param batchCode 物料批次 + * @return 移库合库记录明细 + */ + public WmsMoveDetail selectWmsMoveDetailByMoveIdAndBatchCode(@Param("moveId") Long moveId, + @Param("batchCode") String batchCode); + + + /** + * 查询移库合库记录明细列表,join material + * + * @param wmsMoveDetail 移库合库记录明细 + * @return 移库合库记录明细集合 + */ + public List selectWmsMoveDetailJoinList(WmsMoveDetail wmsMoveDetail); + +} diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsMoveMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsMoveMapper.java index 6c92822..f3de53a 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsMoveMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsMoveMapper.java @@ -6,15 +6,15 @@ import com.hw.wms.domain.WmsMoveDetail; /** * 移库合库记录Mapper接口 - * + * * @author xins * @date 2024-01-09 */ -public interface WmsMoveMapper +public interface WmsMoveMapper { /** * 查询移库合库记录 - * + * * @param moveId 移库合库记录主键 * @return 移库合库记录 */ @@ -22,7 +22,7 @@ public interface WmsMoveMapper /** * 查询移库合库记录列表 - * + * * @param wmsMove 移库合库记录 * @return 移库合库记录集合 */ @@ -30,7 +30,7 @@ public interface WmsMoveMapper /** * 新增移库合库记录 - * + * * @param wmsMove 移库合库记录 * @return 结果 */ @@ -38,7 +38,7 @@ public interface WmsMoveMapper /** * 修改移库合库记录 - * + * * @param wmsMove 移库合库记录 * @return 结果 */ @@ -46,7 +46,7 @@ public interface WmsMoveMapper /** * 删除移库合库记录 - * + * * @param moveId 移库合库记录主键 * @return 结果 */ @@ -54,7 +54,7 @@ public interface WmsMoveMapper /** * 批量删除移库合库记录 - * + * * @param moveIds 需要删除的数据主键集合 * @return 结果 */ @@ -62,26 +62,39 @@ public interface WmsMoveMapper /** * 批量删除移库合库记录明细;原材料入库记录对应的明细信息 - * + * * @param moveIds 需要删除的数据主键集合 * @return 结果 */ public int deleteWmsMoveDetailByMoveIds(Long[] moveIds); - + /** * 批量新增移库合库记录明细;原材料入库记录对应的明细信息 - * + * * @param wmsMoveDetailList 移库合库记录明细;原材料入库记录对应的明细信息列表 * @return 结果 */ public int batchWmsMoveDetail(List wmsMoveDetailList); - + /** * 通过移库合库记录主键删除移库合库记录明细;原材料入库记录对应的明细信息信息 - * + * * @param moveId 移库合库记录ID * @return 结果 */ public int deleteWmsMoveDetailByMoveId(Long moveId); + + + + + + + /** + * 查询移库合库记录列表,Join warehouse + * + * @param wmsMove 移库合库记录 + * @return 移库合库记录集合 + */ + public List selectWmsMoveJoinList(WmsMove wmsMove); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsMoveMergeService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsMoveMergeService.java index 14c96c7..d9ff116 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsMoveMergeService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsMoveMergeService.java @@ -1,6 +1,6 @@ package com.hw.wms.service; -import com.hw.wms.domain.vo.WmsMoveMergeVo; +import com.hw.wms.domain.vo.WmsMoveVo; /** * @Description: 移库Service接口 @@ -16,5 +16,5 @@ public interface IWmsMoveMergeService { * @param wmsMoveMergeVo * @return */ - public int manualMove(WmsMoveMergeVo wmsMoveMergeVo, String manualMergeType); + public int manualMove(WmsMoveVo wmsMoveMergeVo, String manualMergeType); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsMoveService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsMoveService.java index 5b7c820..5e12c18 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsMoveService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsMoveService.java @@ -2,18 +2,20 @@ package com.hw.wms.service; import java.util.List; import com.hw.wms.domain.WmsMove; +import com.hw.wms.domain.WmsMoveDetail; +import com.hw.wms.domain.vo.WmsMoveVo; /** * 移库合库记录Service接口 - * + * * @author xins * @date 2024-01-09 */ -public interface IWmsMoveService +public interface IWmsMoveService { /** * 查询移库合库记录 - * + * * @param moveId 移库合库记录主键 * @return 移库合库记录 */ @@ -21,7 +23,7 @@ public interface IWmsMoveService /** * 查询移库合库记录列表 - * + * * @param wmsMove 移库合库记录 * @return 移库合库记录集合 */ @@ -29,7 +31,7 @@ public interface IWmsMoveService /** * 新增移库合库记录 - * + * * @param wmsMove 移库合库记录 * @return 结果 */ @@ -37,7 +39,7 @@ public interface IWmsMoveService /** * 修改移库合库记录 - * + * * @param wmsMove 移库合库记录 * @return 结果 */ @@ -45,7 +47,7 @@ public interface IWmsMoveService /** * 批量删除移库合库记录 - * + * * @param moveIds 需要删除的移库合库记录主键集合 * @return 结果 */ @@ -53,9 +55,51 @@ public interface IWmsMoveService /** * 删除移库合库记录信息 - * + * * @param moveId 移库合库记录主键 * @return 结果 */ public int deleteWmsMoveByMoveId(Long moveId); + + + + + + + /** + * 查询移库合库记录列表,Join warehouse + * + * @param wmsMove 移库合库记录 + * @return 移库合库记录 + */ + public List selectWmsMoveJoinList(WmsMove wmsMove); + + /** + * 申请移库 + * @param wmsMove + * @return + */ + public int applyMove(WmsMove wmsMove); + + /** + * 获取移库合库记录明细,join material + * @param wmsMoveDetail + * @return + */ + public List selectWmsMoveDetailJoinList(WmsMoveDetail wmsMoveDetail); + + + /** + * 人工移库出库 + * @param wmsMoveVo + * @return + */ + public int moveOutstock(WmsMoveVo wmsMoveVo); + + /** + * 人工移库入库 + * @param wmsMoveVo + * @return + */ + public int moveInstock(WmsMoveVo wmsMoveVo); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsProductOutstockService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsProductOutstockService.java index cf02957..707034a 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsProductOutstockService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsProductOutstockService.java @@ -2,6 +2,7 @@ package com.hw.wms.service; import java.util.List; import com.hw.wms.domain.WmsProductOutstock; +import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo; /** * 成品出库记录Service接口 @@ -74,4 +75,12 @@ public interface IWmsProductOutstockService * @return 成品出库记录 */ public WmsProductOutstock selectWmsProductOutstockJoinByOutstockId(Long productOutstockId); + + + /** + * 成品出库后,在一楼进行最终确认 + * @param wmsProductOutstockConfirmVo + * @return + */ + public int finalConfirmProductOutstock(WmsProductOutstockConfirmVo wmsProductOutstockConfirmVo); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsMoveMergeServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsMoveMergeServiceImpl.java index 8032aa7..2339188 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsMoveMergeServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsMoveMergeServiceImpl.java @@ -1,10 +1,8 @@ package com.hw.wms.service.impl; -import com.hw.common.core.constant.WmsConstants; -import com.hw.wms.domain.WmsBaseWarehouse; import com.hw.wms.domain.WmsProductStock; import com.hw.wms.domain.WmsRawStock; -import com.hw.wms.domain.vo.WmsMoveMergeVo; +import com.hw.wms.domain.vo.WmsMoveVo; import com.hw.wms.mapper.*; import com.hw.wms.service.IWmsMoveMergeService; import org.springframework.beans.factory.annotation.Autowired; @@ -47,12 +45,12 @@ public class WmsMoveMergeServiceImpl implements IWmsMoveMergeService { * @return */ @Override - public int manualMove(WmsMoveMergeVo wmsMoveMergeVo,String manualMergeType){ - Long warehouseId = wmsMoveMergeVo.getWarehouseId(); - String oriLocationCode = wmsMoveMergeVo.getOriLocationCode(); - String targetLocationCode = wmsMoveMergeVo.getTargetLocationCode(); - WmsBaseWarehouse warehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseWithLocationByWarehouseId(warehouseId); - String warehouseInstockType = warehouse.getWarehouseInstockType(); + public int manualMove(WmsMoveVo wmsMoveMergeVo, String manualMergeType){ +// Long warehouseId = wmsMoveMergeVo.getWarehouseId(); +// String oriLocationCode = wmsMoveMergeVo.getOriLocationCode(); +// String targetLocationCode = wmsMoveMergeVo.getTargetLocationCode(); +// WmsBaseWarehouse warehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseWithLocationByWarehouseId(warehouseId); +// String warehouseInstockType = warehouse.getWarehouseInstockType(); //仓库类型为人工仓库 @@ -77,12 +75,12 @@ public class WmsMoveMergeServiceImpl implements IWmsMoveMergeService { * @param wmsMoveMergeVo * @return */ - public int manualMerge(WmsMoveMergeVo wmsMoveMergeVo){ - Long warehouseId = wmsMoveMergeVo.getWarehouseId(); - String oriLocationCode = wmsMoveMergeVo.getOriLocationCode(); - String targetLocationCode = wmsMoveMergeVo.getTargetLocationCode(); - WmsBaseWarehouse warehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseWithLocationByWarehouseId(warehouseId); - String warehouseInstockType = warehouse.getWarehouseInstockType(); + public int manualMerge(WmsMoveVo wmsMoveMergeVo){ +// Long warehouseId = wmsMoveMergeVo.getWarehouseId(); +// String oriLocationCode = wmsMoveMergeVo.getOriLocationCode(); +// String targetLocationCode = wmsMoveMergeVo.getTargetLocationCode(); +// WmsBaseWarehouse warehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseWithLocationByWarehouseId(warehouseId); +// String warehouseInstockType = warehouse.getWarehouseInstockType(); return 1; diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsMoveServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsMoveServiceImpl.java index b502aee..7ef0b12 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsMoveServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsMoveServiceImpl.java @@ -1,62 +1,95 @@ package com.hw.wms.service.impl; +import java.math.BigDecimal; +import java.util.Date; import java.util.List; + +import com.hw.common.core.constant.MesConstants; +import com.hw.common.core.constant.SecurityConstants; +import com.hw.common.core.constant.WmsConstants; +import com.hw.common.core.domain.R; +import com.hw.common.core.exception.ServiceException; +import com.hw.common.core.utils.uuid.Seq; +import com.hw.common.security.utils.SecurityUtils; +import com.hw.mes.api.RemoteMesService; +import com.hw.mes.api.domain.MesBaseBarcodeInfo; +import com.hw.wms.domain.*; +import com.hw.wms.domain.vo.WmsMoveVo; +import com.hw.wms.mapper.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + import java.util.ArrayList; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + import com.hw.common.core.utils.StringUtils; import org.springframework.transaction.annotation.Transactional; -import com.hw.wms.domain.WmsMoveDetail; -import com.hw.wms.mapper.WmsMoveMapper; -import com.hw.wms.domain.WmsMove; import com.hw.wms.service.IWmsMoveService; +import javax.annotation.Resource; + /** * 移库合库记录Service业务层处理 - * + * * @author xins * @date 2024-01-09 */ @Service -public class WmsMoveServiceImpl implements IWmsMoveService -{ +public class WmsMoveServiceImpl implements IWmsMoveService { @Autowired private WmsMoveMapper wmsMoveMapper; + @Autowired + private WmsMoveDetailMapper wmsMoveDetailMapper; + + @Autowired + private WmsBaseLocationMapper wmsBaseLocationMapper; + + @Autowired + private WmsBaseWarehouseMapper wmsBaseWarehouseMapper; + + @Autowired + private WmsRawStockMapper wmsRawStockMapper; + + @Autowired + private WmsProductStockMapper wmsProductStockMapper; + + @Resource + private RemoteMesService remoteMesService; + /** * 查询移库合库记录 - * + * * @param moveId 移库合库记录主键 * @return 移库合库记录 */ @Override - public WmsMove selectWmsMoveByMoveId(Long moveId) - { + public WmsMove selectWmsMoveByMoveId(Long moveId) { return wmsMoveMapper.selectWmsMoveByMoveId(moveId); } /** * 查询移库合库记录列表 - * + * * @param wmsMove 移库合库记录 * @return 移库合库记录 */ @Override - public List selectWmsMoveList(WmsMove wmsMove) - { + public List selectWmsMoveList(WmsMove wmsMove) { return wmsMoveMapper.selectWmsMoveList(wmsMove); } /** * 新增移库合库记录 - * + * * @param wmsMove 移库合库记录 * @return 结果 */ @Transactional @Override - public int insertWmsMove(WmsMove wmsMove) - { + public int insertWmsMove(WmsMove wmsMove) { int rows = wmsMoveMapper.insertWmsMove(wmsMove); insertWmsMoveDetail(wmsMove); return rows; @@ -64,14 +97,13 @@ public class WmsMoveServiceImpl implements IWmsMoveService /** * 修改移库合库记录 - * + * * @param wmsMove 移库合库记录 * @return 结果 */ @Transactional @Override - public int updateWmsMove(WmsMove wmsMove) - { + public int updateWmsMove(WmsMove wmsMove) { wmsMoveMapper.deleteWmsMoveDetailByMoveId(wmsMove.getMoveId()); insertWmsMoveDetail(wmsMove); return wmsMoveMapper.updateWmsMove(wmsMove); @@ -79,53 +111,647 @@ public class WmsMoveServiceImpl implements IWmsMoveService /** * 批量删除移库合库记录 - * + * * @param moveIds 需要删除的移库合库记录主键 * @return 结果 */ @Transactional @Override - public int deleteWmsMoveByMoveIds(Long[] moveIds) - { + public int deleteWmsMoveByMoveIds(Long[] moveIds) { wmsMoveMapper.deleteWmsMoveDetailByMoveIds(moveIds); return wmsMoveMapper.deleteWmsMoveByMoveIds(moveIds); } /** * 删除移库合库记录信息 - * + * * @param moveId 移库合库记录主键 * @return 结果 */ @Transactional @Override - public int deleteWmsMoveByMoveId(Long moveId) - { + public int deleteWmsMoveByMoveId(Long moveId) { wmsMoveMapper.deleteWmsMoveDetailByMoveId(moveId); return wmsMoveMapper.deleteWmsMoveByMoveId(moveId); } /** * 新增移库合库记录明细;原材料入库记录对应的明细信息信息 - * + * * @param wmsMove 移库合库记录对象 */ - public void insertWmsMoveDetail(WmsMove wmsMove) - { + public void insertWmsMoveDetail(WmsMove wmsMove) { List wmsMoveDetailList = wmsMove.getWmsMoveDetailList(); Long moveId = wmsMove.getMoveId(); - if (StringUtils.isNotNull(wmsMoveDetailList)) - { + if (StringUtils.isNotNull(wmsMoveDetailList)) { List list = new ArrayList(); - for (WmsMoveDetail wmsMoveDetail : wmsMoveDetailList) - { + for (WmsMoveDetail wmsMoveDetail : wmsMoveDetailList) { wmsMoveDetail.setMoveId(moveId); list.add(wmsMoveDetail); } - if (list.size() > 0) - { + if (list.size() > 0) { wmsMoveMapper.batchWmsMoveDetail(list); } } } + + + /** + * 查询移库合库记录列表,Join warehouse + * + * @param wmsMove 移库合库记录 + * @return 移库合库记录 + */ + @Override + public List selectWmsMoveJoinList(WmsMove wmsMove) { + return wmsMoveMapper.selectWmsMoveJoinList(wmsMove); + } + + + /** + * 申请移库 + * + * @param wmsMove + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int applyMove(WmsMove wmsMove) { + String oriLocationCode = wmsMove.getOriLocationCode(); + String targetLocationCode = wmsMove.getTargetLocationCode(); + if (oriLocationCode.equals(targetLocationCode)) { + throw new ServiceException("原库位与目标库位不能相同"); + } + + WmsBaseLocation oriLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(oriLocationCode); + if (oriLocation == null) { + throw new ServiceException("原库位不存在"); + } + String oriLocationStatus = oriLocation.getLocationStatus(); + if (!oriLocationStatus.equals(WmsConstants.WMS_BASE_LOCATION_STATUS_NORMAL)) { + throw new ServiceException("原库位已经锁定,不能进行移库"); + } + + WmsBaseLocation targetLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(targetLocationCode); + if (targetLocation == null) { + throw new ServiceException("目标库位不存在"); + } + + String targetLocationStatus = targetLocation.getLocationStatus(); + if (!targetLocationStatus.equals(WmsConstants.WMS_BASE_LOCATION_STATUS_NORMAL)) { + throw new ServiceException("目标库位已经锁定,不能进行移库"); + } + + if (!oriLocation.getWarehouseId().equals(targetLocation.getWarehouseId())) { + throw new ServiceException("原库位和目标库位需为一个仓库"); + } + + WmsBaseWarehouse baseWareHouse = wmsBaseWarehouseMapper. + selectWmsBaseWarehouseByWarehouseId(wmsMove.getWarehouseId()); + String warehouseInstockType = baseWareHouse.getWarehouseInstockType(); + List toInsertedMoveDetails = new ArrayList<>(); + if (warehouseInstockType.equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_RAW)) {//如果是原材料 + WmsRawStock queryRawStock = new WmsRawStock(); + queryRawStock.setLocationCode(oriLocationCode); + List wmsRawStocks = wmsRawStockMapper.selectWmsRawStockInList(queryRawStock); + if (wmsRawStocks == null || wmsRawStocks.isEmpty()) { + throw new ServiceException("原库位无库存信息,不能进行移库"); + } + List occupyRawStocks = wmsRawStocks.stream().filter + (e -> (e.getOccupyAmount().compareTo(BigDecimal.ZERO) > 0 || e.getFrozenAmount().compareTo(BigDecimal.ZERO) > 0)) + .collect(Collectors.toList()); + if (occupyRawStocks != null && !occupyRawStocks.isEmpty()) { + throw new ServiceException("原库位有占用库存信息,不能进行移库"); + } + + //目标库位需要是空库位 + WmsRawStock queryTargetRawStock = new WmsRawStock(); + queryTargetRawStock.setLocationCode(targetLocationCode); + List targetRawStocks = wmsRawStockMapper.selectWmsRawStockInList(queryTargetRawStock); + if (targetRawStocks != null && !targetRawStocks.isEmpty()) { + throw new ServiceException("目标库位有库存,不能进行移库"); + } + + toInsertedMoveDetails = getMoveDetailsByRawStocks(wmsRawStocks); + } else {//如果是成品 + WmsProductStock queryProductStock = new WmsProductStock(); + queryProductStock.setLocationCode(oriLocationCode); + List productStocks = wmsProductStockMapper.selectWmsProductStockInList(queryProductStock); + if (productStocks == null || productStocks.isEmpty()) { + throw new ServiceException("原库位无库存信息,不能进行移库"); + } + List occupyProductStocks = productStocks.stream().filter + (e -> (e.getOccupyAmount().compareTo(BigDecimal.ZERO) > 0 || e.getFrozenAmount().compareTo(BigDecimal.ZERO) > 0)) + .collect(Collectors.toList()); + if (occupyProductStocks != null && !occupyProductStocks.isEmpty()) { + throw new ServiceException("原库位有占用库存信息,不能进行移库"); + } + + //目标库位需要是空库位 + WmsProductStock queryTargetProductStock = new WmsProductStock(); + queryTargetProductStock.setLocationCode(targetLocationCode); + List targetProductStocks = wmsProductStockMapper.selectWmsProductStockInList(queryTargetProductStock); + if (targetProductStocks != null && !targetProductStocks.isEmpty()) { + throw new ServiceException("目标库位有库存,不能进行移库"); + } + + toInsertedMoveDetails = getMoveDetailsByProductStocks(productStocks); + } + + Date currentDate = new Date(); + String userName = SecurityUtils.getUsername(); + oriLocation.setLocationStatus(WmsConstants.WMS_BASE_LOCATION_STATUS_MOVE_LOCK); + oriLocation.setUpdateTime(currentDate); + oriLocation.setUpdateBy(userName); + wmsBaseLocationMapper.updateWmsBaseLocation(oriLocation); + + targetLocation.setLocationStatus(WmsConstants.WMS_BASE_LOCATION_STATUS_MOVE_LOCK); + targetLocation.setUpdateTime(currentDate); + targetLocation.setUpdateBy(userName); + wmsBaseLocationMapper.updateWmsBaseLocation(targetLocation); + + wmsMove.setTaskCode(Seq.getId(Seq.wmsMoveSeqType, Seq.wmsMoveSeqCode)); + wmsMove.setOperationType(WmsConstants.WMS_OPERATION_TYPE_MANUAL); + wmsMove.setMoveWay(WmsConstants.WMS_MOVEMERGE_WAY_MANUAL); + wmsMove.setMoveType(WmsConstants.WMS_MOVEMERGE_TYPE_MOVE); + wmsMove.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS); + wmsMove.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE); + wmsMove.setApplyBy(userName); + wmsMove.setApplyDate(currentDate); + int rows = wmsMoveMapper.insertWmsMove(wmsMove); + + batchInsertMoveDetails(toInsertedMoveDetails, wmsMove.getMoveId(), userName, currentDate); + + return rows; + } + + public List getMoveDetailsByRawStocks(List wmsRawStocks) { + List wmsMoveDetailList = new ArrayList<>(); + wmsRawStocks.forEach(wmsRawStock -> { + WmsMoveDetail wmsMoveDetail = new WmsMoveDetail(); + wmsMoveDetail.setInstockBatch(wmsRawStock.getInstockBatch()); + wmsMoveDetail.setMaterialId(wmsRawStock.getMaterialId()); + wmsMoveDetail.setPlanAmount(wmsRawStock.getTotalAmount()); + wmsMoveDetail.setExecuteStatus(WmsConstants.WMS_MOVE_EXECUTE_STATUS_TOEXECUTE); + wmsMoveDetailList.add(wmsMoveDetail); + }); + return wmsMoveDetailList; + } + + public List getMoveDetailsByProductStocks(List wmsProductStocks) { + List wmsMoveDetailList = new ArrayList<>(); + wmsProductStocks.forEach(wmsProductStock -> { + WmsMoveDetail wmsMoveDetail = new WmsMoveDetail(); + wmsMoveDetail.setInstockBatch(wmsProductStock.getProductBatch()); + wmsMoveDetail.setMaterialId(wmsProductStock.getProductId()); + wmsMoveDetail.setPlanAmount(wmsProductStock.getTotalAmount()); + wmsMoveDetail.setExecuteStatus(WmsConstants.WMS_MOVE_EXECUTE_STATUS_TOEXECUTE); + wmsMoveDetailList.add(wmsMoveDetail); + }); + return wmsMoveDetailList; + } + + public void batchInsertMoveDetails(List wmsMoveDetailList, Long moveId, String userName, Date currentDate) { + wmsMoveDetailList.forEach(moveDetail -> { + moveDetail.setMoveId(moveId); + moveDetail.setCreateBy(userName); + moveDetail.setCreateDate(currentDate); + }); + wmsMoveMapper.batchWmsMoveDetail(wmsMoveDetailList); + } + + + /** + * 获取移库合库记录明细,join material + * + * @param wmsMoveDetail + * @return + */ + @Override + public List selectWmsMoveDetailJoinList(WmsMoveDetail wmsMoveDetail) { + return wmsMoveDetailMapper.selectWmsMoveDetailJoinList(wmsMoveDetail); + } + + /** + * 人工移库出库 + * + * @param wmsMoveVo + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int moveOutstock(WmsMoveVo wmsMoveVo) { + Long moveId = wmsMoveVo.getMoveId(); + String materialBarcode = wmsMoveVo.getMaterialBarcode(); + String locationCode = wmsMoveVo.getLocationCode(); + BigDecimal applyQty = wmsMoveVo.getApplyQty(); + if (applyQty.compareTo(BigDecimal.ZERO) <= 0) { + throw new ServiceException("出库数量需大于0"); + } + + R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); + MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); + if (baseBarcodeInfo == null) { + throw new ServiceException("物料编码有误"); + } + + WmsBaseLocation oriLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode); + if (oriLocation == null) { + throw new ServiceException("库位编码有误"); + } + + String userName = SecurityUtils.getUsername(); + Date currentDate = new Date(); + + String barcodeType = baseBarcodeInfo.getBarcodeType(); + if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_RAW)) {//如果是原材料 + moveOutUpdateRawStock(locationCode, baseBarcodeInfo.getBatchCode(), applyQty, userName, currentDate); + } else {//如果是成品 + moveOutUpdateProductStock(locationCode, baseBarcodeInfo.getBatchCode(), applyQty, userName, currentDate); + } + + WmsMoveDetail queryMoveDetail = new WmsMoveDetail(); + queryMoveDetail.setMoveId(moveId); + List wmsMoveDetailList = wmsMoveDetailMapper.selectWmsMoveDetailList(queryMoveDetail); + if (wmsMoveDetailList == null || wmsMoveDetailList.isEmpty()) { + throw new ServiceException("没有此移库信息"); + } + + Map moveDetailMap = wmsMoveDetailList.stream(). + collect(Collectors.toMap(WmsMoveDetail::getInstockBatch, wmsMoveDetail -> wmsMoveDetail)); + + WmsMoveDetail moveDetail = moveDetailMap.get(baseBarcodeInfo.getBatchCode()); + if (moveDetail == null) { + throw new ServiceException("没有此移库信息"); + } + + String executeStatus = moveDetail.getExecuteStatus(); + BigDecimal planAmount = moveDetail.getPlanAmount(); + BigDecimal realAmount = moveDetail.getRealAmount() == null ? BigDecimal.ZERO : moveDetail.getRealAmount(); + BigDecimal remainingAmount = planAmount.subtract(realAmount); + if (executeStatus.equals(WmsConstants.WMS_MOVE_EXECUTE_STATUS_OUTSTOCK_FINISH)) { + throw new ServiceException("已经移库出库完成,无需再出库"); + } + + if (executeStatus.equals(WmsConstants.WMS_MOVE_EXECUTE_STATUS_INSTOCK_FINISH)) { + throw new ServiceException("已经移库入库完成,无需再出库"); + } + + if (applyQty.compareTo(remainingAmount) > 0) { + throw new ServiceException("数量不能大于" + remainingAmount); + } + + WmsMove wmsMove = wmsMoveMapper.selectWmsMoveByMoveId(moveId); + if(!locationCode.equals(wmsMove.getOriLocationCode())){ + throw new ServiceException("库位错误"); + } + + String moveExecuteStatus = WmsConstants.WMS_MOVE_EXECUTE_STATUS_OUTSTOCK_FINISH; + if(moveDetail.getExecuteStatus().equals(WmsConstants.WMS_MOVE_EXECUTE_STATUS_TOEXECUTE)){ + moveDetail.setExecuteTime(currentDate); + moveDetail.setExecutePerson(userName); + } + if (applyQty.compareTo(remainingAmount) < 0) { + moveDetail.setRealAmount(applyQty.subtract(realAmount)); + moveDetail.setExecuteStatus(WmsConstants.WMS_MOVE_EXECUTE_STATUS_EXECUTING); + + } else { + moveDetail.setRealAmount(applyQty.subtract(realAmount)); + moveDetail.setExecuteStatus(WmsConstants.WMS_MOVE_EXECUTE_STATUS_OUTSTOCK_FINISH); + + for (WmsMoveDetail wmsMoveDetail : wmsMoveDetailList) { + if (!wmsMoveDetail.getMoveDetailId().equals(moveDetail.getMoveDetailId())) { + if (wmsMoveDetail.getExecuteStatus().equals(WmsConstants.WMS_MOVE_EXECUTE_STATUS_TOEXECUTE) + || wmsMoveDetail.getExecuteStatus().equals(WmsConstants.WMS_MOVE_EXECUTE_STATUS_EXECUTING)) { + moveExecuteStatus = WmsConstants.WMS_MOVE_EXECUTE_STATUS_EXECUTING; + } + } + } + + //解锁库位 + if (moveExecuteStatus.equals(WmsConstants.WMS_MOVE_EXECUTE_STATUS_OUTSTOCK_FINISH)){ + oriLocation.setLocationStatus(WmsConstants.WMS_BASE_LOCATION_STATUS_NORMAL); + oriLocation.setUpdateBy(userName); + oriLocation.setUpdateTime(currentDate); + wmsBaseLocationMapper.updateWmsBaseLocation(oriLocation); + } + } + + + wmsMoveDetailMapper.updateWmsMoveDetail(moveDetail); + + if (!wmsMove.getExecuteStatus().equals(moveExecuteStatus)) { + if (wmsMove.getExecuteStatus().equals(WmsConstants.WMS_MOVE_EXECUTE_STATUS_TOEXECUTE)) { + wmsMove.setBeginTime(currentDate); + } + wmsMove.setExecuteStatus(moveExecuteStatus); + wmsMoveMapper.updateWmsMove(wmsMove); + } + + return 1; + } + + + public void moveOutUpdateRawStock(String locationCode, String batchCode, BigDecimal applyQty, + String userName, Date currentDate) { + WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, batchCode); + if (wmsRawStock == null) { + throw new ServiceException("原库位无库存信息,不能进行移库"); + } + + BigDecimal totalAmount = wmsRawStock.getTotalAmount() == null ? BigDecimal.ZERO : wmsRawStock.getTotalAmount(); +// BigDecimal occupyAmount = wmsRawStock.getOccupyAmount() == null ? BigDecimal.ZERO : wmsRawStock.getOccupyAmount();//占用的不能移库 +// BigDecimal frozenAmount = wmsRawStock.getFrozenAmount() == null ? BigDecimal.ZERO : wmsRawStock.getFrozenAmount();//冻结的不能移库 +// BigDecimal availableAmount = totalAmount.subtract(occupyAmount).subtract(frozenAmount); + if (applyQty.compareTo(totalAmount) > 0) { + throw new ServiceException("移库出库数量不能大于" + totalAmount); + } + + totalAmount = totalAmount.subtract(applyQty); + if (totalAmount.compareTo(BigDecimal.ZERO) == 0) { + wmsRawStockMapper.deleteWmsRawStockByRawStockId(wmsRawStock.getRawStockId()); + } else { + wmsRawStock.setTotalAmount(totalAmount); + wmsRawStock.setUpdateBy(userName); + wmsRawStock.setUpdateDate(currentDate); + wmsRawStockMapper.updateWmsRawStock(wmsRawStock); + } + + } + + + public void moveOutUpdateProductStock(String locationCode, String batchCode, BigDecimal applyQty, + String userName, Date currentDate) { + + WmsProductStock wmsProductStock = wmsProductStockMapper.selectProductStockByBatch(batchCode); + if (wmsProductStock == null) { + throw new ServiceException("原库位无库存信息,不能进行移库"); + } + + BigDecimal totalAmount = wmsProductStock.getTotalAmount() == null ? BigDecimal.ZERO : wmsProductStock.getTotalAmount(); +// BigDecimal occupyAmount = wmsProductStock.getOccupyAmount() == null ? BigDecimal.ZERO : wmsProductStock.getOccupyAmount();//占用的不能移库 +// BigDecimal frozenAmount = wmsProductStock.getFrozenAmount() == null ? BigDecimal.ZERO : wmsProductStock.getFrozenAmount();//冻结的不能移库 +// BigDecimal availableAmount = totalAmount.subtract(occupyAmount).subtract(frozenAmount); + if (applyQty.compareTo(totalAmount) > 0) { + throw new ServiceException("移库出库数量不能大于" + totalAmount); + } + + totalAmount = totalAmount.subtract(applyQty); + if (totalAmount.compareTo(BigDecimal.ZERO) == 0) { + wmsProductStockMapper.deleteWmsProductStockByProductStockId(wmsProductStock.getProductStockId()); + } else { + wmsProductStock.setTotalAmount(totalAmount); + wmsProductStock.setUpdateBy(userName); + wmsProductStock.setUpdateDate(currentDate); + wmsProductStockMapper.updateWmsProductStock(wmsProductStock); + } + + } + + + /** + * 人工移库入库 + * + * @param wmsMoveVo + * @return + */ + public int moveInstock(WmsMoveVo wmsMoveVo) { + Long moveId = wmsMoveVo.getMoveId(); + String materialBarcode = wmsMoveVo.getMaterialBarcode(); + String locationCode = wmsMoveVo.getLocationCode(); + BigDecimal applyQty = wmsMoveVo.getApplyQty(); + if (applyQty.compareTo(BigDecimal.ZERO) <= 0) { + throw new ServiceException("入库数量需大于0"); + } + + R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); + MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); + if (baseBarcodeInfo == null) { + throw new ServiceException("物料编码有误"); + } + + WmsBaseLocation location = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode); + if (location == null) { + throw new ServiceException("库位编码有误"); + } + + String userName = SecurityUtils.getUsername(); + Date currentDate = new Date(); + + String barcodeType = baseBarcodeInfo.getBarcodeType(); + String moveExecuteStatus = ""; + + + WmsMoveDetail queryMoveDetail = new WmsMoveDetail(); + queryMoveDetail.setMoveId(moveId); + List moveDetails = wmsMoveDetailMapper.selectWmsMoveDetailList(queryMoveDetail); + if (moveDetails == null || moveDetails.isEmpty()) { + throw new ServiceException("没有移库出库记录"); + } + + Map moveDetailMap = moveDetails.stream(). + collect(Collectors.toMap(WmsMoveDetail::getMaterialBarcode, wmsMoveDetail -> wmsMoveDetail)); + + WmsMoveDetail wmsMoveDetail = moveDetailMap.get(materialBarcode); + if (wmsMoveDetail == null) { + throw new ServiceException("没有移库出库记录"); + } + + moveDetailMap.remove(wmsMoveDetail); + + if (wmsMoveDetail.getPlanAmount().compareTo(applyQty) != 0) { + throw new ServiceException("入库数量需等于" + wmsMoveDetail.getPlanAmount()); + } + + if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_RAW)) {//如果是原材料 +// moveExecuteStatus = moveInUpdateRawStock(Map < String, WmsMoveDetail > moveDetailMap); + } else {//如果是成品 +// moveExecuteStatus = updateProductStock(locationCode, baseBarcodeInfo.getBatchCode(), applyQty, userName, currentDate, location); + } + + if (moveExecuteStatus.equals(WmsConstants.WMS_MOVE_EXECUTE_STATUS_INSTOCK_FINISH)) { + WmsMove wmsMove = wmsMoveMapper.selectWmsMoveByMoveId(moveId); + wmsMove.setEndTime(currentDate); + wmsMove.setExecuteStatus(moveExecuteStatus); + wmsMoveMapper.updateWmsMove(wmsMove); + } + + wmsMoveDetail.setExecuteStatus(WmsConstants.WMS_MOVE_EXECUTE_STATUS_INSTOCK_FINISH); + wmsMoveDetail.setExecuteEndTime(currentDate); + wmsMoveDetail.setUpdateBy(userName); + wmsMoveDetail.setUpdateDate(currentDate); + + return wmsMoveDetailMapper.updateWmsMoveDetail(wmsMoveDetail); + } + + + public String moveInUpdateRawStock(Map moveDetailMap, String locationCode, + MesBaseBarcodeInfo mesBaseBarcodeInfo) { + String moveExecuteStatus = WmsConstants.WMS_MOVE_EXECUTE_STATUS_INSTOCK_FINISH; + //先判断是否已全部出库完成 + if (moveDetailMap != null || !moveDetailMap.isEmpty()) { + for (Map.Entry wmsMoveDetailEntry : moveDetailMap.entrySet()) { + WmsMoveDetail wmsMoveDetail = wmsMoveDetailEntry.getValue(); + if (!wmsMoveDetail.getExecuteStatus().equals(WmsConstants.WMS_MOVE_EXECUTE_STATUS_INSTOCK_FINISH)) { +// moveExecuteStatus = WmsConstants. + } + } + } + + + String batchCode = mesBaseBarcodeInfo.getBatchCode(); + WmsRawStock rawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, batchCode); + if (rawStock != null) { +// rawStock.setTotalAmount(); +// rawStock.setUpdateDate(); +// rawStock.setUpdateBy(); + wmsRawStockMapper.updateWmsRawStock(rawStock); + } else { + rawStock = new WmsRawStock(); +// rawStock.setTotalAmount(); +// rawStock.setLocationCode(); +// rawStock.setInstockBatch(); +// rawStock.setWarehouseId(); +// rawStock.setWarehouseFloor(); +// rawStock.setStockType(); +// rawStock.setMaterialId(); +// rawStock.setInstockDate();//条码中的入库时间 +// rawStock.setLastOutstockTime(); +// rawStock.setQualityStatus(); +// rawStock.setCompleteFlag(); +// rawStock.setCreateDate(); +// rawStock.setCreateBy(); + wmsRawStockMapper.insertWmsRawStock(rawStock); + } + return moveExecuteStatus; + } + + + /** + * 人工移库出库 + * + * @param wmsMoveVo + * @return + */ + /* @Override + @Transactional(rollbackFor = Exception.class) + public int moveOutstock(WmsMoveVo wmsMoveVo) { + String materialBarcode = wmsMoveVo.getMaterialBarcode(); + String locationCode = wmsMoveVo.getLocationCode(); + BigDecimal applyQty = wmsMoveVo.getApplyQty(); + if (applyQty.compareTo(BigDecimal.ZERO) <= 0) { + throw new ServiceException("出库数量需大于0"); + } + + R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); + MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); + if (baseBarcodeInfo == null) { + throw new ServiceException("物料编码有误"); + } + + String batchFlag = baseBarcodeInfo.getBatchFlag(); + if (!batchFlag.equals(MesConstants.IS_BATCH)) { + if (applyQty.compareTo(BigDecimal.ONE) > 0) { + throw new ServiceException("出库数量需等于1"); + } + } + + WmsBaseLocation location = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode); + if (location == null) { + throw new ServiceException("库位编码有误"); + } + + + String userName = SecurityUtils.getUsername(); + Date currentDate = new Date(); + + String barcodeType = baseBarcodeInfo.getBarcodeType(); + if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_RAW)) {//如果是原材料 + WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, baseBarcodeInfo.getBatchCode()); + if (wmsRawStock == null) { + throw new ServiceException("无库存信息"); + } + BigDecimal totalAmount = wmsRawStock.getTotalAmount() == null ? BigDecimal.ZERO : wmsRawStock.getTotalAmount(); + BigDecimal occupyAmount = wmsRawStock.getOccupyAmount() == null ? BigDecimal.ZERO : wmsRawStock.getOccupyAmount(); + BigDecimal frozenAmount = wmsRawStock.getFrozenAmount() == null ? BigDecimal.ZERO : wmsRawStock.getFrozenAmount(); + BigDecimal availableAmount = totalAmount.subtract(occupyAmount).subtract(frozenAmount); + if (applyQty.compareTo(availableAmount) > 0) { + throw new ServiceException("移库出库数量不能大于" + availableAmount); + } + + totalAmount = totalAmount.subtract(applyQty); + if (totalAmount.compareTo(BigDecimal.ZERO) == 0) { + wmsRawStockMapper.deleteWmsRawStockByRawStockId(wmsRawStock.getRawStockId()); + } else { + wmsRawStock.setTotalAmount(totalAmount); + wmsRawStock.setUpdateBy(userName); + wmsRawStock.setUpdateDate(currentDate); + wmsRawStockMapper.updateWmsRawStock(wmsRawStock); + } + + } else {//如果是成品 + WmsProductStock wmsProductStock = wmsProductStockMapper.selectProductStockByBatch(materialBarcode); + if (wmsProductStock == null || !wmsProductStock.getLocationCode().equals(locationCode)) { + throw new ServiceException("无此库存信息"); + } + BigDecimal totalAmount = wmsProductStock.getTotalAmount() == null ? BigDecimal.ZERO : wmsProductStock.getTotalAmount(); + BigDecimal occupyAmount = wmsProductStock.getOccupyAmount() == null ? BigDecimal.ZERO : wmsProductStock.getOccupyAmount(); + BigDecimal frozenAmount = wmsProductStock.getFrozenAmount() == null ? BigDecimal.ZERO : wmsProductStock.getFrozenAmount(); + BigDecimal availableAmount = totalAmount.subtract(occupyAmount).subtract(frozenAmount); + if (applyQty.compareTo(availableAmount) > 0) { + throw new ServiceException("移库出库数量不能大于" + availableAmount); + } + totalAmount = totalAmount.subtract(applyQty); + if (totalAmount.compareTo(BigDecimal.ZERO) == 0) { + wmsProductStockMapper.deleteWmsProductStockByProductStockId(wmsProductStock.getProductStockId()); + } else { + wmsProductStock.setTotalAmount(totalAmount); + wmsProductStock.setUpdateBy(userName); + wmsProductStock.setUpdateDate(currentDate); + wmsProductStockMapper.updateWmsProductStock(wmsProductStock); + } + } + + WmsMoveDetail queryMoveDetail = new WmsMoveDetail(); + queryMoveDetail.setMaterialBarcode(materialBarcode); + queryMoveDetail.setMoveExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_EXECUTING);//移库合库记录执行状态正在执行中的,对于已完成的可以重复移库合库 + List wmsMoveDetails = wmsMoveDetailMapper.selectWmsMoveDetailList(queryMoveDetail); + if (wmsMoveDetails != null && !wmsMoveDetails.isEmpty()) { + throw new ServiceException("已经有此物料信息的移库记录"); + } + + WmsMove wmsMove = new WmsMove(); + wmsMove.setTaskCode(Seq.getId(Seq.wmsMoveSeqType, Seq.wmsMoveSeqCode)); + wmsMove.setWarehouseId(location.getWarehouseId()); + wmsMove.setOriLocationCode(locationCode); + wmsMove.setOperationType(WmsConstants.WMS_OPERATION_TYPE_MANUAL); + wmsMove.setMoveWay(WmsConstants.WMS_MOVEMERGE_WAY_MANUAL); + wmsMove.setMoveType(WmsConstants.WMS_MOVEMERGE_TYPE_MOVE); + wmsMove.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS); + wmsMove.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_EXECUTING); + wmsMove.setApplyBy(userName); + wmsMove.setApplyDate(currentDate); + wmsMove.setBeginTime(currentDate); + + wmsMoveMapper.insertWmsMove(wmsMove); + + WmsMoveDetail wmsMoveDetail = new WmsMoveDetail(); + wmsMoveDetail.setMoveId(wmsMove.getMoveId()); + wmsMoveDetail.setLocationCode(locationCode); + wmsMoveDetail.setMaterialBarcode(materialBarcode); + wmsMoveDetail.setInstockBatch(baseBarcodeInfo.getBatchCode()); + wmsMoveDetail.setMaterialId(baseBarcodeInfo.getMaterialId()); + wmsMoveDetail.setPlanAmount(applyQty); + wmsMoveDetail.setRealAmount(applyQty); + wmsMoveDetail.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH); + wmsMoveDetail.setExecutePerson(userName); + wmsMoveDetail.setExecuteTime(currentDate); + wmsMoveDetail.setMoveDetailType(WmsConstants.WMS_MOVE_DETAIL_TYPE_OUT); + wmsMoveDetail.setCreateBy(userName); + wmsMoveDetail.setCreateDate(currentDate); + + wmsMoveDetailMapper.insertWmsMoveDetail(wmsMoveDetail); + + return 1; + }*/ } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java index 4b30f86..dc590bd 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java @@ -8,9 +8,11 @@ import com.hw.common.core.constant.SecurityConstants; import com.hw.common.core.constant.WmsConstants; import com.hw.common.core.domain.R; import com.hw.common.core.exception.ServiceException; +import com.hw.common.core.utils.uuid.Seq; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.domain.MesBaseBarcodeInfo; +import com.hw.wms.config.WmsConfig; import com.hw.wms.domain.*; import com.hw.wms.domain.vo.WmsProduceInstockVo; import com.hw.wms.domain.vo.WmsProductInstockVo; @@ -47,10 +49,12 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { @Autowired private WmsProductStockMapper wmsProductStockMapper; - @Autowired private WmsBaseLocationMapper wmsBaseLocationMapper; + @Autowired + private WmsConfig wmsConfig; + @Resource private RemoteMesService remoteMesService; @@ -279,8 +283,39 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { */ @Override public int produceInstock(WmsProduceInstockVo wmsProduceInstockVo) { + String materialBarcode = wmsProduceInstockVo.getMaterialBarcode(); + R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); + MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); + if (baseBarcodeInfo == null) { + throw new ServiceException("物料编码有误"); + } + + WmsProductInstock queryProductInstock = new WmsProductInstock(); + queryProductInstock.setProductBatch(materialBarcode); + List wmsProductInstocks = wmsProductInstockMapper.selectWmsProductInstockList(queryProductInstock); + if (wmsProductInstocks != null && !wmsProductInstocks.isEmpty()) { + throw new ServiceException("已经有此物料入库记录"); + } + + Long warehouseId = wmsConfig.getFifthSemiWarehouseId();//五楼半成品库 + WmsProductInstock wmsProductInstock = new WmsProductInstock(); + wmsProductInstock.setTaskCode(Seq.getId(Seq.productInstockSeqType, Seq.productInstockCode)); + wmsProductInstock.setWarehouseId(warehouseId); + wmsProductInstock.setPalletInfoCode(baseBarcodeInfo.getPalletInfoCode()); + wmsProductInstock.setProductType(WmsConstants.PRODUCT_STOCK_STOCK_TYPE_SEMI); + wmsProductInstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO); + wmsProductInstock.setPlanCode(baseBarcodeInfo.getPlanCode()); + wmsProductInstock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode()); + wmsProductInstock.setInstockType(WmsConstants.PRODUCT_INSTOCK_INSTOCK_TYPE_PRODUCT); + wmsProductInstock.setProductId(baseBarcodeInfo.getMaterialId()); + wmsProductInstock.setProductBatch(materialBarcode); + wmsProductInstock.setInstockAmount(BigDecimal.ONE); + wmsProductInstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS); + wmsProductInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE); + wmsProductInstock.setApplyBy(SecurityUtils.getUsername()); + wmsProductInstock.setApplyDate(new Date()); - return 1; + return wmsProductInstockMapper.insertWmsProductInstock(wmsProductInstock); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java index ac92914..8826d0a 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java @@ -10,6 +10,7 @@ import com.hw.common.core.utils.uuid.Seq; import com.hw.common.security.utils.SecurityUtils; import com.hw.wms.domain.WmsBaseWarehouse; import com.hw.wms.domain.WmsProductStock; +import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo; import com.hw.wms.mapper.WmsBaseWarehouseMapper; import com.hw.wms.mapper.WmsProductStockMapper; import org.springframework.beans.factory.annotation.Autowired; @@ -217,4 +218,17 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService } + /** + * 适用于成品出库后,运输到指定地点,根据销售订单最终确认 + * @param wmsProductOutstockConfirmVo + * @return + */ + @Override + public int finalConfirmProductOutstock(WmsProductOutstockConfirmVo wmsProductOutstockConfirmVo){ + System.out.println("111"+wmsProductOutstockConfirmVo.getSaleorderCode()); + System.out.println("3333"+wmsProductOutstockConfirmVo.getMaterialBarcode()); + + return 1; + } + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java index f12cf1b..c711bdc 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java @@ -1,6 +1,5 @@ package com.hw.wms.service.impl; -import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.hw.common.core.constant.MesConstants; import com.hw.common.core.constant.SecurityConstants; @@ -14,6 +13,7 @@ import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseMaterialInfo; import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo; +import com.hw.wms.config.WmsConfig; import com.hw.wms.domain.*; import com.hw.wms.domain.vo.*; import com.hw.wms.mapper.*; @@ -55,9 +55,13 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { @Autowired private WmsBaseLocationMapper wmsBaseLocationMapper; + @Autowired + private WmsConfig wmsConfig; + @Autowired private RemoteMesService remoteMesService; + /** * 查询原材料出库记录 * @@ -281,7 +285,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { WmsRawOutstockDetail queryRawOutstockDetail = new WmsRawOutstockDetail(); queryRawOutstockDetail.setLocationCode(locationCode); queryRawOutstockDetail.setInstockBatch(baseBarcodeInfo.getBatchCode()); - queryRawOutstockDetail.setExecuteStatusStr(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE+","+WmsConstants.WMS_EXECUTE_STATUS_EXECUTING); + queryRawOutstockDetail.setExecuteStatusStr(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE + "," + WmsConstants.WMS_EXECUTE_STATUS_EXECUTING); queryRawOutstockDetail.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS); List wmsRawOutstockDetails = wmsRawOutstockDetailMapper.selectWmsRawOutstockDetailList(queryRawOutstockDetail); WmsRawOutstockDetail wmsRawOutstockDetail; @@ -799,6 +803,53 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { */ @Override public int assembleOutstock(WmsAssembleOutstockVo wmsAssembleOutstockVo) { + String materialBarcode = wmsAssembleOutstockVo.getMaterialBarcode(); + R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); + MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); + if (baseBarcodeInfo == null) { + throw new ServiceException("物料编码有误"); + } + + String bindBarcode = baseBarcodeInfo.getBindBarcode(); + + WmsRawOutstock queryRawOutstock = new WmsRawOutstock(); + queryRawOutstock.setMaterialBatch(bindBarcode); + List wmsRawOutstocks = wmsRawOutstockMapper.selectWmsRawOutstockList(queryRawOutstock); + if (wmsRawOutstocks != null && !wmsRawOutstocks.isEmpty()) { + throw new ServiceException("已经有此物料出库记录"); + } + + WmsRawStock queryRawStock = new WmsRawStock(); + queryRawStock.setInstockBatch(bindBarcode); + queryRawStock.setCompleteFlag(WmsConstants.WMS_RAW_STOCK_COMPLETE_FLAG_NO); + List wmsRawStocks = wmsRawStockMapper.selectWmsRawStockInList(queryRawStock); + if (wmsRawStocks == null || wmsRawStocks.isEmpty()) { + throw new ServiceException("没找到库存信息"); + } + + WmsRawStock wmsRawStock = wmsRawStocks.get(0); //待agv出库后,wcs更新库存信息(需要删除库存,由于是1个) + + WmsRawOutstock wmsRawOutstock = new WmsRawOutstock(); + wmsRawOutstock.setTaskCode(Seq.getId(Seq.rawOutstockSeqType, Seq.rawOutstockSeqCode)); + wmsRawOutstock.setWarehouseId(wmsRawStock.getWarehouseId()); + wmsRawOutstock.setLocationCode(wmsRawStock.getLocationCode()); + wmsRawOutstock.setOrderId(baseBarcodeInfo.getSaleOrderId()); + wmsRawOutstock.setPlanCode(baseBarcodeInfo.getPlanCode()); + wmsRawOutstock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode()); + wmsRawOutstock.setProductId(baseBarcodeInfo.getMaterialId()); + wmsRawOutstock.setMaterialBatch(bindBarcode); + wmsRawOutstock.setPalletInfoCode(baseBarcodeInfo.getPalletInfoCode());//在绑定时需要在条码信息中记录托盘码 + wmsRawOutstock.setOutstockAmount(BigDecimal.ONE); + + wmsRawOutstock.setEndStationCode(wmsConfig.getFifthAssembleStationCode());//目标位置,五楼组装区域 todo 读配置文件获取 + wmsRawOutstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO); + wmsRawOutstock.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_SPLIT); + wmsRawOutstock.setApplyBy(SecurityUtils.getUsername()); + wmsRawOutstock.setApplyDate(new Date()); + wmsRawOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS); + wmsRawOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE); + + wmsRawOutstockMapper.insertWmsRawOutstock(wmsRawOutstock); return 1; } diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsMoveDetailMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsMoveDetailMapper.xml new file mode 100644 index 0000000..d2019e4 --- /dev/null +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsMoveDetailMapper.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select move_detail_id, move_id, material_barcode, instock_batch, material_id, plan_amount, real_amount, execute_status, execute_person, execute_time, machine_name, create_by, create_date, update_by, update_date, active_flag from wms_move_detail wmd + + + + + + + + insert into wms_move_detail + + move_id, + material_barcode, + instock_batch, + material_id, + plan_amount, + real_amount, + execute_status, + execute_person, + execute_time, + execute_end_time, + machine_name, + create_by, + create_date, + update_by, + update_date, + active_flag, + + + #{moveId}, + #{materialBarcode}, + #{instockBatch}, + #{materialId}, + #{planAmount}, + #{realAmount}, + #{executeStatus}, + #{executePerson}, + #{executeTime}, + #{executeEndTime}, + #{machineName}, + #{createBy}, + #{createDate}, + #{updateBy}, + #{updateDate}, + #{activeFlag}, + + + + + update wms_move_detail + + move_id = #{moveId}, + material_barcode = #{materialBarcode}, + instock_batch = #{instockBatch}, + material_id = #{materialId}, + plan_amount = #{planAmount}, + real_amount = #{realAmount}, + execute_status = #{executeStatus}, + execute_person = #{executePerson}, + execute_time = #{executeTime}, + execute_end_time = #{executeEndTime}, + machine_name = #{machineName}, + create_by = #{createBy}, + create_date = #{createDate}, + update_by = #{updateBy}, + update_date = #{updateDate}, + active_flag = #{activeFlag}, + + where move_detail_id = #{moveDetailId} + + + + delete from wms_move_detail where move_detail_id = #{moveDetailId} + + + + delete from wms_move_detail where move_detail_id in + + #{moveDetailId} + + + + + + + + + + + + select wmd.move_detail_id, wmd.move_id, wmd.material_barcode, wmd.instock_batch, wmd.material_id, wmd.plan_amount, wmd.real_amount,wmd.real_instock_amount, + wmd.execute_status, wmd.execute_person, wmd.execute_time, wmd.machine_name, wmd.create_by, wmd.create_date, + mbmi.material_name + from wms_move_detail wmd left join mes_base_material_info mbmi on wmd.material_id = mbmi.material_id + + + + + diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsMoveMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsMoveMapper.xml index 0ec6662..58335f3 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsMoveMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsMoveMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -43,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -58,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into wms_move @@ -165,14 +166,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from wms_move where move_id in + delete from wms_move where move_id in #{moveId} - + - delete from wms_move_detail where move_id in + delete from wms_move_detail where move_id in #{moveId} @@ -183,9 +184,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into wms_move_detail( move_detail_id, move_id, location_code, material_barcode, instock_batch, material_id, plan_amount, real_amount, execute_status, execute_person, execute_time, move_detail_type, machine_name, create_by, create_date, update_by, update_date, active_flag) values + insert into wms_move_detail( move_detail_id, move_id, location_code, material_barcode, instock_batch, material_id, plan_amount, real_amount, execute_status, execute_person, execute_time, execute_end_time, machine_name, create_by, create_date, update_by, update_date, active_flag) values - ( #{item.moveDetailId}, #{item.moveId}, #{item.locationCode}, #{item.materialBarcode}, #{item.instockBatch}, #{item.materialId}, #{item.planAmount}, #{item.realAmount}, #{item.executeStatus}, #{item.executePerson}, #{item.executeTime}, #{item.moveDetailType}, #{item.machineName}, #{item.createBy}, #{item.createDate}, #{item.updateBy}, #{item.updateDate}, #{item.activeFlag}) + ( #{item.moveDetailId}, #{item.moveId}, #{item.locationCode}, #{item.materialBarcode}, #{item.instockBatch}, #{item.materialId}, #{item.planAmount}, #{item.realAmount}, #{item.executeStatus}, #{item.executePerson}, #{item.executeTime}, #{item.executeEndTime}, #{item.machineName}, #{item.createBy}, #{item.createDate}, #{item.updateBy}, #{item.updateDate}, #{item.activeFlag}) - \ No newline at end of file + + + + + + + + + + + select wm.move_id, wm.task_code, wm.warehouse_id, wm.ori_location_code, wm.target_location_code, wm.operation_type, wm.move_way, wm.move_type, + wm.execute_status, wm.apply_by, wm.apply_date, wm.begin_time, wm.end_time, + wbw.warehouse_name + from wms_move wm left join wms_base_warehouse wbw on wm.warehouse_id = wbw.warehouse_id + + + + + 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 64193ce..0131140 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 @@ -14,6 +14,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + @@ -51,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select product_instock_id, task_code, warehouse_id, location_code, product_type, operation_type, plan_code, plan_detail_code, instock_type, apply_reason, audit_reason, audit_status, execute_status, apply_by, apply_date, audit_by, audit_date, update_by, update_date, begin_time, end_time from wms_product_instock + select product_instock_id, task_code, warehouse_id, location_code, product_type, operation_type, plan_code, plan_detail_code, instock_type, product_id, product_batch, instock_amount, pallet_info_code, apply_reason, audit_reason, audit_status, execute_status, apply_by, apply_date, audit_by, audit_date, update_by, update_date, begin_time, end_time from wms_product_instock @@ -91,10 +95,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -109,12 +113,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" plan_detail_code, station_id, product_id, - operation_type, - task_type, + material_batch, + pallet_info_code, + outstock_amount, + end_station_code, + operation_type, + task_type, apply_reason, audit_reason, - audit_status, - execute_status, + audit_status, + execute_status, apply_by, apply_date, audit_by, @@ -123,7 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_date, begin_time, end_time, - + #{taskCode}, #{warehouseId}, @@ -133,12 +141,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{planDetailCode}, #{stationId}, #{productId}, - #{operationType}, - #{taskType}, + #{materialBatch}, + #{palletInfoCode}, + #{outstockAmount}, + #{endStationCode}, + #{operationType}, + #{taskType}, #{applyReason}, #{auditReason}, - #{auditStatus}, - #{executeStatus}, + #{auditStatus}, + #{executeStatus}, #{applyBy}, #{applyDate}, #{auditBy}, @@ -147,7 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateDate}, #{beginTime}, #{endTime}, - + @@ -161,12 +173,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" plan_detail_code = #{planDetailCode}, station_id = #{stationId}, product_id = #{productId}, - operation_type = #{operationType}, - task_type = #{taskType}, + material_batch = #{materialBatch}, + pallet_info_code = #{palletInfoCode}, + outstock_amount = #{outstockAmount}, + end_station_code = #{endStationCode}, + operation_type = #{operationType}, + task_type = #{taskType}, apply_reason = #{applyReason}, audit_reason = #{auditReason}, - audit_status = #{auditStatus}, - execute_status = #{executeStatus}, + audit_status = #{auditStatus}, + execute_status = #{executeStatus}, apply_by = #{applyBy}, apply_date = #{applyDate}, audit_by = #{auditBy}, 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 76c337a..6ac3293 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 @@ -192,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and update_date = #{updateDate} and active_flag = #{activeFlag} - and totalAmount > 0 + and total_amount > 0