You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
3.2 KiB
Java
95 lines
3.2 KiB
Java
package com.glxp.api.controller.dev;
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
import com.glxp.api.controller.BaseController;
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
import com.glxp.api.entity.dev.DeviceCheckEntity;
|
|
import com.glxp.api.req.dev.DeviceCheckQuery;
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
import com.glxp.api.service.dev.DeviceCheckItemDictService;
|
|
import com.glxp.api.service.dev.DeviceCheckService;
|
|
import com.glxp.api.vo.dev.DeviceCheckPrintVo;
|
|
import com.glxp.api.vo.dev.DeviceCheckVo;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import java.util.List;
|
|
|
|
@RestController
|
|
@RequiredArgsConstructor
|
|
@Slf4j
|
|
@RequestMapping
|
|
public class DeviceCheckController extends BaseController {
|
|
|
|
private final DeviceCheckService deviceCheckService;
|
|
|
|
/**
|
|
* 巡检任务单列表
|
|
*
|
|
* @param query
|
|
* @return
|
|
*/
|
|
@AuthRuleAnnotation("")
|
|
@PostMapping("/udi/device/check/page")
|
|
public BaseResponse page(@RequestBody DeviceCheckQuery query) {
|
|
List<DeviceCheckVo> list = deviceCheckService.pageList(query);
|
|
PageInfo pageInfo = new PageInfo<>(list);
|
|
PageSimpleResponse page = new PageSimpleResponse();
|
|
page.setTotal(pageInfo.getTotal());
|
|
page.setList(pageInfo.getList());
|
|
return ResultVOUtils.success(page);
|
|
}
|
|
|
|
/**
|
|
* 本部门巡检任务单列表
|
|
*
|
|
* @param query
|
|
* @return
|
|
*/
|
|
@AuthRuleAnnotation("")
|
|
@PostMapping("/udi/device/check/pageByDept")
|
|
public BaseResponse pageByDept(@RequestBody DeviceCheckQuery query) {
|
|
AuthAdmin user = super.getUser();
|
|
query.setChargeDeptCode(user.getLocDeptCode());
|
|
List<DeviceCheckVo> list = deviceCheckService.pageList(query);
|
|
PageInfo pageInfo = new PageInfo<>(list);
|
|
PageSimpleResponse page = new PageSimpleResponse();
|
|
page.setTotal(pageInfo.getTotal());
|
|
page.setList(pageInfo.getList());
|
|
return ResultVOUtils.success(page);
|
|
}
|
|
|
|
/**
|
|
* 根据计划id生成巡检任务单
|
|
*
|
|
* @param planId 计划id
|
|
* @return
|
|
*/
|
|
@AuthRuleAnnotation("")
|
|
@GetMapping("/udi/device/check/gen/{planId}")
|
|
public BaseResponse genDeviceCheck(@PathVariable Long planId) {
|
|
AuthAdmin user = super.getUser();
|
|
deviceCheckService.genByPlanId(planId, false, user);
|
|
return ResultVOUtils.successMsg("操作成功");
|
|
}
|
|
|
|
@AuthRuleAnnotation("")
|
|
@GetMapping("/udi/device/check/info/print/{taskId}")
|
|
public BaseResponse checkInfoPrint(@PathVariable Long taskId) {
|
|
DeviceCheckPrintVo vo = deviceCheckService.checkInfoPrint(taskId, null);
|
|
return ResultVOUtils.success(vo);
|
|
}
|
|
|
|
@AuthRuleAnnotation("")
|
|
@GetMapping("/udi/device/check/info/print/{taskId}/{deviceCode}")
|
|
public BaseResponse checkInfoPrint(@PathVariable Long taskId, @PathVariable String deviceCode) {
|
|
DeviceCheckPrintVo vo = deviceCheckService.checkInfoPrint(taskId, deviceCode);
|
|
return ResultVOUtils.success(vo);
|
|
}
|
|
|
|
}
|