Browse Source

#巡检内容

zhongwei
yang_shj 2 months ago
parent
commit
1685885aef
  1. 18
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentController.java
  2. 18
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java

18
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentController.java

@ -37,7 +37,7 @@ import java.util.List;
/**
* 巡检内容
* ninglong
* @author ysj
*/
@RestController
@RequestMapping("/obj/content")
@ -69,7 +69,7 @@ public class ContentController {
*/
@GetMapping("/detail")
@ApiOperation(value = "查看详情", notes = "传入id")
@Operate(label="查询巡检内容详情",type = BusinessType.QUERY,ignore = false)
@Operate(label="查询巡检内容详情",type = BusinessType.QUERY)
public R<ContentEntity> detail(Long id) {
ContentEntity content = contentService.getById(id);
return R.data(content);
@ -80,7 +80,7 @@ public class ContentController {
*/
@PostMapping("/submit")
@ApiOperation(value = "新增或修改", notes = "传入巡检内容")
@Operate(label="新增/修改巡检内容",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
@Operate(label="新增/修改巡检内容",type = BusinessType.INSERT,risk = Risk.LOW)
public R<Boolean> submit(@Valid @RequestBody ContentEntity content) {
if(content.getId()==null && Func.isBlank(content.getCode())){
content.setCode(CodeUtils.randomCode());
@ -91,7 +91,7 @@ public class ContentController {
@PostMapping("/saveBatch")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "巡检内容批量新增", notes = "传入object")
@Operate(label="批量新增巡检内容",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
@Operate(label="批量新增巡检内容",type = BusinessType.INSERT,risk = Risk.LOW)
public R<Boolean> submit(@Valid @RequestBody ContentBatchVo batchVo) {
return R.status(contentService.saveBatch(batchVo.getContents()));
}
@ -101,12 +101,12 @@ public class ContentController {
*/
@PostMapping("/remove")
@ApiOperation(value = "删除", notes = "传入id集合")
@Operate(label="删除巡检内容",type = BusinessType.DELETE,risk = Risk.MEDIUM,ignore = false)
@Operate(label="删除巡检内容",type = BusinessType.DELETE,risk = Risk.MEDIUM)
public R<Boolean> remove(@RequestParam String ids) {
List<Long> delIdList = Func.toLongList(ids);
QueryWrapper<ProjectContentEntity> qw = new QueryWrapper<ProjectContentEntity>();
QueryWrapper<ProjectContentEntity> qw = new QueryWrapper<>();
qw.lambda().in(ProjectContentEntity::getContentId,delIdList);
Long count = projectContentService.count(qw);
long count = projectContentService.count(qw);
if(count>0) {
return R.fail("该巡检内容已被巡检项目引用,无法删除。");
}
@ -118,7 +118,7 @@ public class ContentController {
*/
@PostMapping("/insertCopyBatch")
@ApiOperation(value = "根据ids 数据库批量复制", notes = "传入id集合")
@Operate(label="批量拷贝巡检内容",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
@Operate(label="批量拷贝巡检内容",type = BusinessType.INSERT,risk = Risk.LOW)
public R insertCopyBatch(@ApiParam(value = "主键集合 ,隔开", required = true)@RequestParam String ids,
@ApiParam(value = "添加的名称前缀") @RequestParam String pre) {
contentService.databaseCopyBatch(Func.toLongList(ids), pre);
@ -127,7 +127,7 @@ public class ContentController {
@PutMapping("/updateBatch")
@ApiOperation(value = "根据ids 数据库批量复制", notes = "传入id集合")
@Operate(label="批量编辑巡检内容",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false)
@Operate(label="批量编辑巡检内容",type = BusinessType.UPDATE,risk = Risk.LOW)
public R updateBatch(@RequestBody List<ContentDTO> contentList) {
List<ContentEntity> contentEntityList = JSONArray.parseArray(JSON.toJSONString(contentList), ContentEntity.class);
return R.status(contentService.updateBatchById(contentEntityList));

18
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java

@ -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)));
}

Loading…
Cancel
Save