完善模板解析功能
This commit is contained in:
@@ -81,10 +81,10 @@ public class DevModelRelationController extends BaseController {
|
||||
@PostMapping("/getModelByDevId")
|
||||
@ApiOperation("根据装置Id查询模板")
|
||||
@ApiImplicitParam(name = "devId", value = "装置id", required = true)
|
||||
public HttpResult<CsDevModelRelationPO> getModelByDevId(@RequestParam("devId") String devId){
|
||||
public HttpResult<List<CsDevModelRelationPO>> getModelByDevId(@RequestParam("devId") String devId){
|
||||
String methodDescribe = getMethodDescribe("getModelByDevId");
|
||||
CsDevModelRelationPO po = csDevModelRelationService.findModelByDevId(devId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
List<CsDevModelRelationPO> list = csDevModelRelationService.findModelByDevId(devId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
from
|
||||
cs_data_array t0
|
||||
where
|
||||
pid = #{id}
|
||||
pid = #{id} and (stat_method = 'avg' or stat_method is null)
|
||||
group by
|
||||
id,
|
||||
name,
|
||||
|
||||
@@ -44,6 +44,6 @@ public interface CsDevModelRelationService extends IService<CsDevModelRelationPO
|
||||
* @param devId
|
||||
* @return
|
||||
*/
|
||||
CsDevModelRelationPO findModelByDevId(String devId);
|
||||
List<CsDevModelRelationPO> findModelByDevId(String devId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.mapper.CsDataArrayMapper;
|
||||
import com.njcn.csdevice.pojo.dto.DataArrayDTO;
|
||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
||||
@@ -40,6 +41,10 @@ public class CsDataArrayServiceImpl extends ServiceImpl<CsDataArrayMapper, CsDat
|
||||
public List<DeviceManagerDetailVO> getTargetById(String id) {
|
||||
List<DeviceManagerDetailVO> list = new ArrayList<>();
|
||||
List<String> l = this.baseMapper.getDictData(id).stream().map(CsDataArray::getDataId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(l)){
|
||||
log.error(AlgorithmResponseEnum.DATA_ARRAY_MISSING.getMessage());
|
||||
return list;
|
||||
}
|
||||
List<EleEpdPqd> result = epdFeignClient.selectByIds(l).getData();
|
||||
Map<String,List<EleEpdPqd>> map = result.stream().collect(Collectors.groupingBy(EleEpdPqd::getShowName,LinkedHashMap::new,Collectors.toList()));
|
||||
for (Map.Entry<String, List<EleEpdPqd>> entry : map.entrySet()) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.alibaba.excel.util.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.mapper.CsDataSetMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsDataSet;
|
||||
@@ -7,6 +8,7 @@ import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import com.njcn.csdevice.service.ICsDataSetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -22,7 +24,12 @@ public class CsDataSetServiceImpl extends ServiceImpl<CsDataSetMapper, CsDataSet
|
||||
|
||||
@Override
|
||||
public List<CsDataSet> findDataSetByModelId(String modelId) {
|
||||
return this.lambdaQuery().eq(CsDataSet::getPid,modelId).list();
|
||||
List<CsDataSet> list = new ArrayList<>();
|
||||
list = this.lambdaQuery().eq(CsDataSet::getPid,modelId).eq(CsDataSet::getType,0).list();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
list = this.lambdaQuery().eq(CsDataSet::getPid,modelId).orderByAsc(CsDataSet::getClDev).list();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,7 +89,7 @@ public class CsDevModelRelationServiceImpl extends ServiceImpl<CsDevModelRelatio
|
||||
}
|
||||
|
||||
@Override
|
||||
public CsDevModelRelationPO findModelByDevId(String devId) {
|
||||
return this.lambdaQuery().eq(CsDevModelRelationPO::getDevId,devId).eq(CsDevModelRelationPO::getStatus,1).one();
|
||||
public List<CsDevModelRelationPO> findModelByDevId(String devId) {
|
||||
return this.lambdaQuery().eq(CsDevModelRelationPO::getDevId,devId).eq(CsDevModelRelationPO::getStatus,1).list();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.njcn.csdevice.pojo.param.CsEquipmentDeliveryAuditParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentDeliveryQueryParm;
|
||||
import com.njcn.csdevice.pojo.param.ProjectEquipmentQueryParm;
|
||||
import com.njcn.csdevice.pojo.po.CsDataSet;
|
||||
import com.njcn.csdevice.pojo.po.CsDevModelRelationPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||
@@ -28,7 +29,6 @@ import com.njcn.csdevice.pojo.vo.ProjectEquipmentVO;
|
||||
import com.njcn.csdevice.service.*;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -193,8 +193,11 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
DeviceManagerVO deviceManagerVo = new DeviceManagerVO();
|
||||
List<DeviceManagerVO.DataSetVO> dataSetList = new ArrayList<>();
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPo = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId,deviceId).one();
|
||||
String modelId = csDevModelRelationService.findModelByDevId(deviceId).getModelId();
|
||||
List<CsDataSet> dataSet = csDataSetService.findDataSetByModelId(modelId);
|
||||
List<CsDevModelRelationPO> list = csDevModelRelationService.findModelByDevId(deviceId);
|
||||
List<CsDataSet> dataSet = new ArrayList<>();
|
||||
list.forEach(item->{
|
||||
dataSet.addAll(csDataSetService.findDataSetByModelId(item.getModelId()));
|
||||
});
|
||||
BeanUtils.copyProperties(csEquipmentDeliveryPo,deviceManagerVo);
|
||||
dataSet.forEach(item->{
|
||||
DeviceManagerVO.DataSetVO dataSetVO = new DeviceManagerVO.DataSetVO();
|
||||
|
||||
@@ -182,7 +182,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
private List<CsGroupVO> getChildrenes(String tabId, List<CsGroupVO> all) {
|
||||
return all.stream().filter(item -> item.getPid().equals(tabId)).collect(Collectors.toList());
|
||||
}
|
||||
//fixme 目前组的数据插入写在这里,先查询数据集是否分组,分组了直接查询,没分组先分组再展示数据。后期根据业务需求在做调整
|
||||
//如果未做分组,则先分组
|
||||
public List<CsGroupVO> insertGroupData(String dataSet) {
|
||||
AtomicReference<Integer> sort = new AtomicReference<>(0);
|
||||
List<CsGroup> ls = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user