From 0cf799c88336080dcedcce616324426dd94e085d Mon Sep 17 00:00:00 2001 From: xs Date: Tue, 6 Aug 2024 14:12:44 +0800 Subject: [PATCH] =?UTF-8?q?2.8.5=20=E8=BD=A6=E9=97=B4MES:=20-=E5=9B=9B?= =?UTF-8?q?=E6=A5=BC=E8=A3=85=E9=85=8D=E5=B7=A5=E5=BA=8F=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=88=90=E5=93=81=E6=9D=A1=E7=A0=81=E5=92=8C=E9=85=8D=E5=AF=B9?= =?UTF-8?q?=E7=A0=81=E4=BF=AE=E6=94=B9=E5=AE=8C=E5=96=84=20-=E4=BA=94?= =?UTF-8?q?=E6=A5=BC=E6=8B=86=E5=88=86=E5=B7=A5=E5=BA=8F=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=8E=9F=E6=9D=90=E6=96=99=E6=9D=A1=E7=A0=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=8C=E5=96=84=20-=E4=BA=94=E6=A5=BC=E8=A3=85=E9=85=8D?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E6=89=AB=E7=A0=81=E5=BC=80=E5=A7=8B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AE=8C=E5=96=84=20-=E4=BA=94=E6=A5=BC=E8=A3=85?= =?UTF-8?q?=E9=85=8D=E9=A1=B5=E9=9D=A2=E7=94=B3=E8=AF=B7=E9=A2=86=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=AE=8C=E5=96=84=20-=E9=87=8D=E6=96=B0=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=9D=A1=E7=A0=81=E5=AE=8C=E5=96=84=20MES=EF=BC=9A=20?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=B4=BE=E5=B7=A5=EF=BC=9A=E5=AF=B9=E5=86=85?= =?UTF-8?q?=E6=B4=BE=E5=B7=A5=E6=97=B6=E9=9C=80=E8=A6=81=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=89=A9=E6=96=99=20PDA:=20-=E4=BA=94?= =?UTF-8?q?=E6=A5=BCPDA=E7=BB=84=E8=A3=85=E5=87=BA=E5=BA=93=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hw/mes/api/RemoteMesService.java | 15 +- .../hw/mes/api/domain/MesBaseBarcodeInfo.java | 10 +- .../mes/api/domain/MesBaseMaterialInfo.java | 10 ++ .../api/factory/RemoteMesFallbackFactory.java | 5 + .../hw/common/core/constant/WmsConstants.java | 4 +- .../com/hw/common/log/enums/BusinessType.java | 5 + .../hw/mes/controller/MesApiController.java | 2 + .../MesBaseBarcodeInfoController.java | 14 ++ .../com/hw/mes/domain/MesProductOrder.java | 72 ++++++++- .../com/hw/mes/domain/MesProductPlan.java | 10 ++ .../mes/mapper/MesBaseBarcodeInfoMapper.java | 2 +- .../service/IMesBaseBarcodeInfoService.java | 12 +- .../impl/MesBaseBarcodeInfoServiceImpl.java | 118 ++++++++++++--- .../impl/MesProductOrderServiceImpl.java | 24 ++- .../impl/MesProductPlanDetailServiceImpl.java | 90 +++++++---- .../impl/MesProductPlanServiceImpl.java | 1 + .../mapper/mes/MesBaseBarcodeInfoMapper.xml | 10 ++ .../mapper/mes/MesBaseMaterialInfoMapper.xml | 1 + .../mapper/mes/MesProductOrderMapper.xml | 14 ++ .../mapper/mes/MesProductPlanDetailMapper.xml | 3 +- .../mapper/mes/MesProductPlanMapper.xml | 4 +- .../java/com/hw/wms/config/WmsConfig.java | 12 ++ .../hw/wms/controller/WmsApiController.java | 16 +- .../java/com/hw/wms/domain/WmsStockTotal.java | 30 ++++ .../domain/vo/WmsRawInstockContinueVo.java | 20 +++ .../hw/wms/service/IWmsRawInstockService.java | 8 + .../impl/WmsProductInstockServiceImpl.java | 36 +++-- .../impl/WmsRawInstockServiceImpl.java | 70 ++++++++- .../impl/WmsRawOutstockServiceImpl.java | 59 ++++++-- .../service/impl/WmsTransferServiceImpl.java | 8 +- .../mapper/wms/WmsStockTotalMapper.xml | 7 +- hw-ui/src/api/board/index.js | 12 ++ .../views/board/barcode/workshopBarcode.vue | 140 ++++++++--------- hw-ui/src/views/board/fifthFloor/index.vue | 143 +++++++++++++++--- .../src/views/board/fourthFloor/assemble.vue | 18 ++- .../src/views/mes/barcode/endProductIndex.vue | 12 +- hw-ui/src/views/mes/barcode/index.vue | 8 +- hw-ui/src/views/mes/materialBom/addBom.vue | 2 + hw-ui/src/views/mes/productOrder/index.vue | 82 +++++++--- .../views/mes/productplan/editProductPlan.vue | 14 +- 40 files changed, 864 insertions(+), 259 deletions(-) create mode 100644 hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsRawInstockContinueVo.java diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java index 0e4c769c..eb137526 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java @@ -52,9 +52,9 @@ public interface RemoteMesService { /** - * 通过绑定条码查询条码信息 + * 通过配对条码查询条码信息 * - * @param bindBarcode 绑定条码信息 + * @param bindBarcode 配对条码信息 * @param source 请求来源 * @return 结果 */ @@ -62,6 +62,17 @@ public interface RemoteMesService { public R getBarcodeByBindBarcode(@PathVariable("bindBarcode") String bindBarcode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + /** + * 根据绑定的原材料条码信息获取原材料哦条码信息,或者根据绑定的成品条码信息获取原材料条码信息 + * + * @param productBarcode 绑定条码信息 + * @param source 请求来源 + * @return 结果 + */ + @GetMapping("/barcode/getBarcodeByProductBarcode/{productBarcode}") + public R getBarcodeByProductBarcode(@PathVariable("productBarcode") String productBarcode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + + /** * 查询工位信息列表 * diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java index 37a22b55..f4bcfe72 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java @@ -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 diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseMaterialInfo.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseMaterialInfo.java index ef7f5f8b..2dea4b7a 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseMaterialInfo.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseMaterialInfo.java @@ -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) diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java index feb889f2..837de7ea 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java @@ -45,6 +45,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory getBarcodeByBindBarcode(String bindBarcode, String source) { + return R.fail("获取配对条码信息失败:" + throwable.getMessage()); + } + + @Override + public R getBarcodeByProductBarcode(String productBarcode, String source) { return R.fail("获取绑定条码信息失败:" + throwable.getMessage()); } diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java index fc585a58..b97b071d 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java @@ -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";//成品 /*出入库退库记录明细方式*/ diff --git a/hw-common/hw-common-log/src/main/java/com/hw/common/log/enums/BusinessType.java b/hw-common/hw-common-log/src/main/java/com/hw/common/log/enums/BusinessType.java index c3192ee5..a952eefb 100644 --- a/hw-common/hw-common-log/src/main/java/com/hw/common/log/enums/BusinessType.java +++ b/hw-common/hw-common-log/src/main/java/com/hw/common/log/enums/BusinessType.java @@ -138,4 +138,9 @@ public enum BusinessType * 重新生成 */ REGENERATE, + + /** + * 继续 + */ + CONTINUE, } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java index 760f9c1c..b5fbf5aa 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java @@ -320,4 +320,6 @@ public class MesApiController extends BaseController { public AjaxResult check4thFloorProduceOutstock(@PathVariable String materialBarcode) { return success(mesBaseBarcodeInfoService.check4thFloorProduceOutstock(materialBarcode)); } + + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java index f9be0fba..8f06c23c 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java @@ -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)); + } + + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java index ea1bff9c..d1e19731 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java @@ -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) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java index 7e742bf0..3e4dad91 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java @@ -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) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseBarcodeInfoMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseBarcodeInfoMapper.java index 20f6a3d3..8049aa5f 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseBarcodeInfoMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseBarcodeInfoMapper.java @@ -75,7 +75,7 @@ public interface MesBaseBarcodeInfoMapper /** * 查询条码信息,limit 1 * - * @param bindBarcode 绑定条码信息 + * @param bindBarcode 配对条码信息 * @return 条码信息 */ public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByBindBarcode(String bindBarcode); diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java index f4fce57c..05496d5c 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java @@ -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 在5楼成品入库时贴成品条码,此码作为之前的原材料码;在4楼的成品到5楼时需要生成原材料条码时,此字段作为之前的成品条码 + * @return 条码信息 + */ + public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByProductBarcode(String productBarcode); + /** * 验证成品条码信息(是否是对内生产的) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java index d4f12503..5759a55a 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java @@ -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 在5楼成品入库时贴成品条码,此码作为之前的原材料码;在4楼的成品到5楼时需要生成原材料条码时,此字段作为之前的成品条码 + * @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 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 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 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); diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java index 383b772e..fc653f6c 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java @@ -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 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 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); } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java index 69ffb05a..f5d45540 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java @@ -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 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 mesBaseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBaseBarcodeInfo); - List bindBaseBarcodeInfos = mesBaseBarcodeInfos.stream().filter(mesBaseBarcodeInfo -> - StringUtils.isNotEmpty(mesBaseBarcodeInfo.getBindBarcode())).collect(Collectors.toList()); + queryBaseBarcodeInfo.setBindBarcode(bindBarcode); + List 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 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 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); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java index 0e822ee0..3a252d50 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java @@ -670,6 +670,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService { } + // public String executeAssignTaskResultTask() { // ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); // boolean running = true; diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml index f17ac8d3..dbc77d3d 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml @@ -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 @@ and bbi.update_by = #{updateBy} and bbi.update_time = #{updateTime} and bbi.barcode_type in (${barcodeTypeStr}) + + + or exists + (select 1 from mes_base_barcode_info mbbi where mbbi.plan_detail_code =#{planDetailCode} + and bbi.bind_barcode=mbbi.barcode_info) + + + order by bbi.barcode_id desc diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml index 0f2e7b7e..38c47df0 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml @@ -111,6 +111,7 @@ and bmi.deleted_flag = #{deletedFlag} and bmi.approve_date = #{approveDate} and bmi.erp_modify_date = #{erpModifyDate} + 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) diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml index 1201c7ea..3e36de09 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml @@ -14,6 +14,7 @@ + @@ -37,7 +38,11 @@ + + + + @@ -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 @@ -143,6 +154,7 @@ sale_type, material_id, material_bom_id, + produce_material_id, dispatch_type, dispatch_id, sale_amount, @@ -174,6 +186,7 @@ #{saleType}, #{materialId}, #{materialBomId}, + #{produceMaterialId}, #{dispatchType}, #{dispatchId}, #{saleAmount}, @@ -209,6 +222,7 @@ sale_type = #{saleType}, material_id = #{materialId}, material_bom_id = #{materialBomId}, + produce_material_id = #{produceMaterialId}, dispatch_type = #{dispatchType}, dispatch_id = #{dispatchId}, sale_amount = #{saleAmount}, diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml index 1c36139f..c5e8f739 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml @@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 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 @@ -154,6 +155,10 @@ and (wst.sale_order_id = #{saleOrderId} or wst.safe_flag='1') and wst.safe_flag='1' + and (mbmi.material_code like concat('%', + #{materialCodeNameSpec},'%') or mbmi.material_name like concat('%',#{materialCodeNameSpec},'%') + or mbmi.material_spec like concat('%',#{materialCodeNameSpec},'%')) + diff --git a/hw-ui/src/api/board/index.js b/hw-ui/src/api/board/index.js index 3a0dd5be..bffe2c4e 100644 --- a/hw-ui/src/api/board/index.js +++ b/hw-ui/src/api/board/index.js @@ -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 + }) +} diff --git a/hw-ui/src/views/board/barcode/workshopBarcode.vue b/hw-ui/src/views/board/barcode/workshopBarcode.vue index b1b4d408..c804b1ff 100644 --- a/hw-ui/src/views/board/barcode/workshopBarcode.vue +++ b/hw-ui/src/views/board/barcode/workshopBarcode.vue @@ -51,7 +51,7 @@ - + @@ -80,7 +80,6 @@ {{ parseTime(scope.row.lastOutstockDate, '{y}-{m}-{d} {h}:{i}:{s}') }} - @@ -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 = { + //4楼到5楼的原材料条码也要更换成新的plancode和plandetailcode + 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; + } }); }, diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index 01de205c..1d78ca85 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -61,6 +61,13 @@ @click="print()"> 条码 + + + 对内条码 + +
- +
@@ -276,7 +283,7 @@
首页 - 原材料条码 + 继续调度入库 退出
@@ -285,7 +292,7 @@ + width="800px"> @@ -311,7 +318,7 @@ :data="form1.wmsRawOutstockDetailList" :header-cell-style="{textAlign:'center'}" max-height="19.13vw" - style="width: 100%" + style="width: 100%;" > + + @@ -363,14 +375,23 @@ > -
+ + + +
申请领料
@@ -390,7 +411,7 @@ title="柜体绑定" width="40%"> - + @@ -550,6 +571,25 @@ /> + + + + + + + + + + + + @@ -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; } + diff --git a/hw-ui/src/views/board/fourthFloor/assemble.vue b/hw-ui/src/views/board/fourthFloor/assemble.vue index 5f582ed1..44cfcb63 100644 --- a/hw-ui/src/views/board/fourthFloor/assemble.vue +++ b/hw-ui/src/views/board/fourthFloor/assemble.vue @@ -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 }, diff --git a/hw-ui/src/views/mes/barcode/endProductIndex.vue b/hw-ui/src/views/mes/barcode/endProductIndex.vue index aeb3eefd..1139dfcb 100644 --- a/hw-ui/src/views/mes/barcode/endProductIndex.vue +++ b/hw-ui/src/views/mes/barcode/endProductIndex.vue @@ -82,7 +82,7 @@ - + @@ -144,11 +144,11 @@ - + - + @@ -298,7 +298,7 @@ - +