|
@@ -83,6 +83,36 @@ public class ZEngineeringGYServiceImpl implements IZEngineeringGYService {
|
|
|
zEngineeringIndustryVo.setNodeReViewStateList(nodeService.ReViewGYList(list)!=null?nodeService.ReViewGYList(list).get(zEngineeringIndustryVo.getId()):Collections.EMPTY_LIST);
|
|
|
return zEngineeringIndustryVo;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 查询工业工程 根据三个条件 定位ID 获取详情
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ZEngineeringGYVo getInfoforApp(String name, String enginType, String enginClassification) {
|
|
|
+ ZEngineeringIndustryGYBo bo = new ZEngineeringIndustryGYBo();
|
|
|
+ bo.setEnginName(name);
|
|
|
+ bo.setEnginType(enginType);
|
|
|
+ bo.setEnginClassification(enginClassification);
|
|
|
+ LambdaQueryWrapper<ZEngineeringGY> lqw = buildQueryWrapper(bo);
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getEnginName()), ZEngineeringGY::getEnginName, bo.getEnginName());
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getEnginType()), ZEngineeringGY::getEnginType, bo.getEnginType());
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getEnginClassification()), ZEngineeringGY::getEnginClassification, bo.getEnginClassification());
|
|
|
+ List<ZEngineeringGYVo> onlyOneList = baseMapper.selectVoList(lqw);
|
|
|
+ String id = onlyOneList.get(0).getId(); // 此处可能会有异常 或者 查询多条结果集 若有则增加查询条件 保证唯一
|
|
|
+ ZEngineeringGYVo zEngineeringIndustryVo = baseMapper.selectVoById(id);
|
|
|
+ ZEngiineeringPhotoBo zEngiineeringPhotoBo = new ZEngiineeringPhotoBo();
|
|
|
+ zEngiineeringPhotoBo.setParentId(zEngineeringIndustryVo.getId());
|
|
|
+ zEngiineeringPhotoBo.setCreateTime(zEngineeringIndustryVo.getCreateTime());
|
|
|
+ zEngineeringIndustryVo.setPics(photoService.queryList(zEngiineeringPhotoBo));
|
|
|
+ ZEngineeringNodeBo zEngineeringNodeBo = new ZEngineeringNodeBo();
|
|
|
+ zEngineeringNodeBo.setCivliId(id);
|
|
|
+ zEngineeringNodeBo.setCreateTime(zEngineeringIndustryVo.getCreateTime());
|
|
|
+ List<ZEngineeringNodeBo> zEngineeringNodeBos = izEngineeringNodeService.queryListDetails(zEngineeringNodeBo);
|
|
|
+ zEngineeringIndustryVo.setZEngineeringNodeBoList(zEngineeringNodeBos);
|
|
|
+ ArrayList<ZEngineeringGYVo> list = new ArrayList<>();
|
|
|
+ list.add(zEngineeringIndustryVo);
|
|
|
+ zEngineeringIndustryVo.setNodeReViewStateList(nodeService.ReViewGYList(list)!=null?nodeService.ReViewGYList(list).get(zEngineeringIndustryVo.getId()):Collections.EMPTY_LIST);
|
|
|
+ return queryById(id);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 查询工业工程列表
|
|
@@ -418,6 +448,56 @@ public class ZEngineeringGYServiceImpl implements IZEngineeringGYService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<?> queryByTypeforApp(ZEngineeringIndustryGYBo bo) {
|
|
|
+ LambdaQueryWrapper<ZEngineeringGY> zEngineeringIndustryBoLambdaQueryWrapper = buildListByType(bo);
|
|
|
+ List<ZEngineeringGY> zEngineeringIndustryVos = baseMapper.selectList(zEngineeringIndustryBoLambdaQueryWrapper);
|
|
|
+ List<Map<String, Object>> result = zEngineeringIndustryVos.stream()
|
|
|
+ .map(vo -> {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+// map.put("id", vo.getId());
|
|
|
+ map.put("name", vo.getEnginName());
|
|
|
+ map.put("enginType", vo.getEnginType()); // 小微商服
|
|
|
+// map.put("enginClassification", vo.getEnginClassification()); // 室内管线 室外管线 调压柜 室内管线
|
|
|
+ return map;
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ for (Map map : result) {
|
|
|
+ boolean isExist = false;
|
|
|
+ for (Map gyVo : list) {
|
|
|
+ if(map.get("name").equals(gyVo.get("name")) && map.get("name").equals(gyVo.get("name"))){
|
|
|
+ isExist = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isExist){
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * APP 三期新接口 先选工程名称,再选工程步骤
|
|
|
+ * @param bo
|
|
|
+ * @return ID、名称、类型
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<?> queryGYforApp(ZEngineeringIndustryGYBo bo) {
|
|
|
+ LambdaQueryWrapper<ZEngineeringGY> zEngineeringIndustryBoLambdaQueryWrapper = buildListByType(bo);
|
|
|
+ List<ZEngineeringGY> zEngineeringIndustryVos = baseMapper.selectList(zEngineeringIndustryBoLambdaQueryWrapper);
|
|
|
+ List<Map<String, Object>> result = zEngineeringIndustryVos.stream()
|
|
|
+ .map(vo -> {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("id", vo.getId());
|
|
|
+ map.put("name", vo.getEnginName());
|
|
|
+ return map;
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
private LambdaQueryWrapper<ZEngineeringGY> buildListByType(ZEngineeringIndustryGYBo bo) {
|
|
|
LambdaQueryWrapper<ZEngineeringGY> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.orderByDesc(ZEngineeringGY::getCreateTime);
|