组态bug修改
This commit is contained in:
@@ -48,8 +48,16 @@ public interface DataParam {
|
||||
|
||||
String portableDev = "便携式设备";
|
||||
|
||||
String PORTABLE_SYSTEM = "便携式系统";
|
||||
|
||||
String WIRELESS_PROJECT = "无线项目";
|
||||
|
||||
String WIRELESS_PROJECT_ID = "WIRELESS_PROJECT_ID";
|
||||
|
||||
String governmentDev = "治理设备";
|
||||
|
||||
String GOVERNANCE_SYSTEM = "治理系统";
|
||||
|
||||
String EvtParamPhase = "Evt_Param_Phase";
|
||||
|
||||
String EvtParamDepth = "Evt_Param_VVaDepth";
|
||||
|
||||
@@ -67,6 +67,15 @@ public class CsLedgerController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getztProjectTree")
|
||||
@ApiOperation("三层设备树(项目层根节点为治理系统和便携式系统组态)")
|
||||
public HttpResult<List<CsLedgerVO>> getztProjectTree(){
|
||||
String methodDescribe = getMethodDescribe("getProjectTree");
|
||||
List<CsLedgerVO> list = csLedgerService.getztProjectTree();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增台账信息")
|
||||
|
||||
@@ -74,4 +74,6 @@ public interface ICsLedgerService extends IService<CsLedger> {
|
||||
List<CsLedger> queryLine(LineParamDTO lineParamdto);
|
||||
|
||||
DevDetailDTO queryDevDetail(String devId);
|
||||
|
||||
List<CsLedgerVO> getztProjectTree();
|
||||
}
|
||||
|
||||
@@ -327,6 +327,82 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
return device;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsLedgerVO> getztProjectTree() {
|
||||
List<CsLedgerVO> engineeringList;
|
||||
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
||||
/*获取用户工程,设备信息过滤*/
|
||||
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||
List<String> device = roleEngineerDevService.getDevice();
|
||||
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
|
||||
List<CsLedgerVO> deviceList = allList.stream().filter(item -> device.contains(item.getId()) && !Objects.equals(item.getPid(),"0")).
|
||||
peek(
|
||||
temp->{
|
||||
CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(temp.getId());
|
||||
temp.setComFlag(po.getRunStatus());
|
||||
temp.setNDId(po.getNdid());
|
||||
temp.setType("device");
|
||||
}
|
||||
).
|
||||
sorted(Comparator.comparing(CsLedgerVO::getSort))
|
||||
.collect(Collectors.toList());
|
||||
checkDevSetData(deviceList);
|
||||
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
||||
|
||||
//获取便携式项目数
|
||||
CsLedgerVO portable = new CsLedgerVO();
|
||||
portable.setLevel(0);
|
||||
portable.setName(DataParam.PORTABLE_SYSTEM);
|
||||
portable.setPid("0");
|
||||
portable.setId(IdUtil.simpleUUID());
|
||||
|
||||
CsLedgerVO project = new CsLedgerVO();
|
||||
project.setLevel(1);
|
||||
project.setName(DataParam.WIRELESS_PROJECT);
|
||||
project.setPid("0");
|
||||
project.setId(DataParam.WIRELESS_PROJECT_ID);
|
||||
|
||||
List<CsLedgerVO> portables = allList.stream().filter(item->Objects.equals(item.getLevel(),2) && Objects.equals(item.getPid(),"0")).collect(Collectors.toList());
|
||||
checkDevSetData(portables);
|
||||
for(CsLedgerVO c : portables){
|
||||
c.setPid(project.getId());
|
||||
CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(c.getId());
|
||||
c.setComFlag(po.getRunStatus());
|
||||
c.setNDId(po.getNdid());
|
||||
c.setType("device");
|
||||
}
|
||||
project.setChildren(portables);
|
||||
|
||||
List<CsLedgerVO> wxProjectList = new ArrayList<>();
|
||||
wxProjectList.add(project);
|
||||
|
||||
portable.setChildren(wxProjectList);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CsLedgerVO government = new CsLedgerVO();
|
||||
government.setLevel(0);
|
||||
government.setName(DataParam.GOVERNANCE_SYSTEM);
|
||||
government.setPid("0");
|
||||
government.setId(IdUtil.simpleUUID());
|
||||
government.setChildren(engineeringList);
|
||||
List<CsLedgerVO> tree = new ArrayList<>();
|
||||
|
||||
// if (CollUtil.isNotEmpty(portables)) {
|
||||
tree.add(portable);
|
||||
// }
|
||||
// if (CollUtil.isNotEmpty(deviceList)) {
|
||||
tree.add(government);
|
||||
// }
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子节点
|
||||
*/
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.api.RoleEngineerDevFeignClient;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csharmonic.constant.HarmonicConstant;
|
||||
import com.njcn.csharmonic.mapper.CsConfigurationMapper;
|
||||
import com.njcn.csharmonic.param.CsConfigurationParm;
|
||||
@@ -116,6 +117,8 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
||||
if(CollectionUtils.isEmpty(data1)){
|
||||
return returnpage;
|
||||
}
|
||||
//+无线项目id
|
||||
data1.add(DataParam.WIRELESS_PROJECT_ID);
|
||||
Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().queryPage(temppage,csConfigurationQueryParam,data1);
|
||||
// QueryWrapper<CsConfigurationPO> query = new QueryWrapper<>();
|
||||
// query.like(StringUtils.isNotBlank(csConfigurationQueryParam.getSearchValue()),CsConfigurationPO.COL_NAME,csConfigurationQueryParam.getSearchValue()).
|
||||
|
||||
Reference in New Issue
Block a user