Merge branch 'master' of http://192.168.1.22:3000/root/pqs
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package com.njcn.supervision.service.device;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2024-05-21
|
||||
*/
|
||||
public interface ISupervisionTempLineRunTestService extends IService<SupervisionTempLineRunTest> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.supervision.service.device;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/5/17 15:26【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface SupervisionTempLineDebugPOService extends IService<SupervisionTempLineDebugPO> {
|
||||
|
||||
|
||||
String addTempLineDebug(SupervisionTempLineDebugParam supervisionTempLineReportParam);
|
||||
|
||||
Page<SupervisionTempLineDebugVO> getTempLineDeug(SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery);
|
||||
|
||||
Page<SupervisionTempLineDebugVO> pageHasDebug(SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery);
|
||||
|
||||
SupervisionTempLineDebugVO getDetailTempLineDebug(String id);
|
||||
|
||||
void updateStatus(String businessKey, Integer status);
|
||||
}
|
||||
@@ -25,4 +25,6 @@ public interface SupervisionTempLineReportService extends IService<SupervisionTe
|
||||
void updateStatus(String businessKey, Integer status);
|
||||
|
||||
String cancelTempLineReport(BpmProcessInstanceCancelParam cancelReqVO);
|
||||
|
||||
SupervisionTempLineReportVO getDetailTempLine(String id);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||
import com.njcn.supervision.mapper.device.SupervisionDevMainReportPOMapper;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
||||
@@ -62,6 +63,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
private final SupervisionTempDeviceReportService supervisionTempDeviceReportService;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -123,12 +125,13 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
if (StrUtil.isNotBlank(supervisionDevMainReportQuery.getOrgId())) {
|
||||
/*获取直接下属子单位*/
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionDevMainReportQuery.getOrgId()).getData();
|
||||
queryWrapper.in("supervision_dev_main_report.org_no", data);
|
||||
|
||||
//添加上时间范围
|
||||
queryWrapper.between("supervision_dev_main_report.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(supervisionDevMainReportQuery.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionDevMainReportQuery.getSearchEndTime())));
|
||||
}
|
||||
//添加上时间范围
|
||||
queryWrapper.between("supervision_dev_main_report.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(supervisionDevMainReportQuery.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionDevMainReportQuery.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_dev_main_report.Update_Time");
|
||||
Page<SupervisionDevMainReportVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionDevMainReportQuery), PageFactory.getPageSize(supervisionDevMainReportQuery)), queryWrapper);
|
||||
page.getRecords().stream().forEach(temp->{
|
||||
@@ -186,7 +189,8 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
supervisionDevMainReportVO.setOrgName(deptFeignClient.getDeptById(byId.getOrgId()).getData().getName());
|
||||
|
||||
SupervisionTempDeviceReport supervisionTempDeviceReport = supervisionTempDeviceReportService.lambdaQuery().eq(SupervisionTempDeviceReport::getId, id).one();
|
||||
|
||||
supervisionTempDeviceReport.setSubstation(lineFeignClient.getSubstationInfo(supervisionTempDeviceReport.getSubstation()).getData().getName());
|
||||
supervisionTempDeviceReport.setPowerCompany(deptFeignClient.getDeptById(byId.getOrgId()).getData().getName());
|
||||
supervisionDevMainReportVO.setSupervisionTempDeviceReport(supervisionTempDeviceReport);
|
||||
return supervisionDevMainReportVO;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.njcn.supervision.service.device.impl;
|
||||
|
||||
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.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
||||
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO;
|
||||
import com.njcn.supervision.service.device.SupervisionTempLineDebugPOService;
|
||||
import com.njcn.supervision.service.device.SupervisionTempLineReportService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/5/17 15:26【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<SupervisionTempLineDebugPOMapper, SupervisionTempLineDebugPO> implements SupervisionTempLineDebugPOService{
|
||||
public static final String PROCESS_KEY = "temp_line_debug";
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final SupervisionTempLineReportService supervisionTempLineReportService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String addTempLineDebug(SupervisionTempLineDebugParam supervisionTempLineReportParam) {
|
||||
|
||||
SupervisionTempLineDebugPO byId = this.getById(supervisionTempLineReportParam.getId());
|
||||
if(Objects.nonNull(byId)){
|
||||
if(byId.getState() == 1) {
|
||||
throw new BusinessException("该监测点以申请联调");
|
||||
}
|
||||
}
|
||||
SupervisionTempLineDebugPO supervisionTempLineDebugPO = new SupervisionTempLineDebugPO();
|
||||
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineDebugPO);
|
||||
supervisionTempLineDebugPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
supervisionTempLineDebugPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
this.save(supervisionTempLineDebugPO);
|
||||
String id = supervisionTempLineDebugPO.getId();
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionTempLineReportParam.getStartUserSelectAssignees());
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionTempLineDebugPO.getCreateBy(),bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
supervisionTempLineDebugPO.setProcessInstanceId(processInstanceId);
|
||||
this.baseMapper.updateById(supervisionTempLineDebugPO);
|
||||
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SupervisionTempLineDebugVO> getTempLineDeug(SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery) {
|
||||
QueryWrapper<SupervisionDevMainReportVO> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
String userIndex = RequestUtil.getUserIndex();
|
||||
queryWrapper.in("supervision_temp_line_report.create_by", CollectionUtil.newArrayList(userIndex))
|
||||
.eq("supervision_temp_line_report.state", DataStateEnum.ENABLE.getCode());
|
||||
if (StrUtil.isNotBlank(supervisionTempLineDebugQuery.getOrgId())) {
|
||||
/*获取直接下属子单位*/
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgId()).getData();
|
||||
queryWrapper.in("supervision_temp_line_report.org_id", data);
|
||||
|
||||
}
|
||||
//添加上时间范围
|
||||
queryWrapper.between("supervision_temp_line_report.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_temp_line_report.Update_Time");
|
||||
|
||||
Page<SupervisionTempLineDebugVO> page =this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionTempLineDebugQuery), PageFactory.getPageSize(supervisionTempLineDebugQuery)), queryWrapper);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SupervisionTempLineDebugVO> pageHasDebug(SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery) {
|
||||
QueryWrapper<SupervisionDevMainReportVO> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
String userIndex = RequestUtil.getUserIndex();
|
||||
queryWrapper
|
||||
.eq("supervision_temp_line_debug.state", DataStateEnum.ENABLE.getCode());
|
||||
if (StrUtil.isNotBlank(supervisionTempLineDebugQuery.getOrgId())) {
|
||||
/*获取直接下属子单位*/
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgId()).getData();
|
||||
queryWrapper.in("supervision_temp_line_debug.org_id", data);
|
||||
|
||||
}
|
||||
//添加上时间范围
|
||||
queryWrapper.between("supervision_temp_line_debug.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_temp_line_debug.Update_Time");
|
||||
|
||||
Page<SupervisionTempLineDebugVO> page =this.baseMapper.pageHasDebug(new Page<>(PageFactory.getPageNum(supervisionTempLineDebugQuery), PageFactory.getPageSize(supervisionTempLineDebugQuery)), queryWrapper);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupervisionTempLineDebugVO getDetailTempLineDebug(String id) {
|
||||
SupervisionTempLineDebugVO supervisionTempLineDebugVO = new SupervisionTempLineDebugVO();
|
||||
SupervisionTempLineReport supervisionTempLineReport = supervisionTempLineReportService.getById(id);
|
||||
SupervisionTempLineDebugPO supervisionTempLineDebugPO = this.getById(id);
|
||||
supervisionTempLineDebugVO.setId(id);
|
||||
supervisionTempLineDebugVO.setLineId(supervisionTempLineReport.getLineId());
|
||||
supervisionTempLineDebugVO.setLineName(supervisionTempLineReport.getLineName());
|
||||
supervisionTempLineDebugVO.setReason(supervisionTempLineDebugPO.getReason());
|
||||
supervisionTempLineDebugVO.setProcessInstanceId(supervisionTempLineDebugPO.getProcessInstanceId());
|
||||
supervisionTempLineDebugVO.setStatus(supervisionTempLineDebugPO.getStatus());
|
||||
|
||||
|
||||
return supervisionTempLineDebugVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(String businessKey, Integer status) {
|
||||
this.lambdaUpdate().set(SupervisionTempLineDebugPO::getStatus,status).eq(SupervisionTempLineDebugPO::getId,businessKey).update();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -93,20 +93,23 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
String userIndex = RequestUtil.getUserIndex();
|
||||
|
||||
queryWrapper.in("supervision_temp_line_report.create_by", CollectionUtil.newArrayList(userIndex))
|
||||
.eq("supervision_temp_line_report.state", DataStateEnum.ENABLE.getCode());
|
||||
.eq("supervision_temp_line_report.state", DataStateEnum.ENABLE.getCode())
|
||||
.in(CollectionUtil.isNotEmpty(supervisionTempLineReportQuery.getStatueList()),"supervision_temp_line_report.status",supervisionTempLineReportQuery.getStatueList());
|
||||
if (StrUtil.isNotBlank(supervisionTempLineReportQuery.getOrgId())) {
|
||||
/*获取直接下属子单位*/
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineReportQuery.getOrgId()).getData();
|
||||
queryWrapper.in("supervision_temp_line_report.org_id", data);
|
||||
|
||||
|
||||
//添加上时间范围
|
||||
queryWrapper.between("supervision_temp_line_report.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineReportQuery.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineReportQuery.getSearchEndTime())));
|
||||
}
|
||||
//添加上时间范围
|
||||
queryWrapper.between("supervision_temp_line_report.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineReportQuery.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineReportQuery.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_temp_line_report.Update_Time");
|
||||
Page<SupervisionTempLineReportVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionTempLineReportQuery), PageFactory.getPageSize(supervisionTempLineReportQuery)), queryWrapper);
|
||||
page.getRecords().stream().forEach(temp->{
|
||||
temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgId()).getData().getName()));
|
||||
// temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgId()).getData().getName()));
|
||||
//处理特殊字段,用户名、部门名
|
||||
UserVO userVO = userFeignClient.getUserById(temp.getReporter()).getData();
|
||||
temp.setReporter(userVO.getName());
|
||||
@@ -133,6 +136,20 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
return supervisionDevMainReportPO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupervisionTempLineReportVO getDetailTempLine(String id) {
|
||||
SupervisionTempLineReportVO vo =new SupervisionTempLineReportVO();
|
||||
SupervisionTempLineReport byId = this.getById(id);
|
||||
BeanUtils.copyProperties(byId,vo);
|
||||
|
||||
//处理特殊字段,用户名、部门名
|
||||
UserVO userVO = userFeignClient.getUserById(vo.getReporter()).getData();
|
||||
vo.setReporter(userVO.getName());
|
||||
vo.setOrgName(deptFeignClient.getDeptById(vo.getOrgId()).getData().getName());
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
private void checkLineId(SupervisionTempLineReportParam supervisionTempLineReportParam, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<SupervisionTempLineReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.supervision.service.device.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.supervision.mapper.device.SupervisionTempLineRunTestMapper;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTest;
|
||||
import com.njcn.supervision.service.device.ISupervisionTempLineRunTestService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2024-05-21
|
||||
*/
|
||||
@Service
|
||||
public class SupervisionTempLineRunTestServiceImpl extends ServiceImpl<SupervisionTempLineRunTestMapper, SupervisionTempLineRunTest> implements ISupervisionTempLineRunTestService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.supervision.service.leaflet;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam;
|
||||
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
|
||||
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 预告警单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2024-05-21
|
||||
*/
|
||||
public interface IWarningLeafletService extends IService<WarningLeaflet> {
|
||||
|
||||
/**
|
||||
* 创建预告警单,此时还没有走流程,等待用户上传反馈单后,才正式进入工作流阶段
|
||||
* name:预告警单名称,此处暂时用普测计划名称+变电站名称组成预告警单名
|
||||
* code:预告警编号暂时随机by yxb
|
||||
* id:对应问题源id,用于查询详细数据
|
||||
* problemType:问题类型:1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标,此处是现场测试超标
|
||||
* leaflet:单子类型:1:预警单;2:告警单
|
||||
* issueDetail:问题详细描述
|
||||
*/
|
||||
void createLeaflet(String name, String code, String id, Integer problemType, Integer leaflet,String issueDetail);
|
||||
|
||||
Page<WarningLeafletVO> alarmPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam);
|
||||
|
||||
Page<WarningLeafletVO> warningPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.njcn.supervision.service.leaflet.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||
import com.njcn.supervision.enums.LeafletTypeEnum;
|
||||
import com.njcn.supervision.mapper.leaflet.WarningLeafletMapper;
|
||||
import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam;
|
||||
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
|
||||
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
|
||||
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 预告警单表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2024-05-21
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper, WarningLeaflet> implements IWarningLeafletService {
|
||||
|
||||
private final UserFeignClient userFeignClient;
|
||||
|
||||
/**
|
||||
* 不创建工作流,只是创建一个告警单,需要待用户反馈后才会进入流程
|
||||
*/
|
||||
@Override
|
||||
public void createLeaflet(String name, String code, String id, Integer problemType, Integer leaflet,String issueDetail) {
|
||||
WarningLeaflet warningLeaflet = new WarningLeaflet();
|
||||
warningLeaflet.setLeafletName(name);
|
||||
warningLeaflet.setLeafletNo(code);
|
||||
warningLeaflet.setProblemType(problemType);
|
||||
warningLeaflet.setProblemId(id);
|
||||
warningLeaflet.setLeafletType(leaflet);
|
||||
warningLeaflet.setIssueDetail(issueDetail);
|
||||
warningLeaflet.setState(DataStateEnum.ENABLE.getCode());
|
||||
warningLeaflet.setStatus(FlowStatusEnum.NO_FEEDBACK.getCode());
|
||||
this.baseMapper.insert(warningLeaflet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WarningLeafletVO> warningPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) {
|
||||
QueryWrapper<WarningLeafletVO> warningLeafletVOQueryWrapper = new QueryWrapper<>();
|
||||
if (Objects.nonNull(warningLeafletQueryParam)) {
|
||||
//添加上时间范围
|
||||
warningLeafletVOQueryWrapper.between("supervision_warning_leaflet.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchEndTime())));
|
||||
}
|
||||
//获取当前用户部门所有同事的id,查看该部门下所有的数据
|
||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||
warningLeafletVOQueryWrapper.in("supervision_warning_leaflet.Create_By", colleaguesIds)
|
||||
.eq("supervision_warning_leaflet.state",DataStateEnum.ENABLE.getCode())
|
||||
.eq("supervision_warning_leaflet.leaflet_type", LeafletTypeEnum.WARNING.getCode())
|
||||
.orderByDesc("supervision_warning_leaflet.Update_Time");
|
||||
return this.baseMapper.warningPageData(new Page<>(PageFactory.getPageNum(warningLeafletQueryParam), PageFactory.getPageSize(warningLeafletQueryParam)), warningLeafletVOQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WarningLeafletVO> alarmPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) {
|
||||
QueryWrapper<WarningLeafletVO> warningLeafletVOQueryWrapper = new QueryWrapper<>();
|
||||
if (Objects.nonNull(warningLeafletQueryParam)) {
|
||||
//添加上时间范围
|
||||
warningLeafletVOQueryWrapper.between("supervision_warning_leaflet.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchEndTime())));
|
||||
}
|
||||
//获取当前用户部门所有同事的id,查看该部门下所有的数据
|
||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||
warningLeafletVOQueryWrapper.in("supervision_warning_leaflet.Create_By", colleaguesIds)
|
||||
.eq("supervision_warning_leaflet.state",DataStateEnum.ENABLE.getCode())
|
||||
.eq("supervision_warning_leaflet.leaflet_type", LeafletTypeEnum.ALARM.getCode())
|
||||
.orderByDesc("supervision_warning_leaflet.Update_Time");
|
||||
return this.baseMapper.alarmPageData(new Page<>(PageFactory.getPageNum(warningLeafletQueryParam), PageFactory.getPageSize(warningLeafletQueryParam)), warningLeafletVOQueryWrapper);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.supervision.service.plan;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.supervision.pojo.param.plan.SupervisionPlanParam;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionPlanPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.supervision.pojo.vo.plan.SupervisionPlanVO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/5/20 17:49【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface SupervisionPlanPOService extends IService<SupervisionPlanPO>{
|
||||
|
||||
|
||||
String addPlan(SupervisionPlanParam supvPlanParam);
|
||||
|
||||
Page<SupervisionPlanVO> pagePlan(SupervisionPlanParam supvPlanParam);
|
||||
|
||||
String initiateAudit(String id);
|
||||
|
||||
SupervisionPlanVO getDetailPlan(String id);
|
||||
|
||||
void updateStatus(String businessKey, Integer status);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.supervision.service.plan;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.supervision.pojo.param.plan.SupervisopnProblemParam;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionProblemPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/5/20 19:50【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface SupervisionProblemPOService extends IService<SupervisionProblemPO>{
|
||||
|
||||
|
||||
void addProblem(SupervisopnProblemParam supvProblemParam);
|
||||
|
||||
Page<SupervisionProblemPO> pageProblem(SupervisopnProblemParam supvProblemParam);
|
||||
}
|
||||
@@ -0,0 +1,365 @@
|
||||
package com.njcn.supervision.service.plan.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.supervision.mapper.plan.SupervisionPlanPOMapper;
|
||||
import com.njcn.supervision.pojo.param.plan.SupervisionPlanParam;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionPlanPO;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionProblemPO;
|
||||
import com.njcn.supervision.pojo.vo.plan.SupervisionPlanVO;
|
||||
import com.njcn.supervision.service.plan.SupervisionPlanPOService;
|
||||
import com.njcn.supervision.service.plan.SupervisionProblemPOService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/5/20 17:49【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOMapper, SupervisionPlanPO> implements SupervisionPlanPOService{
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
public static final String PROCESS_KEY = "sup_plan_add";
|
||||
private final SupervisionProblemPOService supervisionProblemPOService;
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String addPlan(SupervisionPlanParam supvPlanParam) {
|
||||
checkParam(supvPlanParam, false);
|
||||
SupervisionPlanPO supvPlan = new SupervisionPlanPO();
|
||||
BeanUtil.copyProperties(supvPlanParam, supvPlan);
|
||||
supvPlan.setPlanSupvDate(LocalDateTimeUtil.parse(supvPlanParam.getPlanSupvDate(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectEndTime())) {
|
||||
supvPlan.setEffectEndTime(PubUtils.localDateTimeFormat(supvPlanParam.getEffectEndTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectStartTime())) {
|
||||
supvPlan.setEffectStartTime(PubUtils.localDateTimeFormat(supvPlanParam.getEffectStartTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getProblemOcTime())) {
|
||||
supvPlan.setProblemOcTime(PubUtils.localDateTimeFormat(supvPlanParam.getProblemOcTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getReportIssueTime())) {
|
||||
supvPlan.setReportIssueTime(PubUtils.localDateTimeFormat(supvPlanParam.getReportIssueTime()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!"01".equals(supvPlan.getEffectStatus())){
|
||||
if(Objects.isNull(supvPlan.getEffectStartTime()) ){
|
||||
throw new BusinessException("开始实施时间不可为空!");
|
||||
}
|
||||
}
|
||||
|
||||
if("04".equals(supvPlan.getEffectStatus())){
|
||||
if(Objects.isNull(supvPlan.getEffectEndTime()) ){
|
||||
throw new BusinessException("结束实施时间不可为空!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
supvPlan.setIsUploadHead(0);
|
||||
if(StrUtil.isNotBlank(supvPlan.getEffectUserId())){
|
||||
List<User> userList = userFeignClient.getUserByIdList(Stream.of(supvPlan.getEffectUserId()).collect(Collectors.toList())).getData();
|
||||
if(CollUtil.isNotEmpty(userList)){
|
||||
supvPlan.setEffectUserName(userList.get(0).getName());
|
||||
}
|
||||
}
|
||||
supvPlan.setState(DataStateEnum.ENABLE.getCode());
|
||||
this.save(supvPlan);
|
||||
return supvPlan.getPlanId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SupervisionPlanVO> pagePlan(SupervisionPlanParam supvPlanParam) {
|
||||
LambdaQueryWrapper<SupervisionPlanPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(supvPlanParam.getSupvOrgId())) {
|
||||
List<String> deptIds = deptFeignClient.getDepSonSelfCodetByCode(supvPlanParam.getSupvOrgId()).getData();
|
||||
lambdaQueryWrapper.in(SupervisionPlanPO::getSupvOrgId, deptIds)
|
||||
.between(SupervisionPlanPO::getPlanSupvDate, supvPlanParam.getSearchBeginTime(),supvPlanParam.getSearchEndTime())
|
||||
.eq(StrUtil.isNotBlank(supvPlanParam.getSupvType()),SupervisionPlanPO::getSupvType,supvPlanParam.getSupvType());
|
||||
|
||||
}
|
||||
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getSortBy())){
|
||||
if(supvPlanParam.getOrderBy().equals("desc")){
|
||||
lambdaQueryWrapper.orderByDesc(SupervisionPlanPO::getPlanSupvDate);
|
||||
}else {
|
||||
lambdaQueryWrapper.orderByAsc(SupervisionPlanPO::getPlanSupvDate);
|
||||
|
||||
}
|
||||
}else {
|
||||
lambdaQueryWrapper.orderByDesc(SupervisionPlanPO::getCreateTime);
|
||||
}
|
||||
|
||||
|
||||
List<PvTerminalTreeVO> deptList = deptFeignClient.allDeptList().getData();
|
||||
// Map<String, PvTerminalTreeVO> mapCode = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getCode, Function.identity()));
|
||||
Map<String, PvTerminalTreeVO> mapList = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, Function.identity()));
|
||||
|
||||
|
||||
Page<SupervisionPlanPO> page = this.page(new Page<>(PageFactory.getPageNum(supvPlanParam), PageFactory.getPageSize(supvPlanParam)), lambdaQueryWrapper);
|
||||
List<SupervisionPlanVO> supvPlanVOList = BeanUtil.copyToList(page.getRecords(), SupervisionPlanVO.class);
|
||||
List<String> userIds = supvPlanVOList.stream().map(SupervisionPlanVO::getPlanUserId).distinct().collect(Collectors.toList());
|
||||
supvPlanVOList.forEach(item -> {
|
||||
PvTerminalTreeVO pvTerminalTreeVO = null;
|
||||
if (mapList.containsKey(item.getSupvOrgId())) {
|
||||
pvTerminalTreeVO = mapList.get(item.getSupvOrgId());
|
||||
item.setSupvOrgName(pvTerminalTreeVO.getName());
|
||||
int deptLevel = pvTerminalTreeVO.getPids().split(StrUtil.COMMA).length;
|
||||
if (deptLevel == 2) {
|
||||
//省
|
||||
item.setProvince(pvTerminalTreeVO.getName());
|
||||
} else if (deptLevel == 3) {
|
||||
//市
|
||||
item.setCity(pvTerminalTreeVO.getName());
|
||||
if (mapList.containsKey(pvTerminalTreeVO.getPid())) {
|
||||
PvTerminalTreeVO pvTerminalTreeOne = mapList.get(pvTerminalTreeVO.getPid());
|
||||
item.setProvince(pvTerminalTreeOne.getName());
|
||||
}
|
||||
} else if (deptLevel == 4) {
|
||||
//县
|
||||
if (mapList.containsKey(pvTerminalTreeVO.getPid())) {
|
||||
item.setCounty(pvTerminalTreeVO.getName());
|
||||
PvTerminalTreeVO pvTerminalTreeOne = mapList.get(pvTerminalTreeVO.getPid());
|
||||
if (Objects.nonNull(pvTerminalTreeOne)) {
|
||||
item.setCity(pvTerminalTreeOne.getName());
|
||||
if (mapList.containsKey(pvTerminalTreeOne.getPid())) {
|
||||
PvTerminalTreeVO pvTerminalTreeTwo = mapList.get(pvTerminalTreeOne.getPid());
|
||||
if (Objects.nonNull(pvTerminalTreeTwo)) {
|
||||
item.setProvince(pvTerminalTreeTwo.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mapList.containsKey(item.getPlanOrgId())) {
|
||||
item.setPlanOrgName(mapList.get(item.getPlanOrgId()).getName());
|
||||
}
|
||||
|
||||
// SupvFile supvFile = supvFileMapper.selectOne(new LambdaQueryWrapper<SupvFile>().eq(SupvFile::getBusiId, item.getPlanId()).eq(SupvFile::getType, 0));
|
||||
// if (Objects.nonNull(supvFile)) {
|
||||
// item.setAttachmentName(supvFile.getAttachmentName());
|
||||
// }
|
||||
|
||||
List<User> userList = userFeignClient.getUserByIdList(userIds).getData();
|
||||
Map<String, User> map = userList.stream().collect(Collectors.toMap(User::getId, Function.identity()));
|
||||
|
||||
if (map.containsKey(item.getPlanUserId())) {
|
||||
item.setPlanUserName(map.get(item.getPlanUserId()).getName());
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
Page<SupervisionPlanVO> pageVo = new Page<>();
|
||||
pageVo.setTotal(page.getTotal());
|
||||
pageVo.setPages(page.getPages());
|
||||
pageVo.setSize(page.getSize());
|
||||
pageVo.setRecords(supvPlanVOList);
|
||||
return pageVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String initiateAudit(String id) {
|
||||
|
||||
SupervisionPlanPO byId = this.getById(id);
|
||||
|
||||
List<SupervisionProblemPO> list = supervisionProblemPOService.lambdaQuery().eq(SupervisionProblemPO::getPlanId, id).list();
|
||||
if (CollectionUtil.isEmpty(list)){
|
||||
throw new BusinessException("请填写完事实问题在提交审核");
|
||||
}
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<String, List<String>> ());
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(byId.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
byId.setProcessInstanceId(processInstanceId);
|
||||
this.baseMapper.updateById(byId);
|
||||
return processInstanceId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupervisionPlanVO getDetailPlan(String id) {
|
||||
SupervisionPlanVO supervisionPlanVO = new SupervisionPlanVO();
|
||||
List<PvTerminalTreeVO> deptList = deptFeignClient.allDeptList().getData();
|
||||
Map<String, PvTerminalTreeVO> mapList = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getId, Function.identity()));
|
||||
SupervisionPlanPO byId = this.getById(id);
|
||||
BeanUtils.copyProperties(byId,supervisionPlanVO);
|
||||
|
||||
if (mapList.containsKey(supervisionPlanVO.getSupvOrgId())) {
|
||||
PvTerminalTreeVO pvTerminalTreeVO = null;
|
||||
|
||||
pvTerminalTreeVO = mapList.get(supervisionPlanVO.getSupvOrgId());
|
||||
supervisionPlanVO.setSupvOrgName(pvTerminalTreeVO.getName());
|
||||
int deptLevel = pvTerminalTreeVO.getPids().split(StrUtil.COMMA).length;
|
||||
if (deptLevel == 2) {
|
||||
//省
|
||||
supervisionPlanVO.setProvince(pvTerminalTreeVO.getName());
|
||||
} else if (deptLevel == 3) {
|
||||
//市
|
||||
supervisionPlanVO.setCity(pvTerminalTreeVO.getName());
|
||||
if (mapList.containsKey(pvTerminalTreeVO.getPid())) {
|
||||
PvTerminalTreeVO pvTerminalTreeOne = mapList.get(pvTerminalTreeVO.getPid());
|
||||
supervisionPlanVO.setProvince(pvTerminalTreeOne.getName());
|
||||
}
|
||||
} else if (deptLevel == 4) {
|
||||
//县
|
||||
if (mapList.containsKey(pvTerminalTreeVO.getPid())) {
|
||||
supervisionPlanVO.setCounty(pvTerminalTreeVO.getName());
|
||||
PvTerminalTreeVO pvTerminalTreeOne = mapList.get(pvTerminalTreeVO.getPid());
|
||||
if (Objects.nonNull(pvTerminalTreeOne)) {
|
||||
supervisionPlanVO.setCity(pvTerminalTreeOne.getName());
|
||||
if (mapList.containsKey(pvTerminalTreeOne.getPid())) {
|
||||
PvTerminalTreeVO pvTerminalTreeTwo = mapList.get(pvTerminalTreeOne.getPid());
|
||||
if (Objects.nonNull(pvTerminalTreeTwo)) {
|
||||
supervisionPlanVO.setProvince(pvTerminalTreeTwo.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mapList.containsKey(supervisionPlanVO.getPlanOrgId())) {
|
||||
supervisionPlanVO.setPlanOrgName(mapList.get(supervisionPlanVO.getPlanOrgId()).getName());
|
||||
}
|
||||
|
||||
// SupvFile supvFile = supvFileMapper.selectOne(new LambdaQueryWrapper<SupvFile>().eq(SupvFile::getBusiId, item.getPlanId()).eq(SupvFile::getType, 0));
|
||||
// if (Objects.nonNull(supvFile)) {
|
||||
// item.setAttachmentName(supvFile.getAttachmentName());
|
||||
// }
|
||||
|
||||
// List<User> userList = userFeignClient.getUserByIdList(userIds).getData();
|
||||
// Map<String, User> map = userList.stream().collect(Collectors.toMap(User::getId, Function.identity()));
|
||||
//
|
||||
// if (map.containsKey(supervisionPlanVO.getPlanUserId())) {
|
||||
// supervisionPlanVO.setPlanUserName(map.get(supervisionPlanVO.getPlanUserId()).getName());
|
||||
// }
|
||||
|
||||
return supervisionPlanVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(String businessKey, Integer status) {
|
||||
this.lambdaUpdate().set(SupervisionPlanPO::getStatus,status).eq(SupervisionPlanPO::getPlanId,businessKey).update();
|
||||
}
|
||||
|
||||
|
||||
private void checkParam(SupervisionPlanParam supvPlanParam, Boolean updateFlag) {
|
||||
|
||||
LambdaQueryWrapper<SupervisionPlanPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SupervisionPlanPO::getWorkPlanName, supvPlanParam.getWorkPlanName());
|
||||
|
||||
if (updateFlag) {
|
||||
if (supvPlanParam instanceof SupervisionPlanParam.UpdateSupvPlanParam) {
|
||||
//修改
|
||||
lambdaQueryWrapper.ne(SupervisionPlanPO::getPlanId, ((SupervisionPlanParam.UpdateSupvPlanParam) supvPlanParam).getPlanId());
|
||||
}
|
||||
}
|
||||
|
||||
int count = this.count(lambdaQueryWrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException("监督计划名称已存在");
|
||||
}
|
||||
|
||||
//判断监督对象类型
|
||||
/* if (StrUtil.isNotBlank(supvPlanParam.getSupvObjType())) {
|
||||
DictData dictData = dicDataFeignClient.getDicDataById(supvPlanParam.getSupvType()).getData();
|
||||
if (dictData.getCode().equals(DicDataEnum.New_Energy.getCode())) {
|
||||
if (StrUtil.isBlank(supvPlanParam.getSupvObjType())) {
|
||||
throw new BusinessException("监督对象类型不可为空");
|
||||
}
|
||||
if (StrUtil.isBlank(supvPlanParam.getObjType())) {
|
||||
throw new BusinessException("监督对象属性名称不可为空");
|
||||
}
|
||||
if (Objects.isNull(supvPlanParam.getObjCapacity())) {
|
||||
throw new BusinessException("监督对象协议容量不可为空");
|
||||
}
|
||||
} else if (!dictData.getCode().equals(DicDataEnum.Technical_Super.getCode())) {
|
||||
if (StrUtil.isBlank(supvPlanParam.getSupvObjName())) {
|
||||
throw new BusinessException("监督对象名称不可为空");
|
||||
}
|
||||
if (StrUtil.isBlank(supvPlanParam.getObjVoltageLevel())) {
|
||||
throw new BusinessException("监督对象电压等级不可为空");
|
||||
}
|
||||
|
||||
} else if (!dictData.getCode().equals(DicDataEnum.POWER_QUALITY.getCode())) {
|
||||
if (Objects.isNull(supvPlanParam.getObjCapacity())) {
|
||||
throw new BusinessException("监督对象协议容量不可为空");
|
||||
}
|
||||
}
|
||||
}*/
|
||||
//判断时间范围
|
||||
if(StrUtil.isAllNotBlank(supvPlanParam.getEffectStartTime(),supvPlanParam.getEffectEndTime())||
|
||||
StrUtil.isAllNotBlank(supvPlanParam.getEffectStartTime(),supvPlanParam.getReportIssueTime())
|
||||
){
|
||||
String problemOcTime1 = supvPlanParam.getProblemOcTime();
|
||||
if(StrUtil.isNotBlank(problemOcTime1)){
|
||||
//实施开始时间
|
||||
DateTime effectStartTime = DateUtil.parse(supvPlanParam.getEffectStartTime(), "yyyy-MM-dd HH:mm:ss");
|
||||
//问题发现时间
|
||||
DateTime problemOcTime = DateUtil.parse(problemOcTime1, "yyyy-MM-dd HH:mm:ss");
|
||||
Boolean fly = false;
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectEndTime())){
|
||||
//实施结束时间
|
||||
DateTime effectEndTime = DateUtil.parse(supvPlanParam.getEffectEndTime(), "yyyy-MM-dd HH:mm:ss");
|
||||
if (DateUtil.isIn(problemOcTime, effectStartTime, effectEndTime)) {
|
||||
fly = true;
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getReportIssueTime())){
|
||||
//报告出具时间
|
||||
DateTime reportIssueTime = DateUtil.parse(supvPlanParam.getReportIssueTime(), "yyyy-MM-dd HH:mm:ss");
|
||||
if (DateUtil.isIn(problemOcTime, effectStartTime, reportIssueTime)) {
|
||||
fly = true;
|
||||
}
|
||||
}
|
||||
if (!fly) {
|
||||
throw new BusinessException("问题发现时时间,不在实施开始时间到(实施结束时间/报告出具时间)范围内");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.njcn.supervision.service.plan.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.common.utils.PubUtils;
|
||||
import com.njcn.supervision.mapper.plan.SupervisionPlanPOMapper;
|
||||
import com.njcn.supervision.mapper.plan.SupervisionProblemPOMapper;
|
||||
import com.njcn.supervision.pojo.param.plan.SupervisopnProblemParam;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionPlanPO;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionProblemPO;
|
||||
import com.njcn.supervision.service.plan.SupervisionProblemPOService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/5/20 19:50【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SupervisionProblemPOServiceImpl extends ServiceImpl<SupervisionProblemPOMapper, SupervisionProblemPO> implements SupervisionProblemPOService{
|
||||
|
||||
|
||||
private final SupervisionPlanPOMapper supervisionPlanPOMapper;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addProblem(SupervisopnProblemParam supvProblemParam) {
|
||||
checkParam(supvProblemParam.getPlanId(),supvProblemParam.getDiscoveryTime());
|
||||
SupervisionProblemPO supvProblem = new SupervisionProblemPO();
|
||||
BeanUtil.copyProperties(supvProblemParam, supvProblem);
|
||||
supvProblem.setPlanRectificationTime(PubUtils.beginTimeToLocalDateTime(supvProblemParam.getPlanRectificationTime()));
|
||||
if(StrUtil.isNotBlank(supvProblemParam.getRectificationTime())) {
|
||||
supvProblem.setRectificationTime(PubUtils.beginTimeToLocalDateTime(supvProblemParam.getRectificationTime()));
|
||||
}
|
||||
this.save(supvProblem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SupervisionProblemPO> pageProblem(SupervisopnProblemParam supvProblemParam) {
|
||||
DictData stamped_report = dicDataFeignClient.getDicDataByCode("Stamped_Report").getData();
|
||||
|
||||
LambdaQueryWrapper<SupervisionProblemPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SupervisionProblemPO::getPlanId, supvProblemParam.getPlanId());
|
||||
Page<SupervisionProblemPO> page = this.page(new Page<>(PageFactory.getPageNum(supvProblemParam), PageFactory.getPageSize(supvProblemParam)), lambdaQueryWrapper);
|
||||
|
||||
List<PvTerminalTreeVO> deptList = deptFeignClient.allDeptList().getData();
|
||||
Map<String, PvTerminalTreeVO> mapCode = deptList.stream().collect(Collectors.toMap(PvTerminalTreeVO::getCode, Function.identity()));
|
||||
|
||||
for (SupervisionProblemPO item : page.getRecords()) {
|
||||
if (mapCode.containsKey(item.getDutyOrgId())) {
|
||||
item.setDutyOrgName(mapCode.get(item.getDutyOrgId()).getName());
|
||||
}
|
||||
|
||||
// List<SupvFile> supvFileList = supvFileMapper.selectList(new LambdaQueryWrapper<SupvFile>().eq(SupvFile::getBusiId, item.getProblemId()).eq(SupvFile::getType, 1));
|
||||
// if (CollUtil.isNotEmpty(supvFileList)) {
|
||||
// for(SupvFile supvFile:supvFileList){
|
||||
// if(supvFile.getAttachmentType().equals(stamped_report.getId())){
|
||||
// item.setAttachmentName(supvFile.getAttachmentName());
|
||||
// }else {
|
||||
// item.setAttachmentNameTwo(supvFile.getAttachmentName());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
//判断是否存在时间范围内
|
||||
public void checkParam(String id,String time) {
|
||||
if(StrUtil.isNotBlank(time)){
|
||||
SupervisionPlanPO supvPlan = supervisionPlanPOMapper.selectById(id);
|
||||
if(ObjectUtil.isNotNull(supvPlan)){
|
||||
//判断时间范围
|
||||
if (ObjectUtil.isAllNotEmpty(supvPlan.getEffectStartTime(), supvPlan.getEffectEndTime())||
|
||||
ObjectUtil.isAllNotEmpty(supvPlan.getEffectStartTime(), supvPlan.getReportIssueTime())
|
||||
) {
|
||||
//实施开始时间
|
||||
DateTime effectStartTime = DateUtil.parse(DateUtil.formatLocalDateTime(supvPlan.getEffectStartTime()), "yyyy-MM-dd HH:mm:ss");
|
||||
//问题发现时间
|
||||
DateTime problemOcTime = DateUtil.parse(time, "yyyy-MM-dd HH:mm:ss");
|
||||
Boolean fly = false;
|
||||
if(ObjectUtil.isNotNull(supvPlan.getEffectEndTime())){
|
||||
//实施结束时间
|
||||
DateTime effectEndTime = DateUtil.parse(DateUtil.formatLocalDateTime(supvPlan.getEffectEndTime()), "yyyy-MM-dd HH:mm:ss");
|
||||
if (DateUtil.isIn(problemOcTime, effectStartTime, effectEndTime)) {
|
||||
fly = true;
|
||||
}
|
||||
}
|
||||
if(ObjectUtil.isNotNull(supvPlan.getReportIssueTime())){
|
||||
//报告出具时间
|
||||
DateTime reportIssueTime = DateUtil.parse(DateUtil.formatLocalDateTime(supvPlan.getReportIssueTime()), "yyyy-MM-dd HH:mm:ss");
|
||||
if (DateUtil.isIn(problemOcTime, effectStartTime, reportIssueTime)) {
|
||||
fly = true;
|
||||
}
|
||||
}
|
||||
if (!fly) {
|
||||
throw new BusinessException("问题发现时时间,不在实施开始时间到(实施结束时间/报告出具时间)范围内");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,34 +6,46 @@ import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm;
|
||||
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO;
|
||||
import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO;
|
||||
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanDetailVO;
|
||||
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/5/13 18:35【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface SupervisionGeneralSurveyPlanPOService extends IService<SupervisionGeneralSurveyPlanPO>{
|
||||
public interface SupervisionGeneralSurveyPlanPOService extends IService<SupervisionGeneralSurveyPlanPO> {
|
||||
|
||||
|
||||
String addDevReport(SupervisionGeneralSurveyPlanParm supervisionGeneralSurveyPlanParm);
|
||||
String addDevReport(SupervisionGeneralSurveyPlanParm supervisionGeneralSurveyPlanParm);
|
||||
|
||||
boolean auditSurvey(SupervisionGeneralSurveyPlanParm.SupervisionGeneralSurveyPlanUpdate supervisionGeneralSurveyPlanUpdate);
|
||||
boolean auditSurvey(SupervisionGeneralSurveyPlanParm.SupervisionGeneralSurveyPlanUpdate supervisionGeneralSurveyPlanUpdate);
|
||||
|
||||
Boolean removeSurvey(List<String> ids);
|
||||
Boolean removeSurvey(List<String> ids);
|
||||
|
||||
Page<SupervisionGeneralSurveyPlanVO> getSurvey(SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam);
|
||||
|
||||
/**
|
||||
* 分页查询当前用户能看到的普测计划中存在超标问题
|
||||
*/
|
||||
Page<SupervisionGeneralSurveyPlanDetailVO> pageProblemSubstationBySurvey(SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam);
|
||||
|
||||
SupervisionGeneralSurveyPlanVO querySurveyDetail(String id);
|
||||
|
||||
List<DeptSubstationVO> initDetpStataionTree(String orgId);
|
||||
|
||||
void updateStatus(String businessKey, Integer status);
|
||||
void updateStatus(String businessKey, Integer status);
|
||||
|
||||
String cancelGeneralSurvey(BpmProcessInstanceCancelParam cancelReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 针对有问题的现场测试发起告警单
|
||||
* @param id 有问题的测试记录id
|
||||
*/
|
||||
void initiateWarningLeaflet(String id,String subId);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
package com.njcn.supervision.service.survey.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
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.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||
@@ -13,6 +20,7 @@ import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
@@ -20,15 +28,20 @@ import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||
import com.njcn.supervision.enums.LeafletTypeEnum;
|
||||
import com.njcn.supervision.enums.ProblemTypeEnum;
|
||||
import com.njcn.supervision.mapper.survey.SupervisionGeneralSurveyPlanPOMapper;
|
||||
import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm;
|
||||
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanDetailPO;
|
||||
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO;
|
||||
import com.njcn.supervision.pojo.vo.survey.DeptSubstationVO;
|
||||
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanDetailVO;
|
||||
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanVO;
|
||||
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
|
||||
import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanDetailPOService;
|
||||
import com.njcn.supervision.service.survey.SupervisionGeneralSurveyPlanPOService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
@@ -51,7 +64,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<SupervisionGeneralSurveyPlanPOMapper, SupervisionGeneralSurveyPlanPO> implements SupervisionGeneralSurveyPlanPOService{
|
||||
public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<SupervisionGeneralSurveyPlanPOMapper, SupervisionGeneralSurveyPlanPO> implements SupervisionGeneralSurveyPlanPOService {
|
||||
/**
|
||||
* 用户信息建档对应的流程定义 KEY todo 修改成普测的key
|
||||
*/
|
||||
@@ -62,6 +75,8 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final IWarningLeafletService warningLeafletService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -77,7 +92,7 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
this.save(supervisionGeneralSurveyPlanPO);
|
||||
String planNo = supervisionGeneralSurveyPlanPO.getPlanNo();
|
||||
//保存普测计划电站表
|
||||
if(CollectionUtil.isNotEmpty(supervisionGeneralSurveyPlanParm.getSubIds())){
|
||||
if (CollectionUtil.isNotEmpty(supervisionGeneralSurveyPlanParm.getSubIds())) {
|
||||
SubstationParam param = new SubstationParam();
|
||||
param.setPowerIds(supervisionGeneralSurveyPlanParm.getSubIds());
|
||||
List<SubGetBase> stationList = commTerminalGeneralClient.tagOrIdGetSub(param).getData();
|
||||
@@ -90,11 +105,11 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
supervisionGeneralSurveyPlanDetailPO.setSubName(stat.getName());
|
||||
/*目前时间与计划开始时间,结束时间一致*/
|
||||
supervisionGeneralSurveyPlanDetailPO.setVoltageLevel(stat.getVoltageLevel());
|
||||
List<Line> lines= lineFeignClient.getSubIndexLineDetail(stat.getId()).getData();
|
||||
if(CollectionUtil.isEmpty(lines)){
|
||||
List<Line> lines = lineFeignClient.getSubIndexLineDetail(stat.getId()).getData();
|
||||
if (CollectionUtil.isEmpty(lines)) {
|
||||
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId("");
|
||||
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0);
|
||||
}else {
|
||||
} else {
|
||||
String subList = lines.stream().map(Line::getName).collect(Collectors.joining(","));
|
||||
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId(subList);
|
||||
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(1);
|
||||
@@ -110,19 +125,17 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(planNo);
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionGeneralSurveyPlanParm.getStartUserSelectAssignees());
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionGeneralSurveyPlanPO.getCreateBy(),bpmProcessInstanceCreateReqDTO).getData();
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionGeneralSurveyPlanPO.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
supervisionGeneralSurveyPlanPO.setProcessInstanceId(processInstanceId);
|
||||
this.baseMapper.updateById(supervisionGeneralSurveyPlanPO);
|
||||
return planNo;
|
||||
}{
|
||||
}
|
||||
{
|
||||
throw new BusinessException("请选择电站");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -148,10 +161,10 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
/*目前时间与计划开始时间,结束时间一致*/
|
||||
supervisionGeneralSurveyPlanDetailPO.setVoltageLevel(stat.getVoltageLevel());
|
||||
List<String> unitChildrenList = stat.getUnitChildrenList();
|
||||
if(CollectionUtil.isEmpty(unitChildrenList)){
|
||||
if (CollectionUtil.isEmpty(unitChildrenList)) {
|
||||
supervisionGeneralSurveyPlanDetailPO.setMeasurementPointId("");
|
||||
supervisionGeneralSurveyPlanDetailPO.setIsSurvey(0);
|
||||
}else {
|
||||
} else {
|
||||
List<LineDetailDataVO> data = lineFeignClient.getLineDetailList(unitChildrenList).getData();
|
||||
|
||||
String subList = data.stream().map(LineDetailDataVO::getLineName).collect(Collectors.joining(","));
|
||||
@@ -162,7 +175,7 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
supervisionGeneralSurveyPlanDetailPOS.add(supervisionGeneralSurveyPlanDetailPO);
|
||||
}
|
||||
//清除原有的
|
||||
supervisionGeneralSurveyPlanDetailPOService.remove(new QueryWrapper<SupervisionGeneralSurveyPlanDetailPO>().lambda().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo,planNo));
|
||||
supervisionGeneralSurveyPlanDetailPOService.remove(new QueryWrapper<SupervisionGeneralSurveyPlanDetailPO>().lambda().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, planNo));
|
||||
supervisionGeneralSurveyPlanDetailPOService.saveOrUpdateBatchByMultiId(supervisionGeneralSurveyPlanDetailPOS, 500);
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
@@ -171,7 +184,7 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(planNo);
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionGeneralSurveyPlanUpdate.getStartUserSelectAssignees());
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(RequestUtil.getUserIndex(),bpmProcessInstanceCreateReqDTO).getData();
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(RequestUtil.getUserIndex(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
byId.setProcessInstanceId(processInstanceId);
|
||||
this.baseMapper.updateById(byId);
|
||||
@@ -184,7 +197,7 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
public Boolean removeSurvey(List<String> ids) {
|
||||
this.lambdaUpdate().set(SupervisionGeneralSurveyPlanPO::getState, 0).in(SupervisionGeneralSurveyPlanPO::getPlanNo, ids).update();
|
||||
supervisionGeneralSurveyPlanDetailPOService.remove(new QueryWrapper<SupervisionGeneralSurveyPlanDetailPO>().
|
||||
lambda().in(SupervisionGeneralSurveyPlanDetailPO::getPlanNo,ids));
|
||||
lambda().in(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, ids));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -204,10 +217,14 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
queryWrapper.in("supervision_general_survey_plan.org_no", data);
|
||||
}
|
||||
}
|
||||
//添加上时间范围
|
||||
queryWrapper.between("supervision_general_survey_plan.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(generalSurveyPlanQueryParam.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(generalSurveyPlanQueryParam.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_general_survey_plan.create_time");
|
||||
Page<SupervisionGeneralSurveyPlanVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(generalSurveyPlanQueryParam), PageFactory.getPageSize(generalSurveyPlanQueryParam)), queryWrapper);
|
||||
|
||||
page.getRecords().stream().forEach(temp->{
|
||||
page.getRecords().stream().forEach(temp -> {
|
||||
temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgNo()).getData().getName()));
|
||||
//获取普测下电站详情
|
||||
List<SupervisionGeneralSurveyPlanDetailPO> list = supervisionGeneralSurveyPlanDetailPOService.lambdaQuery().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, temp.getPlanNo()).list();
|
||||
@@ -219,11 +236,31 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SupervisionGeneralSurveyPlanDetailVO> pageProblemSubstationBySurvey(SupervisionGeneralSurveyPlanParm.GeneralSurveyPlanQueryParam generalSurveyPlanQueryParam) {
|
||||
QueryWrapper<SupervisionGeneralSurveyPlanDetailVO> supervisionGeneralSurveyPlanDetailVOQueryWrapper = new QueryWrapper<>();
|
||||
if (Objects.nonNull(generalSurveyPlanQueryParam)) {
|
||||
//添加上时间范围
|
||||
supervisionGeneralSurveyPlanDetailVOQueryWrapper.between("supervision_general_survey_plan_detail.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(generalSurveyPlanQueryParam.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(generalSurveyPlanQueryParam.getSearchEndTime())));
|
||||
}
|
||||
//获取当前用户部门所有同事的id,查看该部门下所有的数据
|
||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||
supervisionGeneralSurveyPlanDetailVOQueryWrapper.in("supervision_general_survey_plan_detail.Create_By", colleaguesIds)
|
||||
.eq("supervision_general_survey_plan.status", BpmProcessInstanceStatusEnum.APPROVE.getStatus())
|
||||
.orderByDesc("supervision_general_survey_plan_detail.Update_Time");
|
||||
Page<SupervisionGeneralSurveyPlanDetailVO> page = this.baseMapper.pageProblemSubstationBySurvey(new Page<>(PageFactory.getPageNum(generalSurveyPlanQueryParam), PageFactory.getPageSize(generalSurveyPlanQueryParam)), supervisionGeneralSurveyPlanDetailVOQueryWrapper);
|
||||
//填充部门名称
|
||||
page.getRecords().forEach(temp -> temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgNo()).getData().getName())));
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupervisionGeneralSurveyPlanVO querySurveyDetail(String id) {
|
||||
SupervisionGeneralSurveyPlanVO supervisionGeneralSurveyPlanVO = new SupervisionGeneralSurveyPlanVO();
|
||||
SupervisionGeneralSurveyPlanPO byId = this.getById(id);
|
||||
BeanUtils.copyProperties(byId,supervisionGeneralSurveyPlanVO);
|
||||
BeanUtils.copyProperties(byId, supervisionGeneralSurveyPlanVO);
|
||||
//获取普测下电站详情
|
||||
List<SupervisionGeneralSurveyPlanDetailPO> list = supervisionGeneralSurveyPlanDetailPOService.lambdaQuery().eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id).list();
|
||||
supervisionGeneralSurveyPlanVO.setSupervisionGeneralSurveyPlanDetailPOS(list);
|
||||
@@ -277,7 +314,7 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
|
||||
@Override
|
||||
public void updateStatus(String businessKey, Integer status) {
|
||||
this.lambdaUpdate().set(SupervisionGeneralSurveyPlanPO::getStatus,status).eq(SupervisionGeneralSurveyPlanPO::getPlanNo,businessKey).update();
|
||||
this.lambdaUpdate().set(SupervisionGeneralSurveyPlanPO::getStatus, status).eq(SupervisionGeneralSurveyPlanPO::getPlanNo, businessKey).update();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -292,6 +329,57 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
return supervisionGeneralSurveyPlanPO.getPlanNo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiateWarningLeaflet(String id, String subId) {
|
||||
//获取数据源用于组装数据
|
||||
LambdaQueryWrapper<SupervisionGeneralSurveyPlanDetailPO> detailPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
detailPOLambdaQueryWrapper.eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id)
|
||||
.eq(SupervisionGeneralSurveyPlanDetailPO::getSubId, subId);
|
||||
SupervisionGeneralSurveyPlanDetailPO detailPlan = supervisionGeneralSurveyPlanDetailPOService.getOne(detailPOLambdaQueryWrapper);
|
||||
SupervisionGeneralSurveyPlanPO generalSurveyPlan = this.getById(id);
|
||||
/*
|
||||
* 1、预告警单名称,此处暂时用普测计划名称+变电站名称组成预告警单名
|
||||
* 2、预告警编号暂时随机by yxb
|
||||
* 3、问题类型:1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标,此处是现场测试超标
|
||||
* 4、对应问题源id,用于查询详细数据
|
||||
* 5、单子类型:1:预警单;2:告警单
|
||||
* 6、问题详细描述
|
||||
* */
|
||||
warningLeafletService.createLeaflet(
|
||||
generalSurveyPlan.getPlanName().concat(StrPool.UNDERLINE).concat(detailPlan.getSubName()),
|
||||
IdWorker.get32UUID(),
|
||||
id,
|
||||
ProblemTypeEnum.SITE_TEST.getCode(),
|
||||
LeafletTypeEnum.ALARM.getCode(),
|
||||
assembleIssueDetail(detailPlan,generalSurveyPlan)
|
||||
);
|
||||
//将当前的问题记录是否告警修改为已告警
|
||||
LambdaUpdateWrapper<SupervisionGeneralSurveyPlanDetailPO> detailPOLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
detailPOLambdaUpdateWrapper.set(SupervisionGeneralSurveyPlanDetailPO::getInitiateWarningFlag, 1)
|
||||
.eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id)
|
||||
.eq(SupervisionGeneralSurveyPlanDetailPO::getSubId, subId);
|
||||
supervisionGeneralSurveyPlanDetailPOService.update(detailPOLambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装谐波普测的问题
|
||||
* 格式:planCreateTime发起的planName普测计划,由负责人leader测试后,于planComplateTime完成,其中subName在本次普测计划测试中存在电能质量问题,详细请查看附件
|
||||
*/
|
||||
private String assembleIssueDetail(SupervisionGeneralSurveyPlanDetailPO detailPlan, SupervisionGeneralSurveyPlanPO generalSurveyPlan) {
|
||||
String issueDetail = "于"
|
||||
.concat(LocalDateTimeUtil.format(generalSurveyPlan.getPlanCreateTime(), DatePattern.CHINESE_DATE_PATTERN))
|
||||
.concat("发起的")
|
||||
.concat(generalSurveyPlan.getPlanName())
|
||||
.concat("普测计划,由负责人")
|
||||
.concat(generalSurveyPlan.getLeader())
|
||||
.concat("测试后,于")
|
||||
.concat(LocalDateTimeUtil.format(generalSurveyPlan.getPlanComplateTime(), DatePattern.CHINESE_DATE_PATTERN))
|
||||
.concat("完成,其中")
|
||||
.concat(detailPlan.getSubName())
|
||||
.concat("在本次普测计划测试中存在电能质量问题,详细请查看问题附件");
|
||||
return issueDetail;
|
||||
}
|
||||
|
||||
|
||||
public List<DeptSubstationVO> recursion(DeptSubstationVO result, String orgdid) {
|
||||
List<DeptSubstationVO> deptSubstationVOList = new ArrayList<>();
|
||||
@@ -313,13 +401,13 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 校验计划名称是否存在
|
||||
* @Param: * @param userReportParam 用户申请数据
|
||||
* * @param isExcludeSelf 是否排除自己,一般新增不排除,更新时需要排除自己
|
||||
* @return: void
|
||||
* @Author: clam
|
||||
* @Date: 2024/5/13
|
||||
*/
|
||||
* @Description: 校验计划名称是否存在
|
||||
* @Param: * @param userReportParam 用户申请数据
|
||||
* * @param isExcludeSelf 是否排除自己,一般新增不排除,更新时需要排除自己
|
||||
* @return: void
|
||||
* @Author: clam
|
||||
* @Date: 2024/5/13
|
||||
*/
|
||||
private void checkPlanName(SupervisionGeneralSurveyPlanParm supervisionGeneralSurveyPlanParm, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<SupervisionGeneralSurveyPlanPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userReportPOLambdaQueryWrapper
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.njcn.supervision.service.user;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportNormalParam;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportNormalPO;
|
||||
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 干扰源用户常态化管理 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2024-05-17
|
||||
*/
|
||||
public interface IUserReportNormalService extends IService<UserReportNormalPO> {
|
||||
|
||||
String addUserNormal(UserReportNormalParam userReportNormalParam);
|
||||
|
||||
|
||||
Page<UserReportVO.UserReportGoNetVO> userReportGoNetPage(UserReportNormalParam userReportNormalParam);
|
||||
|
||||
|
||||
UserReportVO.UserReportGoNetVO userReportGoNetById(String id);
|
||||
|
||||
|
||||
void updateUserReportNormalStatus(String businessKey,Integer status);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package com.njcn.supervision.service.user.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||
import com.njcn.supervision.mapper.user.UserReportNormalMapper;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportNormalParam;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportNormalPO;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
||||
import com.njcn.supervision.service.user.IUserReportNormalService;
|
||||
import com.njcn.supervision.service.user.UserReportPOService;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 干扰源用户常态化管理 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2024-05-17
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMapper, UserReportNormalPO> implements IUserReportNormalService {
|
||||
|
||||
/**
|
||||
* 用户信息建档对应的流程定义 KEY
|
||||
*/
|
||||
public static final String PROCESS_KEY = "user_go_net";
|
||||
public static final String PROCESS_OTHER_KEY ="user_treat_check";
|
||||
|
||||
|
||||
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
|
||||
private final UserReportPOService userReportPOService;
|
||||
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final UserFeignClient userFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String addUserNormal(UserReportNormalParam userReportNormalParam) {
|
||||
UserReportNormalPO userReportNormalPO = new UserReportNormalPO();
|
||||
BeanUtil.copyProperties(userReportNormalParam, userReportNormalPO);
|
||||
userReportNormalPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
userReportNormalPO.setStatus(FlowStatusEnum.AUDIT.getCode());
|
||||
this.save(userReportNormalPO);
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
if(userReportNormalParam.getType() == 0){
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
|
||||
}else {
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_OTHER_KEY);
|
||||
}
|
||||
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportNormalPO.getId());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(userReportNormalParam.getStartUserSelectAssignees());
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(userReportNormalPO.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
userReportNormalPO.setProcessInstanceId(processInstanceId);
|
||||
this.baseMapper.updateById(userReportNormalPO);
|
||||
return userReportNormalPO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<UserReportVO.UserReportGoNetVO> userReportGoNetPage(UserReportNormalParam userReportNormalParam) {
|
||||
Page<UserReportVO.UserReportGoNetVO> pageResult = new Page<>();
|
||||
|
||||
|
||||
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||
List<User> userList = userFeignClient.getUserInfoByDeptIds(deptIds).getData();
|
||||
List<String> userIds = userList.stream().map(User::getId).distinct().collect(Collectors.toList());
|
||||
if(CollUtil.isEmpty(userIds)){
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<UserReportNormalPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.orderByDesc(UserReportNormalPO::getCreateTime)
|
||||
.eq(UserReportNormalPO::getType,userReportNormalParam.getType())
|
||||
.in(UserReportNormalPO::getCreateBy, userIds)
|
||||
.eq(UserReportNormalPO::getUserReportId,userReportNormalParam.getUserReportId());
|
||||
Page<UserReportNormalPO> page = this.page(new Page<>(PageFactory.getPageNum(userReportNormalParam), PageFactory.getPageSize(userReportNormalParam)), lambdaQueryWrapper);
|
||||
if (CollUtil.isNotEmpty(page.getRecords())) {
|
||||
List<String> ids = page.getRecords().stream().map(UserReportNormalPO::getUserReportId).distinct().collect(Collectors.toList());
|
||||
List<UserReportPO> userReportPOList = userReportPOService.list(new LambdaQueryWrapper<UserReportPO>().in(UserReportPO::getId, ids));
|
||||
Map<String, UserReportPO> map = userReportPOList.stream().collect(Collectors.toMap(UserReportPO::getId, Function.identity()));
|
||||
|
||||
List<UserReportVO.UserReportGoNetVO> temList = new ArrayList<>();
|
||||
page.getRecords().forEach(item -> {
|
||||
UserReportVO.UserReportGoNetVO vo = new UserReportVO.UserReportGoNetVO();
|
||||
UserReportPO userReportPO = map.get(item.getUserReportId());
|
||||
BeanUtil.copyProperties(userReportPO,vo);
|
||||
vo.setId(item.getId());
|
||||
vo.setUserReportId(item.getUserReportId());
|
||||
vo.setOtherReport(item.getReportUrl());
|
||||
vo.setProcessInstanceId(item.getProcessInstanceId());
|
||||
vo.setCreateTime(item.getCreateTime());
|
||||
vo.setStatus(item.getStatus());
|
||||
vo.setReporter(item.getCreateBy());
|
||||
temList.add(vo);
|
||||
});
|
||||
BeanUtil.copyProperties(page,pageResult);
|
||||
pageResult.setRecords(temList);
|
||||
}
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserReportVO.UserReportGoNetVO userReportGoNetById(String id) {
|
||||
UserReportNormalPO userReportNormalPO = this.getById(id);
|
||||
UserReportPO userReportPO = userReportPOService.getById(userReportNormalPO.getUserReportId());
|
||||
UserReportVO.UserReportGoNetVO vo = new UserReportVO.UserReportGoNetVO();
|
||||
BeanUtil.copyProperties(userReportPO,vo);
|
||||
BeanUtil.copyProperties(userReportNormalPO,vo);
|
||||
vo.setOtherReport(userReportNormalPO.getReportUrl());
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserReportNormalStatus(String businessKey, Integer status) {
|
||||
this.update(new UpdateWrapper<UserReportNormalPO>().lambda().set(UserReportNormalPO::getStatus,status).eq(UserReportNormalPO::getId,businessKey));
|
||||
}
|
||||
}
|
||||
@@ -251,6 +251,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
List<UserReportVO> collect = list.stream().map(temp -> {
|
||||
UserReportVO vo = new UserReportVO();
|
||||
BeanUtils.copyProperties(temp, vo);
|
||||
UserVO userVO = userFeignClient.getUserById(temp.getReporter()).getData();
|
||||
vo.setReporter(temp.getReporter());
|
||||
vo.setReporterName(userVO.getName());
|
||||
vo.setOrgName(deptFeignClient.getDeptById(temp.getOrgId()).getData().getName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
return collect;
|
||||
|
||||
Reference in New Issue
Block a user