|
|
@ -1,6 +1,8 @@
|
|
|
|
package com.hw.mes.service.impl;
|
|
|
|
package com.hw.mes.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.hw.common.core.exception.ServiceException;
|
|
|
|
import com.hw.common.core.utils.DateUtils;
|
|
|
|
import com.hw.common.core.utils.DateUtils;
|
|
|
|
import com.hw.common.core.utils.StringUtils;
|
|
|
|
import com.hw.common.core.utils.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@ -56,6 +58,12 @@ public class MesBaseMaterialTypeServiceImpl implements IMesBaseMaterialTypeServi
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int insertMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType)
|
|
|
|
public int insertMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
MesBaseMaterialType materialType = new MesBaseMaterialType();
|
|
|
|
|
|
|
|
materialType.setTypeCode(mesBaseMaterialType.getTypeCode());
|
|
|
|
|
|
|
|
List<MesBaseMaterialType> mesBaseMaterialTypes = mesBaseMaterialTypeMapper.selectMesBaseMaterialTypeList(materialType);
|
|
|
|
|
|
|
|
if (!mesBaseMaterialTypes.isEmpty() ) {
|
|
|
|
|
|
|
|
throw new ServiceException("该物料类型编号已存在");
|
|
|
|
|
|
|
|
}
|
|
|
|
mesBaseMaterialType.setCreateTime(DateUtils.getNowDate());
|
|
|
|
mesBaseMaterialType.setCreateTime(DateUtils.getNowDate());
|
|
|
|
MesBaseMaterialType info = mesBaseMaterialTypeMapper.selectMesBaseMaterialTypeByMatrialTypeId(mesBaseMaterialType.getParentId());
|
|
|
|
MesBaseMaterialType info = mesBaseMaterialTypeMapper.selectMesBaseMaterialTypeByMatrialTypeId(mesBaseMaterialType.getParentId());
|
|
|
|
if (StringUtils.isNull(info)){
|
|
|
|
if (StringUtils.isNull(info)){
|
|
|
@ -75,6 +83,13 @@ public class MesBaseMaterialTypeServiceImpl implements IMesBaseMaterialTypeServi
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int updateMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType)
|
|
|
|
public int updateMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
MesBaseMaterialType materialType = new MesBaseMaterialType();
|
|
|
|
|
|
|
|
materialType.setTypeCode(mesBaseMaterialType.getTypeCode());
|
|
|
|
|
|
|
|
List<MesBaseMaterialType> mesBaseMaterialTypes = mesBaseMaterialTypeMapper.selectMesBaseMaterialTypeList(materialType);
|
|
|
|
|
|
|
|
if (!mesBaseMaterialTypes.isEmpty() && !mesBaseMaterialTypes.get(0).getMatrialTypeId().equals(mesBaseMaterialType.getMatrialTypeId())) {
|
|
|
|
|
|
|
|
throw new ServiceException("该物料类型编号已存在");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mesBaseMaterialType.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
mesBaseMaterialType.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
MesBaseMaterialType info = mesBaseMaterialTypeMapper.selectMesBaseMaterialTypeByMatrialTypeId(mesBaseMaterialType.getParentId());
|
|
|
|
MesBaseMaterialType info = mesBaseMaterialTypeMapper.selectMesBaseMaterialTypeByMatrialTypeId(mesBaseMaterialType.getParentId());
|
|
|
|
if (StringUtils.isNull(info)){
|
|
|
|
if (StringUtils.isNull(info)){
|
|
|
|