From 76da01f1ee99d31869cd0bbd7ceea16c97826068 Mon Sep 17 00:00:00 2001 From: xs Date: Tue, 29 Oct 2024 15:32:41 +0800 Subject: [PATCH] =?UTF-8?q?3.3.6=20MES=20=E7=89=A9=E6=96=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AFbug=E4=BF=AE=E5=A4=8D=20=E9=87=87=E8=B4=AD=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=BB=91=E5=AE=9A=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=B8=B8=E5=A4=87=E7=89=A9=E6=96=99=E7=9A=84?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MesBaseMaterialInfoController.java | 16 ++++++++++ .../impl/MesBaseBarcodeInfoServiceImpl.java | 32 +++++++++---------- .../impl/MesPurchaseOrderServiceImpl.java | 16 +++++----- .../mapper/mes/MesBaseMaterialInfoMapper.xml | 1 + hw-ui/src/api/mes/materialinfo.js | 10 ++++++ hw-ui/src/views/mes/materialinfo/index.vue | 26 ++++++++++----- hw-ui/src/views/mes/purchaseOrder/index.vue | 2 +- 7 files changed, 70 insertions(+), 33 deletions(-) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseMaterialInfoController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseMaterialInfoController.java index d61b226..3c3d09f 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseMaterialInfoController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseMaterialInfoController.java @@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletResponse; import com.hw.common.security.annotation.InnerAuth; import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo; +import com.hw.mes.domain.MesBaseMaterialType; +import com.hw.mes.service.IMesBaseMaterialTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -37,6 +39,9 @@ public class MesBaseMaterialInfoController extends BaseController { @Autowired private IMesBaseMaterialInfoService mesBaseMaterialInfoService; + @Autowired + private IMesBaseMaterialTypeService mesBaseMaterialTypeService; + /** * 查询物料信息列表 @@ -157,4 +162,15 @@ public class MesBaseMaterialInfoController extends BaseController return getDataTable(list); } + /** + * 查询物料信息列表 + */ + @RequiresPermissions("mes:materialinfo:list") + @GetMapping("/getMaterialTypes") + public AjaxResult getMaterialTypes(MesBaseMaterialType mesBaseMaterialType) + { + List list = mesBaseMaterialTypeService.selectMesBaseMaterialTypeList(mesBaseMaterialType); + return success(list); + } + } 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 56e65ab..cc1a365 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 @@ -170,10 +170,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService if (mesBaseMaterialInfo == null) { throw new ServiceException("物料信息不存在"); } - if (mesBaseMaterialInfo.getAlwaysFlag() == null) { - throw new ServiceException("请先设置此物料信息[物料编码:" + mesBaseBarcodeInfo.getMaterialCode() - + ",物料名称:" + mesBaseBarcodeInfo.getMaterialName() + "]的常备物料标识"); - } +// if (mesBaseMaterialInfo.getAlwaysFlag() == null) { +// throw new ServiceException("请先设置此物料信息[物料编码:" + mesBaseBarcodeInfo.getMaterialCode() +// + ",物料名称:" + mesBaseBarcodeInfo.getMaterialName() + "]的常备物料标识"); +// } //判断选择的采购订单信息,是否已经合并过 MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate(); @@ -184,11 +184,11 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService } - //如果物料信息为非常备物料,则判断是否有绑定的信息 + //不管物料是否常备物料,都判断是否有绑定的信息 BigDecimal barcodeAmount = mesBaseBarcodeInfo.getBarcodeAmount();//要生成的条码数量 String poNo = StringUtils.isEmpty(mesBaseBarcodeInfo.getPoNo()) ? "0" : mesBaseBarcodeInfo.getPoNo(); String batchCode = this.getRawBatchCode(poNo); - if (!mesBaseMaterialInfo.getAlwaysFlag().equals(MesConstants.MES_MATERIAL_ALWAYS_FLAG_YES)) { +// if (!mesBaseMaterialInfo.getAlwaysFlag().equals(MesConstants.MES_MATERIAL_ALWAYS_FLAG_YES)) { Long orderBindId = mesBaseBarcodeInfo.getOrderBindId(); if (orderBindId == null) { throw new ServiceException("请选择绑定销售订单信息的采购订单"); @@ -221,16 +221,16 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService mesOrderBindMapper.updateMesOrderBind(mesOrderBind); - } else { - MesBaseBarcodeInfo toInsertedBarcodeInfo; - for (long i = 0; i < barcodeAmount.intValue(); i++) { - // 生成条码数量的不同条码内容 - toInsertedBarcodeInfo = getInsertedBarcodeInfo(mesBaseBarcodeInfo, Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode), batchCode, userName, currentDate); - toInsertedBarcodeInfo.setSaleOrderId(0L); - toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES); - mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo); - } - } +// } else { +// MesBaseBarcodeInfo toInsertedBarcodeInfo; +// for (long i = 0; i < barcodeAmount.intValue(); i++) { +// // 生成条码数量的不同条码内容 +// toInsertedBarcodeInfo = getInsertedBarcodeInfo(mesBaseBarcodeInfo, Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode), batchCode, userName, currentDate); +// toInsertedBarcodeInfo.setSaleOrderId(0L); +// toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES); +// mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo); +// } +// } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java index cd484a8..be0fc27 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java @@ -153,14 +153,14 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService { if (mesBaseMaterialInfo == null) { throw new ServiceException("物料信息不存在"); } - String alwaysFlag = mesBaseMaterialInfo.getAlwaysFlag(); - if (alwaysFlag == null) { - throw new ServiceException("请先设置物料信息是否为常备物料"); - } - - if (alwaysFlag.equals(MesConstants.MES_MATERIAL_ALWAYS_FLAG_YES)) { - throw new ServiceException("此物料为常备物料,不需要绑定"); - } +// String alwaysFlag = mesBaseMaterialInfo.getAlwaysFlag(); +// if (alwaysFlag == null) { +// throw new ServiceException("请先设置物料信息是否为常备物料"); +// } +// +// if (alwaysFlag.equals(MesConstants.MES_MATERIAL_ALWAYS_FLAG_YES)) { +// throw new ServiceException("此物料为常备物料,不需要绑定"); +// } Long purchaseOrderId = mesPurchaseOrder.getPurchaseOrderId(); 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 2e897d1..8b5bded 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 @@ -130,6 +130,7 @@ and bmi.auto_outstock_flag = #{autoOutstockFlag} and bmi.accessories_flag = #{accessoriesFlag} and bmi.low_value_consumable_flag = #{lowValueConsumableFlag} + and bmi.always_flag = #{alwaysFlag} 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-ui/src/api/mes/materialinfo.js b/hw-ui/src/api/mes/materialinfo.js index 9750d55..bf0b333 100644 --- a/hw-ui/src/api/mes/materialinfo.js +++ b/hw-ui/src/api/mes/materialinfo.js @@ -42,3 +42,13 @@ export function delMaterialinfo(materialId) { method: 'delete' }) } + + +// 查询物料类型列表 +export function getMaterialTypes(query) { + return request({ + url: '/mes/materialinfo/getMaterialTypes', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/views/mes/materialinfo/index.vue b/hw-ui/src/views/mes/materialinfo/index.vue index 35a17b6..6305c71 100644 --- a/hw-ui/src/views/mes/materialinfo/index.vue +++ b/hw-ui/src/views/mes/materialinfo/index.vue @@ -47,14 +47,18 @@ /> - - + + + + + + 修改 @@ -410,7 +415,8 @@ import { getMaterialinfo, delMaterialinfo, addMaterialinfo, - updateMaterialinfo + updateMaterialinfo, + getMaterialTypes } from "@/api/mes/materialinfo"; import {listBaseMaterialType} from "@//api/mes/baseMaterialType"; import Treeselect from "@riophae/vue-treeselect"; @@ -493,6 +499,10 @@ export default { // ], }, currentStatus: '', + MATERIAL_CLASSFICATION:{ + ERP:'1', + VIRTUAL:'2' + } }; }, created() { diff --git a/hw-ui/src/views/mes/purchaseOrder/index.vue b/hw-ui/src/views/mes/purchaseOrder/index.vue index 300bbbb..8484da7 100644 --- a/hw-ui/src/views/mes/purchaseOrder/index.vue +++ b/hw-ui/src/views/mes/purchaseOrder/index.vue @@ -134,7 +134,7 @@ icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['mes:purchaseOrder:bind']" - v-if="scope.row.alwaysFlag === ALWAYS_FLAG.NO && (scope.row.orderStatus === ORDER_STATUS.TO_PURCHASE || scope.row.orderStatus === ORDER_STATUS.PURCHASEING)" + v-if="scope.row.orderStatus === ORDER_STATUS.TO_PURCHASE || scope.row.orderStatus === ORDER_STATUS.PURCHASEING" >绑定