获取子件接口

liweidong
liweidong-hj 2 weeks ago
parent 4856902ddf
commit 349b6ff5bf
  1. 2
      blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  2. 3
      blade-service/blade-desk/src/main/java/org/springblade/desk/dashboard/controller/DsPartController.java
  3. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/dashboard/mapper/DsProcessMapper.java
  4. 9
      blade-service/blade-desk/src/main/java/org/springblade/desk/dashboard/mapper/ProcessMapper.xml
  5. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/dashboard/service/IDsPartService.java
  6. 7
      blade-service/blade-desk/src/main/java/org/springblade/desk/dashboard/service/IDsProcessService.java
  7. 103
      blade-service/blade-desk/src/main/java/org/springblade/desk/dashboard/service/impl/DsPartServiceImpl.java
  8. 5
      blade-service/blade-desk/src/main/java/org/springblade/desk/dashboard/service/impl/DsProcessServiceImpl.java

@ -15,7 +15,7 @@ public interface LauncherConstant {
// String NACOS_NAMESPACE = "feaf627f-a847-463b-8b73-24a0538f526e";
// 生产环境
String NACOS_NAMESPACE = "db3f4da1-ae19-4104-8c17-6d9b8f069401";
// 测试环境
// 测试环境
// String NACOS_NAMESPACE = "6cdd0310-0d61-4f54-891a-7fb06224d9b8";
/**

@ -267,9 +267,10 @@ public class DsPartController extends BladeController {
*/
@GetMapping("/test")
public R test(@RequestParam String partCode,
@RequestParam String roamNo,
@RequestParam String partVersion) {
return R.data(dsPartService.getPartSubList(partCode,partVersion));
return R.data(dsPartService.getClassCakeWork(partCode,roamNo,partVersion));
}

@ -75,4 +75,6 @@ public interface DsProcessMapper extends BaseMapper<DsProcessEntity> {
List<DsProcessEntity> selectDsProcessByIds(@Param("processIds")List<Long> processIds);
List<DsProcessEntity> selectOldMesProcessByOldMesCraftId(@Param("oldMesCraftId") Long oldMesCraftId);
List<DsProcessEntity> selectDsProcessByCraftIdList(@Param("craftIds") List<Long> craftIds);
}

@ -52,5 +52,14 @@
resultType="org.springblade.desk.dashboard.pojo.entity.DsProcessEntity">
select * from P_RB_SYNC_PROCESS where CRAFT_ID = #{oldMesCraftId}
</select>
<select id="selectDsProcessByCraftIdList"
resultType="org.springblade.desk.dashboard.pojo.entity.DsProcessEntity">
select * from DS_PROCESS where is_deleted = 0
AND CRAFT_ID IN
<foreach collection="craftIds" item="craftId" open="(" close=")" separator=",">
#{craftId}
</foreach>
</select>
</mapper>

@ -286,5 +286,5 @@ public interface IDsPartService extends BaseService<DsPartEntity> {
* @param partVersion
* @return
*/
List<DsPartEntity> getClassCake(String partCode,String roamNo,String partVersion);
List<DsProcessMoldToolEntity> getClassCakeWork(String partCode,String roamNo,String partVersion);
}

@ -97,4 +97,11 @@ public interface IDsProcessService extends BaseService<DsProcessEntity> {
* @return
*/
List<DsProcessEntity> selectOldMesProcessByOldMesCraftId(Long oldMesCraftId);
/**
* 根据工艺ID集合查询
* @param craftIds
* @return
*/
List<DsProcessEntity> selectDsProcessByCraftIdList(List<Long> craftIds);
}

@ -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;
}

@ -165,4 +165,9 @@ public class DsProcessServiceImpl extends BaseServiceImpl<DsProcessMapper, DsPro
return processMapper.selectOldMesProcessByOldMesCraftId(oldMesCraftId);
}
@Override
public List<DsProcessEntity> selectDsProcessByCraftIdList(List<Long> craftIds) {
return processMapper.selectDsProcessByCraftIdList(craftIds);
}
}

Loading…
Cancel
Save