|
|
@@ -1,5 +1,6 @@
|
|
|
package com.sckw.slope.detection.service;
|
|
|
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
@@ -7,20 +8,22 @@ import com.github.pagehelper.PageInfo;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.model.constant.NumberConstant;
|
|
|
import com.sckw.core.model.enums.DeviceEnum;
|
|
|
+import com.sckw.core.model.enums.DictEnum;
|
|
|
import com.sckw.core.model.page.PageRes;
|
|
|
import com.sckw.core.utils.StringUtils;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
import com.sckw.slope.detection.dao.mysql.KwsDeviceModelMapper;
|
|
|
-import com.sckw.slope.detection.model.dos.mysql.KwsDevice;
|
|
|
-import com.sckw.slope.detection.model.dos.mysql.KwsDeviceModel;
|
|
|
-import com.sckw.slope.detection.model.dos.mysql.KwsProjectArea;
|
|
|
-import com.sckw.slope.detection.model.dos.mysql.KwsProjectDevice;
|
|
|
+import com.sckw.slope.detection.dao.mysql.KwsDeviceModelPartMapper;
|
|
|
+import com.sckw.slope.detection.dao.mysql.KwsIntegrationMapper;
|
|
|
+import com.sckw.slope.detection.model.dos.mysql.*;
|
|
|
import com.sckw.slope.detection.model.dto.HeaderData;
|
|
|
import com.sckw.slope.detection.model.param.DeviceModelAdd;
|
|
|
import com.sckw.slope.detection.model.param.DeviceModelQuery;
|
|
|
import com.sckw.slope.detection.model.vo.DeviceModelVo;
|
|
|
-import com.sckw.slope.detection.model.vo.DeviceVo;
|
|
|
-import com.sckw.slope.detection.model.vo.ProjectVo;
|
|
|
+import com.sckw.slope.detection.model.dos.mysql.KwsDeviceModelPart;
|
|
|
+import com.sckw.slope.detection.model.dto.SystemDict;
|
|
|
+import com.sckw.slope.detection.model.vo.DevicePartModelVo;
|
|
|
+import com.sckw.slope.detection.model.vo.IntegrationItemVO;
|
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.http.HttpResponse;
|
|
|
@@ -31,8 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @author sky
|
|
|
@@ -49,6 +51,12 @@ public class DeviceModelService {
|
|
|
@Autowired
|
|
|
KwsDeviceModelMapper kwsDeviceModelMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ KwsDeviceModelPartMapper kwsDeviceModelPartMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ KwsIntegrationMapper kwsIntegrationMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 项目管理分页查询
|
|
|
*
|
|
|
@@ -100,7 +108,41 @@ public class DeviceModelService {
|
|
|
DeviceModelVo vo = new DeviceModelVo();
|
|
|
BeanUtils.copyProperties(device, vo);
|
|
|
vo.setStatusText(DeviceEnum.getName(vo.getStatus()));
|
|
|
-
|
|
|
+ //获取要数
|
|
|
+ List<DevicePartModelVo> deviceModelPart= kwsDeviceModelPartMapper.selectByModelId(vo.getId());
|
|
|
+ //获取字典
|
|
|
+ Map<String, SystemDict> dictList = commonService.getDictList(null, new HashMap<String, String>() {{
|
|
|
+ put("code", DictEnum.MODEL_PART.getCodeType());
|
|
|
+ put("type", "1");
|
|
|
+ }});
|
|
|
+ //获取集成要素-start
|
|
|
+ List<String> partData = new ArrayList<>();
|
|
|
+ List<String> intList = new ArrayList<>();
|
|
|
+ //Map<String,IntegrationItemVO> map = new HashMap<>();
|
|
|
+ List<IntegrationItemVO> dataList = new ArrayList<>();
|
|
|
+ for (DevicePartModelVo part : deviceModelPart) {
|
|
|
+ for(SystemDict value : dictList.values()){
|
|
|
+ if(part.getPartName().equals(value.getValue())){
|
|
|
+ partData.add(value.getLabel());
|
|
|
+ //查询对应的集成要素
|
|
|
+ List<IntegrationItemVO> integrationItemVO = kwsIntegrationMapper.getDataByFindInSet(value.getValue());
|
|
|
+ for (IntegrationItemVO intvo : integrationItemVO) {
|
|
|
+ if(!intList.contains(intvo.getId())){//判断是否存在
|
|
|
+ intList.add(intvo.getId());
|
|
|
+ dataList.add(intvo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //获取集成要素-end
|
|
|
+ List<SystemDict> systemDict = new ArrayList<>();
|
|
|
+ for(SystemDict value : dictList.values()){
|
|
|
+ systemDict.add((value));
|
|
|
+ }
|
|
|
+ vo.setPart(partData);
|
|
|
+ vo.setIntegration(dataList);
|
|
|
+ vo.setSystemDict(systemDict);
|
|
|
return HttpResult.ok(vo);
|
|
|
}
|
|
|
|