doum
2026-06-11 d9c657aa78cf0ebe31933a87e63ca92edd8a8da3
server/visits/admin_timer/src/main/java/com/doumee/api/PlatformJobController.java
@@ -7,9 +7,11 @@
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.atomic.AtomicBoolean;
/**
 * @author 江蹄蹄
@@ -24,32 +26,38 @@
    @Autowired
    private PlatformJobService platformJobService;
    private final AtomicBoolean dealingSendNotice = new AtomicBoolean(false);
    @ApiOperation("月台停靠超时报警业务")
    @GetMapping("/platformJobTimer")
    @PostMapping("/platformJobTimer")
    public ApiResponse platformJobTimer() {
        log.info("定时任务执行开始:platformJobTimer-月台停靠超时报警");
        platformJobService.timeOutReport();
        return ApiResponse.success("月台停靠超时报警业务");
    }
    @ApiOperation("月台作业检查电子锁上锁状态")
    @GetMapping("/platformCheckWmsLockStatus")
    @PostMapping("/platformCheckWmsLockStatus")
    public ApiResponse checkWmsLockStatus() {
        log.info("定时任务执行开始:checkWmsLockStatus-检查电子锁上锁状态");
        platformJobService.checkWmsLockStatus();
        return ApiResponse.success("月台停靠超时报警业务");
    }
    @ApiOperation("月台作业超时报警业务")
    @GetMapping("/platformJobWorkTimeOut")
    @PostMapping("/platformJobWorkTimeOut")
    public ApiResponse platformJobWorkTimeOut() {
        log.info("定时任务执行开始:platformJobWorkTimeOut-月台作业超时报警");
        platformJobService.timeOutWork();
        return ApiResponse.success("月台作业超时报警业务");
    }
    @ApiOperation("月台等待作业超时业务")
    @GetMapping("/platformJobWaitTimeOut")
    @PostMapping("/platformJobWaitTimeOut")
    public ApiResponse platformJobWaitTimeOut() {
        log.info("定时任务执行开始:platformJobWaitTimeOut-月台等待作业超时");
        platformJobService.timeOutCallIn();
        return ApiResponse.success("月台等待作业超时业务");
    }
@@ -58,11 +66,19 @@
    @PreventRepeat(interval = 2000)
    @ApiOperation("月台今日作业未完成通知定时")
    @GetMapping("/sendUnFinishNotice")
    public synchronized ApiResponse sendUnFinishNotice() {
        log.error("========月台今日作业未完成通知定时============开始"+System.currentTimeMillis()+"");
        platformJobService.sendUnFinishNotice();
        log.error("========月台今日作业未完成通知定时============结束"+System.currentTimeMillis()+"");
    @PostMapping("/sendUnFinishNotice")
    public ApiResponse sendUnFinishNotice() {
        if(!dealingSendNotice.compareAndSet(false, true)){
            return ApiResponse.success("sendUnFinishNotice正在执行,跳过");
        }
        try {
            log.info("定时任务执行开始:sendUnFinishNotice-月台作业未完成通知");
            platformJobService.sendUnFinishNotice();
        } catch (Exception e){
            log.error("sendUnFinishNotice异常", e);
        } finally {
            dealingSendNotice.set(false);
        }
        return ApiResponse.success("月台今日作业外完成通知定时");
    }