车间MES:
-四楼装配工序生成成品条码和配对码修改完善
-五楼拆分工序生成原材料条码修改完善
-五楼装配工序扫码开始修改完善
-五楼装配页面申请领物料完善
-重新生成条码完善
MES:
生产派工:对内派工时需要选择生产物料
PDA:
-五楼PDA组装出库修改完善
master
xs 11 months ago
parent ed0dc9fcdf
commit 0cf799c883

@ -52,9 +52,9 @@ public interface RemoteMesService {
/**
*
*
*
* @param bindBarcode
* @param bindBarcode
* @param source
* @return
*/
@ -62,6 +62,17 @@ public interface RemoteMesService {
public R<MesBaseBarcodeInfo> getBarcodeByBindBarcode(@PathVariable("bindBarcode") String bindBarcode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param productBarcode
* @param source
* @return
*/
@GetMapping("/barcode/getBarcodeByProductBarcode/{productBarcode}")
public R<MesBaseBarcodeInfo> getBarcodeByProductBarcode(@PathVariable("productBarcode") String productBarcode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*

@ -181,7 +181,7 @@ public class MesBaseBarcodeInfo extends BaseEntity
private String locationCode;
private String condition;
private String bindOrFlag;//如果是1查询条码连着配对码一起查询
public String getLocationCode() {
return locationCode;
@ -574,12 +574,12 @@ public class MesBaseBarcodeInfo extends BaseEntity
this.confirmFlag = confirmFlag;
}
public String getCondition() {
return condition;
public String getBindOrFlag() {
return bindOrFlag;
}
public void setCondition(String condition) {
this.condition = condition;
public void setBindOrFlag(String bindOrFlag) {
this.bindOrFlag = bindOrFlag;
}
@Override

@ -128,6 +128,8 @@ public class MesBaseMaterialInfo extends BaseEntity
/** 采购计价单位;对应FPurchasePriceUnitId */
private Long purchasePriceUnitId;
private String selectType;//3是选择实际生产的物料信息需要过滤是到511仓库的物料
public Long getPurchasePriceUnitId() {
return purchasePriceUnitId;
}
@ -378,6 +380,14 @@ public class MesBaseMaterialInfo extends BaseEntity
this.warehouseId = warehouseId;
}
public String getSelectType() {
return selectType;
}
public void setSelectType(String selectType) {
this.selectType = selectType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -45,6 +45,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
@Override
public R<MesBaseBarcodeInfo> getBarcodeByBindBarcode(String bindBarcode, String source) {
return R.fail("获取配对条码信息失败:" + throwable.getMessage());
}
@Override
public R<MesBaseBarcodeInfo> getBarcodeByProductBarcode(String productBarcode, String source) {
return R.fail("获取绑定条码信息失败:" + throwable.getMessage());
}

@ -40,7 +40,9 @@ public class WmsConstants {
/*原材料库存库存类型*/
public static final String RWA_STOCK_STOCK_TYPE_RAW = "1";//原材料
public static final String RWA_STOCK_STOCK_TYPE_PRODUCT = "2";//半成品
public static final String RWA_STOCK_STOCK_TYPE_SEMI = "2";//半成品
public static final String RWA_STOCK_STOCK_TYPE_PRODUCT = "3";//成品
/*出入库退库记录明细方式*/

@ -138,4 +138,9 @@ public enum BusinessType
*
*/
REGENERATE,
/**
*
*/
CONTINUE,
}

@ -320,4 +320,6 @@ public class MesApiController extends BaseController {
public AjaxResult check4thFloorProduceOutstock(@PathVariable String materialBarcode) {
return success(mesBaseBarcodeInfoService.check4thFloorProduceOutstock(materialBarcode));
}
}

@ -304,4 +304,18 @@ public class MesBaseBarcodeInfoController extends BaseController
return getDataTable(list);
}
/**
*
*/
@InnerAuth
@GetMapping(value = "/getBarcodeByProductBarcode/{productBarcode}")
public AjaxResult getBarcodeByProductBarcode(@PathVariable("productBarcode") String productBarcode)
{
return success(mesBaseBarcodeInfoService.selectMesBaseBarcodeInfoByProductBarcode(productBarcode));
}
}

@ -72,6 +72,9 @@ public class MesProductOrder extends BaseEntity {
@Excel(name = "物料bomID")
private Long materialBomId;
/**对内生产生产的实际物料信息*/
private Long produceMaterialId;
/**
* BOM
*/
@ -181,17 +184,37 @@ public class MesProductOrder extends BaseEntity {
private String dispatchName;
/**
*
*
*/
@Excel(name = "物料编号")
@Excel(name = "成品编号")
private String materialCode;
/**
*
*
*/
@Excel(name = "物料名称")
@Excel(name = "成品名称")
private String materialName;
/**
*
*/
private String materialSpec;
/**
*
*/
private String produceMaterialCode;
/**
*
*/
private String produceMaterialName;
/**
*
*/
private String produceMaterialSpec;
/**
*
*/
@ -377,6 +400,14 @@ public class MesProductOrder extends BaseEntity {
return materialBomId;
}
public Long getProduceMaterialId() {
return produceMaterialId;
}
public void setProduceMaterialId(Long produceMaterialId) {
this.produceMaterialId = produceMaterialId;
}
public void setDispatchType(String dispatchType) {
this.dispatchType = dispatchType;
}
@ -497,6 +528,39 @@ public class MesProductOrder extends BaseEntity {
this.materialName = materialName;
}
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
public String getProduceMaterialCode() {
return produceMaterialCode;
}
public void setProduceMaterialCode(String produceMaterialCode) {
this.produceMaterialCode = produceMaterialCode;
}
public String getProduceMaterialName() {
return produceMaterialName;
}
public void setProduceMaterialName(String produceMaterialName) {
this.produceMaterialName = produceMaterialName;
}
public String getProduceMaterialSpec() {
return produceMaterialSpec;
}
public void setProduceMaterialSpec(String produceMaterialSpec) {
this.produceMaterialSpec = produceMaterialSpec;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -186,6 +186,8 @@ public class MesProductPlan extends BaseEntity
private String processType;
private String saleType;
public Long getSaleOrderId() {
return saleOrderId;
@ -528,6 +530,14 @@ public class MesProductPlan extends BaseEntity
this.processType = processType;
}
public String getSaleType() {
return saleType;
}
public void setSaleType(String saleType) {
this.saleType = saleType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -75,7 +75,7 @@ public interface MesBaseBarcodeInfoMapper
/**
* ,limit 1
*
* @param bindBarcode
* @param bindBarcode
* @return
*/
public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByBindBarcode(String bindBarcode);

@ -111,7 +111,7 @@ public interface IMesBaseBarcodeInfoService
public int printBarcodes(Long[] barcodeIds,String printType);
/**
* ()
* ()
*
* @param mesBindBarcodeVo
* @return
@ -122,12 +122,20 @@ public interface IMesBaseBarcodeInfoService
/**
*
*
* @param bindBarcode
* @param bindBarcode
* @return
*/
public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByBindBarcode(String bindBarcode);
/**
*
*
* @param productBarcode 545
* @return
*/
public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByProductBarcode(String productBarcode);
/**
*

@ -129,7 +129,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// 生成成品条码
else if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_PRODUCT)) {
generateProductBarcode(mesBaseBarcodeInfo);
} else {//生成背板条码或者门板条
} else {//生成配对
generateBindBarcode(mesBaseBarcodeInfo);
}
@ -282,6 +282,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
Long materialId;
String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
//在五楼根据原材料条码单独生成成品条码
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) &&
mesBaseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_YES)) {
@ -295,40 +298,66 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
throw new ServiceException("此条码为非原材料条码,不能生成成品条码");
}
MesBaseBarcodeInfo bindBarcode = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBindBarcode(rawMaterialBarcode);
if (bindBarcode == null) {
throw new ServiceException("此原材料条码没有绑定背板或门板");
}
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByProductBarcode(rawMaterialBarcode);
if (productBarcodeInfo != null) {
throw new ServiceException("此原材料条码已经生成过成品条码,不能重复生成");
}
planCode = bindBarcode.getPlanCode();
planDetailCode = bindBarcode.getPlanDetailCode();
saleOrderId = bindBarcode.getSaleOrderId();
saleOrderCode = bindBarcode.getSaleorderCode();
materialId = rawBarcode.getMaterialId();
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByMaterialBarcode(rawMaterialBarcode);
if (mesProductPlanDetail == null) {
throw new ServiceException("此条码没有生产明细");
}
if (!mesProductPlanDetail.getPlanDetailStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)) {
throw new ServiceException("生产明细还未结束");
}
planCode = mesProductPlanDetail.getPlanCode();
planDetailCode = mesProductPlanDetail.getPlanDetailCode();
if (StringUtils.isEmpty(planCode) || StringUtils.isEmpty(planDetailCode)) {
throw new ServiceException("绑定的门板或背板条码有误");
throw new ServiceException("绑定的配对码有误");
}
if (StringUtils.isEmpty(rawBarcode.getPalletInfoCode())) {
throw new ServiceException("此条码有误,未绑定托盘信息");
throw new ServiceException("此条码未绑定托盘信息");
}
mesBaseBarcodeInfo.setPalletInfoCode(rawBarcode.getPalletInfoCode());
MesProductPlan productPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanCode(planCode);
if (productPlan == null) {
throw new ServiceException("此生产派工不存在");
}
saleOrderId = rawBarcode.getSaleOrderId();
saleOrderCode = rawBarcode.getSaleorderCode();
materialId = productPlan.getMaterialId();
mesBaseBarcodeInfo.setPalletInfoCode(rawBarcode.getPalletInfoCode());//重新绑定托盘号
mesBaseBarcodeInfo.setBindStatus(MesConstants.MES_BARCODE_BIND_STATUS_BINDING);
//取消托盘信息此原材料条码的绑定信息
MesBasePalletInfo mesBasePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByPalletInfoCode(rawBarcode.getPalletInfoCode());
mesBasePalletInfo.setMaterialBarcode(barcode);
mesBasePalletInfo.setMaterialId(materialId);
mesBasePalletInfo.setUpdateTime(currentDate);
mesBasePalletInfo.setUpdateBy(userName);
mesBasePalletInfoMapper.updateMesBasePalletInfo(mesBasePalletInfo);
//取消原材料条码的托盘绑定信息
rawBarcode.setPalletInfoCode("");
rawBarcode.setBindStatus(MesConstants.MES_BARCODE_BIND_STATUS_UNBINDING);
rawBarcode.setUpdateTime(currentDate);
rawBarcode.setUpdateBy(userName);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(rawBarcode);
mesProductPlanDetail.setMaterialBarcode(barcode);
mesProductPlanDetail.setUpdateBy(userName);
mesProductPlanDetail.setUpdateTime(currentDate);
mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
} else {
planCode = mesBaseBarcodeInfo.getPlanCode();
planDetailCode = mesBaseBarcodeInfo.getPlanDetailCode();
@ -358,16 +387,13 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
saleOrderId = productPlan.getSaleOrderId();
saleOrderCode = productPlan.getSaleorderCode();
materialId = productPlan.getMaterialId();
materialId = productPlan.getMaterialId();//在生产计划的materialid是根据saletype保存如果是外部销售则保存productorder中的materialid如果是内部生产则保存prpductorder中的producematerialid
MesProductOrder mesProductOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(productPlan.getProductOrderId());
mesBaseBarcodeInfo.setCompleteFlag(mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_SALE)
? MesConstants.MES_BASE_BARCODE_COMPLETE_FLAG_YES : MesConstants.MES_BASE_BARCODE_COMPLETE_FLAG_NO);
}
Date currentDate = new Date();
mesBaseBarcodeInfo.setBatchCode(barcode);// 成品的批次代码 == 条码内容
mesBaseBarcodeInfo.setBarcodeInfo(barcode);
mesBaseBarcodeInfo.setAmount(new BigDecimal(1));
@ -380,7 +406,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBaseBarcodeInfo.setPlanCode(planCode);
mesBaseBarcodeInfo.setPlanDetailCode(planDetailCode);
mesBaseBarcodeInfo.setCreateTime(currentDate);
mesBaseBarcodeInfo.setCreateBy(SecurityUtils.getUsername());
mesBaseBarcodeInfo.setCreateBy(userName);
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo);
@ -417,7 +443,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
Date currentDate = new Date();
for (int i = 0; i < barcodeAmount; i++) {
String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
String barcode = Seq.getId(Seq.mesBindBarcodeSeqType, Seq.mesBindBarcodeCode);
mesBaseBarcodeInfo.setBatchCode(barcode);// 成品的批次代码 == 条码内容
mesBaseBarcodeInfo.setBarcodeInfo(barcode);
mesBaseBarcodeInfo.setAmount(new BigDecimal(1));
@ -429,6 +455,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_NO);
mesBaseBarcodeInfo.setSaleOrderId(productPlan.getSaleOrderId());
mesBaseBarcodeInfo.setSaleorderCode(productPlan.getSaleorderCode());
mesBaseBarcodeInfo.setPlanDetailCode(null);
mesBaseBarcodeInfo.setCreateTime(currentDate);
mesBaseBarcodeInfo.setCreateBy(userName);
@ -714,7 +741,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
/**
* ()
* ()
*
* @param mesBindBarcodeVo
* @return
@ -763,7 +790,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
/**
*
*
* @param bindBarcode
* @param bindBarcode
* @return
*/
@Override
@ -772,6 +799,18 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
/**
*
*
* @param productBarcode 545
* @return
*/
@Override
public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByProductBarcode(String productBarcode) {
return mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByProductBarcode(productBarcode);
}
/**
*
*
@ -814,7 +853,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Override
public int insertInternalMesBaseBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
String productBarcode = mesBaseBarcodeInfo.getProductBarcode();
//先判断此成品条码是否有绑定过原材料条码
//先获取此4楼的成品条码。判断此成品条码是否有绑定过原材料条码
MesBaseBarcodeInfo bindProductBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByProductBarcode(productBarcode);
if (bindProductBarcodeInfo != null) {
throw new ServiceException("此成品条码已经打印过原材料条码,无需重复打印");
@ -850,12 +889,24 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
if (productBarcodeInfo == null) {
throw new ServiceException("成品条码不存在");
}
if (StringUtils.isEmpty(productBarcodeInfo.getPalletInfoCode())) {
throw new ServiceException("此成品还未绑定托盘信息");
}
productBarcodeInfo.setPalletInfoCode("");
productBarcodeInfo.setBindStatus(MesConstants.MES_BARCODE_BIND_STATUS_UNBINDING);
productBarcodeInfo.setUpdateTime(currentDate);
productBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(productBarcodeInfo);
//更新此成品码之前的配对码的绑定码
MesBaseBarcodeInfo queryBarcodeInfo = new MesBaseBarcodeInfo();
queryBarcodeInfo.setBindBarcode(productBarcode);
List<MesBaseBarcodeInfo> bindBarcodes = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBarcodeInfo);
if (bindBarcodes == null || bindBarcodes.isEmpty()) {
throw new ServiceException("此成品码没有配对码信息");
}
mesBaseBarcodeInfo.setBarcodeInfo(barcodeInfo);
mesBaseBarcodeInfo.setBatchCode(barcodeInfo);
mesBaseBarcodeInfo.setBatchFlag(MesConstants.NOT_IS_BATCH);
@ -863,6 +914,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBaseBarcodeInfo.setBarcodeType(MesConstants.MES_BARCODE_TYPE_RAW);
mesBaseBarcodeInfo.setPalletInfoCode(basePalletInfo.getPalletInfoCode());
mesBaseBarcodeInfo.setSingleFlag(MesConstants.MES_BARCODE_SINGLE_FLAG_INTERNAL);
mesBaseBarcodeInfo.setCompleteFlag(productBarcodeInfo.getCompleteFlag());
if (productBarcodeInfo.getSaleOrderId() != null && !productBarcodeInfo.getSaleOrderId().equals(0L)) {
mesBaseBarcodeInfo.setSaleOrderId(productBarcodeInfo.getSaleOrderId());
mesBaseBarcodeInfo.setSaleorderCode(productBarcodeInfo.getSaleorderCode());
@ -890,14 +942,16 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String barcodeType = mesBaseBarcodeInfo.getBarcodeType();
String oldBarcode = mesBaseBarcodeInfo.getBarcodeInfo();
String newBarcode = "";
String errorMsg = "";
switch (barcodeType) {
case MesConstants.MES_BARCODE_TYPE_RAW:
WmsRawStockVo queryRawStockVo = new WmsRawStockVo();
queryRawStockVo.setInstockBatch(oldBarcode);
R<Boolean> isExistRawStock = remoteWmsService.isExistRawStock(queryRawStockVo, SecurityConstants.INNER);
if (isExistRawStock.getData()) {
throw new ServiceException("此物料条码存在库存信息,不能重新生成");
throw new ServiceException("此物料条码存在原料库存信息,不能重新生成");
}
errorMsg = "此原材料条码已经生成过成品条码,不能重新生成";
newBarcode = Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode);
break;
case MesConstants.MES_BARCODE_TYPE_PRODUCT:
@ -905,8 +959,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
queryProductStockVo.setProductBatch(oldBarcode);
R<Boolean> isExistProductStock = remoteWmsService.isExistProductStock(queryProductStockVo, SecurityConstants.INNER);
if (isExistProductStock.getData()) {
throw new ServiceException("此物料条码存在库存信息,不能重新生成");
throw new ServiceException("此物料条码存在成品库存信息,不能重新生成");
}
errorMsg = "此成品条码已经生成过原材料条码,不能重新生成";
newBarcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
break;
case MesConstants.MES_BARCODE_TYPE_BIND:
@ -914,6 +969,11 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
break;
}
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByProductBarcode(oldBarcode);
if (productBarcodeInfo != null) {
throw new ServiceException(errorMsg);
}
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
MesBaseAbandonBarcode mesBaseAbandonBarcode = new MesBaseAbandonBarcode();
@ -923,6 +983,14 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBaseAbandonBarcode.setUpdateTime(currentDate);
mesBaseAbandonBarcodeMapper.insertMesBaseAbandonBarcode(mesBaseAbandonBarcode);
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByMaterialBarcode(oldBarcode);
if (mesProductPlanDetail != null) {
mesProductPlanDetail.setMaterialBarcode(newBarcode);
mesProductPlanDetail.setUpdateTime(currentDate);
mesProductPlanDetail.setUpdateBy(userName);
mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
}
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(oldBarcode);
if (basePalletInfo != null) {
basePalletInfo.setMaterialBarcode(newBarcode);

@ -76,12 +76,20 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
//销售订单添加工单:校验是否超出销售数量
if (mesProductOrder.getSaleOrderFlag().equals("1") && StringUtils.isNotNull(mesProductOrder.getSaleOrderId())) {
checkSalesQuantity(mesProductOrder);
}else{
} else {
mesProductOrder.setSaleAmount(mesProductOrder.getPlanAmount());
}
if (mesProductOrder.getSaleOrderId() == null) {
mesProductOrder.setSaleOrderId(0L);
}
if (mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_SALE)) {
mesProductOrder.setProduceMaterialId(null);
} else {
if (mesProductOrder.getProduceMaterialId() == null) {
throw new ServiceException("请选择生产物料");
}
}
return mesProductOrderMapper.insertMesProductOrder(mesProductOrder);
}
@ -237,6 +245,7 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
/**
*
*
*
* @param mesProductOrder
* @return
*/
@ -260,10 +269,10 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
Long orderId = order.getProductOrderId();
List<String> planDateRange = new ArrayList<>();
if (StringUtils.isNotNull(order.getPlanBeginTime())){
if (StringUtils.isNotNull(order.getPlanBeginTime())) {
planDateRange.add(DateFormatUtils.format(order.getPlanBeginTime(), YYYY_MM_DD_HH_MM_SS));
}
if (StringUtils.isNotNull(order.getPlanEndTime())){
if (StringUtils.isNotNull(order.getPlanEndTime())) {
planDateRange.add(DateFormatUtils.format(order.getPlanEndTime(), YYYY_MM_DD_HH_MM_SS));
}
order.setPlanDateRange(planDateRange);
@ -274,10 +283,10 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
for (MesProductPlan mesProductPlan : productPlanList) {
MesProductOrder productOrder = new MesProductOrder();
List<String> dateRange = new ArrayList<>();
if (StringUtils.isNotNull(mesProductPlan.getPlanBeginTime())){
if (StringUtils.isNotNull(mesProductPlan.getPlanBeginTime())) {
dateRange.add(DateFormatUtils.format(mesProductPlan.getPlanBeginTime(), YYYY_MM_DD_HH_MM_SS));
}
if (StringUtils.isNotNull(mesProductPlan.getPlanEndTime())){
if (StringUtils.isNotNull(mesProductPlan.getPlanEndTime())) {
dateRange.add(DateFormatUtils.format(mesProductPlan.getPlanEndTime(), YYYY_MM_DD_HH_MM_SS));
}
productOrder.setPlanDateRange(dateRange);
@ -300,6 +309,7 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
/**
*
*
* @param productOrderList
* @return
*/
@ -308,14 +318,14 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
int result = 0;
for (MesProductOrder productOrder : productOrderList) {
productOrder.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
if (StringUtils.isNull(productOrder.getPlanId())){
if (StringUtils.isNull(productOrder.getPlanId())) {
result = mesProductOrderMapper.updateMesProductOrder(productOrder);
} else {
MesProductPlan productPlan = new MesProductPlan();
productPlan.setPlanId(productOrder.getPlanId());
productPlan.setPlanBeginTime(productOrder.getPlanBeginTime());
productPlan.setPlanEndTime(productOrder.getPlanEndTime());
if (StringUtils.isNotNull(productPlan.getPlanBeginTime()) || StringUtils.isNotNull(productPlan.getPlanEndTime())){
if (StringUtils.isNotNull(productPlan.getPlanBeginTime()) || StringUtils.isNotNull(productPlan.getPlanEndTime())) {
result = mesProductPlanMapper.updateMesProductPlan(productPlan);
}
}

@ -242,7 +242,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
Long planId = dbProductPlanDetail.getPlanId();
MesProductPlan dbProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(planId);
if(!dbProductPlan.getUserId().equals(SecurityUtils.getUserId())){
if (!dbProductPlan.getUserId().equals(SecurityUtils.getUserId())) {
throw new ServiceException("此派工信息没有派工到您");
}
@ -253,16 +253,35 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
throw new ServiceException("此生产派工已结束");
}
//如果是五楼拆分,校验是否有绑定条码
//如果是五楼拆分,校验是否有配对条码
if (StringUtils.isNotEmpty(mesProductPlanDetail.getProcessType())
&& mesProductPlanDetail.getProcessType().equals(MesConstants.MES_PROCESS_TYPE_FIFTH_SPLIT)) {
MesBaseBarcodeInfo queryBarcodeInfo = new MesBaseBarcodeInfo();
queryBarcodeInfo.setPlanDetailCode(dbProductPlanDetail.getPlanDetailCode());
queryBarcodeInfo.setBarcodeType(MesConstants.MES_BARCODE_TYPE_RAW);
List<MesBaseBarcodeInfo> rawBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBarcodeInfo);
if (rawBarcodeInfos == null || rawBarcodeInfos.isEmpty()) {
throw new ServiceException("还未生成原材料条码,不能完成");
}
MesBaseBarcodeInfo mesBaseBarcodeInfo = rawBarcodeInfos.get(0);
String bindBarcode;
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) &&
mesBaseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_PRODUCT_ORDER_INTERNAL)) {//对内生产
if (StringUtils.isEmpty(mesBaseBarcodeInfo.getProductBarcode())) {
throw new ServiceException("还未生成对内原材料条码");
}
bindBarcode = mesBaseBarcodeInfo.getProductBarcode();
} else {//外部销售
bindBarcode = mesBaseBarcodeInfo.getBarcodeInfo();
}
MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo();
queryBaseBarcodeInfo.setPlanDetailCode(dbProductPlanDetail.getPlanDetailCode());
List<MesBaseBarcodeInfo> mesBaseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBaseBarcodeInfo);
List<MesBaseBarcodeInfo> bindBaseBarcodeInfos = mesBaseBarcodeInfos.stream().filter(mesBaseBarcodeInfo ->
StringUtils.isNotEmpty(mesBaseBarcodeInfo.getBindBarcode())).collect(Collectors.toList());
queryBaseBarcodeInfo.setBindBarcode(bindBarcode);
List<MesBaseBarcodeInfo> bindBaseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBaseBarcodeInfo);
if (bindBaseBarcodeInfos == null || bindBaseBarcodeInfos.isEmpty()) {
throw new ServiceException("请绑定条码执行返库后再执行完成");
throw new ServiceException("请配对条码执行返库后再完成");
}
}
@ -331,6 +350,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
dbProductPlan.setUpdateBy(userName);
mesProductPlanMapper.updateMesProductPlan(dbProductPlan);
mesProductPlanDetail.setPlanDetailId(dbProductPlanDetail.getPlanDetailId());
mesProductPlanDetail.setUpdateTime(currentDate);
mesProductPlanDetail.setUpdateBy(userName);
mesProductPlanDetail.setPlanDetailStatus(updatePlanDetailStatus);
@ -399,7 +419,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
MesProductPlan mesProductPlan = new MesProductPlan();
if (startType.equals(MesConstants.MES_START_TYPE_FIFTH_FLOOR_INSTALL)) {//五楼组装工序
if (startType.equals(MesConstants.MES_START_TYPE_FIFTH_FLOOR_INSTALL)) {//五楼PDA组装工序
//在拆分区拿柜体拆分时,需要打印配对码,然后跟柜体码绑定
//在从4楼到5楼接驳位时需要根据4楼的成品码重新打印原材料条码
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(
@ -420,14 +440,14 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
}
MesProductPlan barcodeProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanCode(planCode);
if(barcodeProductPlan==null){
if (barcodeProductPlan == null) {
throw new ServiceException("无派工信息");
}
MesProductPlan queryProductPlan = new MesProductPlan();
queryProductPlan.setDispatchCode(barcodeProductPlan.getDispatchCode());
queryProductPlan.setFinalProcessFlag(MesConstants.MES_FINAL_PROCESS_FLAG_YES);
List<MesProductPlan> mesProductPlans = mesProductPlanMapper.selectOnlyMesProductPlans(queryProductPlan);
if(mesProductPlans==null || mesProductPlans.isEmpty()){
if (mesProductPlans == null || mesProductPlans.isEmpty()) {
throw new ServiceException("没有派工信息");
}
mesProductPlan = mesProductPlans.get(0);
@ -444,7 +464,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
throw new ServiceException("无派工信息");
}
if(!mesProductPlan.getUserId().equals(SecurityUtils.getUserId())){
if (!mesProductPlan.getUserId().equals(SecurityUtils.getUserId())) {
throw new ServiceException("此派工信息没有派工到您");
}
@ -488,25 +508,51 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
public void start5thFloorAssemble(String materialBarcode, String dispatchCode, String planDetailCode, String userName, Date currentDate) {
//materialBarcode是配对码
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode);
if (mesBaseBarcodeInfo == null) {
throw new ServiceException("条码有误");
}
if (!mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)) {
throw new ServiceException("请扫描背板或门板条码开始");
throw new ServiceException("请扫描配对条码开始");
}
if (StringUtils.isEmpty(mesBaseBarcodeInfo.getBindBarcode())) {
throw new ServiceException("此条码有误,未绑定任何柜体");
}
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getTransferredPlanDetailCode())) {
//获取绑定的之前的成品条码信息
MesBaseBarcodeInfo bindBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(mesBaseBarcodeInfo.getBindBarcode());
if (bindBarcodeInfo == null) {
throw new ServiceException("配对条码有误,未找到原材料条码信息");
}
if(StringUtils.isNotEmpty(bindBarcodeInfo.getSafeFlag()) &&
bindBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_INTERNAL)){//对内生产
if(StringUtils.isEmpty(bindBarcodeInfo.getProductBarcode())){
throw new ServiceException("未按成品条码生成原材料条码");
}
}
if (StringUtils.isNotEmpty(bindBarcodeInfo.getTransferredPlanDetailCode())) {
throw new ServiceException("此条码已经扫描使用过,不能再次使用");
}
MesProductPlan barcodeProductPlan;
if (bindBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_PRODUCT)) {//如果是成品码则是4楼绑定的需要找到5楼生成的原材料条码
//通过productbarcode找到原材料条码
MesBaseBarcodeInfo rawBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByProductBarcode(mesBaseBarcodeInfo.getBindBarcode());
if (rawBarcodeInfo == null) {
throw new ServiceException("未找到原材料条码");
}
barcodeProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanCode(rawBarcodeInfo.getPlanCode());
} else {
barcodeProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanCode(mesBaseBarcodeInfo.getPlanCode());
}
//校验此条码是否是同一派工单
MesProductPlan barcodeProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanCode(mesBaseBarcodeInfo.getPlanCode());
if (barcodeProductPlan == null) {
throw new ServiceException("条码有误,没有相关派工");
}
@ -514,18 +560,10 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
throw new ServiceException("此条码的派工单号为:" + barcodeProductPlan.getDispatchCode() + ",与此派工单号不符");
}
// MesMaterialAssignInfo queryMaterialAssignInfo = new MesMaterialAssignInfo();
// queryMaterialAssignInfo.setMaterialBarcode(materialBarcode);
// List<MesMaterialAssignInfo> mesMaterialAssignInfoList = mesMaterialAssignInfoMapper.selectMesMaterialAssignInfoList(queryMaterialAssignInfo);
// if (mesMaterialAssignInfoList == null || mesMaterialAssignInfoList.isEmpty()) {
// throw new ServiceException("此物料条码还没下发到工位");
// }
mesBaseBarcodeInfo.setTransferredPlanDetailCode(planDetailCode);
mesBaseBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
bindBarcodeInfo.setTransferredPlanDetailCode(planDetailCode);
bindBarcodeInfo.setUpdateTime(currentDate);
bindBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(bindBarcodeInfo);
}

@ -670,6 +670,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
}
// public String executeAssignTaskResultTask() {
// ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
// boolean running = true;

@ -58,6 +58,7 @@
bbi.barcode_type,
bbi.barcode_info,
bbi.batch_code,
bbi.single_flag,
bbi.pallet_info_code,
bbi.bind_barcode,
bbi.material_id,
@ -72,6 +73,7 @@
bbi.po_no,
bbi.production_date,
bbi.accepted_date,
bbi.complete_flag,
bbi.last_outstock_date,
bbi.plan_code,
bbi.plan_detail_code,
@ -137,6 +139,14 @@
<if test="updateBy != null and updateBy != ''">and bbi.update_by = #{updateBy}</if>
<if test="updateTime != null ">and bbi.update_time = #{updateTime}</if>
<if test="barcodeTypeStr != null and barcodeTypeStr != ''">and bbi.barcode_type in (${barcodeTypeStr})</if>
<if test="bindOrFlag != null and bindOrFlag != '' and planDetailCode != null and planDetailCode != ''">
or exists
(select 1 from mes_base_barcode_info mbbi where mbbi.plan_detail_code =#{planDetailCode}
and bbi.bind_barcode=mbbi.barcode_info)</if>
</where>
order by bbi.barcode_id desc
</select>

@ -111,6 +111,7 @@
<if test="deletedFlag != null and deletedFlag != ''">and bmi.deleted_flag = #{deletedFlag}</if>
<if test="approveDate != null ">and bmi.approve_date = #{approveDate}</if>
<if test="erpModifyDate != null ">and bmi.erp_modify_date = #{erpModifyDate}</if>
<if test="selectType != null and selectType = '1'">and exists (select 1 from wms_warehouse_material wwm where wwm.storage_type='1' and wwm.warehouse_id=511 and wwm.storage_id=bmi.material_id)</if>
</where>
</select>

@ -14,6 +14,7 @@
<result property="saleType" column="sale_type"/>
<result property="materialId" column="material_id"/>
<result property="materialBomId" column="material_bom_id"/>
<result property="produceMaterialId" column="produce_material_id"/>
<result property="dispatchType" column="dispatch_type"/>
<result property="dispatchId" column="dispatch_id"/>
<result property="saleAmount" column="sale_amount"/>
@ -37,7 +38,11 @@
<result property="dispatchName" column="dispatchName"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="materialSpec" column="material_spec"/>
<result property="materialBomDesc" column="material_bom_desc"/>
<result property="produceMaterialCode" column="produce_material_code"/>
<result property="produceMaterialName" column="produce_material_name"/>
<result property="produceMaterialSpec" column="produce_material_spec"/>
<result property="productionTime" column="production_time"/>
<result property="preOrderId" column="pre_order_id"/>
</resultMap>
@ -52,12 +57,17 @@
mpo.sale_type,
mpo.material_id,
mpo.material_bom_id,
mpo.produce_material_id,
concat(mb.material_name, '-', mb.material_bom_desc) material_bom_desc,
mpo.dispatch_type,
mpo.dispatch_id,
mbr.route_name dispatchName,
bmi.material_code,
bmi.material_name,
bmi.material_spec,
pbmi.material_code as produce_material_code,
pbmi.material_name as produce_material_name,
pbmi.material_spec as produce_material_spec,
mpo.sale_amount,
mpo.plan_amount,
mpo.dispatch_amount,
@ -87,6 +97,7 @@
left join mes_base_process_info p on p.process_id = b.process_id
group by a.route_id, a.route_name) mbr on mbr.route_id = mpo.dispatch_id
left join mes_base_material_info bmi on bmi.material_id = mpo.material_id
left join mes_base_material_info pbmi on pbmi.material_id = mpo.produce_material_id
left join mes_material_bom mb on mb.material_bom_id = mpo.material_bom_id
</sql>
@ -143,6 +154,7 @@
<if test="saleType != null and saleType != ''">sale_type,</if>
<if test="materialId != null">material_id,</if>
<if test="materialBomId != null">material_bom_id,</if>
<if test="produceMaterialId != null">produce_material_id,</if>
<if test="dispatchType != null and dispatchType != ''">dispatch_type,</if>
<if test="dispatchId != null">dispatch_id,</if>
<if test="saleAmount != null">sale_amount,</if>
@ -174,6 +186,7 @@
<if test="saleType != null and saleType != ''">#{saleType},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialBomId != null">#{materialBomId},</if>
<if test="produceMaterialId != null">#{produceMaterialId},</if>
<if test="dispatchType != null and dispatchType != ''">#{dispatchType},</if>
<if test="dispatchId != null">#{dispatchId},</if>
<if test="saleAmount != null">#{saleAmount},</if>
@ -209,6 +222,7 @@
<if test="saleType != null and saleType != ''">sale_type = #{saleType},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialBomId != null">material_bom_id = #{materialBomId},</if>
<if test="produceMaterialId != null">produce_material_id = #{produceMaterialId},</if>
<if test="dispatchType != null and dispatchType != ''">dispatch_type = #{dispatchType},</if>
<if test="dispatchId != null">dispatch_id = #{dispatchId},</if>
<if test="saleAmount != null">sale_amount = #{saleAmount},</if>

@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMesProductPlanDetailVo">
select plan_detail_id, plan_detail_code, plan_id, plan_code, user_id, user_name, real_begin_time, real_end_time,attach_id, plan_detail_status, is_flag, remark, create_by, create_time, update_by, update_time from mes_product_plan_detail
select plan_detail_id, plan_detail_code, plan_id, plan_code, user_id, user_name, material_barcode,real_begin_time, real_end_time,attach_id, plan_detail_status, is_flag, remark, create_by, create_time, update_by, update_time from mes_product_plan_detail
</sql>
<select id="selectMesProductPlanDetailList" parameterType="MesProductPlanDetail" resultMap="MesProductPlanDetailResult">
@ -102,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userName != null">user_name = #{userName},</if>
<if test="realBeginTime != null">real_begin_time = #{realBeginTime},</if>
<if test="realEndTime != null">real_end_time = #{realEndTime},</if>
<if test="materialBarcode != null and materialBarcode != ''">material_barcode = #{materialBarcode},</if>
<if test="planDetailStatus != null and planDetailStatus != ''">plan_detail_status = #{planDetailStatus},</if>
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</if>

@ -48,7 +48,7 @@
<result property="stationName" column="station_name"/>
<result property="sopId" column="sop_id"/>
<result property="orderCode" column="order_code"/>
<result property="saleType" column="sale_type"/>
</resultMap>
<resultMap id="MesProductPlanMesProductPlanDetailResult" type="MesProductPlan" extends="MesProductPlanResult">
@ -343,7 +343,7 @@
mpp.material_bom_id, mpp.process_id, mpp.process_order, mpp.last_process_id,mpp.final_process_flag,mpp.user_id,
mpp.station_id, mpp.dispatch_amount, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time,
mpp.real_begin_time, mpp.real_end_time,
mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mbmi.material_code,mbmi.material_name,mbmi.material_spec
mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mpo.sale_type,mbmi.material_code,mbmi.material_name,mbmi.material_spec
from mes_product_plan mpp left join mes_product_order mpo on mpp.product_order_id = mpo.product_order_id
left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id
<where>

@ -53,6 +53,10 @@ public class WmsConfig {
*/
private String wcsAgvCompleteUrl;
/**
* WCS-45
*/
private String wcsAgvContinueUrl;
public String getFifthAssembleStationCode() {
return fifthAssembleStationCode;
@ -117,4 +121,12 @@ public class WmsConfig {
public void setWcsAgvCompleteUrl(String wcsAgvCompleteUrl) {
this.wcsAgvCompleteUrl = wcsAgvCompleteUrl;
}
public String getWcsAgvContinueUrl() {
return wcsAgvContinueUrl;
}
public void setWcsAgvContinueUrl(String wcsAgvContinueUrl) {
this.wcsAgvContinueUrl = wcsAgvContinueUrl;
}
}

@ -8,6 +8,7 @@ import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.web.page.TableDataInfo;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.wms.domain.*;
import com.hw.wms.domain.vo.*;
import com.hw.wms.service.*;
@ -72,12 +73,13 @@ public class WmsApiController extends BaseController {
*/
// @RequiresPermissions("mes:materialBom:list")
@GetMapping("/getStockTotal")
public AjaxResult getStockTotal(WmsStockTotal queryStockTotal) {
public TableDataInfo getStockTotal(WmsStockTotal queryStockTotal) {
// String ancestors = mesMaterialBom.getAncestors();
// ancestors = "0," + ancestors;
// mesMaterialBom.setAncestors(ancestors);
startPage();
List<WmsStockTotal> list = wmsStockTotalService.selectWmsStockTotalJoinListBySaleOrder(queryStockTotal);
return success(list);
return getDataTable(list);
}
@ -256,4 +258,14 @@ public class WmsApiController extends BaseController {
return toAjax(wmsErpScheduledTaskService.synchronizeProductOutstockInformationToERP(days));
}
/**
* WCS-45
*/
@Log(title = "入库", businessType = BusinessType.CONTINUE)
@PostMapping(("/continueRawInstock"))
public AjaxResult continueRawInstock(@Validated @RequestBody WmsRawInstockContinueVo wmsRawInstockContinueVo) {
return toAjax(wmsRawInstockService.continueRawInstock(wmsRawInstockContinueVo));
}
}

@ -108,6 +108,12 @@ public class WmsStockTotal extends BaseEntity {
@Excel(name = "有效标记")
private String activeFlag;
private String materialSpec;
private String materialCodeNameSpec;
private BigDecimal applyQty;//已申请数量
public String getWarehouseName() {
return warehouseName;
@ -238,6 +244,30 @@ public class WmsStockTotal extends BaseEntity {
this.materialName = materialName;
}
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
public String getMaterialCodeNameSpec() {
return materialCodeNameSpec;
}
public void setMaterialCodeNameSpec(String materialCodeNameSpec) {
this.materialCodeNameSpec = materialCodeNameSpec;
}
public BigDecimal getApplyQty() {
return applyQty;
}
public void setApplyQty(BigDecimal applyQty) {
this.applyQty = applyQty;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,20 @@
package com.hw.wms.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class WmsRawInstockContinueVo {
/**物料条码*/
@NotBlank(message = "物料条码必须输入")
private String materialBarcode;//调度暂时没用
private String palletInfoCode;//托盘号
private Long materialId;//物料ID
private String endStationCode;//工位,调度暂时没用
}

@ -3,6 +3,7 @@ package com.hw.wms.service;
import java.util.List;
import com.hw.wms.domain.WmsRawInstock;
import com.hw.wms.domain.vo.WmsRawBackVo;
import com.hw.wms.domain.vo.WmsRawInstockContinueVo;
import com.hw.wms.domain.vo.WmsRawInstockVo;
import org.springframework.transaction.annotation.Transactional;
@ -79,4 +80,11 @@ public interface IWmsRawInstockService
* @param wmsRawBackVo
*/
public int applyRawBack(WmsRawBackVo wmsRawBackVo);
/**
* WCS-45
*
* @param wmsRawInstockContinueVo
*/
public int continueRawInstock(WmsRawInstockContinueVo wmsRawInstockContinueVo);
}

@ -304,7 +304,19 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
String operationType = WmsConstants.WMS_OPERATION_TYPE_AUTO;
String executeStatus = WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE;
return produceInstock(wmsProduceInstockVo, warehouseId, productType, operationType, executeStatus, 5L);
produceInstock(wmsProduceInstockVo, warehouseId, productType, operationType, executeStatus, 5L);
/**
* 5PDA
*/
MesPdaProductPlanVo mesPdaProductPlanVo = new MesPdaProductPlanVo();
mesPdaProductPlanVo.setMaterialBarcode(wmsProduceInstockVo.getMaterialBarcode());
R<?> tdReturnMsg = remoteMesService.complete5thFloorInstall(mesPdaProductPlanVo, SecurityConstants.INNER);
if (tdReturnMsg.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务
throw new RuntimeException(tdReturnMsg.getMsg());
}
return 1;
}
/**
@ -342,7 +354,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
/**
*
* 5
*
* @param wmsProduceInstockVo
* @param warehouseId
@ -362,10 +374,15 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
throw new ServiceException("物料条码有误");
}
//按原材料入库的柜体原料码进行入库
if (!productType.equals(WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_SEMI) &&
baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW)) {
throw new ServiceException("此物料条码为原材料,非成品条码");
//半成品入库按原材料入库的柜体原料码进行入库
if (productType.equals(WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_SEMI)) {
if (!baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW)) {
throw new ServiceException("请按原材料柜体条码入库");
}
} else {//其他按成品条码入库
if (!baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_PRODUCT)) {
throw new ServiceException("请按成品条码入库");
}
}
if (baseBarcodeInfo.getPrintFlag().equals(MesConstants.MES_BARCODE_PRINT_FLAG_NO)) {
@ -410,13 +427,6 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
}
wmsProductInstockMapper.insertWmsProductInstock(wmsProductInstock);
MesPdaProductPlanVo mesPdaProductPlanVo = new MesPdaProductPlanVo();
mesPdaProductPlanVo.setMaterialBarcode(materialBarcode);
R<?> tdReturnMsg = remoteMesService.complete5thFloorInstall(mesPdaProductPlanVo, SecurityConstants.INNER);
if (tdReturnMsg.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务
throw new RuntimeException(tdReturnMsg.getMsg());
}
return 1;
}

@ -10,23 +10,29 @@ 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.StringUtils;
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.WmsBaseLocation;
import com.hw.wms.domain.WmsRawStock;
import com.hw.wms.domain.vo.WmsRawBackVo;
import com.hw.wms.domain.vo.WmsRawInstockVo;
import com.hw.wms.domain.vo.*;
import com.hw.wms.mapper.WmsBaseLocationMapper;
import com.hw.wms.mapper.WmsRawStockMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hw.wms.mapper.WmsRawInstockMapper;
import com.hw.wms.domain.WmsRawInstock;
import com.hw.wms.service.IWmsRawInstockService;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
@ -47,6 +53,9 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
@Autowired
private WmsRawStockMapper wmsRawStockMapper;
@Autowired
private WmsConfig wmsConfig;
@Resource
private RemoteMesService remoteMesService;
@ -160,7 +169,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
}
}
if(!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)){
if (!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)) {
WmsRawInstock existedRawInstock = wmsRawInstockMapper.selectWmsRawInstockByBarcode(wmsRawInstockVo.getMaterialBarcode());
if (existedRawInstock != null) {
throw new ServiceException("此物料已经入库,不需重复入库");
@ -180,7 +189,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
wmsRawInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsRawInstock.setApplyBy(userName);
wmsRawInstock.setApplyDate(currentDate);
if(!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)) {
if (!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)) {
wmsRawInstock.setMaterialBarcode(wmsRawInstockVo.getMaterialBarcode());
}
wmsRawInstock.setMaterialBatchCode(baseBarcodeInfo.getBatchCode());
@ -217,7 +226,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
BigDecimal totalAmount = wmsRawStockMapper.getRawStockTotalAmount(queryRawStock);
totalAmount = totalAmount == null ? BigDecimal.ZERO : totalAmount;
BigDecimal qtyLimit = baseLocation.getQtyLimit();
if (qtyLimit!=null && totalAmount.add(wmsRawInstockVo.getInstockAmount()).compareTo(qtyLimit) > 0) {
if (qtyLimit != null && totalAmount.add(wmsRawInstockVo.getInstockAmount()).compareTo(qtyLimit) > 0) {
throw new ServiceException("已超出库位数量限制,请重新选择库位");
}
@ -226,7 +235,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(barcode);
if (wmsRawStock != null) {
// wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus());
if(!batchFlag.equals(MesConstants.IS_BATCH)){
if (!batchFlag.equals(MesConstants.IS_BATCH)) {
throw new ServiceException("此物料条码已经入库");
}
wmsRawStock.setTotalAmount(wmsRawStock.getTotalAmount().add(wmsRawInstockVo.getInstockAmount()));
@ -314,4 +323,53 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
return wmsRawInstockMapper.insertWmsRawInstock(wmsRawInstock);
}
/**
* WCS-45
*
* @param wmsRawInstockContinueVo
*/
@Override
public int continueRawInstock(WmsRawInstockContinueVo wmsRawInstockContinueVo) {
try {
String materialBarcode = wmsRawInstockContinueVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料条码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料条码有误");
}
if (StringUtils.isEmpty(baseBarcodeInfo.getProductBarcode())) {
throw new ServiceException("此物料条码信息有误");
}
String wcsAgvContinueUrl = wmsConfig.getWcsAgvContinueUrl();
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
// headers.add(HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON_VALUE);
// String params = "{\"endStationCode\":\""+stationCode+"\"}";
wmsRawInstockContinueVo.setMaterialId(baseBarcodeInfo.getMaterialId());//目前调度只用了这个字段
wmsRawInstockContinueVo.setPalletInfoCode(baseBarcodeInfo.getPalletInfoCode());
HttpEntity<WmsRawInstockContinueVo> entity = new HttpEntity<>(wmsRawInstockContinueVo, headers);
ResponseEntity<WcsReturnMsgVo> response = restTemplate.postForEntity(
wcsAgvContinueUrl, entity, WcsReturnMsgVo.class);
// WcsReturnMsgVo wcsReturnMsgVo = response.getBody();
// System.out.println("Response Status: " + response.getStatusCode());
// System.out.println("Response Status: " + wcsReturnMsgVo);
if (response.getStatusCodeValue() != 200) {
throw new ServiceException("调度异常,请重试");
}
} catch (Exception e) {
throw new ServiceException("调度连接异常,请重试[" + e.getMessage() + "]");
}
return 1;
}
}

@ -632,7 +632,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
toInsertedRawOutstock.setApplyBy(userName);
toInsertedRawOutstock.setApplyReason(wmsRawOutstockParam.getApplyReason());
toInsertedRawOutstock.setApplyDate(currentDate);
log.info("taskType:"+wmsRawOutstockParam.getTaskType()+",stationcode:"+wmsConfig.getFifthSplitStationCode());
log.info("taskType:" + wmsRawOutstockParam.getTaskType() + ",stationcode:" + wmsConfig.getFifthSplitStationCode());
if (wmsRawOutstockParam.getTaskType().equals(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_PICKING)) {
toInsertedRawOutstock.setEndStationCode(wmsRawOutstockParam.getEndStationCode());
@ -966,7 +966,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
* 3WCS
* *
*/
String materialBarcode = wmsAssembleOutstockVo.getMaterialBarcode();
String materialBarcode = wmsAssembleOutstockVo.getMaterialBarcode();//配对码
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料条码有误");
@ -976,7 +976,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
throw new ServiceException("物料条码有误");
}
if(!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)){
if (!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)) {
throw new ServiceException("请扫描配对码后进行组装出库");
}
@ -985,7 +985,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
if (StringUtils.isEmpty(bindBarcode)) {
throw new ServiceException("此柜体还未绑定");
}
//通过绑定的条码找到物料信息和saleorderid
//通过配对的条码找到物料信息和saleorderid
R<MesBaseBarcodeInfo> bindBarcodeInfoR = remoteMesService.getBarcode(bindBarcode, SecurityConstants.INNER);
if (bindBarcodeInfoR == null) {
throw new ServiceException("绑定的柜体条码有误");
@ -996,15 +996,42 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
}
String assembleMaterialBarcode,planCode,planDetailCode,palletInfoCode;
Long materialId;
if (!bindBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
//bindBarcode在这位成品码通过productbarcode找到5楼拆分区新生成的原材料条码
R<MesBaseBarcodeInfo> productBarcodeInfoR = remoteMesService.getBarcodeByProductBarcode(bindBarcode, SecurityConstants.INNER);
if (productBarcodeInfoR == null) {
throw new ServiceException("没有绑定的原材料条码");
}
MesBaseBarcodeInfo productBarcodeInfo = productBarcodeInfoR.getData();
if (productBarcodeInfo == null) {
throw new ServiceException("没有绑定的原材料条码");
}
assembleMaterialBarcode = productBarcodeInfo.getBarcodeInfo();
planCode = productBarcodeInfo.getPlanCode();
planDetailCode = productBarcodeInfo.getPlanDetailCode();
palletInfoCode = productBarcodeInfo.getPalletInfoCode();
materialId = productBarcodeInfo.getMaterialId();
}else{
assembleMaterialBarcode = bindBarcode;//组装出库的物料条码
planCode = bindBarcodeInfo.getPlanCode();
planDetailCode = bindBarcodeInfo.getPlanDetailCode();
palletInfoCode = bindBarcodeInfo.getPalletInfoCode();
materialId = bindBarcodeInfo.getMaterialId();
}
WmsRawOutstock queryRawOutstock = new WmsRawOutstock();
queryRawOutstock.setMaterialBatch(bindBarcode);
queryRawOutstock.setMaterialBatch(assembleMaterialBarcode);
List<WmsRawOutstock> wmsRawOutstocks = wmsRawOutstockMapper.selectWmsRawOutstockList(queryRawOutstock);
if (wmsRawOutstocks != null && !wmsRawOutstocks.isEmpty()) {
throw new ServiceException("已经有此物料出库记录");
}
WmsRawStock queryRawStock = new WmsRawStock();
queryRawStock.setInstockBatch(bindBarcode);
queryRawStock.setInstockBatch(assembleMaterialBarcode);
queryRawStock.setCompleteFlag(WmsConstants.WMS_RAW_STOCK_COMPLETE_FLAG_NO);
List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectWmsRawStockInList(queryRawStock);
if (wmsRawStocks == null || wmsRawStocks.isEmpty()) {
@ -1015,17 +1042,17 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
WmsRawOutstock wmsRawOutstock = new WmsRawOutstock();
wmsRawOutstock.setTaskCode(Seq.getId(Seq.rawOutstockSeqType, Seq.rawOutstockSeqCode));
wmsRawOutstock.setMaterialBatch(assembleMaterialBarcode);
wmsRawOutstock.setWarehouseId(wmsRawStock.getWarehouseId());
wmsRawOutstock.setLocationCode(wmsRawStock.getLocationCode());
wmsRawOutstock.setOrderId(baseBarcodeInfo.getSaleOrderId());
wmsRawOutstock.setPlanCode(baseBarcodeInfo.getPlanCode());
wmsRawOutstock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode());
wmsRawOutstock.setMaterialId(bindBarcodeInfo.getMaterialId());
wmsRawOutstock.setMaterialBatch(bindBarcode);
wmsRawOutstock.setPalletInfoCode(bindBarcodeInfo.getPalletInfoCode());//在绑定时需要在条码信息中记录托盘码
wmsRawOutstock.setOutstockAmount(BigDecimal.ONE);
wmsRawOutstock.setSaleOrderId(bindBarcodeInfo.getSaleOrderId());
wmsRawOutstock.setPlanCode(planCode);
wmsRawOutstock.setPlanDetailCode(planDetailCode);
wmsRawOutstock.setPalletInfoCode(palletInfoCode);//在绑定时需要在条码信息中记录托盘码
wmsRawOutstock.setMaterialId(materialId);
wmsRawOutstock.setSaleOrderId(bindBarcodeInfo.getSaleOrderId());//销售订单ID都是一样的
wmsRawOutstock.setOutstockAmount(BigDecimal.ONE);
wmsRawOutstock.setEndStationCode(wmsConfig.getFifthAssembleStationCode());//目标位置,五楼组装区域
wmsRawOutstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO);
wmsRawOutstock.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_INSTALL);
@ -1037,7 +1064,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstockMapper.insertWmsRawOutstock(wmsRawOutstock);
MesPdaProductPlanVo mesPdaProductPlanVo = new MesPdaProductPlanVo();
mesPdaProductPlanVo.setMaterialBarcode(bindBarcode);
mesPdaProductPlanVo.setMaterialBarcode(assembleMaterialBarcode);//原柜体的条码之前的原材料条码start后在plandetail保存此码
R<?> tdReturnMsg = remoteMesService.start5thFloorInstall(mesPdaProductPlanVo, SecurityConstants.INNER);
if (tdReturnMsg.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务
throw new ServiceException(tdReturnMsg.getMsg());
@ -1255,7 +1282,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
throw new ServiceException("调度异常,请重试");
}
} catch (Exception e) {
throw new ServiceException("调度异常,请重试");
throw new ServiceException("调度连接异常,请重试[" + e.getMessage() + "]");
}
return 1;

@ -284,7 +284,7 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
String targetLocationCode = wmsTransferDetail.getLocationCode();
String materialBarcode = wmsTransferDetail.getMaterialBarcode();
String materialBarcode = wmsTransferDetail.getMaterialBarcode();//成品条码(之前半成品出库的是原材料条码)
R<MesBaseBarcodeInfo> mesBaseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (mesBaseBarcodeInfoR == null) {
@ -311,8 +311,7 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
throw new ServiceException("此库位已经有库存,不能入库");
}
WmsTransfer queryTransfer = new WmsTransfer();
queryTransfer.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_NOT_FINISH);
String barcodeType = mesBaseBarcodeInfo.getBarcodeType();
//如果是非成品条码,就还可以入原来的半成品库
Long targetWarehouseId = targetLocation.getWarehouseId();
@ -336,6 +335,8 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
throw new ServiceException("请入5楼成品库");
}
WmsTransfer queryTransfer = new WmsTransfer();
queryTransfer.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_NOT_FINISH);
queryTransfer.setProductBatch(mesBaseBarcodeInfo.getProductBarcode());
/**判断有没有已出库的转库记录*/
@ -344,7 +345,6 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
throw new ServiceException("没有此成品的转库出库记录,不能转库入库");
}
WmsTransfer wmsTransfer = wmsTransfers.get(0);
wmsTransfer.setTargetWarehouseId(targetWarehouseId);
wmsTransfer.setTargetLocationCode(targetLocationCode);

@ -22,6 +22,7 @@
<result property="activeFlag" column="active_flag"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="materialSpec" column="material_spec"/>
<result property="warehouseName" column="warehouse_name"/>
</resultMap>
@ -139,7 +140,7 @@
<select id="selectWmsStockTotalJoinListBySaleOrder" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
select wst.stock_total_id, wst.warehouse_id, wst.warehouse_floor, wst.stock_type, wst.material_id,
wst.total_amount, wst.frozen_amount, wst.occupy_amount,wst.safe_flag,
mbmi.material_code,mbmi.material_name
mbmi.material_code,mbmi.material_name,mbmi.material_spec
from wms_stock_total wst left join mes_base_material_info mbmi on wst.material_id = mbmi.material_id
<where>
@ -154,6 +155,10 @@
</if>
<if test="saleOrderId != null ">and (wst.sale_order_id = #{saleOrderId} or wst.safe_flag='1')</if>
<if test="saleOrderId == null ">and wst.safe_flag='1'</if>
<if test="materialCodeNameSpec != null and materialCodeNameSpec != ''">and (mbmi.material_code like concat('%',
#{materialCodeNameSpec},'%') or mbmi.material_name like concat('%',#{materialCodeNameSpec},'%')
or mbmi.material_spec like concat('%',#{materialCodeNameSpec},'%'))
</if>
</where>
</select>

@ -336,3 +336,15 @@ export function get4thFloorRegularBarcode(query) {
params: query
})
}
/**
* WCS调度接口-通知调度继续任务在4楼到5楼接驳位时调用调度继续任务
*/
export function continueRawInstock(data) {
return request({
url: '/wms/api/continueRawInstock',
method: 'post',
data: data
})
}

@ -51,7 +51,7 @@
</template>
</el-table-column>
<el-table-column v-if="columns[17].visible" align="center" label="派工单号" prop="planCode" width="110"/>
<el-table-column v-if="columns[17].visible" align="center" label="明细编号" prop="planDetailCode" width="110"/>
<el-table-column v-if="columns[18].visible" align="center" label="明细编号" prop="planDetailCode" width="110"/>
<el-table-column v-if="columns[20].visible" align="center" label="销售订单编号" prop="saleorderCode" width="110"/>
<el-table-column v-if="columns[13].visible" align="center" label="采购订单号" prop="poNo" width="100"/>
<el-table-column v-if="columns[29].visible" align="center" label="条码类型" prop="barcodeType" width="100">
@ -80,7 +80,6 @@
<span>{{ parseTime(scope.row.lastOutstockDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column v-if="columns[18].visible" align="center" label="计划明细编号" prop="planDetailCode"/>
<el-table-column v-if="columns[19].visible" align="center" label="销售订单ID" prop="saleOrderId"/>
<el-table-column v-if="columns[21].visible" align="center" label="项目号" prop="projectNo"/>
<el-table-column v-if="columns[23].visible" align="center" label="备注" prop="remark"/>
@ -266,13 +265,6 @@ export default {
open: false,
addBtnTitle: '新增条码',
addProductBarcodeTitle: '新增成品条码',
addProductBarcodeForm: {},
addProductBarcodeRules: {
productBarcode: [
{required: true, message: "原材料条码不能为空", trigger: "blur"}
],
},
addProductBarcodeOpen: false,
internalTitle: "添加对内原材料条码信息",
@ -281,20 +273,8 @@ export default {
internalForm: {},
//
internalRules: {
poNo: [
{required: true, message: "采购订单号不能为空", trigger: "change"}
],
batchFlag: [
{required: true, message: "批次标识不能为空", trigger: "change"}
],
amount: [
{required: true, message: "批次数量不能为空", trigger: "change"}
],
barcodeType: [
{required: true, message: "条码类型不能为空", trigger: "change"}
],
materialId: [
{required: true, message: "物料ID不能为空", trigger: "blur"}
materialCode: [
{required: true, message: "物料编码不能为空", trigger: "blur"}
],
},
@ -372,8 +352,8 @@ export default {
{key: 14, label: `生产日期`, visible: true},
{key: 15, label: `接受日期`, visible: true},
{key: 16, label: `最晚出库日期`, visible: true},
{key: 17, label: `派工单号`, visible: true},
{key: 18, label: `明细编号`, visible: false},
{key: 17, label: `派工单号`, visible: false},
{key: 18, label: `明细编号`, visible: true},
{key: 19, label: `销售订单ID`, visible: false},
{key: 20, label: `销售订单编号`, visible: true},
{key: 21, label: `项目号`, visible: false},
@ -439,30 +419,42 @@ export default {
let bindBarcode = this.defineData.bindBarcode ? this.defineData.bindBarcode : '';
this.barcodeTypeParam = barcodeType;
this.queryParams.planCode = this.defineData.planCode;
this.queryParams.planDetailCode = this.defineData.planDetailCode;
if (barcodeType === this.BARCODE_TYPE_PARAM.PRODUCT_BARCODE) {//
this.queryParams.barcodeType = null;
this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.PRODUCT + "," + this.BARCODE_TYPE.BIND_BARCODE;
this.queryParams.barcodeType = this.BARCODE_TYPE.PRODUCT;
this.queryParams.bindOrFlag = "1";
// this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.PRODUCT + "," + this.BARCODE_TYPE.BIND_BARCODE;
} else if (barcodeType === this.BARCODE_TYPE_PARAM.SPLIT_BIND_BARCODE) {//
this.queryParams.barcodeType = null;
this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.RAW + "," + this.BARCODE_TYPE.BIND_BARCODE;
this.queryParams.barcodeType = this.BARCODE_TYPE.RAW ;
// this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.RAW + "," + this.BARCODE_TYPE.BIND_BARCODE;
// this.queryParams.bindOrFlag = "1";
}
this.form = {
planId: this.defineData.planId,
planCode: this.defineData.planCode,
planDetailCode: this.defineData.planDetailCode,
singleFlag:this.defineData.singleFlag,
saleOrderId:this.defineData.saleOrderId,
batchFlag: '0',
bindBarcode: bindBarcode,
barcodeType: "",
amount: 1,
}
} else if (this.defineData.singleFlag && this.defineData.singleFlag === this.SINGLE_FLAG.INTERNAL) {
this.form = {
//45plancodeplandetailcode
this.internalForm = {
planId: this.defineData.planId,
planCode: this.defineData.planCode,
planDetailCode: this.defineData.planDetailCode,
saleOrderId:this.defineData.saleOrderId,
batchFlag: '0',
barcodeType: this.BARCODE_TYPE.RAW,
amount: 1,
}
this.queryParams.planCode = this.defineData.planCode;
this.queryParams.planDetailCode = this.defineData.planDetailCode;
this.queryParams.singleFlag = this.SINGLE_FLAG.INTERNAL;
this.queryParams.barcodeType = this.BARCODE_TYPE.RAW;
}
@ -475,11 +467,11 @@ export default {
this.barcodeList = response.rows;
this.total = response.total;
if (this.total && this.total > 0) {
if(this.queryParams.singleFlag){
if (this.queryParams.singleFlag) {
this.addProductBarcodeBtnVisible = false;
this.addBindBarcodeBtnVisible = false;
this.addInternalBtnVisible = true;
}else{
this.addInternalBtnVisible = false;
} else {
this.addInternalBtnVisible = false;
this.addProductBarcodeBtnVisible = false;
this.addBindBarcodeBtnVisible = true;
@ -489,11 +481,12 @@ export default {
}
} else {
if(this.queryParams.singleFlag){
if (this.queryParams.singleFlag) {
this.addProductBarcodeBtnVisible = false;
this.addBindBarcodeBtnVisible = false;
this.addInternalBtnVisible = true;
}else{
this.handleInternalAdd();
} else {
this.addInternalBtnVisible = false;
this.addProductBarcodeBtnVisible = true;
this.addProductBarcodeOpen = true;
@ -590,55 +583,19 @@ export default {
this.title = "添加配对条码信息";
},
//
resetProductBarcode() {
this.addProductBarcodeForm = {
barcodeId: null,
productBarcode: null,
printTime: null,
printPerson: null,
batchFlag: '0',
barcodeType: '3',
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
materialId: null,
manufacturerId: null,
amount: 1,
machineName: null,
printNumber: null,
poNo: null,
productionDate: null,
acceptedDate: null,
lastOutstockDate: null,
planCode: null,
planDetailCode: null,
saleOrderId: null,
saleorderCode: null,
projectNo: null,
serialNumber: null,
remark: null,
bindStatus: null,
bindBy: null,
bindTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("addProductBarcodeForm");
},
handleAddProductBarcode() {
this.resetProductBarcode();
this.form.barcodeType = this.BARCODE_TYPE.PRODUCT;
this.reset();
if (this.defineData?.planCode) {
this.getData()
this.form.barcodeType = this.BARCODE_TYPE.PRODUCT;
}
this.addProductBarcodeOpen = true;
},
//
cancelProductBarcode() {
this.addProductBarcodeOpen = false;
this.resetProductBarcode();
this.reset();
},
/** 打印条码按钮操作 */
@ -719,6 +676,10 @@ export default {
/** 内部生产原材料条码新增按钮操作 */
handleInternalAdd() {
this.resetInternal();
if (this.defineData?.planCode) {
this.getData()
this.internalForm.barcodeType = this.BARCODE_TYPE.RAW;
}
this.internalOpen = true;
},
@ -729,10 +690,26 @@ export default {
selectProductBarcodeInfoByBarcodeInfo(this.internalForm.productBarcode).then(response => {
if (response.data == null) {
this.resetInternal();
if (this.defineData?.planCode) {
this.getData()
this.internalForm.barcodeType = this.BARCODE_TYPE.RAW;
}
this.$modal.msgError("成品信息不存在");
return;
}
if(response.data.saleOrderId !== this.internalForm.saleOrderId){
this.resetInternal();
if (this.defineData?.planCode) {
this.getData()
this.internalForm.barcodeType = this.BARCODE_TYPE.RAW;
}
this.$modal.msgError("销售订单不一致");
return;
}
this.$set(this.internalForm, "materialId", response.data.materialId);
this.$set(this.internalForm, "materialCode", response.data.materialCode);
this.$set(this.internalForm, "materialName", response.data.materialName);
@ -740,8 +717,15 @@ export default {
this.$set(this.internalForm, "productionDate", response.data.productionDate);
this.$set(this.internalForm, "saleOrderId", response.data.saleOrderId);
this.$set(this.internalForm, "saleorderCode", response.data.saleorderCode);
this.$set(this.internalForm, "safeFlag", response.data.safeFlag);
}).catch(error => {
this.resetInternal();
if (this.defineData?.planCode) {
this.getData()
this.internalForm.barcodeType = this.BARCODE_TYPE.RAW;
}
});
},

@ -61,6 +61,13 @@
@click="print()">
条码
</el-button>
<el-button size="mini" type="info" v-if="($route.query && $route.query.id) !== '2'"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="printInternalBarcode()">
对内条码
</el-button>
<!--el-button v-if="($route.query && $route.query.id) !== '2'" type="info"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="handleBindBarcode">绑定
@ -211,7 +218,7 @@
<!-- </el-button>-->
<el-popconfirm
v-if="($route.query && $route.query.id) !== '2'"
v-if="($route.query && $route.query.id) !== '2' && scope.row.planAmount - scope.row.completeAmount>0"
cancel-button-text='否'
confirm-button-text='是'
icon="el-icon-info"
@ -234,7 +241,7 @@
trigger="click">
<div>
<div style="margin: 15px 0;">
<el-input placeholder="请扫描或输入背板/门板条码" v-model="input1" class="input-with-select">
<el-input placeholder="请扫描或输入配对条码" v-model="input1" class="input-with-select">
<el-button slot="append" icon="el-icon-full-screen"></el-button>
</el-input>
</div>
@ -276,7 +283,7 @@
<div class="bottom">
<el-row>
<el-button type="primary">首页</el-button>
<el-button type="success" @click="printInternalBarcode"></el-button>
<el-button type="success" @click="continueRawInstock"></el-button>
<el-button type="danger" @click="logout">退</el-button>
</el-row>
</div>
@ -285,7 +292,7 @@
<el-dialog
:visible.sync="dialogVisible"
:title="applyMaterialTitle"
width="40%">
width="800px">
<el-form ref="form" :model="form1" label-width="100px">
<el-form-item label="派工单号">
<el-input v-model="form1.dispatchCode" disabled></el-input>
@ -311,7 +318,7 @@
:data="form1.wmsRawOutstockDetailList"
:header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
style="width: 100%"
style="width: 100%;"
>
<el-table-column
label="物料编号"
@ -323,6 +330,11 @@
prop="materialName"
>
</el-table-column>
<el-table-column
label="物料规格"
prop="materialSpec"
>
</el-table-column>
<el-table-column
label="安全库存"
prop="safeFlag"
@ -333,12 +345,12 @@
</el-table-column>
<el-table-column
label="可用库存数量"
label="可用库存"
prop="availableAmount"
>
</el-table-column>
<el-table-column
label="占用库存数量"
label="占用库存"
prop="unavailableAmount"
>
</el-table-column>
@ -363,14 +375,23 @@
>
<template slot="header" slot-scope="scope">
<el-input
v-model="searchMaterialValue"
placeholder="输入物料名称搜索"
v-model="queryParams.materialCodeNameSpec"
placeholder="编码、名称或规格搜索"
size="mini"
@change="searchMaterial"/>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 12px">
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="searchMaterial"
/>
<div style="text-align: center;margin-top: 30px">
<el-button type="primary" @click="receiveMaterial"></el-button>
</div>
</el-dialog>
@ -390,7 +411,7 @@
title="柜体绑定"
width="40%">
<el-form ref="bindBarcodeForm" :model="bindBarcodeForm" :rules="bindBarcodeRules" label-width="80px">
<el-form-item label="背板条码" prop="productBarcode">
<el-form-item label="配对条码" prop="productBarcode">
<el-input v-model="bindBarcodeForm.productBarcode"></el-input>
</el-form-item>
<el-form-item label="物料条码" prop="materialBarcode">
@ -550,6 +571,25 @@
/>
</el-dialog>
<el-dialog
:visible.sync="continueRawInstockVisible"
title="继续入库"
width="500px">
<el-form ref="continueRawInstockForm" :model="continueRawInstockForm" :rules="continueRawInstockRules" label-width="80px">
<el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="continueRawInstockForm.materialBarcode" suffix-icon="el-icon-full-screen"
style="width:380px" placeholder="请扫描或输入原材料条码"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitContinueRawInstock"> </el-button>
<el-button @click="cancelContinueRawInstock"> </el-button>
</div>
</el-dialog>
<!-- <el-dialog :visible.sync="assignModel" title="工位选择" width="80%">-->
<!-- <el-table :data="stationData" highlight-current-row-->
@ -602,7 +642,7 @@ import {
bindBarcode,
applyRawBack,
assignTask, scanMaterial2Confirm, applyRawReturn,
getNewestOutstockCabinet,updateBarcodePlan, completeCollectMaterials, completeReturnMaterials
getNewestOutstockCabinet,updateBarcodePlan, completeCollectMaterials, completeReturnMaterials,continueRawInstock
} from "@/api/board";
const setState = (e) => {
@ -711,7 +751,14 @@ export default {
},
],
warehouseList: [],
searchMaterialValue: '',
queryParams:{
pageNum: 1,
pageSize: 10,
materialCodeNameSpec:''
},
//
total: 0,
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
bindBarcodeVisible: false,
@ -746,6 +793,19 @@ export default {
{required: true, message: '请选择退库类型', trigger: 'change'}
],
},
continueRawInstockVisible: false,
continueRawInstockForm: {
materialBarcode: null
},
continueRawInstockRules: {
materialBarcode: [
{required: true, message: "物料条码不能为空", trigger: "blur"}
]
},
}
},
async mounted() {
@ -758,7 +818,14 @@ export default {
// });
// }, 60 * 1000)
getLoginStationInfo().then(e => {
// if(!e.data){
// this.$modal.msgError("");
// return;
// }
this.loginStationInfo = e.data;
//TODO
this.loginStationInfo = {stationId:"1",endStationCode:"ss"}
this.getProductPlans();
this.getChartData();
});
@ -995,7 +1062,7 @@ export default {
},
async startPlan1(val) {
if (!this.input1 || this.input1 == null || this.input1 == undefined || this.input1 == '') {
this.$modal.msgWarning("请扫描或输入背板/门板条码");
this.$modal.msgWarning("请扫描或输入配对条码");
return;
}
await this.startPlan(val, this.input1);
@ -1428,7 +1495,7 @@ export default {
this.taskType = '1';//
}
this.searchMaterialValue = ''
this.queryParams.materialCodeNameSpec = ''
this.dialogVisible = true
this.form1 = {
warehouseId: '',
@ -1453,17 +1520,16 @@ export default {
},
//
searchMaterial(val) {
if (this.form1.warehouseId == null || this.form1.warehouseId == undefined
|| this.form1.warehouseId == "") {
searchMaterial() {
if (this.form1.warehouseId === null || this.form1.warehouseId === undefined
|| this.form1.warehouseId === "") {
return;
}
getStockTotal({
warehouseId: this.form1.warehouseId,
materialName: val,
saleOrderId: this.form.saleOrderId,
}).then(e => {
this.form1.wmsRawOutstockDetailList = e.data.map(r => {
this.queryParams.warehouseId = this.form1.warehouseId;
this.queryParams.saleOrderId = this.form1.saleOrderId;
getStockTotal(this.queryParams).then(e => {
this.total = e.total;
this.form1.wmsRawOutstockDetailList = e.rows.map(r => {
return {
stockTotalId: r.stockTotalId,
materialId: r.materialId,
@ -1487,7 +1553,6 @@ export default {
receiveMaterial() {
this.form1.taskType = this.taskType;
console.log("tasktype:"+this.form1.taskType);
applyRawOutstock(this.form1).then(e => {
this.dialogVisible = false
this.$message({
@ -1518,6 +1583,7 @@ export default {
},
printInternalBarcode(){
this.PrintData = this.form;
this.PrintData.singleFlag = '2';//
this.printModel = true
},
@ -1678,6 +1744,31 @@ export default {
});
},
//
resetContinueRawInstock() {
this.continueRawInstockForm = {
materialBarcode: null
};
this.resetForm("continueRawInstockForm");
},
continueRawInstock(){
this.resetContinueRawInstock();
this.continueRawInstockVisible = true;
},
submitContinueRawInstock(){
continueRawInstock(this.continueRawInstockForm).then(v => {
this.$modal.msgSuccess("操作成功");
})
},
cancelContinueRawInstock(){
this.continueRawInstockVisible = false;
this.resetContinueRawInstock();
},
async SOP(e) {
this.fileList = []
@ -1786,6 +1877,7 @@ export default {
.el-table {
background-color: #fff0;
overflow-y: auto;
}
.whiteTable {
@ -1928,4 +2020,5 @@ export default {
/deep/ .dialog .el-dialog__body {
padding: 0 !important;
}
</style>

@ -471,7 +471,7 @@ export default {
OUTSTOCK: "2",//
},
productInstockVisible: false,
productInstockTitle:'',
productInstockTitle: '',
productInstockForm: {
materialBarcode: null
},
@ -513,6 +513,16 @@ export default {
FINISHED: '3',
ABNORMAL_FINISHED: '9'
},
SALE_TYPE: {
INTERNAL: '2',//
},
SINGLE_FLAG: {
NOT_SINGLE: "0",//
INTERNAL: '2'//
}
}
},
created() {
@ -870,6 +880,7 @@ export default {
this.planId = e.row.planId
this.materialBomId = e.row.materialBomId
this.saleOrderId = e.row.saleOrderId
this.saleType = e.row.saleType
this.nowNum2 = 1
getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.row.planId}).then(res => {
if (res.rows.length === 0) {
@ -971,6 +982,11 @@ export default {
print(val) {
this.PrintData = val
this.PrintData.barcodeType = '4';//
if (this.saleType === this.SALE_TYPE.INTERNAL) {
this.PrintData.singleFlag = this.SINGLE_FLAG.INTERNAL;
} else {
this.PrintData.singleFlag = this.SINGLE_FLAG.NOT_SINGLE;
}
this.printModel = true
},

@ -82,7 +82,7 @@
<dict-tag :options="dict.type.barcode_type" :value="scope.row.barcodeType"/>
</template>
</el-table-column>
<el-table-column v-if="columns[17].visible" align="center" label="生产计划编号" prop="planCode" width="110"/>
<el-table-column v-if="columns[17].visible" align="center" label="派工单号" prop="planCode" width="110"/>
<el-table-column v-if="columns[17].visible" align="center" label="明细编号" prop="planDetailCode" width="110"/>
<el-table-column v-if="columns[20].visible" align="center" label="销售订单编号" prop="saleorderCode" width="110"/>
<el-table-column v-if="columns[13].visible" align="center" label="采购订单号" prop="poNo" width="100"/>
@ -144,11 +144,11 @@
<!-- 添加或修改条码信息对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="生产计划编号" prop="planCode">
<el-form-item label="派工单号" prop="planCode">
<el-input v-model="form.planCode" :disabled="true">
</el-input>
</el-form-item>
<el-form-item label="计划明细编号" prop="planDetailCode">
<el-form-item label="明细编号" prop="planDetailCode">
<el-input v-model="form.planDetailCode" :disabled="true">
</el-input>
</el-form-item>
@ -298,7 +298,7 @@
<!-- 添加生产计划编号对话框 -->
<el-dialog :visible.sync="productPlanOpen" append-to-body title="选择生产计划编号">
<el-dialog :visible.sync="productPlanOpen" append-to-body title="选择派工单号">
<add-ProductPlan ref="productPlanRef" :defineData="defineData" @selection="handleSelection"></add-ProductPlan>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitProductPlanForm"> </el-button>
@ -429,8 +429,8 @@ export default {
{key: 14, label: `生产日期`, visible: true},
{key: 15, label: `接受日期`, visible: true},
{key: 16, label: `最晚出库日期`, visible: true},
{key: 17, label: `生产计划编`, visible: true},
{key: 18, label: `生产计划明细编号`, visible: false},
{key: 17, label: `派工单`, visible: true},
{key: 18, label: `生产明细编号`, visible: false},
{key: 19, label: `销售订单ID`, visible: false},
{key: 20, label: `销售订单编号`, visible: true},
{key: 21, label: `项目号`, visible: false},

@ -176,8 +176,8 @@
</el-table-column>
<el-table-column label="托盘RFID代码" align="center" prop="palletInfoCode" v-if="columns[7].visible" width="110"/>
<el-table-column label="生产计划编号" align="center" prop="planCode" v-if="columns[17].visible"/>
<el-table-column label="生产计划明细编号" align="center" prop="planDetailCode" v-if="columns[18].visible"/>
<el-table-column label="派工单号" align="center" prop="planCode" v-if="columns[17].visible"/>
<el-table-column label="生产明细编号" align="center" prop="planDetailCode" v-if="columns[18].visible"/>
<el-table-column label="销售订单ID" align="center" prop="saleOrderId" v-if="columns[19].visible"/>
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" v-if="columns[20].visible"/>
<el-table-column label="项目号" align="center" prop="projectNo" v-if="columns[21].visible"/>
@ -691,8 +691,8 @@ export default {
{key: 14, label: `生产日期`, visible: true},
{key: 15, label: `接受日期`, visible: true},
{key: 16, label: `最晚出库日期`, visible: true},
{key: 17, label: `生产计划编`, visible: false},
{key: 18, label: `生产计划明细编号`, visible: false},
{key: 17, label: `派工单`, visible: false},
{key: 18, label: `生产明细编号`, visible: false},
{key: 19, label: `销售订单ID`, visible: false},
{key: 20, label: `销售订单编号`, visible: false},
{key: 21, label: `项目号`, visible: false},

@ -95,6 +95,7 @@ import { listMaterialinfo, getMaterialinfo, delMaterialinfo, addMaterialinfo, up
export default {
name: "Materialinfo",
props: ['selectType'],
data() {
return {
//
@ -171,6 +172,7 @@ export default {
/** 查询物料信息列表 */
getList() {
this.loading = true;
this.queryParams.selectType = this.selectType;
listMaterialinfo(this.queryParams).then(response => {
this.materialinfoList = response.rows;
this.total = response.total;

@ -134,8 +134,8 @@
<el-table-column label="销售订单ID" align="center" prop="saleOrderId" v-if="columns[2].visible" width="100"/>
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" v-if="columns[3].visible" width="100"/>
<el-table-column label="项目编号" align="center" prop="projectNo" v-if="columns[5].visible"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[6].visible" width="100"/>
<el-table-column label="物料BOM" align="center" prop="materialBomDesc" v-if="columns[7].visible" width="120"/>
<el-table-column label="成品名称" align="center" prop="materialName" v-if="columns[6].visible" width="100"/>
<el-table-column label="成品BOM" align="center" prop="materialBomDesc" v-if="columns[7].visible" width="120"/>
<el-table-column label="派工类型" align="center" prop="dispatchType" v-if="columns[8].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.dispatch_type" :value="scope.row.dispatchType"/>
@ -305,13 +305,13 @@
<!-- <el-input v-model="form.materialId" placeholder="请输入物料ID" :disabled="true"/>-->
<!-- </el-form-item>-->
<el-form-item label="物料名称" prop="materialName">
<el-form-item label="成品名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请点击右侧检索物料" :disabled="materialDisabled" readonly>
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
</el-input>
</el-form-item>
<el-form-item label="物料BOM" prop="materialBomId">
<el-form-item label="成品BOM" prop="materialBomId">
<el-select v-model="form.materialBomId" placeholder="请选择物料BOM">
<el-option
v-for="item in materialBomList"
@ -321,6 +321,15 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="生产物料" prop="produceMaterialName"
v-if="form.saleType===this.MES_SALE_TYPE.MES_SALE_TYPE_INTERNAL">
<el-input v-model="form.produceMaterialName" placeholder="请点击右侧检索物料" :disabled="true">
<el-button slot="append" icon="el-icon-search" @click="handleProduceMaterialAdd"></el-button>
</el-input>
</el-form-item>
<el-form-item label="工艺路线" prop="dispatchId">
<el-select v-model="form.dispatchId" filterable placeholder="请选择工艺路线" clearable>
<el-option
@ -393,12 +402,12 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-form-item label="成品名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请点击右侧检索物料" readonly>
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
</el-input>
</el-form-item>
<el-form-item label="物料BOM" prop="materialBomId">
<el-form-item label="成品BOM" prop="materialBomId">
<el-select v-model="form.materialBomId" placeholder="请选择物料BOM">
<el-option
v-for="item in materialBomList"
@ -472,7 +481,7 @@
<!-- 添加物料信息对话框 -->
<el-dialog title="选择物料信息" :visible.sync="materialOpen" append-to-body>
<add-bom @selection="handleSelection" ref="materialRef"></add-bom>
<add-bom @selection="handleSelection" ref="materialRef" :select-type="selectType"></add-bom>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitMaterialForm"> </el-button>
<el-button @click="materialOpen = false"> </el-button>
@ -544,6 +553,8 @@ export default {
noOrderOpen: false,
//
materialOpen: false,
//input
selectType: "",
//
productOrderOpen: false,
//
@ -593,10 +604,10 @@ export default {
{required: true, message: "销售订单编号不能为空", trigger: "blur"}
],
materialName: [
{required: true, message: "物料名称不能为空", trigger: "blur"}
{required: true, message: "请选择成品", trigger: "blur"}
],
materialBomId: [
{required: true, message: "物料BOM不能为空", trigger: "blur"}
{required: true, message: "成品BOM不能为空", trigger: "blur"}
],
dispatchType: [
{required: true, message: "派工类型不能为空", trigger: "change"}
@ -613,6 +624,10 @@ export default {
planEndTime: [
{required: true, message: "计划结束时间不能为空", trigger: "blur"}
],
produceMaterialName: [
{required: true, message: "请选择生产物料",}
],
saleAmount: [
{required: true, message: "销售数量不能为空", trigger: "blur"},
{
@ -672,6 +687,11 @@ export default {
MES_SALE_TYPE_INTERNAL: '2',//
},
MATERIAL_TYPE: {
RAW: "1",
PRODUCT: "3"
},
MES_ORDER_STATUS: {
UNPUBLISH: '0',//
PUBLISHED: '1',//
@ -777,17 +797,25 @@ export default {
/** 提交物料信息按钮 */
submitMaterialForm() {
let selectedRow = this.$refs.materialRef.selectedRow;
this.form.materialId = selectedRow.materialId;
this.form.materialName = selectedRow.materialName;
getMaterialVisionList(this.form.materialId).then(response => {
this.materialBomList = response.data
if (this.materialBomList.length !== 0) {
this.form.materialBomId = this.materialBomList[0].materialBomId
} else {
this.form.materialBomId = null;
this.$modal.msgError("该物料未维护BOM信息");
}
})
alert("--"+this.selectType)
if (this.selectType === this.MATERIAL_TYPE.RAW) {
this.form.produceMaterialId = selectedRow.materialId;
this.$set(this.form, 'produceMaterialName', selectedRow.materialName)
// this.form.produceMaterialName = selectedRow.materialName;//
} else {
this.form.materialId = selectedRow.materialId;
this.form.materialName = selectedRow.materialName;
getMaterialVisionList(this.form.materialId).then(response => {
this.materialBomList = response.data
if (this.materialBomList.length !== 0) {
this.form.materialBomId = this.materialBomList[0].materialBomId
} else {
this.form.materialBomId = null;
this.$modal.msgError("该物料未维护BOM信息");
}
})
}
this.materialOpen = false;
},
@ -795,7 +823,7 @@ export default {
submitSaleOrderForm() {
let selectedRow = this.$refs.saleOrderRef.selectedRow;
this.form.saleOrderId = selectedRow.saleOrderId;
this.form.saleorderCode = selectedRow.saleorderCode;
this.$set(this.form, 'saleorderCode', selectedRow.saleorderCode)
this.form.saleorderLinenumber = selectedRow.saleorderLinenumber;
this.form.saleAmount = selectedRow.orderAmount;
this.form.planBeginTime = selectedRow.beginDate == null ? null : selectedRow.beginDate + " 00:00:00";
@ -809,7 +837,8 @@ export default {
this.form.materialId = selectedRow.materialId;
this.form.materialCode = selectedRow.materialCode;
this.form.materialName = selectedRow.materialName;
this.$set(this.form, 'materialName', selectedRow.materialName)
this.getMaterialVisionList();
@ -873,9 +902,16 @@ export default {
handleMaterialAdd() {
if (!this.materialDisabled) {
this.materialOpen = true;
this.selectType = this.MATERIAL_TYPE.PRODUCT;//
}
},
/** 新增按钮操作 */
handleProduceMaterialAdd() {
this.materialOpen = true;
this.selectType = this.MATERIAL_TYPE.RAW;//
},
/** 新增按钮操作 */
handleProductOrderAdd() {
this.productOrderOpen = true;
@ -894,7 +930,6 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
console.log(row)
if (row.orderStatus !== '0') {
return this.$modal.msgError("该订单状态无法修改!");
}
@ -976,6 +1011,7 @@ export default {
},
/** 销售订单新增提交按钮 */
submitForm() {
console.log(this.form)
this.$refs["form"].validate(valid => {
if (valid) {
//

@ -335,13 +335,12 @@
</template>
<script>
import {getProductOrder, updateProductOrder} from "@//api/mes/productOrder";
import {getProductOrder} from "@//api/mes/productOrder";
import {
deleteProductPlansByDispatchCode,
getDispatchCode, getDispatchDrawingList, getDispatchSOPAttachList,
selectProductPlans,
orderAddMesProductPlanList,
updateProductplan,
getBaseRouteProcesses,
getProcessUsers,
uploadFile
@ -487,6 +486,9 @@ export default {
FINISHED: '3' //
},
SALE_TYPE:{
INTERNAL:'2',//
},
id: 1,
processUsers: []
@ -867,13 +869,17 @@ export default {
// obj.dispatchAmount = this.form.planAmount - this.form.dispatchAmount;
obj.dispatchFlag = null;
obj.materialId = this.form.materialId;
if(this.form.saleType === this.SALE_TYPE.INTERNAL){
obj.materialId = this.form.produceMaterialId;
}else{
obj.materialId = this.form.materialId;
}
obj.materialBomId = this.form.materialBomId;
obj.productOrderId = this.form.productOrderId;
obj.saleOrderId = this.form.saleOrderId;
obj.saleorderCode = this.form.saleorderCode;
obj.newFlag = "1";//
// e.mesBaseProcessUserList.forEach((mesBaseProcessUser, index) => {

Loading…
Cancel
Save