|
@@ -1,8 +1,10 @@
|
|
|
package com.ruoyi.web.controller.task;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
|
+import com.ruoyi.common.core.text.Convert;
|
|
|
import com.ruoyi.qdtl.domain.PlanUser;
|
|
|
import com.ruoyi.qdtl.domain.TlInspectionLocation;
|
|
|
import com.ruoyi.qdtl.domain.TlInspectionPlan;
|
|
@@ -65,6 +67,11 @@ public class PlanTask {
|
|
|
if (planList != null && planList.size() > 0) {
|
|
|
List<TlPlanRecord> planRecords = new ArrayList<>();
|
|
|
for (TlInspectionPlan inspectionPlan : planList) {
|
|
|
+ // 查询是否满足日期的要求
|
|
|
+ int week = DateUtil.dayOfWeek(DateUtil.parseDate(queryDate));
|
|
|
+ if (!CollUtil.contains(StrUtil.split(inspectionPlan.getWeeks(), ","), Convert.toStr(week))) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
// 查询计划的人员.根据计划id查询人员以及设备号
|
|
|
List<PlanUser> userList = planService.queryPlanUser(inspectionPlan.getId());
|
|
|
// 查询计划的线路及点位
|
|
@@ -73,19 +80,25 @@ public class PlanTask {
|
|
|
// 组装计划数据
|
|
|
for (PlanUser planUser : userList) {
|
|
|
for (TlInspectionLocation lineLocation : lineLocations) {
|
|
|
- TlPlanRecord planRecord = new TlPlanRecord();
|
|
|
- planRecord.setPlanId(planUser.getPlanId());
|
|
|
- planRecord.setPlanDate(queryDate);
|
|
|
- planRecord.setPlanName(inspectionPlan.getPlanName());
|
|
|
- planRecord.setUserId(planUser.getUserId());
|
|
|
- planRecord.setNickName(planUser.getNickName());
|
|
|
- planRecord.setCard(planUser.getCard());
|
|
|
- planRecord.setScore(inspectionPlan.getScore());
|
|
|
- planRecord.setCheckpointCard(lineLocation.getLocationCode());
|
|
|
- planRecord.setLineId(inspectionPlan.getLineId());
|
|
|
- planRecord.setLineName("");
|
|
|
- planRecord.setAreaId(lineLocation.getAreaId());
|
|
|
- planRecords.add(planRecord);
|
|
|
+ for (String s : StrUtil.split(inspectionPlan.getTimeUnit(), ",")) {
|
|
|
+ for (int i = 0; i < inspectionPlan.getXunNum(); i++) {
|
|
|
+ TlPlanRecord planRecord = new TlPlanRecord();
|
|
|
+ planRecord.setPlanId(planUser.getPlanId());
|
|
|
+ planRecord.setPlanDate(queryDate);
|
|
|
+ planRecord.setStartTime(s.split("~")[0] + ":00");
|
|
|
+ planRecord.setEndTime(s.split("~")[1] + ":59");
|
|
|
+ planRecord.setPlanName(inspectionPlan.getPlanName());
|
|
|
+ planRecord.setUserId(planUser.getUserId());
|
|
|
+ planRecord.setNickName(planUser.getNickName());
|
|
|
+ planRecord.setCard(planUser.getCard());
|
|
|
+ planRecord.setScore(inspectionPlan.getScore());
|
|
|
+ planRecord.setCheckpointCard(lineLocation.getLocationCode());
|
|
|
+ planRecord.setLineId(inspectionPlan.getLineId());
|
|
|
+ planRecord.setLineName("");
|
|
|
+ planRecord.setAreaId(lineLocation.getAreaId());
|
|
|
+ planRecords.add(planRecord);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|