MES:
四楼激光切割工位板材领料和板材入库根据采购订单绑定销售订单逻辑修改
master
xins 6 months ago
parent 39e3c34ecd
commit 25cb4da81d

@ -124,4 +124,9 @@ public enum BusinessType
*/ */
BIND, BIND,
/**
*
*/
CHECK,
} }

@ -34,6 +34,11 @@ public class WmsConfig
*/ */
private Long fourthFloorProductWarehouseId; private Long fourthFloorProductWarehouseId;
/**
* ID
*/
private Long fourthFloorPalteWarehouseId;
public String getFifthAssembleStationCode() { public String getFifthAssembleStationCode() {
return fifthAssembleStationCode; return fifthAssembleStationCode;
@ -66,4 +71,12 @@ public class WmsConfig
public void setFourthFloorProductWarehouseId(Long fourthFloorProductWarehouseId) { public void setFourthFloorProductWarehouseId(Long fourthFloorProductWarehouseId) {
this.fourthFloorProductWarehouseId = fourthFloorProductWarehouseId; this.fourthFloorProductWarehouseId = fourthFloorProductWarehouseId;
} }
public Long getFourthFloorPalteWarehouseId() {
return fourthFloorPalteWarehouseId;
}
public void setFourthFloorPalteWarehouseId(Long fourthFloorPalteWarehouseId) {
this.fourthFloorPalteWarehouseId = fourthFloorPalteWarehouseId;
}
} }

@ -1,5 +1,6 @@
package com.hw.wms.controller; package com.hw.wms.controller;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.WmsConstants; import com.hw.common.core.constant.WmsConstants;
import com.hw.common.core.web.controller.BaseController; import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult; import com.hw.common.core.web.domain.AjaxResult;
@ -12,6 +13,7 @@ import com.hw.wms.service.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import java.util.List; import java.util.List;
@ -101,6 +103,15 @@ public class WmsApiController extends BaseController {
return toAjax(wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo)); return toAjax(wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo));
} }
/**
*
*/
@Log(title = "原材料出库记录", businessType = BusinessType.CHECK)
@PostMapping(("/checkSuitableSaleOrderMaterial"))
public AjaxResult checkSuitableSaleOrderMaterial(@RequestBody WmsRawOutstock wmsRawOutstock) {
JSONObject returnJson = wmsRawOutstockService.checkSuitableSaleOrderMaterial(wmsRawOutstock);
return AjaxResult.success(returnJson);
}
/** /**
* *

@ -2,7 +2,9 @@ package com.hw.wms.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.hw.common.core.constant.MesConstants;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel; import com.hw.common.core.annotation.Excel;
@ -14,101 +16,144 @@ import com.hw.common.core.web.domain.BaseEntity;
* @author xs * @author xs
* @date 2023-12-21 * @date 2023-12-21
*/ */
public class WmsRawStock extends BaseEntity public class WmsRawStock extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 原材料库存ID */ /**
* ID
*/
private Long rawStockId; private Long rawStockId;
/** 仓库ID */ /**
* ID
*/
@Excel(name = "仓库ID") @Excel(name = "仓库ID")
private Long warehouseId; private Long warehouseId;
/** 仓库名称 */ /**
*
*/
@Excel(name = "仓库名称") @Excel(name = "仓库名称")
private String warehouseName; private String warehouseName;
/** 仓库楼层 */ /**
*
*/
@Excel(name = "仓库楼层") @Excel(name = "仓库楼层")
private Long warehouseFloor; private Long warehouseFloor;
/** 库位编码 */ /**
*
*/
@Excel(name = "库位编码") @Excel(name = "库位编码")
private String locationCode; private String locationCode;
/** 库存类型1原材料 2半成品 */ /**
* 1 2
*/
@Excel(name = "库存类型") @Excel(name = "库存类型")
private String stockType; private String stockType;
/** 物料ID */ /**
* ID
*/
@Excel(name = "物料ID") @Excel(name = "物料ID")
private Long materialId; private Long materialId;
/** 物料编号 */ /**
*
*/
@Excel(name = "物料编号") @Excel(name = "物料编号")
private String materialCode; private String materialCode;
/** 物料名称 */ /**
*
*/
@Excel(name = "物料名称") @Excel(name = "物料名称")
private String materialName; private String materialName;
/** 入库批次号 */ /**
*
*/
@Excel(name = "入库批次号") @Excel(name = "入库批次号")
private String instockBatch; private String instockBatch;
/**托盘码*/ /**
*
*/
private String palletInfoCode; private String palletInfoCode;
private Long saleOrderId; private Long saleOrderId;
private String safeFlag; private String safeFlag;
/** 入库时间 */ /**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date instockDate; private Date instockDate;
/** 最晚出库时间;入库时,根据物料信“存放周期“计算出来的时间 */ /**
* ;
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最晚出库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "最晚出库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lastOutstockTime; private Date lastOutstockTime;
/** 质检状态(1检验中,2质检通过,3质检不通过) */ /**
* (1,2,3)
*/
@Excel(name = "质检状态") @Excel(name = "质检状态")
private String qualityStatus; private String qualityStatus;
/** 完整标识 */ /**
*
*/
@Excel(name = "完整标识") @Excel(name = "完整标识")
private String completeFlag; private String completeFlag;
/** 总数量 */ /**
*
*/
@Excel(name = "总数量") @Excel(name = "总数量")
private BigDecimal totalAmount; private BigDecimal totalAmount;
/** 冻结数量 */ /**
*
*/
@Excel(name = "冻结数量") @Excel(name = "冻结数量")
private BigDecimal frozenAmount; private BigDecimal frozenAmount;
/** 占用数量 */ /**
*
*/
@Excel(name = "占用数量") @Excel(name = "占用数量")
private BigDecimal occupyAmount; private BigDecimal occupyAmount;
/** 供应商ID */ /**
* ID
*/
@Excel(name = "供应商ID") @Excel(name = "供应商ID")
private Long supplierId; private Long supplierId;
/** 创建时间 */ /**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createDate; private Date createDate;
/** 最后更新时间 */ /**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updateDate; private Date updateDate;
/** 有效标记 */ /**
*
*/
@Excel(name = "有效标记") @Excel(name = "有效标记")
private String activeFlag; private String activeFlag;
@ -136,22 +181,19 @@ public class WmsRawStock extends BaseEntity
this.materialName = materialName; this.materialName = materialName;
} }
public void setRawStockId(Long rawStockId) public void setRawStockId(Long rawStockId) {
{
this.rawStockId = rawStockId; this.rawStockId = rawStockId;
} }
public Long getRawStockId() public Long getRawStockId() {
{
return rawStockId; return rawStockId;
} }
public void setWarehouseId(Long warehouseId)
{ public void setWarehouseId(Long warehouseId) {
this.warehouseId = warehouseId; this.warehouseId = warehouseId;
} }
public Long getWarehouseId() public Long getWarehouseId() {
{
return warehouseId; return warehouseId;
} }
@ -163,40 +205,35 @@ public class WmsRawStock extends BaseEntity
this.warehouseFloor = warehouseFloor; this.warehouseFloor = warehouseFloor;
} }
public void setLocationCode(String locationCode) public void setLocationCode(String locationCode) {
{
this.locationCode = locationCode; this.locationCode = locationCode;
} }
public String getLocationCode() public String getLocationCode() {
{
return locationCode; return locationCode;
} }
public void setStockType(String stockType)
{ public void setStockType(String stockType) {
this.stockType = stockType; this.stockType = stockType;
} }
public String getStockType() public String getStockType() {
{
return stockType; return stockType;
} }
public void setMaterialId(Long materialId)
{ public void setMaterialId(Long materialId) {
this.materialId = materialId; this.materialId = materialId;
} }
public Long getMaterialId() public Long getMaterialId() {
{
return materialId; return materialId;
} }
public void setInstockBatch(String instockBatch)
{ public void setInstockBatch(String instockBatch) {
this.instockBatch = instockBatch; this.instockBatch = instockBatch;
} }
public String getInstockBatch() public String getInstockBatch() {
{
return instockBatch; return instockBatch;
} }
@ -224,31 +261,27 @@ public class WmsRawStock extends BaseEntity
this.safeFlag = safeFlag; this.safeFlag = safeFlag;
} }
public void setInstockDate(Date instockDate) public void setInstockDate(Date instockDate) {
{
this.instockDate = instockDate; this.instockDate = instockDate;
} }
public Date getInstockDate() public Date getInstockDate() {
{
return instockDate; return instockDate;
} }
public void setLastOutstockTime(Date lastOutstockTime)
{ public void setLastOutstockTime(Date lastOutstockTime) {
this.lastOutstockTime = lastOutstockTime; this.lastOutstockTime = lastOutstockTime;
} }
public Date getLastOutstockTime() public Date getLastOutstockTime() {
{
return lastOutstockTime; return lastOutstockTime;
} }
public void setQualityStatus(String qualityStatus)
{ public void setQualityStatus(String qualityStatus) {
this.qualityStatus = qualityStatus; this.qualityStatus = qualityStatus;
} }
public String getQualityStatus() public String getQualityStatus() {
{
return qualityStatus; return qualityStatus;
} }
@ -260,91 +293,88 @@ public class WmsRawStock extends BaseEntity
this.completeFlag = completeFlag; this.completeFlag = completeFlag;
} }
public void setTotalAmount(BigDecimal totalAmount) public void setTotalAmount(BigDecimal totalAmount) {
{
this.totalAmount = totalAmount; this.totalAmount = totalAmount;
} }
public BigDecimal getTotalAmount() public BigDecimal getTotalAmount() {
{
return totalAmount; return totalAmount;
} }
public void setFrozenAmount(BigDecimal frozenAmount)
{ public void setFrozenAmount(BigDecimal frozenAmount) {
this.frozenAmount = frozenAmount; this.frozenAmount = frozenAmount;
} }
public BigDecimal getFrozenAmount() public BigDecimal getFrozenAmount() {
{
return frozenAmount; return frozenAmount;
} }
public void setOccupyAmount(BigDecimal occupyAmount)
{ public void setOccupyAmount(BigDecimal occupyAmount) {
this.occupyAmount = occupyAmount; this.occupyAmount = occupyAmount;
} }
public BigDecimal getOccupyAmount() public BigDecimal getOccupyAmount() {
{
return occupyAmount; return occupyAmount;
} }
public void setSupplierId(Long supplierId)
{ public void setSupplierId(Long supplierId) {
this.supplierId = supplierId; this.supplierId = supplierId;
} }
public Long getSupplierId() public Long getSupplierId() {
{
return supplierId; return supplierId;
} }
public void setCreateDate(Date createDate)
{ public void setCreateDate(Date createDate) {
this.createDate = createDate; this.createDate = createDate;
} }
public Date getCreateDate() public Date getCreateDate() {
{
return createDate; return createDate;
} }
public void setUpdateDate(Date updateDate)
{ public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate; this.updateDate = updateDate;
} }
public Date getUpdateDate() public Date getUpdateDate() {
{
return updateDate; return updateDate;
} }
public void setActiveFlag(String activeFlag)
{ public void setActiveFlag(String activeFlag) {
this.activeFlag = activeFlag; this.activeFlag = activeFlag;
} }
public String getActiveFlag() public String getActiveFlag() {
{
return activeFlag; return activeFlag;
} }
public String getLocationAndMaterial() {
return "库位:" + locationCode + ",物料条码:" + instockBatch +
",安全库存:"+(safeFlag.equals(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES)?"是":"否")+";";
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("rawStockId", getRawStockId()) .append("rawStockId", getRawStockId())
.append("warehouseId", getWarehouseId()) .append("warehouseId", getWarehouseId())
.append("locationCode", getLocationCode()) .append("locationCode", getLocationCode())
.append("stockType", getStockType()) .append("stockType", getStockType())
.append("materialId", getMaterialId()) .append("materialId", getMaterialId())
.append("instockBatch", getInstockBatch()) .append("instockBatch", getInstockBatch())
.append("instockDate", getInstockDate()) .append("instockDate", getInstockDate())
.append("lastOutstockTime", getLastOutstockTime()) .append("lastOutstockTime", getLastOutstockTime())
.append("qualityStatus", getQualityStatus()) .append("qualityStatus", getQualityStatus())
.append("totalAmount", getTotalAmount()) .append("totalAmount", getTotalAmount())
.append("frozenAmount", getFrozenAmount()) .append("frozenAmount", getFrozenAmount())
.append("occupyAmount", getOccupyAmount()) .append("occupyAmount", getOccupyAmount())
.append("supplierId", getSupplierId()) .append("supplierId", getSupplierId())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createDate", getCreateDate()) .append("createDate", getCreateDate())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateDate", getUpdateDate()) .append("updateDate", getUpdateDate())
.append("activeFlag", getActiveFlag()) .append("activeFlag", getActiveFlag())
.toString(); .toString();
} }
} }

@ -126,6 +126,14 @@ public interface IWmsRawOutstockService
*/ */
public int assembleOutstock(WmsAssembleOutstockVo wmsAssembleOutstockVo); public int assembleOutstock(WmsAssembleOutstockVo wmsAssembleOutstockVo);
/**
*
* @param wmsRawOutstock
* @return
*/
public JSONObject checkSuitableSaleOrderMaterial(WmsRawOutstock wmsRawOutstock);
/** /**
* *
* @param wmsRawOutstock * @param wmsRawOutstock

@ -558,7 +558,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
* @return * @return
*/ */
private WmsRawOutstock getWmsRawOutstock(WmsBaseWarehouse baseWarehouse, private WmsRawOutstock getWmsRawOutstock(WmsBaseWarehouse baseWarehouse,
String planCode, String planDetailCode, Long materialId, String taskCode, String taskType,String applyReason, String planCode, String planDetailCode, Long materialId, String taskCode, String taskType, String applyReason,
BigDecimal planAmount, Date currentDate, String userName) { BigDecimal planAmount, Date currentDate, String userName) {
//出库要求 0申请出库1申请审核出库2直接出库 //出库要求 0申请出库1申请审核出库2直接出库
String outRequirement = baseWarehouse.getOutRequirement(); String outRequirement = baseWarehouse.getOutRequirement();
@ -966,15 +966,18 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
/** /**
* *
* *
* @param wmsRawOutstock * @param wmsRawOutstock
* @return * @return
*/ */
@Transactional
@Override @Override
public int directRawOutstock(WmsRawOutstock wmsRawOutstock) { public JSONObject checkSuitableSaleOrderMaterial(WmsRawOutstock wmsRawOutstock) {
//出库要求 0申请出库1申请审核出库2直接出库 String directOutstockCode = "1";
String confirmOutstockCode = "2";
String cannotOutstockCode = "3";
JSONObject returnJson = new JSONObject();
String materialBarcode = wmsRawOutstock.getMaterialBarcode(); String materialBarcode = wmsRawOutstock.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) { if (baseBarcodeInfoR == null) {
@ -985,11 +988,107 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
throw new ServiceException("物料编码有误"); throw new ServiceException("物料编码有误");
} }
//验证销售订单绑定关系,或者是否安全库存
Long saleOrderId = wmsRawOutstock.getSaleOrderId();
if (saleOrderId != null) {
//如果出库的物料是安全库存,则判断是否有绑定的销售订单信息
if ((baseBarcodeInfo.getSafeFlag().equals(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES))) {
String returnMsg = getSuitableSaleOrderMaterials(saleOrderId);
if (StringUtils.isEmpty(returnMsg)) {//如果没有,可以直接出库
returnJson.put("code", directOutstockCode);
} else {//如果有,可以二次提示是否需要出库
returnJson.put("code", confirmOutstockCode);
returnJson.put("msg", returnMsg);
}
return returnJson;
} else {//如果非安全库存需要判断销售订单ID是否相同
if (baseBarcodeInfo.getSaleOrderId() == null || !saleOrderId.equals(baseBarcodeInfo.getSaleOrderId())) {
String returnMsg = getSuitableSaleOrderMaterials(saleOrderId);
if (StringUtils.isEmpty(returnMsg)) {//如果没有
returnMsg = getSuitableSafeMaterials(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
}
if (StringUtils.isEmpty(returnMsg)) {
throw new ServiceException("请出库对应销售订单的板材【已经没有此销售订单的库存和安全库存】");
} else {//如果有,不能出库
returnJson.put("code", cannotOutstockCode);
returnJson.put("msg", returnMsg);
}
return returnJson;
} else {
returnJson.put("code", directOutstockCode);
return returnJson;
}
}
} else {//如果没有销售订单,则需要出安全库存
if (!baseBarcodeInfo.getSafeFlag().equals(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES)) {
String returnMsg = getSuitableSafeMaterials(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
if (StringUtils.isEmpty(returnMsg)) {
throw new ServiceException("请出库安全库存的板材【已经没有安全库存】");
} else {
returnJson.put("code", cannotOutstockCode);
returnJson.put("msg", returnMsg);
}
return returnJson;
}
}
return returnJson;
}
public String getSuitableSaleOrderMaterials(Long saleOrderId) {
WmsRawStock queryRawStock = new WmsRawStock();
queryRawStock.setSaleOrderId(saleOrderId);
queryRawStock.setWarehouseId(wmsConfig.getFourthFloorPalteWarehouseId());
List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectWmsRawStockList(queryRawStock);
List<WmsRawStock> availableRawStocks = wmsRawStocks.stream().filter(wmsRawStock ->
(wmsRawStock.getTotalAmount().subtract(wmsRawStock.getOccupyAmount() == null ? BigDecimal.ZERO : wmsRawStock.getOccupyAmount())
.subtract(wmsRawStock.getFrozenAmount() == null ? BigDecimal.ZERO : wmsRawStock.getFrozenAmount())).compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
if (availableRawStocks != null && !availableRawStocks.isEmpty()) {
List<String> returnMsg = availableRawStocks.stream().map(WmsRawStock::getLocationAndMaterial).collect(Collectors.toList());
return returnMsg.toString();
}
return "";
}
public String getSuitableSafeMaterials(String safeFlag) {
WmsRawStock querySafeRawStock = new WmsRawStock();
querySafeRawStock.setSafeFlag(safeFlag);
querySafeRawStock.setWarehouseId(wmsConfig.getFourthFloorPalteWarehouseId());
List<WmsRawStock> safeRawStocks = wmsRawStockMapper.selectWmsRawStockList(querySafeRawStock);
List<WmsRawStock> availableSafeRawStocks = safeRawStocks.stream().filter(wmsRawStock ->
(wmsRawStock.getTotalAmount().subtract(wmsRawStock.getOccupyAmount() == null ? BigDecimal.ZERO : wmsRawStock.getOccupyAmount())
.subtract(wmsRawStock.getFrozenAmount() == null ? BigDecimal.ZERO : wmsRawStock.getFrozenAmount())).compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
if (availableSafeRawStocks != null && !availableSafeRawStocks.isEmpty()) {
List<String> returnMsg = availableSafeRawStocks.stream().map(WmsRawStock::getLocationAndMaterial).collect(Collectors.toList());
return returnMsg.toString();
}
return "";
}
/**
*
*
* @param wmsRawOutstock
* @return
*/
@Transactional
@Override
public int directRawOutstock(WmsRawOutstock wmsRawOutstock) {
//出库要求 0申请出库1申请审核出库2直接出库
String materialBarcode = wmsRawOutstock.getMaterialBarcode();
String locationCode = wmsRawOutstock.getLocationCode(); String locationCode = wmsRawOutstock.getLocationCode();
WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode); WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode);
if (baseLocation == null) { if (baseLocation == null) {
throw new ServiceException("库位编码错误"); throw new ServiceException("库位编码错误");
} }
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料编码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
BigDecimal outstockAmount = wmsRawOutstock.getOutstockAmount(); BigDecimal outstockAmount = wmsRawOutstock.getOutstockAmount();
String batchCode = baseBarcodeInfo.getBatchCode(); String batchCode = baseBarcodeInfo.getBatchCode();
@ -1012,16 +1111,15 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
this.insertRawOutstockDetail(wmsRawOutstock, materialBarcode, batchCode, this.insertRawOutstockDetail(wmsRawOutstock, materialBarcode, batchCode,
userName, currentDate); userName, currentDate);
directOutstockUpdateRawStock(locationCode, batchCode, outstockAmount, userName, currentDate); directOutstockUpdateRawStock(locationCode, materialBarcode, outstockAmount, userName, currentDate);
return 1; return 1;
} }
public void directOutstockUpdateRawStock(String locationCode, String batchCode, BigDecimal outstockAmount, public void directOutstockUpdateRawStock(String locationCode, String materialBarcode, BigDecimal outstockAmount,
String userName, Date currentDate) { String userName, Date currentDate) {
//TODO:批次码 WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(materialBarcode);
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(batchCode);
if (wmsRawStock == null) { if (wmsRawStock == null) {
throw new ServiceException("没找到库存信息"); throw new ServiceException("没找到库存信息");
} else { } else {

@ -13,6 +13,8 @@
<result property="materialId" column="material_id"/> <result property="materialId" column="material_id"/>
<result property="instockBatch" column="instock_batch"/> <result property="instockBatch" column="instock_batch"/>
<result property="palletInfoCode" column="pallet_info_code"/> <result property="palletInfoCode" column="pallet_info_code"/>
<result property="saleOrderId" column="sale_order_id"/>
<result property="safeFlag" column="safe_flag"/>
<result property="instockDate" column="instock_date"/> <result property="instockDate" column="instock_date"/>
<result property="lastOutstockTime" column="last_outstock_time"/> <result property="lastOutstockTime" column="last_outstock_time"/>
<result property="qualityStatus" column="quality_status"/> <result property="qualityStatus" column="quality_status"/>
@ -43,6 +45,8 @@
mbmi.material_name, mbmi.material_name,
wrs.instock_batch, wrs.instock_batch,
wrs.pallet_info_code, wrs.pallet_info_code,
wrs.sale_order_id,
wrs.safe_flag,
wrs.instock_date, wrs.instock_date,
wrs.last_outstock_time, wrs.last_outstock_time,
wrs.quality_status, wrs.quality_status,
@ -68,6 +72,8 @@
<if test="locationCode != null and locationCode != ''">and wrs.location_code = #{locationCode}</if> <if test="locationCode != null and locationCode != ''">and wrs.location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and wrs.stock_type = #{stockType}</if> <if test="stockType != null and stockType != ''">and wrs.stock_type = #{stockType}</if>
<if test="materialId != null ">and wrs.material_id = #{materialId}</if> <if test="materialId != null ">and wrs.material_id = #{materialId}</if>
<if test="saleOrderId != null ">and wrs.sale_order_id = #{saleOrderId}</if>
<if test="safeFlag != null and safeFlag != ''">and wrs.safe_flag = #{safeFlag}</if>
<if test="instockBatch != null and instockBatch != ''">and wrs.instock_batch = #{instockBatch}</if> <if test="instockBatch != null and instockBatch != ''">and wrs.instock_batch = #{instockBatch}</if>
<if test="instockDate != null ">and wrs.instock_date = #{instockDate}</if> <if test="instockDate != null ">and wrs.instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null ">and wrs.last_outstock_time = #{lastOutstockTime}</if> <if test="lastOutstockTime != null ">and wrs.last_outstock_time = #{lastOutstockTime}</if>

@ -183,6 +183,17 @@ export function addRawInstock(data) {
}) })
} }
//激光切割工位板材出库
export function checkSuitableSaleOrderMaterial(data) {
return request({
url: '/wms/api/checkSuitableSaleOrderMaterial',
method: 'post',
data: data
})
}
//激光切割工位板材出库 //激光切割工位板材出库
export function directRawOutstock(data) { export function directRawOutstock(data) {
return request({ return request({

@ -194,10 +194,10 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="wmsForm" :model="wmsForm" :rules="wmsRules" label-width="80px"> <el-form ref="wmsForm" :model="wmsForm" :rules="wmsRules" label-width="80px">
<el-form-item label="库位编码" prop="locationCode"> <el-form-item label="库位编码" prop="locationCode">
<el-input v-model="wmsForm.locationCode" autocomplete="off"></el-input> <el-input v-model="wmsForm.locationCode" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="物料条码" prop="materialBarcode"> <el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="wmsForm.materialBarcode" autocomplete="off"></el-input> <el-input v-model="wmsForm.materialBarcode" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -219,6 +219,7 @@ import {
startNextProductPlanDetailAttach, startNextProductPlanDetailAttach,
getPlanDrawings, getPlanDrawings,
addRawInstock, addRawInstock,
checkSuitableSaleOrderMaterial,
directRawOutstock, directRawOutstock,
} from "@/api/board"; } from "@/api/board";
@ -251,19 +252,26 @@ export default {
title: '', title: '',
open: false, open: false,
stockType: '', stockType: '',
wmsForm:{ wmsForm: {
locationCode: null, locationCode: null,
materialBarcode : null, materialBarcode: null,
},//使 },//使
// //
wmsRules: { wmsRules: {
locationCode: [ locationCode: [
{ required: true, message: "库位编码不能为空", trigger: "blur" } {required: true, message: "库位编码不能为空", trigger: "blur"}
], ],
materialBarcode: [ materialBarcode: [
{ required: true, message: "物料条码不能为空", trigger: "blur" } {required: true, message: "物料条码不能为空", trigger: "blur"}
], ],
} },
OUTSTOCKCODE: {
directOutstockCode: "1",
confirmOutstockCode: "2",
cannotOutstockCode: "3"
},
} }
}, },
async mounted() { async mounted() {
@ -285,6 +293,7 @@ export default {
this.form.materialId = e.rows[0]?.materialId this.form.materialId = e.rows[0]?.materialId
this.form.materialCode = e.rows[0]?.materialCode this.form.materialCode = e.rows[0]?.materialCode
this.form.materialName = e.rows[0]?.materialName this.form.materialName = e.rows[0]?.materialName
this.form.saleOrderId = e.rows[0]?.saleOrderId
this.form.planDetailStatus = setState(val.data.planDetailStatus) this.form.planDetailStatus = setState(val.data.planDetailStatus)
}) })
}) })
@ -462,7 +471,8 @@ export default {
this.$store.dispatch('LogOut').then(() => { this.$store.dispatch('LogOut').then(() => {
location.href = '/login?isStationId=true'; location.href = '/login?isStationId=true';
}) })
}).catch(() => {}); }).catch(() => {
});
}, },
next1() { next1() {
this.nowNum1 += 1 this.nowNum1 += 1
@ -485,6 +495,7 @@ export default {
this.form.materialId = e.materialId this.form.materialId = e.materialId
this.form.materialCode = e.materialCode this.form.materialCode = e.materialCode
this.form.materialName = e.materialName this.form.materialName = e.materialName
this.form.saleOrderId = e.saleOrderId
this.form.planDetailStatus = setState(val.data.planDetailStatus) this.form.planDetailStatus = setState(val.data.planDetailStatus)
}) })
}, },
@ -834,6 +845,7 @@ export default {
this.form.materialId = val.materialId this.form.materialId = val.materialId
this.form.materialCode = val.materialCode this.form.materialCode = val.materialCode
this.form.materialName = val.materialName this.form.materialName = val.materialName
this.form.saleOrderId = val.saleOrderId
this.form.planDetailStatus = setState(val1.data.planDetailStatus) this.form.planDetailStatus = setState(val1.data.planDetailStatus)
}) })
const data = await getPlanDrawings({planId: val.planId, attachId: val.attachId}) const data = await getPlanDrawings({planId: val.planId, attachId: val.attachId})
@ -887,47 +899,73 @@ export default {
this.resetForm("wmsForm"); this.resetForm("wmsForm");
}, },
handleRawInstock(){ handleRawInstock() {
this.resetWmsForm(); this.resetWmsForm();
this.open = true; this.open = true;
this.stockType = "1";// this.stockType = "1";//
this.title = "板材入库"; this.title = "板材入库";
}, },
handleRawOutstock(){ handleRawOutstock() {
this.resetWmsForm(); this.resetWmsForm();
this.open = true; this.open = true;
this.stockType = "2";// this.stockType = "2";//
this.title = "板材领料"; this.title = "板材领料";
}, },
cancel(){ cancel() {
this.stockType = ""; this.stockType = "";
this.open = false; this.open = false;
this.resetWmsForm(); this.resetWmsForm();
}, },
submitRawStock(){ submitRawStock() {
if(this.stockType == "1"){// if (this.stockType == "1") {//
this.wmsForm.instockAmount = 1; this.wmsForm.instockAmount = 1;
addRawInstock(this.wmsForm).then(response => { addRawInstock(this.wmsForm).then(response => {
this.$modal.msgSuccess("板材入库成功"); this.$modal.msgSuccess("板材入库成功");
this.cancel(); this.cancel();
}); });
} else if(this.stockType == "2"){// } else if (this.stockType == "2") {//
this.wmsForm.outstockAmount = 1; this.wmsForm.outstockAmount = 1;
this.wmsForm.planCode = this.form.planCode; this.wmsForm.planCode = this.form.planCode;
this.wmsForm.planDetailCode = this.form.planDetailCode; this.wmsForm.planDetailCode = this.form.planDetailCode;
this.wmsForm.operationType = '1';// this.wmsForm.operationType = '1';//
this.wmsForm.taskType = '1';// this.wmsForm.taskType = '1';//
this.wmsForm.saleOrderId = this.form.saleOrderId;
directRawOutstock(this.wmsForm).then(response => { checkSuitableSaleOrderMaterial(this.wmsForm).then(response => {
this.$modal.msgSuccess("板材领取成功"); let returnCode = response.data.code;
this.cancel(); let returnMsg = response.data.msg;
}); if (returnCode == this.OUTSTOCKCODE.directOutstockCode) {
} this.directRawOutstock();
} else if (returnCode == this.OUTSTOCKCODE.confirmOutstockCode) {
this.$confirm('此库存为安全库存,确认要出安全库存么?有以下销售订单库存可以优先出:'+returnMsg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.directRawOutstock();
}).catch(() => {
});
} else {
this.$modal.msgWarning("请出库:"+returnMsg);
}
});
}
}, },
directRawOutstock() {
directRawOutstock(this.wmsForm).then(response => {
this.$modal.msgSuccess("板材领取成功");
this.cancel();
});
}
}, },
@ -981,8 +1019,9 @@ export default {
/deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell { /deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #fff0; background-color: #fff0;
} }
/deep/ .el-table__expand-icon{
color:#fff /deep/ .el-table__expand-icon {
color: #fff
} }
/deep/ .current-row .el-table__expand-icon { /deep/ .current-row .el-table__expand-icon {
@ -990,7 +1029,7 @@ export default {
} }
/deep/ .current-row:hover .el-table__expand-icon { /deep/ .current-row:hover .el-table__expand-icon {
color:#fff color: #fff
} }
/deep/ .current-row:hover .cell { /deep/ .current-row:hover .cell {

Loading…
Cancel
Save