去掉魔法字符,设备监控及管理左侧树过滤掉无数据的tree,测试项绑定数据列表形式修改
This commit is contained in:
@@ -23,4 +23,23 @@ public interface DataParam {
|
||||
|
||||
//便携式设备默认统计方式
|
||||
String portableDevStatisticalMethods = "min";
|
||||
|
||||
//DecimalFormat格式化
|
||||
String DecimalFormatStr = "#0.0000";
|
||||
|
||||
//DecimalFormat格式化
|
||||
String startTime = " 00:00:00";
|
||||
|
||||
String endTime = " 23:59:59";
|
||||
|
||||
String timeFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
String portableDev = "便携式设备";
|
||||
|
||||
String governmentDev = "治理设备";
|
||||
|
||||
String EvtParamPhase = "Evt_Param_Phase";
|
||||
|
||||
String evtData = "evt_data";
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ public enum LineBaseEnum {
|
||||
DEVICE_LEVEL(2, "设备"),
|
||||
LINE_LEVEL(3, "监测点"),
|
||||
INVALID_LEVEL(-1, "非法拓扑等级"),
|
||||
NOWLRECORD_FAIL(-1,"方案ID不存在"),
|
||||
EXISTWLRECORD_FAIL(-1,"方案名称已存在"),
|
||||
DEVID_FAIL(-1,"devId有误"),
|
||||
NOTYPE_FAIL(-1,"devId有误"),
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
|
||||
@@ -4,9 +4,6 @@ import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@@ -18,16 +15,10 @@ public class WlRecordPageParam extends BaseParam {
|
||||
@ApiModelProperty(value="是否匹配测试项ID")
|
||||
private Integer isTrueFlag;
|
||||
|
||||
@ApiModelProperty(value="添加设备时左侧的监测点ID")
|
||||
private List<String> treeIds = new ArrayList<>();
|
||||
@ApiModelProperty(value="设备ID(后端自己用)")
|
||||
private String devId;
|
||||
|
||||
@ApiModelProperty(value="添加测试项的时候顺便添加基础数据列表要排除临时已经添加的基础设备数据")
|
||||
private List<String> isBandIds = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty(value="添加设备时左侧的设备ID")
|
||||
private List<String> pIds = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty(value="关键字多个匹配")
|
||||
private String searchText;
|
||||
@ApiModelProperty(value="监测点ID(后端自己用)")
|
||||
private String lineId;
|
||||
|
||||
}
|
||||
|
||||
@@ -35,5 +35,22 @@ public class RecordAllDevTreeVo {
|
||||
@ApiModelProperty("设备ID")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("线路")
|
||||
private List<RecordAllTimeTreeVo> children;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RecordAllTimeTreeVo {
|
||||
|
||||
@ApiModelProperty("数据ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("数据名称(开始时间-结束时间)")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("监测点ID")
|
||||
private String pid;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,11 +112,11 @@ public class WlRecordController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备列表
|
||||
* 设备列表树
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@PostMapping("/queryPage")
|
||||
@ApiOperation("设备列表")
|
||||
@ApiOperation("设备列表树")
|
||||
public HttpResult<Object> queryPage(@Validated @RequestBody WlRecordPageParam wlRecordPageParam) {
|
||||
String methodDescribe = getMethodDescribe("queryPage");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe);
|
||||
@@ -138,19 +138,6 @@ public class WlRecordController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除测试项中的设备基础数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/deleteDataRecord")
|
||||
@ApiOperation("删除测试项中的设备基础数据")
|
||||
public HttpResult<Boolean> deleteDataRecord(@RequestBody @Validated WlRecordParam.UpdateRecord record) {
|
||||
String methodDescribe = getMethodDescribe("deleteDataRecord");
|
||||
LogUtil.njcnDebug(log, "{},测试项及基础数据ID为:{}", methodDescribe, record);
|
||||
wlRecordService.deleteDataRecord(record);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加测试项中的设备基础数据
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.csdevice.param.WlRecordPageParam;
|
||||
import com.njcn.csdevice.pojo.po.WlRecord;
|
||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||
import com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo;
|
||||
import com.njcn.csdevice.pojo.vo.RecordPageVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,11 +18,6 @@ import java.util.List;
|
||||
*/
|
||||
public interface WlRecordMapper extends BaseMapper<WlRecord> {
|
||||
|
||||
/**
|
||||
* 查询测试项下绑定的设备列表
|
||||
*/
|
||||
Page<RecordPageVo> queryPage(Page<RecordPageVo> returnpage,@Param("wlRecordPageParam") WlRecordPageParam wlRecordPageParam);
|
||||
|
||||
/**
|
||||
* 添加测试项中的设备基础数据
|
||||
*/
|
||||
@@ -43,8 +36,9 @@ public interface WlRecordMapper extends BaseMapper<WlRecord> {
|
||||
/**
|
||||
* 组装测试项表的tree
|
||||
*/
|
||||
List<RecordAllDevTreeVo> getRecordAll();
|
||||
List<RecordAllDevTreeVo.RecordAllLineTreeVo> getRecordAllLine(@Param("devId") String devId);
|
||||
List<RecordAllDevTreeVo> getRecordAll(@Param("wlRecordPageParam")WlRecordPageParam wlRecordPageParam);
|
||||
List<RecordAllDevTreeVo.RecordAllLineTreeVo> getRecordAllLine(@Param("wlRecordPageParam")WlRecordPageParam wlRecordPageParam);
|
||||
List<RecordAllDevTreeVo.RecordAllTimeTreeVo> getRecordAllTime(@Param("wlRecordPageParam")WlRecordPageParam wlRecordPageParam);
|
||||
|
||||
/**
|
||||
* 根据测试项ID或方案ID获取其下关联的所有设备基础数据信息
|
||||
|
||||
@@ -2,64 +2,6 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.csdevice.mapper.WlRecordMapper">
|
||||
|
||||
<select id="queryPage" resultType="com.njcn.csdevice.pojo.vo.RecordPageVo">
|
||||
select
|
||||
a.id,
|
||||
a.item_name itemName,
|
||||
b.name devName,
|
||||
b.mac devMac,
|
||||
b.ndid devNdId,
|
||||
c.name lineName,
|
||||
a.start_time startTime,
|
||||
a.end_time endTime
|
||||
from
|
||||
wl_record a
|
||||
left join cs_equipment_delivery b on a.dev_id = b.id
|
||||
left join cs_line c on a.line_id = c.line_id
|
||||
where a.`type` = 1 and a.state = 1
|
||||
<if test="wlRecordPageParam.isTrueFlag == 1">
|
||||
and exists (select 1 from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id} and a.id = wd.data_id)
|
||||
</if>
|
||||
<if test="wlRecordPageParam.isTrueFlag == 0">
|
||||
and not exists (select 1 from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id} and a.id = wd.data_id)
|
||||
</if>
|
||||
<if test="wlRecordPageParam.treeIds != null and wlRecordPageParam.treeIds.size() > 0">
|
||||
and a.line_id in
|
||||
<foreach collection="wlRecordPageParam.treeIds" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
<if test="wlRecordPageParam.pIds != null and wlRecordPageParam.pIds.size() > 0">
|
||||
and a.dev_id in
|
||||
<foreach collection="wlRecordPageParam.pIds" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="wlRecordPageParam.searchText != null and wlRecordPageParam.searchText != ''">
|
||||
and (b.name like concat('%',#{wlRecordPageParam.searchText},'%')
|
||||
or b.item_name like concat('%',#{wlRecordPageParam.searchText},'%'))
|
||||
</if>
|
||||
<if test="wlRecordPageParam.searchBeginTime != null and wlRecordPageParam.searchEndTime != ''">
|
||||
and (
|
||||
a.start_time between #{wlRecordPageParam.searchBeginTime} and #{wlRecordPageParam.searchEndTime}
|
||||
or
|
||||
a.end_time between #{wlRecordPageParam.searchBeginTime} and #{wlRecordPageParam.searchEndTime}
|
||||
or
|
||||
#{wlRecordPageParam.searchBeginTime} between a.start_time and a.end_time
|
||||
or
|
||||
#{wlRecordPageParam.searchEndTime} between a.start_time and a.end_time
|
||||
)
|
||||
</if>
|
||||
<if test="wlRecordPageParam.isBandIds != null and wlRecordPageParam.isBandIds.size() > 0">
|
||||
and a.id not in
|
||||
<foreach collection="wlRecordPageParam.isBandIds" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by a.start_time
|
||||
</select>
|
||||
|
||||
<insert id="saveDataRecord">
|
||||
insert into wl_record_test_data
|
||||
select #{testRecordId},#{dataRecordId} from dual
|
||||
@@ -78,26 +20,57 @@
|
||||
</select>
|
||||
|
||||
<select id="getRecordAll" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo">
|
||||
<if test="wlRecordPageParam.isTrueFlag == 0">
|
||||
select a.dev_id as id,b.name as name from wl_record a
|
||||
left join cs_equipment_delivery b on a.dev_id = b.id
|
||||
where a.type=1 and a.state =1
|
||||
where a.type=1 and a.state =1 and
|
||||
(select count(1) from wl_record wl where wl.dev_id = a.dev_id) >
|
||||
(select count(1) from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id}
|
||||
and data_id in (select w.id from wl_record w where w.dev_id = a.dev_id))
|
||||
group by a.dev_id,b.name having a.dev_id is not null and b.name is not null
|
||||
</select>
|
||||
|
||||
<select id="getAll" resultType="com.njcn.csdevice.pojo.vo.CsLedgerVO">
|
||||
</if>
|
||||
<if test="wlRecordPageParam.isTrueFlag == 1">
|
||||
select a.dev_id as id,b.name as name from wl_record a
|
||||
left join cs_equipment_delivery b on a.dev_id = b.id
|
||||
where a.type=1 and a.state =1
|
||||
where a.type=1 and a.state =1 and exists
|
||||
(select 1 from wl_record wl where wl.dev_id = a.dev_id and wl.type=1 and wl.state =1
|
||||
and exists (select 1 from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id} and wd.data_id = wl.id))
|
||||
group by a.dev_id,b.name having a.dev_id is not null and b.name is not null
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getRecordAllLine" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllLineTreeVo">
|
||||
select a.line_id as id,c.name as name, #{devId} as pid from wl_record a
|
||||
select a.line_id as id,c.name as name, #{wlRecordPageParam.devId} as pid from wl_record a
|
||||
left join cs_line c on a.line_id = c.line_id
|
||||
where a.type=1 and a.state =1 and a.dev_id=#{devId}
|
||||
where a.type=1 and a.state =1 and a.dev_id=#{wlRecordPageParam.devId} and
|
||||
<if test="wlRecordPageParam.isTrueFlag == 0">
|
||||
not
|
||||
</if>
|
||||
exists
|
||||
(select 1 from wl_record wl where wl.id = a.id and wl.type=1 and wl.state =1
|
||||
and exists (select 1 from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id} and wd.data_id = wl.id))
|
||||
group by a.line_id,c.name having a.line_id is not null and c.name is not null
|
||||
</select>
|
||||
|
||||
<select id="getRecordAllTime" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllTimeTreeVo">
|
||||
select a.id as id,concat(a.start_time,'-',a.end_time) as name, #{wlRecordPageParam.lineId} as pid from wl_record a
|
||||
left join cs_line c on a.line_id = c.line_id
|
||||
where a.type=1 and a.state =1 and a.dev_id=#{wlRecordPageParam.devId} and a.line_id=#{wlRecordPageParam.lineId}
|
||||
and
|
||||
<if test="wlRecordPageParam.isTrueFlag == 0">
|
||||
not
|
||||
</if>
|
||||
exists
|
||||
(select 1 from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id} and wd.data_id = a.id)
|
||||
</select>
|
||||
|
||||
<select id="getAll" resultType="com.njcn.csdevice.pojo.vo.CsLedgerVO">
|
||||
select a.dev_id as id,b.name as name ,2 as level from wl_record a
|
||||
left join cs_equipment_delivery b on a.dev_id = b.id
|
||||
where a.type=1 and a.state =1
|
||||
group by a.dev_id,b.name having a.dev_id is not null and b.name is not null
|
||||
</select>
|
||||
|
||||
<select id="getAllLine" resultType="com.njcn.csdevice.pojo.vo.CsLedgerVO">
|
||||
select a.line_id as id,c.name as name from wl_record a
|
||||
left join cs_line c on a.line_id = c.line_id
|
||||
|
||||
@@ -56,7 +56,7 @@ public interface IWlRecordService extends IService<WlRecord> {
|
||||
void updateSchemeRecord(WlRecordParam.UpdateRecord record);
|
||||
|
||||
/**
|
||||
* 设备列表
|
||||
* 设备列表树
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@@ -69,12 +69,6 @@ public interface IWlRecordService extends IService<WlRecord> {
|
||||
*/
|
||||
void deleteRecord(String id);
|
||||
|
||||
/**
|
||||
* 删除测试项中的设备基础数据
|
||||
* @return
|
||||
*/
|
||||
void deleteDataRecord(WlRecordParam.UpdateRecord record);
|
||||
|
||||
/**
|
||||
* 添加测试项中的设备基础数据
|
||||
* @return
|
||||
|
||||
@@ -295,8 +295,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
} else {
|
||||
//治理设备 devTypeCode = Direct_Connected_Device 便携式设备 = Portable
|
||||
String devTypeCode = dictTreeFeignClient.queryById(csEquipmentDeliveryPo.getDevType()).getData().getCode();
|
||||
if (Objects.equals(devTypeCode, DicDataEnum.CONNECT_DEV.getCode())) {
|
||||
CsLinePO line = csLinePOService.getById(lineId);
|
||||
if (Objects.equals(devTypeCode, DicDataEnum.CONNECT_DEV.getCode())) {
|
||||
String code = dicDataFeignClient.getDicDataById(line.getPosition()).getData().getCode();
|
||||
String modelId = "";
|
||||
List<CsDataSet> dataSet = new ArrayList<>();
|
||||
@@ -331,7 +331,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
List<CsDevModelRelationPO> modelId = csDevModelRelationService.findModelByDevId(deviceId);
|
||||
if (CollUtil.isNotEmpty(modelId)){
|
||||
for (CsDevModelRelationPO item : modelId) {
|
||||
dataSet.addAll(csDataSetService.findDataSetByModelId(item.getModelId()));
|
||||
dataSet.addAll(csDataSetService.findDataSetByModelId(item.getModelId(),line.getClDid()));
|
||||
}
|
||||
setDataSetValues(csEquipmentDeliveryPo, dataSet, dataSetList, type, deviceManagerVo);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||
import com.njcn.csdevice.mapper.CsDataArrayMapper;
|
||||
import com.njcn.csdevice.mapper.CsGroArrMapper;
|
||||
import com.njcn.csdevice.mapper.CsGroupMapper;
|
||||
@@ -48,6 +49,7 @@ import com.njcn.system.pojo.po.EleEvtParm;
|
||||
import com.njcn.system.pojo.vo.CsStatisticalSetVO;
|
||||
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -235,7 +237,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
@Override
|
||||
public Object deviceDataByType(CommonStatisticalQueryParam commonStatisticalQueryParam) {
|
||||
String type = commonStatisticalQueryParam.getType();
|
||||
if (type == null) throw new BusinessException("type参数缺失!");
|
||||
if (type == null) throw new BusinessException(LineBaseEnum.NOTYPE_FAIL.getMessage());
|
||||
//传1 则是趋势数据tab页面
|
||||
if("1".equals(type)){
|
||||
formatQueryParamList(commonStatisticalQueryParam);
|
||||
@@ -341,7 +343,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
for (EleEvtParm eleEvtParm : data1) {
|
||||
EventDataSetDTO eventDataSetDTO = new EventDataSetDTO();
|
||||
BeanUtils.copyProperties(eleEvtParm,eventDataSetDTO);
|
||||
EventDataSetDTO evtData = evtDataService.getEventDataSet("evt_data", temp.getId(), eleEvtParm.getName());
|
||||
EventDataSetDTO evtData = evtDataService.getEventDataSet(DataParam.evtData, temp.getId(), eleEvtParm.getName());
|
||||
if (evtData == null) {
|
||||
eventDataSetDTO.setValue("-");
|
||||
}else {
|
||||
@@ -350,7 +352,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
eventDataSetDTOS.add(eventDataSetDTO);
|
||||
}
|
||||
List<EventDataSetDTO> evtParamPhase = eventDataSetDTOS.stream().
|
||||
filter(dataSetDTO -> Objects.equals(dataSetDTO.getName(), "Evt_Param_Phase")).
|
||||
filter(dataSetDTO -> Objects.equals(dataSetDTO.getName(), DataParam.EvtParamPhase)).
|
||||
collect(Collectors.toList());
|
||||
if(CollectionUtil.isEmpty(evtParamPhase)){
|
||||
temp.setPhaseType("-");
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||
import com.njcn.csdevice.mapper.*;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
@@ -12,10 +14,7 @@ import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||
import com.njcn.csdevice.pojo.po.*;
|
||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
import com.njcn.csdevice.service.ICsEngineeringUserService;
|
||||
import com.njcn.csdevice.service.ICsLedgerService;
|
||||
import com.njcn.csdevice.service.RoleEngineerDevService;
|
||||
import com.njcn.csdevice.service.*;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.AreaFeignClient;
|
||||
@@ -52,8 +51,10 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
private final RoleEngineerDevService roleEngineerDevService;
|
||||
private final WlRecordMapper wlRecordMapper;
|
||||
private final CsDevModelRelationService csDevModelRelationService;
|
||||
|
||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||
private final ICsDataSetService csDataSetService;
|
||||
|
||||
|
||||
|
||||
@@ -110,19 +111,22 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
|
||||
|
||||
List<CsLedgerVO> finalLineList = lineList;
|
||||
checkDevSetData(deviceList);
|
||||
deviceList.forEach(dev -> dev.setChildren(getChildren(dev, finalLineList)));
|
||||
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("便携式设备");
|
||||
portable.setName(DataParam.portableDev);
|
||||
portable.setPid("0");
|
||||
portable.setId(IdUtil.simpleUUID());
|
||||
List<CsLedgerVO> portables = wlRecordMapper.getAll();
|
||||
checkDevSetData(portables);
|
||||
for(CsLedgerVO c : portables){
|
||||
c.setPid(portable.getId());
|
||||
c.setLevel(2);
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(c.getId());
|
||||
c.setComFlag(Integer.parseInt(csEquipmentDeliveryPO.getStatus()));
|
||||
c.setChildren(wlRecordMapper.getAllLine(c.getId()));
|
||||
for(CsLedgerVO cs : c.getChildren()){
|
||||
cs.setPid(c.getId());
|
||||
@@ -133,7 +137,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
|
||||
CsLedgerVO government = new CsLedgerVO();
|
||||
government.setLevel(0);
|
||||
government.setName("治理设备");
|
||||
government.setName(DataParam.governmentDev);
|
||||
government.setPid("0");
|
||||
government.setId(IdUtil.simpleUUID());
|
||||
government.setChildren(engineeringList);
|
||||
@@ -144,6 +148,27 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
//return engineeringList;
|
||||
}
|
||||
|
||||
//剔除未接入的设备(根据status判断不太稳,所有这里直接判断该设备有没有对应的模板指标)
|
||||
private void checkDevSetData(List<CsLedgerVO> ledgerVOS){
|
||||
Iterator<CsLedgerVO> iterator = ledgerVOS.iterator();
|
||||
while (iterator.hasNext()){
|
||||
CsLedgerVO csLedgerVO = iterator.next();
|
||||
//只针对设备
|
||||
if(csLedgerVO.getLevel() == 2){
|
||||
List<CsDevModelRelationPO> modelId = csDevModelRelationService.findModelByDevId(csLedgerVO.getId());
|
||||
if (CollUtil.isEmpty(modelId)){
|
||||
iterator.remove();
|
||||
}else{
|
||||
for (CsDevModelRelationPO item : modelId) {
|
||||
if (CollUtil.isEmpty(csDataSetService.findDataSetByModelId(item.getModelId()))){
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsLedgerVO> getDeviceTree() {
|
||||
List<CsLedgerVO> engineeringList = new ArrayList<>();
|
||||
@@ -169,25 +194,27 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
}
|
||||
).
|
||||
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("便携式设备");
|
||||
portable.setName(DataParam.portableDev);
|
||||
portable.setPid("0");
|
||||
portable.setId(IdUtil.simpleUUID());
|
||||
List<CsLedgerVO> portables = wlRecordMapper.getAll();
|
||||
checkDevSetData(portables);
|
||||
for(CsLedgerVO c : portables){
|
||||
c.setPid(portable.getId());
|
||||
c.setLevel(2);
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(c.getId());
|
||||
c.setComFlag(Integer.parseInt(csEquipmentDeliveryPO.getStatus()));
|
||||
}
|
||||
portable.setChildren(portables);
|
||||
|
||||
CsLedgerVO government = new CsLedgerVO();
|
||||
government.setLevel(0);
|
||||
government.setName("治理设备");
|
||||
government.setName(DataParam.governmentDev);
|
||||
government.setPid("0");
|
||||
government.setId(IdUtil.simpleUUID());
|
||||
government.setChildren(engineeringList);
|
||||
|
||||
@@ -3,14 +3,15 @@ package com.njcn.csdevice.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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.CsLineFeignClient;
|
||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||
import com.njcn.csdevice.mapper.WlRecordMapper;
|
||||
import com.njcn.csdevice.param.WlRecordPageParam;
|
||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||
@@ -18,7 +19,6 @@ import com.njcn.csdevice.pojo.param.WlRecordParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.po.WlRecord;
|
||||
import com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo;
|
||||
import com.njcn.csdevice.pojo.vo.RecordPageVo;
|
||||
import com.njcn.csdevice.pojo.vo.RecordTreeVo;
|
||||
import com.njcn.csdevice.pojo.vo.RecordVo;
|
||||
import com.njcn.csdevice.service.IWlRecordService;
|
||||
@@ -65,7 +65,7 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final DecimalFormat df = new DecimalFormat("#0.0000");
|
||||
private final DecimalFormat df = new DecimalFormat(DataParam.DecimalFormatStr);
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -73,11 +73,11 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
//整理的方案下测试项集合(可能添加多个测试项)
|
||||
List<WlRecord> insertList = new ArrayList<>();
|
||||
//校验方案ID是否存在
|
||||
QueryWrapper<WlRecord> qw = new QueryWrapper();
|
||||
qw.eq("id",records.getId()).eq("type",0).eq("state",1);
|
||||
LambdaQueryWrapper<WlRecord> qw = new LambdaQueryWrapper();
|
||||
qw.eq(WlRecord::getId,records.getId()).eq(WlRecord::getType,0).eq(WlRecord::getState,1);
|
||||
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||
if(wlRecordList.isEmpty() && wlRecordList.get(0).getPId()!=null){
|
||||
throw new BusinessException("方案ID不存在");
|
||||
throw new BusinessException(LineBaseEnum.NOWLRECORD_FAIL.getMessage());
|
||||
}
|
||||
//便利测试项
|
||||
records.getRecords().forEach(item->{
|
||||
@@ -113,12 +113,12 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
BeanUtils.copyProperties(record, wlRecord);
|
||||
this.updateById(wlRecord);
|
||||
}else{
|
||||
QueryWrapper<WlRecord> qw = new QueryWrapper();
|
||||
qw.eq("item_name",record.getItemName()).eq("type",0).eq("state",1);
|
||||
LambdaQueryWrapper<WlRecord> qw = new LambdaQueryWrapper();
|
||||
qw.eq(WlRecord::getItemName,record.getItemName()).eq(WlRecord::getType,0).eq(WlRecord::getState,1);
|
||||
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||
//方案名称重复校验
|
||||
if(!wlRecordList.isEmpty()){
|
||||
throw new BusinessException("方案名称已存在");
|
||||
throw new BusinessException(LineBaseEnum.EXISTWLRECORD_FAIL.getMessage());
|
||||
}
|
||||
BeanUtils.copyProperties(record, wlRecord);
|
||||
wlRecord.setId(IdUtil.simpleUUID());
|
||||
@@ -132,17 +132,14 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
public RecordVo.RecordItemVo getTestRecordById(String testRecordId) {
|
||||
RecordVo.RecordItemVo recordItemVo = new RecordVo.RecordItemVo();
|
||||
List<RecordVo> recordVoList = new ArrayList<>();
|
||||
QueryWrapper<WlRecord> qw = new QueryWrapper();
|
||||
qw.eq("id",testRecordId).eq("type",0).eq("state",1);
|
||||
LambdaQueryWrapper<WlRecord> qw = new LambdaQueryWrapper();
|
||||
qw.eq(WlRecord::getId,testRecordId).eq(WlRecord::getType,0).eq(WlRecord::getState,1);
|
||||
List<WlRecord> list = this.baseMapper.selectList(qw);
|
||||
if(list.isEmpty()){
|
||||
throw new BusinessException("ID有误");
|
||||
}
|
||||
WlRecord wlRecord = list.get(0);
|
||||
//当前ID就是测试项ID直接返回
|
||||
if(wlRecord.getPId()!=null){
|
||||
qw = new QueryWrapper();
|
||||
qw.eq("id",wlRecord.getPId()).eq("type",0).eq("state",1);
|
||||
qw = new LambdaQueryWrapper();
|
||||
qw.eq(WlRecord::getId,wlRecord.getPId()).eq(WlRecord::getType,0).eq(WlRecord::getState,1);
|
||||
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||
recordItemVo.setDescribe(wlRecordList.get(0).getDescribe());
|
||||
recordItemVo.setItemName(wlRecordList.get(0).getItemName());
|
||||
@@ -155,8 +152,8 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
//反之则是方案ID 则返回该方案下所有的测试项信息
|
||||
recordItemVo.setDescribe(wlRecord.getDescribe());
|
||||
recordItemVo.setItemName(wlRecord.getItemName());
|
||||
qw = new QueryWrapper();
|
||||
qw.eq("p_id",testRecordId).eq("type",0).eq("state",1).orderByAsc("create_time");;
|
||||
qw = new LambdaQueryWrapper();
|
||||
qw.eq(WlRecord::getPId,testRecordId).eq(WlRecord::getType,0).eq(WlRecord::getState,1).orderByAsc(WlRecord::getCreateTime);;
|
||||
for (WlRecord wl : this.baseMapper.selectList(qw)){
|
||||
RecordVo recordVo = new RecordVo();
|
||||
wl.setStartTime(getFirstTimeById(wl.getId()));
|
||||
@@ -171,34 +168,25 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
|
||||
@Override
|
||||
public Object queryPage(WlRecordPageParam wlRecordPageParam) {
|
||||
//如果没有分页请求则直接返回tree
|
||||
if(wlRecordPageParam.getPageNum() == null){
|
||||
//组装tree用于测试项绑定数据页面左侧的搜索树
|
||||
List<RecordAllDevTreeVo> recordAllDevTreeVos = this.baseMapper.getRecordAll();
|
||||
List<RecordAllDevTreeVo> recordAllDevTreeVos = this.baseMapper.getRecordAll(wlRecordPageParam);
|
||||
for (RecordAllDevTreeVo recordAllDevTreeVo : recordAllDevTreeVos){
|
||||
List<RecordAllDevTreeVo.RecordAllLineTreeVo> recordAllLineTreeVos = this.baseMapper.getRecordAllLine(recordAllDevTreeVo.getId());
|
||||
wlRecordPageParam.setDevId(recordAllDevTreeVo.getId());
|
||||
List<RecordAllDevTreeVo.RecordAllLineTreeVo> recordAllLineTreeVos = this.baseMapper.getRecordAllLine(wlRecordPageParam);
|
||||
for(RecordAllDevTreeVo.RecordAllLineTreeVo recordAllLineTreeVo : recordAllLineTreeVos){
|
||||
wlRecordPageParam.setLineId(recordAllLineTreeVo.getId());
|
||||
recordAllLineTreeVo.setChildren(this.baseMapper.getRecordAllTime(wlRecordPageParam));
|
||||
}
|
||||
recordAllDevTreeVo.setChildren(recordAllLineTreeVos);
|
||||
}
|
||||
return recordAllDevTreeVos;
|
||||
}else{
|
||||
//查看已绑定的设备基础数据列表
|
||||
Page<RecordPageVo> returnpage = new Page<> (wlRecordPageParam.getPageNum(), wlRecordPageParam.getPageSize ());
|
||||
if(wlRecordPageParam.getSearchBeginTime()!=null) wlRecordPageParam.setSearchBeginTime(wlRecordPageParam.getSearchBeginTime()+" 00:00:00");
|
||||
if(wlRecordPageParam.getSearchEndTime()!=null) wlRecordPageParam.setSearchEndTime(wlRecordPageParam.getSearchEndTime()+" 23:59:59");
|
||||
if(wlRecordPageParam.getIsTrueFlag() == 0 && wlRecordPageParam.getTreeIds().isEmpty()){
|
||||
wlRecordPageParam.setTreeIds(new ArrayList<>());
|
||||
wlRecordPageParam.getTreeIds().add("-1");
|
||||
}
|
||||
returnpage = this.getBaseMapper().queryPage(returnpage,wlRecordPageParam);
|
||||
return returnpage;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RecordTreeVo> getSchemeTree() {
|
||||
List<RecordTreeVo> result = new ArrayList<>();
|
||||
QueryWrapper<WlRecord> qw = new QueryWrapper();
|
||||
qw.eq("state","1").eq("type","0").orderByAsc("create_time");
|
||||
LambdaQueryWrapper<WlRecord> qw = new LambdaQueryWrapper();
|
||||
qw.eq(WlRecord::getState,"1").eq(WlRecord::getType,"0").orderByAsc(WlRecord::getCreateTime);
|
||||
List<WlRecord> list = this.baseMapper.selectList(qw);
|
||||
// 过滤出方案数据和测试项数据(组装成tree)
|
||||
List<WlRecord> schemes = list.stream().filter(item -> item.getPId() == null).collect(Collectors.toList());
|
||||
@@ -216,8 +204,8 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
children.setId(testItem.getId());
|
||||
children.setName(testItem.getItemName());
|
||||
children.setPId(testItem.getPId());
|
||||
children.setStartTime(LocalDateTimeUtil.format(getFirstTimeById(testItem.getId()), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
children.setEndTime(LocalDateTimeUtil.format(getLastTimeById(testItem.getId()), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
children.setStartTime(LocalDateTimeUtil.format(getFirstTimeById(testItem.getId()), DateTimeFormatter.ofPattern(DataParam.timeFormat)));
|
||||
children.setEndTime(LocalDateTimeUtil.format(getLastTimeById(testItem.getId()), DateTimeFormatter.ofPattern(DataParam.timeFormat)));
|
||||
childrens.add(children);
|
||||
}
|
||||
vo.setChildren(childrens);
|
||||
@@ -230,8 +218,8 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteRecord(String id) {
|
||||
QueryWrapper<WlRecord> qw = new QueryWrapper();
|
||||
qw.eq("id",id).eq("state","1").eq("type","0");
|
||||
LambdaQueryWrapper<WlRecord> qw = new LambdaQueryWrapper();
|
||||
qw.eq(WlRecord::getId,id).eq(WlRecord::getState,"1").eq(WlRecord::getType,"0");
|
||||
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||
if(!wlRecordList.isEmpty()){
|
||||
//首先先删除本条数据
|
||||
@@ -247,8 +235,8 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
this.baseMapper.deleteDataRecord(id,null);
|
||||
}else{
|
||||
//如果删除的是方案 那么连带方案下的所有测试项也要删除
|
||||
qw = new QueryWrapper();
|
||||
qw.eq("p_id",id).eq("state","1").eq("type","0");
|
||||
qw = new LambdaQueryWrapper();
|
||||
qw.eq(WlRecord::getPId,id).eq(WlRecord::getState,"1").eq(WlRecord::getType,"0");
|
||||
for (WlRecord wl : this.baseMapper.selectList(qw)){
|
||||
LambdaUpdateWrapper<WlRecord> uw = new LambdaUpdateWrapper<>();
|
||||
uw.set(WlRecord::getState,0)
|
||||
@@ -261,19 +249,10 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteDataRecord(WlRecordParam.UpdateRecord record) {
|
||||
if(record.getList()!=null && !record.getList().isEmpty()){
|
||||
for(String dataRecordId : record.getList()){
|
||||
this.baseMapper.deleteDataRecord(record.getId(),dataRecordId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveDataRecord(WlRecordParam.UpdateRecord record) {
|
||||
this.baseMapper.deleteDataRecord(record.getId(),null);
|
||||
if(record.getList()!=null && !record.getList().isEmpty()){
|
||||
for(String dataRecordId : record.getList()){
|
||||
this.baseMapper.saveDataRecord(record.getId(),dataRecordId);
|
||||
@@ -284,12 +263,12 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
@Override
|
||||
public List<ThdDataVO> queryCommonStatisticalByTest(CommonStatisticalQueryParam commonStatisticalQueryParam) {
|
||||
List<ThdDataVO> result = new ArrayList();
|
||||
QueryWrapper<WlRecord> qw = new QueryWrapper();
|
||||
LambdaQueryWrapper<WlRecord> qw = new LambdaQueryWrapper();
|
||||
//注意:此DevId为方案或测试项ID
|
||||
qw.eq("id",commonStatisticalQueryParam.getDevId()).eq("state","1").eq("type","0");
|
||||
qw.eq(WlRecord::getId,commonStatisticalQueryParam.getDevId()).eq(WlRecord::getState,"1").eq(WlRecord::getType,"0");
|
||||
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||
if(wlRecordList.isEmpty()){
|
||||
throw new BusinessException("DevId有误");
|
||||
throw new BusinessException(LineBaseEnum.DEVID_FAIL.getMessage());
|
||||
}
|
||||
WlRecord wlRecord = wlRecordList.get(0);
|
||||
List<WlRecord> data = new ArrayList<>();
|
||||
@@ -300,9 +279,12 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
//如果查询的是测试项 则查询该测试项下所有的关联的设备基础数据
|
||||
data = this.baseMapper.getDataRecordByTestId(wlRecord.getId(),0);
|
||||
}
|
||||
//进行时间覆盖
|
||||
|
||||
//
|
||||
//进行时间覆盖(查询的基础数据必须两个以上)
|
||||
if(data.size()>1){
|
||||
//fuseWlRecordTime(data,0);
|
||||
//fuseWlRecordTime(data,0);
|
||||
}
|
||||
//格式化前端参数
|
||||
formatQueryParamList(commonStatisticalQueryParam);
|
||||
if(commonStatisticalQueryParam.getList() != null && commonStatisticalQueryParam.getList().size() > 0){
|
||||
for (CommonStatisticalQueryParam param : commonStatisticalQueryParam.getList()){
|
||||
@@ -320,8 +302,8 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
commonQueryParam.setTableName(getTableNameByClassId(epdPqd.getClassId()));
|
||||
commonQueryParam.setColumnName(epdPqd.getName()+ (param.getFrequency() == null ? "":"_"+param.getFrequency()));
|
||||
commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||
commonQueryParam.setStartTime(LocalDateTimeUtil.format(wl.getStartTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
commonQueryParam.setEndTime(LocalDateTimeUtil.format(wl.getEndTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
commonQueryParam.setStartTime(LocalDateTimeUtil.format(wl.getStartTime(), DateTimeFormatter.ofPattern(DataParam.timeFormat)));
|
||||
commonQueryParam.setEndTime(LocalDateTimeUtil.format(wl.getEndTime(), DateTimeFormatter.ofPattern(DataParam.timeFormat)));
|
||||
commonQueryParam.setDataType(commonStatisticalQueryParam.getValueType());
|
||||
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
||||
commonQueryParam.setClDid(getClDidByLineId(temp.getLineId()));
|
||||
@@ -351,6 +333,23 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据项内的时间进行覆盖:解决多个数据项的startTime及endTime之间存在时间冲突
|
||||
* @param data 数据项
|
||||
* @param flag 覆盖规则(0:从左到右依次覆盖,1:时间范围度最大依次覆盖)
|
||||
*/
|
||||
private void fuseWlRecordTime(List<WlRecord> data,int flag){
|
||||
if(flag == 0){
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
for (int j = 0; j < data.size(); j++) {
|
||||
if(data.get(0).getEndTime().isBefore(data.get(j+1).getEndTime())){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void formatQueryParamList(CommonStatisticalQueryParam commonStatisticalQueryParam){
|
||||
List<CommonStatisticalQueryParam> list = new ArrayList<>();
|
||||
if(commonStatisticalQueryParam.getList() != null && commonStatisticalQueryParam.getList().size() > 0){
|
||||
@@ -376,7 +375,7 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
private String getTableNameByClassId(String classId){
|
||||
DictData data = dicDataFeignClient.getDicDataById(classId).getData();
|
||||
if(Objects.isNull(data)){
|
||||
throw new BusinessException("数据缺失");
|
||||
throw new BusinessException(AlgorithmResponseEnum.DATA_MISSING.getMessage());
|
||||
}
|
||||
return data.getCode();
|
||||
}
|
||||
@@ -403,12 +402,12 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
* @return
|
||||
*/
|
||||
private LocalDateTime getFirstTimeById(String testRecordId) {
|
||||
QueryWrapper<WlRecord> qw = new QueryWrapper();
|
||||
LambdaQueryWrapper<WlRecord> qw = new LambdaQueryWrapper();
|
||||
List<String> recordIds = this.baseMapper.getDataRecordBytestId(testRecordId);
|
||||
if(recordIds.isEmpty()){
|
||||
recordIds.add("-1");
|
||||
}
|
||||
qw.eq("state","1").in("id",recordIds).orderByAsc("start_Time");
|
||||
qw.eq(WlRecord::getState,"1").in(WlRecord::getId,recordIds).orderByAsc(WlRecord::getStartTime);
|
||||
List<WlRecord> list = this.baseMapper.selectList(qw);
|
||||
if(list.isEmpty()){
|
||||
return null;
|
||||
@@ -422,12 +421,12 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
* @return
|
||||
*/
|
||||
private LocalDateTime getLastTimeById(String testRecordId) {
|
||||
QueryWrapper<WlRecord> qw = new QueryWrapper();
|
||||
LambdaQueryWrapper<WlRecord> qw = new LambdaQueryWrapper();
|
||||
List<String> recordIds = this.baseMapper.getDataRecordBytestId(testRecordId);
|
||||
if(recordIds.isEmpty()){
|
||||
recordIds.add("-1");
|
||||
}
|
||||
qw.eq("state","1").in("id",recordIds).orderByDesc("end_Time");
|
||||
qw.eq(WlRecord::getState,"1").in(WlRecord::getId,recordIds).orderByAsc(WlRecord::getEndTime);
|
||||
List<WlRecord> list = this.baseMapper.selectList(qw);
|
||||
if(list.isEmpty()){
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user