diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java index 50d293e..31b6059 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java @@ -4,8 +4,13 @@ import java.math.BigDecimal; import java.util.List; import com.hw.common.core.constant.MesConstants; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; +import com.hw.mes.api.domain.MesBaseBarcodeInfo; +import com.hw.mes.domain.MesOrderBind; +import com.hw.mes.mapper.MesBaseBarcodeInfoMapper; +import com.hw.mes.mapper.MesOrderBindMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hw.mes.mapper.MesBaseMaterialInfoMapper; @@ -23,6 +28,12 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi @Autowired private MesBaseMaterialInfoMapper mesBaseMaterialInfoMapper; + @Autowired + private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper; + + @Autowired + private MesOrderBindMapper mesOrderBindMapper; + /** * 查询物料信息 * @@ -65,6 +76,21 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi */ @Override public int updateMesBaseMaterialInfo(MesBaseMaterialInfo mesBaseMaterialInfo) { +// MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo(); +// queryBaseBarcodeInfo.setMaterialId(mesBaseMaterialInfo.getMaterialId()); +// int barcodeInfoCount = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoCount(queryBaseBarcodeInfo); +// if (barcodeInfoCount > 0) { +// throw new ServiceException("此物料已经有条码信息,不能修改"); +// } +// +// MesOrderBind queryOrderBind = new MesOrderBind(); +// queryOrderBind.setMaterialId(mesBaseMaterialInfo.getMaterialId()); +// List orderBinds = mesOrderBindMapper.selectMesOrderBindList(queryOrderBind); +// if (orderBinds != null && orderBinds.size() > 0) { +// throw new ServiceException("此物料已经有采购订单和销售订单绑定信息,不能修改"); +// } + + mesBaseMaterialInfo.setUpdateTime(DateUtils.getNowDate()); mesBaseMaterialInfo.setUpdateBy(SecurityUtils.getUsername()); if (!mesBaseMaterialInfo.getBatchFlag().equals(MesConstants.IS_BATCH)) { diff --git a/hw-ui/src/views/mes/materialinfo/index.vue b/hw-ui/src/views/mes/materialinfo/index.vue index e0d00bd..26b516f 100644 --- a/hw-ui/src/views/mes/materialinfo/index.vue +++ b/hw-ui/src/views/mes/materialinfo/index.vue @@ -184,7 +184,7 @@ placeholder="请选择物料类型"/> - + - + - +