1.完善模板解析功能
This commit is contained in:
@@ -44,11 +44,11 @@ public class EpdPqdDto implements Serializable {
|
|||||||
|
|
||||||
@SerializedName("HarmStart")
|
@SerializedName("HarmStart")
|
||||||
@ApiModelProperty("数据开始谐波次数")
|
@ApiModelProperty("数据开始谐波次数")
|
||||||
private Integer harmStart;
|
private Double harmStart;
|
||||||
|
|
||||||
@SerializedName("HarmEnd")
|
@SerializedName("HarmEnd")
|
||||||
@ApiModelProperty("数据结束谐波次数")
|
@ApiModelProperty("数据结束谐波次数")
|
||||||
private Integer harmEnd;
|
private Double harmEnd;
|
||||||
|
|
||||||
@SerializedName("StatMethod")
|
@SerializedName("StatMethod")
|
||||||
@ApiModelProperty("数据统计方法(max,min,avg,cp95)")
|
@ApiModelProperty("数据统计方法(max,min,avg,cp95)")
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -36,6 +37,7 @@ import java.util.List;
|
|||||||
@RequestMapping("/csDataArray")
|
@RequestMapping("/csDataArray")
|
||||||
@Api(tags = "终端详细数据集")
|
@Api(tags = "终端详细数据集")
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@ApiIgnore
|
||||||
public class CsDataArrayController extends BaseController {
|
public class CsDataArrayController extends BaseController {
|
||||||
|
|
||||||
private final ICsDataArrayService csDataArrayService;
|
private final ICsDataArrayService csDataArrayService;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -36,6 +37,7 @@ import java.util.List;
|
|||||||
@RequestMapping("/csDataSet")
|
@RequestMapping("/csDataSet")
|
||||||
@Api(tags = "终端数据集")
|
@Api(tags = "终端数据集")
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@ApiIgnore
|
||||||
public class CsDataSetController extends BaseController {
|
public class CsDataSetController extends BaseController {
|
||||||
|
|
||||||
private final ICsDataSetService csDataSetService;
|
private final ICsDataSetService csDataSetService;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.access.controller;
|
package com.njcn.access.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.njcn.access.pojo.param.DevModelParam;
|
import com.njcn.access.pojo.param.DevModelParam;
|
||||||
import com.njcn.access.service.ICsDevModelService;
|
import com.njcn.access.service.ICsDevModelService;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
@@ -7,6 +8,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.api.CsGroupFeignClient;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -18,6 +20,8 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类的介绍:
|
* 类的介绍:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.njcn.access.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.access.service.ICsGroArrService;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.common.utils.LogUtil;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsGroArr;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 组和指标关系表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-06-19
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/csGroArr")
|
||||||
|
@Api(tags = "组和指标关系")
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiIgnore
|
||||||
|
public class CsGroArrController extends BaseController {
|
||||||
|
|
||||||
|
private final ICsGroArrService csGroArrService;
|
||||||
|
|
||||||
|
@PostMapping("/add")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("新增组和指标关系")
|
||||||
|
@ApiImplicitParam(name = "csGroArr", value = "分组信息", required = true)
|
||||||
|
public HttpResult<String> add(@RequestBody CsGroArr csGroArr) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LogUtil.njcnDebug(log, "{},分组信息为:{}", methodDescribe, csGroArr);
|
||||||
|
csGroArrService.addGroArr(csGroArr);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/addList")
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@ApiOperation("批量新增组和指标关系")
|
||||||
|
@ApiImplicitParam(name = "list", value = "分组信息集合", required = true)
|
||||||
|
public HttpResult<String> addList(@RequestBody List<CsGroArr> list) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateGroArr");
|
||||||
|
LogUtil.njcnDebug(log, "{},分组信息为:{}", methodDescribe, list);
|
||||||
|
csGroArrService.addGroArrList(list);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.njcn.access.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.access.service.ICsGroupService;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsGroup;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据分组表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-06-16
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/csGroup")
|
||||||
|
@Api(tags = "指标分组")
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiIgnore
|
||||||
|
public class CsGroupController extends BaseController {
|
||||||
|
|
||||||
|
private final ICsGroupService csGroupService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增分组")
|
||||||
|
@ApiImplicitParam(name = "csGroup", value = "组数据", required = true)
|
||||||
|
public HttpResult<String> add(@RequestBody CsGroup csGroup){
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
csGroupService.add(csGroup);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/addList")
|
||||||
|
@ApiOperation("批量新增分组")
|
||||||
|
@ApiImplicitParam(name = "list", value = "组集合", required = true)
|
||||||
|
public HttpResult<String> addList(@RequestBody List<CsGroup> list){
|
||||||
|
String methodDescribe = getMethodDescribe("addList");
|
||||||
|
csGroupService.addList(list);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -34,6 +35,7 @@ import java.util.List;
|
|||||||
@RequestMapping("/csLineModel")
|
@RequestMapping("/csLineModel")
|
||||||
@Api(tags = "监测点模板")
|
@Api(tags = "监测点模板")
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@ApiIgnore
|
||||||
public class CsLineModelController extends BaseController {
|
public class CsLineModelController extends BaseController {
|
||||||
|
|
||||||
private final ICsLineModelService csLineModelService;
|
private final ICsLineModelService csLineModelService;
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.access.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsGroArr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 组和指标关系表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-06-19
|
||||||
|
*/
|
||||||
|
public interface CsGroArrMapper extends BaseMapper<CsGroArr> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.access.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据分组表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-06-16
|
||||||
|
*/
|
||||||
|
public interface CsGroupMapper extends BaseMapper<CsGroup> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@ package com.njcn.access.service;
|
|||||||
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类的介绍:
|
* 类的介绍:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.access.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.csdevice.pojo.param.GroupArrParam;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsGroArr;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 组和指标关系表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-06-19
|
||||||
|
*/
|
||||||
|
public interface ICsGroArrService extends IService<CsGroArr> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增组和指标关系
|
||||||
|
* @param csGroArr 组和指标关系
|
||||||
|
*/
|
||||||
|
void addGroArr(CsGroArr csGroArr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增组和指标关系
|
||||||
|
* @param csGroArr 组和指标关系
|
||||||
|
*/
|
||||||
|
void addGroArrList(List<CsGroArr> csGroArr);
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.access.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.csdevice.pojo.param.EnergyBaseParam;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsGroup;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据分组表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-06-16
|
||||||
|
*/
|
||||||
|
public interface ICsGroupService extends IService<CsGroup> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增组数据
|
||||||
|
* @param csGroup
|
||||||
|
*/
|
||||||
|
void add(CsGroup csGroup);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增组数据
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
|
void addList(List<CsGroup> list);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,53 +3,40 @@ package com.njcn.access.service.impl;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.njcn.access.enums.AccessResponseEnum;
|
import com.njcn.access.enums.AccessResponseEnum;
|
||||||
import com.njcn.access.enums.DataModel;
|
import com.njcn.access.enums.DataModel;
|
||||||
import com.njcn.access.enums.TypeEnum;
|
|
||||||
import com.njcn.access.mapper.CsDevModelMapper;
|
import com.njcn.access.mapper.CsDevModelMapper;
|
||||||
import com.njcn.access.pojo.dto.data.*;
|
import com.njcn.access.pojo.dto.data.*;
|
||||||
import com.njcn.access.pojo.dto.devModel.*;
|
import com.njcn.access.pojo.dto.devModel.*;
|
||||||
import com.njcn.access.pojo.po.CsDataArrayPO;
|
import com.njcn.access.pojo.po.CsDataArrayPO;
|
||||||
import com.njcn.access.pojo.po.CsDataSetPO;
|
import com.njcn.access.pojo.po.CsDataSetPO;
|
||||||
import com.njcn.access.pojo.po.CsLineModel;
|
import com.njcn.access.pojo.po.CsLineModel;
|
||||||
import com.njcn.access.service.ICsDataArrayService;
|
import com.njcn.access.service.*;
|
||||||
import com.njcn.access.service.ICsDataSetService;
|
|
||||||
import com.njcn.access.service.ICsDevModelService;
|
|
||||||
import com.njcn.access.service.ICsLineModelService;
|
|
||||||
import com.njcn.access.utils.JsonUtil;
|
import com.njcn.access.utils.JsonUtil;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.utils.LogUtil;
|
|
||||||
import com.njcn.csdevice.api.DevModelFeignClient;
|
import com.njcn.csdevice.api.DevModelFeignClient;
|
||||||
import com.njcn.csdevice.pojo.param.CsDevModelAddParm;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsDevModelPO;
|
import com.njcn.csdevice.pojo.po.CsDevModelPO;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsGroArr;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsGroup;
|
||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.api.DictTreeFeignClient;
|
|
||||||
import com.njcn.system.api.EleEvtFeignClient;
|
import com.njcn.system.api.EleEvtFeignClient;
|
||||||
import com.njcn.system.api.EpdFeignClient;
|
import com.njcn.system.api.EpdFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||||
import com.njcn.system.pojo.param.EleEvtParam;
|
import com.njcn.system.pojo.param.EleEvtParam;
|
||||||
import com.njcn.system.pojo.po.Dic;
|
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.cloud.client.ConditionalOnBlockingDiscoveryEnabled;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.Date;
|
import java.sql.Date;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类的介绍:
|
* 类的介绍:
|
||||||
@@ -81,6 +68,10 @@ public class CsDevModelServiceImpl implements ICsDevModelService {
|
|||||||
|
|
||||||
private final ICsLineModelService csLineModelService;
|
private final ICsLineModelService csLineModelService;
|
||||||
|
|
||||||
|
private final ICsGroupService csGroupService;
|
||||||
|
|
||||||
|
private final ICsGroArrService csGroArrService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public void addModel(MultipartFile file) {
|
public void addModel(MultipartFile file) {
|
||||||
@@ -630,6 +621,37 @@ public class CsDevModelServiceImpl implements ICsDevModelService {
|
|||||||
}
|
}
|
||||||
if(CollectionUtil.isNotEmpty(arrayList)) {
|
if(CollectionUtil.isNotEmpty(arrayList)) {
|
||||||
csDataArrayService.addList(arrayList);
|
csDataArrayService.addList(arrayList);
|
||||||
|
List<CsGroup> ls = new ArrayList<>();
|
||||||
|
List<CsGroArr> groArrList = new ArrayList<>();
|
||||||
|
Map<String,List<CsDataArrayPO>> setMap = arrayList.stream().collect(Collectors.groupingBy(CsDataArrayPO::getPid,LinkedHashMap::new,Collectors.toList()));
|
||||||
|
setMap.forEach((k0,v0)->{
|
||||||
|
AtomicReference<Integer> sort = new AtomicReference<>(0);
|
||||||
|
Map<String,List<CsDataArrayPO>> map = v0.stream().filter(a-> "avg".equals(a.getStatMethod()) || Objects.isNull(a.getStatMethod())).collect(Collectors.groupingBy(CsDataArrayPO::getAnotherName,LinkedHashMap::new,Collectors.toList()));
|
||||||
|
map.forEach((k,v)->{
|
||||||
|
//录入组数据
|
||||||
|
String groupId = IdUtil.simpleUUID();
|
||||||
|
CsGroup csGroup = new CsGroup();
|
||||||
|
csGroup.setId(groupId);
|
||||||
|
csGroup.setDataSetId(k0);
|
||||||
|
csGroup.setGroupName(k);
|
||||||
|
csGroup.setSort(sort.getAndSet(sort.get() + 1));
|
||||||
|
csGroup.setIsShow(1);
|
||||||
|
ls.add(csGroup);
|
||||||
|
//录入组和指标关系
|
||||||
|
v.forEach(item->{
|
||||||
|
CsGroArr csGroArr = new CsGroArr();
|
||||||
|
csGroArr.setGroupId(groupId);
|
||||||
|
csGroArr.setArrayId(item.getId());
|
||||||
|
groArrList.add(csGroArr);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if(CollectionUtil.isNotEmpty(ls)) {
|
||||||
|
csGroupService.addList(ls);
|
||||||
|
}
|
||||||
|
if(CollectionUtil.isNotEmpty(groArrList)) {
|
||||||
|
csGroArrService.addGroArrList(groArrList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -743,30 +765,59 @@ public class CsDevModelServiceImpl implements ICsDevModelService {
|
|||||||
throw new BusinessException(AccessResponseEnum.DICT_MISSING);
|
throw new BusinessException(AccessResponseEnum.DICT_MISSING);
|
||||||
}
|
}
|
||||||
if (!Objects.isNull(eleEpdPqd.getHarmStart()) && !Objects.isNull(eleEpdPqd.getHarmEnd())){
|
if (!Objects.isNull(eleEpdPqd.getHarmStart()) && !Objects.isNull(eleEpdPqd.getHarmEnd())){
|
||||||
for (int i = eleEpdPqd.getHarmStart(); i <= eleEpdPqd.getHarmEnd(); i++) {
|
if (Objects.equals(eleEpdPqd.getHarmStart(),1)){
|
||||||
if (!Objects.isNull(eleEpdPqd.getStatMethod())){
|
for (int i = eleEpdPqd.getHarmStart(); i <= eleEpdPqd.getHarmEnd(); i++) {
|
||||||
String[] statMethodList = eleEpdPqd.getStatMethod().split(",");
|
if (!Objects.isNull(eleEpdPqd.getStatMethod())){
|
||||||
for (String stat : statMethodList) {
|
String[] statMethodList = eleEpdPqd.getStatMethod().split(",");
|
||||||
|
for (String stat : statMethodList) {
|
||||||
|
CsDataArrayPO csDataArrayPo = new CsDataArrayPO();
|
||||||
|
csDataArrayPo.setPid(pid);
|
||||||
|
csDataArrayPo.setDataId(eleEpdPqd.getId());
|
||||||
|
csDataArrayPo.setName(eleEpdPqd.getName() + "_" + i);
|
||||||
|
csDataArrayPo.setAnotherName((i-0.5) + "次" +eleEpdPqd.getShowName());
|
||||||
|
csDataArrayPo.setStatMethod(stat);
|
||||||
|
csDataArrayPo.setDataType(eleEpdPqd.getDataType());
|
||||||
|
csDataArrayPo.setPhase(eleEpdPqd.getPhase());
|
||||||
|
list.add(csDataArrayPo);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
CsDataArrayPO csDataArrayPo = new CsDataArrayPO();
|
||||||
|
csDataArrayPo.setPid(pid);
|
||||||
|
csDataArrayPo.setDataId(eleEpdPqd.getId());
|
||||||
|
csDataArrayPo.setName(eleEpdPqd.getName() + "_" + i);
|
||||||
|
csDataArrayPo.setAnotherName((i-0.5) + "次" +eleEpdPqd.getShowName());
|
||||||
|
csDataArrayPo.setStatMethod(eleEpdPqd.getStatMethod());
|
||||||
|
csDataArrayPo.setDataType(eleEpdPqd.getDataType());
|
||||||
|
csDataArrayPo.setPhase(eleEpdPqd.getPhase());
|
||||||
|
list.add(csDataArrayPo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (int i = eleEpdPqd.getHarmStart(); i <= eleEpdPqd.getHarmEnd(); i++) {
|
||||||
|
if (!Objects.isNull(eleEpdPqd.getStatMethod())){
|
||||||
|
String[] statMethodList = eleEpdPqd.getStatMethod().split(",");
|
||||||
|
for (String stat : statMethodList) {
|
||||||
|
CsDataArrayPO csDataArrayPo = new CsDataArrayPO();
|
||||||
|
csDataArrayPo.setPid(pid);
|
||||||
|
csDataArrayPo.setDataId(eleEpdPqd.getId());
|
||||||
|
csDataArrayPo.setName(eleEpdPqd.getName() + "_" + i);
|
||||||
|
csDataArrayPo.setAnotherName(i + "次" +eleEpdPqd.getShowName());
|
||||||
|
csDataArrayPo.setStatMethod(stat);
|
||||||
|
csDataArrayPo.setDataType(eleEpdPqd.getDataType());
|
||||||
|
csDataArrayPo.setPhase(eleEpdPqd.getPhase());
|
||||||
|
list.add(csDataArrayPo);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
CsDataArrayPO csDataArrayPo = new CsDataArrayPO();
|
CsDataArrayPO csDataArrayPo = new CsDataArrayPO();
|
||||||
csDataArrayPo.setPid(pid);
|
csDataArrayPo.setPid(pid);
|
||||||
csDataArrayPo.setDataId(eleEpdPqd.getId());
|
csDataArrayPo.setDataId(eleEpdPqd.getId());
|
||||||
csDataArrayPo.setName(eleEpdPqd.getName() + "_" + i);
|
csDataArrayPo.setName(eleEpdPqd.getName() + "_" + i);
|
||||||
csDataArrayPo.setAnotherName(i + "次" +eleEpdPqd.getShowName());
|
csDataArrayPo.setAnotherName(i + "次" +eleEpdPqd.getShowName());
|
||||||
csDataArrayPo.setStatMethod(stat);
|
csDataArrayPo.setStatMethod(eleEpdPqd.getStatMethod());
|
||||||
csDataArrayPo.setDataType(eleEpdPqd.getDataType());
|
csDataArrayPo.setDataType(eleEpdPqd.getDataType());
|
||||||
csDataArrayPo.setPhase(eleEpdPqd.getPhase());
|
csDataArrayPo.setPhase(eleEpdPqd.getPhase());
|
||||||
list.add(csDataArrayPo);
|
list.add(csDataArrayPo);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
CsDataArrayPO csDataArrayPo = new CsDataArrayPO();
|
|
||||||
csDataArrayPo.setPid(pid);
|
|
||||||
csDataArrayPo.setDataId(eleEpdPqd.getId());
|
|
||||||
csDataArrayPo.setName(eleEpdPqd.getName() + "_" + i);
|
|
||||||
csDataArrayPo.setAnotherName(i + "次" +eleEpdPqd.getShowName());
|
|
||||||
csDataArrayPo.setStatMethod(eleEpdPqd.getStatMethod());
|
|
||||||
csDataArrayPo.setDataType(eleEpdPqd.getDataType());
|
|
||||||
csDataArrayPo.setPhase(eleEpdPqd.getPhase());
|
|
||||||
list.add(csDataArrayPo);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -828,6 +879,8 @@ public class CsDevModelServiceImpl implements ICsDevModelService {
|
|||||||
result.add(csLineModel);
|
result.add(csLineModel);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
csLineModelService.addList(result);
|
if (CollectionUtil.isNotEmpty(result)){
|
||||||
|
csLineModelService.addList(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
|||||||
equipmentFeignClient.updateStatusBynDid(devAccessParam.getNDid(), AccessEnum.REGISTERED.getCode());
|
equipmentFeignClient.updateStatusBynDid(devAccessParam.getNDid(), AccessEnum.REGISTERED.getCode());
|
||||||
//6.装置接入之后再设置心跳时间,超时改为掉线
|
//6.装置接入之后再设置心跳时间,超时改为掉线
|
||||||
//redisUtil.saveByKeyWithExpire("MQTT:" + devAccessParam.getNDid(), Instant.now().toEpochMilli(),180L);
|
//redisUtil.saveByKeyWithExpire("MQTT:" + devAccessParam.getNDid(), Instant.now().toEpochMilli(),180L);
|
||||||
//todo 需要将设备运行状态改为在线
|
|
||||||
//7.绑定装置和人的关系
|
//7.绑定装置和人的关系
|
||||||
CsDeviceUserPO po = new CsDeviceUserPO();
|
CsDeviceUserPO po = new CsDeviceUserPO();
|
||||||
po.setPrimaryUserId(RequestUtil.getUserIndex());
|
po.setPrimaryUserId(RequestUtil.getUserIndex());
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.njcn.access.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.access.mapper.CsGroArrMapper;
|
||||||
|
import com.njcn.access.service.ICsGroArrService;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsGroArr;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 组和指标关系表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-06-19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CsGroArrServiceImpl extends ServiceImpl<CsGroArrMapper, CsGroArr> implements ICsGroArrService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addGroArr(CsGroArr csGroArr) {
|
||||||
|
this.save(csGroArr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addGroArrList(List<CsGroArr> csGroArr) {
|
||||||
|
this.saveBatch(csGroArr,1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.access.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.access.mapper.CsGroupMapper;
|
||||||
|
import com.njcn.access.service.ICsGroupService;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsGroup;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据分组表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-06-16
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> implements ICsGroupService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(CsGroup csGroup) {
|
||||||
|
this.save(csGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addList(List<CsGroup> list) {
|
||||||
|
this.saveBatch(list,1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user