|
@@ -4,8 +4,10 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
|
import com.ruoyi.qdtl.domain.PlanUser;
|
|
|
+import com.ruoyi.qdtl.domain.TlInspectionLocation;
|
|
|
import com.ruoyi.qdtl.domain.TlInspectionPlan;
|
|
|
import com.ruoyi.qdtl.domain.TlPlanRecord;
|
|
|
+import com.ruoyi.qdtl.service.ITlInspectionLocationService;
|
|
|
import com.ruoyi.qdtl.service.ITlInspectionPlanService;
|
|
|
import com.ruoyi.qdtl.service.ITlPlanRecordService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -30,6 +32,8 @@ public class PlanTask {
|
|
|
@Autowired
|
|
|
private ITlPlanRecordService planRecordService;
|
|
|
@Autowired
|
|
|
+ private ITlInspectionLocationService locationService;
|
|
|
+ @Autowired
|
|
|
private RedisCache redisCache;
|
|
|
|
|
|
/**
|
|
@@ -63,18 +67,23 @@ public class PlanTask {
|
|
|
for (TlInspectionPlan inspectionPlan : planList) {
|
|
|
// 查询计划的人员.根据计划id查询人员以及设备号
|
|
|
List<PlanUser> userList = planService.queryPlanUser(inspectionPlan.getId());
|
|
|
+ // 查询计划的线路及点位
|
|
|
+ List<TlInspectionLocation> lineLocations = locationService.queryLocationByLineId(inspectionPlan.getLineId());
|
|
|
if (userList != null && userList.size() > 0) {
|
|
|
// 组装计划数据
|
|
|
for (PlanUser planUser : userList) {
|
|
|
- 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());
|
|
|
- planRecords.add(planRecord);
|
|
|
+ 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());
|
|
|
+ planRecords.add(planRecord);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|