|
|
@ -384,6 +384,28 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
String msg = String.valueOf(resultMap.get("resultMsg")); |
|
|
String msg = String.valueOf(resultMap.get("resultMsg")); |
|
|
throw new XJException(msg, Integer.parseInt(code)); |
|
|
throw new XJException(msg, Integer.parseInt(code)); |
|
|
} |
|
|
} |
|
|
|
|
|
// 根据单位校验密度 |
|
|
|
|
|
UmInformationEntity um = umInformationMapper.selectOne(new QueryWrapper<UmInformationEntity>().eq("um_id", data.getUmId())); |
|
|
|
|
|
if (data.getDensity() != null && !("Weight".equals(um.getUmType()) || "Volume".equals(um.getUmType()))) { |
|
|
|
|
|
throw new RuntimeException("单位类型为 Weight 或者 Volume 时才可设置密度!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询是否已存在 master part,没有就创建 |
|
|
|
|
|
MasterPartInformationEntity masterPart = masterPartInformationMapper.selectOne(new QueryWrapper<MasterPartInformationEntity>().eq("part_no", data.getPartNo())); |
|
|
|
|
|
if (masterPart == null) { |
|
|
|
|
|
// 创建 masterPart |
|
|
|
|
|
MasterPartInformationEntity masterPartEntity = new MasterPartInformationEntity(); |
|
|
|
|
|
masterPartEntity.setPartNo(data.getPartNo()); |
|
|
|
|
|
masterPartEntity.setPartDesc(data.getPartDesc()); |
|
|
|
|
|
masterPartEntity.setUmId(data.getUmId()); |
|
|
|
|
|
masterPartEntity.setOfficialFlag("N"); |
|
|
|
|
|
masterPartEntity.setCodeNo(data.getCodeNo()); |
|
|
|
|
|
masterPartEntity.setLotTrackingCode("Not Lot Tracking"); |
|
|
|
|
|
masterPartEntity.setLotQuantityRule("One Lot Per Production Order"); |
|
|
|
|
|
masterPartEntity.setSubLotRule("No Sub Lots Allowed"); |
|
|
|
|
|
masterPartEntity.setComponentLotRule("Many Lots Allowed"); |
|
|
|
|
|
masterPartInformationMapper.insert(masterPartEntity); |
|
|
|
|
|
} |
|
|
partInformationMapper.insert(data); |
|
|
partInformationMapper.insert(data); |
|
|
// 创建物料的默认revision |
|
|
// 创建物料的默认revision |
|
|
PartRevisionEntity partRevision = new PartRevisionEntity(); |
|
|
PartRevisionEntity partRevision = new PartRevisionEntity(); |
|
|
|