1.冀北台账树编写
2.技术监督删除流程业务调整,支持多数据删除
This commit is contained in:
@@ -32,9 +32,13 @@ public enum LineBaseEnum {
|
||||
*/
|
||||
PV_UNIT_LEVEL(0,"单位"),
|
||||
PV_SUB_LEVEL(1,"变电站"),
|
||||
PV_SUB_AREA_LEVEL(2,"台区")
|
||||
|
||||
PV_SUB_AREA_LEVEL(2,"台区"),
|
||||
|
||||
/**
|
||||
* 电网标志
|
||||
*/
|
||||
POWER_FLAG(0,"电网侧"),
|
||||
POWER_FLAG_NOT(1,"非电网侧")
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -115,4 +115,7 @@ public class AreaLineInfoVO implements Serializable {
|
||||
|
||||
@ApiModelProperty(name = "type",value = "冀北电网一张图类型信息")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(name = "新能源场站信息ID")
|
||||
private String newStationId;
|
||||
}
|
||||
|
||||
@@ -124,4 +124,27 @@ public class LineVO implements Serializable {
|
||||
@ApiModelProperty(name = "newStationId",value = "新能源场站信息ID")
|
||||
private String newStationId;
|
||||
|
||||
/**
|
||||
* 电网侧变电站
|
||||
*/
|
||||
@ApiModelProperty(name = "powerSubstationName",value = "电网侧变电站")
|
||||
private String powerSubstationName;
|
||||
|
||||
/**
|
||||
* 监测点拥有者
|
||||
*/
|
||||
@ApiModelProperty(name = "owner",value = "监测点拥有者")
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 拥有者职务
|
||||
*/
|
||||
@ApiModelProperty(name = "ownerDuty",value = "拥有者职务")
|
||||
private String ownerDuty;
|
||||
|
||||
/**
|
||||
* 上级电站
|
||||
*/
|
||||
@ApiModelProperty(name = "superiorsSubstation",value = "上级电站")
|
||||
private String superiorsSubstation;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ public class TerminalTree implements Serializable {
|
||||
private Integer sort;
|
||||
@ApiModelProperty(name = "comFlag",value = "设备状态")
|
||||
private Integer comFlag;
|
||||
|
||||
@ApiModelProperty(name = "children",value = "子节点")
|
||||
private List<TerminalTree> children = new ArrayList<>();
|
||||
|
||||
@@ -59,4 +60,14 @@ public class TerminalTree implements Serializable {
|
||||
* 接线方式
|
||||
*/
|
||||
private Integer ptType;
|
||||
|
||||
/**
|
||||
* 电网标志(0-电网侧;1-非电网侧)
|
||||
*/
|
||||
private Integer powerFlag;
|
||||
|
||||
/**
|
||||
* 电网侧变电站
|
||||
*/
|
||||
private String powerSubstationName;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,9 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -32,13 +33,14 @@ import java.util.List;
|
||||
@Slf4j
|
||||
@Api(tags = "终端树管理")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/terminalTree")
|
||||
public class TerminalTreeController extends BaseController {
|
||||
|
||||
private final TerminalTreeService terminalTreeService;
|
||||
|
||||
|
||||
@Value("${isJb}")
|
||||
private Boolean isJb;
|
||||
|
||||
/**
|
||||
* 获取终端台账设备树
|
||||
@@ -50,7 +52,13 @@ public class TerminalTreeController extends BaseController {
|
||||
@GetMapping("getTerminalTree")
|
||||
public HttpResult<List<TerminalTree>> getTerminalTree(){
|
||||
String methodDescribe = getMethodDescribe("getTerminalTree");
|
||||
List<TerminalTree> tree = terminalTreeService.getTerminalTree();
|
||||
List<TerminalTree> tree;
|
||||
if(isJb){
|
||||
tree= terminalTreeService.getJbTerminalTree();
|
||||
}else{
|
||||
tree= terminalTreeService.getTerminalTree();
|
||||
}
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, tree, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -574,7 +574,8 @@
|
||||
detail.Calssification_Grade,
|
||||
detail.Superiors_Substation,
|
||||
detail.Hang_Line,
|
||||
loadtype.name loadType
|
||||
loadtype.name loadType,
|
||||
pq_line_detail.New_Station_Id as newStationId
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line_detail detail,
|
||||
|
||||
@@ -43,4 +43,10 @@ public interface TerminalTreeService {
|
||||
List<DeptLineTreeVO> getDeptBindDeptLineTree(String deptId, Integer deptType, String id, Integer type);
|
||||
|
||||
List<TerminalSelectTreeVO> getTerminalSelectTree(Integer level);
|
||||
|
||||
/**
|
||||
* 冀北设备台账树
|
||||
* @return
|
||||
*/
|
||||
List<TerminalTree> getJbTerminalTree();
|
||||
}
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.pojo.vo.TerminalSelectTreeVO;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.mapper.DeptLineMapper;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.TreeMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.vo.DeptLineTreeVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalTree;
|
||||
import com.njcn.device.pq.service.TerminalTreeService;
|
||||
@@ -24,10 +28,7 @@ import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -45,6 +46,8 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
|
||||
private final AreaFeignClient areaFeignClient;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
@@ -279,6 +282,127 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TerminalTree> getJbTerminalTree() {
|
||||
List<TerminalTree> taiZhang = new ArrayList<>();
|
||||
List<TerminalTree> allList = lineMapper.getAllList();
|
||||
List<TerminalTree> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> provinceList = lineMapper.getProvinceList(null, 0);
|
||||
|
||||
List<TerminalTree> collect1 = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.SUB_LEVEL.getCode()) ||
|
||||
item.getLevel().equals(LineBaseEnum.DEVICE_LEVEL.getCode()) ||
|
||||
item.getLevel().equals(LineBaseEnum.SUB_V_LEVEL.getCode())
|
||||
).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
|
||||
|
||||
List<TerminalTree> gdList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.GD_LEVEL.getCode())
|
||||
// && item.getName().equals("承德供电公司")
|
||||
).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> subList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.SUB_LEVEL.getCode())
|
||||
// && item.getName().equals("110kV兴泉变电站")
|
||||
|
||||
).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> lineList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.LINE_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
|
||||
//赋值电网侧信息
|
||||
List<String> lineIds = lineList.stream().map(TerminalTree::getId).collect(Collectors.toList());
|
||||
List<LineDetail> list = lineDetailMapper.selectList(new LambdaQueryWrapper<LineDetail>().in(CollUtil.isNotEmpty(lineIds), LineDetail::getId, lineIds));
|
||||
Map<String, LineDetail> powerFlagMap = list.stream().collect(Collectors.toMap(LineDetail::getId, Function.identity()));
|
||||
for (TerminalTree x : lineList) {
|
||||
if(powerFlagMap.containsKey(x.getId())){
|
||||
x.setPowerFlag(powerFlagMap.get(x.getId()).getPowerFlag());
|
||||
x.setPowerSubstationName(powerFlagMap.get(x.getId()).getPowerSubstationName());
|
||||
}else{
|
||||
x.setPowerFlag(LineBaseEnum.POWER_FLAG.getCode());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Map<String, List<TerminalTree>> lineObjNameMap = lineList.stream().filter(x -> StrUtil.isNotBlank(x.getPowerSubstationName())).collect(Collectors.groupingBy(TerminalTree::getPowerSubstationName));
|
||||
//组织变电站信息
|
||||
List<TerminalTree> subInfoList = new ArrayList<>();
|
||||
|
||||
lineObjNameMap.forEach((key, value)->{
|
||||
List<TerminalTree> valueList = new ArrayList<>();
|
||||
//电网侧监测点
|
||||
TerminalTree powerTree=new TerminalTree();
|
||||
powerTree.setName("电网侧");
|
||||
List<TerminalTree> powerFlag = value.stream().filter(x -> x.getPowerFlag().equals(LineBaseEnum.POWER_FLAG.getCode())).collect(Collectors.toList());
|
||||
List<TerminalTree> subChildren = getRecursionChildren(powerFlag, collect1);
|
||||
powerTree.setChildren(new ArrayList<>());
|
||||
|
||||
//非电网侧监测点
|
||||
TerminalTree notPowerTree=new TerminalTree();
|
||||
notPowerTree.setName("非电网侧");
|
||||
List<TerminalTree> powerFlagNot = value.stream().filter(x -> x.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())).collect(Collectors.toList());
|
||||
List<TerminalTree> notSubChildren = getRecursionChildren(powerFlagNot, collect1);
|
||||
notPowerTree.setChildren(new ArrayList<>());
|
||||
valueList.add(powerTree);
|
||||
valueList.add(notPowerTree);
|
||||
//获取变电信息
|
||||
List<TerminalTree> collect = subList.stream().filter(x -> x.getName().equals(key)).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(collect)){
|
||||
TerminalTree sub=new TerminalTree();
|
||||
sub.setId(collect.get(0).getId());
|
||||
sub.setName(collect.get(0).getName());
|
||||
sub.setPid(collect.get(0).getPid());
|
||||
sub.setChildren(valueList);
|
||||
powerTree.setChildren(subChildren);
|
||||
notPowerTree.setChildren(notSubChildren);
|
||||
subInfoList.add(sub);
|
||||
}else{
|
||||
//电网侧变电站能否找到
|
||||
for (TerminalTree child : subChildren) {
|
||||
List<TerminalTree> exist = subInfoList.stream().filter(x -> x.getId().equals(child.getId())).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(exist)){
|
||||
//电网侧
|
||||
exist.get(0).getChildren().get(0).getChildren().addAll(child.getChildren());
|
||||
}else{
|
||||
TerminalTree sub=new TerminalTree();
|
||||
sub.setId(child.getId());
|
||||
sub.setName(child.getName());
|
||||
sub.setPid(child.getPid());
|
||||
valueList.get(0).setChildren(Arrays.asList(child));
|
||||
sub.setChildren(valueList);
|
||||
subInfoList.add(sub);
|
||||
}
|
||||
}
|
||||
for (TerminalTree child : notSubChildren) {
|
||||
List<TerminalTree> exist = subInfoList.stream().filter(x -> x.getId().equals(child.getId())).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(exist)){
|
||||
//非电网侧
|
||||
exist.get(1).getChildren().get(0).getChildren().addAll(child.getChildren());
|
||||
}else{
|
||||
TerminalTree sub=new TerminalTree();
|
||||
sub.setId(child.getId());
|
||||
sub.setName(child.getName());
|
||||
sub.setPid(child.getPid());
|
||||
valueList.get(1).setChildren(Arrays.asList(child));
|
||||
sub.setChildren(valueList);
|
||||
subInfoList.add(sub);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gdList.forEach(gd -> gd.setChildren(getChildren(gd, subInfoList)));
|
||||
provinceList.forEach(province -> province.setChildren(getChildren(province, gdList)));
|
||||
projectList.forEach(project -> project.setChildren(getChildren(project, provinceList)));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(allList)) {
|
||||
TerminalTree terminalTree = new TerminalTree();
|
||||
terminalTree.setId("9999999");
|
||||
terminalTree.setLevel(0);
|
||||
terminalTree.setName("台账管理");
|
||||
if (CollectionUtil.isNotEmpty(projectList)) {
|
||||
terminalTree.setChildren(projectList);
|
||||
}
|
||||
taiZhang.add(terminalTree);
|
||||
}
|
||||
return taiZhang;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取全部子节点
|
||||
@@ -290,6 +414,53 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
return all.stream().filter(allItem -> allItem.getPid().equals(item.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 变电站层级增加电网侧和非电网侧电站
|
||||
* @param line 变电站对象
|
||||
* @param all 检测对象
|
||||
* @return
|
||||
*/
|
||||
public List<TerminalTree> getRecursionChildren(List<TerminalTree> line, List<TerminalTree> all) {
|
||||
List<TerminalTree> info=new ArrayList<>();
|
||||
|
||||
List<TerminalTree> aa=new ArrayList<>();
|
||||
for (TerminalTree lineTree : line) {
|
||||
findParentsRecursive(lineTree, all,aa);
|
||||
aa.add(lineTree);
|
||||
}
|
||||
List<TerminalTree> distinctList = aa.stream().distinct().collect(Collectors.toList());
|
||||
List<TerminalTree> collect = distinctList.stream().filter(x -> x.getLevel() == LineBaseEnum.SUB_LEVEL.getCode()).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(collect)){
|
||||
for (TerminalTree tree : collect) {
|
||||
info.add(findParents(distinctList,tree));
|
||||
}
|
||||
|
||||
}
|
||||
return info;
|
||||
}
|
||||
private TerminalTree findParents(List<TerminalTree> all,TerminalTree subTree) {
|
||||
List<TerminalTree> collect = all.stream().filter(allItem -> allItem.getPid().equals(subTree.getId())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
collect.forEach(treeMap -> {
|
||||
subTree.setChildren(collect);
|
||||
findParents( all,treeMap);
|
||||
});
|
||||
}
|
||||
return subTree;
|
||||
}
|
||||
|
||||
private static void findParentsRecursive(TerminalTree tree, List<TerminalTree> all,List<TerminalTree> newParents) {
|
||||
if (tree.getLevel() == LineBaseEnum.SUB_LEVEL.getCode()) {
|
||||
return;
|
||||
}
|
||||
List<TerminalTree> collect = all.stream().filter(allItem -> allItem.getId().equals(tree.getPid())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
newParents.addAll(collect);
|
||||
collect.forEach(treeMap -> {
|
||||
findParentsRecursive(treeMap, all, newParents);
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 未绑定监测点树
|
||||
*
|
||||
|
||||
@@ -63,6 +63,7 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
||||
|
||||
if (CollectionUtil.isNotEmpty(lineIds)) {
|
||||
List<AreaLineInfoVO> resList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
|
||||
//设置冀北告警监测点类型
|
||||
if(CollectionUtil.isNotEmpty(deviceInfoParam.getCoutList())){
|
||||
resList.stream().filter(x->deviceInfoParam.getCoutList().contains(x.getLineId())).forEach(x->x.setType(0));
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@ public enum SupervisionKeyEnum {
|
||||
BUILD_USER_INFO("build_user_info","user","干扰源建档流程","UserReportPOServiceImpl"),
|
||||
TIMING_CHECK_DEVICE("timing_check_device","device","终端周期检测","CheckDeviceServiceImpl"),
|
||||
USER_REPORT_RENEWAL("user_report_update","user","干扰源常态化信息编辑流程","UserReportRenewalServiceImpl"),
|
||||
USER_REPORT_DELETE("user_report_delete","user","干扰源常态化信息删除流程","UserReportDeleteServiceImpl");
|
||||
USER_REPORT_DELETE("user_report_delete","user","干扰源常态化信息删除流程","UserReportDeleteServiceImpl"),
|
||||
BUILD_USER_INFO_ARCHIVIST("build_user_info_archivist","user","干扰源用户台账归档流程","UserReportPOServiceImpl"),
|
||||
|
||||
;
|
||||
|
||||
private final String key;
|
||||
|
||||
|
||||
@@ -20,11 +20,12 @@ public enum SupervisionResponseEnum {
|
||||
IMPORT_SENSITIVE_REPORT_ERROR("A00550","导入干扰源用户失败"),
|
||||
SUPERVISION_SERVICE_NOT_FOUND("A00550","业务实现类丢失,清查看类路径配置"),
|
||||
DATA_NOT_EXISTS("A00550","数据不存在"),
|
||||
NO_POWER("A00550","不能操作非自己创建的任务!"),
|
||||
NO_POWER("A00550","不能操作非自己创建的任务!"),
|
||||
NO_USER_REPORT_UPDATE("A00550","常态化干扰源用户管理信息更新失败,不存在该条信息"),
|
||||
NO_DEPT_POWER("A00550","不能操作非自己部门创建的任务"),
|
||||
IMPORT_DEV_ERROR("A00550","导入终端检测失败"),
|
||||
DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"),
|
||||
EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -155,10 +155,10 @@ public class DeVReportManageController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/deleteDevReport")
|
||||
@PostMapping(value = "/deleteDevReport")
|
||||
@ApiOperation("终端入网检测删除流程")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> deleteDevReport(String supervisionId) {
|
||||
public HttpResult<Boolean> deleteDevReport(@RequestBody List<String> supervisionId) {
|
||||
String methodDescribe = getMethodDescribe("deleteDevReport");
|
||||
Boolean b = supervisionDevMainReportPOService.deleteDevReport(supervisionId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
|
||||
@@ -21,6 +21,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
@@ -96,10 +98,10 @@ public class QuitRunningDeviceController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, quitRunningDeviceVO, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/deleteQuitRunningDevice")
|
||||
@ApiOperation("试运行评估删除流程")
|
||||
@PostMapping(value = "/deleteQuitRunningDevice")
|
||||
@ApiOperation("设备退运管理删除流程")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> deleteQuitRunningDevice(String supervisionId) {
|
||||
public HttpResult<Boolean> deleteQuitRunningDevice(@RequestBody List<String> supervisionId) {
|
||||
String methodDescribe = getMethodDescribe("deleteQuitRunningDevice");
|
||||
Boolean b = quitRunningDeviceService.deleteQuitRunningDevice(supervisionId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -103,10 +104,10 @@ public class SupervisionTempLineRunTestController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/deleteTempLineRunTestReport")
|
||||
@PostMapping(value = "/deleteTempLineRunTestReport")
|
||||
@ApiOperation("试运行评估删除流程")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> deleteTempLineRunTestReport(String supervisionId) {
|
||||
public HttpResult<Boolean> deleteTempLineRunTestReport(@RequestBody List<String> supervisionId) {
|
||||
String methodDescribe = getMethodDescribe("deleteTempLineRunTestReport");
|
||||
Boolean b = iSupervisionTempLineRunTestService.deleteTempLineRunTestReport(supervisionId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
|
||||
@@ -23,6 +23,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 干扰源用户管理
|
||||
*
|
||||
@@ -104,10 +106,10 @@ public class TempLineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/deleteTempLineReport")
|
||||
@PostMapping(value = "/deleteTempLineReport")
|
||||
@ApiOperation("监测点台账录入删除流程")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> deleteTempLineReport(String supervisionId) {
|
||||
public HttpResult<Boolean> deleteTempLineReport(@RequestBody List<String> supervisionId) {
|
||||
String methodDescribe = getMethodDescribe("deleteDevReport");
|
||||
Boolean b = supervisionTempLineReportService.deleteTempLineReport(supervisionId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
|
||||
@@ -21,6 +21,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 干扰源用户管理
|
||||
*
|
||||
@@ -116,10 +118,10 @@ public class TempLineDebugController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/deleteTempLineDebugReport")
|
||||
@PostMapping(value = "/deleteTempLineDebugReport")
|
||||
@ApiOperation("监测点联调列表删除流程")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> deleteTempLineDebugReport(String supervisionId) {
|
||||
public HttpResult<Boolean> deleteTempLineDebugReport(@RequestBody List<String> supervisionId) {
|
||||
String methodDescribe = getMethodDescribe("deleteTempLineDebugReport");
|
||||
Boolean b = supervisionTempLineDebugPOService.deleteTempLineDebugReport(supervisionId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
|
||||
@@ -28,6 +28,8 @@ 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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 预告警单表 前端控制器
|
||||
@@ -138,10 +140,10 @@ public class WarningLeafletController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, warningLeafletId, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/deleteWarningLeaflet")
|
||||
@PostMapping(value = "/deleteWarningLeaflet")
|
||||
@ApiOperation("预告警单删除流程")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> deleteWarningLeaflet(String supervisionId) {
|
||||
public HttpResult<Boolean> deleteWarningLeaflet(@RequestBody List<String> supervisionId) {
|
||||
String methodDescribe = getMethodDescribe("deleteWarningLeaflet");
|
||||
Boolean b = warningLeafletService.deleteWarningLeaflet(supervisionId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
|
||||
@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 普测计划流程表 前端控制器
|
||||
@@ -97,10 +99,10 @@ public class SurveyPlanController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, surveyPlanVO, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/deleteSurveyPlan")
|
||||
@PostMapping(value = "/deleteSurveyPlan")
|
||||
@ApiOperation("技术监督计划管理删除流程")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> deleteSurveyPlan(String supervisionId) {
|
||||
public HttpResult<Boolean> deleteSurveyPlan(@RequestBody List<String> supervisionId) {
|
||||
String methodDescribe = getMethodDescribe("deleteSurveyPlan");
|
||||
Boolean b = surveyPlanService.deleteSurveyPlan(supervisionId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
|
||||
@@ -22,6 +22,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 普测测试的管理表 前端控制器
|
||||
@@ -118,10 +120,10 @@ public class SurveyTestController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Boolean.TRUE, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/deleteSurveyPlanTest")
|
||||
@PostMapping(value = "/deleteSurveyPlanTest")
|
||||
@ApiOperation("技术监督测试管理删除流程")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> deleteSurveyPlanTest(String supervisionId) {
|
||||
public HttpResult<Boolean> deleteSurveyPlanTest(@RequestBody List<String> supervisionId) {
|
||||
String methodDescribe = getMethodDescribe("deleteSurveyPlanTest");
|
||||
Boolean b = surveyTestService.deleteSurveyPlanTest(supervisionId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
|
||||
@@ -135,7 +135,7 @@ public class UserReportManageController extends BaseController {
|
||||
@ApiOperation("分页查询常态化干扰源用户台账")
|
||||
@ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true)
|
||||
public HttpResult<Page<UserReportVO>> getNormalUserPage(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("getInterferenceUserPage");
|
||||
String methodDescribe = getMethodDescribe("getNormalUserPage");
|
||||
Page<UserReportVO> out = userReportPOService.getInterferenceUserPage(userReportQueryParam, true);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||
}
|
||||
@@ -206,10 +206,10 @@ public class UserReportManageController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/deleteUserReport")
|
||||
@PostMapping(value = "/deleteUserReport")
|
||||
@ApiOperation("干扰源接入功能删除流程")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> deleteUserReport(String supervisionId) {
|
||||
public HttpResult<Boolean> deleteUserReport(@RequestBody List<String> supervisionId) {
|
||||
String methodDescribe = getMethodDescribe("deleteUserReport");
|
||||
Boolean b = userReportPOService.deleteUserReport(supervisionId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.njcn.supervision.pojo.param.device.QuitRunningDeviceParam;
|
||||
import com.njcn.supervision.pojo.po.device.QuitRunningDevice;
|
||||
import com.njcn.supervision.pojo.vo.device.QuitRunningDeviceVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
@@ -27,5 +29,5 @@ public interface IQuitRunningDeviceService extends IBpmService<QuitRunningDevice
|
||||
|
||||
String cancelQuitRunningDevice(BpmProcessInstanceCancelParam cancelReqVO);
|
||||
|
||||
Boolean deleteQuitRunningDevice(String supervisionId);
|
||||
Boolean deleteQuitRunningDevice(List<String> supervisionId);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
|
||||
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineRunTestVO;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -29,5 +30,5 @@ public interface ISupervisionTempLineRunTestService extends IBpmReasonService<Su
|
||||
|
||||
String cancel(BpmProcessInstanceCancelParam cancelReqVO);
|
||||
|
||||
Boolean deleteTempLineRunTestReport(String supervisionId);
|
||||
Boolean deleteTempLineRunTestReport(List<String> supervisionId);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ public interface SupervisionDevMainReportPOService extends IBpmService<Supervisi
|
||||
|
||||
void importDevData(MultipartFile file, HttpServletResponse response);
|
||||
|
||||
Boolean deleteDevReport(String supervisionId);
|
||||
Boolean deleteDevReport(List<String> supervisionId);
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/5/17 15:26【需求编号】
|
||||
@@ -31,5 +33,5 @@ public interface SupervisionTempLineDebugPOService extends IBpmService<Supervisi
|
||||
|
||||
String cancel(BpmProcessInstanceCancelParam cancelReqVO);
|
||||
|
||||
Boolean deleteTempLineDebugReport(String supervisionId);
|
||||
Boolean deleteTempLineDebugReport(List<String> supervisionId);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.njcn.supervision.pojo.param.device.SupervisionTempLineReportParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/5/11 14:07【需求编号】
|
||||
@@ -27,6 +29,6 @@ public interface SupervisionTempLineReportService extends IBpmService<Supervisio
|
||||
|
||||
SupervisionTempLineReportVO getDetailTempLine(String id);
|
||||
|
||||
Boolean deleteTempLineReport(String supervisionId);
|
||||
Boolean deleteTempLineReport(List<String> supervisionId);
|
||||
|
||||
}
|
||||
|
||||
@@ -82,10 +82,10 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
|
||||
quitRunningDevice.setState(DataStateEnum.ENABLE.getCode());
|
||||
//设置状态
|
||||
if(Objects.equals(quitRunningDeviceParam.getSaveOrCheckflag(),"1")){
|
||||
if (Objects.equals(quitRunningDeviceParam.getSaveOrCheckflag(), "1")) {
|
||||
quitRunningDevice.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||
|
||||
}else {
|
||||
} else {
|
||||
quitRunningDevice.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
quitRunningDevice = this.baseMapper.selectById(quitRunningDevice.getId());
|
||||
|
||||
// 发起 BPM 流程
|
||||
if(Objects.equals(quitRunningDeviceParam.getSaveOrCheckflag(),"2")) {
|
||||
if (Objects.equals(quitRunningDeviceParam.getSaveOrCheckflag(), "2")) {
|
||||
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
@@ -146,15 +146,15 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
|
||||
@Override
|
||||
public Page<QuitRunningDeviceVO> getQuitRunningDevice(QuitRunningDeviceParam.QuitRunningDeviceQueryParam quitRunningDeviceQueryParam) {
|
||||
DataParam param=new DataParam();
|
||||
DataParam param = new DataParam();
|
||||
param.setOrgId(RequestUtil.getDeptIndex());
|
||||
param.setType(quitRunningDeviceQueryParam.getDeviceType());
|
||||
param.setSearchValue(quitRunningDeviceQueryParam.getSearchValue());
|
||||
List<LineDetailVO.Detail> lineDetail = lineFeignClient.getDeptDeviceDetailData(param).getData();
|
||||
if(CollUtil.isEmpty(lineDetail)){
|
||||
if (CollUtil.isEmpty(lineDetail)) {
|
||||
return new Page<>();
|
||||
}
|
||||
Map<String, LineDetailVO.Detail> mapDetail=new HashMap<>();
|
||||
Map<String, LineDetailVO.Detail> mapDetail = new HashMap<>();
|
||||
QueryWrapper<QuitRunningDeviceVO> quitRunningDeviceVOQueryWrapper = new QueryWrapper<>();
|
||||
if (Objects.nonNull(quitRunningDeviceQueryParam)) {
|
||||
//判断监测点/设备的选择
|
||||
@@ -168,10 +168,10 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
DateUtil.endOfDay(DateUtil.parse(quitRunningDeviceQueryParam.getSearchEndTime())));
|
||||
//判断监测点/设备的选择
|
||||
quitRunningDeviceVOQueryWrapper.eq("supervision_quit_running_device.device_type", quitRunningDeviceQueryParam.getDeviceType());
|
||||
if(2==quitRunningDeviceQueryParam.getDeviceType()){
|
||||
if (2 == quitRunningDeviceQueryParam.getDeviceType()) {
|
||||
mapDetail.putAll(lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getLineId, Function.identity())));
|
||||
}else{
|
||||
mapDetail.putAll(lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getDevId,Function.identity(), (key1,key2)->key1)));
|
||||
} else {
|
||||
mapDetail.putAll(lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getDevId, Function.identity(), (key1, key2) -> key1)));
|
||||
}
|
||||
quitRunningDeviceVOQueryWrapper
|
||||
.and(w -> w.in("supervision_quit_running_device.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus()))
|
||||
@@ -182,11 +182,11 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
if (Objects.nonNull(quitRunningDeviceQueryParam.getStatus())) {
|
||||
quitRunningDeviceVOQueryWrapper.eq("supervision_quit_running_device.status", quitRunningDeviceQueryParam.getStatus());
|
||||
}
|
||||
quitRunningDeviceVOQueryWrapper.and(x->x
|
||||
.in(CollUtil.isNotEmpty(mapDetail.keySet()),"supervision_quit_running_device.device_id", mapDetail.keySet())
|
||||
quitRunningDeviceVOQueryWrapper.and(x -> x
|
||||
.in(CollUtil.isNotEmpty(mapDetail.keySet()), "supervision_quit_running_device.device_id", mapDetail.keySet())
|
||||
.or()
|
||||
.isNull("supervision_quit_running_device.device_id")
|
||||
.or().eq("supervision_quit_running_device.device_id","")
|
||||
.or().eq("supervision_quit_running_device.device_id", "")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
for (QuitRunningDeviceVO record : records) {
|
||||
if (record.getDeviceType() == 1) {
|
||||
//获取装置详细信息
|
||||
if(mapDetail.containsKey(record.getDeviceId())){
|
||||
if (mapDetail.containsKey(record.getDeviceId())) {
|
||||
LineDetailVO.Detail detail = mapDetail.get(record.getDeviceId());
|
||||
record.setDeviceName(detail.getDevName());
|
||||
record.setDeviceStatus(detail.getRunFlag());
|
||||
@@ -209,7 +209,7 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
}
|
||||
} else if (record.getDeviceType() == 2) {
|
||||
//获取监测点详细信息
|
||||
if(mapDetail.containsKey(record.getDeviceId())){
|
||||
if (mapDetail.containsKey(record.getDeviceId())) {
|
||||
LineDetailVO.Detail detail = mapDetail.get(record.getDeviceId());
|
||||
record.setDeviceName(detail.getVolName().concat("_").concat(detail.getLineName()));
|
||||
record.setDeviceStatus(detail.getRunFlag());
|
||||
@@ -270,7 +270,7 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
QuitRunningDevice quitRunningDevice = this.baseMapper.selectById(id);
|
||||
QuitRunningDeviceVO quitRunningDeviceVO = new QuitRunningDeviceVO();
|
||||
BeanUtils.copyProperties(quitRunningDevice, quitRunningDeviceVO);
|
||||
if(StringUtils.isNotEmpty(quitRunningDeviceVO.getDeviceId())){
|
||||
if (StringUtils.isNotEmpty(quitRunningDeviceVO.getDeviceId())) {
|
||||
if (quitRunningDeviceVO.getDeviceType() == 1) {
|
||||
|
||||
DeviceVO deviceVO = lineFeignClient.getDeviceDetailData(quitRunningDeviceVO.getDeviceId()).getData();
|
||||
@@ -309,21 +309,17 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteQuitRunningDevice(String supervisionId) {
|
||||
QuitRunningDevice byId = this.getById(supervisionId);
|
||||
//判断是否有权限操作
|
||||
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy());
|
||||
if(ObjectUtil.isNotEmpty(byId)) {
|
||||
//是否删除管理管理员权限
|
||||
if(!deleteRole){
|
||||
if(byId.getStatus() != BpmTaskStatusEnum.WAIT.getStatus()){
|
||||
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
|
||||
}
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<QuitRunningDevice>().set(QuitRunningDevice::getState, DataStateEnum.DELETED.getCode())
|
||||
.eq(QuitRunningDevice::getId, supervisionId));
|
||||
public Boolean deleteQuitRunningDevice(List<String> supervisionId) {
|
||||
List<QuitRunningDevice> quitRunningDevices = this.listByIds(supervisionId);
|
||||
if (CollUtil.isEmpty(quitRunningDevices)) {
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
return false;
|
||||
List<String> collect = quitRunningDevices.stream().map(QuitRunningDevice::getCreateBy).distinct().collect(Collectors.toList());
|
||||
long count = quitRunningDevices.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
//判断是否有权限操作
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<QuitRunningDevice>().set(QuitRunningDevice::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(QuitRunningDevice::getId, supervisionId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -692,21 +692,17 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteDevReport(String supervisionId) {
|
||||
SupervisionDevMainReportPO byId = this.getById(supervisionId);
|
||||
//判断是否有权限操作
|
||||
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy());
|
||||
if(ObjectUtil.isNotEmpty(byId)) {
|
||||
//是否删除管理管理员权限
|
||||
if(!deleteRole){
|
||||
if(byId.getStatus() != BpmTaskStatusEnum.WAIT.getStatus()){
|
||||
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
|
||||
}
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<SupervisionDevMainReportPO>().set(SupervisionDevMainReportPO::getState, DataStateEnum.DELETED.getCode())
|
||||
.eq(SupervisionDevMainReportPO::getId, supervisionId));
|
||||
public Boolean deleteDevReport(List<String> supervisionId) {
|
||||
List<SupervisionDevMainReportPO> supervisionDevMainReportPOS = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(supervisionDevMainReportPOS)){
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
return false;
|
||||
//判断是否有权限操作
|
||||
List<String> collect = supervisionDevMainReportPOS.stream().map(SupervisionDevMainReportPO::getCreateBy).distinct().collect(Collectors.toList());
|
||||
long count = supervisionDevMainReportPOS.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<SupervisionDevMainReportPO>().set(SupervisionDevMainReportPO::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(SupervisionDevMainReportPO::getId, supervisionId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.njcn.supervision.enums.UserNatureEnum;
|
||||
import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper;
|
||||
import com.njcn.supervision.mapper.user.UserReportNormalMapper;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||
@@ -414,21 +415,18 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteTempLineDebugReport(String supervisionId) {
|
||||
SupervisionTempLineDebugPO byId = this.getById(supervisionId);
|
||||
//判断是否有权限操作
|
||||
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy());
|
||||
if(ObjectUtil.isNotEmpty(byId)) {
|
||||
//是否删除管理管理员权限
|
||||
if(!deleteRole){
|
||||
if(byId.getStatus() != BpmTaskStatusEnum.WAIT.getStatus()){
|
||||
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
|
||||
}
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<SupervisionTempLineDebugPO>().set(SupervisionTempLineDebugPO::getState, DataStateEnum.DELETED.getCode())
|
||||
.eq(SupervisionTempLineDebugPO::getId, supervisionId));
|
||||
public Boolean deleteTempLineDebugReport(List<String> supervisionId) {
|
||||
List<SupervisionTempLineDebugPO> supervisionTempLineDebugPOS = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(supervisionTempLineDebugPOS)){
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
return false;
|
||||
//判断是否有权限操作
|
||||
List<String> collect = supervisionTempLineDebugPOS.stream().map(SupervisionTempLineDebugPO::getCreateBy).distinct().collect(Collectors.toList());
|
||||
long count = supervisionTempLineDebugPOS.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<SupervisionTempLineDebugPO>().set(SupervisionTempLineDebugPO::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(SupervisionTempLineDebugPO::getId, supervisionId));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -267,21 +267,17 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteTempLineReport(String supervisionId) {
|
||||
SupervisionTempLineReport byId = this.getById(supervisionId);
|
||||
//判断是否有权限操作
|
||||
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy());
|
||||
if(ObjectUtil.isNotEmpty(byId)) {
|
||||
//是否删除管理管理员权限
|
||||
if(!deleteRole){
|
||||
if(byId.getStatus() != BpmTaskStatusEnum.WAIT.getStatus()){
|
||||
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
|
||||
}
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<SupervisionTempLineReport>().set(SupervisionTempLineReport::getState, DataStateEnum.DELETED.getCode())
|
||||
.eq(SupervisionTempLineReport::getId, supervisionId));
|
||||
public Boolean deleteTempLineReport(List<String> supervisionId) {
|
||||
List<SupervisionTempLineReport> supervisionTempLineReports = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(supervisionTempLineReports)){
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
return false;
|
||||
//判断是否有权限操作
|
||||
List<String> collect = supervisionTempLineReports.stream().map(SupervisionTempLineReport::getCreateBy).distinct().collect(Collectors.toList());
|
||||
long count = supervisionTempLineReports.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<SupervisionTempLineReport>().set(SupervisionTempLineReport::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(SupervisionTempLineReport::getId, supervisionId));
|
||||
}
|
||||
|
||||
private void checkLineId(SupervisionTempLineReportParam supervisionTempLineReportParam, boolean isExcludeSelf) {
|
||||
|
||||
@@ -381,21 +381,17 @@ public class SupervisionTempLineRunTestServiceImpl extends ServiceImpl<Supervisi
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteTempLineRunTestReport(String supervisionId) {
|
||||
SupervisionTempLineRunTestPO byId = this.getById(supervisionId);
|
||||
//判断是否有权限操作
|
||||
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy());
|
||||
if(ObjectUtil.isNotEmpty(byId)) {
|
||||
//是否删除管理管理员权限
|
||||
if(!deleteRole){
|
||||
if(byId.getStatus() != BpmTaskStatusEnum.WAIT.getStatus()){
|
||||
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
|
||||
}
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<SupervisionTempLineRunTestPO>().set(SupervisionTempLineRunTestPO::getState, DataStateEnum.DELETED.getCode())
|
||||
.eq(SupervisionTempLineRunTestPO::getId, supervisionId));
|
||||
public Boolean deleteTempLineRunTestReport(List<String> supervisionId) {
|
||||
List<SupervisionTempLineRunTestPO> supervisionTempLineRunTestPOS = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(supervisionTempLineRunTestPOS)){
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
return false;
|
||||
//判断是否有权限操作
|
||||
List<String> collect = supervisionTempLineRunTestPOS.stream().map(SupervisionTempLineRunTestPO::getCreateBy).distinct().collect(Collectors.toList());
|
||||
long count = supervisionTempLineRunTestPOS.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<SupervisionTempLineRunTestPO>().set(SupervisionTempLineRunTestPO::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(SupervisionTempLineRunTestPO::getId, supervisionId));
|
||||
}
|
||||
|
||||
private String assMsg(List<SupervisionTempLineReport> supervisionTempLineReportList, List<SupervisionTempLineRunTestPO> supervisionTempLineRunTestPOList) {
|
||||
|
||||
@@ -8,6 +8,8 @@ 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 java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 预告警单表 服务类
|
||||
@@ -54,6 +56,6 @@ public interface IWarningLeafletService extends IBpmService<WarningLeaflet> {
|
||||
*/
|
||||
Page<WarningLeafletVO> allPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam);
|
||||
|
||||
Boolean deleteWarningLeaflet(String supervisionId);
|
||||
Boolean deleteWarningLeaflet(List<String> supervisionId);
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.njcn.supervision.enums.*;
|
||||
import com.njcn.supervision.mapper.leaflet.WarningLeafletMapper;
|
||||
import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
|
||||
import com.njcn.supervision.pojo.po.device.TempLineRunTestWarning;
|
||||
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
|
||||
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
|
||||
@@ -270,7 +271,10 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
DateUtil.endOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchEndTime())));
|
||||
}
|
||||
warningLeafletVOQueryWrapper
|
||||
.and(w -> w.in("supervision_warning_leaflet.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus()))
|
||||
.and(w -> w.in("supervision_warning_leaflet.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(),
|
||||
BpmTaskStatusEnum.APPROVE.getStatus(),
|
||||
BpmTaskStatusEnum.RETURN.getStatus()
|
||||
))
|
||||
.or()
|
||||
.eq("supervision_warning_leaflet.dept_id", RequestUtil.getDeptIndex())
|
||||
);
|
||||
@@ -398,21 +402,17 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWarningLeaflet(String supervisionId) {
|
||||
WarningLeaflet byId = this.getById(supervisionId);
|
||||
//判断是否有权限操作
|
||||
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy());
|
||||
if(ObjectUtil.isNotEmpty(byId)) {
|
||||
//是否删除管理管理员权限
|
||||
if(!deleteRole){
|
||||
if(byId.getStatus() != BpmTaskStatusEnum.WAIT.getStatus()){
|
||||
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
|
||||
}
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<WarningLeaflet>().set(WarningLeaflet::getState, DataStateEnum.DELETED.getCode())
|
||||
.eq(WarningLeaflet::getId, supervisionId));
|
||||
public Boolean deleteWarningLeaflet(List<String> supervisionId) {
|
||||
List<WarningLeaflet> warningLeaflets = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(warningLeaflets)){
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
return false;
|
||||
//判断是否有权限操作
|
||||
List<String> collect = warningLeaflets.stream().map(WarningLeaflet::getCreateBy).distinct().collect(Collectors.toList());
|
||||
long count = warningLeaflets.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<WarningLeaflet>().set(WarningLeaflet::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(WarningLeaflet::getId, supervisionId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 普测计划流程表 服务类
|
||||
@@ -27,5 +29,5 @@ public interface ISurveyPlanService extends IBpmService<SurveyPlan> {
|
||||
|
||||
SurveyPlanVO getVOById(String id);
|
||||
|
||||
Boolean deleteSurveyPlan(String supervisionId);
|
||||
Boolean deleteSurveyPlan(List<String> supervisionId);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
||||
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 普测测试的管理表 服务类
|
||||
@@ -32,5 +34,5 @@ public interface ISurveyTestService extends IBpmService<SurveyTest> {
|
||||
|
||||
void initiateWarningLeaflet(WarningAddParam warningAddParam);
|
||||
|
||||
Boolean deleteSurveyPlanTest(String supervisionId);
|
||||
Boolean deleteSurveyPlanTest(List<String> supervisionId);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||
import com.njcn.supervision.mapper.survey.SurveyPlanMapper;
|
||||
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
||||
@@ -46,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -310,20 +312,17 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteSurveyPlan(String supervisionId) {
|
||||
SurveyPlan byId = this.getById(supervisionId);
|
||||
//判断是否有权限操作
|
||||
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy());
|
||||
if(ObjectUtil.isNotEmpty(byId)) {
|
||||
//是否删除管理管理员权限
|
||||
if(!deleteRole){
|
||||
if(byId.getStatus() != BpmTaskStatusEnum.WAIT.getStatus()){
|
||||
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
|
||||
}
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<SurveyPlan>().set(SurveyPlan::getState, DataStateEnum.DELETED.getCode())
|
||||
.eq(SurveyPlan::getId, supervisionId));
|
||||
public Boolean deleteSurveyPlan(List<String> supervisionId) {
|
||||
List<SurveyPlan> surveyPlans = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(surveyPlans)){
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
return false;
|
||||
//判断是否有权限操作
|
||||
List<String> collect = surveyPlans.stream().map(SurveyPlan::getCreateBy).distinct().collect(Collectors.toList());
|
||||
long count = surveyPlans.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
//判断是否有权限操作
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<SurveyPlan>().set(SurveyPlan::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(SurveyPlan::getId, supervisionId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.njcn.supervision.enums.*;
|
||||
import com.njcn.supervision.mapper.survey.SurveyTestMapper;
|
||||
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
|
||||
import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
|
||||
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
||||
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
|
||||
@@ -386,21 +387,17 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteSurveyPlanTest(String supervisionId) {
|
||||
SurveyTest byId = this.getById(supervisionId);
|
||||
//判断是否有权限操作
|
||||
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy());
|
||||
if(ObjectUtil.isNotEmpty(byId)) {
|
||||
//是否删除管理管理员权限
|
||||
if(!deleteRole){
|
||||
if(byId.getStatus() != BpmTaskStatusEnum.WAIT.getStatus()){
|
||||
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
|
||||
}
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<SurveyTest>().set(SurveyTest::getState, DataStateEnum.DELETED.getCode())
|
||||
.eq(SurveyTest::getId, supervisionId));
|
||||
public Boolean deleteSurveyPlanTest(List<String> supervisionId) {
|
||||
List<SurveyTest> surveyTests = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(surveyTests)){
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
return false;
|
||||
//判断是否有权限操作
|
||||
List<String> collect = surveyTests.stream().map(SurveyTest::getCreateBy).distinct().collect(Collectors.toList());
|
||||
long count = surveyTests.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<SurveyTest>().set(SurveyTest::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(SurveyTest::getId, supervisionId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,5 +55,5 @@ public interface UserReportPOService extends IBpmService<UserReportPO> {
|
||||
|
||||
void importSensitiveReportData(MultipartFile file, HttpServletResponse response);
|
||||
|
||||
Boolean deleteUserReport(String supervisionId);
|
||||
Boolean deleteUserReport(List<String> supervisionId);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
if (ObjectUtil.isNotNull(userReportParam.getDataType())) {
|
||||
userReportPO.setDataType(userReportParam.getDataType());
|
||||
if (userReportParam.getDataType() == 1) {
|
||||
userReportPO.setStatus(FlowStatusEnum.APPROVE.getCode());
|
||||
userReportPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
}
|
||||
} else {
|
||||
userReportPO.setDataType(0);
|
||||
@@ -162,7 +162,14 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
if (Objects.equals(userReportParam.getSaveOrCheckflag(), "2")) {
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.BUILD_USER_INFO.getKey());
|
||||
//干扰源用户台账和敏感用户审核流程
|
||||
if (ObjectUtil.isNotNull(userReportParam.getDataType())) {
|
||||
if (userReportParam.getDataType() == 1) {
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.BUILD_USER_INFO_ARCHIVIST.getKey());
|
||||
}
|
||||
} else {
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.BUILD_USER_INFO.getKey());
|
||||
}
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportPO.getId());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(userReportParam.getStartUserSelectAssignees());
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
@@ -223,7 +230,12 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.BUILD_USER_INFO.getKey());
|
||||
//干扰源用户台账和敏感用户审核流程
|
||||
if (userReportPO.getDataType() == 1) {
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.BUILD_USER_INFO_ARCHIVIST.getKey());
|
||||
}else{
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.BUILD_USER_INFO.getKey());
|
||||
}
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportPO.getId());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(userReportParam.getStartUserSelectAssignees());
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
@@ -431,11 +443,13 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
.or()
|
||||
.in("supervision_user_report.org_id", data)
|
||||
)
|
||||
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
||||
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode());
|
||||
if (!allDataFlag) {
|
||||
//台账不查询全部数据,需要排除敏感及重要用户
|
||||
userReportVOQueryWrapper.ne("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode());
|
||||
userReportVOQueryWrapper.ne("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode())
|
||||
.in("supervision_user_report.status", Arrays.asList(FlowStatusEnum.AUDIT.getCode(), FlowStatusEnum.APPROVE.getCode()));
|
||||
}else{
|
||||
userReportVOQueryWrapper.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||
}
|
||||
if (Objects.nonNull(userReportQueryParam)) {
|
||||
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
|
||||
@@ -571,7 +585,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
)
|
||||
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
||||
.eq("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode())
|
||||
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||
.in("supervision_user_report.status", Arrays.asList(FlowStatusEnum.AUDIT.getCode(), FlowStatusEnum.APPROVE.getCode()));
|
||||
if (Objects.nonNull(userReportQueryParam)) {
|
||||
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
|
||||
//查询所有区域下的数据
|
||||
@@ -733,7 +747,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
List<DictData> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||
//指标类型
|
||||
List<DictData> indicatorType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDICATOR_TYPE.getCode()).getData();
|
||||
//敏感用户字典
|
||||
//问题指标
|
||||
List<DictData> problemIndicators = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.PROBLEM_INDICATORS.getCode()).getData();
|
||||
//评估类型
|
||||
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData();
|
||||
@@ -784,7 +798,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
userReportPO.setEvaluationDept(userExcel.getEvaluationDept());
|
||||
userReportPO.setEvaluationConclusion(userExcel.getEvaluationConclusion());
|
||||
userReportPO.setDataType(1);
|
||||
userReportPO.setStatus(2);
|
||||
userReportPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||
userReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
this.baseMapper.insert(userReportPO);
|
||||
//处理敏感用户的信息
|
||||
@@ -989,7 +1003,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
userReportPO.setEvaluationDept(reportExcel.getEvaluationDept());
|
||||
userReportPO.setEvaluationConclusion(reportExcel.getEvaluationConclusion());
|
||||
userReportPO.setDataType(1);
|
||||
userReportPO.setStatus(2);
|
||||
userReportPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||
userReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
this.baseMapper.insert(userReportPO);
|
||||
if (CollectionUtil.newArrayList(
|
||||
@@ -1056,21 +1070,18 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteUserReport(String supervisionId) {
|
||||
UserReportPO byId = this.getById(supervisionId);
|
||||
//判断是否有权限操作
|
||||
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy());
|
||||
if(ObjectUtil.isNotEmpty(byId)) {
|
||||
//是否删除管理管理员权限
|
||||
if(!deleteRole){
|
||||
if(byId.getStatus() != BpmTaskStatusEnum.WAIT.getStatus()){
|
||||
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
|
||||
}
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<UserReportPO>().set(UserReportPO::getState, DataStateEnum.DELETED.getCode())
|
||||
.eq(UserReportPO::getId, supervisionId));
|
||||
public Boolean deleteUserReport(List<String> supervisionId) {
|
||||
List<UserReportPO> userReportPOS = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(userReportPOS)){
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
return false;
|
||||
//判断是否有权限操作
|
||||
List<String> collect = userReportPOS.stream().map(UserReportPO::getCreateBy).distinct().collect(Collectors.toList());
|
||||
long count = userReportPOS.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
//判断是否有权限操作
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<UserReportPO>().set(UserReportPO::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(UserReportPO::getId, supervisionId));
|
||||
}
|
||||
|
||||
public Map<String, String> getTreeString(String name, List<SysDicTreePO> treeVOS) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class InstanceUtil {
|
||||
/**
|
||||
* 判断用户是否有权限操作
|
||||
*
|
||||
* @param deptId 当前用户部门id
|
||||
* @param deptId 当前用户部门id
|
||||
* @param responsibleDeptId 数据创建负责单位id
|
||||
*/
|
||||
public static void judgeUserDeptPower(String deptId, String responsibleDeptId) {
|
||||
@@ -61,21 +61,26 @@ public class InstanceUtil {
|
||||
* @param userId 当前用户部门id
|
||||
* @param createBy 数据创建负责单位id
|
||||
*/
|
||||
public static Boolean deleteRole(String userId, String createBy) {
|
||||
public static void deleteRole(String userId, List<String> createBy, Long statusCount) {
|
||||
if (CollUtil.isEmpty(createBy)) {
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
//先判断是否是删除管理员,如果是就有全部删除权限,否则就只能删除带提交审批的
|
||||
String userRole = RequestUtil.getUserRole();
|
||||
String trimmedString = userRole.substring(1, userRole.length() - 1).replace("\"","");
|
||||
String trimmedString = userRole.substring(1, userRole.length() - 1).replace("\"", "");
|
||||
List<String> list = Arrays.asList(trimmedString.split(","));
|
||||
List<String> delete = list.stream().filter(x -> "delete_info".equals(x)).collect(Collectors.toList());
|
||||
//false 表示不是删除管理员
|
||||
if(CollUtil.isNotEmpty(delete)){
|
||||
return true;
|
||||
}else{
|
||||
if (!userId.equalsIgnoreCase(createBy)) {
|
||||
List<String> delete = list.stream().filter(x -> "delete_info".equals(x)).collect(Collectors.toList());
|
||||
//如果为空则需要判断信息,先判断全部数据是否都是自己创建的,然后判断是否是都是带提交数据
|
||||
if (CollUtil.isEmpty(delete)) {
|
||||
long count = list.stream().filter(x -> !userId.equals(x)).count();
|
||||
if (count > 0) {
|
||||
throw new BusinessException(SupervisionResponseEnum.NO_POWER);
|
||||
} else {
|
||||
if (statusCount > 0) {
|
||||
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user