方案数据修改后第二版提交
This commit is contained in:
@@ -4,6 +4,8 @@ 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
|
||||
@@ -22,6 +24,18 @@ public class WlRecordPageParam extends BaseParam {
|
||||
@ApiModelProperty(value="是否匹配测试项ID")
|
||||
private Integer isTrueFlag;
|
||||
|
||||
/**
|
||||
* 添加设备时左侧的设备或测点ID
|
||||
*/
|
||||
@ApiModelProperty(value="添加设备时左侧的设备或测点ID")
|
||||
private List<String> treeIds = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 添加测试项的时候顺便添加基础数据列表要排除临时已经添加的基础设备数据
|
||||
*/
|
||||
@ApiModelProperty(value="添加测试项的时候顺便添加基础数据列表要排除临时已经添加的基础设备数据")
|
||||
private List<String> isBandIds = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 关键字多个匹配
|
||||
*/
|
||||
|
||||
@@ -40,6 +40,12 @@ public class WlRecordParam {
|
||||
@ApiModelProperty("CT变比")
|
||||
private Integer ct;
|
||||
|
||||
@ApiModelProperty("PT变比")
|
||||
private Integer pt1;
|
||||
|
||||
@ApiModelProperty("CT变比")
|
||||
private Integer ct1;
|
||||
|
||||
@ApiModelProperty("电压等级")
|
||||
private String voltageLevel;
|
||||
|
||||
@@ -74,6 +80,9 @@ public class WlRecordParam {
|
||||
public static class AddRecord extends WlRecordParam {
|
||||
@ApiModelProperty("records")
|
||||
private List<Record> records;
|
||||
|
||||
@ApiModelProperty("方案id")
|
||||
private String id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,6 +68,16 @@ public class WlRecord extends BaseEntity {
|
||||
*/
|
||||
private Integer ct;
|
||||
|
||||
/**
|
||||
* PT变比
|
||||
*/
|
||||
private Integer pt1;
|
||||
|
||||
/**
|
||||
* CT变比
|
||||
*/
|
||||
private Integer ct1;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:方案树、测试项树、基础数据树
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2024/4/2 10:23
|
||||
*/
|
||||
@Data
|
||||
public class RecordAllDevTreeVo {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("设备名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("线路")
|
||||
private List<RecordAllLineTreeVo> children;
|
||||
|
||||
@Data
|
||||
public static class RecordAllLineTreeVo {
|
||||
|
||||
@ApiModelProperty("线路ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("线路名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,9 @@ public class RecordPageVo {
|
||||
@ApiModelProperty("基础数据id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("数据名称")
|
||||
private String itemName;
|
||||
|
||||
@ApiModelProperty("设备名称")
|
||||
private String devName;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -15,18 +14,26 @@ import java.util.List;
|
||||
@Data
|
||||
public class RecordTreeVo {
|
||||
|
||||
@ApiModelProperty("方案id")
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("方案名称")
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("测试项数据")
|
||||
private List<Children> children;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class Children extends RecordTreeVo {
|
||||
public static class Children{
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("父级ID")
|
||||
private String pId;
|
||||
|
||||
@ApiModelProperty("测试项开始时间")
|
||||
private String startTime;
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍: 测试项详情表
|
||||
@@ -15,10 +16,10 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class RecordVo {
|
||||
|
||||
@ApiModelProperty("测试项id")
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("测试项名称")
|
||||
@ApiModelProperty("名称")
|
||||
private String itemName;
|
||||
|
||||
@ApiModelProperty("数据起始时间")
|
||||
@@ -41,6 +42,12 @@ public class RecordVo {
|
||||
@ApiModelProperty("CT变比")
|
||||
private Integer ct;
|
||||
|
||||
@ApiModelProperty("PT变比")
|
||||
private Integer pt1;
|
||||
|
||||
@ApiModelProperty("CT变比")
|
||||
private Integer ct1;
|
||||
|
||||
@ApiModelProperty("电压等级")
|
||||
private String voltageLevel;
|
||||
|
||||
@@ -59,4 +66,16 @@ public class RecordVo {
|
||||
@ApiModelProperty("电压接线方式")
|
||||
private String volConType;
|
||||
|
||||
@Data
|
||||
public static class RecordItemVo{
|
||||
|
||||
@ApiModelProperty("方案名称")
|
||||
private String itemName;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String describe;
|
||||
|
||||
@ApiModelProperty("测试项")
|
||||
private List<RecordVo> records;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.njcn.csdevice.service.IMqttUserService;
|
||||
import com.njcn.csdevice.utils.ExcelStyleUtil;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.web.advice.DeviceLog;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.*;
|
||||
@@ -161,6 +162,12 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
public HttpResult<Page<CsEquipmentDeliveryVO>> list(@RequestBody CsEquipmentDeliveryQueryParm param){
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
Page<CsEquipmentDeliveryVO> page = csEquipmentDeliveryService.list(param);
|
||||
//新增逻辑(只针对便携式设备):修改设备中的未注册状态(status = 1)改为5(前端定义的字典也即未接入)
|
||||
for(CsEquipmentDeliveryVO csEquipmentDeliveryVO : page.getRecords()){
|
||||
if("8b45cf6b7f5266e777d07c166ad5fa77".equals(csEquipmentDeliveryVO.getDevType()) && csEquipmentDeliveryVO.getStatus() == 1){
|
||||
csEquipmentDeliveryVO.setStatus(5);
|
||||
}
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.njcn.csdevice.controller.scheme;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
@@ -10,11 +9,11 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.csdevice.param.WlRecordPageParam;
|
||||
import com.njcn.csdevice.pojo.param.WlRecordParam;
|
||||
import com.njcn.csdevice.pojo.po.WlRecord;
|
||||
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;
|
||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -24,7 +23,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -45,7 +43,7 @@ public class WlRecordController extends BaseController {
|
||||
private final IWlRecordService wlRecordService;
|
||||
|
||||
/**
|
||||
* 两层树方案+测试项*
|
||||
* 两层树方案+测试项
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@GetMapping("/schemeTree")
|
||||
@@ -58,25 +56,25 @@ public class WlRecordController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据测试项ID查询测试项信息*
|
||||
* 根据测试项ID查询测试项信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@GetMapping("/getTestRecordById")
|
||||
@ApiOperation("根据测试项ID查询测试项信息")
|
||||
@ApiImplicitParam(name = "testRecordId", value = "测试项ID", required = true)
|
||||
public HttpResult<RecordVo> getTestRecordById(@RequestParam @Validated String testRecordId) {
|
||||
public HttpResult<RecordVo.RecordItemVo> getTestRecordById(@RequestParam @Validated String testRecordId) {
|
||||
String methodDescribe = getMethodDescribe("getTestRecordById");
|
||||
LogUtil.njcnDebug(log, "{},测试项id为:{}", methodDescribe, testRecordId);
|
||||
RecordVo result = wlRecordService.getTestRecordById(testRecordId);
|
||||
RecordVo.RecordItemVo result = wlRecordService.getTestRecordById(testRecordId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增方案或新增测试项*
|
||||
* 新增测试项
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/addRecord")
|
||||
@ApiOperation("新增方案或新增测试项")
|
||||
@ApiOperation("新增测试项")
|
||||
@ApiImplicitParam(name = "records", value = "测试项集合", required = true)
|
||||
public HttpResult<Boolean> addRecord(@RequestBody @Validated WlRecordParam.AddRecord records) {
|
||||
String methodDescribe = getMethodDescribe("addRecord");
|
||||
@@ -86,7 +84,7 @@ public class WlRecordController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改测试项*
|
||||
* 修改测试项
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/updateTestRecord")
|
||||
@@ -100,15 +98,29 @@ public class WlRecordController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询测试项下绑定的设备列表*
|
||||
* 新增或修改方案
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/updateSchemeRecord")
|
||||
@ApiOperation("新增或修改方案")
|
||||
@ApiImplicitParam(name = "record", value = "方案对象", required = true)
|
||||
public HttpResult<Boolean> updateSchemeRecord(@RequestBody @Validated WlRecordParam.UpdateRecord record) {
|
||||
String methodDescribe = getMethodDescribe("updateSchemeRecord");
|
||||
LogUtil.njcnDebug(log, "{},新增或修改方案对象为:{}", methodDescribe, record);
|
||||
wlRecordService.updateSchemeRecord(record);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备列表
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@PostMapping("/queryPage")
|
||||
@ApiOperation("查询测试项下绑定的设备列表")
|
||||
public HttpResult<Page<RecordPageVo>> queryPage(@Validated @RequestBody WlRecordPageParam wlRecordPageParam) {
|
||||
@ApiOperation("设备列表")
|
||||
public HttpResult<Object> queryPage(@Validated @RequestBody WlRecordPageParam wlRecordPageParam) {
|
||||
String methodDescribe = getMethodDescribe("queryPage");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe);
|
||||
Page<RecordPageVo> result = wlRecordService.queryPage(wlRecordPageParam);
|
||||
Object result = wlRecordService.queryPage(wlRecordPageParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -127,24 +139,12 @@ public class WlRecordController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改方案名称
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/updateSchemeRecordName")
|
||||
@ApiOperation("修改方案名称")
|
||||
public HttpResult<List<Map>> updateSchemeRecordName(@RequestBody @Validated WlRecordParam.UpdateRecord record) {
|
||||
String methodDescribe = getMethodDescribe("updateSchemeRecordName");
|
||||
wlRecordService.updateSchemeRecordName(record);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除测试项中的设备基础数据*
|
||||
* 删除测试项中的设备基础数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/deleteDataRecord")
|
||||
@ApiOperation("删除测试项中的设备基础数据")
|
||||
public HttpResult<WlRecord> deleteDataRecord(@RequestBody @Validated WlRecordParam.UpdateRecord record) {
|
||||
public HttpResult<Boolean> deleteDataRecord(@RequestBody @Validated WlRecordParam.UpdateRecord record) {
|
||||
String methodDescribe = getMethodDescribe("deleteDataRecord");
|
||||
LogUtil.njcnDebug(log, "{},测试项及基础数据ID为:{}", methodDescribe, record);
|
||||
wlRecordService.deleteDataRecord(record);
|
||||
@@ -152,27 +152,28 @@ public class WlRecordController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加测试项中的设备基础数据*
|
||||
* 添加测试项中的设备基础数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/saveDataRecord")
|
||||
@ApiOperation("添加测试项中的设备基础数据")
|
||||
public HttpResult<WlRecord> saveDataRecord(@RequestBody @Validated WlRecordParam.UpdateRecord record) {
|
||||
public HttpResult<Boolean> saveDataRecord(@RequestBody @Validated WlRecordParam.UpdateRecord record) {
|
||||
String methodDescribe = getMethodDescribe("saveDataRecord");
|
||||
LogUtil.njcnDebug(log, "{},测试项及基础数据ID为:{}", methodDescribe, record);
|
||||
LogUtil.njcnDebug(log, "{},测试项及基础数据对象为:{}", methodDescribe, record);
|
||||
wlRecordService.saveDataRecord(record);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 方案下拉框*
|
||||
* 查询测试项时间段实时数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@GetMapping("/schemeRecordDown")
|
||||
@ApiOperation("方案下拉框")
|
||||
public HttpResult<List<Map>> schemeRecordDown() {
|
||||
String methodDescribe = getMethodDescribe("schemeRecordDown");
|
||||
List<Map> result = wlRecordService.schemeRecordDown();
|
||||
@PostMapping("/queryCommonStatisticalByTest")
|
||||
@ApiOperation("查询测试项时间段实时数据")
|
||||
public HttpResult<List<ThdDataVO>> queryCommonStatisticalByTest(@RequestBody @Validated CommonStatisticalQueryParam commonStatisticalQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("queryCommonStatisticalByTest");
|
||||
LogUtil.njcnDebug(log, "{},查询对象为:{}", methodDescribe, commonStatisticalQueryParam);
|
||||
List<ThdDataVO> result = wlRecordService.queryCommonStatisticalByTest(commonStatisticalQueryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ 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.RecordAllDevTreeVo;
|
||||
import com.njcn.csdevice.pojo.vo.RecordPageVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -40,8 +40,13 @@ public interface WlRecordMapper extends BaseMapper<WlRecord> {
|
||||
List<String> getDataRecordBytestId(@Param("testRecordId") String testRecordId);
|
||||
|
||||
/**
|
||||
* 方案下拉框
|
||||
* 组装测试项表的tree
|
||||
*/
|
||||
List<Map> schemeRecordDown();
|
||||
List<RecordAllDevTreeVo> getRecordAll();
|
||||
List<RecordAllDevTreeVo.RecordAllLineTreeVo> getRecordAllLine(@Param("devId") String devId);
|
||||
|
||||
/**
|
||||
* 根据测试项ID或方案ID获取其下关联的所有设备基础数据信息
|
||||
*/
|
||||
List<WlRecord> getDataRecordByTestId(@Param("testRecordId") String testRecordId,@Param("flag") Integer flag);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<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,
|
||||
@@ -16,18 +17,47 @@
|
||||
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.id != null and wlRecordPageParam.isTrueFlag == 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.id != null and wlRecordPageParam.isTrueFlag == 0">
|
||||
<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.dev_id in
|
||||
<foreach collection="wlRecordPageParam.treeIds" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
or a.line_id in
|
||||
<foreach collection="wlRecordPageParam.treeIds" 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.mac like concat('%',#{wlRecordPageParam.searchText},'%')
|
||||
or b.ndid like concat('%',#{wlRecordPageParam.searchText},'%'))
|
||||
or b.item_name like concat('%',#{wlRecordPageParam.searchText},'%'))
|
||||
</if>
|
||||
order by a.start_time desc
|
||||
<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">
|
||||
@@ -47,7 +77,30 @@
|
||||
select data_id from wl_record_test_data where test_item_id = #{testRecordId};
|
||||
</select>
|
||||
|
||||
<select id="schemeRecordDown" resultType="map">
|
||||
select item_name name,item_name value from wl_record where type = 0 and state = 1 and p_id is null order by create_time
|
||||
<select id="getRecordAll" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo">
|
||||
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
|
||||
group by a.dev_id,b.name having a.dev_id is not null and b.name is not null
|
||||
</select>
|
||||
|
||||
<select id="getRecordAllLine" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllLineTreeVo">
|
||||
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
|
||||
where a.type=1 and a.state =1 and a.dev_id=#{devId}
|
||||
group by a.line_id,c.name having a.line_id is not null and c.name is not null
|
||||
</select>
|
||||
|
||||
<select id="getDataRecordByTestId" resultType="com.njcn.csdevice.pojo.po.WlRecord">
|
||||
select * from wl_record b where b.id in (
|
||||
select data_id from wl_record_test_data where
|
||||
<if test="flag == 1">
|
||||
test_item_id in (select a.id from wl_record a where a.p_id = #{testRecordId})
|
||||
</if>
|
||||
<if test="flag == 0">
|
||||
test_item_id = #{testRecordId}
|
||||
</if>
|
||||
)
|
||||
order by dev_id
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,15 +1,14 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.param.WlRecordPageParam;
|
||||
import com.njcn.csdevice.pojo.param.WlRecordParam;
|
||||
import com.njcn.csdevice.pojo.po.WlRecord;
|
||||
import com.njcn.csdevice.pojo.vo.RecordPageVo;
|
||||
import com.njcn.csdevice.pojo.vo.RecordTreeVo;
|
||||
import com.njcn.csdevice.pojo.vo.RecordVo;
|
||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -33,10 +32,10 @@ public interface IWlRecordService extends IService<WlRecord> {
|
||||
* @param testRecordId
|
||||
* @return
|
||||
*/
|
||||
RecordVo getTestRecordById(String testRecordId);
|
||||
RecordVo.RecordItemVo getTestRecordById(String testRecordId);
|
||||
|
||||
/**
|
||||
* 新增方案或新增测试项
|
||||
* 新增测试项
|
||||
* @param records
|
||||
* @return
|
||||
*/
|
||||
@@ -49,13 +48,19 @@ public interface IWlRecordService extends IService<WlRecord> {
|
||||
*/
|
||||
void updateTestRecord(WlRecordParam.UpdateRecord record);
|
||||
|
||||
/**
|
||||
* 新增或修改方案
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
void updateSchemeRecord(WlRecordParam.UpdateRecord record);
|
||||
|
||||
/**
|
||||
* 查询测试项下绑定的设备列表
|
||||
* 设备列表
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
Page<RecordPageVo> queryPage(WlRecordPageParam wlRecordPageParam);
|
||||
Object queryPage(WlRecordPageParam wlRecordPageParam);
|
||||
|
||||
/**
|
||||
* 删除测试项或方案
|
||||
@@ -64,13 +69,6 @@ public interface IWlRecordService extends IService<WlRecord> {
|
||||
*/
|
||||
void deleteRecord(String id);
|
||||
|
||||
/**
|
||||
* 修改方案名称
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
void updateSchemeRecordName(WlRecordParam.UpdateRecord record);
|
||||
|
||||
/**
|
||||
* 删除测试项中的设备基础数据
|
||||
* @return
|
||||
@@ -84,10 +82,9 @@ public interface IWlRecordService extends IService<WlRecord> {
|
||||
void saveDataRecord(WlRecordParam.UpdateRecord record);
|
||||
|
||||
/**
|
||||
* 方案下拉框
|
||||
* 查询测试项时间段实时数据
|
||||
* @return
|
||||
*/
|
||||
List<Map> schemeRecordDown();
|
||||
|
||||
List<ThdDataVO> queryCommonStatisticalByTest(CommonStatisticalQueryParam commonStatisticalQueryParam);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,23 +8,43 @@ 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.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.mapper.WlRecordMapper;
|
||||
import com.njcn.csdevice.param.WlRecordPageParam;
|
||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||
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;
|
||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.service.CommonService;
|
||||
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -35,28 +55,32 @@ import java.util.stream.Collectors;
|
||||
* @since 2024-04-01
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> implements IWlRecordService {
|
||||
|
||||
private final EquipmentFeignClient equipmentFeignClient;
|
||||
|
||||
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final CsLineFeignClient csLineFeignClient;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final DecimalFormat df = new DecimalFormat("#0.0000");
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addRecord(WlRecordParam.AddRecord records) {
|
||||
//整理的方案下测试项集合(可能添加多个测试项)
|
||||
List<WlRecord> insertList = new ArrayList<>();
|
||||
//整理单独的方案
|
||||
WlRecord wlRecord = new WlRecord();
|
||||
//校验方案ID是否存在
|
||||
QueryWrapper<WlRecord> qw = new QueryWrapper();
|
||||
qw.eq("item_name",records.getItemName()).eq("type",0).eq("state",1);
|
||||
qw.eq("id",records.getId()).eq("type",0).eq("state",1);
|
||||
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||
//如果当前新增的方案名称已存在的话则测试项直接绑定已存在的方案
|
||||
if(!wlRecordList.isEmpty()){
|
||||
wlRecord.setId(wlRecordList.get(0).getId());
|
||||
}else{
|
||||
//否则新增方案
|
||||
BeanUtils.copyProperties(records, wlRecord);
|
||||
wlRecord.setId(IdUtil.simpleUUID());
|
||||
wlRecord.setType(0);
|
||||
wlRecord.setState(1);
|
||||
this.save(wlRecord);
|
||||
if(wlRecordList.isEmpty() && wlRecordList.get(0).getPId()!=null){
|
||||
throw new BusinessException("方案ID不存在");
|
||||
}
|
||||
//便利测试项
|
||||
records.getRecords().forEach(item->{
|
||||
@@ -65,7 +89,7 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
BeanUtils.copyProperties(item, record);
|
||||
record.setId(id);
|
||||
//当前测试项绑定当前方案
|
||||
record.setPId(wlRecord.getId());
|
||||
record.setPId(records.getId());
|
||||
record.setType(0);
|
||||
record.setState(1);
|
||||
insertList.add(record);
|
||||
@@ -80,40 +104,99 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
|
||||
@Override
|
||||
public void updateTestRecord(WlRecordParam.UpdateRecord record) {
|
||||
List<WlRecord> updateList = new ArrayList<>();
|
||||
WlRecord wlRecord = new WlRecord();
|
||||
BeanUtils.copyProperties(record, wlRecord);
|
||||
this.updateById(wlRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecordVo getTestRecordById(String testRecordId) {
|
||||
RecordVo recordVo = new RecordVo();
|
||||
public void updateSchemeRecord(WlRecordParam.UpdateRecord record) {
|
||||
WlRecord wlRecord = new WlRecord();
|
||||
if(record.getId()!=null){
|
||||
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);
|
||||
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||
//方案名称重复校验
|
||||
if(!wlRecordList.isEmpty()){
|
||||
throw new BusinessException("方案名称已存在");
|
||||
}
|
||||
BeanUtils.copyProperties(record, wlRecord);
|
||||
wlRecord.setId(IdUtil.simpleUUID());
|
||||
wlRecord.setType(0);
|
||||
wlRecord.setState(1);
|
||||
this.save(wlRecord);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
List<WlRecord> list = this.baseMapper.selectList(qw);
|
||||
if(list.isEmpty()){
|
||||
throw new BusinessException("测试项ID有误");
|
||||
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);
|
||||
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||
recordItemVo.setDescribe(wlRecordList.get(0).getDescribe());
|
||||
recordItemVo.setItemName(wlRecordList.get(0).getItemName());
|
||||
RecordVo recordVo = new RecordVo();
|
||||
wlRecord.setStartTime(getFirstTimeById(wlRecord.getId()));
|
||||
wlRecord.setEndTime(getLastTimeById(wlRecord.getId()));
|
||||
BeanUtils.copyProperties(wlRecord, recordVo);
|
||||
return recordVo;
|
||||
recordVoList.add(recordVo);
|
||||
}else{
|
||||
//反之则是方案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");;
|
||||
for (WlRecord wl : this.baseMapper.selectList(qw)){
|
||||
RecordVo recordVo = new RecordVo();
|
||||
wl.setStartTime(getFirstTimeById(wlRecord.getId()));
|
||||
wl.setEndTime(getLastTimeById(wlRecord.getId()));
|
||||
BeanUtils.copyProperties(wl, recordVo);
|
||||
recordVoList.add(recordVo);
|
||||
}
|
||||
}
|
||||
recordItemVo.setRecords(recordVoList);
|
||||
return recordItemVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<RecordPageVo> queryPage(WlRecordPageParam wlRecordPageParam) {
|
||||
Page<RecordPageVo> returnpage = new Page<> (wlRecordPageParam.getPageNum(), wlRecordPageParam.getPageSize ( ));
|
||||
public Object queryPage(WlRecordPageParam wlRecordPageParam) {
|
||||
if(wlRecordPageParam.getIsTrueFlag()!=1 && wlRecordPageParam.getTreeIds().isEmpty()){
|
||||
//组装tree
|
||||
List<RecordAllDevTreeVo> recordAllDevTreeVos = this.baseMapper.getRecordAll();
|
||||
for (RecordAllDevTreeVo recordAllDevTreeVo : recordAllDevTreeVos){
|
||||
List<RecordAllDevTreeVo.RecordAllLineTreeVo> recordAllLineTreeVos = this.baseMapper.getRecordAllLine(recordAllDevTreeVo.getId());
|
||||
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");
|
||||
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");
|
||||
qw.eq("state","1").eq("type","0").orderByAsc("create_time");
|
||||
List<WlRecord> list = this.baseMapper.selectList(qw);
|
||||
// 过滤出方案数据和测试项数据(组装成tree)
|
||||
List<WlRecord> schemes = list.stream().filter(item -> item.getPId() == null).collect(Collectors.toList());
|
||||
@@ -129,6 +212,7 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
RecordTreeVo.Children children = new RecordTreeVo.Children();
|
||||
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")));
|
||||
childrens.add(children);
|
||||
@@ -171,37 +255,118 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSchemeRecordName(WlRecordParam.UpdateRecord record) {
|
||||
LambdaUpdateWrapper<WlRecord> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.set(WlRecord::getItemName,record.getItemName()).set(WlRecord::getDescribe,record.getDescribe())
|
||||
.eq(WlRecord::getId, record.getId())
|
||||
.eq(WlRecord::getType, 0);
|
||||
this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
@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) {
|
||||
if(record.getList()!=null && !record.getList().isEmpty()){
|
||||
for(String dataRecordId : record.getList()){
|
||||
this.baseMapper.saveDataRecord(record.getId(),dataRecordId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> schemeRecordDown() {
|
||||
return this.baseMapper.schemeRecordDown();
|
||||
public List<ThdDataVO> queryCommonStatisticalByTest(CommonStatisticalQueryParam commonStatisticalQueryParam) {
|
||||
List<ThdDataVO> result = new ArrayList();
|
||||
QueryWrapper<WlRecord> qw = new QueryWrapper();
|
||||
//注意:此DevId为方案或测试项ID
|
||||
qw.eq("id",commonStatisticalQueryParam.getDevId()).eq("state","1").eq("type","0");
|
||||
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||
if(wlRecordList.isEmpty()){
|
||||
throw new BusinessException("DevId有误");
|
||||
}
|
||||
WlRecord wlRecord = wlRecordList.get(0);
|
||||
List<WlRecord> data = new ArrayList<>();
|
||||
if(wlRecord.getPId() == null){
|
||||
//如果查询的是方案 则查询该方案下所有的测试项关联的设备基础数据
|
||||
data = this.baseMapper.getDataRecordByTestId(wlRecord.getId(),1);
|
||||
}else{
|
||||
//如果查询的是测试项 则查询该测试项下所有的关联的设备基础数据
|
||||
data = this.baseMapper.getDataRecordByTestId(wlRecord.getId(),0);
|
||||
}
|
||||
//进行时间覆盖
|
||||
|
||||
//开始组装查询数据对象
|
||||
String frequency = Optional.ofNullable(commonStatisticalQueryParam.getFrequency()).orElse("");
|
||||
for(WlRecord wl : data){
|
||||
//根据设备ID获取设备基础信息
|
||||
List<String> ids = new ArrayList();
|
||||
ids.add(wl.getLineId());
|
||||
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(ids).getData();
|
||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(wl.getDevId()).collect(Collectors.toList())).getData();
|
||||
//获取指标下的相别
|
||||
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(commonStatisticalQueryParam.getStatisticalId()).getData();
|
||||
List<CommonQueryParam> commonQueryParams = new ArrayList<>();
|
||||
for(EleEpdPqd epdPqd : eleEpdPqds){
|
||||
commonQueryParams.clear();
|
||||
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||
commonQueryParam.setLineId(wl.getLineId());
|
||||
commonQueryParam.setTableName(getTableNameByClassId(epdPqd.getClassId()));
|
||||
commonQueryParam.setColumnName(epdPqd.getName()+ frequency);
|
||||
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.setDataType(commonStatisticalQueryParam.getValueType());
|
||||
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
||||
commonQueryParam.setClDid(getClDidByLineId(wl.getLineId()));
|
||||
commonQueryParams.add(commonQueryParam);
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||
ThdDataVO vo = new ThdDataVO();
|
||||
vo.setLineId(temp.getLineId());
|
||||
vo.setPhase(temp.getPhaseType());
|
||||
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(wl.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||
vo.setPosition(position);
|
||||
vo.setTime(temp.getTime());
|
||||
vo.setStatMethod(temp.getValueType());
|
||||
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||
vo.setStatisticalIndex(epdPqd.getId());
|
||||
vo.setUnit(epdPqd.getUnit());
|
||||
vo.setStatisticalName(epdPqd.getName());
|
||||
vo.setAnotherName(epdPqd.getShowName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
result.addAll(collect1);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*表名换成了id本方法做转换*/
|
||||
private String getTableNameByClassId(String classId){
|
||||
DictData data = dicDataFeignClient.getDicDataById(classId).getData();
|
||||
if(Objects.isNull(data)){
|
||||
throw new BusinessException("数据缺失");
|
||||
}
|
||||
return data.getCode();
|
||||
}
|
||||
private String getClDidByLineId(String lineId){
|
||||
String position = csLineFeignClient.getPositionById(lineId).getData();
|
||||
if (Objects.isNull(position)){
|
||||
throw new BusinessException(AlgorithmResponseEnum.POSITION_ERROR);
|
||||
}
|
||||
String clDid = null;
|
||||
String areaCode = dicDataFeignClient.getDicDataById(position).getData().getCode();
|
||||
if (Objects.equals(areaCode, DicDataEnum.OUTPUT_SIDE.getCode())){
|
||||
clDid = "0";
|
||||
} else if (Objects.equals(areaCode, DicDataEnum.GRID_SIDE.getCode())){
|
||||
clDid = "1";
|
||||
} else if (Objects.equals(areaCode, DicDataEnum.LOAD_SIDE.getCode())){
|
||||
clDid = "2";
|
||||
}
|
||||
return clDid;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user