冀北监测点试运行功能调整

This commit is contained in:
cdf
2024-05-22 19:52:19 +08:00
parent af3d231352
commit 8e83a6b35e
9 changed files with 65 additions and 14 deletions

View File

@@ -20,4 +20,7 @@ public interface TempLineRunTestFeignClient {
@GetMapping("/updateStatus")
HttpResult<Object> updateStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
@GetMapping("/isTestRunStartOrEnd")
void isTestRunStartOrEnd();
}

View File

@@ -33,6 +33,12 @@ public class TempLineRunTestFeignClientFallbackFactory implements FallbackFactor
log.error("{}异常,降级处理,异常为:{}", "更新流程状态", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public void isTestRunStartOrEnd() {
log.error("{}异常,降级处理,异常为:{}", "定时判断试运行是否结束", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -160,4 +160,12 @@ public class SupervisionDevMainReportVO {
}
private String substation;
private String monitoringTerminalCode;
private String monitoringTerminalName;
}

View File

@@ -54,11 +54,8 @@ public class SupervisionTempLineRunTestController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/isTestRunStartOrEnd")
@ApiOperation("每日判断试运行是否结束")
public HttpResult<Object> isTestRunStartOrEnd(){
String methodDescribe = getMethodDescribe("isTestRunStartOrEnd");
public void isTestRunStartOrEnd(){
iSupervisionTempLineRunTestService.isTestRunStartOrEnd();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
}

View File

@@ -29,18 +29,20 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, reporter, report_date, org_id, expected_production_date, city, user_status, user_name,
acceptance_inspection_report, acceptance_inspection_report_single, type_experiment_report,
factory_inspection_report, performance_test_report, information_security_test_report,
other_attachments, process_instance_id, `status`, Create_By, Create_Time, Update_By,
id, reporter, report_date, org_id, expected_production_date, city, user_status, user_name,
acceptance_inspection_report, acceptance_inspection_report_single, type_experiment_report,
factory_inspection_report, performance_test_report, information_security_test_report,
other_attachments, process_instance_id, `status`, Create_By, Create_Time, Update_By,
Update_Time, `State`
</sql>
<select id="page" resultType="com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO">
SELECT
*
supervision_dev_main_report.*,station.name substation,dev.monitoring_terminal_code,dev.monitoring_terminal_name
FROM supervision_dev_main_report supervision_dev_main_report
left join supervision_temp_device_report dev on supervision_dev_main_report.id = dev.id
left join pq_Line station on dev.substation = station.id
WHERE ${ew.sqlSegment}
</select>
</mapper>
</mapper>

View File

@@ -30,6 +30,10 @@
supervision_temp_line_report.Power_Substation_Name,
supervision_temp_line_report.line_id lineId,
supervision_temp_line_report.line_name lineName,
supervision_temp_line_report.connected_bus,
supervision_temp_line_report.monitoring_terminal_code,
supervision_temp_line_report.monitoring_terminal_name,
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`

View File

@@ -11,6 +11,7 @@ import com.njcn.bpm.api.BpmProcessFeignClient;
import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum;
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.device.biz.commApi.CommLineClient;
import com.njcn.device.biz.enums.RunFlagEnum;
@@ -71,7 +72,7 @@ public class SupervisionTempLineRunTestServiceImpl extends ServiceImpl<Supervisi
List<LineDTO> lineDTOList = commLineClient.getLineDetailBatch(lineIds).getData();
if(lineIds.size()!=lineDTOList.size()){
throw new BusinessException("请联系管理员检查监测点唯一编号是否匹配");
throw new BusinessException(CommonResponseEnum.FAIL,"请联系管理员检查监测点唯一编号是否匹配");
}
//校验
@@ -103,7 +104,6 @@ public class SupervisionTempLineRunTestServiceImpl extends ServiceImpl<Supervisi
@Override
public void isTestRunStartOrEnd() {
LocalDateTime time = LocalDateTime.now();
LambdaQueryWrapper<SupervisionTempLineRunTestPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(SupervisionTempLineRunTestPO::getTestRunState,1).eq(SupervisionTempLineRunTestPO::getState,DataStateEnum.ENABLE.getCode());
List<SupervisionTempLineRunTestPO> supervisionTempLineRunTestPOList = this.list(lambdaQueryWrapper);

View File

@@ -31,6 +31,12 @@
<artifactId>user-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>supervision-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>common-web</artifactId>
@@ -128,4 +134,4 @@
</plugins>
</build>
</project>
</project>

View File

@@ -0,0 +1,25 @@
package com.njcn.system.timer.tasks;
import com.njcn.supervision.api.TempLineRunTestFeignClient;
import com.njcn.system.timer.TimerTaskRunner;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
/**
* pqs
* 冀北技术监督监测点试运行,每日扫描
* @author cdf
* @date 2024/5/22
*/
@Component
@RequiredArgsConstructor
public class SupervisionLineRunTestTaskRunner implements TimerTaskRunner {
private final TempLineRunTestFeignClient tempLineRunTestFeignClient;
@Override
public void action(String date) {
tempLineRunTestFeignClient.isTestRunStartOrEnd();
}
}