原材料采购,合并条码入库
四楼到五楼流程功能完善(增加合并条码)
master
xs 6 months ago
parent 782150c419
commit 13c42f6da3

@ -166,4 +166,17 @@ public interface RemoteMesService {
*/
@GetMapping("/barcode/selectBindBarcodeListByBarcodeInfo/{barcodeInfo}")
public R<List<MesBaseBindBarcode>> selectBindBarcodeListByBarcodeInfo(@PathVariable("barcodeInfo") String barcodeInfo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param bindBarcode
* @param source
* @return
*/
@GetMapping("/barcode/getBarcodeInfoByBindBarcode/{bindBarcode}")
public R<MesBaseBarcodeInfo> getBarcodeInfoByBindBarcode(@PathVariable("bindBarcode") String bindBarcode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

@ -38,6 +38,8 @@ public class MesSaleOrderRelate extends BaseEntity
private String relateSaleOrderCode;
private Long virtualMaterialId;
private Long materialId;
private Long productId;
@ -49,6 +51,8 @@ public class MesSaleOrderRelate extends BaseEntity
@Excel(name = "关联销售订单的数量,有可能小于原销售订单的订单数量")
private BigDecimal relateSaleOrderAmount;
private String bindBarcode;
private String materialCode;
private String materialName;
@ -99,6 +103,14 @@ public class MesSaleOrderRelate extends BaseEntity
this.relateSaleOrderCode = relateSaleOrderCode;
}
public Long getVirtualMaterialId() {
return virtualMaterialId;
}
public void setVirtualMaterialId(Long virtualMaterialId) {
this.virtualMaterialId = virtualMaterialId;
}
public String getBarcodeInfo() {
return barcodeInfo;
}
@ -157,6 +169,14 @@ public class MesSaleOrderRelate extends BaseEntity
this.relateSaleOrderAmount = relateSaleOrderAmount;
}
public String getBindBarcode() {
return bindBarcode;
}
public void setBindBarcode(String bindBarcode) {
this.bindBarcode = bindBarcode;
}
public String getMaterialCode() {
return materialCode;
}

@ -95,6 +95,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
public R<List<MesBaseBindBarcode>> selectBindBarcodeListByBarcodeInfo(String barcodeInfo, String source) {
return R.fail("根据原材料条码获取成品条码信息失败:" + throwable.getMessage());
}
@Override
public R<MesBaseBarcodeInfo> getBarcodeInfoByBindBarcode(String bindBarcode, String source) {
return R.fail("根据成品条码信息获取原材料条码失败:" + throwable.getMessage());
}
};
}
}

@ -26,6 +26,8 @@ public class WmsConstants {
/*原材料入库记录入库类型*/
public static final String RAW_INSTOCK_INSTOCK_TYPE_PURCHASE = "1";//采购入库
public static final String RAW_INSTOCK_INSTOCK_TYPE_RETURN = "2";//返库入库
public static final String RAW_INSTOCK_INSTOCK_TYPE_INTERNAL_PRODUCE = "4";//内部生产入库
public static final String RAW_INSTOCK_INSTOCK_TYPE_OTHER = "9";//其他入库

@ -118,6 +118,18 @@ public class Seq {
// 条码内容标识
public static final String mesBarcodeCode = "RB";
// 四楼到五楼内部生产条码内容记录标识
public static final String mesInternalBarcodeSeqType = "INTERNAL_BAR_CODE";
// 四楼到五楼内部生产条码内容序列数
private static AtomicInteger mesInternalBarcodeSeq = new AtomicInteger(1);
// 四楼到五楼内部生产条码内容标识
public static final String mesInternalBarcodeCode = "RN";
// 成品条码内容记录标识
public static final String mesCompBarcodeSeqType = "COMP_BAR_CODE";
@ -325,10 +337,10 @@ public class Seq {
// 内部生产合并虚拟原材料条码内容记录标识
public static final String mesInternalVirtualBarcodeSeqType = "INTERNAL_VIRTUAL_BAR_CODE";
// 内部生产虚拟原材料条码内容序列数
// 内部生产合并虚拟原材料条码内容序列数
private static AtomicInteger mesInternalVirtualBarcodeSeq = new AtomicInteger(1);
// 内部生产虚拟原材料条码内容标识
// 内部生产合并虚拟原材料条码内容标识
public static final String mesInternalVirtualBarcodeCode = "VI";
@ -340,7 +352,7 @@ public class Seq {
private static AtomicInteger mesPurchaseVirtualProductBarcodeSeq = new AtomicInteger(1);
// 采购合并虚拟成品条码内容标识
public static final String mesPurchaseVirtualProductBarcodeCode = "VP";
public static final String mesPurchaseVirtualProductBarcodeCode = "VC";
@ -476,6 +488,8 @@ public class Seq {
atomicInt = mesInternalVirtualBarcodeSeq;
}else if (mesInternalVirtualProductBarcodeSeqType.equals(type)) {
atomicInt = mesInternalVirtualProductBarcodeSeq;
}else if (mesInternalBarcodeSeqType.equals(type)) {
atomicInt = mesInternalBarcodeSeq;
}
return getId(atomicInt, 3, code);
}

@ -68,7 +68,6 @@
// }
//
// private void handleServerFeedback(String feedback) {
// // TODO: 实现处理服务器反馈的逻辑
// System.out.println("Handling server feedback: " + feedback);
// }
//

@ -410,4 +410,15 @@ public class MesBaseBarcodeInfoController extends BaseController
return R.ok(mesBaseBarcodeInfoService.selectMesBaseBindBarcodeList(queryBindBarcode));
}
/**
*
*/
@InnerAuth
@GetMapping(value="/getBarcodeInfoByBindBarcode/{bindBarcode}")
public R<MesBaseBarcodeInfo> getBarcodeInfoByBindBarcode(@PathVariable("bindBarcode") String bindBarcode)
{
return R.ok(mesBaseBarcodeInfoService.getBarcodeInfoByBindBarcode(bindBarcode));
}
}

@ -38,6 +38,7 @@ public class MesSaleOrderController extends BaseController
@Autowired
private IMesSaleOrderService mesSaleOrderService;
/**
*
*/

@ -1,88 +0,0 @@
//package com.hw.mes.domain;
//
//import org.apache.commons.lang3.builder.ToStringBuilder;
//import org.apache.commons.lang3.builder.ToStringStyle;
//import com.hw.common.core.annotation.Excel;
//import com.hw.common.core.web.domain.BaseEntity;
//
///**
// * 绑定条码对象 mes_base_bind_barcode
// *
// * @author Open Platform
// * @date 2024-09-25
// */
//public class MesBaseBindBarcode extends BaseEntity
//{
// private static final long serialVersionUID = 1L;
//
// /** 主键 */
// private Long bindBarcodeId;
//
// /** 条码ID */
// @Excel(name = "条码ID")
// private Long barcodeId;
//
// private String barcodeInfo;
//
// private Long saleOrderId;
//
// /** 绑定的条码内容 */
// @Excel(name = "绑定的条码内容")
// private String bindBarcode;
//
// public void setBindBarcodeId(Long bindBarcodeId)
// {
// this.bindBarcodeId = bindBarcodeId;
// }
//
// public Long getBindBarcodeId()
// {
// return bindBarcodeId;
// }
// public void setBarcodeId(Long barcodeId)
// {
// this.barcodeId = barcodeId;
// }
//
// public Long getBarcodeId()
// {
// return barcodeId;
// }
//
// public String getBarcodeInfo() {
// return barcodeInfo;
// }
//
// public void setBarcodeInfo(String barcodeInfo) {
// this.barcodeInfo = barcodeInfo;
// }
//
// public Long getSaleOrderId() {
// return saleOrderId;
// }
//
// public void setSaleOrderId(Long saleOrderId) {
// this.saleOrderId = saleOrderId;
// }
//
// public void setBindBarcode(String bindBarcode)
// {
// this.bindBarcode = bindBarcode;
// }
//
// public String getBindBarcode()
// {
// return bindBarcode;
// }
//
// @Override
// public String toString() {
// return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
// .append("bindBarcodeId", getBindBarcodeId())
// .append("barcodeId", getBarcodeId())
// .append("bindBarcode", getBindBarcode())
// .append("createBy", getCreateBy())
// .append("createTime", getCreateTime())
// .toString();
// }
//}

@ -1,270 +0,0 @@
//package com.hw.mes.domain;
//
//import java.math.BigDecimal;
//import java.util.Objects;
//
//import org.apache.commons.lang3.builder.ToStringBuilder;
//import org.apache.commons.lang3.builder.ToStringStyle;
//import com.hw.common.core.annotation.Excel;
//import com.hw.common.core.web.domain.BaseEntity;
//
///**
// * 采购销售订单绑定信息对象 mes_order_bind
// *
// * @author xins
// * @date 2024-05-16
// */
//public class MesOrderBind extends BaseEntity {
// private static final long serialVersionUID = 1L;
//
// /**
// * 主键标识
// */
// private Long orderBindId;
//
// /**
// * 安全库存标识(1是0否)
// */
// @Excel(name = "安全库存标识(1是0否)")
// private String safeFlag;
//
// /**
// * 销售订单ID;对应FID
// */
// @Excel(name = "销售订单ID;对应FID")
// private Long saleOrderId;
//
// /**
// * 销售订单编号
// */
// @Excel(name = "销售订单编号")
// private String saleOrderCode;
//
// /**
// * ERP成品ID
// */
// @Excel(name = "ERP成品ID")
// private Long productId;
//
// /**
// * 成品编号
// */
// @Excel(name = "成品编号")
// private String productCode;
//
// /**
// * 成品名称
// */
// @Excel(name = "成品名称")
// private String productName;
//
// /**
// * 采购订单ID
// */
// @Excel(name = "采购订单ID")
// private Long purchaseOrderId;
//
// /**
// * 采购订单编号
// */
// @Excel(name = "采购订单编号")
// private String poNo;
//
// /**
// * ERP物料ID
// */
// @Excel(name = "ERP物料ID")
// private Long materialId;
//
// /**
// * 物料编号
// */
// @Excel(name = "物料编号")
// private String materialCode;
//
// /**
// * 物料名称
// */
// @Excel(name = "物料名称")
// private String materialName;
//
// /**
// * 绑定数量
// */
// @Excel(name = "绑定数量")
// private BigDecimal bindAmount;
//
// /**
// * 绑定条码数量
// */
// private BigDecimal barcodeAmount;
//
// private String productSpec;
//
// private String materialSpec;
//
// public void setOrderBindId(Long orderBindId) {
// this.orderBindId = orderBindId;
// }
//
// public Long getOrderBindId() {
// return orderBindId;
// }
//
// public void setSafeFlag(String safeFlag) {
// this.safeFlag = safeFlag;
// }
//
// public String getSafeFlag() {
// return safeFlag;
// }
//
// public void setSaleOrderId(Long saleOrderId) {
// this.saleOrderId = saleOrderId;
// }
//
// public Long getSaleOrderId() {
// return saleOrderId;
// }
//
// public void setSaleOrderCode(String saleOrderCode) {
// this.saleOrderCode = saleOrderCode;
// }
//
// public String getSaleOrderCode() {
// return saleOrderCode;
// }
//
// public void setProductId(Long productId) {
// this.productId = productId;
// }
//
// public Long getProductId() {
// return productId;
// }
//
// public void setProductCode(String productCode) {
// this.productCode = productCode;
// }
//
// public String getProductCode() {
// return productCode;
// }
//
// public void setProductName(String productName) {
// this.productName = productName;
// }
//
// public String getProductName() {
// return productName;
// }
//
// public void setPurchaseOrderId(Long purchaseOrderId) {
// this.purchaseOrderId = purchaseOrderId;
// }
//
// public Long getPurchaseOrderId() {
// return purchaseOrderId;
// }
//
// public void setPoNo(String poNo) {
// this.poNo = poNo;
// }
//
// public String getPoNo() {
// return poNo;
// }
//
// public void setMaterialId(Long materialId) {
// this.materialId = materialId;
// }
//
// public Long getMaterialId() {
// return materialId;
// }
//
// public void setMaterialCode(String materialCode) {
// this.materialCode = materialCode;
// }
//
// public String getMaterialCode() {
// return materialCode;
// }
//
// public void setMaterialName(String materialName) {
// this.materialName = materialName;
// }
//
// public String getMaterialName() {
// return materialName;
// }
//
// public void setBindAmount(BigDecimal bindAmount) {
// this.bindAmount = bindAmount;
// }
//
// public BigDecimal getBindAmount() {
// return bindAmount;
// }
//
// public BigDecimal getBarcodeAmount() {
// return barcodeAmount;
// }
//
// public void setBarcodeAmount(BigDecimal barcodeAmount) {
// this.barcodeAmount = barcodeAmount;
// }
//
// public String getProductSpec() {
// return productSpec;
// }
//
// public void setProductSpec(String productSpec) {
// this.productSpec = productSpec;
// }
//
// public String getMaterialSpec() {
// return materialSpec;
// }
//
// public void setMaterialSpec(String materialSpec) {
// this.materialSpec = materialSpec;
// }
//
// @Override
// public String toString() {
// return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
// .append("orderBindId", getOrderBindId())
// .append("safeFlag", getSafeFlag())
// .append("saleOrderId", getSaleOrderId())
// .append("saleOrderCode", getSaleOrderCode())
// .append("productId", getProductId())
// .append("productCode", getProductCode())
// .append("productName", getProductName())
// .append("purchaseOrderId", getPurchaseOrderId())
// .append("poNo", getPoNo())
// .append("materialId", getMaterialId())
// .append("materialCode", getMaterialCode())
// .append("materialName", getMaterialName())
// .append("bindAmount", getBindAmount())
// .append("remark", getRemark())
// .append("createBy", getCreateBy())
// .append("createTime", getCreateTime())
// .append("updateBy", getUpdateBy())
// .append("updateTime", getUpdateTime())
// .toString();
// }
//
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
// MesOrderBind that = (MesOrderBind) o;
// return Objects.equals(orderBindId, that.orderBindId) && barcodeAmount.compareTo(that.barcodeAmount) == 0;
// }
//
// @Override
// public int hashCode() {
// return Objects.hash(orderBindId, barcodeAmount);
// }
//}

@ -1,106 +0,0 @@
//package com.hw.mes.domain;
//
//import java.math.BigDecimal;
//import java.util.Date;
//
//import org.apache.commons.lang3.builder.ToStringBuilder;
//import org.apache.commons.lang3.builder.ToStringStyle;
//import com.hw.common.core.annotation.Excel;
//import com.hw.common.core.web.domain.BaseEntity;
//
///**
// * 销售订单关联信息对象 mes_sale_order_relate
// *
// * @author xins
// * @date 2024-09-09
// */
//public class MesSaleOrderRelate extends BaseEntity
//{
// private static final long serialVersionUID = 1L;
//
// /** 主键 */
// private Long saleOrderRelateId;
//
// /** 销售订单ID */
// @Excel(name = "销售订单ID")
// private Long saleOrderId;
//
// /** 关联销售订单ID */
// @Excel(name = "关联销售订单ID")
// private Long relateSaleOrderId;
//
// /** 采购订单ID */
// private Long purchaseOrderId;
//
// /** 关联销售订单的数量,有可能小于原销售订单的订单数量 */
// @Excel(name = "关联销售订单的数量,有可能小于原销售订单的订单数量")
// private BigDecimal relateSaleOrderAmout;
//
// /**
// * 此字段不保存
// */
// private Date planDeliveryDate;
//
// public void setSaleOrderRelateId(Long saleOrderRelateId)
// {
// this.saleOrderRelateId = saleOrderRelateId;
// }
//
// public Long getSaleOrderRelateId()
// {
// return saleOrderRelateId;
// }
// public void setSaleOrderId(Long saleOrderId)
// {
// this.saleOrderId = saleOrderId;
// }
//
// public Long getSaleOrderId()
// {
// return saleOrderId;
// }
// public void setRelateSaleOrderId(Long relateSaleOrderId)
// {
// this.relateSaleOrderId = relateSaleOrderId;
// }
//
// public Long getPurchaseOrderId() {
// return purchaseOrderId;
// }
//
// public void setPurchaseOrderId(Long purchaseOrderId) {
// this.purchaseOrderId = purchaseOrderId;
// }
//
// public Long getRelateSaleOrderId()
// {
// return relateSaleOrderId;
// }
// public void setRelateSaleOrderAmout(BigDecimal relateSaleOrderAmout)
// {
// this.relateSaleOrderAmout = relateSaleOrderAmout;
// }
//
// public BigDecimal getRelateSaleOrderAmout()
// {
// return relateSaleOrderAmout;
// }
//
// public Date getPlanDeliveryDate() {
// return planDeliveryDate;
// }
//
// public void setPlanDeliveryDate(Date planDeliveryDate) {
// this.planDeliveryDate = planDeliveryDate;
// }
//
// @Override
// public String toString() {
// return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
// .append("saleOrderRelateId", getSaleOrderRelateId())
// .append("saleOrderId", getSaleOrderId())
// .append("relateSaleOrderId", getRelateSaleOrderId())
// .append("relateSaleOrderAmout", getRelateSaleOrderAmout())
// .toString();
// }
//}

@ -75,4 +75,14 @@ public interface MesSaleOrderRelateMapper
*/
public List<MesSaleOrderRelate> selectMesSaleOrderRelateJoinList(MesSaleOrderRelate mesSaleOrderRelate);
/**
*
*
* @param bindBarcode
* @return
*/
public MesSaleOrderRelate selectMesSaleOrderRelateByBindBarcode(String bindBarcode);
}

@ -224,4 +224,12 @@ public interface IMesBaseBarcodeInfoService {
* @return
*/
public List<MesBaseBindBarcode> selectMesBaseBindBarcodeList(MesBaseBindBarcode mesBaseBindBarcode);
/**
*
* @param bindBarcode
* @return
*/
public MesBaseBarcodeInfo getBarcodeInfoByBindBarcode(String bindBarcode);
}

@ -1,8 +1,5 @@
package com.hw.mes.service.impl;
import java.math.BigDecimal;
import java.util.*;
import com.hw.common.core.constant.*;
import com.hw.common.core.domain.R;
import com.hw.common.core.exception.ServiceException;
@ -15,10 +12,7 @@ import com.hw.mes.config.MesConfig;
import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesBindBarcodeVo;
import com.hw.mes.mapper.*;
import java.text.DecimalFormat;
import java.util.stream.Collectors;
import com.hw.mes.service.IMesBaseBarcodeInfoService;
import com.hw.printer.api.RemotePrinterService;
import com.hw.printer.api.domain.vo.PrintContentVo;
import com.hw.printer.api.domain.vo.PrinterVo;
@ -28,11 +22,16 @@ import com.hw.wms.api.domain.vo.WmsProductStockVo;
import com.hw.wms.api.domain.vo.WmsRawStockVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.service.IMesBaseBarcodeInfoService;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* Service
@ -367,9 +366,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
throw new ServiceException("此条码为非原材料条码,不能生成成品条码");
}
if (rawMaterialBarcode.indexOf(Seq.mesPurchaseVirtualBarcodeCode) >= 0) {
if (rawMaterialBarcode.contains(Seq.mesPurchaseVirtualBarcodeCode)) {//采购合并虚拟条码
barcode = Seq.getId(Seq.mesPurchaseVirtualProductBarcodeSeqType, Seq.mesPurchaseVirtualProductBarcodeCode);
} else if (rawMaterialBarcode.indexOf(Seq.mesInternalVirtualBarcodeCode) >= 0) {
} else if (rawMaterialBarcode.contains(Seq.mesInternalVirtualBarcodeCode)) {//内部生产合并虚拟条码
barcode = Seq.getId(Seq.mesInternalVirtualProductBarcodeSeqType, Seq.mesInternalVirtualProductBarcodeCode);
}
@ -437,7 +436,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
} else {
materialId = mesBaseBarcodeInfo.getMaterialId();
materialId = productPlan.getMaterialId();
MesProductOrder mesProductOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(productPlan.getProductOrderId());
mesBaseBarcodeInfo.setCompleteFlag(mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_SALE)
@ -921,10 +920,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String splitCharacterEnglish = ",";
String splitCharacterChinese = "";
String[] productBarcodesArr = null;
if (productBarcodes.indexOf(splitCharacterEnglish) >= 0) {
if (productBarcodes.contains(splitCharacterEnglish)) {
productBarcodesArr = productBarcodes.split(splitCharacterEnglish);
} else if (productBarcodes.indexOf(splitCharacterChinese) >= 0) {
} else if (productBarcodes.contains(splitCharacterChinese)) {
productBarcodesArr = productBarcodes.split(splitCharacterChinese);
}
@ -935,6 +934,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
boolean palletInfoCodeRepeat = false;
String palletInfoCode = "";
String barcodeInfo = "";
String userName = SecurityUtils.getUsername();
Date currentDate = DateUtils.getNowDate();
if (productBarcodesArr != null) {
for (String productBarcode : productBarcodesArr) {
//先根据之前的成品条码信息获取托盘信息
@ -966,6 +967,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
barcodeInfo = Seq.getId(Seq.mesInternalVirtualBarcodeSeqType, Seq.mesInternalVirtualBarcodeCode);
//新建虚拟物料
materialId = this.insertNewVirtualMaterial(barcodeInfo, userName, currentDate);
} else {
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcodes);
if (basePalletInfo == null) {
@ -985,7 +990,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
basePalletInfoList.add(basePalletInfo);
materialId = productBarcodeInfo.getMaterialId();
barcodeInfo = Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode);
barcodeInfo = Seq.getId(Seq.mesInternalBarcodeSeqType, Seq.mesInternalBarcodeCode);
}
@ -998,8 +1003,6 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
String userName = SecurityUtils.getUsername();
Date currentDate = DateUtils.getNowDate();
//修改托盘信息的绑定关系为当前原材料的
if (basePalletInfoList == null || basePalletInfoList.isEmpty()) {
throw new ServiceException("没有绑定托盘信息;请先绑定");
@ -1034,7 +1037,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo);
List<MesBaseBindBarcode> toInsertedBaseBindBarcodeList = new ArrayList<>();
List<MesSaleOrderRelate> toInsertedSaleOrderRelateList = new ArrayList<>();
for (MesBaseBarcodeInfo productBarcodeInfo : productBarcodeInfoList) {
@ -1063,21 +1066,27 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
allErrorMsgBuilder.append("成品条码[").append(productBarcodeInfo.getBarcodeInfo()).append("]没有维护在五楼成品的生产bom信息中;");
} else if (childMaterialBomList.size() > 1) {
allErrorMsgBuilder.append("成品条码[").append(productBarcodeInfo.getBarcodeInfo())
.append("]五楼成品的生产bom信息多于1个").append(mesMaterialBomList.size()).append(";");
.append("]五楼成品的生产bom信息不能多于1个[").append(mesMaterialBomList.size()).append("个];");
} else {
MesMaterialBom childMaterialBom = childMaterialBomList.get(0);
MesMaterialBom parentBom = mesMaterialBomMapper.selectMesMaterialBomByMaterialBomId(childMaterialBom.getParentId());
MesBaseBindBarcode baseBindBarcode = new MesBaseBindBarcode();
baseBindBarcode.setBindBarcode(productBarcodeInfo.getBarcodeInfo());
baseBindBarcode.setBarcodeId(mesBaseBarcodeInfo.getBarcodeId());
baseBindBarcode.setBarcodeInfo(barcodeInfo);
baseBindBarcode.setSaleOrderId(mesBaseBarcodeInfo.getSaleOrderId());
baseBindBarcode.setMaterialId(bindMaterialId);//四楼成品条码的物料id作为五楼原材料的物料id
baseBindBarcode.setProductId(parentBom.getMaterialId());
baseBindBarcode.setCreateBy(userName);
baseBindBarcode.setCreateTime(new Date());
toInsertedBaseBindBarcodeList.add(baseBindBarcode);
MesSaleOrderRelate saleOrderRelate = new MesSaleOrderRelate();
saleOrderRelate.setBarcodeInfo(barcodeInfo);
saleOrderRelate.setSaleOrderId(mesBaseBarcodeInfo.getSaleOrderId());
saleOrderRelate.setVirtualMaterialId(materialId);
saleOrderRelate.setMaterialId(bindMaterialId);//四楼成品条码的物料id作为五楼原材料的物料id
saleOrderRelate.setProductId(parentBom.getMaterialId());
saleOrderRelate.setBindBarcode(productBarcodeInfo.getBarcodeInfo());
saleOrderRelate.setCreateBy(userName);
saleOrderRelate.setCreateTime(currentDate);
saleOrderRelate.setOrderBindId(0L);
saleOrderRelate.setRelateSaleOrderId(0L);
saleOrderRelate.setRelateSaleOrderCode("");
saleOrderRelate.setRelateSaleOrderAmount(BigDecimal.ONE);
toInsertedSaleOrderRelateList.add(saleOrderRelate);
}
@ -1086,7 +1095,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
if (allErrorMsgBuilder.length() > 0) {
throw new ServiceException(allErrorMsgBuilder.toString());
}
return mesBaseBindBarcodeMapper.batchMesBaseBindBarcode(toInsertedBaseBindBarcodeList);
return mesSaleOrderRelateMapper.batchMesSaleOrderRelate(toInsertedSaleOrderRelateList);
}
@ -1100,28 +1109,44 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
//多个成品条码的销售订单要相同,并且需要与当前生产明细的销售订单相同;
String produceSaleOrderCode = StringUtils.isEmpty(mesBaseBarcodeInfo.getSaleorderCode()) ? "无"
: mesBaseBarcodeInfo.getSaleorderCode();
String productSaleOrderCode = StringUtils.isEmpty(productBarcodeInfo.getSaleorderCode()) ? "无"
: productBarcodeInfo.getSaleorderCode();
if (!produceSaleOrderCode.equals(productSaleOrderCode)) {
errorMsg.append("成品条码销售订单与当前生产明细不同(成品条码:").append(productBarcode)
.append(",销售订单:").append(productSaleOrderCode)
.append(",当前生产明细销售订单:").append(produceSaleOrderCode).append(");");
}
if (mesBaseBarcodeInfo != null && productBarcodeInfo != null) {
String produceSaleOrderCode = StringUtils.isEmpty(mesBaseBarcodeInfo.getSaleorderCode()) ? "无"
: mesBaseBarcodeInfo.getSaleorderCode();
String productSaleOrderCode = StringUtils.isEmpty(productBarcodeInfo.getSaleorderCode()) ? "无"
: productBarcodeInfo.getSaleorderCode();
if (!produceSaleOrderCode.equals(productSaleOrderCode)) {
errorMsg.append("成品条码销售订单与当前生产明细不同(成品条码:").append(productBarcode)
.append(",销售订单:").append(productSaleOrderCode)
.append(",当前生产明细销售订单:").append(produceSaleOrderCode).append(");");
}
if (!productBarcodeInfo.getCompleteFlag().equals(MesConstants.MES_BASE_BARCODE_COMPLETE_FLAG_NO)) {
errorMsg.append("成品条码[").append(productBarcode).append("]是完整物料,未拆分;");
}
WmsProductStockVo queryProductStockVo = new WmsProductStockVo();
queryProductStockVo.setProductBatch(productBarcode);
R<Boolean> isProductOutstock = remoteWmsService.isProductOutstock(queryProductStockVo, SecurityConstants.INNER);
if (!isProductOutstock.getData()) {
errorMsg.append("成品条码[").append(productBarcode).append("]还未出库,不能生成原材料条码;");
if (productBarcodeInfo != null) {
if (!productBarcodeInfo.getCompleteFlag().equals(MesConstants.MES_BASE_BARCODE_COMPLETE_FLAG_NO)) {
errorMsg.append("成品条码[").append(productBarcode).append("]是完整物料,未拆分;");
}
WmsProductStockVo queryProductStockVo = new WmsProductStockVo();
queryProductStockVo.setProductBatch(productBarcode);
R<Boolean> isProductOutstock = remoteWmsService.isProductOutstock(queryProductStockVo, SecurityConstants.INNER);
if (!isProductOutstock.getData()) {
errorMsg.append("成品条码[").append(productBarcode).append("]还未出库,不能生成原材料条码;");
}
//更新此成品码之前的配对码的绑定码
MesBaseBarcodeInfo queryBarcodeInfo = new MesBaseBarcodeInfo();
queryBarcodeInfo.setBindBarcode(productBarcode);
List<MesBaseBarcodeInfo> bindBarcodes = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBarcodeInfo);
if (bindBarcodes == null || bindBarcodes.isEmpty()) {
errorMsg.append("成品条码").append(productBarcode).append("没有配对码信息;");
}
}
MesBasePalletInfo queryPalletInfo = new MesBasePalletInfo();
queryPalletInfo.setMaterialBarcode(productBarcode);
@ -1135,14 +1160,6 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// errorMsg.append("成品条码""还未绑定托盘信息");
// }
//更新此成品码之前的配对码的绑定码
MesBaseBarcodeInfo queryBarcodeInfo = new MesBaseBarcodeInfo();
queryBarcodeInfo.setBindBarcode(productBarcode);
List<MesBaseBarcodeInfo> bindBarcodes = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBarcodeInfo);
if (bindBarcodes == null || bindBarcodes.isEmpty()) {
errorMsg.append("成品条码").append(productBarcode).append("没有配对码信息;");
}
return errorMsg.toString();
@ -1346,7 +1363,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
querySaleOrderRelate.setRelateSaleOrderId(relateSaleOrderId);
List<MesSaleOrderRelate> mesSaleOrderRelates = mesSaleOrderRelateMapper.selectMesSaleOrderRelateList(querySaleOrderRelate);
if (mesSaleOrderRelates != null && !mesSaleOrderRelates.isEmpty()) {
errorMsgBuilder.append(String.format("序号%s销售订单已经关联过;", mesSaleOrderRelate.getIndex()));
errorMsgBuilder.append(String.format("序号%s销售订单已经合并关联过;", mesSaleOrderRelate.getIndex()));
}
MesSaleOrder saleOrder = mesSaleOrderMapper.selectMesSaleOrderBySaleOrderId(relateSaleOrderId);
@ -1358,7 +1375,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
if (!saleOrder.getIsRelease().equals(MesConstants.MES_SALE_ORDER_IS_RELEASE_TO_PUBLISH)) {
errorMsgBuilder.append(String.format("序号%s销售订单已经发布工单,不能合并;", mesSaleOrderRelate.getIndex()));
errorMsgBuilder.append(String.format("序号%s销售订单已经发布生产任务,不能合并;", mesSaleOrderRelate.getIndex()));
}
if (saleOrderAmount.compareTo(availableAmount) != 0) {
@ -1497,6 +1514,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesSaleOrderRelates.forEach(msor -> {
msor.setSaleOrderId(mesSaleOrder.getSaleOrderId());
msor.setBarcodeInfo(barcodeInfo);
msor.setVirtualMaterialId(materialId);
});
mesSaleOrderRelateMapper.batchMesSaleOrderRelate(mesSaleOrderRelates);
@ -1572,6 +1590,23 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
/**
*
*
* @param bindBarcode
* @return
*/
@Override
public MesBaseBarcodeInfo getBarcodeInfoByBindBarcode(String bindBarcode) {
MesBaseBarcodeInfo mesBaseBarcodeInfo = null;
MesSaleOrderRelate mesSaleOrderRelate = mesSaleOrderRelateMapper.selectMesSaleOrderRelateByBindBarcode(bindBarcode);
if (mesSaleOrderRelate != null) {
mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(mesSaleOrderRelate.getBarcodeInfo());
}
return mesBaseBarcodeInfo;
}
// public MesPurchaseOrder insertVirtualPurchaseOrder(Long materialId, String barcodeInfo, BigDecimal sumOrderAmount,
// List<MesPurchaseOrderRelate> mesPurchaseOrderRelates,String userName, Date currentDate) {
// MesPurchaseOrder virtualPurchaseOrder = new MesPurchaseOrder();

@ -384,9 +384,9 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
String bindBarcode;
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) &&
mesBaseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_PRODUCT_ORDER_INTERNAL)) {//对内生产
if (StringUtils.isEmpty(mesBaseBarcodeInfo.getProductBarcode())) {
throw new ServiceException("还未生成对内原材料条码");
}
// if (StringUtils.isEmpty(mesBaseBarcodeInfo.getProductBarcode())) {
// throw new ServiceException("还未生成对内原材料条码");
// }
bindBarcode = mesBaseBarcodeInfo.getProductBarcode();
} else {//外部销售
bindBarcode = mesBaseBarcodeInfo.getBarcodeInfo();

@ -491,7 +491,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
Long userId = SecurityUtils.getUserId();
mesProductPlan.setUserId(userId);
mesProductPlan.setProcessId(processId);
mesProductPlan.setIncompleteFlag("1");
// mesProductPlan.setIncompleteFlag("1");
// String ipAddress = IpUtils.getIpAddr();
// MesBaseStationInfo mesBaseStationInfo = mesBase
// queryBaseStation.set

@ -311,7 +311,8 @@
mpo.material_id,
mpo.material_bom_id,
mpo.produce_material_id,
concat(mb.material_name, '-', mb.material_bom_desc) material_bom_desc,
-- concat(mb.material_name, '-', mb.material_bom_desc) material_bom_desc,
mb.material_bom_desc,
mpo.dispatch_type,
mpo.dispatch_id,
mpo.cabinet_channel,

@ -11,9 +11,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="orderBindId" column="order_bind_id" />
<result property="relateSaleOrderId" column="relate_sale_order_id" />
<result property="relateSaleOrderCode" column="relate_sale_order_code" />
<result property="virtualMaterialId" column="virtual_material_id" />
<result property="materialId" column="material_id" />
<result property="purchaseOrderId" column="purchase_order_id" />
<result property="relateSaleOrderAmount" column="relate_sale_order_amount" />
<result property="bindBarcode" column="bind_barcode" />
<result property="productId" column="product_id" />
<result property="materialCode" column="material_code" />
@ -48,10 +50,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderBindId != null">order_bind_id,</if>
<if test="relateSaleOrderId != null">relate_sale_order_id,</if>
<if test="relateSaleOrderCode != null">relate_sale_order_code,</if>
<if test="virtualMaterialId != null">virtual_material_id,</if>
<if test="materialId != null">material_id,</if>
<if test="productId != null">product_id,</if>
<if test="purchaseOrderId != null">purchase_order_id,</if>
<if test="relateSaleOrderAmount != null">relate_sale_order_amount,</if>
<if test="bindBarcode != null">bind_barcode,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="saleOrderId != null">#{saleOrderId},</if>
@ -59,10 +63,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderBindId != null">#{orderBindId},</if>
<if test="relateSaleOrderId != null">#{relateSaleOrderId},</if>
<if test="relateSaleOrderCode != null">#{relateSaleOrderCode},</if>
<if test="virtualMaterialId != null">#{virtualMaterialId},</if>
<if test="materialId != null">#{materialId},</if>
<if test="productId != null">#{productId},</if>
<if test="purchaseOrderId != null">#{purchaseOrderId},</if>
<if test="relateSaleOrderAmount != null">#{relateSaleOrderAmount},</if>
<if test="bindBarcode != null">#{bindBarcode},</if>
</trim>
</insert>
@ -89,9 +95,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="batchMesSaleOrderRelate">
insert into mes_sale_order_relate( sale_order_id, barcode_info,order_bind_id,relate_sale_order_id,relate_sale_order_code,material_id, product_id,purchase_order_id,relate_sale_order_amount) values
insert into mes_sale_order_relate( sale_order_id, barcode_info,order_bind_id,relate_sale_order_id,relate_sale_order_code,virtual_material_id,material_id, product_id,purchase_order_id,relate_sale_order_amount,bind_barcode) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.saleOrderId}, #{item.barcodeInfo}, #{item.orderBindId}, #{item.relateSaleOrderId}, #{item.relateSaleOrderCode}, #{item.materialId},#{item.productId},#{item.purchaseOrderId}, #{item.relateSaleOrderAmount})
( #{item.saleOrderId}, #{item.barcodeInfo}, #{item.orderBindId}, #{item.relateSaleOrderId}, #{item.relateSaleOrderCode}, #{item.virtualMaterialId}, #{item.materialId},#{item.productId},#{item.purchaseOrderId}, #{item.relateSaleOrderAmount}, #{item.bindBarcode})
</foreach>
</insert>
@ -113,4 +119,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectMesSaleOrderRelateByBindBarcode" parameterType="String" resultMap="MesSaleOrderRelateResult">
<include refid="selectMesSaleOrderRelateVo"/>
where bind_barcode= #{bindBarcode} limit 1
</select>
</mapper>

@ -196,7 +196,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
wmsRawInstock.setApplyDate(currentDate);
// if (!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)) {
wmsRawInstock.setMaterialBarcode(wmsRawInstockVo.getMaterialBarcode());
wmsRawInstock.setMaterialBarcode(wmsRawInstockVo.getMaterialBarcode());
// }
wmsRawInstock.setMaterialBatchCode(baseBarcodeInfo.getBatchCode());
wmsRawInstock.setMaterialId(baseBarcodeInfo.getMaterialId());
@ -289,7 +289,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
String cabinetChannel = wmsRawBackVo.getCabinetChannel();
if(cabinetChannel.equals(MesConstants.MES_PRODUCT_ORDER_CABINET_CHANNEL_PURCHASE)){
if (cabinetChannel.equals(MesConstants.MES_PRODUCT_ORDER_CABINET_CHANNEL_PURCHASE)) {
//判断此柜体是否已跟配对码绑定,如果未绑定不允许返库
R<MesBaseBarcodeInfo> bindBarcodeInfoR = remoteMesService.getBarcodeByBindBarcode(materialBarcode, SecurityConstants.INNER);
if (bindBarcodeInfoR == null) {
@ -309,7 +309,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
throw new ServiceException("没有领取柜体,无需返库");
}
}else{
} else {
}
@ -348,7 +348,13 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
wmsRawInstock.setPurchaseOrderId(baseBarcodeInfo.getPurchaseOrderId());
wmsRawInstock.setPoNo(baseBarcodeInfo.getPoNo());
wmsRawInstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO);
wmsRawInstock.setInstockType(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_RETURN);
if (baseBarcodeInfo.getCompleteFlag().equals(WmsConstants.WMS_RAW_STOCK_COMPLETE_FLAG_NO)) {
//如果条码信息是非完整的,则代表是内部生产
wmsRawInstock.setInstockType(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_INTERNAL_PRODUCE);
} else {
wmsRawInstock.setInstockType(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_RETURN);
}
wmsRawInstock.setMaterialId(baseBarcodeInfo.getMaterialId());
wmsRawInstock.setMaterialBarcode(materialBarcode);
wmsRawInstock.setMaterialBatchCode(baseBarcodeInfo.getBatchCode());

@ -1006,7 +1006,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
Long materialId;
if (!bindBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
//bindBarcode在这为成品码通过productbarcode找到5楼拆分区新生成的原材料条码
R<MesBaseBarcodeInfo> rawBarcodeInfoR = remoteMesService.getRawBarcodeByProductBarcode(bindBarcode, SecurityConstants.INNER);
R<MesBaseBarcodeInfo> rawBarcodeInfoR = remoteMesService.getBarcodeInfoByBindBarcode(bindBarcode, SecurityConstants.INNER);
if (rawBarcodeInfoR == null) {
throw new ServiceException("没有绑定的原材料条码");
}

@ -216,12 +216,18 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
public List<WmsStockTotal> selectWmsStockTotalList4ProductApply(WmsStockTotal wmsStockTotal) {
wmsStockTotal.setStockType(WmsConstants.PRODUCT_STOCK_STOCK_TYPE_PRODUCT);
wmsStockTotal.setSafeFlag(WmsConstants.WMS_SAFE_FLAG_NO);
List<WmsStockTotal> list = wmsStockTotalMapper.selectWmsStockTotalList4ProductApply(wmsStockTotal);
if (list == null || list.isEmpty()) {
List<WmsStockTotal> stockTotalList = wmsStockTotalMapper.selectWmsStockTotalList4ProductApply(wmsStockTotal);
if (stockTotalList == null || stockTotalList.isEmpty()) {
throw new ServiceException("没有销售订单成品库存信息");
}
return list;
for(WmsStockTotal stockTotal:stockTotalList){
if(stockTotal.getProductId().equals(0L)){
stockTotal.setMaterialCode("1111|222");
}
}
return stockTotalList;
}

@ -53,6 +53,9 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
@Autowired
private WmsBaseWarehouseMapper wmsBaseWarehouseMapper;
@Autowired
private WmsProductInstockMapper wmsProductInstockMapper;
@Resource
private RemoteMesService remoteMesService;
@ -383,7 +386,6 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
productStock.setStockType(WmsConstants.PRODUCT_STOCK_STOCK_TYPE_PRODUCT);
productStock.setProductBatch(materialBarcode);
productStock.setPalletInfoCode(mesBaseBarcodeInfo.getPalletInfoCode());
// productStock.setQualityStatus();//todo: 获取质检状态
productStock.setWarehouseFloor(targetWarehouse.getWarehouseFloor());
productStock.setProductId(mesBaseBarcodeInfo.getMaterialId());
productStock.setPlanCode(mesBaseBarcodeInfo.getPlanCode());
@ -394,8 +396,34 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
productStock.setCreateBy(userName);
wmsProductStockMapper.insertWmsProductStock(productStock);
this.insertProductInstock(mesBaseBarcodeInfo,targetWarehouseId,userName,currentDate);
return 1;
}
public void insertProductInstock(MesBaseBarcodeInfo baseBarcodeInfo,Long warehouseId,String userName,Date currentDate){
WmsProductInstock wmsProductInstock = new WmsProductInstock();
wmsProductInstock.setTaskCode(Seq.getId(Seq.productInstockSeqType, Seq.productInstockCode));
wmsProductInstock.setWarehouseId(warehouseId);
wmsProductInstock.setPalletInfoCode(baseBarcodeInfo.getPalletInfoCode());
wmsProductInstock.setProductType(WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_PRODUCT);
wmsProductInstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_MANUAL);
wmsProductInstock.setPlanCode(baseBarcodeInfo.getPlanCode());
wmsProductInstock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode());
wmsProductInstock.setInstockType(WmsConstants.PRODUCT_INSTOCK_INSTOCK_TYPE_PRODUCT);
wmsProductInstock.setProductId(baseBarcodeInfo.getMaterialId());
wmsProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo());
wmsProductInstock.setInstockAmount(BigDecimal.ONE);
wmsProductInstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
wmsProductInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsProductInstock.setApplyBy(userName);
wmsProductInstock.setApplyDate(currentDate);
wmsProductInstockMapper.insertWmsProductInstock(wmsProductInstock);
}
}

@ -158,7 +158,8 @@
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="agvPositionCode != null and agvPositionCode != ''">agv_position_code = #{agvPositionCode},</if>
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
<if test="containerCode != null">container_code = #{containerCode},</if>
<if test="containerCode != null and containerCode != ''">container_code = #{containerCode},</if>
<if test="containerCode != null and containerCode == ''">container_code = null,</if>
<if test="locRow != null">loc_row = #{locRow},</if>
<if test="layerNum != null">layer_num = #{layerNum},</if>
<if test="locColumn != null">loc_column = #{locColumn},</if>

@ -58,7 +58,7 @@
领柜体
</el-button>
<el-button size="mini" type="danger" v-if="($route.query && $route.query.id) === '1'"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode || form.cabinetChannel === CABINET_CHANNEL.INTERNAL"
:disabled=" !form.planDetailCode || form.cabinetChannel === CABINET_CHANNEL.INTERNAL"
@click="print()">
条码
</el-button>

@ -443,7 +443,7 @@
<!-- 无销售订单添加生产任务对话框 -->
<el-dialog :title="title" :visible.sync="noOrderOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form ref="form" :model="form" :rules="noOrderRules" label-width="110px">
<el-form-item label="任务编号" prop="orderCode">
<el-input v-model="form.orderCode" :disabled="true"/>
</el-form-item>
@ -733,6 +733,61 @@ export default {
}
],
},
//
noOrderRules: {
orderCode: [
{required: true, message: "任务编号不能为空", trigger: "blur"}
],
saleType: [
{required: true, message: "销售类型不能为空", trigger: "blur"}
],
materialName: [
{required: true, message: "请选择成品", trigger: "blur"}
],
materialBomId: [
{required: true, message: "成品BOM不能为空", trigger: "blur"}
],
dispatchType: [
{required: true, message: "派工类型不能为空", trigger: "change"}
],
dispatchId: [
{required: true, message: "工艺路线不能为空", trigger: "blur"}
],
cabinetChannel: [
{required: true, message: "柜体渠道不能为空", trigger: "blur"}
],
planDeliveryDate: [
{required: true, message: "计划交货日期不能为空", trigger: "blur"}
],
planBeginTime: [
{required: true, message: "计划开始时间不能为空", trigger: "blur"}
],
planEndTime: [
{required: true, message: "计划结束时间不能为空", trigger: "blur"}
],
produceMaterialName: [
{required: true, message: "请选择生产物料",}
],
saleAmount: [
{required: true, message: "销售数量不能为空", trigger: "blur"},
{
validator: (rule, value, callback) => callback(Number.isInteger(Number(value)) && Number(value) >= 0 ? undefined : new Error("销售数量需要是大于等于0的整数")),
trigger: "blur"
}
],
planAmount: [
{required: true, message: "计划数量不能为空", trigger: "blur"},
{
validator: (rule, value, callback) => callback(Number.isInteger(Number(value)) && Number(value) >= 1 ? undefined : new Error("计划数量需要是大于等于1的整数")),
trigger: "blur"
}
],
},
columns: [
{key: 0, label: `主键标识`, visible: false},
{key: 1, label: `任务编号`, visible: true},

Loading…
Cancel
Save