用能空调代码提交 终端相关代码修改
This commit is contained in:
@@ -10,6 +10,7 @@ import com.njcn.device.mapper.DeviceMapper;
|
||||
import com.njcn.device.mapper.LineMapper;
|
||||
import com.njcn.device.pojo.dto.*;
|
||||
import com.njcn.device.pojo.po.Device;
|
||||
import com.njcn.device.pojo.po.Line;
|
||||
import com.njcn.device.pojo.po.Overlimit;
|
||||
import com.njcn.device.pojo.vo.*;
|
||||
import com.njcn.device.service.LineService;
|
||||
@@ -227,4 +228,32 @@ public class LineController extends BaseController {
|
||||
List<Overlimit> result = lineService.getOverLimitByList(pollutionParamDTO);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取监测点及以上层的基础信息(含区域信息)
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getBaseLineAreaInfo")
|
||||
@ApiOperation("获取监测点及以上层的基础信息(含区域信息)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "lineIndex", value = "监测点集合", required = true)
|
||||
})
|
||||
public HttpResult<List<AreaLineInfoVO>> getBaseLineAreaInfo(@RequestBody List<String> lineIndex) {
|
||||
String methodDescribe = getMethodDescribe("getBaseLineAreaInfo");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineService.getBaseLineAreaInfo(lineIndex), methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据监测点ids获取监测点基本信息
|
||||
* @author cdf
|
||||
* @date 2022/6/30
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getBaseLineList")
|
||||
@ApiOperation("根据监测点ids获取监测点基本信息")
|
||||
@ApiImplicitParam(name = "lineIndex", value = "监测点集合", required = true)
|
||||
public HttpResult<List<Line>> getBaseLineList(@RequestBody List<String> lineIndex) {
|
||||
String methodDescribe = getMethodDescribe("getBaseLineList");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineService.getBaseLineList(lineIndex), methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,17 +12,19 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.pojo.bo.DeviceType;
|
||||
import com.njcn.device.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pojo.param.*;
|
||||
import com.njcn.device.pojo.po.Device;
|
||||
import com.njcn.device.pojo.po.Line;
|
||||
import com.njcn.device.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.device.pojo.vo.TerminalBaseVO;
|
||||
import com.njcn.device.pojo.vo.TerminalVO;
|
||||
import com.njcn.device.service.TerminalBaseService;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
@@ -32,6 +34,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -178,6 +181,23 @@ public class TerminalBaseController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, subList, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据设备id集获取设备集信息
|
||||
* @param list 设备集合
|
||||
* @author cdf
|
||||
* @date 2022/6/29
|
||||
*/
|
||||
@ApiOperation("获取装置信息")
|
||||
@OperateInfo
|
||||
@PostMapping("/getDevInfoByIds")
|
||||
public HttpResult<List<TerminalBaseVO>> getDevInfoByIds(@RequestBody List<String> list) {
|
||||
String methodDescribe = getMethodDescribe("getDevInfoByIds");
|
||||
LogUtil.njcnDebug(log, "{},设备集合为:{}", methodDescribe, list);
|
||||
List<TerminalBaseVO> devList = terminalBaseService.getDeviceByIdOnOrOff(list,new DeviceType(),0);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, devList, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入oracle中的原始数据
|
||||
*
|
||||
@@ -223,16 +243,15 @@ public class TerminalBaseController extends BaseController {
|
||||
* @author cdf
|
||||
* @date 2022/5/17
|
||||
*/
|
||||
@ApiOperation("下载台账信息")
|
||||
@GetMapping(value = "downTerminalBase")
|
||||
public void downTerminalBase(HttpServletResponse response) {
|
||||
String fileName = "台账信息.xls";
|
||||
/*
|
||||
ExportParams exportExcel = new ExportParams("批量导入模板(请严格按照模板标准填入数据)","台账信息");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportExcel,TerminalBaseExcel.class, baseExcelList);
|
||||
PoiUtil.exportFileByWorkbook(workbook,fileName,response);*/
|
||||
|
||||
|
||||
@ApiOperation("导出台账模板")
|
||||
@GetMapping(value = "downTerminalTemplate")
|
||||
public void downTerminalTemplate(HttpServletResponse response) {
|
||||
ExportParams exportExcel = new ExportParams("批量导入模板(请严格按照模板标准填入数据)","台账信息");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportExcel,TerminalBaseExcel.class,new ArrayList<TerminalBaseExcel>());
|
||||
//这里是自己加的 带下拉框的代码
|
||||
ExcelUtil.selectList(workbook, 4, 4, new String[]{"斤","两","个","袋","份"});
|
||||
ExcelUtil.selectList(workbook, 0, 0, new String[]{"蔬菜","水果","主食","熟食","调料"});
|
||||
PoiUtil.exportFileByWorkbook(workbook, "菜品管理", response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -248,4 +267,6 @@ public class TerminalBaseController extends BaseController {
|
||||
terminalBaseService.importTerminalBase(file,response);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -81,62 +81,6 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
*/
|
||||
List<TerminalTree> getProvinceList(@Param("pids") List<String> pids, @Param("type") Integer type);
|
||||
|
||||
/**
|
||||
* 通过id集合获取终端信息
|
||||
*
|
||||
* @param ids
|
||||
* @author cdf
|
||||
* @date 2022/2/28
|
||||
*/
|
||||
List<TerminalTree> getInfoByIdList(@Param("ids") List<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 通过id集合获取终端信息
|
||||
*
|
||||
* @param pids
|
||||
* @author cdf
|
||||
* @date 2022/2/28
|
||||
*/
|
||||
List<TerminalTree> getInfoByPidList(@Param("pids") List<String> pids);
|
||||
|
||||
|
||||
/**
|
||||
* 获取指定id集的设备
|
||||
*
|
||||
* @return TerminalTree 终端树数据
|
||||
* @author cdf
|
||||
* @date 2022/2/25
|
||||
*/
|
||||
List<TerminalTree> getAllDeviceList(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取所有id集的母线
|
||||
*
|
||||
* @return TerminalTree 终端树数据
|
||||
* @author cdf
|
||||
* @date 2022/2/25
|
||||
*/
|
||||
List<TerminalTree> getAllVolList(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取所有id集的监测点
|
||||
*
|
||||
* @return TerminalTree 终端树数据
|
||||
* @author cdf
|
||||
* @date 2022/2/25
|
||||
*/
|
||||
List<TerminalTree> getAllLineList(@Param("ids") List<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 通过监测点集合获取所有母线
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/2/28
|
||||
*/
|
||||
List<TerminalTree> getVoltageListByLineIds(@Param("ids") List<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 返回未绑定的监测点
|
||||
@@ -165,6 +109,9 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
List<Line> getDeviceById(@Param("devIds") List<String> devIds, @Param("deviceType") DeviceType deviceType);
|
||||
|
||||
|
||||
List<TerminalBaseVO> getDeviceByIdOnOrOff(@Param("devIds") List<String> devIds, @Param("deviceType") DeviceType deviceType,@Param("comFlag")Integer comFlag);
|
||||
|
||||
|
||||
List<LineDataVO> getLineDetail(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
@@ -233,6 +180,14 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
*/
|
||||
List<BaseLineInfo> getBaseLineInfo(@Param("list")List<String> lineIndex);
|
||||
|
||||
|
||||
/**
|
||||
* 获取监测点区域详细信息(原基础上添加监测点区域经纬度信息)
|
||||
* @param lineIndex 监测点结合
|
||||
* @date 2022/6/29
|
||||
*/
|
||||
List<AreaLineInfoVO> getBaseLineAreaInfo(@Param("list")List<String> lineIndex);
|
||||
|
||||
/**
|
||||
* 返回监测点信息及通讯状态
|
||||
* @param lineIndex 监测点集合
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
order by sort
|
||||
</select>
|
||||
|
||||
<select id="getInfoByPidList">
|
||||
<select id="getInfoByPidList" resultType="TerminalTree">
|
||||
select a.id,a.pid,a.name,a.level,a.sort from pq_line
|
||||
where pid in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
@@ -266,6 +266,48 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getDeviceByIdOnOrOff" resultType="TerminalBaseVO">
|
||||
SELECT
|
||||
t1.name devName,t2.ip,t2.update_time,sub.name subName,gd.name gdName
|
||||
FROM
|
||||
pq_line t1,
|
||||
pq_device t2,
|
||||
pq_line sub,
|
||||
pq_line gd
|
||||
WHERE
|
||||
t1.id = t2.id
|
||||
and t1.pid = sub.id
|
||||
and sub.pid = gd.id
|
||||
<if test="deviceType.devModel!=null">
|
||||
AND t2.Dev_Model in
|
||||
<foreach collection="deviceType.devModel" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.runFlag!=null">
|
||||
AND t2.Run_Flag in
|
||||
<foreach collection="deviceType.runFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="deviceType.dataType!=null">
|
||||
AND t2.Dev_Data_Type in
|
||||
<foreach collection="deviceType.dataType" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
AND t1.id IN
|
||||
<foreach collection="devIds" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="comFlag!=null">
|
||||
and t2.com_flag = #{comFlag}
|
||||
</if>
|
||||
order by update_time desc
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getLineDetail" resultType="com.njcn.web.pojo.vo.LineDataVO">
|
||||
SELECT line.*
|
||||
FROM PQ_LINE line
|
||||
@@ -488,6 +530,60 @@
|
||||
GROUP BY line.id
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getBaseLineAreaInfo" resultType="AreaLineInfoVO">
|
||||
SELECT
|
||||
line.Id lineId,
|
||||
line.`Name` lineName,
|
||||
gd.`Name` gdName,
|
||||
substation.id subId,
|
||||
substation.`Name` subName,
|
||||
pqdevice.IP ip,
|
||||
pqdevice.Com_Flag comFlag,
|
||||
factory.`Name` manufacturer,
|
||||
voltage.`Name` voltageName,
|
||||
scale.`Name` voltageScale,
|
||||
pqdevice.run_flag,
|
||||
pqdevice.com_flag,
|
||||
pqsubstation.Lng,
|
||||
pqsubstation.lat,
|
||||
detail.ct1,
|
||||
detail.ct2,
|
||||
detail.pt1,
|
||||
detail.pt2
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line_detail detail,
|
||||
pq_line voltage,
|
||||
pq_voltage pqvoltage,
|
||||
pq_line device,
|
||||
pq_device pqdevice,
|
||||
pq_line substation,
|
||||
pq_substation pqsubstation,
|
||||
pq_line gd,
|
||||
sys_dict_data scale,
|
||||
sys_dict_data factory,
|
||||
sys_dict_data loadtype,
|
||||
sys_dict_data subscale
|
||||
WHERE
|
||||
line.id = detail.id
|
||||
AND line.pid = voltage.id
|
||||
AND voltage.id = pqvoltage.id
|
||||
AND pqvoltage.Scale = scale.id
|
||||
AND voltage.pid = device.id
|
||||
AND voltage.pid = pqdevice.id
|
||||
AND pqdevice.Manufacturer = factory.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.id = pqsubstation.id
|
||||
AND pqsubstation.Scale = subscale.id
|
||||
AND substation.pid = gd.id
|
||||
AND line.Id IN
|
||||
<foreach item="item" collection="list" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY line.id
|
||||
</select>
|
||||
|
||||
<select id="getLineDeviceStateVO" resultType="com.njcn.device.pojo.vo.LineDeviceStateVO">
|
||||
SELECT
|
||||
t.id id,
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.njcn.device.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pojo.dto.PollutionParamDTO;
|
||||
import com.njcn.device.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pojo.po.Line;
|
||||
import com.njcn.device.pojo.po.Overlimit;
|
||||
import com.njcn.device.pojo.vo.*;
|
||||
|
||||
@@ -125,4 +126,20 @@ public interface LineService {
|
||||
* @return 结果
|
||||
*/
|
||||
List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO);
|
||||
|
||||
/**
|
||||
* 获取监测点区域详细信息(原基础上添加监测点区域经纬度信息)
|
||||
* @param lineIndex 监测点结合
|
||||
* @date 2022/6/29
|
||||
*/
|
||||
List<AreaLineInfoVO> getBaseLineAreaInfo(List<String> lineIndex);
|
||||
|
||||
/**
|
||||
* 获取监测点基本信息
|
||||
* @param lineIndex 监测点结合
|
||||
* @date 2022/6/29
|
||||
*/
|
||||
List<Line> getBaseLineList(List<String> lineIndex);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,10 @@ import com.njcn.device.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pojo.param.AddTerminalParam;
|
||||
import com.njcn.device.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pojo.param.UpdateTerminalParam;
|
||||
import com.njcn.device.pojo.po.Device;
|
||||
import com.njcn.device.pojo.po.Line;
|
||||
import com.njcn.device.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.device.pojo.vo.TerminalBaseVO;
|
||||
import com.njcn.device.pojo.vo.TerminalVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -40,7 +43,7 @@ public interface TerminalBaseService {
|
||||
|
||||
/**
|
||||
* 终端查询操作
|
||||
*
|
||||
* @param id 设备id
|
||||
* @author cdf
|
||||
* @date 2021/7/19
|
||||
*/
|
||||
@@ -48,7 +51,7 @@ public interface TerminalBaseService {
|
||||
|
||||
/**
|
||||
* 终端删除操作
|
||||
*
|
||||
* @param id 设备id
|
||||
* @author cdf
|
||||
* @date 2021/7/21
|
||||
*/
|
||||
@@ -88,6 +91,16 @@ public interface TerminalBaseService {
|
||||
*/
|
||||
List<Line> getDeviceById(List<String> devIds, DeviceType deviceType);
|
||||
|
||||
/**
|
||||
* 根据终端id,获取所有对应终端
|
||||
*
|
||||
* @param devIds 终端id
|
||||
* @param deviceType 终端条件筛选
|
||||
* @param comFlag 是否中断标志
|
||||
* @return 终端数据
|
||||
*/
|
||||
List<TerminalBaseVO> getDeviceByIdOnOrOff(List<String> devIds, DeviceType deviceType, Integer comFlag);
|
||||
|
||||
/**
|
||||
* 功能描述: 根据id查询变电站信息
|
||||
*
|
||||
|
||||
@@ -4,8 +4,10 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.EnumUtils;
|
||||
@@ -657,4 +659,17 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
return communicateList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<AreaLineInfoVO> getBaseLineAreaInfo(List<String> lineIndex) {
|
||||
return this.baseMapper.getBaseLineAreaInfo(lineIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Line> getBaseLineList(List<String> lineIndex) {
|
||||
LambdaQueryWrapper<Line> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(Line::getState, DataStateEnum.ENABLE.getCode()).in(Line::getId,lineIndex);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1254,6 +1254,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
return this.baseMapper.getDeviceById(devIds, deviceType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TerminalBaseVO> getDeviceByIdOnOrOff(List<String> devIds, DeviceType deviceType,Integer comFlag){
|
||||
return this.baseMapper.getDeviceByIdOnOrOff(devIds, deviceType,comFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Line> getSubstationById(List<String> list) {
|
||||
return this.lambdaQuery().in(Line::getId, list).list();
|
||||
@@ -1294,6 +1299,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
return this.baseMapper.getBaseLineInfo(lineIndex);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importOracleTerminalData(MultipartFile file, HttpServletResponse response) {
|
||||
|
||||
@@ -21,6 +21,7 @@ spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
ip: @server.url@
|
||||
server-addr: @nacos.url@
|
||||
namespace: @nacos.namespace@
|
||||
config:
|
||||
|
||||
Reference in New Issue
Block a user