1.冀北台账树编写

2.技术监督删除流程业务调整,支持多数据删除
This commit is contained in:
wr
2024-09-06 16:18:27 +08:00
parent a3772119b4
commit fb8ed6174c
39 changed files with 456 additions and 204 deletions

View File

@@ -32,9 +32,13 @@ public enum LineBaseEnum {
*/ */
PV_UNIT_LEVEL(0,"单位"), PV_UNIT_LEVEL(0,"单位"),
PV_SUB_LEVEL(1,"变电站"), PV_SUB_LEVEL(1,"变电站"),
PV_SUB_AREA_LEVEL(2,"台区") PV_SUB_AREA_LEVEL(2,"台区"),
/**
* 电网标志
*/
POWER_FLAG(0,"电网侧"),
POWER_FLAG_NOT(1,"非电网侧")
; ;

View File

@@ -115,4 +115,7 @@ public class AreaLineInfoVO implements Serializable {
@ApiModelProperty(name = "type",value = "冀北电网一张图类型信息") @ApiModelProperty(name = "type",value = "冀北电网一张图类型信息")
private Integer type; private Integer type;
@ApiModelProperty(name = "新能源场站信息ID")
private String newStationId;
} }

View File

@@ -124,4 +124,27 @@ public class LineVO implements Serializable {
@ApiModelProperty(name = "newStationId",value = "新能源场站信息ID") @ApiModelProperty(name = "newStationId",value = "新能源场站信息ID")
private String newStationId; 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;
} }

View File

@@ -35,6 +35,7 @@ public class TerminalTree implements Serializable {
private Integer sort; private Integer sort;
@ApiModelProperty(name = "comFlag",value = "设备状态") @ApiModelProperty(name = "comFlag",value = "设备状态")
private Integer comFlag; private Integer comFlag;
@ApiModelProperty(name = "children",value = "子节点") @ApiModelProperty(name = "children",value = "子节点")
private List<TerminalTree> children = new ArrayList<>(); private List<TerminalTree> children = new ArrayList<>();
@@ -59,4 +60,14 @@ public class TerminalTree implements Serializable {
* 接线方式 * 接线方式
*/ */
private Integer ptType; private Integer ptType;
/**
* 电网标志0-电网侧1-非电网侧)
*/
private Integer powerFlag;
/**
* 电网侧变电站
*/
private String powerSubstationName;
} }

View File

@@ -16,8 +16,9 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -32,13 +33,14 @@ import java.util.List;
@Slf4j @Slf4j
@Api(tags = "终端树管理") @Api(tags = "终端树管理")
@RestController @RestController
@AllArgsConstructor @RequiredArgsConstructor
@RequestMapping("/terminalTree") @RequestMapping("/terminalTree")
public class TerminalTreeController extends BaseController { public class TerminalTreeController extends BaseController {
private final TerminalTreeService terminalTreeService; private final TerminalTreeService terminalTreeService;
@Value("${isJb}")
private Boolean isJb;
/** /**
* 获取终端台账设备树 * 获取终端台账设备树
@@ -50,7 +52,13 @@ public class TerminalTreeController extends BaseController {
@GetMapping("getTerminalTree") @GetMapping("getTerminalTree")
public HttpResult<List<TerminalTree>> getTerminalTree(){ public HttpResult<List<TerminalTree>> getTerminalTree(){
String methodDescribe = getMethodDescribe("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); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, tree, methodDescribe);
} }

View File

@@ -574,7 +574,8 @@
detail.Calssification_Grade, detail.Calssification_Grade,
detail.Superiors_Substation, detail.Superiors_Substation,
detail.Hang_Line, detail.Hang_Line,
loadtype.name loadType loadtype.name loadType,
pq_line_detail.New_Station_Id as newStationId
FROM FROM
pq_line line, pq_line line,
pq_line_detail detail, pq_line_detail detail,

View File

@@ -43,4 +43,10 @@ public interface TerminalTreeService {
List<DeptLineTreeVO> getDeptBindDeptLineTree(String deptId, Integer deptType, String id, Integer type); List<DeptLineTreeVO> getDeptBindDeptLineTree(String deptId, Integer deptType, String id, Integer type);
List<TerminalSelectTreeVO> getTerminalSelectTree(Integer level); List<TerminalSelectTreeVO> getTerminalSelectTree(Integer level);
/**
* 冀北设备台账树
* @return
*/
List<TerminalTree> getJbTerminalTree();
} }

View File

@@ -1,17 +1,21 @@
package com.njcn.device.pq.service.impl; package com.njcn.device.pq.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.njcn.common.pojo.enums.common.ServerEnum; import com.njcn.common.pojo.enums.common.ServerEnum;
import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.biz.pojo.vo.TerminalSelectTreeVO; import com.njcn.device.biz.pojo.vo.TerminalSelectTreeVO;
import com.njcn.device.pq.enums.LineBaseEnum; import com.njcn.device.pq.enums.LineBaseEnum;
import com.njcn.device.pq.mapper.DeptLineMapper; 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.LineMapper;
import com.njcn.device.pq.mapper.TreeMapper; import com.njcn.device.pq.mapper.TreeMapper;
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO; import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.DeviceInfoParam; import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.po.Line; 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.DeptLineTreeVO;
import com.njcn.device.pq.pojo.vo.TerminalTree; import com.njcn.device.pq.pojo.vo.TerminalTree;
import com.njcn.device.pq.service.TerminalTreeService; import com.njcn.device.pq.service.TerminalTreeService;
@@ -24,10 +28,7 @@ import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.*;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -45,6 +46,8 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
private final LineMapper lineMapper; private final LineMapper lineMapper;
private final LineDetailMapper lineDetailMapper;
private final AreaFeignClient areaFeignClient; private final AreaFeignClient areaFeignClient;
private final DicDataFeignClient dicDataFeignClient; private final DicDataFeignClient dicDataFeignClient;
@@ -279,6 +282,127 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
return resultList; 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()); 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);
});
}
}
/** /**
* 未绑定监测点树 * 未绑定监测点树
* *

View File

@@ -63,6 +63,7 @@ public class AreaInfoServiceImpl implements AreaInfoService {
if (CollectionUtil.isNotEmpty(lineIds)) { if (CollectionUtil.isNotEmpty(lineIds)) {
List<AreaLineInfoVO> resList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData(); List<AreaLineInfoVO> resList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
//设置冀北告警监测点类型
if(CollectionUtil.isNotEmpty(deviceInfoParam.getCoutList())){ if(CollectionUtil.isNotEmpty(deviceInfoParam.getCoutList())){
resList.stream().filter(x->deviceInfoParam.getCoutList().contains(x.getLineId())).forEach(x->x.setType(0)); resList.stream().filter(x->deviceInfoParam.getCoutList().contains(x.getLineId())).forEach(x->x.setType(0));
} }

View File

@@ -19,7 +19,10 @@ public enum SupervisionKeyEnum {
BUILD_USER_INFO("build_user_info","user","干扰源建档流程","UserReportPOServiceImpl"), BUILD_USER_INFO("build_user_info","user","干扰源建档流程","UserReportPOServiceImpl"),
TIMING_CHECK_DEVICE("timing_check_device","device","终端周期检测","CheckDeviceServiceImpl"), TIMING_CHECK_DEVICE("timing_check_device","device","终端周期检测","CheckDeviceServiceImpl"),
USER_REPORT_RENEWAL("user_report_update","user","干扰源常态化信息编辑流程","UserReportRenewalServiceImpl"), 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; private final String key;

View File

@@ -20,11 +20,12 @@ public enum SupervisionResponseEnum {
IMPORT_SENSITIVE_REPORT_ERROR("A00550","导入干扰源用户失败"), IMPORT_SENSITIVE_REPORT_ERROR("A00550","导入干扰源用户失败"),
SUPERVISION_SERVICE_NOT_FOUND("A00550","业务实现类丢失,清查看类路径配置"), SUPERVISION_SERVICE_NOT_FOUND("A00550","业务实现类丢失,清查看类路径配置"),
DATA_NOT_EXISTS("A00550","数据不存在"), DATA_NOT_EXISTS("A00550","数据不存在"),
NO_POWER("A00550","不能操作非自己创建的任务"), NO_POWER("A00550","不能操作非自己创建的任务!"),
NO_USER_REPORT_UPDATE("A00550","常态化干扰源用户管理信息更新失败,不存在该条信息"), NO_USER_REPORT_UPDATE("A00550","常态化干扰源用户管理信息更新失败,不存在该条信息"),
NO_DEPT_POWER("A00550","不能操作非自己部门创建的任务"), NO_DEPT_POWER("A00550","不能操作非自己部门创建的任务"),
IMPORT_DEV_ERROR("A00550","导入终端检测失败"), IMPORT_DEV_ERROR("A00550","导入终端检测失败"),
DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"), DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"),
EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"),
; ;
private final String code; private final String code;

View File

@@ -155,10 +155,10 @@ public class DeVReportManageController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }
@GetMapping(value = "/deleteDevReport") @PostMapping(value = "/deleteDevReport")
@ApiOperation("终端入网检测删除流程") @ApiOperation("终端入网检测删除流程")
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE) @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"); String methodDescribe = getMethodDescribe("deleteDevReport");
Boolean b = supervisionDevMainReportPOService.deleteDevReport(supervisionId); Boolean b = supervisionDevMainReportPOService.deleteDevReport(supervisionId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);

View File

@@ -21,6 +21,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* <p> * <p>
* 前端控制器 * 前端控制器
@@ -96,10 +98,10 @@ public class QuitRunningDeviceController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, quitRunningDeviceVO, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, quitRunningDeviceVO, methodDescribe);
} }
@GetMapping(value = "/deleteQuitRunningDevice") @PostMapping(value = "/deleteQuitRunningDevice")
@ApiOperation("试运行评估删除流程") @ApiOperation("设备退运管理删除流程")
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE) @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"); String methodDescribe = getMethodDescribe("deleteQuitRunningDevice");
Boolean b = quitRunningDeviceService.deleteQuitRunningDevice(supervisionId); Boolean b = quitRunningDeviceService.deleteQuitRunningDevice(supervisionId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);

View File

@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* <p> * <p>
@@ -103,10 +104,10 @@ public class SupervisionTempLineRunTestController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
} }
@GetMapping(value = "/deleteTempLineRunTestReport") @PostMapping(value = "/deleteTempLineRunTestReport")
@ApiOperation("试运行评估删除流程") @ApiOperation("试运行评估删除流程")
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE) @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"); String methodDescribe = getMethodDescribe("deleteTempLineRunTestReport");
Boolean b = iSupervisionTempLineRunTestService.deleteTempLineRunTestReport(supervisionId); Boolean b = iSupervisionTempLineRunTestService.deleteTempLineRunTestReport(supervisionId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);

View File

@@ -23,6 +23,8 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; 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); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
} }
@GetMapping(value = "/deleteTempLineReport") @PostMapping(value = "/deleteTempLineReport")
@ApiOperation("监测点台账录入删除流程") @ApiOperation("监测点台账录入删除流程")
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE) @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"); String methodDescribe = getMethodDescribe("deleteDevReport");
Boolean b = supervisionTempLineReportService.deleteTempLineReport(supervisionId); Boolean b = supervisionTempLineReportService.deleteTempLineReport(supervisionId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);

View File

@@ -21,6 +21,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; 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); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
} }
@GetMapping(value = "/deleteTempLineDebugReport") @PostMapping(value = "/deleteTempLineDebugReport")
@ApiOperation("监测点联调列表删除流程") @ApiOperation("监测点联调列表删除流程")
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE) @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"); String methodDescribe = getMethodDescribe("deleteTempLineDebugReport");
Boolean b = supervisionTempLineDebugPOService.deleteTempLineDebugReport(supervisionId); Boolean b = supervisionTempLineDebugPOService.deleteTempLineDebugReport(supervisionId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);

View File

@@ -28,6 +28,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* <p> * <p>
* 预告警单表 前端控制器 * 预告警单表 前端控制器
@@ -138,10 +140,10 @@ public class WarningLeafletController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, warningLeafletId, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, warningLeafletId, methodDescribe);
} }
@GetMapping(value = "/deleteWarningLeaflet") @PostMapping(value = "/deleteWarningLeaflet")
@ApiOperation("预告警单删除流程") @ApiOperation("预告警单删除流程")
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE) @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"); String methodDescribe = getMethodDescribe("deleteWarningLeaflet");
Boolean b = warningLeafletService.deleteWarningLeaflet(supervisionId); Boolean b = warningLeafletService.deleteWarningLeaflet(supervisionId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);

View File

@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
import java.util.List;
/** /**
* <p> * <p>
* 普测计划流程表 前端控制器 * 普测计划流程表 前端控制器
@@ -97,10 +99,10 @@ public class SurveyPlanController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, surveyPlanVO, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, surveyPlanVO, methodDescribe);
} }
@GetMapping(value = "/deleteSurveyPlan") @PostMapping(value = "/deleteSurveyPlan")
@ApiOperation("技术监督计划管理删除流程") @ApiOperation("技术监督计划管理删除流程")
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE) @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"); String methodDescribe = getMethodDescribe("deleteSurveyPlan");
Boolean b = surveyPlanService.deleteSurveyPlan(supervisionId); Boolean b = surveyPlanService.deleteSurveyPlan(supervisionId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);

View File

@@ -22,6 +22,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* <p> * <p>
* 普测测试的管理表 前端控制器 * 普测测试的管理表 前端控制器
@@ -118,10 +120,10 @@ public class SurveyTestController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Boolean.TRUE, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Boolean.TRUE, methodDescribe);
} }
@GetMapping(value = "/deleteSurveyPlanTest") @PostMapping(value = "/deleteSurveyPlanTest")
@ApiOperation("技术监督测试管理删除流程") @ApiOperation("技术监督测试管理删除流程")
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE) @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"); String methodDescribe = getMethodDescribe("deleteSurveyPlanTest");
Boolean b = surveyTestService.deleteSurveyPlanTest(supervisionId); Boolean b = surveyTestService.deleteSurveyPlanTest(supervisionId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);

View File

@@ -135,7 +135,7 @@ public class UserReportManageController extends BaseController {
@ApiOperation("分页查询常态化干扰源用户台账") @ApiOperation("分页查询常态化干扰源用户台账")
@ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true) @ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true)
public HttpResult<Page<UserReportVO>> getNormalUserPage(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam) { 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); Page<UserReportVO> out = userReportPOService.getInterferenceUserPage(userReportQueryParam, true);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
} }
@@ -206,10 +206,10 @@ public class UserReportManageController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }
@GetMapping(value = "/deleteUserReport") @PostMapping(value = "/deleteUserReport")
@ApiOperation("干扰源接入功能删除流程") @ApiOperation("干扰源接入功能删除流程")
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM, operateType = OperateType.DELETE) @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"); String methodDescribe = getMethodDescribe("deleteUserReport");
Boolean b = userReportPOService.deleteUserReport(supervisionId); Boolean b = userReportPOService.deleteUserReport(supervisionId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);

View File

@@ -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.po.device.QuitRunningDevice;
import com.njcn.supervision.pojo.vo.device.QuitRunningDeviceVO; import com.njcn.supervision.pojo.vo.device.QuitRunningDeviceVO;
import java.util.List;
/** /**
* <p> * <p>
* 服务类 * 服务类
@@ -27,5 +29,5 @@ public interface IQuitRunningDeviceService extends IBpmService<QuitRunningDevice
String cancelQuitRunningDevice(BpmProcessInstanceCancelParam cancelReqVO); String cancelQuitRunningDevice(BpmProcessInstanceCancelParam cancelReqVO);
Boolean deleteQuitRunningDevice(String supervisionId); Boolean deleteQuitRunningDevice(List<String> supervisionId);
} }

View File

@@ -8,6 +8,7 @@ import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineRunTestVO; import com.njcn.supervision.pojo.vo.device.SupervisionTempLineRunTestVO;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* <p> * <p>
@@ -29,5 +30,5 @@ public interface ISupervisionTempLineRunTestService extends IBpmReasonService<Su
String cancel(BpmProcessInstanceCancelParam cancelReqVO); String cancel(BpmProcessInstanceCancelParam cancelReqVO);
Boolean deleteTempLineRunTestReport(String supervisionId); Boolean deleteTempLineRunTestReport(List<String> supervisionId);
} }

View File

@@ -44,6 +44,6 @@ public interface SupervisionDevMainReportPOService extends IBpmService<Supervisi
void importDevData(MultipartFile file, HttpServletResponse response); void importDevData(MultipartFile file, HttpServletResponse response);
Boolean deleteDevReport(String supervisionId); Boolean deleteDevReport(List<String> supervisionId);
} }

View File

@@ -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.po.device.SupervisionTempLineDebugPO;
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO; import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO;
import java.util.List;
/** /**
* Description: * Description:
* Date: 2024/5/17 15:26【需求编号】 * Date: 2024/5/17 15:26【需求编号】
@@ -31,5 +33,5 @@ public interface SupervisionTempLineDebugPOService extends IBpmService<Supervisi
String cancel(BpmProcessInstanceCancelParam cancelReqVO); String cancel(BpmProcessInstanceCancelParam cancelReqVO);
Boolean deleteTempLineDebugReport(String supervisionId); Boolean deleteTempLineDebugReport(List<String> supervisionId);
} }

View File

@@ -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.po.device.SupervisionTempLineReport;
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO; import com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO;
import java.util.List;
/** /**
* Description: * Description:
* Date: 2024/5/11 14:07【需求编号】 * Date: 2024/5/11 14:07【需求编号】
@@ -27,6 +29,6 @@ public interface SupervisionTempLineReportService extends IBpmService<Supervisio
SupervisionTempLineReportVO getDetailTempLine(String id); SupervisionTempLineReportVO getDetailTempLine(String id);
Boolean deleteTempLineReport(String supervisionId); Boolean deleteTempLineReport(List<String> supervisionId);
} }

View File

@@ -82,10 +82,10 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
quitRunningDevice.setState(DataStateEnum.ENABLE.getCode()); quitRunningDevice.setState(DataStateEnum.ENABLE.getCode());
//设置状态 //设置状态
if(Objects.equals(quitRunningDeviceParam.getSaveOrCheckflag(),"1")){ if (Objects.equals(quitRunningDeviceParam.getSaveOrCheckflag(), "1")) {
quitRunningDevice.setStatus(BpmTaskStatusEnum.WAIT.getStatus()); quitRunningDevice.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
}else { } else {
quitRunningDevice.setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); quitRunningDevice.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
} }
@@ -95,7 +95,7 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
quitRunningDevice = this.baseMapper.selectById(quitRunningDevice.getId()); quitRunningDevice = this.baseMapper.selectById(quitRunningDevice.getId());
// 发起 BPM 流程 // 发起 BPM 流程
if(Objects.equals(quitRunningDeviceParam.getSaveOrCheckflag(),"2")) { if (Objects.equals(quitRunningDeviceParam.getSaveOrCheckflag(), "2")) {
Map<String, Object> processInstanceVariables = new HashMap<>(); Map<String, Object> processInstanceVariables = new HashMap<>();
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO(); BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
@@ -146,15 +146,15 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
@Override @Override
public Page<QuitRunningDeviceVO> getQuitRunningDevice(QuitRunningDeviceParam.QuitRunningDeviceQueryParam quitRunningDeviceQueryParam) { public Page<QuitRunningDeviceVO> getQuitRunningDevice(QuitRunningDeviceParam.QuitRunningDeviceQueryParam quitRunningDeviceQueryParam) {
DataParam param=new DataParam(); DataParam param = new DataParam();
param.setOrgId(RequestUtil.getDeptIndex()); param.setOrgId(RequestUtil.getDeptIndex());
param.setType(quitRunningDeviceQueryParam.getDeviceType()); param.setType(quitRunningDeviceQueryParam.getDeviceType());
param.setSearchValue(quitRunningDeviceQueryParam.getSearchValue()); param.setSearchValue(quitRunningDeviceQueryParam.getSearchValue());
List<LineDetailVO.Detail> lineDetail = lineFeignClient.getDeptDeviceDetailData(param).getData(); List<LineDetailVO.Detail> lineDetail = lineFeignClient.getDeptDeviceDetailData(param).getData();
if(CollUtil.isEmpty(lineDetail)){ if (CollUtil.isEmpty(lineDetail)) {
return new Page<>(); return new Page<>();
} }
Map<String, LineDetailVO.Detail> mapDetail=new HashMap<>(); Map<String, LineDetailVO.Detail> mapDetail = new HashMap<>();
QueryWrapper<QuitRunningDeviceVO> quitRunningDeviceVOQueryWrapper = new QueryWrapper<>(); QueryWrapper<QuitRunningDeviceVO> quitRunningDeviceVOQueryWrapper = new QueryWrapper<>();
if (Objects.nonNull(quitRunningDeviceQueryParam)) { if (Objects.nonNull(quitRunningDeviceQueryParam)) {
//判断监测点/设备的选择 //判断监测点/设备的选择
@@ -168,10 +168,10 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
DateUtil.endOfDay(DateUtil.parse(quitRunningDeviceQueryParam.getSearchEndTime()))); DateUtil.endOfDay(DateUtil.parse(quitRunningDeviceQueryParam.getSearchEndTime())));
//判断监测点/设备的选择 //判断监测点/设备的选择
quitRunningDeviceVOQueryWrapper.eq("supervision_quit_running_device.device_type", quitRunningDeviceQueryParam.getDeviceType()); 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()))); mapDetail.putAll(lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getLineId, Function.identity())));
}else{ } else {
mapDetail.putAll(lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getDevId,Function.identity(), (key1,key2)->key1))); mapDetail.putAll(lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getDevId, Function.identity(), (key1, key2) -> key1)));
} }
quitRunningDeviceVOQueryWrapper quitRunningDeviceVOQueryWrapper
.and(w -> w.in("supervision_quit_running_device.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus())) .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())) { if (Objects.nonNull(quitRunningDeviceQueryParam.getStatus())) {
quitRunningDeviceVOQueryWrapper.eq("supervision_quit_running_device.status", quitRunningDeviceQueryParam.getStatus()); quitRunningDeviceVOQueryWrapper.eq("supervision_quit_running_device.status", quitRunningDeviceQueryParam.getStatus());
} }
quitRunningDeviceVOQueryWrapper.and(x->x quitRunningDeviceVOQueryWrapper.and(x -> x
.in(CollUtil.isNotEmpty(mapDetail.keySet()),"supervision_quit_running_device.device_id", mapDetail.keySet()) .in(CollUtil.isNotEmpty(mapDetail.keySet()), "supervision_quit_running_device.device_id", mapDetail.keySet())
.or() .or()
.isNull("supervision_quit_running_device.device_id") .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) { for (QuitRunningDeviceVO record : records) {
if (record.getDeviceType() == 1) { if (record.getDeviceType() == 1) {
//获取装置详细信息 //获取装置详细信息
if(mapDetail.containsKey(record.getDeviceId())){ if (mapDetail.containsKey(record.getDeviceId())) {
LineDetailVO.Detail detail = mapDetail.get(record.getDeviceId()); LineDetailVO.Detail detail = mapDetail.get(record.getDeviceId());
record.setDeviceName(detail.getDevName()); record.setDeviceName(detail.getDevName());
record.setDeviceStatus(detail.getRunFlag()); record.setDeviceStatus(detail.getRunFlag());
@@ -209,7 +209,7 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
} }
} else if (record.getDeviceType() == 2) { } else if (record.getDeviceType() == 2) {
//获取监测点详细信息 //获取监测点详细信息
if(mapDetail.containsKey(record.getDeviceId())){ if (mapDetail.containsKey(record.getDeviceId())) {
LineDetailVO.Detail detail = mapDetail.get(record.getDeviceId()); LineDetailVO.Detail detail = mapDetail.get(record.getDeviceId());
record.setDeviceName(detail.getVolName().concat("_").concat(detail.getLineName())); record.setDeviceName(detail.getVolName().concat("_").concat(detail.getLineName()));
record.setDeviceStatus(detail.getRunFlag()); record.setDeviceStatus(detail.getRunFlag());
@@ -270,7 +270,7 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
QuitRunningDevice quitRunningDevice = this.baseMapper.selectById(id); QuitRunningDevice quitRunningDevice = this.baseMapper.selectById(id);
QuitRunningDeviceVO quitRunningDeviceVO = new QuitRunningDeviceVO(); QuitRunningDeviceVO quitRunningDeviceVO = new QuitRunningDeviceVO();
BeanUtils.copyProperties(quitRunningDevice, quitRunningDeviceVO); BeanUtils.copyProperties(quitRunningDevice, quitRunningDeviceVO);
if(StringUtils.isNotEmpty(quitRunningDeviceVO.getDeviceId())){ if (StringUtils.isNotEmpty(quitRunningDeviceVO.getDeviceId())) {
if (quitRunningDeviceVO.getDeviceType() == 1) { if (quitRunningDeviceVO.getDeviceType() == 1) {
DeviceVO deviceVO = lineFeignClient.getDeviceDetailData(quitRunningDeviceVO.getDeviceId()).getData(); DeviceVO deviceVO = lineFeignClient.getDeviceDetailData(quitRunningDeviceVO.getDeviceId()).getData();
@@ -309,21 +309,17 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
} }
@Override @Override
public Boolean deleteQuitRunningDevice(String supervisionId) { public Boolean deleteQuitRunningDevice(List<String> supervisionId) {
QuitRunningDevice byId = this.getById(supervisionId); List<QuitRunningDevice> quitRunningDevices = this.listByIds(supervisionId);
if (CollUtil.isEmpty(quitRunningDevices)) {
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
}
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();
//判断是否有权限操作 //判断是否有权限操作
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy()); InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
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()) return this.update(new LambdaUpdateWrapper<QuitRunningDevice>().set(QuitRunningDevice::getState, DataStateEnum.DELETED.getCode())
.eq(QuitRunningDevice::getId, supervisionId)); .in(QuitRunningDevice::getId, supervisionId));
}
return false;
} }
/** /**

View File

@@ -692,21 +692,17 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
} }
@Override @Override
public Boolean deleteDevReport(String supervisionId) { public Boolean deleteDevReport(List<String> supervisionId) {
SupervisionDevMainReportPO byId = this.getById(supervisionId); List<SupervisionDevMainReportPO> supervisionDevMainReportPOS = this.listByIds(supervisionId);
if(CollUtil.isEmpty(supervisionDevMainReportPOS)){
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
}
//判断是否有权限操作 //判断是否有权限操作
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy()); List<String> collect = supervisionDevMainReportPOS.stream().map(SupervisionDevMainReportPO::getCreateBy).distinct().collect(Collectors.toList());
if(ObjectUtil.isNotEmpty(byId)) { long count = supervisionDevMainReportPOS.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
//是否删除管理管理员权限 InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
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()) return this.update(new LambdaUpdateWrapper<SupervisionDevMainReportPO>().set(SupervisionDevMainReportPO::getState, DataStateEnum.DELETED.getCode())
.eq(SupervisionDevMainReportPO::getId, supervisionId)); .in(SupervisionDevMainReportPO::getId, supervisionId));
}
return false;
} }
/** /**

View File

@@ -32,6 +32,7 @@ import com.njcn.supervision.enums.UserNatureEnum;
import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper; import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper;
import com.njcn.supervision.mapper.user.UserReportNormalMapper; import com.njcn.supervision.mapper.user.UserReportNormalMapper;
import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam; 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.SupervisionTempDeviceReport;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO; import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport; import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
@@ -414,21 +415,18 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
} }
@Override @Override
public Boolean deleteTempLineDebugReport(String supervisionId) { public Boolean deleteTempLineDebugReport(List<String> supervisionId) {
SupervisionTempLineDebugPO byId = this.getById(supervisionId); List<SupervisionTempLineDebugPO> supervisionTempLineDebugPOS = this.listByIds(supervisionId);
if(CollUtil.isEmpty(supervisionTempLineDebugPOS)){
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
}
//判断是否有权限操作 //判断是否有权限操作
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy()); List<String> collect = supervisionTempLineDebugPOS.stream().map(SupervisionTempLineDebugPO::getCreateBy).distinct().collect(Collectors.toList());
if(ObjectUtil.isNotEmpty(byId)) { long count = supervisionTempLineDebugPOS.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
//是否删除管理管理员权限 InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
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()) return this.update(new LambdaUpdateWrapper<SupervisionTempLineDebugPO>().set(SupervisionTempLineDebugPO::getState, DataStateEnum.DELETED.getCode())
.eq(SupervisionTempLineDebugPO::getId, supervisionId)); .in(SupervisionTempLineDebugPO::getId, supervisionId));
}
return false;
} }

View File

@@ -267,21 +267,17 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
} }
@Override @Override
public Boolean deleteTempLineReport(String supervisionId) { public Boolean deleteTempLineReport(List<String> supervisionId) {
SupervisionTempLineReport byId = this.getById(supervisionId); List<SupervisionTempLineReport> supervisionTempLineReports = this.listByIds(supervisionId);
if(CollUtil.isEmpty(supervisionTempLineReports)){
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
}
//判断是否有权限操作 //判断是否有权限操作
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy()); List<String> collect = supervisionTempLineReports.stream().map(SupervisionTempLineReport::getCreateBy).distinct().collect(Collectors.toList());
if(ObjectUtil.isNotEmpty(byId)) { long count = supervisionTempLineReports.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
//是否删除管理管理员权限 InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
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()) return this.update(new LambdaUpdateWrapper<SupervisionTempLineReport>().set(SupervisionTempLineReport::getState, DataStateEnum.DELETED.getCode())
.eq(SupervisionTempLineReport::getId, supervisionId)); .in(SupervisionTempLineReport::getId, supervisionId));
}
return false;
} }
private void checkLineId(SupervisionTempLineReportParam supervisionTempLineReportParam, boolean isExcludeSelf) { private void checkLineId(SupervisionTempLineReportParam supervisionTempLineReportParam, boolean isExcludeSelf) {

View File

@@ -381,21 +381,17 @@ public class SupervisionTempLineRunTestServiceImpl extends ServiceImpl<Supervisi
} }
@Override @Override
public Boolean deleteTempLineRunTestReport(String supervisionId) { public Boolean deleteTempLineRunTestReport(List<String> supervisionId) {
SupervisionTempLineRunTestPO byId = this.getById(supervisionId); List<SupervisionTempLineRunTestPO> supervisionTempLineRunTestPOS = this.listByIds(supervisionId);
if(CollUtil.isEmpty(supervisionTempLineRunTestPOS)){
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
}
//判断是否有权限操作 //判断是否有权限操作
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy()); List<String> collect = supervisionTempLineRunTestPOS.stream().map(SupervisionTempLineRunTestPO::getCreateBy).distinct().collect(Collectors.toList());
if(ObjectUtil.isNotEmpty(byId)) { long count = supervisionTempLineRunTestPOS.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
//是否删除管理管理员权限 InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
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()) return this.update(new LambdaUpdateWrapper<SupervisionTempLineRunTestPO>().set(SupervisionTempLineRunTestPO::getState, DataStateEnum.DELETED.getCode())
.eq(SupervisionTempLineRunTestPO::getId, supervisionId)); .in(SupervisionTempLineRunTestPO::getId, supervisionId));
}
return false;
} }
private String assMsg(List<SupervisionTempLineReport> supervisionTempLineReportList, List<SupervisionTempLineRunTestPO> supervisionTempLineRunTestPOList) { private String assMsg(List<SupervisionTempLineReport> supervisionTempLineReportList, List<SupervisionTempLineRunTestPO> supervisionTempLineRunTestPOList) {

View File

@@ -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.po.leaflet.WarningLeaflet;
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO; import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
import java.util.List;
/** /**
* <p> * <p>
* 预告警单表 服务类 * 预告警单表 服务类
@@ -54,6 +56,6 @@ public interface IWarningLeafletService extends IBpmService<WarningLeaflet> {
*/ */
Page<WarningLeafletVO> allPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam); Page<WarningLeafletVO> allPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam);
Boolean deleteWarningLeaflet(String supervisionId); Boolean deleteWarningLeaflet(List<String> supervisionId);
} }

View File

@@ -26,6 +26,7 @@ import com.njcn.supervision.enums.*;
import com.njcn.supervision.mapper.leaflet.WarningLeafletMapper; import com.njcn.supervision.mapper.leaflet.WarningLeafletMapper;
import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam; import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO; 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.device.TempLineRunTestWarning;
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet; import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO; import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
@@ -270,7 +271,10 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
DateUtil.endOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchEndTime()))); DateUtil.endOfDay(DateUtil.parse(warningLeafletQueryParam.getSearchEndTime())));
} }
warningLeafletVOQueryWrapper 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() .or()
.eq("supervision_warning_leaflet.dept_id", RequestUtil.getDeptIndex()) .eq("supervision_warning_leaflet.dept_id", RequestUtil.getDeptIndex())
); );
@@ -398,21 +402,17 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
} }
@Override @Override
public Boolean deleteWarningLeaflet(String supervisionId) { public Boolean deleteWarningLeaflet(List<String> supervisionId) {
WarningLeaflet byId = this.getById(supervisionId); List<WarningLeaflet> warningLeaflets = this.listByIds(supervisionId);
if(CollUtil.isEmpty(warningLeaflets)){
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
}
//判断是否有权限操作 //判断是否有权限操作
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy()); List<String> collect = warningLeaflets.stream().map(WarningLeaflet::getCreateBy).distinct().collect(Collectors.toList());
if(ObjectUtil.isNotEmpty(byId)) { long count = warningLeaflets.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
//是否删除管理管理员权限 InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
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()) return this.update(new LambdaUpdateWrapper<WarningLeaflet>().set(WarningLeaflet::getState, DataStateEnum.DELETED.getCode())
.eq(WarningLeaflet::getId, supervisionId)); .in(WarningLeaflet::getId, supervisionId));
}
return false;
} }

View File

@@ -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.po.survey.SurveyPlan;
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO; import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
import java.util.List;
/** /**
* <p> * <p>
* 普测计划流程表 服务类 * 普测计划流程表 服务类
@@ -27,5 +29,5 @@ public interface ISurveyPlanService extends IBpmService<SurveyPlan> {
SurveyPlanVO getVOById(String id); SurveyPlanVO getVOById(String id);
Boolean deleteSurveyPlan(String supervisionId); Boolean deleteSurveyPlan(List<String> supervisionId);
} }

View File

@@ -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.po.survey.SurveyTest;
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO; import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
import java.util.List;
/** /**
* <p> * <p>
* 普测测试的管理表 服务类 * 普测测试的管理表 服务类
@@ -32,5 +34,5 @@ public interface ISurveyTestService extends IBpmService<SurveyTest> {
void initiateWarningLeaflet(WarningAddParam warningAddParam); void initiateWarningLeaflet(WarningAddParam warningAddParam);
Boolean deleteSurveyPlanTest(String supervisionId); Boolean deleteSurveyPlanTest(List<String> supervisionId);
} }

View File

@@ -25,6 +25,7 @@ import com.njcn.supervision.enums.SupervisionKeyEnum;
import com.njcn.supervision.enums.SupervisionResponseEnum; import com.njcn.supervision.enums.SupervisionResponseEnum;
import com.njcn.supervision.mapper.survey.SurveyPlanMapper; import com.njcn.supervision.mapper.survey.SurveyPlanMapper;
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam; 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.device.SupervisionTempLineRunTestPO;
import com.njcn.supervision.pojo.po.survey.SurveyPlan; import com.njcn.supervision.pojo.po.survey.SurveyPlan;
import com.njcn.supervision.pojo.po.survey.SurveyTest; import com.njcn.supervision.pojo.po.survey.SurveyTest;
@@ -46,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* <p> * <p>
@@ -310,20 +312,17 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
} }
@Override @Override
public Boolean deleteSurveyPlan(String supervisionId) { public Boolean deleteSurveyPlan(List<String> supervisionId) {
SurveyPlan byId = this.getById(supervisionId); List<SurveyPlan> surveyPlans = this.listByIds(supervisionId);
if(CollUtil.isEmpty(surveyPlans)){
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
}
//判断是否有权限操作 //判断是否有权限操作
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy()); List<String> collect = surveyPlans.stream().map(SurveyPlan::getCreateBy).distinct().collect(Collectors.toList());
if(ObjectUtil.isNotEmpty(byId)) { long count = surveyPlans.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
//是否删除管理管理员权限 //判断是否有权限操作
if(!deleteRole){ InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
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()) return this.update(new LambdaUpdateWrapper<SurveyPlan>().set(SurveyPlan::getState, DataStateEnum.DELETED.getCode())
.eq(SurveyPlan::getId, supervisionId)); .in(SurveyPlan::getId, supervisionId));
}
return false;
} }
} }

View File

@@ -29,6 +29,7 @@ import com.njcn.supervision.enums.*;
import com.njcn.supervision.mapper.survey.SurveyTestMapper; import com.njcn.supervision.mapper.survey.SurveyTestMapper;
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam; import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
import com.njcn.supervision.pojo.param.survey.SurveyTestParam; 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.SurveyPlan;
import com.njcn.supervision.pojo.po.survey.SurveyTest; import com.njcn.supervision.pojo.po.survey.SurveyTest;
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO; import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
@@ -386,21 +387,17 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
} }
@Override @Override
public Boolean deleteSurveyPlanTest(String supervisionId) { public Boolean deleteSurveyPlanTest(List<String> supervisionId) {
SurveyTest byId = this.getById(supervisionId); List<SurveyTest> surveyTests = this.listByIds(supervisionId);
if(CollUtil.isEmpty(surveyTests)){
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
}
//判断是否有权限操作 //判断是否有权限操作
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy()); List<String> collect = surveyTests.stream().map(SurveyTest::getCreateBy).distinct().collect(Collectors.toList());
if(ObjectUtil.isNotEmpty(byId)) { long count = surveyTests.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
//是否删除管理管理员权限 InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
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()) return this.update(new LambdaUpdateWrapper<SurveyTest>().set(SurveyTest::getState, DataStateEnum.DELETED.getCode())
.eq(SurveyTest::getId, supervisionId)); .in(SurveyTest::getId, supervisionId));
}
return false;
} }
/** /**

View File

@@ -55,5 +55,5 @@ public interface UserReportPOService extends IBpmService<UserReportPO> {
void importSensitiveReportData(MultipartFile file, HttpServletResponse response); void importSensitiveReportData(MultipartFile file, HttpServletResponse response);
Boolean deleteUserReport(String supervisionId); Boolean deleteUserReport(List<String> supervisionId);
} }

View File

@@ -121,7 +121,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
if (ObjectUtil.isNotNull(userReportParam.getDataType())) { if (ObjectUtil.isNotNull(userReportParam.getDataType())) {
userReportPO.setDataType(userReportParam.getDataType()); userReportPO.setDataType(userReportParam.getDataType());
if (userReportParam.getDataType() == 1) { if (userReportParam.getDataType() == 1) {
userReportPO.setStatus(FlowStatusEnum.APPROVE.getCode()); userReportPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
} }
} else { } else {
userReportPO.setDataType(0); userReportPO.setDataType(0);
@@ -162,7 +162,14 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
if (Objects.equals(userReportParam.getSaveOrCheckflag(), "2")) { if (Objects.equals(userReportParam.getSaveOrCheckflag(), "2")) {
Map<String, Object> processInstanceVariables = new HashMap<>(); Map<String, Object> processInstanceVariables = new HashMap<>();
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO(); BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
//干扰源用户台账和敏感用户审核流程
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.setProcessDefinitionKey(SupervisionKeyEnum.BUILD_USER_INFO.getKey());
}
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportPO.getId()); bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportPO.getId());
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(userReportParam.getStartUserSelectAssignees()); bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(userReportParam.getStartUserSelectAssignees());
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables); bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
@@ -223,7 +230,12 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
// 发起 BPM 流程 // 发起 BPM 流程
Map<String, Object> processInstanceVariables = new HashMap<>(); Map<String, Object> processInstanceVariables = new HashMap<>();
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO(); BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
//干扰源用户台账和敏感用户审核流程
if (userReportPO.getDataType() == 1) {
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.BUILD_USER_INFO_ARCHIVIST.getKey());
}else{
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.BUILD_USER_INFO.getKey()); bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.BUILD_USER_INFO.getKey());
}
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportPO.getId()); bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportPO.getId());
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(userReportParam.getStartUserSelectAssignees()); bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(userReportParam.getStartUserSelectAssignees());
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables); bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
@@ -431,11 +443,13 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
.or() .or()
.in("supervision_user_report.org_id", data) .in("supervision_user_report.org_id", data)
) )
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode()) .eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode());
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
if (!allDataFlag) { 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 (Objects.nonNull(userReportQueryParam)) {
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) { 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.state", DataStateEnum.ENABLE.getCode())
.eq("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.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 (Objects.nonNull(userReportQueryParam)) {
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) { 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> devVoltage = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
//指标类型 //指标类型
List<DictData> indicatorType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDICATOR_TYPE.getCode()).getData(); List<DictData> indicatorType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDICATOR_TYPE.getCode()).getData();
//敏感用户字典 //问题指标
List<DictData> problemIndicators = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.PROBLEM_INDICATORS.getCode()).getData(); List<DictData> problemIndicators = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.PROBLEM_INDICATORS.getCode()).getData();
//评估类型 //评估类型
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.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.setEvaluationDept(userExcel.getEvaluationDept());
userReportPO.setEvaluationConclusion(userExcel.getEvaluationConclusion()); userReportPO.setEvaluationConclusion(userExcel.getEvaluationConclusion());
userReportPO.setDataType(1); userReportPO.setDataType(1);
userReportPO.setStatus(2); userReportPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
userReportPO.setState(DataStateEnum.ENABLE.getCode()); userReportPO.setState(DataStateEnum.ENABLE.getCode());
this.baseMapper.insert(userReportPO); this.baseMapper.insert(userReportPO);
//处理敏感用户的信息 //处理敏感用户的信息
@@ -989,7 +1003,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
userReportPO.setEvaluationDept(reportExcel.getEvaluationDept()); userReportPO.setEvaluationDept(reportExcel.getEvaluationDept());
userReportPO.setEvaluationConclusion(reportExcel.getEvaluationConclusion()); userReportPO.setEvaluationConclusion(reportExcel.getEvaluationConclusion());
userReportPO.setDataType(1); userReportPO.setDataType(1);
userReportPO.setStatus(2); userReportPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
userReportPO.setState(DataStateEnum.ENABLE.getCode()); userReportPO.setState(DataStateEnum.ENABLE.getCode());
this.baseMapper.insert(userReportPO); this.baseMapper.insert(userReportPO);
if (CollectionUtil.newArrayList( if (CollectionUtil.newArrayList(
@@ -1056,21 +1070,18 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
} }
@Override @Override
public Boolean deleteUserReport(String supervisionId) { public Boolean deleteUserReport(List<String> supervisionId) {
UserReportPO byId = this.getById(supervisionId); List<UserReportPO> userReportPOS = this.listByIds(supervisionId);
if(CollUtil.isEmpty(userReportPOS)){
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
}
//判断是否有权限操作 //判断是否有权限操作
Boolean deleteRole = InstanceUtil.deleteRole(RequestUtil.getUserIndex(), byId.getCreateBy()); List<String> collect = userReportPOS.stream().map(UserReportPO::getCreateBy).distinct().collect(Collectors.toList());
if(ObjectUtil.isNotEmpty(byId)) { long count = userReportPOS.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
//是否删除管理管理员权限 //判断是否有权限操作
if(!deleteRole){ InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
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()) return this.update(new LambdaUpdateWrapper<UserReportPO>().set(UserReportPO::getState, DataStateEnum.DELETED.getCode())
.eq(UserReportPO::getId, supervisionId)); .in(UserReportPO::getId, supervisionId));
}
return false;
} }
public Map<String, String> getTreeString(String name, List<SysDicTreePO> treeVOS) { public Map<String, String> getTreeString(String name, List<SysDicTreePO> treeVOS) {

View File

@@ -61,21 +61,26 @@ public class InstanceUtil {
* @param userId 当前用户部门id * @param userId 当前用户部门id
* @param createBy 数据创建负责单位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 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> list = Arrays.asList(trimmedString.split(","));
List<String> delete = list.stream().filter(x -> "delete_info".equals(x)).collect(Collectors.toList()); List<String> delete = list.stream().filter(x -> "delete_info".equals(x)).collect(Collectors.toList());
//false 表示不是删除管理员 //如果为空则需要判断信息,先判断全部数据是否都是自己创建的,然后判断是否是都是带提交数据
if(CollUtil.isNotEmpty(delete)){ if (CollUtil.isEmpty(delete)) {
return true; long count = list.stream().filter(x -> !userId.equals(x)).count();
}else{ if (count > 0) {
if (!userId.equalsIgnoreCase(createBy)) {
throw new BusinessException(SupervisionResponseEnum.NO_POWER); throw new BusinessException(SupervisionResponseEnum.NO_POWER);
} else {
if (statusCount > 0) {
throw new BusinessException(SupervisionResponseEnum.DELETE_TO_BE_SUBMITTED);
}
} }
} }
return false;
} }
} }