Browse Source

# 巡检模块日志注解添加

zhongwei
haungxing 10 months ago
parent
commit
7c13076446
  1. 19
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentController.java
  2. 12
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentDefinitionController.java
  3. 27
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectController.java
  4. 13
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectTemplateController.java
  5. 19
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/TemplateController.java
  6. 21
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/RouteController.java
  7. 12
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java
  8. 35
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java
  9. 14
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskRecordController.java

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

@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
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.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import com.hnac.hzinfo.inspect.obj.entity.ContentEntity;
import com.hnac.hzinfo.inspect.obj.entity.ProjectContentEntity;
@ -18,6 +16,10 @@ import com.hnac.hzinfo.inspect.obj.utils.CodeUtils;
import com.hnac.hzinfo.inspect.obj.vo.ContentBatchVo;
import com.hnac.hzinfo.inspect.utils.Condition;
import com.hnac.hzinfo.inspect.obj.vo.ContentListQueryVO;
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 groovy.util.logging.Slf4j;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -41,6 +43,7 @@ import java.util.List;
@RestController
@RequestMapping("/obj/content")
@Api(value = "巡检内容", tags = "巡检内容")
@Business(module = Constants.APP_NAME,value = "巡检内容管理",ignore = false)
@Slf4j
public class ContentController {
@ -54,9 +57,7 @@ public class ContentController {
*/
@GetMapping("/list")
@ApiOperation(value = "巡检内容列表", notes = "巡检内容列表")
@OperationAnnotation(moduleName = "巡检管理",title = "巡检配置",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "查询巡检内容管理列表")
@Operate(label="查询巡检内容分页列表",type = BusinessType.QUERY,ignore = false)
public R<IPage<ContentEntity>> list(ContentListQueryVO content, Query query, BladeUser bladeUser) {
LambdaQueryWrapper<ContentEntity> queryWrapper = Condition.getQueryWrapper(new ContentEntity(),content);
queryWrapper.orderByDesc(ContentEntity::getUpdateTime);
@ -69,6 +70,7 @@ public class ContentController {
*/
@GetMapping("/detail")
@ApiOperation(value = "查看详情", notes = "传入id")
@Operate(label="查询巡检内容详情",type = BusinessType.QUERY,ignore = false)
public R<ContentEntity> detail(Long id) {
ContentEntity content = contentService.getById(id);
return R.data(content);
@ -79,6 +81,7 @@ public class ContentController {
*/
@PostMapping("/submit")
@ApiOperation(value = "新增或修改", notes = "传入巡检内容")
@Operate(label="新增/修改巡检内容",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R<Boolean> submit(@Valid @RequestBody ContentEntity content) {
if(content.getId()==null && Func.isBlank(content.getCode())){
content.setCode(CodeUtils.randomCode());
@ -89,6 +92,7 @@ public class ContentController {
@PostMapping("/saveBatch")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "巡检内容批量新增", notes = "传入object")
@Operate(label="批量新增巡检内容",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R<Boolean> submit(@Valid @RequestBody ContentBatchVo batchVo) {
return R.status(contentService.saveBatch(batchVo.getContents()));
}
@ -98,6 +102,7 @@ public class ContentController {
*/
@PostMapping("/remove")
@ApiOperation(value = "删除", notes = "传入id集合")
@Operate(label="删除巡检内容",type = BusinessType.DELETE,risk = Risk.MEDIUM,ignore = false)
public R<Boolean> remove(@RequestParam String ids) {
List<Long> delIdList = Func.toLongList(ids);
QueryWrapper<ProjectContentEntity> qw = new QueryWrapper<ProjectContentEntity>();
@ -114,6 +119,7 @@ public class ContentController {
*/
@PostMapping("/insertCopyBatch")
@ApiOperation(value = "根据ids 数据库批量复制", notes = "传入id集合")
@Operate(label="批量拷贝巡检内容",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R insertCopyBatch(@ApiParam(value = "主键集合 ,隔开", required = true)@RequestParam String ids,
@ApiParam(value = "添加的名称前缀") @RequestParam String pre) {
contentService.databaseCopyBatch(Func.toLongList(ids), pre);
@ -122,6 +128,7 @@ public class ContentController {
@PutMapping("/updateBatch")
@ApiOperation(value = "根据ids 数据库批量复制", notes = "传入id集合")
@Operate(label="批量编辑巡检内容",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false)
public R updateBatch(@RequestBody List<ContentDTO> contentList) {
List<ContentEntity> contentEntityList = JSONArray.parseArray(JSON.toJSONString(contentList), ContentEntity.class);
return R.status(contentService.updateBatchById(contentEntityList));

12
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentDefinitionController.java

@ -4,12 +4,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.obj.dto.ContentDefinitionDTO;
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity;
import com.hnac.hzinfo.inspect.obj.services.IContentDefinitionService;
import com.hnac.hzinfo.inspect.obj.utils.CodeUtils;
import com.hnac.hzinfo.inspect.obj.vo.ContentDefinitionVO;
import com.hnac.hzinfo.inspect.obj.wrapper.ContentDefinitionWrapper;
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.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@ -35,6 +40,7 @@ import java.util.List;
@RequestMapping("/content/definition")
@Api(value = "巡检内容定义管理",tags = "巡检内容定义管理")
@AllArgsConstructor
@Business(module = Constants.APP_NAME,value="巡检内容定义管理",ignore = false)
public class ContentDefinitionController extends BladeController {
private final IContentDefinitionService contentDefinitionService;
@ -42,6 +48,7 @@ public class ContentDefinitionController extends BladeController {
@GetMapping("/page")
@ApiOperation("分页查询")
@ApiOperationSupport(order = 1)
@Operate(label="查询巡检内容定义分页列表",type = BusinessType.QUERY,ignore = false)
public R<IPage<ContentDefinitionVO>> page(ContentDefinitionDTO content, Query query) {
IPage page = contentDefinitionService.page(Condition.getPage(query), contentDefinitionService.getQueryWrapper(BeanUtil.copy(content,ContentDefinitionEntity.class)));
page.setRecords(ContentDefinitionWrapper.build().listVO(page.getRecords()));
@ -51,6 +58,7 @@ public class ContentDefinitionController extends BladeController {
@GetMapping("/list")
@ApiOperation("查询,最多查询五十条")
@ApiOperationSupport(order = 2)
@Operate(label="巡检巡检内容定义列表(最多50条)",type = BusinessType.QUERY,ignore = false)
public R<List<ContentDefinitionVO>> list(ContentDefinitionDTO content) {
LambdaQueryWrapper<ContentDefinitionEntity> lambda = contentDefinitionService.getQueryWrapper(BeanUtil.copy(content, ContentDefinitionEntity.class));
lambda.last("limit 1,50;");
@ -60,6 +68,7 @@ public class ContentDefinitionController extends BladeController {
@PostMapping("/save")
@ApiOperation("保存巡检内容定义")
@ApiOperationSupport(order = 3)
@Operate(label="新增巡检内容定义",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R save(@RequestBody @Valid ContentDefinitionDTO content) {
if(content.getId()==null && Func.isBlank(content.getCode())){
content.setCode(CodeUtils.randomCode());
@ -70,6 +79,7 @@ public class ContentDefinitionController extends BladeController {
@PutMapping("/update")
@ApiOperation("更新巡检内容定义")
@ApiOperationSupport(order = 4)
@Operate(label="编辑巡检内容定义",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false)
public R update(@RequestBody ContentDefinitionDTO content) {
return R.status(contentDefinitionService.updateById(BeanUtil.copy(content,ContentDefinitionEntity.class)));
}
@ -77,6 +87,7 @@ public class ContentDefinitionController extends BladeController {
@PutMapping("/removeByIds")
@ApiOperation("根据ID删除")
@ApiOperationSupport(order = 5)
@Operate(label="批量删除巡检内容定义",type = BusinessType.DELETE,risk = Risk.MEDIUM,ignore = false)
public R removeByIds(@RequestParam String ids) {
return R.status(contentDefinitionService.removeByIds(ids));
}
@ -84,6 +95,7 @@ public class ContentDefinitionController extends BladeController {
@GetMapping("/detail")
@ApiOperation("查看详情")
@ApiOperationSupport(order = 6)
@Operate(label="查询巡检内容定义详情",type = BusinessType.QUERY,ignore = false)
public R<ContentDefinitionVO> detail(@RequestParam Long id) {
ContentDefinitionEntity definition = contentDefinitionService.getById(id);
return R.data(ContentDefinitionWrapper.build().entityVO(definition));

27
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectController.java

@ -7,9 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
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.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.obj.entity.ObjectDangerEntity;
import com.hnac.hzinfo.inspect.obj.entity.ObjectEntity;
import com.hnac.hzinfo.inspect.obj.entity.ObjectTemplateEntity;
@ -22,6 +20,10 @@ import com.hnac.hzinfo.inspect.plan.entity.PlanObjectTemplateEntity;
import com.hnac.hzinfo.inspect.plan.service.IPlanObjectTemplateService;
import com.hnac.hzinfo.inspect.task.TaskContants;
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.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -57,6 +59,7 @@ import java.util.stream.Collectors;
@AllArgsConstructor
@RequestMapping("/obj/object")
@Api(value = "巡检对象", tags = "巡检对象")
@Business(module = Constants.APP_NAME,value="巡检对象管理",ignore = false)
public class ObjectController extends BladeController {
private final ObjectService objectService;
@ -70,6 +73,7 @@ public class ObjectController extends BladeController {
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查看", notes = "传入id")
@Operate(label="查询巡检对象详情",type = BusinessType.QUERY,ignore = false)
public R<ObjectEntity> detail(Long id) {
ObjectEntity detail = objectService.getDetail(id);
detail.setDangerSources(objectDangerService.getDangerDetailByObjectId(id));
@ -89,9 +93,7 @@ public class ObjectController extends BladeController {
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "巡检对象列表", notes = "巡检对象列表")
@OperationAnnotation(moduleName = "巡检管理",title = "巡检配置",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "查询巡检对象管理列表")
@Operate(label="查询巡检对象分页列表",type = BusinessType.QUERY,ignore = false)
public R<IPage<ObjectEntity>> list(ObjectListQueryVO object, Query query, BladeUser bladeUser) {
IPage<ObjectEntity> pages = Condition.getPage(query);
ObjectEntity entity = new ObjectEntity();
@ -110,6 +112,7 @@ public class ObjectController extends BladeController {
@GetMapping("/other_list_page")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "其他巡检对象列表-分页", notes = "其他巡检对象列表,分页")
@Operate(label="查询其他巡检对象分页列表",type = BusinessType.QUERY,ignore = false)
public R<IPage<OtherObjectEntity>> otherListPage(OtherObjectListQueryVO object, Query query, BladeUser bladeUser) {
LambdaQueryWrapper<OtherObjectEntity> queryWrapper = Condition.getQueryWrapper(new OtherObjectEntity(),object);
queryWrapper.orderByDesc(OtherObjectEntity::getRealId);
@ -120,6 +123,7 @@ public class ObjectController extends BladeController {
@GetMapping("/other_list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "其他巡检对象列表", notes = "其他巡检对象列表,不分页")
@Operate(label="查询其他巡检对象列表",type = BusinessType.QUERY,ignore = false)
public R<List<OtherObjectEntity>> otherList(OtherObjectListQueryVO object, BladeUser bladeUser) {
LambdaQueryWrapper<OtherObjectEntity> queryWrapper = Condition.getQueryWrapper(new OtherObjectEntity(),object);
queryWrapper.orderByDesc(OtherObjectEntity::getRealId);
@ -130,6 +134,7 @@ public class ObjectController extends BladeController {
@GetMapping("/other_unbind_list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "获获取未绑定的其他来源对象", notes = "获获取未绑定的其他来源对象,分页")
@Operate(label="查询未绑定的其他来源对象",type = BusinessType.QUERY,ignore = false)
public R<IPage<OtherObjectEntity>> otherUnbindList(OtherObjectListQueryVO obj, Query query, BladeUser bladeUser) {
IPage<OtherObjectEntity> pages = Condition.getPage(query);
OtherObjectEntity object = new OtherObjectEntity();
@ -145,6 +150,7 @@ public class ObjectController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "新增或修改", notes = "传入object")
@Operate(label="新增/修改巡检对象",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R<Boolean> submit(@Valid @RequestBody ObjectEntity object) {
return R.data(objectService.submit(object));
}
@ -152,6 +158,7 @@ public class ObjectController extends BladeController {
@PostMapping("/saveBatch")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "批量新增", notes = "传入object")
@Operate(label="批量新增巡检对象",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R<Boolean> submit(@Valid @RequestBody ObjectBatchVo batchVo) {
return R.status(objectService.saveBatch(batchVo.getObjects()));
}
@ -159,6 +166,7 @@ public class ObjectController extends BladeController {
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
@Operate(label="批量删除巡检对象",type = BusinessType.DELETE,risk = Risk.MEDIUM,ignore = false)
public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
List<Long> delIdList = Func.toLongList(ids);
QueryWrapper<PlanObjectTemplateEntity> qw = new QueryWrapper<>();
@ -178,6 +186,7 @@ public class ObjectController extends BladeController {
@GetMapping("/disableOrEnable")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "启用/停用", notes = "传入id,以及目标状态0-启用,1-停用")
@Operate(label="启用/停用巡检对象",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false)
public R<Boolean> disableOrEnable(@RequestParam Long id,@RequestParam Integer status) {
QueryWrapper<PlanObjectTemplateEntity> qw = new QueryWrapper<>();
qw.lambda().eq(PlanObjectTemplateEntity::getObjectId,id);
@ -193,6 +202,7 @@ public class ObjectController extends BladeController {
@GetMapping("/getAllEnableOfObject")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "获取所有启用状态的对象(不分页)", notes = "获取所有启用状态的对象(不分页")
@Operate(label="查询启用状态的巡检对象列表",type = BusinessType.QUERY,ignore = false)
public R<List<ObjectEntity>> getAllEnableOfObject(){
List<ObjectEntity> list = objectService.list(Wrappers.<ObjectEntity>lambdaQuery().eq(ObjectEntity::getStatus,0));
return R.data(list);
@ -201,6 +211,7 @@ public class ObjectController extends BladeController {
@GetMapping("/getObjectList")
@ApiOperationSupport(order = 11)
@ApiOperation(value = "获获取未绑定的其他来源对象", notes = "获获取未绑定的其他来源对象,分页")
@Operate(label="查询未绑定的其他来源对象",type = BusinessType.QUERY,ignore = false)
public R<List<ObjectEntity>> getObjectList(ObjectEntity object){
List<ObjectEntity> list = objectService.list(org.springblade.core.mp.support.Condition.getQueryWrapper(new ObjectEntity(),object));
return R.data(list);
@ -209,6 +220,7 @@ public class ObjectController extends BladeController {
@GetMapping("/getOtherType")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "获取其他对象来源类型", notes = "获取其他对象来源类型")
@Operate(label="查询其他来源对象类型",type = BusinessType.QUERY,ignore = false)
public R<List<String>> getOtherType(){
List<String> list = otherObjectService.getOtherType();
return R.data(list);
@ -220,6 +232,7 @@ public class ObjectController extends BladeController {
@PostMapping("/importObjectByExcel")
@ApiOperationSupport(order = 8)
@ApiOperation(value = "Excel导入巡检对象(含项目和内容)", notes = "Excel导入巡检对象(含项目和内容)")
@Operate(label="Excel导入巡检对象(含项目、内容)",type = BusinessType.IMPORT,risk = Risk.LOW,ignore = false)
public R<Boolean> importObjectByExcel(@ApiParam(value = "excel文件,巡检对象导入模板", required = true) @RequestParam(value="file") MultipartFile file) throws IOException {
if (file.getSize() > MAX_SIZE) {
throw new ServiceException( "上传文件大小不能超过200M");
@ -231,6 +244,7 @@ public class ObjectController extends BladeController {
@ApiOperationSupport(order = 9)
@ApiOperation(value = "巡检对象标签导出,下载pdf", notes = "巡检对象标签导出,下载pdf")
@RequestMapping(value = "/objectPdfDownload", method = {RequestMethod.GET, RequestMethod.POST})
@Operate(label="Excel导出巡检对象标签",type = BusinessType.EXPORT,ignore = false)
public void objectPdfDownload(HttpServletResponse response,@ApiParam(value = "导出对象的ids, 通过,隔开。 不传则返回全部对象", required = false) @RequestParam String ids) {
List idList = null;
if(Func.isNotEmpty(ids)){
@ -262,6 +276,7 @@ public class ObjectController extends BladeController {
@RequestMapping(value = "/previewQrCode",method = RequestMethod.GET)
@ApiOperation("预览对象二维码")
@ApiOperationSupport(order = 10)
@Operate(label="预览巡检二维码",type = BusinessType.QUERY,ignore = false)
public void previewQrCode(@RequestParam @ApiParam(value = "对象ID",required = true) Long objectId) {
objectService.previewQrCode(objectId);
}

13
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ObjectTemplateController.java

@ -3,10 +3,15 @@
*/
package com.hnac.hzinfo.inspect.obj.web;
import com.hnac.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.obj.entity.ObjectTemplateEntity;
import com.hnac.hzinfo.inspect.obj.services.ObjectTemplateService;
import com.hnac.hzinfo.inspect.obj.vo.TemplateAddVo;
import com.hnac.hzinfo.inspect.obj.vo.TemplateProjectVo;
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 oracle.jdbc.proxy.annotation.Post;
import org.springblade.core.log.exception.ServiceException;
@ -27,6 +32,7 @@ import java.util.List;
@RestController
@RequestMapping("/obj/objectTemplate")
@Api(value = "巡检对象模板", tags = "巡检对象模板")
@Business(module = Constants.APP_NAME,value = "巡检对象模板管理",ignore = false)
public class ObjectTemplateController {
@Autowired
@ -34,12 +40,14 @@ public class ObjectTemplateController {
@GetMapping("getListByObjectId")
@ApiOperation(value = "根据巡检对象id获取该对象下的巡检模板")
@Operate(label="查询巡检对象绑定的巡检模板",type = BusinessType.QUERY,ignore = false)
public R<List<ObjectTemplateEntity>> getListByObjectId(@ApiParam(value = "对象id", required = true)@RequestParam Long id) {
return R.data(objectTemplateService.getListByObjectId(id,null));
}
@GetMapping("getTemplates")
@ApiOperation(value = "根据巡检对象id获取该对象下的巡检模板,加类型筛选")
@Operate(label="查询巡检对象绑定的巡检模板(类型筛选)",type = BusinessType.QUERY,ignore = false)
public R<List<ObjectTemplateEntity>> getTemplates(@ApiParam(value = "对象id", required = true)@RequestParam Long id,
@ApiParam(value = "支持的巡检类型 0普通巡检,1视频自动巡检,2机器人巡检", required = true)@RequestParam String type) {
return R.data(objectTemplateService.getListByObjectId(id, type));
@ -59,6 +67,7 @@ public class ObjectTemplateController {
@PostMapping("/submitTempAndProj")
@ApiOperation(value = "hld-新增对象下的模板,或者修改模板。同时处理模板项目绑定", notes = "新增模板,或者修改模板。同时处理模板项目绑定")
@Operate(label="新增/修改对象绑定的模板",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R<Boolean> submitTemplateAndProj(@Valid @RequestBody TemplateAddVo temp){
return R.status(objectTemplateService.submitTemplateAndProj(temp));
}
@ -70,6 +79,7 @@ public class ObjectTemplateController {
@ApiImplicitParam(name="objectId",value="巡检对象id"),
@ApiImplicitParam(name="templateId",value="巡检模板id")
})
@Operate(label="新增绑定对象的模板",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R<Boolean> addObjectTemplate(@RequestParam Long objectId,@RequestParam Long templateId){
ObjectTemplateEntity objectTemplateEntity = ObjectTemplateEntity.builder().objectId(objectId).templateId(templateId).build();
return R.status(objectTemplateService.save(objectTemplateEntity));
@ -77,6 +87,7 @@ public class ObjectTemplateController {
@GetMapping("/addObjTempBatch")
@ApiOperation(value = "hld-批量新增一个对象下的多个巡检模板", notes = "hld-批量新增一个对象下的多个巡检模板")
@Operate(label="批量新增绑定对象的模板",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R<Boolean> addObjTempBatch(@ApiParam(value = "巡检对象id", required = true)@RequestParam Long objectId,
@ApiParam(value = "巡检模板ids,逗号隔开", required = true) @RequestParam String templateIds){
if(Func.isBlank(templateIds)){
@ -97,12 +108,14 @@ public class ObjectTemplateController {
@PostMapping("/deleteObjectTemplate")
@ApiOperation(value = "删除对象模板", notes = "传入ids集合")
@Operate(label="批量删除绑定对象的模板",type = BusinessType.DELETE,risk = Risk.MEDIUM,ignore = false)
public R<Boolean> deleteObjectTemplate(@RequestParam String ids){
return R.status(objectTemplateService.deleteLogic(Func.toLongList(ids)));
}
@GetMapping("/getTemplatesByObjectId")
@ApiOperation(value = "hld 根据对象id获取模板项目内容")
@Operate(label="查询与模板绑定的项目内容信息",type = BusinessType.QUERY,ignore = false)
public R<List<TemplateProjectVo>> getTemplateByObjectId(@ApiParam(value = "对象id", required = true)@RequestParam Long id) {
return R.data(objectTemplateService.getTemplateByObjectId(id));
}

19
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/TemplateController.java

@ -5,9 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
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.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.obj.entity.ObjectTemplateEntity;
import com.hnac.hzinfo.inspect.obj.entity.TemplateEntity;
import com.hnac.hzinfo.inspect.obj.entity.TemplateProjectEntity;
@ -22,6 +20,10 @@ import com.hnac.hzinfo.inspect.obj.vo.TemplateListQueryVO;
import com.hnac.hzinfo.inspect.plan.entity.PlanObjectTemplateEntity;
import com.hnac.hzinfo.inspect.plan.service.IPlanObjectTemplateService;
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.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -51,6 +53,7 @@ import java.util.stream.Collectors;
@AllArgsConstructor
@RequestMapping("/obj/template")
@Api(value = "巡检模板", tags = "巡检模板")
@Business(module = Constants.APP_NAME,value = "巡检模板管理",ignore = false)
public class TemplateController extends BladeController {
private final TemplateService templateService;
@ -61,6 +64,7 @@ public class TemplateController extends BladeController {
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查看", notes = "传入巡检模板id")
@Operate(label="查询巡检模板详情",type = BusinessType.QUERY,ignore = false)
public R<TemplateEntity> detail(Long id) {
TemplateEntity detail = templateService.getById(id);
return R.data(detail);
@ -69,9 +73,7 @@ public class TemplateController extends BladeController {
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "巡检模板列表分页", notes = "传入巡检模板")
@OperationAnnotation(moduleName = "巡检管理",title = "模板配置",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "查询巡检模板管理列表")
@Operate(label="查询巡检模板分页列表",type = BusinessType.QUERY,ignore = false)
public R<IPage<TemplateEntity>> list(TemplateListQueryVO inspectionTemplate, Query query, BladeUser bladeUser) {
LambdaQueryWrapper<TemplateEntity> queryWrapper = Condition.getQueryWrapper(new TemplateEntity(),inspectionTemplate);
queryWrapper.orderByDesc(TemplateEntity::getUpdateTime);
@ -82,6 +84,7 @@ public class TemplateController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改巡检模板", notes = "传入巡检模板")
@Operate(label="新增/修改巡检模板",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R<Boolean> submit(@Valid @RequestBody TemplateEntity inspectionTemplate) {
if(inspectionTemplate.getId()==null && Func.isBlank(inspectionTemplate.getCode())){
inspectionTemplate.setCode(CodeUtils.randomCode());
@ -95,6 +98,7 @@ public class TemplateController extends BladeController {
@GetMapping("/disableOrEnable")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "启用/停用", notes = "传入id,,以及目标状态0-启用,1-停用")
@Operate(label="启用/停用巡检模板",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false)
public R<Boolean> disableOrEnable(@RequestParam Long id,@RequestParam Integer status) {
QueryWrapper<PlanObjectTemplateEntity> qw = new QueryWrapper<>();
qw.lambda().eq(PlanObjectTemplateEntity::getTemplateId,id);
@ -119,6 +123,7 @@ public class TemplateController extends BladeController {
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
@Operate(label="批量删除巡检模板",type = BusinessType.DELETE,risk = Risk.MEDIUM,ignore = false)
public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
//已引用的不能删除(对象引用模板、计划引用模板)
List<Long> delIdList = Func.toLongList(ids);
@ -148,6 +153,7 @@ public class TemplateController extends BladeController {
@GetMapping("/getAllContainProjectOfTemplate")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "获取所有包含项目的模板(不分页)", notes = "获取所有包含项目的模板(不分页")
@Operate(label="查询某绑定项目的巡检模板列表",type = BusinessType.QUERY,ignore = false)
public R<List<TemplateEntity>> getAllContainProjectOfTemplate(){
List<TemplateEntity> list = templateService.getAllContainProjectOfTemplate();
return R.data(list);
@ -158,6 +164,7 @@ public class TemplateController extends BladeController {
*/
@PostMapping("/insertCopyBatch")
@ApiOperation(value = "根据ids 数据库批量复制", notes = "传入id集合")
@Operate(label="批量复制巡检模板",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R insertCopyBatch(@ApiParam(value = "主键集合 ,隔开", required = true)@RequestParam String ids,
@ApiParam(value = "添加的名称前缀") @RequestParam String pre) {
templateProjectService.databaseCopyBatch(Func.toLongList(ids), pre);

21
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/RouteController.java

@ -2,9 +2,11 @@ package com.hnac.hzinfo.inspect.plan.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
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.hzinfo.inspect.Constants;
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 lombok.AllArgsConstructor;
@ -36,6 +38,7 @@ import java.util.Map;
@AllArgsConstructor
@RequestMapping("/st_re_route")
@Api(value = "hld-巡检路径", tags = "hld-巡检路径")
@Business(module = Constants.APP_NAME,value="巡检路径管理",ignore = false)
public class RouteController extends BladeController {
private final IRouteService st_re_routeService;
@ -46,6 +49,7 @@ public class RouteController extends BladeController {
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入st_re_route")
@Operate(label = "查看巡检路径详情",type = BusinessType.QUERY,ignore = false)
public R<RouteEntity> detail(RouteEntity st_re_route) {
RouteEntity detail = st_re_routeService.getOne(Condition.getQueryWrapper(st_re_route));
return R.data(detail);
@ -59,10 +63,7 @@ public class RouteController extends BladeController {
@ApiOperation(value = "分页", notes = "传入st_re_route")
@ApiImplicitParams({
})
@OperationAnnotation(moduleName = "巡检管理", title = "巡检配置",
operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,
action = "查询巡检路径管理列表")
@Operate(label = "查询巡检路径分页列表",type = BusinessType.QUERY,ignore = false)
public R<IPage<RouteEntity>> list(@ApiIgnore @RequestParam Map<String, Object> st_re_route, Query query) {
QueryWrapper<RouteEntity> queryWrapper = Condition.getQueryWrapper(st_re_route, RouteEntity.class);
queryWrapper.orderByDesc("create_time", "update_time");
@ -76,6 +77,7 @@ public class RouteController extends BladeController {
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入st_re_route")
@Operate(label = "新增巡检路径",type = BusinessType.INSERT,ignore = false)
public R save(@Valid @RequestBody RouteEntity st_re_route) {
return R.status(st_re_routeService.save(st_re_route));
}
@ -86,6 +88,7 @@ public class RouteController extends BladeController {
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入st_re_route")
@Operate(label = "修改巡检路径",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false)
public R update(@Valid @RequestBody RouteEntity st_re_route) {
return R.status(st_re_routeService.updateById(st_re_route));
}
@ -96,6 +99,7 @@ public class RouteController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入st_re_route")
@Operate(label = "新增/修改巡检路径",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false)
public R submit(@Valid @RequestBody RouteEntity st_re_route) {
return R.status(st_re_routeService.saveOrUpdate(st_re_route));
}
@ -107,6 +111,7 @@ public class RouteController extends BladeController {
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
@Operate(label = "删除巡检路径",type = BusinessType.DELETE,risk = Risk.MEDIUM,ignore = false)
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(st_re_routeService.deleteLogic(Func.toLongList(ids)));
}
@ -114,6 +119,7 @@ public class RouteController extends BladeController {
@GetMapping("/getRouteByObjectId")
@ApiOperationSupport(order = 8)
@ApiOperation(value = "获取使用到相关对象ID的所有路径", notes = "传入对象id")
@Operate(label = "获取使用到相关对象ID的所有路径",type = BusinessType.QUERY,ignore = false)
public R<List<RouteEntity>> getRouteByObjectId(@RequestParam Long objectId) {
return R.data(st_re_routeService.getRouteByObjectId(objectId));
}
@ -121,6 +127,7 @@ public class RouteController extends BladeController {
@GetMapping("/getRouteByTemplateId")
@ApiOperationSupport(order = 8)
@ApiOperation(value = "获取使用到相关模板ID的所有路径", notes = "传入模板id")
@Operate(label = "获取使用到相关模板ID的所有路径",type = BusinessType.QUERY,ignore = false)
public R<List<RouteEntity>> getRouteByTemplateId(@RequestParam Long templateId) {
return R.data(st_re_routeService.getRouteByTemplateId(templateId));
}

12
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java

@ -2,13 +2,12 @@ package com.hnac.hzinfo.inspect.report.controller;
import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.excel.EasyExcel;
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.hzinfo.inspect.gather.vo.TaskGatherQueryVO;
import com.hnac.hzinfo.inspect.report.entity.InspectMonthReportExcel;
import com.hnac.hzinfo.inspect.report.entity.MonthRoutReport;
import com.hnac.hzinfo.inspect.report.service.InspectReportService;
import com.hnac.hzinfo.log.annotation.Operate;
import com.hnac.hzinfo.log.contants.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -40,9 +39,7 @@ public class InspectReportController {
@RequestMapping(value = "/getInspectMonthReport", method = { RequestMethod.POST,RequestMethod.GET })
@ApiOperation(notes = "子站-巡检月报表接口-按路径", value = "针对巡检月报表页")
@OperationAnnotation(moduleName = "生产月报", title = "巡检报表", operatorType = OperatorType.MOBILE, businessType =
BusinessType.GENCODE,
action = "子站-巡检月报表接口-按路径")
@Operate(label = "巡检子站巡检月报表",type = BusinessType.QUERY,ignore = false)
public R<Map<String,MonthRoutReport>> getInspectMonthReport(
@ApiParam(value = "年月 2019-02") @RequestParam(required = true) String month,
@ApiParam(value = "巡检路径id") @RequestParam(required = true) Long routId,
@ -59,6 +56,7 @@ public class InspectReportController {
@ApiOperation(value = "子站-按月巡检报表导出-Excel")
@RequestMapping(value = "/exportMonthExcel", method = {RequestMethod.GET, RequestMethod.POST})
@Operate(label = "导出子站巡检月报表",type = BusinessType.EXPORT,ignore = false)
public void exportMonthExcel(HttpServletResponse response,
@ApiParam(value = "年月 2019-02") @RequestParam(required = true) String month,
@ApiParam(value = "巡检路径id") @RequestParam(required = false) Long routId,
@ -101,12 +99,14 @@ public class InspectReportController {
@RequestMapping(value = "/getInspectMonthReportGather", method = { RequestMethod.POST})
@ApiOperation(notes = "集控站 —— 巡检月报表接口", value = "集控站 —— 针对巡检月报表页")
@Operate(label = "查询集控站巡检月报表",type = BusinessType.QUERY,ignore = false)
public R<Map<String,MonthRoutReport>> getInspectMonthReportGather(@Valid @RequestBody TaskGatherQueryVO vo) {
return R.data(irs.getMonthReportGather(vo));
}
@ApiOperation(value = "集控站 —— 按月巡检报表导出-Excel")
@Operate(label = "导出集控站巡检月报表",type = BusinessType.EXPORT,ignore = false)
@RequestMapping(value = "/exportMonthExcelGather", method = { RequestMethod.POST})
public void exportMonthExcelGather(HttpServletResponse response, @Valid @RequestBody TaskGatherQueryVO vo) {

35
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java

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

14
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskRecordController.java

@ -5,9 +5,7 @@ package com.hnac.hzinfo.inspect.task.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.task.entity.TaskRecordEntity;
import com.hnac.hzinfo.inspect.task.service.ITaskRecordService;
import com.hnac.hzinfo.inspect.task.service.ITaskService;
@ -15,6 +13,10 @@ import com.hnac.hzinfo.inspect.task.vo.TaskListQuery;
import com.hnac.hzinfo.inspect.task.vo.TaskRecordAddVO;
import com.hnac.hzinfo.inspect.task.vo.TaskVo;
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.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@ -36,6 +38,7 @@ import java.util.List;
@AllArgsConstructor
@RequestMapping("/task/taskRecord")
@Api(value = "巡检报备", tags = "巡检报备")
@Business(module = Constants.APP_NAME,value = "巡检报备管理",ignore = false)
@Slf4j
public class TaskRecordController {
@ -44,9 +47,7 @@ public class TaskRecordController {
@GetMapping("/list")
@ApiOperation(value = "巡检报备列表", notes = "巡检报备列表(只显示未开始)")
@OperationAnnotation(moduleName = "巡检管理",title = "巡检设备",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "巡检报备列表")
@Operate(label = "查询巡检报备分页列表",type = BusinessType.QUERY,ignore = false)
public R<IPage<TaskVo>> getListTaskRecord(TaskListQuery task, Query query) {
IPage<TaskVo> pages = Condition.getPage(query);
if(!AuthUtil.isAdministrator()){
@ -64,6 +65,7 @@ public class TaskRecordController {
*/
@PostMapping("/addTaskRecord")
@ApiOperation(value = "巡检任务报备", notes = "巡检任务报备")
@Operate(label = "报备巡检任务",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false)
public R<Boolean> addTaskRecord(@RequestBody TaskRecordAddVO itr) {
TaskRecordEntity record = taskRecordService.getOne(Wrappers.<TaskRecordEntity>query().lambda().eq(TaskRecordEntity::getTaskId,itr.getTaskId()));
if(record!=null){

Loading…
Cancel
Save