预处理兼容pq/pms处理
This commit is contained in:
@@ -5,16 +5,20 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
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.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.IPqsDeviceUnitService;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -27,6 +31,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
@@ -47,6 +52,10 @@ public class CommTerminalController extends BaseController {
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
|
||||
private final IPqsDeviceUnitService iPqsDeviceUnitService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -260,4 +269,33 @@ public class CommTerminalController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/lineUnitDetail")
|
||||
@ApiOperation("根据监测点id获取数据单位")
|
||||
@ApiImplicitParam(name = "lineID", value = "实体", required = true)
|
||||
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineID") String lineId) {
|
||||
String methodDescribe = getMethodDescribe("lineUnitDetail");
|
||||
PqsDeviceUnit pqsDeviceUnit = iPqsDeviceUnitService.lineUnitDetail(lineId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过监测点获取监测点数据单位
|
||||
* @author cdf
|
||||
* @date 2023/9/21
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getMonitorDetail")
|
||||
@ApiOperation("根据监测点id获取数据单位")
|
||||
@ApiImplicitParam(name = "lineID", value = "实体", required = true)
|
||||
public HttpResult<LineDevGetDTO> getMonitorDetail(@RequestParam("lineId") String lineId) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorDetail");
|
||||
LineDevGetDTO monitor = lineDetailMapper.getMonitorDetail(lineId);
|
||||
if(Objects.isNull(monitor)){
|
||||
throw new BusinessException("未查询到监测点信息");
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ 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.device.pq.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo;
|
||||
import com.njcn.device.pq.service.IPqsDeviceUnitService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -47,4 +48,7 @@ public interface LineDetailMapper extends BaseMapper<LineDetail> {
|
||||
|
||||
@Select ("select count(1) from pq_line a where a.`Level`=6 and SUBSTRING_INDEX(SUBSTRING_INDEX(a.Pids, ',', 4),',',-1)=#{subIndex}")
|
||||
Integer getLineCountBySubstation(@Param("subIndex")String subIndex);
|
||||
|
||||
|
||||
LineDevGetDTO getMonitorDetail(@Param("monitorId")String monitorId);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -30,7 +29,7 @@ public interface PqsDeviceUnitMapper extends BaseMapper<PqsDeviceUnit> {
|
||||
/**
|
||||
* @Description: 根据监测点信息查询
|
||||
* @param ids
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.po.PqsDeviceUnit>
|
||||
* @return: java.util.List<com.njcn.device.biz.pojo.po.PqsDeviceUnit>
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/21 14:17
|
||||
*/
|
||||
|
||||
@@ -52,4 +52,12 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getMonitorDetail" resultType="LineDevGetDTO">
|
||||
select a.id pointId,a.name pointName,b.Time_Interval interval
|
||||
from pq_line a
|
||||
inner join pq_line_detail b on a.id=b.id
|
||||
where a.id = #{monitorId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="deviceUnitByID" resultType="com.njcn.device.pq.pojo.po.PqsDeviceUnit">
|
||||
<select id="deviceUnitByID" resultType="com.njcn.device.biz.pojo.po.PqsDeviceUnit">
|
||||
SELECT
|
||||
unit.*
|
||||
FROM
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -37,7 +37,7 @@ public interface IPqsDeviceUnitService extends IService<PqsDeviceUnit> {
|
||||
/**
|
||||
* @param lineID
|
||||
* @Description: 根据监测点id查询数据单位
|
||||
* @return: com.njcn.device.pq.pojo.po.PqsDeviceUnit
|
||||
* @return: com.njcn.device.biz.pojo.po.PqsDeviceUnit
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/21 14:02
|
||||
*/
|
||||
@@ -46,7 +46,7 @@ public interface IPqsDeviceUnitService extends IService<PqsDeviceUnit> {
|
||||
/**
|
||||
* @param devID
|
||||
* @Description: 根据终端id查询数据单位
|
||||
* @return: com.njcn.device.pq.pojo.po.PqsDeviceUnit
|
||||
* @return: com.njcn.device.biz.pojo.po.PqsDeviceUnit
|
||||
* @Author: wr
|
||||
* @Date: 2023/8/21 14:02
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.PqsDeviceUnitMapper;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.pojo.vo.PqsDeviceUnitVo;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalTree;
|
||||
import com.njcn.device.pq.service.IPqsDeviceUnitService;
|
||||
|
||||
Reference in New Issue
Block a user