草稿功能各个页面开发引起的查询bug,预告警单新增整改意见字段

This commit is contained in:
hzj
2024-06-20 11:46:11 +08:00
parent b501b91bc4
commit 197d3df0fb
15 changed files with 92 additions and 47 deletions

View File

@@ -0,0 +1,26 @@
package com.njcn.supervision.pojo.param.leaflet;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Description:
* Date: 2024/6/20 9:37【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WarningAddParam {
@ApiModelProperty(value = "对应问题源ID用于查询详细信息")
private String id;
/**
* 整改意见
*/
@ApiModelProperty(value = "整改意见")
private String reformAdvice;
}

View File

@@ -101,6 +101,11 @@ public class WarningLeafletVO extends BaseEntity implements Serializable{
*/
private String issueDetail;
/**
* 整改意见
*/
private String reformAdvice;
private String createBy;
/**

View File

@@ -7,6 +7,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
import com.njcn.supervision.pojo.param.problem.SupervisionUserComplaintParam;
import com.njcn.supervision.pojo.vo.problem.SupervisionUserComplaintVO;
import com.njcn.supervision.service.problem.SupervisionUserComplaintPOService;
@@ -47,11 +48,11 @@ public class SupervisionUserComplaintController extends BaseController {
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/initiateWarningLeaflet")
@PostMapping("/initiateWarningLeaflet")
@ApiOperation("针对用户投诉发起告警单")
public HttpResult<Boolean> initiateWarningLeaflet(@RequestParam("id") String id){
public HttpResult<Boolean> initiateWarningLeaflet(@RequestBody WarningAddParam warningAddParam){
String methodDescribe = getMethodDescribe("initiateWarningLeaflet");
supervisionUserComplaintService.initiateWarningLeaflet(id);
supervisionUserComplaintService.initiateWarningLeaflet(warningAddParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Boolean.TRUE, methodDescribe);
}

View File

@@ -9,23 +9,19 @@ import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.supervision.pojo.param.survey.SupervisionGeneralSurveyPlanParm;
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
import com.njcn.supervision.pojo.vo.survey.SupervisionGeneralSurveyPlanDetailVO;
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
import com.njcn.supervision.service.survey.ISurveyTestService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.njcn.web.controller.BaseController;
/**
* <p>
* 普测测试的管理表 前端控制器
@@ -114,11 +110,11 @@ public class SurveyTestController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/initiateWarningLeaflet")
@PostMapping("/initiateWarningLeaflet")
@ApiOperation("针对有问题的现场测试发起告警单")
public HttpResult<Boolean> initiateWarningLeaflet(@RequestParam("id") String id){
public HttpResult<Boolean> initiateWarningLeaflet(@RequestBody WarningAddParam warningAddParam){
String methodDescribe = getMethodDescribe("initiateWarningLeaflet");
surveyTestService.initiateWarningLeaflet(id);
surveyTestService.initiateWarningLeaflet(warningAddParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Boolean.TRUE, methodDescribe);
}
}

View File

@@ -15,6 +15,7 @@
supervision_warning_leaflet.STATUS,
supervision_warning_leaflet.process_instance_id,
supervision_warning_leaflet.history_instance_id,
supervision_warning_leaflet.reform_advice,
supervision_warning_leaflet.issue_detail,
supervision_warning_leaflet.take_step,
supervision_warning_leaflet.report_path,
@@ -40,6 +41,7 @@
supervision_warning_leaflet.process_instance_id,
supervision_warning_leaflet.history_instance_id,
supervision_warning_leaflet.issue_detail,
supervision_warning_leaflet.reform_advice,
supervision_warning_leaflet.take_step,
supervision_warning_leaflet.report_path,
supervision_warning_leaflet.state,

View File

@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.alibaba.nacos.common.utils.UuidUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
@@ -141,8 +140,8 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
@Override
@Transactional(rollbackFor = Exception.class)
public void startReport(OnlineParam.ReportParam param) {
//下发预告警单
warningLeafletService.createLeaflet(ProblemTypeEnum.ONLINE.getName(), "",IdUtil.fastSimpleUUID(), param.getId(), ProblemTypeEnum.ONLINE.getCode(),param.getType(),param.getIssueDetail());
//下发预告警单 todo后期和前端调添加字段
warningLeafletService.createLeaflet(ProblemTypeEnum.ONLINE.getName(), "",IdUtil.fastSimpleUUID(), param.getId(), ProblemTypeEnum.ONLINE.getCode(),param.getType(),param.getIssueDetail(),"");
//更新supervision_line_warning表字段信
LineWarning lineWarning = this.baseMapper.selectById(param.getId());
if (lineWarning.getThresholdResource() == 0) {

View File

@@ -230,9 +230,15 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
//处理特殊字段,用户名、部门名
UserVO userVO = userFeignClient.getUserById(vo.getCreateBy()).getData();
vo.setReporter(userVO.getName());
vo.setOrgName(deptFeignClient.getDeptById(vo.getOrgId()).getData().getName());
vo.setLoadType(dictTreeFeignClient.queryById(vo.getLoadType()).getData().getName());
vo.setBusinessType(dictTreeFeignClient.queryById(vo.getBusinessType()).getData().getName());
if(StringUtils.isNotEmpty(vo.getOrgId())){
vo.setOrgName(deptFeignClient.getDeptById(vo.getOrgId()).getData().getName());
}
if(StringUtils.isNotEmpty(vo.getLoadType())){
vo.setLoadType(dictTreeFeignClient.queryById(vo.getLoadType()).getData().getName());
}
if(StringUtils.isNotEmpty(vo.getBusinessType())){
vo.setBusinessType(dictTreeFeignClient.queryById(vo.getBusinessType()).getData().getName());
}
return vo;
}

View File

@@ -27,8 +27,9 @@ public interface IWarningLeafletService extends IBpmService<WarningLeaflet> {
* problemType问题类型1技术监督管理2在线监测超标问题3用户投诉4现场测试超标参考枚举ProblemTypeEnum
* leaflet单子类型1预警单2告警单
* issueDetail问题详细描述
* reformAdvice:整改意见
*/
void createLeaflet(String name, String deptId, String code, String id, Integer problemType, Integer leaflet, String issueDetail);
void createLeaflet(String name, String deptId, String code, String id, Integer problemType, Integer leaflet, String issueDetail,String reformAdvice);
Page<WarningLeafletVO> alarmPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam);

View File

@@ -82,7 +82,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
* 不创建工作流,只是创建一个告警单,需要待用户反馈后才会进入流程
*/
@Override
public void createLeaflet(String name, String deptId, String code, String id, Integer problemType, Integer leaflet, String issueDetail) {
public void createLeaflet(String name, String deptId, String code, String id, Integer problemType, Integer leaflet, String issueDetail,String reformAdvice) {
WarningLeaflet warningLeaflet = new WarningLeaflet();
warningLeaflet.setLeafletName(name);
warningLeaflet.setDeptId(deptId);
@@ -91,6 +91,8 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
warningLeaflet.setProblemId(id);
warningLeaflet.setLeafletType(leaflet);
warningLeaflet.setIssueDetail(issueDetail);
//新增字段整改意见
warningLeaflet.setReformAdvice(reformAdvice);
warningLeaflet.setState(DataStateEnum.ENABLE.getCode());
warningLeaflet.setStatus(FlowStatusEnum.NO_FEEDBACK.getCode());
this.baseMapper.insert(warningLeaflet);

View File

@@ -1,6 +1,7 @@
package com.njcn.supervision.service.problem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
import com.njcn.supervision.pojo.po.problem.SupervisionUserComplaintPO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.supervision.pojo.param.problem.SupervisionUserComplaintParam;
@@ -19,5 +20,5 @@ public interface SupervisionUserComplaintPOService extends IService<SupervisionU
Page<SupervisionUserComplaintVO> getSupervisionUserComplaint(SupervisionUserComplaintParam.SupervisionUserComplaintQueryParam supervisionUserComplaintQueryParam);
void initiateWarningLeaflet(String id);
void initiateWarningLeaflet(WarningAddParam warningAddParam);
}

View File

@@ -14,9 +14,9 @@ import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.supervision.enums.LeafletTypeEnum;
import com.njcn.supervision.enums.ProblemTypeEnum;
import com.njcn.supervision.mapper.problem.SupervisionUserComplaintPOMapper;
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
import com.njcn.supervision.pojo.param.problem.SupervisionUserComplaintParam;
import com.njcn.supervision.pojo.po.problem.SupervisionUserComplaintPO;
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
import com.njcn.supervision.pojo.vo.problem.SupervisionUserComplaintVO;
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
import com.njcn.supervision.service.problem.SupervisionUserComplaintPOService;
@@ -24,12 +24,10 @@ import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.api.UserFeignClient;
import com.njcn.user.pojo.po.Dept;
import com.njcn.web.factory.PageFactory;
import com.njcn.web.utils.RequestUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -99,8 +97,8 @@ public class SupervisionUserComplaintPOServiceImpl extends ServiceImpl<Supervisi
@Override
@Transactional(rollbackFor = Exception.class)
public void initiateWarningLeaflet(String id) {
SupervisionUserComplaintPO supervisionUserComplaintPO = this.getById(id);
public void initiateWarningLeaflet(WarningAddParam warningAddParam) {
SupervisionUserComplaintPO supervisionUserComplaintPO = this.getById(warningAddParam.getId());
//组装告警单
String complainteDetail = assembleComplainteDetail(supervisionUserComplaintPO);
/*
@@ -115,12 +113,13 @@ public class SupervisionUserComplaintPOServiceImpl extends ServiceImpl<Supervisi
supervisionUserComplaintPO.getUserName().concat("投诉"),
supervisionUserComplaintPO.getDutyOrgId(),
IdWorker.get32UUID(),
id,
warningAddParam.getId(),
ProblemTypeEnum.USER.getCode(),
LeafletTypeEnum.ALARM.getCode(),
supervisionUserComplaintPO.getComplaintText()
supervisionUserComplaintPO.getComplaintText(),
warningAddParam.getReformAdvice()
);
this.lambdaUpdate().eq(SupervisionUserComplaintPO::getId,id).set(SupervisionUserComplaintPO::getInitiateWarningFlag,1).update();
this.lambdaUpdate().eq(SupervisionUserComplaintPO::getId,warningAddParam.getId()).set(SupervisionUserComplaintPO::getInitiateWarningFlag,1).update();
}
private String assembleComplainteDetail(SupervisionUserComplaintPO byId) {

View File

@@ -3,6 +3,7 @@ package com.njcn.supervision.service.survey;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
import com.njcn.bpm.service.IBpmService;
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
import com.njcn.supervision.pojo.po.survey.SurveyTest;
import com.njcn.supervision.pojo.vo.survey.SurveyTestVO;
@@ -28,5 +29,5 @@ public interface ISurveyTestService extends IBpmService<SurveyTest> {
SurveyTestVO getVOById(String id);
void initiateWarningLeaflet(String id);
void initiateWarningLeaflet(WarningAddParam warningAddParam);
}

View File

@@ -78,9 +78,9 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
QueryWrapper<SurveyPlanVO> surveyPlanVOQueryWrapper = new QueryWrapper<>();
if (Objects.nonNull(surveyPlanQueryParam)) {
//添加上时间范围
surveyPlanVOQueryWrapper.between("supervision_survey_plan.plan_start_time",
surveyPlanVOQueryWrapper.and(x->x.between("supervision_survey_plan.plan_start_time",
DateUtil.beginOfDay(DateUtil.parse(surveyPlanQueryParam.getSearchBeginTime())),
DateUtil.endOfDay(DateUtil.parse(surveyPlanQueryParam.getSearchEndTime())));
DateUtil.endOfDay(DateUtil.parse(surveyPlanQueryParam.getSearchEndTime()))).or().isNull("supervision_survey_plan.plan_start_time"));
//根据工程名称模糊搜索
if (StrUtil.isNotBlank(surveyPlanQueryParam.getSearchValue())) {
surveyPlanVOQueryWrapper.like("supervision_survey_plan.plan_name", surveyPlanQueryParam.getSearchValue());
@@ -279,14 +279,17 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
if (surveyPlanVO.getCustomSubstationFlag() == 0) {
//系统内变电站信息
String substation = surveyPlanVO.getSubstation();
String[] subIds = substation.split(StrPool.COMMA);
for (String subId : subIds) {
PollutionSubstationDTO data = lineFeignClient.getSubstationInfo(subId).getData();
SurveySubstation surveySubstation = new SurveySubstation();
surveySubstation.setDataSource(0);
surveySubstation.setSubstationName(data.getName());
surveySubstation.setVoltageLevel(data.getVoltageLevel());
surveySubstationList.add(surveySubstation);
//保存草稿时未选择电站判断
if(StringUtils.isNotEmpty(substation)) {
String[] subIds = substation.split(StrPool.COMMA);
for (String subId : subIds) {
PollutionSubstationDTO data = lineFeignClient.getSubstationInfo(subId).getData();
SurveySubstation surveySubstation = new SurveySubstation();
surveySubstation.setDataSource(0);
surveySubstation.setSubstationName(data.getName());
surveySubstation.setVoltageLevel(data.getVoltageLevel());
surveySubstationList.add(surveySubstation);
}
}
} else {
SurveySubstation surveySubstation = new SurveySubstation();

View File

@@ -25,6 +25,7 @@ import com.njcn.supervision.enums.LeafletTypeEnum;
import com.njcn.supervision.enums.ProblemTypeEnum;
import com.njcn.supervision.enums.SupervisionKeyEnum;
import com.njcn.supervision.mapper.survey.SurveyTestMapper;
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
import com.njcn.supervision.pojo.po.survey.SurveyTest;
@@ -341,8 +342,8 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
@Override
@Transactional(rollbackFor = Exception.class)
public void initiateWarningLeaflet(String id) {
SurveyTestVO surveyTestVO = this.getVOById(id);
public void initiateWarningLeaflet(WarningAddParam warningAddParam) {
SurveyTestVO surveyTestVO = this.getVOById(warningAddParam.getId());
/*
* 1、预告警单名称此处暂时用普测计划名称+变电站名称组成预告警单名
* 2、预告警编号暂时随机by yxb
@@ -355,13 +356,14 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
surveyTestVO.getPlanName().concat(StrPool.UNDERLINE).concat(surveyTestVO.getSubstationName()),
surveyTestVO.getDeptId(),
IdWorker.get32UUID(),
id,
warningAddParam.getId(),
ProblemTypeEnum.SITE_TEST.getCode(),
LeafletTypeEnum.ALARM.getCode(),
surveyTestVO.getProblemDetail()
surveyTestVO.getProblemDetail(),
warningAddParam.getReformAdvice()
);
//将当前的测试数据改为已告警
this.lambdaUpdate().eq(SurveyTest::getId,id).set(SurveyTest::getInitiateWarningFlag,1).update();
this.lambdaUpdate().eq(SurveyTest::getId,warningAddParam.getId()).set(SurveyTest::getInitiateWarningFlag,1).update();
}
/**

View File

@@ -291,9 +291,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()), "supervision_user_report.project_name", userReportQueryParam.getProjectName());
//添加上时间范围
if(StrUtil.isNotBlank(userReportQueryParam.getSearchBeginTime())&&StrUtil.isNotBlank(userReportQueryParam.getSearchEndTime())){
userReportVOQueryWrapper.between("supervision_user_report.expected_production_date",
userReportVOQueryWrapper .and(x->x.between("supervision_user_report.expected_production_date",
DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())),
DateUtil.endOfDay(DateUtil.parse(userReportQueryParam.getSearchEndTime())));
DateUtil.endOfDay(DateUtil.parse(userReportQueryParam.getSearchEndTime()))).or().isNull("supervision_user_report.expected_production_date"));
}
userReportVOQueryWrapper.orderByDesc("supervision_user_report.Update_Time");
}