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 73c1b17..50d293e 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 @@ -1,7 +1,11 @@ package com.hw.mes.service.impl; +import java.math.BigDecimal; import java.util.List; + +import com.hw.common.core.constant.MesConstants; import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hw.mes.mapper.MesBaseMaterialInfoMapper; @@ -15,8 +19,7 @@ import com.hw.mes.service.IMesBaseMaterialInfoService; * @date 2023-12-21 */ @Service -public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoService -{ +public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoService { @Autowired private MesBaseMaterialInfoMapper mesBaseMaterialInfoMapper; @@ -27,8 +30,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi * @return 物料信息 */ @Override - public MesBaseMaterialInfo selectMesBaseMaterialInfoByMaterialId(Long materialId) - { + public MesBaseMaterialInfo selectMesBaseMaterialInfoByMaterialId(Long materialId) { return mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialId(materialId); } @@ -39,8 +41,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi * @return 物料信息 */ @Override - public List selectMesBaseMaterialInfoList(MesBaseMaterialInfo mesBaseMaterialInfo) - { + public List selectMesBaseMaterialInfoList(MesBaseMaterialInfo mesBaseMaterialInfo) { return mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoList(mesBaseMaterialInfo); } @@ -51,8 +52,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi * @return 结果 */ @Override - public int insertMesBaseMaterialInfo(MesBaseMaterialInfo mesBaseMaterialInfo) - { + public int insertMesBaseMaterialInfo(MesBaseMaterialInfo mesBaseMaterialInfo) { mesBaseMaterialInfo.setCreateTime(DateUtils.getNowDate()); return mesBaseMaterialInfoMapper.insertMesBaseMaterialInfo(mesBaseMaterialInfo); } @@ -64,9 +64,12 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi * @return 结果 */ @Override - public int updateMesBaseMaterialInfo(MesBaseMaterialInfo mesBaseMaterialInfo) - { + public int updateMesBaseMaterialInfo(MesBaseMaterialInfo mesBaseMaterialInfo) { mesBaseMaterialInfo.setUpdateTime(DateUtils.getNowDate()); + mesBaseMaterialInfo.setUpdateBy(SecurityUtils.getUsername()); + if (!mesBaseMaterialInfo.getBatchFlag().equals(MesConstants.IS_BATCH)) { + mesBaseMaterialInfo.setBatchAmount(BigDecimal.ONE); + } return mesBaseMaterialInfoMapper.updateMesBaseMaterialInfo(mesBaseMaterialInfo); } @@ -77,8 +80,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi * @return 结果 */ @Override - public int deleteMesBaseMaterialInfoByMaterialIds(Long[] materialIds) - { + public int deleteMesBaseMaterialInfoByMaterialIds(Long[] materialIds) { return mesBaseMaterialInfoMapper.deleteMesBaseMaterialInfoByMaterialIds(materialIds); } @@ -89,14 +91,11 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi * @return 结果 */ @Override - public int deleteMesBaseMaterialInfoByMaterialId(Long materialId) - { + public int deleteMesBaseMaterialInfoByMaterialId(Long materialId) { return mesBaseMaterialInfoMapper.deleteMesBaseMaterialInfoByMaterialId(materialId); } - - /** * 查询物料信息列表 * @@ -104,8 +103,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi * @return 物料信息 */ @Override - public List selectMesBaseMaterialInfoListByMaterialIds(Long[] materialIds) - { + public List selectMesBaseMaterialInfoListByMaterialIds(Long[] materialIds) { return mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoListByMaterialIds(materialIds); } @@ -117,16 +115,11 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi * @return 物料信息 */ @Override - public List selectMaterialInfos4AllocationWarehouse(MesBaseMaterialInfo mesBaseMaterialInfo) - { + public List selectMaterialInfos4AllocationWarehouse(MesBaseMaterialInfo mesBaseMaterialInfo) { return mesBaseMaterialInfoMapper.selectMaterialInfos4AllocationWarehouse(mesBaseMaterialInfo); } - - - - /** * 查询物料信息 * @@ -134,8 +127,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi * @return 物料信息 */ @Override - public MesBaseMaterialInfo selectMesBaseMaterialInfoByErpId(Long erpId) - { + public MesBaseMaterialInfo selectMesBaseMaterialInfoByErpId(Long erpId) { return mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByErpId(erpId); } } diff --git a/hw-ui/src/views/mes/materialinfo/index.vue b/hw-ui/src/views/mes/materialinfo/index.vue index 8003213..e0d00bd 100644 --- a/hw-ui/src/views/mes/materialinfo/index.vue +++ b/hw-ui/src/views/mes/materialinfo/index.vue @@ -111,15 +111,18 @@ + + + - + - -