Commit eb36129d authored by tianyiming's avatar tianyiming

更新索引--涉及任务下发、定时器修改、任务执行

parent b585659a
...@@ -36,6 +36,9 @@ public class ESPlanTaskListDto { ...@@ -36,6 +36,9 @@ public class ESPlanTaskListDto {
private String taskName; private String taskName;
@Field(type = FieldType.Text) @Field(type = FieldType.Text)
private String type;
@Field(type = FieldType.Text)
private String beginTime; private String beginTime;
@Field(type = FieldType.Text) @Field(type = FieldType.Text)
......
...@@ -22,9 +22,15 @@ public class ESTaskDetailDto { ...@@ -22,9 +22,15 @@ public class ESTaskDetailDto {
@Id @Id
private String id;
@Field(type = FieldType.Text)
private String pointId; private String pointId;
@Field(type = FieldType.Text) @Field(type = FieldType.Text)
private String planTaskId;
@Field(type = FieldType.Text)
private String pointName; private String pointName;
@Field(type = FieldType.Text) @Field(type = FieldType.Text)
......
...@@ -34,6 +34,18 @@ public class PlanTaskDetail extends BasicEntity { ...@@ -34,6 +34,18 @@ public class PlanTaskDetail extends BasicEntity {
*/ */
@Column(name="executor_id") @Column(name="executor_id")
private String executorId; private String executorId;
/**
* 点名称
*/
@Column(name="name")
private String name;
/**
* 点编号
*/
@Column(name="point_no")
private String pointNo;
/** /**
* 执行时间 * 执行时间
...@@ -69,6 +81,14 @@ public class PlanTaskDetail extends BasicEntity { ...@@ -69,6 +81,14 @@ public class PlanTaskDetail extends BasicEntity {
this.pointId = pointId; this.pointId = pointId;
} }
public void setName(String name) {
this.name = name;
}
public void setPointNo(String pointNo) {
this.pointNo = pointNo;
}
public long getTaskNo() { public long getTaskNo() {
return this.taskNo; return this.taskNo;
} }
......
...@@ -163,4 +163,7 @@ public interface PointMapper extends BaseMapper { ...@@ -163,4 +163,7 @@ public interface PointMapper extends BaseMapper {
List<Point> findByName(@Param(value = "pointName") String pointName, @Param(value = "pointId") String pointId); List<Point> findByName(@Param(value = "pointName") String pointName, @Param(value = "pointId") String pointId);
List<Point> findByNo(@Param(value = "pointNo") String pointNo, @Param(value = "pointId") String pointId); List<Point> findByNo(@Param(value = "pointNo") String pointNo, @Param(value = "pointId") String pointId);
Point selectPointInfo(long pointId);
} }
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
@Repository("iRoutePointDao") @Repository("iRoutePointDao")
public interface IRoutePointDao extends BaseDao<RoutePoint, Long> { public interface IRoutePointDao extends BaseDao<RoutePoint, Long> {
@Query(value = "SELECT COUNT( point_id ) FROM p_route_point where route_id = ?1", nativeQuery = true) @Query(value = "SELECT COUNT( point_id ) cont FROM p_route_point where route_id = ?1", nativeQuery = true)
int countRoutePoint(Long routeId); int countRoutePoint(Long routeId);
@Query(value = "SELECT * FROM p_route_point where point_id = ?1", nativeQuery = true) @Query(value = "SELECT * FROM p_route_point where point_id = ?1", nativeQuery = true)
......
...@@ -176,6 +176,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -176,6 +176,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Autowired @Autowired
private ICheckShotDao iCheckShotDao; private ICheckShotDao iCheckShotDao;
@Autowired
PointMapper pointMapper;
@Autowired @Autowired
private RepositoryTs repositoryTs; private RepositoryTs repositoryTs;
...@@ -938,9 +940,20 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -938,9 +940,20 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
List<PlanTaskDetail> planTaskDetailList = new ArrayList<>(); List<PlanTaskDetail> planTaskDetailList = new ArrayList<>();
planTaskDetails.forEach(single ->planTaskDetailList.add(single)); planTaskDetails.forEach(single ->planTaskDetailList.add(single));
for (PlanTaskDetail taskDetail : planTaskDetailList) {
Point point = pointMapper.selectPointInfo(taskDetail.getPointId());
taskDetail.setName(point.getName());
taskDetail.setPointNo(point.getPointNo());
}
for (ESPlanTaskListDto esPlanTaskListDto : esPlanTaskListDtos) { for (ESPlanTaskListDto esPlanTaskListDto : esPlanTaskListDtos) {
esPlanTaskListDto.setPoints(planTaskDetailList); esPlanTaskListDto.setPoints(planTaskDetailList);
Map task = queryPlanTaskById(Long.valueOf(esPlanTaskListDto.getPlanTaskId()));
esPlanTaskListDto.setFinshNum(ObjectUtils.isEmpty(task.get("finshNum")) ? "0" : task.get("finshNum").toString());
esPlanTaskListDto.setOmission(ObjectUtils.isEmpty(task.get("omission")) ? "0" : task.get("omission").toString());
esPlanTaskListDto.setUnqualified(ObjectUtils.isEmpty(task.get("unqualified")) ? "0" : task.get("unqualified").toString());
esPlanTaskListDto.setUnplan(ObjectUtils.isEmpty(task.get("unplan")) ? "0" : task.get("unplan").toString());
esPlanTaskListDto.setTaskPlanNum(ObjectUtils.isEmpty(task.get("taskPlanNum")) ? "0" : task.get("taskPlanNum").toString());
} }
saveEsPlanTaskList(esPlanTaskListDtos, oldEsPlanTaskListDtos); saveEsPlanTaskList(esPlanTaskListDtos, oldEsPlanTaskListDtos);
// 定时任务监控 // 定时任务监控
...@@ -1287,6 +1300,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1287,6 +1300,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
ESPlanTaskListDto esPlanTaskListDto = JSONObject.parseObject(toJSONString(planTask), ESPlanTaskListDto esPlanTaskListDto = JSONObject.parseObject(toJSONString(planTask),
ESPlanTaskListDto.class); ESPlanTaskListDto.class);
Map task = queryPlanTaskById(Long.valueOf(id));
esPlanTaskListDto.setFinshNum(ObjectUtils.isEmpty(task.get("finshNum")) ? "0" : task.get("finshNum").toString());
esPlanTaskListDto.setOmission(ObjectUtils.isEmpty(task.get("omission")) ? "0" : task.get("omission").toString());
esPlanTaskListDto.setUnqualified(ObjectUtils.isEmpty(task.get("unqualified")) ? "0" : task.get("unqualified").toString());
esPlanTaskListDto.setUnplan(ObjectUtils.isEmpty(task.get("unplan")) ? "0" : task.get("unplan").toString());
esPlanTaskListDto.setTaskPlanNum(ObjectUtils.isEmpty(task.get("taskPlanNum")) ? "0" : task.get("taskPlanNum").toString());
esPlanTaskListDto.setPoints(planTaskDetails); esPlanTaskListDto.setPoints(planTaskDetails);
esPlanTaskList.save(esPlanTaskListDto); esPlanTaskList.save(esPlanTaskListDto);
// 生成巡检记录 // 生成巡检记录
......
...@@ -23,7 +23,6 @@ import com.yeejoin.amos.patrol.business.param.CheckInputParam; ...@@ -23,7 +23,6 @@ import com.yeejoin.amos.patrol.business.param.CheckInputParam;
import com.yeejoin.amos.patrol.business.param.MsgConfigParam; import com.yeejoin.amos.patrol.business.param.MsgConfigParam;
import com.yeejoin.amos.patrol.business.service.intfc.IMessageService; import com.yeejoin.amos.patrol.business.service.intfc.IMessageService;
import com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService; import com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService;
import com.yeejoin.amos.patrol.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.patrol.business.util.DateUtil; import com.yeejoin.amos.patrol.business.util.DateUtil;
import com.yeejoin.amos.patrol.business.util.Toke; import com.yeejoin.amos.patrol.business.util.Toke;
import com.yeejoin.amos.patrol.common.enums.*; import com.yeejoin.amos.patrol.common.enums.*;
...@@ -225,6 +224,12 @@ public class JobService implements IJobService { ...@@ -225,6 +224,12 @@ public class JobService implements IJobService {
ESPlanTaskListDto esPlanTaskListDto = new ESPlanTaskListDto(); ESPlanTaskListDto esPlanTaskListDto = new ESPlanTaskListDto();
esPlanTaskListDto.setPlanTaskId(id); esPlanTaskListDto.setPlanTaskId(id);
esPlanTaskListDto.setFinishStatus(String.valueOf(status)); esPlanTaskListDto.setFinishStatus(String.valueOf(status));
Map task = planTaskMapper.queryPlanTaskById(Long.valueOf(id));
esPlanTaskListDto.setFinshNum(ObjectUtils.isEmpty(task.get("finshNum")) ? "0" : task.get("finshNum").toString());
esPlanTaskListDto.setOmission(ObjectUtils.isEmpty(task.get("omission")) ? "0" : task.get("omission").toString());
esPlanTaskListDto.setUnqualified(ObjectUtils.isEmpty(task.get("unqualified")) ? "0" : task.get("unqualified").toString());
esPlanTaskListDto.setUnplan(ObjectUtils.isEmpty(task.get("unplan")) ? "0" : task.get("unplan").toString());
esPlanTaskListDto.setTaskPlanNum(ObjectUtils.isEmpty(task.get("taskPlanNum")) ? "0" : task.get("taskPlanNum").toString());
List<PlanTaskDetail> planTaskDetailList = planTaskMapper.selectTaskDetails(id); List<PlanTaskDetail> planTaskDetailList = planTaskMapper.selectTaskDetails(id);
esPlanTaskListDto.setPoints(planTaskDetailList); esPlanTaskListDto.setPoints(planTaskDetailList);
esPlanTaskListDtos.add(esPlanTaskListDto); esPlanTaskListDtos.add(esPlanTaskListDto);
......
...@@ -1509,4 +1509,8 @@ ...@@ -1509,4 +1509,8 @@
AND pp.id != #{pointId} AND pp.id != #{pointId}
</if> </if>
</select> </select>
<select id="selectPointInfo" resultType="com.yeejoin.amos.patrol.dao.entity.Point">
select * from p_point where id = #{pointId}
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment