|
@@ -11,6 +11,7 @@ import com.ruoyi.common.helper.LoginHelper;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.redis.RedisUtils;
|
|
|
import com.ruoyi.framework.handler.MonthTableNameHandler;
|
|
|
+import com.ruoyi.system.service.ISysDictTypeService;
|
|
|
import com.ruoyi.zdsz.domain.ZEngiineeringPhoto;
|
|
|
import com.ruoyi.zdsz.domain.ZEngineeringGY;
|
|
|
import com.ruoyi.zdsz.domain.ZEngineeringIndustry;
|
|
@@ -64,6 +65,9 @@ public class ZEngineeringGYServiceImpl implements IZEngineeringGYService {
|
|
|
@Resource
|
|
|
private IZEngiineeringPhotoService photoService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private final ISysDictTypeService dictTypeService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查询工业工程
|
|
@@ -461,6 +465,18 @@ public class ZEngineeringGYServiceImpl implements IZEngineeringGYService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public Boolean testEnginNameUnique(ZEngineeringIndustryGYBo bo) {
|
|
|
+ List<?> list = queryByTypeforApp(new ZEngineeringIndustryGYBo());
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ Map map = (Map)list.get(i);
|
|
|
+ if(map.get("name").equals(bo.getEnginName())){
|
|
|
+ return false; // 当前工程名称已存在 不可用
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true; // 当前工程名称可用
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<?> queryByTypeforApp(ZEngineeringIndustryGYBo bo) {
|
|
|
LambdaQueryWrapper<ZEngineeringGY> zEngineeringIndustryBoLambdaQueryWrapper = buildListByType(bo);
|
|
|
List<ZEngineeringGY> zEngineeringIndustryVos = baseMapper.selectList(zEngineeringIndustryBoLambdaQueryWrapper);
|
|
@@ -470,7 +486,9 @@ public class ZEngineeringGYServiceImpl implements IZEngineeringGYService {
|
|
|
// map.put("id", vo.getId());
|
|
|
map.put("name", vo.getEnginName());
|
|
|
map.put("enginType", vo.getEnginType()); // 小微商服
|
|
|
-// map.put("enginClassification", vo.getEnginClassification()); // 室内管线 室外管线 调压柜 室内管线
|
|
|
+ List enginClassification = new ArrayList();
|
|
|
+ enginClassification.add(vo.getEnginClassification());
|
|
|
+ map.put("enginClassification", enginClassification); // 室内管线 室外管线 调压柜 室内管线
|
|
|
return map;
|
|
|
})
|
|
|
.collect(Collectors.toList());
|
|
@@ -478,16 +496,93 @@ public class ZEngineeringGYServiceImpl implements IZEngineeringGYService {
|
|
|
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"))){
|
|
|
+ if(map.get("name").equals(gyVo.get("name")) && map.get("enginType").equals(gyVo.get("enginType"))){
|
|
|
isExist = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(!isExist){
|
|
|
list.add(map);
|
|
|
+ }else { // 生成新字典项数组 而不是直接查询字典项
|
|
|
+ for (Map<String, Object> gyVo:list) {
|
|
|
+ if(map.get("name").equals(gyVo.get("name")) && map.get("enginType").equals(gyVo.get("enginType"))){
|
|
|
+ ((List)gyVo.get("enginClassification")).add(((List)map.get("enginClassification")).get(0)); // .getEnginClassification()
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- return list;
|
|
|
+ /**
|
|
|
+ * App 弘瑞要再封装一层返回去 加个key
|
|
|
+ */
|
|
|
+ List hongRuiList = new ArrayList();
|
|
|
+ String dictType = "engin_classification";
|
|
|
+ List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
|
|
+ for(int k = 0; k < list.size(); k++){
|
|
|
+ Map map = list.get(k);
|
|
|
+ Map hongRuiMap = new HashMap<>();
|
|
|
+ hongRuiMap.put("name", map.get("name"));
|
|
|
+ hongRuiMap.put("enginType", map.get("enginType"));
|
|
|
+ List hongRuiEnginClassificationList = new ArrayList();
|
|
|
+ List<String> enginClassifications = (List)map.get("enginClassification");
|
|
|
+ for(int j = 0; j < enginClassifications.size(); j++){
|
|
|
+ for(int i = 0; i < data.size(); i++){
|
|
|
+ SysDictData dictData = data.get(i);
|
|
|
+ if(dictData.getDictLabel().equals(enginClassifications.get(j))){
|
|
|
+ String enginClassification = dictData.getDictLabel();
|
|
|
+ String dictChild;
|
|
|
+ switch (enginClassification){
|
|
|
+ case "调压柜":{
|
|
|
+ dictChild = "gy_tyg";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "室内管线":{
|
|
|
+ dictChild = "gy_inner";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "庭院":{
|
|
|
+ dictChild = "gy_out";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "架空管线":{
|
|
|
+ dictChild = "gy_jkgx";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:{
|
|
|
+ dictChild = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+// dictData.setDictType(dictChild);
|
|
|
+ Map dictMap = new HashMap();
|
|
|
+ dictMap.put("dictLabel", dictData.getDictLabel());
|
|
|
+ dictMap.put("dictValue", dictData.getDictValue());
|
|
|
+ dictMap.put("dictType", dictChild);
|
|
|
+// hongRuiEnginClassificationList.add(dictData);
|
|
|
+ hongRuiEnginClassificationList.add(dictMap);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ hongRuiMap.put("enginClassification", hongRuiEnginClassificationList);
|
|
|
+ hongRuiList.add(hongRuiMap);
|
|
|
+ }
|
|
|
+
|
|
|
+// String dictType = "engin_classification";
|
|
|
+// List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
|
|
+// for(int k = 0; k < list.size(); k++){
|
|
|
+// Map map = list.get(k);
|
|
|
+// for(int j = 0; j < data.size(); j++){
|
|
|
+// SysDictData dictData = data.get(j);
|
|
|
+// List<String> enginClassifications = (List)map.get("enginClassification");
|
|
|
+// for(int i = 0; i < enginClassifications.size(); i++){
|
|
|
+// if(dictData.getDictLabel().equals(enginClassifications.get(i))){
|
|
|
+// list.get(k).put("enginClassification", dictData);
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return list;
|
|
|
+ return hongRuiList;
|
|
|
}
|
|
|
|
|
|
/**
|