Merge remote-tracking branch 'origin/master'

This commit is contained in:
wurui
2023-03-22 14:56:47 +08:00
12 changed files with 80 additions and 48 deletions

View File

@@ -16,7 +16,7 @@ import javax.validation.constraints.NotBlank;
*/
@Data
@ApiModel
public class AlarmParam {
public class AlarmParam extends BaseParam{
@NotBlank(message = "起始时间不可为空")
@DateTimeStrValid
@@ -45,12 +45,4 @@ public class AlarmParam {
@ApiModelProperty(name = "processTime",value = "处理时间")
private String processTime;
@ApiModelProperty("页码")
private Integer pageNum;
@ApiModelProperty("页面尺寸")
private Integer pageSize;
}

View File

@@ -20,6 +20,7 @@ import java.time.LocalDateTime;
public class TerminalAlarmVO implements Serializable {
// 变电站
private String subName;
private String lineGrade;

View File

@@ -1,12 +1,10 @@
package com.njcn.device.pq.controller;
import cn.hutool.core.collection.CollectionUtil;
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.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.LargeScreenParam;
import com.njcn.device.pq.pojo.vo.MonitoringPointScaleVO;
import com.njcn.device.pq.service.LargeScreenService;
@@ -22,9 +20,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Objects;
/**
* @version 1.0.0
* @author: zbj
@@ -44,11 +39,24 @@ public class LargeScreenController extends BaseController {
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getMonitoringPointScale")
@ApiOperation("监测点规模")
@ApiImplicitParam(name = "largeScreenParam", value = "查询终端条件", required = true)
@ApiOperation("监测点规模(区域)")
@ApiImplicitParam(name = "largeScreenParam", value = "监测点规模(区域)", required = true)
public HttpResult<MonitoringPointScaleVO> getMonitoringPointScale(@RequestBody @Validated LargeScreenParam largeScreenParam) {
String methodDescribe = getMethodDescribe("getMonitoringPointScale");
MonitoringPointScaleVO result = largeScreenService.getMonitoringPointScale(largeScreenParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
/**
* 监测点规模
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getLoadType")
@ApiOperation("监测点规模(负荷类型)")
@ApiImplicitParam(name = "getLoadType", value = "监测点规模(负荷类型)", required = true)
public HttpResult<MonitoringPointScaleVO> getLoadType(@RequestBody @Validated LargeScreenParam largeScreenParam) {
String methodDescribe = getMethodDescribe("getLoadType");
MonitoringPointScaleVO result = largeScreenService.getLoadType(largeScreenParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
}

View File

@@ -64,7 +64,7 @@ FROM
f.NAME type,
f.id typeId,
f.`Level`,
max( a.Occurred_Time ) occurredTime,
max(a.Occurred_Time) occurredTime,
e.NAME subName,
b.NAME devLineName,
b.id devLineId,

View File

@@ -1,10 +1,8 @@
package com.njcn.device.pq.service;
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.LargeScreenParam;
import com.njcn.device.pq.pojo.vo.MonitoringPointScaleVO;
import java.util.List;
/**
* @version 1.0.0
@@ -15,4 +13,5 @@ public interface LargeScreenService {
MonitoringPointScaleVO getMonitoringPointScale(LargeScreenParam largeScreenParam);
MonitoringPointScaleVO getLoadType(LargeScreenParam largeScreenParam);
}

View File

@@ -2,7 +2,6 @@ package com.njcn.device.pq.service.impl;
import com.njcn.common.pojo.dto.SimpleDTO;
import com.njcn.device.pq.mapper.LargeScreenMapper;
import com.njcn.device.pq.mapper.LineIntegrityDataMapper;
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.param.LargeScreenParam;
@@ -37,7 +36,7 @@ public class LargeScreenServiceImpl implements LargeScreenService {
private final LargeScreenMapper largeScreenMapper;
/**
* 监测点规模
* 监测点规模(区域)
*/
@Override
public MonitoringPointScaleVO getMonitoringPointScale(LargeScreenParam largeScreenParam) {
@@ -49,7 +48,7 @@ public class LargeScreenServiceImpl implements LargeScreenService {
deviceInfoParam.setDeptIndex(largeScreenParam.getDeptIndex());
//统计类型
SimpleDTO simpleDTO = new SimpleDTO();
simpleDTO.setName(String.valueOf(StatisticsEnum.POWER_NETWORK));
simpleDTO.setCode(String.valueOf(StatisticsEnum.POWER_NETWORK));
deviceInfoParam.setStatisticalType(simpleDTO);
//添加时间
deviceInfoParam.setSearchBeginTime(largeScreenParam.getSearchBeginTime());
@@ -72,4 +71,37 @@ public class LargeScreenServiceImpl implements LargeScreenService {
result.setMonitorAddCount(count.get("count").toString());
return result;
}
/**
* 监测点规模(负荷类型)
*/
@Override
public MonitoringPointScaleVO getLoadType(LargeScreenParam largeScreenParam) {
//创建返回VO
MonitoringPointScaleVO result = new MonitoringPointScaleVO();
ArrayList<MonitoringPointScaleParam> list = new ArrayList<>();
DeviceInfoParam.BusinessParam deviceInfoParam = new DeviceInfoParam.BusinessParam();
//部门索引
deviceInfoParam.setDeptIndex(largeScreenParam.getDeptIndex());
//统计类型
SimpleDTO simpleDTO = new SimpleDTO();
simpleDTO.setCode(String.valueOf(StatisticsEnum.LOAD_TYPE));
deviceInfoParam.setStatisticalType(simpleDTO);
//添加时间
deviceInfoParam.setSearchBeginTime(largeScreenParam.getSearchBeginTime());
deviceInfoParam.setSearchEndTime(largeScreenParam.getSearchEndTime());
// 获取所有数据
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) {
MonitoringPointScaleParam param = new MonitoringPointScaleParam();
param.setIndex(generalDeviceDTO.getIndex());
param.setName(generalDeviceDTO.getName());
param.setCount(generalDeviceDTO.getLineIndexes().size());
list.add(param);
}
result.setParam(list);
return result;
}
}

View File

@@ -401,12 +401,6 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
if (CollectionUtils.isEmpty(deviceIndexes)) {
continue;
}
// 监测点流量统计
// deviceList = lineMapper.getNewDeviceRunStatistics(lineIndexes,
// DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())),
// DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())),
// (deviceInfoParam.getPageNum()-1)*deviceInfoParam.getPageSize(),
// deviceInfoParam.getPageSize());
page = lineMapper.getNewDeviceRunStatistics(
new Page(deviceInfoParam.getPageNum(), deviceInfoParam.getPageSize()),

View File

@@ -29,19 +29,9 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
@Override
public Page<TerminalAlarmVO> alarmList(AlarmParam alarmParam) {
String sql = "SELECT last(dev_line_type) as dev_line_type,line_id ,type FROM pqs_alarm group by type,line_id,dev_line_type";
//Page<TerminalAlarmVO> page = new Page<>(PageFactory.getPageNum(alarmParam),PageFactory.getPageSize(alarmParam));
//return alarmMapper.getAlarmInfo(page,PubUtils.beginTimeToLocalDateTime(alarmParam.getStartTime()),PubUtils.endTimeToLocalDateTime(alarmParam.getEndTime()),alarmParam.getFlag(),alarmParam.getType(),alarmParam.getAlarmLevel(),alarmParam.getLineGrade());
return null;
// String sql = "SELECT last(dev_line_type) as dev_line_type,line_id ,type FROM pqs_alarm group by type,line_id,dev_line_type";
Page<TerminalAlarmVO> page = new Page<>(PageFactory.getPageNum(alarmParam),PageFactory.getPageSize(alarmParam));
return alarmMapper.getAlarmInfo(page,PubUtils.beginTimeToLocalDateTime(alarmParam.getStartTime()),PubUtils.endTimeToLocalDateTime(alarmParam.getEndTime()),alarmParam.getFlag(),alarmParam.getType(),alarmParam.getAlarmLevel(),alarmParam.getLineGrade());
}
@Override

View File

@@ -128,4 +128,7 @@ public class RGeneralSurveyPlanPO {
@TableField(value = "upload_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date uploadTime;
@TableField(value = "create_person")
private String createPerson;
}

View File

@@ -158,7 +158,7 @@ public class RGeneralSurveyPlanController extends BaseController {
public HttpResult<IPage<RGeneralSurveyPlanVO>> queryPlan(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
String methodDescribe = getMethodDescribe("queryPlan");
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("0","1","2","3").collect (Collectors.toList ()));
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("0","1","2","3").collect (Collectors.toList ()),"1");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
}
@@ -169,7 +169,7 @@ public class RGeneralSurveyPlanController extends BaseController {
public HttpResult<IPage<RGeneralSurveyPlanVO>> queryPlanAudit(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
String methodDescribe = getMethodDescribe("queryPlanAudit");
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("1","2").collect (Collectors.toList ()));
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("1","2").collect (Collectors.toList ()),"2");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
}
@@ -191,7 +191,7 @@ public class RGeneralSurveyPlanController extends BaseController {
public HttpResult<IPage<RGeneralSurveyPlanVO>> queryPlanResult(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){
String methodDescribe = getMethodDescribe("queryPlanResult");
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("3","4").collect (Collectors.toList ()));
IPage<RGeneralSurveyPlanVO> rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm, Stream.of ("3","4").collect (Collectors.toList ()),"3");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
}

View File

@@ -37,7 +37,7 @@ public interface RGeneralSurveyPlanPOService extends IMppService<RGeneralSurveyP
* @Author: clam
* @Date: 2022/11/15
*/
IPage<RGeneralSurveyPlanVO> query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm,List<String> statusList);
IPage<RGeneralSurveyPlanVO> query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm,List<String> statusList,String type);
/**
* @Description: surveyResultUpload
* @Param: [surveyResultUploadParam]

View File

@@ -34,7 +34,9 @@ import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.system.pojo.po.DictData;
import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.po.Dept;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.web.utils.RequestUtil;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -113,6 +115,10 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
RSurveyCyclePO rSurveyCyclePO = rSurveyCycleMapper.selectOne (rSurveyCyclePOQueryWrapper);
rGeneralSurveyPlanPO.setCycleId (rSurveyCyclePO.getId ( ));
String deptIndex = RequestUtil.getDeptIndex ( );
Dept data = deptFeignClient.getDeptById (deptIndex).getData ( );
rGeneralSurveyPlanPO.setCheckPerson (data.getPid ());
rGeneralSurveyPlanPO.setCreatePerson (RequestUtil.getUserIndex ());
boolean b = this.saveOrUpdateByMultiId (rGeneralSurveyPlanPO);
QueryWrapper<RGeneralSurveyPlanDetail> queryWrapper = new QueryWrapper ( );
@@ -149,11 +155,18 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
* @Date: 2022/11/15
*/
@Override
public IPage<RGeneralSurveyPlanVO> query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm, List<String> statusList) {
public IPage<RGeneralSurveyPlanVO> query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm, List<String> statusList,String type) {
IPage<RGeneralSurveyPlanPO> page = new Page<> (rGeneralSurveyPlanQueryParm.getCurrentPage ( ), rGeneralSurveyPlanQueryParm.getPageSize ( ));
IPage<RGeneralSurveyPlanVO> returnpage = new Page<> (rGeneralSurveyPlanQueryParm.getCurrentPage ( ), rGeneralSurveyPlanQueryParm.getPageSize ( ));
LambdaQueryWrapper<RGeneralSurveyPlanPO> queryWrapper = new LambdaQueryWrapper<> ( );
/*type=1新建页面查看自己负责的计划type=2审核页面审核者==当前用户;结果页面:查看自己负责的计划*/
if(type=="1"||type=="3"){
queryWrapper.eq (RGeneralSurveyPlanPO::getCreatePerson,RequestUtil.getUserIndex ());
}
if(type=="2"){
queryWrapper.eq (RGeneralSurveyPlanPO::getCheckPerson,RequestUtil.getDeptIndex ());
}
if (!StringUtils.isEmpty (rGeneralSurveyPlanQueryParm.getOrgNo ( ))) {
List<String> data = deptFeignClient.getDepSonIdtByDeptId (rGeneralSurveyPlanQueryParm.getOrgNo ( )).getData ( );
@@ -382,7 +395,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
UpdateWrapper<RGeneralSurveyPlanPO> updateWrapper = new UpdateWrapper ( );
updateWrapper.eq ("plan_no", rGeneralSurveyPlanChcekParm.getPlanNo ( ));
updateWrapper.set ("check_comment", rGeneralSurveyPlanChcekParm.getCheckComment ( ));
updateWrapper.set ("check_person", rGeneralSurveyPlanChcekParm.getCheckPerson ( ));
// updateWrapper.set ("check_person", rGeneralSurveyPlanChcekParm.getCheckPerson ( ));
updateWrapper.set ("status", Objects.equals ("1", rGeneralSurveyPlanChcekParm.getCheckResult ( )) ? 3 : 2);
result = this.update (updateWrapper);
return result;