rk
2026-06-09 c467370d8741bc05ca7c22d4253c58ac0a979ef5
server/visits/admin_timer/src/main/java/com/doumee/api/PlatformJobController.java
@@ -11,6 +11,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.atomic.AtomicBoolean;
/**
 * @author 江蹄蹄
 * @date 2023/11/30 15:33
@@ -24,16 +26,20 @@
    @Autowired
    private PlatformJobService platformJobService;
    private final AtomicBoolean dealingSendNotice = new AtomicBoolean(false);
    @ApiOperation("月台停靠超时报警业务")
    @PostMapping("/platformJobTimer")
    public ApiResponse platformJobTimer() {
        log.info("定时任务执行开始:platformJobTimer-月台停靠超时报警");
        platformJobService.timeOutReport();
        return ApiResponse.success("月台停靠超时报警业务");
    }
    @ApiOperation("月台作业检查电子锁上锁状态")
    @PostMapping("/platformCheckWmsLockStatus")
    public ApiResponse checkWmsLockStatus() {
        log.info("定时任务执行开始:checkWmsLockStatus-检查电子锁上锁状态");
        platformJobService.checkWmsLockStatus();
        return ApiResponse.success("月台停靠超时报警业务");
    }
@@ -42,6 +48,7 @@
    @ApiOperation("月台作业超时报警业务")
    @PostMapping("/platformJobWorkTimeOut")
    public ApiResponse platformJobWorkTimeOut() {
        log.info("定时任务执行开始:platformJobWorkTimeOut-月台作业超时报警");
        platformJobService.timeOutWork();
        return ApiResponse.success("月台作业超时报警业务");
    }
@@ -50,6 +57,7 @@
    @ApiOperation("月台等待作业超时业务")
    @PostMapping("/platformJobWaitTimeOut")
    public ApiResponse platformJobWaitTimeOut() {
        log.info("定时任务执行开始:platformJobWaitTimeOut-月台等待作业超时");
        platformJobService.timeOutCallIn();
        return ApiResponse.success("月台等待作业超时业务");
    }
@@ -59,10 +67,18 @@
    @PreventRepeat(interval = 2000)
    @ApiOperation("月台今日作业未完成通知定时")
    @PostMapping("/sendUnFinishNotice")
    public synchronized ApiResponse sendUnFinishNotice() {
        log.error("========月台今日作业未完成通知定时============开始"+System.currentTimeMillis()+"");
    public ApiResponse sendUnFinishNotice() {
        if(!dealingSendNotice.compareAndSet(false, true)){
            return ApiResponse.success("sendUnFinishNotice正在执行,跳过");
        }
        try {
            log.info("定时任务执行开始:sendUnFinishNotice-月台作业未完成通知");
        platformJobService.sendUnFinishNotice();
        log.error("========月台今日作业未完成通知定时============结束"+System.currentTimeMillis()+"");
        } catch (Exception e){
            log.error("sendUnFinishNotice异常", e);
        } finally {
            dealingSendNotice.set(false);
        }
        return ApiResponse.success("月台今日作业外完成通知定时");
    }