技术监督模板、文件(批量)上传
This commit is contained in:
@@ -4,14 +4,12 @@ import com.njcn.common.pojo.constant.ServerInfo;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.prepare.harmonic.api.line.fallback.CoustomReportFeignClientFallbackFactory;
|
import com.njcn.prepare.harmonic.api.line.fallback.CoustomReportFeignClientFallbackFactory;
|
||||||
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
|
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
|
||||||
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
|
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@FeignClient(
|
@FeignClient(
|
||||||
value = ServerInfo.PREPARE_BOOT,//对应模块名
|
value = ServerInfo.PREPARE_BOOT,//对应模块名
|
||||||
path = "/thsSupervise",//对应controller请求类
|
path = "/thsSupervise",//对应controller请求类
|
||||||
@@ -25,5 +23,5 @@ public interface ThsSuperviseClient {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/initSupervise")
|
@PostMapping("/initSupervise")
|
||||||
HttpResult<List<ThsOverRunLog>> initSupervise(@RequestBody @Validated SuperviseParam superviseParam);
|
HttpResult<SuperviceRunLogVo> initSupervise(@RequestBody @Validated SuperviseParam superviseParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,15 +6,13 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.device.pq.utils.DeviceEnumUtil;
|
import com.njcn.device.pq.utils.DeviceEnumUtil;
|
||||||
import com.njcn.prepare.harmonic.api.line.ThsSuperviseClient;
|
import com.njcn.prepare.harmonic.api.line.ThsSuperviseClient;
|
||||||
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
|
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
|
||||||
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
|
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class ThsSuperviseClientFallbackFactory implements FallbackFactory<ThsSuperviseClient> {
|
public class ThsSuperviseClientFallbackFactory implements FallbackFactory<ThsSuperviseClient> {
|
||||||
@@ -28,7 +26,7 @@ public class ThsSuperviseClientFallbackFactory implements FallbackFactory<ThsSup
|
|||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new ThsSuperviseClient() {
|
return new ThsSuperviseClient() {
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<ThsOverRunLog>> initSupervise(@RequestBody @Validated SuperviseParam superviseParam) {
|
public HttpResult<SuperviceRunLogVo> initSupervise(@RequestBody @Validated SuperviseParam superviseParam) {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "预警/告警事务的生成: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "预警/告警事务的生成: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,29 +59,41 @@ public class ThsOverRunLog {
|
|||||||
@ApiModelProperty(name = "alarmTicket", value = "预/告警单")
|
@ApiModelProperty(name = "alarmTicket", value = "预/告警单")
|
||||||
private String alarmTicket;
|
private String alarmTicket;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String alarmTicketName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 反馈单
|
* 反馈单
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "feedback", value = "反馈单")
|
@ApiModelProperty(name = "feedback", value = "反馈单")
|
||||||
private String feedback;
|
private String feedback;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String feedbackName;
|
||||||
/**
|
/**
|
||||||
* 测试报告
|
* 测试报告
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "testReport", value = "测试报告")
|
@ApiModelProperty(name = "testReport", value = "测试报告")
|
||||||
private String testReport;
|
private String testReport;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String ftestReportName;
|
||||||
/**
|
/**
|
||||||
* 整改通知单
|
* 整改通知单
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "reviseNotice", value = "整改通知单")
|
@ApiModelProperty(name = "reviseNotice", value = "整改通知单")
|
||||||
private String reviseNotice;
|
private String reviseNotice;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String reviseNoticeName;
|
||||||
/**
|
/**
|
||||||
* 整改通知反馈单
|
* 整改通知反馈单
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "reviseFeedback", value = "整改通知反馈单")
|
@ApiModelProperty(name = "reviseFeedback", value = "整改通知反馈单")
|
||||||
private String reviseFeedback;
|
private String reviseFeedback;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String reviseFeedbackName;
|
||||||
/**
|
/**
|
||||||
* 越限时间(yyyy-MM-dd)
|
* 越限时间(yyyy-MM-dd)
|
||||||
*/
|
*/
|
||||||
@@ -105,6 +117,8 @@ public class ThsOverRunLog {
|
|||||||
@ApiModelProperty(name = "fileName", value = "文件名")
|
@ApiModelProperty(name = "fileName", value = "文件名")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String fileName;
|
private String fileName;
|
||||||
|
@ApiModelProperty(name = "overTime", value = "越限次数")
|
||||||
|
private Integer overTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,4 +23,8 @@ public class ThsSuperviseVo {
|
|||||||
private Integer reviseFeedbackNum;
|
private Integer reviseFeedbackNum;
|
||||||
@ApiModelProperty(name = "endNum", value = "完结数量")
|
@ApiModelProperty(name = "endNum", value = "完结数量")
|
||||||
private Integer endNum;
|
private Integer endNum;
|
||||||
|
@ApiModelProperty(name = "earlyWarnNum", value = "预警单数量")
|
||||||
|
private Integer earlyWarnNum;
|
||||||
|
@ApiModelProperty(name = "reportWarnNum", value = "告警单数量")
|
||||||
|
private Integer reportWarnNum;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,8 @@ import lombok.Getter;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
public enum TypeEnum {
|
public enum TypeEnum {
|
||||||
MONITOR_TYPE(0, "监测点表类型"),
|
|
||||||
INTERFERENCE_TYPE(1, "指标类型"),
|
INTERFERENCE_TYPE(1, "指标类型"),
|
||||||
SOURCE_TYPE(2, "干扰源类型");
|
SOURCE_TYPE(0, "干扰源类型");
|
||||||
|
|
||||||
|
|
||||||
private final Integer code;
|
private final Integer code;
|
||||||
|
|||||||
@@ -1,29 +1,20 @@
|
|||||||
package com.njcn.prepare.harmonic.controller.line;
|
package com.njcn.prepare.harmonic.controller.line;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
|
||||||
import com.njcn.prepare.harmonic.pojo.dto.SuperviseDto;
|
|
||||||
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
|
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
|
||||||
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
||||||
import com.njcn.prepare.harmonic.pojo.vo.SuperviseVo;
|
|
||||||
import com.njcn.prepare.harmonic.service.mysql.line.ThsOverRunLogService;
|
|
||||||
import com.njcn.prepare.harmonic.service.mysql.line.ThsSuperviseService;
|
import com.njcn.prepare.harmonic.service.mysql.line.ThsSuperviseService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -39,8 +30,6 @@ import java.util.Map;
|
|||||||
public class ThsSuperviseController extends BaseController {
|
public class ThsSuperviseController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ThsSuperviseService thsSuperviseService;
|
private ThsSuperviseService thsSuperviseService;
|
||||||
@Autowired
|
|
||||||
private ThsOverRunLogService thsOverRunLogService;
|
|
||||||
|
|
||||||
@ApiOperation("预警/告警事务生成")
|
@ApiOperation("预警/告警事务生成")
|
||||||
@ApiImplicitParam(name = "superviseParam", value = "创建技术监督参数", required = true)
|
@ApiImplicitParam(name = "superviseParam", value = "创建技术监督参数", required = true)
|
||||||
@@ -48,61 +37,5 @@ public class ThsSuperviseController extends BaseController {
|
|||||||
public HttpResult<SuperviceRunLogVo> initSupervise(@RequestBody @Validated SuperviseParam superviseParam) {
|
public HttpResult<SuperviceRunLogVo> initSupervise(@RequestBody @Validated SuperviseParam superviseParam) {
|
||||||
return thsSuperviseService.initSupervise(superviseParam);
|
return thsSuperviseService.initSupervise(superviseParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("保存技术监督监测点")
|
|
||||||
@ApiImplicitParam(name = "superviceRunLogVo", value = "技术监督监测点参数", required = true)
|
|
||||||
@PostMapping("/saveOverRunLog")
|
|
||||||
public HttpResult saveOverRunLog(@RequestBody SuperviceRunLogVo superviceRunLogVo) {
|
|
||||||
thsSuperviseService.saveOverRunLog(superviceRunLogVo);
|
|
||||||
String methodDescribe = getMethodDescribe("saveOverRunLog");
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("技术监督详情")
|
|
||||||
@ApiImplicitParam(name = "supIndex", value = "技术监督id", required = true)
|
|
||||||
@PostMapping("/superviseDetail")
|
|
||||||
public HttpResult superviseDetail(@RequestParam String supIndex) {
|
|
||||||
SuperviceRunLogVo result = thsOverRunLogService.superviseDetail(supIndex);
|
|
||||||
String methodDescribe = getMethodDescribe("superviseDetail");
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("删除技术监督")
|
|
||||||
@ApiImplicitParam(name = "superviseDto", value = "删除技术监督请求体", required = true)
|
|
||||||
@PostMapping("/deleteSupervise")
|
|
||||||
public HttpResult deleteSupervise(@RequestBody SuperviseDto superviseDto) {
|
|
||||||
return thsSuperviseService.deleteSupervise(superviseDto);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("查询技术监督列表")
|
|
||||||
@ApiImplicitParam(name = "superviseDto", value = "查询技术监督列表参数", required = true)
|
|
||||||
@PostMapping("/querySuperviseList")
|
|
||||||
public HttpResult<Page<SuperviseVo>> querySuperviseList(@RequestBody SuperviseDto superviseDto) {
|
|
||||||
Page<SuperviseVo> pageResult = thsSuperviseService.querySuperviseList(superviseDto);
|
|
||||||
String methodDescribe = getMethodDescribe("querySuperviseList");
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pageResult, methodDescribe);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("上传技术监督单据")
|
|
||||||
@PostMapping("/uploadSuperviseTicket")
|
|
||||||
public HttpResult uploadSuperviseTicket(@ApiParam(value = "文件", required = true)
|
|
||||||
@RequestPart(value = "files") MultipartFile[] files,
|
|
||||||
@ApiParam(name = "越限监测点记录id", value = "id", required = true) @RequestParam("id") String id,
|
|
||||||
@ApiParam(name = "上传单据类型", value = "ticketType", required = true) @RequestParam("ticketType") String ticketType,
|
|
||||||
HttpServletResponse response) {
|
|
||||||
thsSuperviseService.uploadSuperviseTicket(id, ticketType, files, response);
|
|
||||||
String methodDescribe = getMethodDescribe("uploadSuperviseTicket");
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("查询流程状态列表")
|
|
||||||
@PostMapping("/queryProgressValues")
|
|
||||||
public HttpResult queryProgressValues() {
|
|
||||||
List<Map<Integer, String>> values = thsSuperviseService.queryProgressValues();
|
|
||||||
String methodDescribe = getMethodDescribe("queryProgressValues");
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, values, methodDescribe);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,8 @@
|
|||||||
<if test="param.deptId !=null and param.deptId !=''">
|
<if test="param.deptId !=null and param.deptId !=''">
|
||||||
and tda.Dept_Id=#{param.deptId}
|
and tda.Dept_Id=#{param.deptId}
|
||||||
</if>
|
</if>
|
||||||
<if test="param != null and param.overRunLog != null and param.overRunLog.size > 0">
|
<if test="param.type !=null">
|
||||||
AND tda.Monitor_Id IN
|
and tda.type=#{param.type}
|
||||||
<foreach collection='param.overRunLog' item='item' index="index" open='(' separator=',' close=')'>
|
|
||||||
#{item.lineIndex}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
</if>
|
||||||
and tws.Big_Type=1
|
and tws.Big_Type=1
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
@@ -5,26 +5,21 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
|
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
|
||||||
import com.njcn.device.pms.pojo.po.Monitor;
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
import com.njcn.harmonic.pojo.vo.SourceSteadyIndicator;
|
import com.njcn.harmonic.pojo.vo.SourceSteadyIndicator;
|
||||||
import com.njcn.harmonic.pojo.vo.ThsStrategyVo;
|
import com.njcn.harmonic.pojo.vo.ThsStrategyVo;
|
||||||
import com.njcn.oss.constant.OssPath;
|
|
||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
import com.njcn.prepare.enums.*;
|
import com.njcn.prepare.enums.*;
|
||||||
import com.njcn.prepare.harmonic.mapper.mysql.line.*;
|
import com.njcn.prepare.harmonic.mapper.mysql.line.*;
|
||||||
import com.njcn.prepare.harmonic.pojo.dto.SuperviseDto;
|
|
||||||
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
|
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
|
||||||
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
|
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
|
||||||
import com.njcn.prepare.harmonic.pojo.po.ThsSupervise;
|
import com.njcn.prepare.harmonic.pojo.po.ThsSupervise;
|
||||||
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
||||||
import com.njcn.prepare.harmonic.pojo.vo.SuperviseVo;
|
|
||||||
import com.njcn.prepare.harmonic.service.mysql.line.ThsSuperviseService;
|
import com.njcn.prepare.harmonic.service.mysql.line.ThsSuperviseService;
|
||||||
import com.njcn.process.annotaion.HarCurrent;
|
import com.njcn.process.annotaion.HarCurrent;
|
||||||
import com.njcn.process.annotaion.HarVoltage;
|
import com.njcn.process.annotaion.HarVoltage;
|
||||||
@@ -35,7 +30,6 @@ import com.njcn.system.api.DicDataFeignClient;
|
|||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.user.pojo.po.Dept;
|
import com.njcn.user.pojo.po.Dept;
|
||||||
import com.njcn.web.factory.PageFactory;
|
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.map.HashedMap;
|
import org.apache.commons.collections.map.HashedMap;
|
||||||
@@ -43,9 +37,7 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -99,7 +91,6 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
for (Map.Entry<String, List<ThsStrategyVo>> entry : deptMap.entrySet()) {
|
for (Map.Entry<String, List<ThsStrategyVo>> entry : deptMap.entrySet()) {
|
||||||
String depId = entry.getKey();
|
String depId = entry.getKey();
|
||||||
ThsSupervise thsSupervise = new ThsSupervise();
|
ThsSupervise thsSupervise = new ThsSupervise();
|
||||||
ArrayList<ThsOverRunLog> thsOverRunLogs = new ArrayList<>();
|
|
||||||
List<ThsStrategyVo> deptList = entry.getValue();
|
List<ThsStrategyVo> deptList = entry.getValue();
|
||||||
List<ThsStrategyVo> oneLevel = deptList.stream().filter(r -> !GradeEnum.THREE_LEVEL.getCode().equals(r.getGrade())).collect(Collectors.toList());//一级或二级策略集合
|
List<ThsStrategyVo> oneLevel = deptList.stream().filter(r -> !GradeEnum.THREE_LEVEL.getCode().equals(r.getGrade())).collect(Collectors.toList());//一级或二级策略集合
|
||||||
List<SourceSteadyIndicator> oneSourceSteadyIndicatorList = new ArrayList<>();
|
List<SourceSteadyIndicator> oneSourceSteadyIndicatorList = new ArrayList<>();
|
||||||
@@ -175,11 +166,12 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
//生成技术监督数据
|
//生成技术监督数据
|
||||||
if (InitTypeEnum.AUTO.getCode().equals(superviseParam.getInitType())) {
|
|
||||||
HttpResult<Dept> deptById = deptFeignClient.getDeptById(depId);
|
HttpResult<Dept> deptById = deptFeignClient.getDeptById(depId);
|
||||||
Dept dept = deptById.getData();
|
Dept dept = deptById.getData();
|
||||||
|
if (InitTypeEnum.AUTO.getCode().equals(superviseParam.getInitType())) {
|
||||||
this.creatData(dept, thsSupervise, overRunLogList);
|
this.creatData(dept, thsSupervise, overRunLogList);
|
||||||
} else {
|
} else {
|
||||||
|
this.buildSuperviseName(thsSupervise, overRunLogList, dept);
|
||||||
superviceRunLogVo.setOverRunLog(overRunLogList);
|
superviceRunLogVo.setOverRunLog(overRunLogList);
|
||||||
superviceRunLogVo.setThsSupervise(thsSupervise);
|
superviceRunLogVo.setThsSupervise(thsSupervise);
|
||||||
}
|
}
|
||||||
@@ -189,6 +181,22 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, superviceRunLogVo, "");
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, superviceRunLogVo, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建技术监督名称
|
||||||
|
*
|
||||||
|
* @param thsSupervise
|
||||||
|
* @param overRunLogList
|
||||||
|
* @param dept
|
||||||
|
*/
|
||||||
|
private void buildSuperviseName(ThsSupervise thsSupervise, List<ThsOverRunLog> overRunLogList, Dept dept) {
|
||||||
|
if (CollectionUtil.isNotEmpty(overRunLogList)) {
|
||||||
|
thsSupervise.setDescription(overRunLogList.get(0).getDescription());
|
||||||
|
String str = Arrays.asList(overRunLogList.get(0).getDescription().split(",")).get(0);
|
||||||
|
String overItem = str.substring(0, str.indexOf("次") - 1);
|
||||||
|
thsSupervise.setName(DateUtil.today() + dept.getName() + overRunLogList.get(0).getName() + "等" + overRunLogList.size() + "个监测点" + overItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//生成技术监督数据
|
//生成技术监督数据
|
||||||
@DS("process")
|
@DS("process")
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -206,123 +214,6 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@DS("process")
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void saveOverRunLog(SuperviceRunLogVo superviceRunLogVo) {
|
|
||||||
if (CollectionUtil.isNotEmpty(superviceRunLogVo.getOverRunLog())) {
|
|
||||||
ThsSupervise thsSupervise = superviceRunLogVo.getThsSupervise();
|
|
||||||
Date date = new Date();
|
|
||||||
thsSupervise.setCreateTime(date);
|
|
||||||
thsSupervise.setCreateUser(RequestUtil.getUsername());
|
|
||||||
thsSupervise.setModifyTime(date);
|
|
||||||
thsSupervise.setSupIndex(IdUtil.simpleUUID());
|
|
||||||
this.thsSuperviseMapper.insert(thsSupervise);
|
|
||||||
for (ThsOverRunLog thsOverRunLog : superviceRunLogVo.getOverRunLog()) {
|
|
||||||
thsOverRunLog.setCreateTime(date);
|
|
||||||
thsOverRunLog.setSupIndex(thsSupervise.getSupIndex());
|
|
||||||
this.thsOverRunLogMapper.insert(thsOverRunLog);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<SuperviseVo> querySuperviseList(SuperviseDto superviseDto) {
|
|
||||||
Integer pageNum = PageFactory.getPageNum(superviseDto);
|
|
||||||
Integer pageSize = PageFactory.getPageSize(superviseDto);
|
|
||||||
Page<SuperviseVo> superviseVoPage = new Page<>(pageNum, pageSize);
|
|
||||||
Page<SuperviseVo> page = thsSuperviseMapper.querySuperviseList(superviseVoPage, superviseDto);
|
|
||||||
List<SuperviseVo> pageRecords = page.getRecords();
|
|
||||||
if (CollectionUtil.isNotEmpty(pageRecords)) {
|
|
||||||
for (SuperviseVo superviseVo : pageRecords) {
|
|
||||||
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, superviseVo.getSupIndex()));
|
|
||||||
if (CollectionUtil.isNotEmpty(thsOverRunLogs)) {
|
|
||||||
List<String> alarmTickets = thsOverRunLogs.stream().map(ThsOverRunLog::getAlarmTicket).collect(Collectors.toList());
|
|
||||||
if (CollectionUtil.isNotEmpty(alarmTickets)) {
|
|
||||||
superviseVo.setHaveAlarmticket(true);
|
|
||||||
}
|
|
||||||
List<String> feedbacks = thsOverRunLogs.stream().map(ThsOverRunLog::getFeedback).collect(Collectors.toList());
|
|
||||||
if (CollectionUtil.isNotEmpty(feedbacks)) {
|
|
||||||
superviseVo.setHaveFeedback(true);
|
|
||||||
}
|
|
||||||
List<String> testReports = thsOverRunLogs.stream().map(ThsOverRunLog::getTestReport).collect(Collectors.toList());
|
|
||||||
if (CollectionUtil.isNotEmpty(testReports)) {
|
|
||||||
superviseVo.setHaveTestReport(true);
|
|
||||||
}
|
|
||||||
List<String> reviseNotices = thsOverRunLogs.stream().map(ThsOverRunLog::getReviseNotice).collect(Collectors.toList());
|
|
||||||
if (CollectionUtil.isNotEmpty(reviseNotices)) {
|
|
||||||
superviseVo.setHaveReviseNotice(true);
|
|
||||||
}
|
|
||||||
List<String> reviseFeedbacks = thsOverRunLogs.stream().map(ThsOverRunLog::getReviseFeedback).collect(Collectors.toList());
|
|
||||||
if (CollectionUtil.isNotEmpty(reviseFeedbacks)) {
|
|
||||||
superviseVo.setHaveReviseFeedback(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
page.setRecords(pageRecords);
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpResult deleteSupervise(SuperviseDto superviseDto) {
|
|
||||||
if (CollectionUtil.isNotEmpty(superviseDto.getDeleteIds())) {
|
|
||||||
superviseDto.getDeleteIds().forEach(id -> {
|
|
||||||
thsOverRunLogMapper.delete(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, id));
|
|
||||||
thsSuperviseMapper.deleteById(id);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void uploadSuperviseTicket(String id, String ticketType, MultipartFile[] files, HttpServletResponse response) {
|
|
||||||
ThsOverRunLog thsOverRunLog = new ThsOverRunLog();
|
|
||||||
thsOverRunLog.setId(id);
|
|
||||||
if (files != null && files.length > 0) {
|
|
||||||
List<String> pathList = new ArrayList<>();
|
|
||||||
for (int i = 0; i < files.length; i++) {
|
|
||||||
String path = fileStorageUtil.uploadMultipart(files[i], OssPath.ELECTRICITY_QUALITY);
|
|
||||||
pathList.add(path);
|
|
||||||
}
|
|
||||||
String pathStr = StringUtils.join(pathList, ",");
|
|
||||||
TicketTypeEnum ticketTypeEnum = TicketTypeEnum.getTicketTypeEnumByCode(ticketType);
|
|
||||||
if (ticketTypeEnum == null) {
|
|
||||||
throw new BusinessException("上传单据参数类型错误!");
|
|
||||||
}
|
|
||||||
switch (ticketTypeEnum) {
|
|
||||||
case ALARM_TICKET:
|
|
||||||
thsOverRunLog.setAlarmTicket(pathStr);
|
|
||||||
break;
|
|
||||||
case FEEDBACK:
|
|
||||||
thsOverRunLog.setFeedback(pathStr);
|
|
||||||
break;
|
|
||||||
case TEST_REPORT:
|
|
||||||
thsOverRunLog.setTestReport(pathStr);
|
|
||||||
break;
|
|
||||||
case REVISE_NOTICE:
|
|
||||||
thsOverRunLog.setTestReport(pathStr);
|
|
||||||
break;
|
|
||||||
case REVISE_FEEDBACK:
|
|
||||||
thsOverRunLog.setReviseFeedback(pathStr);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
thsOverRunLogMapper.updateById(thsOverRunLog);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Map<Integer, String>> queryProgressValues() {
|
|
||||||
List<Map<Integer, String>> list = new ArrayList<>();
|
|
||||||
Arrays.asList(ProgressEnum.values()).forEach(value -> {
|
|
||||||
Map<Integer, String> progress = new HashMap<>();
|
|
||||||
progress.put(value.getCode(), value.getMessage());
|
|
||||||
list.add(progress);
|
|
||||||
});
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询策略列表
|
* 查询策略列表
|
||||||
*
|
*
|
||||||
@@ -425,25 +316,6 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 重复执行删除旧数据
|
|
||||||
*
|
|
||||||
* @param depId
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@DS("process")
|
|
||||||
public void deleteTodayData(String depId, Integer initType) {
|
|
||||||
ThsSupervise thsSupervise = thsSuperviseMapper.selectOne(new LambdaQueryWrapper<ThsSupervise>().eq(ThsSupervise::getDeptId, depId)
|
|
||||||
.eq(ThsSupervise::getCreateType, initType)
|
|
||||||
.between(ThsSupervise::getCreateTime,
|
|
||||||
DateUtil.beginOfDay(new Date()),
|
|
||||||
DateUtil.endOfDay(new Date())).last("limit 1"));
|
|
||||||
if (thsSupervise != null) {
|
|
||||||
thsOverRunLogMapper.delete(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, thsSupervise.getSupIndex()));
|
|
||||||
thsSuperviseMapper.delete(new LambdaQueryWrapper<ThsSupervise>().eq(ThsSupervise::getSupIndex, thsSupervise.getSupIndex()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断监测数据是否超标
|
* 判断监测数据是否超标
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -86,8 +86,6 @@ public interface ThsSuperviseService extends IService<ThsSupervise> {
|
|||||||
void buildOverRunLog(SourceSteadyIndicator steady, ThsSupervise thsSupervise, Monitor monitor, LimitRate limitRate, Map<String, Object> limitBoolMap, Integer initType, List<ThsOverRunLog> thsOverRunLogs);
|
void buildOverRunLog(SourceSteadyIndicator steady, ThsSupervise thsSupervise, Monitor monitor, LimitRate limitRate, Map<String, Object> limitBoolMap, Integer initType, List<ThsOverRunLog> thsOverRunLogs);
|
||||||
|
|
||||||
|
|
||||||
void deleteTodayData(String depId, Integer initType);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成技术监督数据
|
* 生成技术监督数据
|
||||||
*
|
*
|
||||||
@@ -96,42 +94,5 @@ public interface ThsSuperviseService extends IService<ThsSupervise> {
|
|||||||
*/
|
*/
|
||||||
void creatData(Dept dept, ThsSupervise thsSupervise, List<ThsOverRunLog> overRunLogList);
|
void creatData(Dept dept, ThsSupervise thsSupervise, List<ThsOverRunLog> overRunLogList);
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存技术监督数据
|
|
||||||
*
|
|
||||||
* @param superviceRunLogVo
|
|
||||||
*/
|
|
||||||
void saveOverRunLog(SuperviceRunLogVo superviceRunLogVo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询技术监督列表
|
|
||||||
*
|
|
||||||
* @param superviseDto
|
|
||||||
*/
|
|
||||||
Page<SuperviseVo> querySuperviseList(SuperviseDto superviseDto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除技术监督
|
|
||||||
*
|
|
||||||
* @param superviseDto
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
HttpResult deleteSupervise(SuperviseDto superviseDto);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传技术监督单据
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @param ticketType
|
|
||||||
* @param files
|
|
||||||
* @param response
|
|
||||||
*/
|
|
||||||
void uploadSuperviseTicket(String id, String ticketType, MultipartFile[] files, HttpServletResponse response);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询流程状态枚举列表
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<Map<Integer, String>> queryProgressValues();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.process.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum FormworkTypeEnum {
|
||||||
|
ALARM_TICKET(0, "预/告警单模板"),
|
||||||
|
RECTIFY_TICKET(1, "整改通知反馈单模板");
|
||||||
|
private final Integer code;
|
||||||
|
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
FormworkTypeEnum(Integer code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FormworkTypeEnum getFormworkTypeEnumByCode(Integer code) {
|
||||||
|
for (FormworkTypeEnum formworkTypeEnum : FormworkTypeEnum.values()) {
|
||||||
|
if (formworkTypeEnum.getCode().equals(code)) {
|
||||||
|
return formworkTypeEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,30 +1,27 @@
|
|||||||
package com.njcn.process.enums;
|
package com.njcn.process.enums;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
public enum TicketTypeEnum {
|
public enum TicketTypeEnum {
|
||||||
|
ALARM_TICKET(0, "预/告警单"),
|
||||||
|
FEEDBACK(1, "反馈单"),
|
||||||
|
TEST_REPORT(2, "测试报告"),
|
||||||
|
REVISE_NOTICE(3, "整改通知单"),
|
||||||
|
REVISE_FEEDBACK(4, "整改通知反馈单");
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
ALARM_TICKET("alarm_ticket", "预/告警单"),
|
|
||||||
FEEDBACK("feedback", "反馈单"),
|
|
||||||
TEST_REPORT("test_report", "测试报告"),
|
|
||||||
REVISE_NOTICE("revise_notice", "整改通知单"),
|
|
||||||
REVISE_FEEDBACK("revise_feedback", "整改通知反馈单");
|
|
||||||
|
|
||||||
private final String code;
|
|
||||||
|
|
||||||
private final String message;
|
private final String message;
|
||||||
|
|
||||||
TicketTypeEnum(String code, String message) {
|
TicketTypeEnum(Integer code, String message) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TicketTypeEnum getTicketTypeEnumByCode(String code) {
|
public static TicketTypeEnum getTicketTypeEnumByCode(Integer code) {
|
||||||
for (TicketTypeEnum ticketTypeEnum : TicketTypeEnum.values()) {
|
for (TicketTypeEnum ticketTypeEnum : TicketTypeEnum.values()) {
|
||||||
if (StringUtils.equals(code, ticketTypeEnum.getCode())) {
|
if (ticketTypeEnum.getCode().equals(code)) {
|
||||||
return ticketTypeEnum;
|
return ticketTypeEnum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,10 +59,18 @@ public class ThsSuperviseController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("更新技术监督")
|
||||||
|
@ApiImplicitParam(name = "superviceRunLogVo", value = "更新技术监督参数", required = true)
|
||||||
|
@PostMapping("/updateSupervice")
|
||||||
|
public HttpResult updateSupervice(@RequestBody SuperviceRunLogVo superviceRunLogVo) {
|
||||||
|
return thsOverRunLogService.updateSupervise(superviceRunLogVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("技术监督详情")
|
@ApiOperation("技术监督详情")
|
||||||
@ApiImplicitParam(name = "supIndex", value = "技术监督id", required = true)
|
@ApiImplicitParam(name = "supIndex", value = "技术监督id", required = true)
|
||||||
@PostMapping("/superviseDetail")
|
@PostMapping("/superviseDetail")
|
||||||
public HttpResult superviseDetail(@RequestParam String supIndex) {
|
public HttpResult<SuperviceRunLogVo> superviseDetail(@RequestParam String supIndex) {
|
||||||
SuperviceRunLogVo result = thsOverRunLogService.superviseDetail(supIndex);
|
SuperviceRunLogVo result = thsOverRunLogService.superviseDetail(supIndex);
|
||||||
String methodDescribe = getMethodDescribe("superviseDetail");
|
String methodDescribe = getMethodDescribe("superviseDetail");
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
@@ -88,9 +96,9 @@ public class ThsSuperviseController extends BaseController {
|
|||||||
@PostMapping("/uploadSuperviseTicket")
|
@PostMapping("/uploadSuperviseTicket")
|
||||||
public HttpResult uploadSuperviseTicket(@ApiParam(value = "文件", required = true)
|
public HttpResult uploadSuperviseTicket(@ApiParam(value = "文件", required = true)
|
||||||
@RequestPart(value = "files") MultipartFile[] files,
|
@RequestPart(value = "files") MultipartFile[] files,
|
||||||
@ApiParam(name = "id", value = "越限监测点记录id", required = true) @RequestParam("id") String id,
|
@ApiParam(name = "id", value = "越限监测点记录id") @RequestParam(value = "id", required = false) String id,
|
||||||
@ApiParam(name = "supIndex", value = "技术监督id", required = true) @RequestParam("supIndex") String supIndex,
|
@ApiParam(name = "supIndex", value = "技术监督id", required = true) @RequestParam("supIndex") String supIndex,
|
||||||
@ApiParam(name = "ticketType", value = "上传单据类型", required = true) @RequestParam("ticketType") String ticketType,
|
@ApiParam(name = "ticketType", value = "上传单据类型:1 反馈单,2 测试报告,4 整改通知反馈单", required = true) @RequestParam("ticketType") Integer ticketType,
|
||||||
HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
thsSuperviseService.uploadSuperviseTicket(id, supIndex, ticketType, files, response);
|
thsSuperviseService.uploadSuperviseTicket(id, supIndex, ticketType, files, response);
|
||||||
String methodDescribe = getMethodDescribe("uploadSuperviseTicket");
|
String methodDescribe = getMethodDescribe("uploadSuperviseTicket");
|
||||||
@@ -122,14 +130,15 @@ public class ThsSuperviseController extends BaseController {
|
|||||||
@ApiOperation("下载单据模板")
|
@ApiOperation("下载单据模板")
|
||||||
@PostMapping("/dowloadAlarmFormwork")
|
@PostMapping("/dowloadAlarmFormwork")
|
||||||
public HttpResult dowloadAlarmFormwork(@ApiParam(name = "type", value = "类型(0:预警;1:告警)", required = true) @RequestParam("type") Integer type,
|
public HttpResult dowloadAlarmFormwork(@ApiParam(name = "type", value = "类型(0:预警;1:告警)", required = true) @RequestParam("type") Integer type,
|
||||||
|
@ApiParam(name = "supIndex", value = "技术监督id", required = true) @RequestParam("supIndex") String supIndex,
|
||||||
@ApiParam(name = "formworkType", value = "0:预/告警单模板;1:整改通知反馈单模板", required = true) @RequestParam("formworkType") Integer formworkType,
|
@ApiParam(name = "formworkType", value = "0:预/告警单模板;1:整改通知反馈单模板", required = true) @RequestParam("formworkType") Integer formworkType,
|
||||||
HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
String httpPath = thsSuperviseService.dowloadAlarmFormwork(type, formworkType, response);
|
String httpPath = thsSuperviseService.dowloadAlarmFormwork(type, formworkType, supIndex, response);
|
||||||
String methodDescribe = getMethodDescribe("uploadAlarmFormwork");
|
String methodDescribe = getMethodDescribe("uploadAlarmFormwork");
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, httpPath, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, httpPath, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("监督首页")
|
@ApiOperation("技术监督首页")
|
||||||
@ApiImplicitParam(name = "superviseDto", value = "查询技术监督列表参数", required = true)
|
@ApiImplicitParam(name = "superviseDto", value = "查询技术监督列表参数", required = true)
|
||||||
@PostMapping("/superviseIndex")
|
@PostMapping("/superviseIndex")
|
||||||
public HttpResult<Page<ThsSuperviseVo>> superviseIndex(@RequestBody SuperviseDto superviseDto) {
|
public HttpResult<Page<ThsSuperviseVo>> superviseIndex(@RequestBody SuperviseDto superviseDto) {
|
||||||
|
|||||||
@@ -81,12 +81,6 @@
|
|||||||
<if test="param.type !=null">
|
<if test="param.type !=null">
|
||||||
and tda.type=#{param.type}
|
and tda.type=#{param.type}
|
||||||
</if>
|
</if>
|
||||||
<!-- <if test="param != null and param.overRunLog != null and param.overRunLog.size > 0">
|
|
||||||
AND tda.Monitor_Id IN
|
|
||||||
<foreach collection='param.overRunLog' item='item' index="index" open='(' separator=',' close=')'>
|
|
||||||
#{item.lineIndex}
|
|
||||||
</foreach>
|
|
||||||
</if>-->
|
|
||||||
and tws.Big_Type=1
|
and tws.Big_Type=1
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.njcn.process.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
|
|
||||||
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
|
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
|
||||||
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
||||||
|
|
||||||
@@ -16,14 +15,6 @@ import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
|||||||
*/
|
*/
|
||||||
public interface ThsOverRunLogService extends IService<ThsOverRunLog> {
|
public interface ThsOverRunLogService extends IService<ThsOverRunLog> {
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存技术监督监测点
|
|
||||||
*
|
|
||||||
* @param superviseParam
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void saveOverRunLog(SuperviseParam superviseParam);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询技术监督监测点集合
|
* 查询技术监督监测点集合
|
||||||
*
|
*
|
||||||
@@ -37,5 +28,5 @@ public interface ThsOverRunLogService extends IService<ThsOverRunLog> {
|
|||||||
*
|
*
|
||||||
* @param superviseParam
|
* @param superviseParam
|
||||||
*/
|
*/
|
||||||
HttpResult updateSupervise(SuperviseParam superviseParam);
|
HttpResult updateSupervise(SuperviceRunLogVo superviseParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public interface ThsSuperviseService extends IService<ThsSupervise> {
|
|||||||
* @param files
|
* @param files
|
||||||
* @param response
|
* @param response
|
||||||
*/
|
*/
|
||||||
void uploadSuperviseTicket(String id, String supIndex, String ticketType, MultipartFile[] files, HttpServletResponse response);
|
void uploadSuperviseTicket(String id, String supIndex, Integer ticketType, MultipartFile[] files, HttpServletResponse response);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询流程状态枚举列表
|
* 查询流程状态枚举列表
|
||||||
@@ -154,7 +154,7 @@ public interface ThsSuperviseService extends IService<ThsSupervise> {
|
|||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String dowloadAlarmFormwork(Integer type, Integer formworkType, HttpServletResponse response);
|
String dowloadAlarmFormwork(Integer type, Integer formworkType, String supIndex, HttpServletResponse response);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 技术监督首页
|
* 技术监督首页
|
||||||
|
|||||||
@@ -7,19 +7,21 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
import com.njcn.prepare.harmonic.pojo.param.SuperviseParam;
|
|
||||||
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
|
import com.njcn.prepare.harmonic.pojo.po.ThsOverRunLog;
|
||||||
import com.njcn.prepare.harmonic.pojo.po.ThsSupervise;
|
import com.njcn.prepare.harmonic.pojo.po.ThsSupervise;
|
||||||
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
import com.njcn.prepare.harmonic.pojo.vo.SuperviceRunLogVo;
|
||||||
|
import com.njcn.process.enums.ProgressEnum;
|
||||||
|
import com.njcn.process.mapper.PmsMonitorMapper;
|
||||||
import com.njcn.process.mapper.ThsOverRunLogMapper;
|
import com.njcn.process.mapper.ThsOverRunLogMapper;
|
||||||
import com.njcn.process.mapper.ThsSuperviseMapper;
|
import com.njcn.process.mapper.ThsSuperviseMapper;
|
||||||
import com.njcn.process.service.ThsOverRunLogService;
|
import com.njcn.process.service.ThsOverRunLogService;
|
||||||
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -42,12 +44,10 @@ public class ThsOverRunLogServiceImpl extends ServiceImpl<ThsOverRunLogMapper, T
|
|||||||
private ThsSuperviseMapper thsSuperviseMapper;
|
private ThsSuperviseMapper thsSuperviseMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileStorageUtil fileStorageUtil;
|
private FileStorageUtil fileStorageUtil;
|
||||||
|
@Autowired
|
||||||
@Override
|
private DeptFeignClient deptFeignClient;
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Autowired
|
||||||
public void saveOverRunLog(SuperviseParam superviseParam) {
|
private PmsMonitorMapper pmsMonitorMapper;
|
||||||
this.saveBatch(superviseParam.getOverRunLog());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuperviceRunLogVo superviseDetail(String supIndex) {
|
public SuperviceRunLogVo superviseDetail(String supIndex) {
|
||||||
@@ -55,6 +55,9 @@ public class ThsOverRunLogServiceImpl extends ServiceImpl<ThsOverRunLogMapper, T
|
|||||||
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, supIndex));
|
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, supIndex));
|
||||||
if (CollectionUtil.isNotEmpty(thsOverRunLogs)) {
|
if (CollectionUtil.isNotEmpty(thsOverRunLogs)) {
|
||||||
thsOverRunLogs.forEach(item -> {
|
thsOverRunLogs.forEach(item -> {
|
||||||
|
Monitor monitor = pmsMonitorMapper.selectById(item.getLineIndex());
|
||||||
|
item.setCompanyName(monitor.getOrgName());
|
||||||
|
item.setLineIndexName(monitor.getName());
|
||||||
if (StringUtils.isNotBlank(item.getAlarmTicket())) {
|
if (StringUtils.isNotBlank(item.getAlarmTicket())) {
|
||||||
item.setAlarmTicket(fileStorageUtil.getFileUrl(item.getAlarmTicket()));
|
item.setAlarmTicket(fileStorageUtil.getFileUrl(item.getAlarmTicket()));
|
||||||
}
|
}
|
||||||
@@ -77,12 +80,21 @@ public class ThsOverRunLogServiceImpl extends ServiceImpl<ThsOverRunLogMapper, T
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult updateSupervise(SuperviseParam superviseParam) {
|
public HttpResult updateSupervise(SuperviceRunLogVo superviseParam) {
|
||||||
List<ThsOverRunLog> overRunLog = superviseParam.getOverRunLog();
|
List<ThsOverRunLog> overRunLog = superviseParam.getOverRunLog();
|
||||||
if (CollectionUtil.isEmpty(overRunLog)) {
|
if (CollectionUtil.isEmpty(overRunLog) ||
|
||||||
|
CollectionUtil.isEmpty(overRunLog.stream().map(ThsOverRunLog::getId).collect(Collectors.toList()))) {
|
||||||
HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "监测点不能为空", null);
|
HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "监测点不能为空", null);
|
||||||
}
|
}
|
||||||
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, superviseParam.getSupIndex()));
|
ThsSupervise thsSupervise = superviseParam.getThsSupervise();
|
||||||
|
if (StringUtils.isBlank(thsSupervise.getSupIndex())) {
|
||||||
|
HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "技术监督id不能为空", null);
|
||||||
|
}
|
||||||
|
ThsSupervise supervise = thsSuperviseMapper.selectOne(new LambdaQueryWrapper<ThsSupervise>().eq(ThsSupervise::getSupIndex, thsSupervise.getSupIndex()));
|
||||||
|
if (!ProgressEnum.START.getCode().equals(supervise.getProgress())) {
|
||||||
|
HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, "流程状态为开始才可以更新", null);
|
||||||
|
}
|
||||||
|
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, thsSupervise.getSupIndex()));
|
||||||
List<String> saveIds = superviseParam.getOverRunLog().stream().map(ThsOverRunLog::getId).collect(Collectors.toList());
|
List<String> saveIds = superviseParam.getOverRunLog().stream().map(ThsOverRunLog::getId).collect(Collectors.toList());
|
||||||
List<String> allIds = thsOverRunLogs.stream().map(ThsOverRunLog::getId).collect(Collectors.toList());
|
List<String> allIds = thsOverRunLogs.stream().map(ThsOverRunLog::getId).collect(Collectors.toList());
|
||||||
allIds.removeAll(saveIds);
|
allIds.removeAll(saveIds);
|
||||||
|
|||||||
@@ -264,23 +264,23 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
superviseVo.setCompanyName(deptFeignClient.getDeptById(superviseVo.getDeptId()).getData().getName());
|
superviseVo.setCompanyName(deptFeignClient.getDeptById(superviseVo.getDeptId()).getData().getName());
|
||||||
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, superviseVo.getSupIndex()));
|
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, superviseVo.getSupIndex()));
|
||||||
if (CollectionUtil.isNotEmpty(thsOverRunLogs)) {
|
if (CollectionUtil.isNotEmpty(thsOverRunLogs)) {
|
||||||
List<String> alarmTickets = thsOverRunLogs.stream().map(ThsOverRunLog::getAlarmTicket).collect(Collectors.toList());
|
List<String> alarmTickets = thsOverRunLogs.stream().filter(r -> StringUtils.isNotBlank(r.getAlarmTicket())).map(ThsOverRunLog::getAlarmTicket).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(alarmTickets)) {
|
if (CollectionUtil.isNotEmpty(alarmTickets)) {
|
||||||
superviseVo.setHaveAlarmticket(true);
|
superviseVo.setHaveAlarmticket(true);
|
||||||
}
|
}
|
||||||
List<String> feedbacks = thsOverRunLogs.stream().map(ThsOverRunLog::getFeedback).collect(Collectors.toList());
|
List<String> feedbacks = thsOverRunLogs.stream().filter(r -> StringUtils.isNotBlank(r.getFeedback())).map(ThsOverRunLog::getFeedback).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(feedbacks)) {
|
if (CollectionUtil.isNotEmpty(feedbacks)) {
|
||||||
superviseVo.setHaveFeedback(true);
|
superviseVo.setHaveFeedback(true);
|
||||||
}
|
}
|
||||||
List<String> testReports = thsOverRunLogs.stream().map(ThsOverRunLog::getTestReport).collect(Collectors.toList());
|
List<String> testReports = thsOverRunLogs.stream().filter(r -> StringUtils.isNotBlank(r.getTestReport())).map(ThsOverRunLog::getTestReport).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(testReports)) {
|
if (CollectionUtil.isNotEmpty(testReports)) {
|
||||||
superviseVo.setHaveTestReport(true);
|
superviseVo.setHaveTestReport(true);
|
||||||
}
|
}
|
||||||
List<String> reviseNotices = thsOverRunLogs.stream().map(ThsOverRunLog::getReviseNotice).collect(Collectors.toList());
|
List<String> reviseNotices = thsOverRunLogs.stream().filter(r -> StringUtils.isNotBlank(r.getReviseNotice())).map(ThsOverRunLog::getReviseNotice).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(reviseNotices)) {
|
if (CollectionUtil.isNotEmpty(reviseNotices)) {
|
||||||
superviseVo.setHaveReviseNotice(true);
|
superviseVo.setHaveReviseNotice(true);
|
||||||
}
|
}
|
||||||
List<String> reviseFeedbacks = thsOverRunLogs.stream().map(ThsOverRunLog::getReviseFeedback).collect(Collectors.toList());
|
List<String> reviseFeedbacks = thsOverRunLogs.stream().filter(r -> StringUtils.isNotBlank(r.getReviseFeedback())).map(ThsOverRunLog::getReviseFeedback).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(reviseFeedbacks)) {
|
if (CollectionUtil.isNotEmpty(reviseFeedbacks)) {
|
||||||
superviseVo.setHaveReviseFeedback(true);
|
superviseVo.setHaveReviseFeedback(true);
|
||||||
}
|
}
|
||||||
@@ -296,27 +296,56 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
if (CollectionUtil.isNotEmpty(superviseDto.getDeleteIds())) {
|
if (CollectionUtil.isNotEmpty(superviseDto.getDeleteIds())) {
|
||||||
superviseDto.getDeleteIds().forEach(id -> {
|
superviseDto.getDeleteIds().forEach(id -> {
|
||||||
thsOverRunLogMapper.delete(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, id));
|
thsOverRunLogMapper.delete(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, id));
|
||||||
thsSuperviseMapper.deleteById(id);
|
thsSuperviseMapper.delete(new LambdaQueryWrapper<ThsSupervise>().eq(ThsSupervise::getSupIndex, id));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, null);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uploadSuperviseTicket(String id, String supIndex, String ticketType, MultipartFile[] files, HttpServletResponse response) {
|
public void uploadSuperviseTicket(String id, String supIndex, Integer ticketType, MultipartFile[] files, HttpServletResponse response) {
|
||||||
ThsSupervise thsSupervise = thsSuperviseMapper.selectOne(new LambdaQueryWrapper<ThsSupervise>().eq(ThsSupervise::getSupIndex, supIndex).last("limit 1"));
|
ThsSupervise thsSupervise = new ThsSupervise();
|
||||||
ThsOverRunLog thsOverRunLog = thsOverRunLogMapper.selectById(id);
|
thsSupervise.setSupIndex(supIndex);
|
||||||
thsSupervise.setSupIndex(thsOverRunLog.getSupIndex());
|
|
||||||
thsOverRunLog.setId(id);
|
|
||||||
if (files != null && files.length == 1) {
|
if (files != null && files.length == 1) {
|
||||||
|
ThsOverRunLog thsOverRunLog = thsOverRunLogMapper.selectById(id);
|
||||||
|
thsOverRunLog.setId(id);
|
||||||
String path = fileStorageUtil.uploadMultipart(files[0], OssPath.ELECTRICITY_QUALITY);
|
String path = fileStorageUtil.uploadMultipart(files[0], OssPath.ELECTRICITY_QUALITY);
|
||||||
this.updateSuperviesData(path, thsOverRunLog, ticketType);
|
this.updateSuperviesData(path, thsOverRunLog, ticketType, thsSupervise);
|
||||||
} else {
|
this.updateProcess(thsSupervise, ticketType);
|
||||||
|
}
|
||||||
|
if (files != null && files.length > 1) {
|
||||||
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, supIndex));
|
List<ThsOverRunLog> thsOverRunLogs = thsOverRunLogMapper.selectList(new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, supIndex));
|
||||||
this.batchUploadFile(thsSupervise, thsOverRunLogs, files, ticketType);
|
this.batchUploadFile(thsSupervise, thsOverRunLogs, files, ticketType);
|
||||||
|
this.updateProcess(thsSupervise, ticketType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新技术监督流程
|
||||||
|
*
|
||||||
|
* @param thsSupervise
|
||||||
|
* @param ticketType
|
||||||
|
*/
|
||||||
|
private void updateProcess(ThsSupervise thsSupervise, Integer ticketType) {
|
||||||
|
TicketTypeEnum ticketTypeEnum = TicketTypeEnum.getTicketTypeEnumByCode(ticketType);
|
||||||
|
if (ticketTypeEnum == null) {
|
||||||
|
throw new BusinessException("上传单据参数类型错误!");
|
||||||
|
}
|
||||||
|
switch (ticketTypeEnum) {
|
||||||
|
case FEEDBACK:
|
||||||
|
thsSupervise.setProgress(ProgressEnum.TEST_REPORT.getCode());
|
||||||
|
break;
|
||||||
|
case TEST_REPORT:
|
||||||
|
thsSupervise.setProgress(ProgressEnum.REVISE_NOTICE_ISSUE.getCode());
|
||||||
|
break;
|
||||||
|
case REVISE_FEEDBACK:
|
||||||
|
thsSupervise.setProgress(ProgressEnum.END.getCode());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
thsSupervise.setModifyTime(new Date());
|
||||||
|
thsSuperviseMapper.update(thsSupervise, new LambdaQueryWrapper<ThsSupervise>().eq(ThsSupervise::getSupIndex, thsSupervise.getSupIndex()));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量上传文件
|
* 批量上传文件
|
||||||
*
|
*
|
||||||
@@ -325,7 +354,7 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
* @param files
|
* @param files
|
||||||
* @param ticketType
|
* @param ticketType
|
||||||
*/
|
*/
|
||||||
private void batchUploadFile(ThsSupervise thsSupervise, List<ThsOverRunLog> thsOverRunLogs, MultipartFile[] files, String ticketType) {
|
private void batchUploadFile(ThsSupervise thsSupervise, List<ThsOverRunLog> thsOverRunLogs, MultipartFile[] files, Integer ticketType) {
|
||||||
if (files != null && files.length > 1) {
|
if (files != null && files.length > 1) {
|
||||||
List<ThsOverRunLog> excelData = new ArrayList<>();
|
List<ThsOverRunLog> excelData = new ArrayList<>();
|
||||||
for (int i = 0; i < files.length; i++) {
|
for (int i = 0; i < files.length; i++) {
|
||||||
@@ -346,7 +375,7 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
String originalFilename = files[i].getOriginalFilename();
|
String originalFilename = files[i].getOriginalFilename();
|
||||||
String filename = originalFilename.substring(0, originalFilename.lastIndexOf("."));
|
String filename = originalFilename.substring(0, originalFilename.lastIndexOf("."));
|
||||||
if (StringUtils.equals(filename, thsOverRunLogDto.getLineIndexName())) {
|
if (StringUtils.equals(filename, thsOverRunLogDto.getLineIndexName())) {
|
||||||
this.uploadFile(files[i], ticketType, thsOverRunLog);
|
this.uploadFile(files[i], ticketType, thsOverRunLog, thsSupervise);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -355,12 +384,20 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void uploadFile(MultipartFile file, String ticketType, ThsOverRunLog thsOverRunLog) {
|
private void uploadFile(MultipartFile file, Integer ticketType, ThsOverRunLog thsOverRunLog, ThsSupervise thsSupervise) {
|
||||||
String path = fileStorageUtil.uploadMultipart(file, OssPath.ELECTRICITY_QUALITY);
|
String path = fileStorageUtil.uploadMultipart(file, OssPath.ELECTRICITY_QUALITY);
|
||||||
this.updateSuperviesData(path, thsOverRunLog, ticketType);
|
this.updateSuperviesData(path, thsOverRunLog, ticketType, thsSupervise);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateSuperviesData(String path, ThsOverRunLog thsOverRunLog, String ticketType) {
|
/**
|
||||||
|
* 更新技术监督监测点数据
|
||||||
|
*
|
||||||
|
* @param path
|
||||||
|
* @param thsOverRunLog
|
||||||
|
* @param ticketType
|
||||||
|
* @param thsSupervise
|
||||||
|
*/
|
||||||
|
private void updateSuperviesData(String path, ThsOverRunLog thsOverRunLog, Integer ticketType, ThsSupervise thsSupervise) {
|
||||||
TicketTypeEnum ticketTypeEnum = TicketTypeEnum.getTicketTypeEnumByCode(ticketType);
|
TicketTypeEnum ticketTypeEnum = TicketTypeEnum.getTicketTypeEnumByCode(ticketType);
|
||||||
if (ticketTypeEnum == null) {
|
if (ticketTypeEnum == null) {
|
||||||
throw new BusinessException("上传单据参数类型错误!");
|
throw new BusinessException("上传单据参数类型错误!");
|
||||||
@@ -411,10 +448,25 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String dowloadAlarmFormwork(Integer type, Integer formworkType, HttpServletResponse response) {
|
public String dowloadAlarmFormwork(Integer type, Integer formworkType, String supIndex, HttpServletResponse response) {
|
||||||
ThsAlarmFormwork thsAlarmFormwork = thsAlarmFormworkMapper.selectOne(new LambdaQueryWrapper<ThsAlarmFormwork>().eq(ThsAlarmFormwork::getFormworkType, formworkType)
|
ThsAlarmFormwork thsAlarmFormwork = thsAlarmFormworkMapper.selectOne(new LambdaQueryWrapper<ThsAlarmFormwork>().eq(ThsAlarmFormwork::getFormworkType, formworkType)
|
||||||
.eq(ThsAlarmFormwork::getType, type).last("limit 1"));
|
.eq(ThsAlarmFormwork::getType, type).last("limit 1"));
|
||||||
return fileStorageUtil.getFileUrl(thsAlarmFormwork.getPath());
|
String fileUrl = fileStorageUtil.getFileUrl(thsAlarmFormwork.getPath());
|
||||||
|
ThsSupervise thsSupervise = new ThsSupervise();
|
||||||
|
thsSupervise.setModifyTime(new Date());
|
||||||
|
ThsOverRunLog thsOverRunLog = new ThsOverRunLog();
|
||||||
|
thsOverRunLog.setSupIndex(supIndex);
|
||||||
|
if (FormworkTypeEnum.ALARM_TICKET.getCode().equals(formworkType)) {
|
||||||
|
thsSupervise.setProgress(ProgressEnum.FEEDBACK_UPLOAD.getCode());
|
||||||
|
thsOverRunLog.setAlarmTicket(fileUrl);
|
||||||
|
}
|
||||||
|
if (FormworkTypeEnum.RECTIFY_TICKET.getCode().equals(formworkType)) {
|
||||||
|
thsSupervise.setProgress(ProgressEnum.REVISE_FEEDBACK.getCode());
|
||||||
|
thsOverRunLog.setReviseNotice(thsAlarmFormwork.getPath());
|
||||||
|
}
|
||||||
|
thsOverRunLogMapper.update(thsOverRunLog, new LambdaQueryWrapper<ThsOverRunLog>().eq(ThsOverRunLog::getSupIndex, supIndex));
|
||||||
|
thsSuperviseMapper.update(thsSupervise, new LambdaQueryWrapper<ThsSupervise>().eq(ThsSupervise::getSupIndex, supIndex));
|
||||||
|
return fileUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -455,7 +507,7 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
thsSuperviseVo.setSuperviseVoList(pageRecords);
|
thsSuperviseVo.setSuperviseVoList(pageRecords);
|
||||||
//分组处理每种流程状态的数量
|
//分组计算每种流程状态的数量
|
||||||
Map<Integer, List<SuperviseVo>> map = pageRecords.stream().collect(Collectors.groupingBy(SuperviseVo::getProgress));
|
Map<Integer, List<SuperviseVo>> map = pageRecords.stream().collect(Collectors.groupingBy(SuperviseVo::getProgress));
|
||||||
for (Map.Entry<Integer, List<SuperviseVo>> entry : map.entrySet()) {
|
for (Map.Entry<Integer, List<SuperviseVo>> entry : map.entrySet()) {
|
||||||
Integer code = entry.getKey();
|
Integer code = entry.getKey();
|
||||||
@@ -483,7 +535,19 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//分组计算预/告警单数量
|
||||||
|
Map<Integer, List<SuperviseVo>> typeMap = pageRecords.stream().collect(Collectors.groupingBy(SuperviseVo::getType));
|
||||||
|
for (Map.Entry<Integer, List<SuperviseVo>> entry : typeMap.entrySet()) {
|
||||||
|
Integer code = entry.getKey();
|
||||||
|
switch (AlarmTypeEnum.getAlarmTypeEnumByCode(code)) {
|
||||||
|
case EARLY_WARN:
|
||||||
|
thsSuperviseVo.setEarlyWarnNum(entry.getValue().size());
|
||||||
|
break;
|
||||||
|
case REPORT_WARN:
|
||||||
|
thsSuperviseVo.setReportWarnNum(entry.getValue().size());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
thsSuperviseVoPage.setRecords(Collections.singletonList(thsSuperviseVo));
|
thsSuperviseVoPage.setRecords(Collections.singletonList(thsSuperviseVo));
|
||||||
return thsSuperviseVoPage;
|
return thsSuperviseVoPage;
|
||||||
@@ -577,9 +641,9 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
|||||||
thsOverRunLog.setCreateTime(new Date());
|
thsOverRunLog.setCreateTime(new Date());
|
||||||
thsOverRunLog.setCompanyName(monitor.getOrgName());
|
thsOverRunLog.setCompanyName(monitor.getOrgName());
|
||||||
thsOverRunLog.setLineIndexName(monitor.getName());
|
thsOverRunLog.setLineIndexName(monitor.getName());
|
||||||
List<String> descriptionList = (List) limitBoolMap.get(DESCRIPTION);
|
List descriptionList = (List) limitBoolMap.get(DESCRIPTION);
|
||||||
thsOverRunLog.setDescription(StringUtils.join(descriptionList, ","));
|
thsOverRunLog.setDescription(StringUtils.join(descriptionList, ","));
|
||||||
|
thsOverRunLog.setOverTime(limitRate.getAlltime());
|
||||||
thsOverRunLogs.add(thsOverRunLog);
|
thsOverRunLogs.add(thsOverRunLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user