Administrator
2023-08-22 e8a4f9014fbea4159ea15642226c6793d57d13ee
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java
@@ -3,6 +3,7 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -788,18 +789,18 @@
    @Override
    public Results son() {
        SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        //获取用户执行人
        String userId = SecurityUtils.getUserId();
        // 减少 10 秒
        LocalDateTime now = LocalDateTime.now(); // 获取当前日期时间
        LocalDateTime earlier = now.minusSeconds(10); // 减少30秒
        System.out.println("当前日期时间:" + now);
        System.out.println("减少10秒后的日期时间:" + earlier);
        RecordSonParam recordSonParam = new RecordSonParam();
        recordSonParam.setUserId(userId);
        recordSonParam.setTime(dateFormatTime.format(now));
        recordSonParam.setBeforeTime(dateFormatTime.format(earlier));
        String n = fmt.format(now);
        recordSonParam.setTime(n);
        String e = fmt.format(earlier);
        recordSonParam.setBeforeTime(e);
        //根据姓名ID为执行人获取所有对应的计划名称
        List<ArdAppPatrolplan> list = patrolplanMapper.planUser(recordSonParam);
        JSONArray jsonArray = new JSONArray();