冀北重新发起,取消发起接口

This commit is contained in:
cdf
2024-06-04 15:54:25 +08:00
parent 503a82e92a
commit c54d00dbae
18 changed files with 105 additions and 16 deletions

View File

@@ -121,6 +121,17 @@ public class UserReportParam extends BaseEntity {
private UserReportSubstationPO userReportSubstationPO;
/**
* 流程实例的编号
*/
@ApiModelProperty(value = "流程实例的编号")
private String processInstanceId;
@ApiModelProperty(value = "历史流程实例的编号")
private String historyInstanceId;
@Data

View File

@@ -118,19 +118,19 @@ public class SupervisionTempLineReport extends BaseEntity {
/**
* CT变比
*/
@ApiModelProperty(value="CT1")
@TableField(value = "ct_1")
private Integer ct1;
@ApiModelProperty(value="CT2")
@TableField(value = "ct_2")
private Integer ct2;
/**
* PT变比
*/
@ApiModelProperty(value="PT1")
@TableField(value = "pt_1")
private Integer pt1;
@ApiModelProperty(value="PT2")
@TableField(value = "pt_2")
private Integer pt2;
@@ -179,7 +179,7 @@ public class SupervisionTempLineReport extends BaseEntity {
* 是否参与统计
*/
@TableField(value = "is_statistical")
private String isStatistical;
private Integer isStatistical;
/**
* 线路号
*/
@@ -208,7 +208,7 @@ public class SupervisionTempLineReport extends BaseEntity {
* 是否并网点
*/
@TableField(value = "is_grid_connection_point")
private String isGridConnectionPoint;
private Integer isGridConnectionPoint;
/**
* 监测点运行状态

View File

@@ -63,6 +63,8 @@ public class WarningLeaflet extends BaseEntity implements Serializable{
*/
private String processInstanceId;
private String historyInstanceId;
/**
* 问题详细描述
*/

View File

@@ -8,7 +8,7 @@ import java.io.Serializable;
/**
* <p>
*
*
* </p>
*
* @author hongawen
@@ -88,4 +88,5 @@ public class QuitRunningDeviceVO extends BaseEntity implements Serializable{
private String historyInstanceId;
private String createBy;
}

View File

@@ -173,6 +173,6 @@ public class SupervisionDevMainReportVO {
private String monitoringTerminalName;
private String createBy;
}

View File

@@ -46,4 +46,7 @@ public class SupervisionTempLineDebugVO extends BaseEntity {
* 试运行时间范围
*/
private String testRunTime;
private String createBy;
}

View File

@@ -177,7 +177,7 @@ public class SupervisionTempLineReportVO {
* 是否参与统计
*/
@ApiModelProperty(value="是否参与统计")
private Boolean isStatistical;
private Integer isStatistical;
/**
* 监测点对象名称
@@ -195,7 +195,7 @@ public class SupervisionTempLineReportVO {
* 是否并网点
*/
@ApiModelProperty(value="是否并网点")
private Boolean isGridConnectionPoint;
private Integer isGridConnectionPoint;
/**
* 监测点运行状态
@@ -228,7 +228,8 @@ public class SupervisionTempLineReportVO {
@ApiModelProperty(value = "流程实例的编号")
private String processInstanceId;
@ApiModelProperty(value = "流程实例的编号")
private String historyInstanceId;
/**
* 线路号
*/
@@ -248,4 +249,7 @@ public class SupervisionTempLineReportVO {
private Integer status;
private String createBy;
}

View File

@@ -85,9 +85,13 @@ public class WarningLeafletVO extends BaseEntity implements Serializable{
*/
private String processInstanceId;
private String historyInstanceId;
/**
* 问题详细描述
*/
private String issueDetail;
private String createBy;
}

View File

@@ -192,4 +192,10 @@ public class SupervisionPlanVO {
@ApiModelProperty(value = "流程实例的编号")
private String processInstanceId;
@ApiModelProperty(value = "历史流程实例的编号")
private String historyInstanceId;
}

View File

@@ -134,6 +134,9 @@ public class UserReportVO {
@TableField(value = "`status`")
private Integer status;
private String createBy;
/**
* 创建时间
*/

View File

@@ -93,6 +93,17 @@ public class WarningLeafletController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
@PostMapping("/update")
@ApiOperation("重新发起反馈单申请")
@ApiImplicitParam(name = "warningLeafletUpdateParam", value = "实体参数", required = true)
public HttpResult<Object> updateFeedback(@RequestBody @Validated WarningLeafletParam.WarningLeafletUpdateParam warningLeafletUpdateParam) {
String methodDescribe = getMethodDescribe("updateFeedback");
warningLeafletService.updateFeedback(warningLeafletUpdateParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@GetMapping("/getById")
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("根据id获取预告警单的详细数据")

View File

@@ -37,6 +37,7 @@ import java.util.List;
@RequestMapping("/generalSurvey")
@Api(tags = "谐波普测计划")
@AllArgsConstructor
@Deprecated
public class GeneralSurveyController extends BaseController {
private final SupervisionGeneralSurveyPlanPOService supervisionGeneralSurveyPlanPOService;

View File

@@ -36,7 +36,8 @@
supervision_temp_line_report.Power_Substation_Name,
supervision_temp_line_debug.reason reason,
supervision_temp_line_debug.process_instance_id process_instanceId,
supervision_temp_line_debug.`status` `Status`
supervision_temp_line_debug.`status` `Status`,
supervision_temp_line_debug.create_by
FROM
supervision_temp_line_report left
JOIN supervision_temp_line_debug ON supervision_temp_line_report.id = supervision_temp_line_debug.id
@@ -59,7 +60,8 @@
supervision_temp_line_run_test.process_instance_id process_instanceId,
supervision_temp_line_run_test.`status` `Status`,
IFNULL(supervision_temp_line_run_test.`test_run_state`,0) `testRunState`,
supervision_temp_line_run_test.test_run_time
supervision_temp_line_run_test.test_run_time,
supervision_temp_line_run_test.create_by
FROM
supervision_temp_line_debug
inner JOIN supervision_temp_line_report ON supervision_temp_line_report.id = supervision_temp_line_debug.id

View File

@@ -50,6 +50,7 @@
supervision_user_report.process_instance_id,
supervision_user_report.history_instance_id,
supervision_user_report.create_time,
supervision_user_report.create_by,
supervision_user_report.status
FROM supervision_user_report supervision_user_report
WHERE ${ew.sqlSegment}

View File

@@ -35,6 +35,9 @@ public interface IWarningLeafletService extends IService<WarningLeaflet> {
void addFeedback(WarningLeafletParam.WarningLeafletUpdateParam warningLeafletUpdateParam);
String updateFeedback(WarningLeafletParam.WarningLeafletUpdateParam warningLeafletUpdateParam);
WarningLeafletVO getVOById(String id);
void updateStatus(String businessKey, Integer status);

View File

@@ -23,6 +23,7 @@ import com.njcn.supervision.enums.LeafletTypeEnum;
import com.njcn.supervision.enums.ProblemTypeEnum;
import com.njcn.supervision.mapper.leaflet.WarningLeafletMapper;
import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO;
import com.njcn.supervision.pojo.po.survey.SurveyTest;
@@ -134,6 +135,36 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
this.baseMapper.updateById(warningLeaflet);
}
@Override
public String updateFeedback(WarningLeafletParam.WarningLeafletUpdateParam warningLeafletUpdateParam) {
WarningLeaflet warningLeaflet = this.baseMapper.selectById(warningLeafletUpdateParam.getId());
//判断是否有权限操作
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),warningLeaflet.getCreateBy());
//处理历史流程id列表
String historyInstanceIds = InstanceUtil.dealHistoryId(warningLeaflet.getProcessInstanceId(), warningLeaflet.getHistoryInstanceId());
BeanUtils.copyProperties(warningLeafletUpdateParam,warningLeaflet);
warningLeaflet.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
warningLeaflet.setState(DataStateEnum.ENABLE.getCode());
// 发起 BPM 流程
Map<String, Object> processInstanceVariables = new HashMap<>();
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
bpmProcessInstanceCreateReqDTO.setBusinessKey(warningLeaflet.getId());
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(warningLeafletUpdateParam.getStartUserSelectAssignees());
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
String processInstanceId = bpmProcessFeignClient.createProcessInstance(warningLeaflet.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
// 将工作流的编号,更新到流程单中
warningLeaflet.setProcessInstanceId(processInstanceId);
//保存历史流程id列表
warningLeaflet.setHistoryInstanceId(historyInstanceIds);
this.baseMapper.updateById(warningLeaflet);
return warningLeaflet.getId();
}
@Override
public WarningLeafletVO getVOById(String id) {
WarningLeaflet warningLeaflet = this.getById(id);

View File

@@ -206,6 +206,7 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
surveyTest.setSubstation(subId);
surveyTest.setCustomSubstationFlag(0);
surveyTest.setStatus(FlowStatusEnum.UN_TEST.getCode());
surveyTest.setCreateBy(surveyPlan.getCreateBy());
surveyTestService.save(surveyTest);
}
}else{
@@ -216,6 +217,7 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
surveyTest.setInitiateWarningFlag(0);
surveyTest.setCustomSubstationFlag(1);
surveyTest.setStatus(FlowStatusEnum.UN_TEST.getCode());
surveyTest.setCreateBy(surveyPlan.getCreateBy());
surveyTestService.save(surveyTest);
}
}

View File

@@ -156,10 +156,12 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
UserReportPO userReportPO = this.baseMapper.selectById(userReportParam.getId());
//判断是否有权限操作
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),userReportPO.getCreateBy());
if(!Objects.equals(userReportPO.getStatus(), BpmTaskStatusEnum.REJECT.getStatus())){
if(Objects.equals(userReportPO.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus())){
throw new BusinessException("当前流程以完成审批,无法重新发起");
}
BeanUtil.copyProperties(userReportParam,userReportPO);
if (
CollectionUtil.newArrayList(
UserNatureEnum.BUILD_POWER_GRID.getCode(),
@@ -169,7 +171,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
UserReportProjectPO userReportProjectPO = userReportParam.getUserReportProjectPO();
userReportProjectPO.setId(userReportPO.getId());
userReportProjectPO.setState(DataStateEnum.ENABLE.getCode());
userReportProjectPOService.saveOrUpdate(userReportProjectPO);
userReportProjectPOService.updateById(userReportProjectPO);
} else if (
CollectionUtil.newArrayList(
UserNatureEnum.BUILD_NON_LINEAR_LOAD.getCode(),
@@ -259,7 +261,8 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds)
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode());
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
.eq("supervision_user_report.data_type",0);
if (Objects.nonNull(userReportQueryParam)) {
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
//查询所有区域下的数据
@@ -341,6 +344,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
List<UserReportPO> list = this.lambdaQuery()
.eq(UserReportPO::getStatus, 2)
.eq(UserReportPO::getDataType,0)
.in(CollectionUtil.isNotEmpty(data), UserReportPO::getOrgId, data)
.list();
List<UserReportVO> collect = list.stream().map(temp -> {