|
|
|
@ -32,7 +32,6 @@ import org.springblade.core.tool.constant.BladeConstant;
|
|
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
@ -52,7 +51,7 @@ import java.util.Map;
|
|
|
|
|
@RequestMapping("/plan") |
|
|
|
|
@Validated |
|
|
|
|
@Api(value = "巡检计划", tags = "巡检计划") |
|
|
|
|
@Business(module = Constants.APP_NAME,value = "巡检计划管理",ignore = false) |
|
|
|
|
@Business(module = Constants.APP_NAME,value = "巡检计划管理") |
|
|
|
|
public class PlanController extends BladeController { |
|
|
|
|
|
|
|
|
|
private final IPlanService planService; |
|
|
|
@ -66,7 +65,7 @@ public class PlanController extends BladeController {
|
|
|
|
|
@GetMapping("/detail") |
|
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
@ApiOperation(value = "查看", notes = "传入planId") |
|
|
|
|
@Operate(label = "查看巡检计划详情",type = BusinessType.QUERY,ignore = false) |
|
|
|
|
@Operate(label = "查看巡检计划详情",type = BusinessType.QUERY) |
|
|
|
|
public R<PlanVO> detail(Long id) { |
|
|
|
|
PlanVO detail = planService.detail(id); |
|
|
|
|
return R.data(detail); |
|
|
|
@ -78,7 +77,7 @@ public class PlanController extends BladeController {
|
|
|
|
|
@GetMapping("/list") |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "分页显示计划列表", notes = "传入plan") |
|
|
|
|
@Operate(label = "巡检计划列表分页查询",type = BusinessType.QUERY,ignore = false) |
|
|
|
|
@Operate(label = "巡检计划列表分页查询",type = BusinessType.QUERY) |
|
|
|
|
public R<IPage<PlanEntity>> list(PlanListQueryVO plan, Query query) { |
|
|
|
|
LambdaQueryWrapper<PlanEntity> queryWrapper = Condition.getQueryWrapper(new PlanEntity(),plan); |
|
|
|
|
if(plan.getStartTime()!=null){ |
|
|
|
@ -87,9 +86,6 @@ public class PlanController extends BladeController {
|
|
|
|
|
if(plan.getEndTime()!=null){ |
|
|
|
|
queryWrapper.le(PlanEntity::getEndTime,plan.getEndTime()); |
|
|
|
|
} |
|
|
|
|
// if(plan.getStatus()==null){
|
|
|
|
|
// queryWrapper.ne(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_AUTH.getStatus());
|
|
|
|
|
// }
|
|
|
|
|
if(plan.getCreateDept()!=null){ |
|
|
|
|
queryWrapper.eq(PlanEntity::getCreateDept,plan.getCreateDept()); |
|
|
|
|
} |
|
|
|
@ -105,7 +101,7 @@ public class PlanController extends BladeController {
|
|
|
|
|
@PostMapping("/submit") |
|
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入plan") |
|
|
|
|
@Operate(label = "新增/修改巡检计划",type = BusinessType.INSERT, risk = Risk.LOW,ignore = false) |
|
|
|
|
@Operate(label = "新增/修改巡检计划",type = BusinessType.INSERT, risk = Risk.LOW) |
|
|
|
|
public R<Boolean> submit(@Valid @RequestBody PlanVO plan) { |
|
|
|
|
return R.status(planService.submit(plan)); |
|
|
|
|
} |
|
|
|
@ -116,7 +112,7 @@ public class PlanController extends BladeController {
|
|
|
|
|
@PostMapping("/addAndChecked") |
|
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入plan") |
|
|
|
|
@Operate(label = "审核巡检计划",type = BusinessType.UPDATE, risk = Risk.LOW,ignore = false) |
|
|
|
|
@Operate(label = "审核巡检计划",type = BusinessType.UPDATE, risk = Risk.LOW) |
|
|
|
|
public R<List<Long>> addAndChecked(@Valid @RequestBody PlanVO plan) { |
|
|
|
|
return R.data(planService.addAndChecked(plan)); |
|
|
|
|
} |
|
|
|
@ -126,7 +122,7 @@ public class PlanController extends BladeController {
|
|
|
|
|
@GetMapping("/revoke") |
|
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
|
@ApiOperation(value = "撤销", notes = "传入plan") |
|
|
|
|
@Operate(label = "撤销巡检计划",type = BusinessType.UPDATE, risk = Risk.LOW,ignore = false) |
|
|
|
|
@Operate(label = "撤销巡检计划",type = BusinessType.UPDATE, risk = Risk.LOW) |
|
|
|
|
public R<Boolean> revoke(@RequestParam Long planId) { |
|
|
|
|
return R.data(planService.revoke(planId)); |
|
|
|
|
} |
|
|
|
@ -137,7 +133,7 @@ public class PlanController extends BladeController {
|
|
|
|
|
@PostMapping("/remove") |
|
|
|
|
@ApiOperationSupport(order = 7) |
|
|
|
|
@ApiOperation(value = "逻辑删除,不删除关联信息", notes = "传入ids") |
|
|
|
|
@Operate(label = "删除巡检计划",type = BusinessType.DELETE, risk = Risk.MEDIUM,ignore = false) |
|
|
|
|
@Operate(label = "删除巡检计划",type = BusinessType.DELETE, risk = Risk.MEDIUM) |
|
|
|
|
public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
|
return R.status(planService.removeByIds(Func.toLongList(ids))); |
|
|
|
|
} |
|
|
|
|