|
|
@ -7,14 +7,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
|
|
|
|
|
|
|
import com.hnac.hzims.common.logs.enums.BusinessType; |
|
|
|
|
|
|
|
import com.hnac.hzims.common.logs.enums.OperatorType; |
|
|
|
|
|
|
|
import com.hnac.hzims.vo.VoteChartVo; |
|
|
|
import com.hnac.hzims.vo.VoteChartVo; |
|
|
|
import com.hnac.hzinfo.core.push.enums.PushAudienceType; |
|
|
|
import com.hnac.hzinfo.core.push.enums.PushAudienceType; |
|
|
|
import com.hnac.hzinfo.core.push.model.PushAudience; |
|
|
|
import com.hnac.hzinfo.core.push.model.PushAudience; |
|
|
|
import com.hnac.hzinfo.core.push.model.PushInfo; |
|
|
|
import com.hnac.hzinfo.core.push.model.PushInfo; |
|
|
|
import com.hnac.hzinfo.core.push.model.PushPlatform; |
|
|
|
import com.hnac.hzinfo.core.push.model.PushPlatform; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.inspect.Constants; |
|
|
|
import com.hnac.hzinfo.inspect.plan.PlanContants; |
|
|
|
import com.hnac.hzinfo.inspect.plan.PlanContants; |
|
|
|
import com.hnac.hzinfo.inspect.task.TaskContants.ClaimStatusEnum; |
|
|
|
import com.hnac.hzinfo.inspect.task.TaskContants.ClaimStatusEnum; |
|
|
|
import com.hnac.hzinfo.inspect.task.dto.RobotTaskVideoDTO; |
|
|
|
import com.hnac.hzinfo.inspect.task.dto.RobotTaskVideoDTO; |
|
|
@ -31,6 +29,10 @@ import com.hnac.hzinfo.inspect.task.vo.TaskListQuery; |
|
|
|
import com.hnac.hzinfo.inspect.task.vo.TaskObjectVO; |
|
|
|
import com.hnac.hzinfo.inspect.task.vo.TaskObjectVO; |
|
|
|
import com.hnac.hzinfo.inspect.task.vo.TaskVo; |
|
|
|
import com.hnac.hzinfo.inspect.task.vo.TaskVo; |
|
|
|
import com.hnac.hzinfo.inspect.utils.Condition; |
|
|
|
import com.hnac.hzinfo.inspect.utils.Condition; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.log.annotation.Business; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.log.annotation.Operate; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.log.contants.BusinessType; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.log.contants.Risk; |
|
|
|
import io.swagger.annotations.*; |
|
|
|
import io.swagger.annotations.*; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
@ -68,6 +70,7 @@ import java.util.*; |
|
|
|
@AllArgsConstructor |
|
|
|
@AllArgsConstructor |
|
|
|
@RequestMapping("/task") |
|
|
|
@RequestMapping("/task") |
|
|
|
@Api(value = "巡检任务", tags = "巡检任务") |
|
|
|
@Api(value = "巡检任务", tags = "巡检任务") |
|
|
|
|
|
|
|
@Business(module = Constants.APP_NAME,value = "巡检任务管理",ignore = false) |
|
|
|
public class TaskController extends BladeController { |
|
|
|
public class TaskController extends BladeController { |
|
|
|
|
|
|
|
|
|
|
|
private final ITaskService taskService; |
|
|
|
private final ITaskService taskService; |
|
|
@ -80,6 +83,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/getTaskListPageByPlanId") |
|
|
|
@GetMapping("/getTaskListPageByPlanId") |
|
|
|
@ApiOperation(value = "根据计划id获取任务列表", notes = "传入计划id") |
|
|
|
@ApiOperation(value = "根据计划id获取任务列表", notes = "传入计划id") |
|
|
|
|
|
|
|
@Operate(label = "根据计划ID获取任务列表",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<IPage<TaskEntity>> getTaskListPageByPlanId(Long id, Query query) { |
|
|
|
public R<IPage<TaskEntity>> getTaskListPageByPlanId(Long id, Query query) { |
|
|
|
IPage<TaskEntity> pages = taskService.page(Condition.getPage(query), Wrappers.<TaskEntity>query().lambda().eq(TaskEntity::getPlanId, id)); |
|
|
|
IPage<TaskEntity> pages = taskService.page(Condition.getPage(query), Wrappers.<TaskEntity>query().lambda().eq(TaskEntity::getPlanId, id)); |
|
|
|
return R.data(pages); |
|
|
|
return R.data(pages); |
|
|
@ -90,6 +94,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping(value = "/detail") |
|
|
|
@GetMapping(value = "/detail") |
|
|
|
@ApiOperation(value = "查看,下面列表再调用eventController.list", notes = "传入taskid") |
|
|
|
@ApiOperation(value = "查看,下面列表再调用eventController.list", notes = "传入taskid") |
|
|
|
|
|
|
|
@Operate(label = "查看巡检任务详情",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<TaskEntity> detail(@RequestParam Long id) { |
|
|
|
public R<TaskEntity> detail(@RequestParam Long id) { |
|
|
|
TaskEntity detail = taskService.getById(id); |
|
|
|
TaskEntity detail = taskService.getById(id); |
|
|
|
TaskUserEntity taskUserEntity = taskUserService.getOne(Wrappers.<TaskUserEntity>query().lambda().eq(TaskUserEntity::getTaskId, id).eq(TaskUserEntity::getClaimStatus,ClaimStatusEnum.COLLECT.getStatus())); |
|
|
|
TaskUserEntity taskUserEntity = taskUserService.getOne(Wrappers.<TaskUserEntity>query().lambda().eq(TaskUserEntity::getTaskId, id).eq(TaskUserEntity::getClaimStatus,ClaimStatusEnum.COLLECT.getStatus())); |
|
|
@ -121,6 +126,7 @@ public class TaskController extends BladeController { |
|
|
|
@PostMapping("/listPage") |
|
|
|
@PostMapping("/listPage") |
|
|
|
@ApiOperation(value = "巡检任务分页查询-站长级", notes = "传入task") |
|
|
|
@ApiOperation(value = "巡检任务分页查询-站长级", notes = "传入task") |
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
|
|
|
@Operate(label = "查询巡检任务分页列表-1",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<BladePage<TaskVo>> listPage(@RequestBody TaskDTO taskDTO) { |
|
|
|
public R<BladePage<TaskVo>> listPage(@RequestBody TaskDTO taskDTO) { |
|
|
|
return R.data(taskService.page(taskDTO)); |
|
|
|
return R.data(taskService.page(taskDTO)); |
|
|
|
} |
|
|
|
} |
|
|
@ -130,9 +136,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/list") |
|
|
|
@GetMapping("/list") |
|
|
|
@ApiOperation(value = "分页显示任务列表", notes = "传入task") |
|
|
|
@ApiOperation(value = "分页显示任务列表", notes = "传入task") |
|
|
|
@OperationAnnotation(moduleName = "巡检管理",title = "我的巡检任务",operatorType = OperatorType.MOBILE,businessType = |
|
|
|
@Operate(label = "查询巡检任务分页列表-2",type = BusinessType.QUERY,ignore = false) |
|
|
|
BusinessType.GENCODE, |
|
|
|
|
|
|
|
action = "分页显示任务列表") |
|
|
|
|
|
|
|
public R<BladePage<TaskVo>> list(TaskListQuery task, Query query) { |
|
|
|
public R<BladePage<TaskVo>> list(TaskListQuery task, Query query) { |
|
|
|
//CacheUtil.put("test#2","inspect","test","12");
|
|
|
|
//CacheUtil.put("test#2","inspect","test","12");
|
|
|
|
// LambdaQueryWrapper<TaskEntity> queryWrapper = Condition.getQueryWrapper(new TaskEntity(),task);
|
|
|
|
// LambdaQueryWrapper<TaskEntity> queryWrapper = Condition.getQueryWrapper(new TaskEntity(),task);
|
|
|
@ -157,6 +161,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@PostMapping("/exportTaskList") |
|
|
|
@PostMapping("/exportTaskList") |
|
|
|
@ApiOperation(value = "巡检任务导出", notes = "传入计划id") |
|
|
|
@ApiOperation(value = "巡检任务导出", notes = "传入计划id") |
|
|
|
|
|
|
|
@Operate(label = "巡检任务导出",type = BusinessType.EXPORT,ignore = false) |
|
|
|
public void exportTaskList(HttpServletResponse response,@RequestBody TaskDTO task) { |
|
|
|
public void exportTaskList(HttpServletResponse response,@RequestBody TaskDTO task) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
// if(ObjectUtils.isEmpty(task.getStartTime())&&ObjectUtils.isEmpty(task.getEndTime())){
|
|
|
|
// if(ObjectUtils.isEmpty(task.getStartTime())&&ObjectUtils.isEmpty(task.getEndTime())){
|
|
|
@ -225,9 +230,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/robotList") |
|
|
|
@GetMapping("/robotList") |
|
|
|
@ApiOperation(value = "机器人任务列表", notes = "传入task") |
|
|
|
@ApiOperation(value = "机器人任务列表", notes = "传入task") |
|
|
|
@OperationAnnotation(moduleName = "巡检管理",title = "机器人巡检",operatorType = OperatorType.MOBILE,businessType = |
|
|
|
@Operate(label = "机器人任务列表",type = BusinessType.QUERY,ignore = false) |
|
|
|
BusinessType.GENCODE, |
|
|
|
|
|
|
|
action = "机器人任务列表") |
|
|
|
|
|
|
|
public R<IPage<TaskVo>> robotList(TaskListQuery task, Query query) { |
|
|
|
public R<IPage<TaskVo>> robotList(TaskListQuery task, Query query) { |
|
|
|
IPage<TaskVo> pages = Condition.getPage(query); |
|
|
|
IPage<TaskVo> pages = Condition.getPage(query); |
|
|
|
task.setAutoVideo(PlanContants.InspectTypeEnum.ROBOT.getVal()); |
|
|
|
task.setAutoVideo(PlanContants.InspectTypeEnum.ROBOT.getVal()); |
|
|
@ -241,11 +244,8 @@ public class TaskController extends BladeController { |
|
|
|
* 视频任务列表 |
|
|
|
* 视频任务列表 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/videoList") |
|
|
|
@GetMapping("/videoList") |
|
|
|
@OperationAnnotation(moduleName = "巡检管理", title = "视频巡检任务", |
|
|
|
|
|
|
|
operatorType = OperatorType.MOBILE, |
|
|
|
|
|
|
|
businessType = BusinessType.GENCODE, |
|
|
|
|
|
|
|
action = "查询视频巡检任务列表") |
|
|
|
|
|
|
|
@ApiOperation(value = "视频任务列表", notes = "传入task") |
|
|
|
@ApiOperation(value = "视频任务列表", notes = "传入task") |
|
|
|
|
|
|
|
@Operate(label = "视频任务列表",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<IPage<TaskVo>> videoList(TaskListQuery task, Query query) { |
|
|
|
public R<IPage<TaskVo>> videoList(TaskListQuery task, Query query) { |
|
|
|
IPage<TaskVo> pages = Condition.getPage(query); |
|
|
|
IPage<TaskVo> pages = Condition.getPage(query); |
|
|
|
task.setAutoVideo(PlanContants.InspectTypeEnum.VIDEO.getVal()); |
|
|
|
task.setAutoVideo(PlanContants.InspectTypeEnum.VIDEO.getVal()); |
|
|
@ -260,6 +260,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@RequestMapping(value = "/listOfPhone", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
@RequestMapping(value = "/listOfPhone", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
@ApiOperation(value = "分页显示任务列表(手机端)", notes = "传入task") |
|
|
|
@ApiOperation(value = "分页显示任务列表(手机端)", notes = "传入task") |
|
|
|
|
|
|
|
@Operate(label = "查询巡检任务分页列表(手机端)",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<IPage<TaskVo>> listOfPhone(TaskListQuery task, Query query) { |
|
|
|
public R<IPage<TaskVo>> listOfPhone(TaskListQuery task, Query query) { |
|
|
|
IPage<TaskVo> pages = Condition.getPage(query); |
|
|
|
IPage<TaskVo> pages = Condition.getPage(query); |
|
|
|
if(!AuthUtil.isAdministrator()){ |
|
|
|
if(!AuthUtil.isAdministrator()){ |
|
|
@ -273,6 +274,7 @@ public class TaskController extends BladeController { |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getFinishTaskList", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
@RequestMapping(value = "/getFinishTaskList", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
@ApiOperation(value = "获取已完成任务列表", notes = "传入task") |
|
|
|
@ApiOperation(value = "获取已完成任务列表", notes = "传入task") |
|
|
|
|
|
|
|
@Operate(label = "获取已完成任务列表",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<IPage<TaskVo>> getFinishTaskList(TaskListQuery task, Query query) { |
|
|
|
public R<IPage<TaskVo>> getFinishTaskList(TaskListQuery task, Query query) { |
|
|
|
IPage<TaskVo> pages = Condition.getPage(query); |
|
|
|
IPage<TaskVo> pages = Condition.getPage(query); |
|
|
|
if(!AuthUtil.isAdministrator()){ |
|
|
|
if(!AuthUtil.isAdministrator()){ |
|
|
@ -289,6 +291,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@RequestMapping(value = "/startTask", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
@RequestMapping(value = "/startTask", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
@ApiOperation(value = "开始任务", notes = "开始任务") |
|
|
|
@ApiOperation(value = "开始任务", notes = "开始任务") |
|
|
|
|
|
|
|
@Operate(label = "开始巡检任务",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false) |
|
|
|
public R<Boolean> startTask(@RequestParam Long id) { |
|
|
|
public R<Boolean> startTask(@RequestParam Long id) { |
|
|
|
return R.status(taskService.startTask(id)); |
|
|
|
return R.status(taskService.startTask(id)); |
|
|
|
} |
|
|
|
} |
|
|
@ -302,6 +305,7 @@ public class TaskController extends BladeController { |
|
|
|
@ApiImplicitParam(name="id",value="计划id"), |
|
|
|
@ApiImplicitParam(name="id",value="计划id"), |
|
|
|
@ApiImplicitParam(name="status",value="0未开始 1进行中 2暂停 3已完成 4未完成") |
|
|
|
@ApiImplicitParam(name="status",value="0未开始 1进行中 2暂停 3已完成 4未完成") |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
@Operate(label = "执行巡检任务",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false) |
|
|
|
public R<Boolean> modifyTaskStatus(@RequestParam Long id,@RequestParam Integer status) { |
|
|
|
public R<Boolean> modifyTaskStatus(@RequestParam Long id,@RequestParam Integer status) { |
|
|
|
return R.status(taskService.modifyTaskStatus(id,status)); |
|
|
|
return R.status(taskService.modifyTaskStatus(id,status)); |
|
|
|
} |
|
|
|
} |
|
|
@ -311,6 +315,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@RequestMapping(value = "/getTaskById", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
@RequestMapping(value = "/getTaskById", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
@ApiOperation(value = "获取任务详情", notes = "传入taskId") |
|
|
|
@ApiOperation(value = "获取任务详情", notes = "传入taskId") |
|
|
|
|
|
|
|
@Operate(label = "获取巡检任务详情",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<List<TaskObjectVO>> getTaskById(@RequestParam Long id) { |
|
|
|
public R<List<TaskObjectVO>> getTaskById(@RequestParam Long id) { |
|
|
|
List<TaskObjectVO> list = taskService.getTaskById(id); |
|
|
|
List<TaskObjectVO> list = taskService.getTaskById(id); |
|
|
|
/*long begin = System.nanoTime(); |
|
|
|
/*long begin = System.nanoTime(); |
|
|
@ -326,6 +331,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/scanQRCode") |
|
|
|
@GetMapping("/scanQRCode") |
|
|
|
@ApiOperation(value = "扫描二维码,查看对象任务,从二维码里获取对象id", notes = "传入objectId") |
|
|
|
@ApiOperation(value = "扫描二维码,查看对象任务,从二维码里获取对象id", notes = "传入objectId") |
|
|
|
|
|
|
|
@Operate(label = "二维码扫描获取任务列表",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<BladePage<TaskVo>> scanQRCode(@ApiParam(value = "当前页") @RequestParam Integer current, @ApiParam(value = "每页显示条数") @RequestParam Integer size, @ApiParam(value = "对象id") @RequestParam Long objectId) { |
|
|
|
public R<BladePage<TaskVo>> scanQRCode(@ApiParam(value = "当前页") @RequestParam Integer current, @ApiParam(value = "每页显示条数") @RequestParam Integer size, @ApiParam(value = "对象id") @RequestParam Long objectId) { |
|
|
|
IPage<TaskVo> pages = new Page<>(current,size); |
|
|
|
IPage<TaskVo> pages = new Page<>(current,size); |
|
|
|
TaskListQuery task = new TaskListQuery(); |
|
|
|
TaskListQuery task = new TaskListQuery(); |
|
|
@ -343,6 +349,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@RequestMapping(value = "/cancelStart", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
@RequestMapping(value = "/cancelStart", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
|
@ApiOperation(value = "撤销领用", notes = "传taskId") |
|
|
|
@ApiOperation(value = "撤销领用", notes = "传taskId") |
|
|
|
|
|
|
|
@Operate(label = "巡检任务撤销领用",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false) |
|
|
|
public R<Boolean> cancelStart( @ApiParam(value = "任务id") @RequestParam Long taskId) { |
|
|
|
public R<Boolean> cancelStart( @ApiParam(value = "任务id") @RequestParam Long taskId) { |
|
|
|
return R.data(taskService.cancelStart(taskId)); |
|
|
|
return R.data(taskService.cancelStart(taskId)); |
|
|
|
} |
|
|
|
} |
|
|
@ -366,6 +373,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/getObjPrj") |
|
|
|
@GetMapping("/getObjPrj") |
|
|
|
@ApiOperation(value = "机器人 获取任务 项目list", notes = "传入taskId") |
|
|
|
@ApiOperation(value = "机器人 获取任务 项目list", notes = "传入taskId") |
|
|
|
|
|
|
|
@Operate(label = "获取机器人任务详情",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<List<TaskObjectVO>> getObjPrj(Long taskId) { |
|
|
|
public R<List<TaskObjectVO>> getObjPrj(Long taskId) { |
|
|
|
List<TaskObjectVO> list = taskService.getObjPrj(taskId); |
|
|
|
List<TaskObjectVO> list = taskService.getObjPrj(taskId); |
|
|
|
return R.data(list); |
|
|
|
return R.data(list); |
|
|
@ -443,6 +451,7 @@ public class TaskController extends BladeController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/importTaskListStatistics") |
|
|
|
@GetMapping("/importTaskListStatistics") |
|
|
|
@ApiOperation(value = "导出", notes = "传入计划id") |
|
|
|
@ApiOperation(value = "导出", notes = "传入计划id") |
|
|
|
|
|
|
|
@Operate(label = "巡检任务统计表导出",type = BusinessType.EXPORT,ignore = false) |
|
|
|
public void importTaskListStatistics(HttpServletResponse response, String startTime, String endTime,Long deptId) { |
|
|
|
public void importTaskListStatistics(HttpServletResponse response, String startTime, String endTime,Long deptId) { |
|
|
|
if(ObjectUtil.isEmpty(AuthUtil.getUser())||ObjectUtil.isEmpty(AuthUtil.getUser().getUserId())){ |
|
|
|
if(ObjectUtil.isEmpty(AuthUtil.getUser())||ObjectUtil.isEmpty(AuthUtil.getUser().getUserId())){ |
|
|
|
throw new ServiceException ("暂无权限查看,请稍后重试"); |
|
|
|
throw new ServiceException ("暂无权限查看,请稍后重试"); |
|
|
|