|
|
|
|
@ -100,6 +100,9 @@ public class DsPartServiceImpl extends BaseServiceImpl<DsPartMapper, DsPartEntit |
|
|
|
|
@Autowired |
|
|
|
|
IMesNotifyMessageService mesNotifyMessageService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
IDsProcessMoldToolService processMoldToolService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DsPartVO> selectDsPartPage(IPage<DsPartVO> page, DsPartVO dsPart) { |
|
|
|
|
|
|
|
|
|
@ -432,29 +435,31 @@ public class DsPartServiceImpl extends BaseServiceImpl<DsPartMapper, DsPartEntit |
|
|
|
|
//查询子件信息
|
|
|
|
|
if (TaskingConstant.IS_SINTERING.equals(partEntity.getIsSintering())) { |
|
|
|
|
List<DsPartRelationEntity> partRelationEntityList = partRelationService.selectDsPartRelationByPartId(partEntity.getId()); |
|
|
|
|
List<Long> idList = partRelationEntityList.stream() |
|
|
|
|
.map(DsPartRelationEntity::getChildPartId) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
if(!CollectionUtils.isEmpty(partRelationEntityList)){ |
|
|
|
|
List<Long> idList = partRelationEntityList.stream() |
|
|
|
|
.map(DsPartRelationEntity::getChildPartId) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
List<DsPartEntity> dsPartEntityList = dsPartMapper.selectDsPartByIds(idList); |
|
|
|
|
List<DsPartEntity> dsPartEntityList = dsPartMapper.selectDsPartByIds(idList); |
|
|
|
|
|
|
|
|
|
List<DsPartVO> dsPartVOList = dsPartEntityList.stream() |
|
|
|
|
.map(entity -> { |
|
|
|
|
DsPartVO vo = new DsPartVO(); |
|
|
|
|
BeanUtils.copyProperties(entity, vo); |
|
|
|
|
List<DsPartVO> dsPartVOList = dsPartEntityList.stream() |
|
|
|
|
.map(entity -> { |
|
|
|
|
DsPartVO vo = new DsPartVO(); |
|
|
|
|
BeanUtils.copyProperties(entity, vo); |
|
|
|
|
|
|
|
|
|
if (vo.getUpdateUser() != null) { |
|
|
|
|
String userName = userClient.userInfo(Func.toLong(vo.getUpdateUser())) |
|
|
|
|
.getData() |
|
|
|
|
.getUser() |
|
|
|
|
.getName(); |
|
|
|
|
vo.setUpdateUserStr(userName); |
|
|
|
|
} |
|
|
|
|
return vo; |
|
|
|
|
}) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
if (vo.getUpdateUser() != null) { |
|
|
|
|
String userName = userClient.userInfo(Func.toLong(vo.getUpdateUser())) |
|
|
|
|
.getData() |
|
|
|
|
.getUser() |
|
|
|
|
.getName(); |
|
|
|
|
vo.setUpdateUserStr(userName); |
|
|
|
|
} |
|
|
|
|
return vo; |
|
|
|
|
}) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
dsPartSynthesisVO.setDsPartVOList(dsPartVOList); |
|
|
|
|
dsPartSynthesisVO.setDsPartVOList(dsPartVOList); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
dsPartSynthesisVO.setDsPartEntity(partEntity); |
|
|
|
|
@ -718,12 +723,12 @@ public class DsPartServiceImpl extends BaseServiceImpl<DsPartMapper, DsPartEntit |
|
|
|
|
public List<DsPartEntity> getPartSubList(String partCode, String partVersion) { |
|
|
|
|
//校验零件号
|
|
|
|
|
if(StringUtils.isEmpty(partCode)){ |
|
|
|
|
throw new ServiceException("零件号不能为空"); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
//查询零件是否存在
|
|
|
|
|
List<DsPartEntity> dsPartEntityList = this.selectDsPartByPatCode(partCode); |
|
|
|
|
if(CollectionUtils.isEmpty(dsPartEntityList)){ |
|
|
|
|
throw new ServiceException("零件不存在"); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询零件
|
|
|
|
|
@ -742,7 +747,61 @@ public class DsPartServiceImpl extends BaseServiceImpl<DsPartMapper, DsPartEntit |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<DsPartEntity> getClassCake(String partCode, String roamNo, String partVersion) { |
|
|
|
|
public List<DsProcessMoldToolEntity> getClassCakeWork(String partCode, String roamNo, String partVersion) { |
|
|
|
|
|
|
|
|
|
//校验零件号
|
|
|
|
|
if(StringUtils.isEmpty(partCode)){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询零件是否存在
|
|
|
|
|
List<DsPartEntity> dsPartEntityList = this.selectDsPartByPatCode(partCode); |
|
|
|
|
if(CollectionUtils.isEmpty(dsPartEntityList)){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询零件
|
|
|
|
|
DsPartEntity partEntity = this.selectDsPartByPatCodeAndVersion(partCode, partVersion); |
|
|
|
|
|
|
|
|
|
//不是玻璃饼
|
|
|
|
|
if(null == partEntity.getSinTerType()){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//校验是否是玻璃饼
|
|
|
|
|
if (DsPartSub.SIN_TER_TYPE_BLB.intValue() == partEntity.getSinTerType()) { |
|
|
|
|
List<DsCraftEntity> dsCraftEntityList = null; |
|
|
|
|
if(!StringUtils.isEmpty(roamNo)){ |
|
|
|
|
dsCraftEntityList = craftService.selectDsCraftByPartIdAndRoamNo(partEntity.getId(), roamNo); |
|
|
|
|
}else { |
|
|
|
|
dsCraftEntityList = craftService.listByPartId(partEntity.getId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(CollectionUtils.isEmpty(dsCraftEntityList)){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
List<Long> craftIds = dsCraftEntityList.stream() |
|
|
|
|
.map(DsCraftEntity::getId) |
|
|
|
|
.filter(Objects::nonNull) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
//查询工序
|
|
|
|
|
List<DsProcessEntity> processList = processService.selectDsProcessByCraftIdList(craftIds); |
|
|
|
|
if(CollectionUtils.isEmpty(processList)){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Long> processIds = processList.stream() |
|
|
|
|
.map(DsProcessEntity::getId) |
|
|
|
|
.filter(Objects::nonNull) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
//查询工装
|
|
|
|
|
List<DsProcessMoldToolEntity> processMoldToolEntityList = processMoldToolService.selectDsProcessMoldToolByProcessIds(processIds); |
|
|
|
|
|
|
|
|
|
return processMoldToolEntityList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|