|
|
@ -23,11 +23,8 @@ import com.hnac.hzinfo.inspect.obj.vo.ProjectVO; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.constant.BladeConstant; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
import org.springblade.system.entity.Dept; |
|
|
@ -61,24 +58,13 @@ public class ProjectController { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private ISysClient sysClient; |
|
|
|
private ISysClient sysClient; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 巡检项目列表 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
@GetMapping("/list") |
|
|
|
@ApiOperation(value = "巡检项目列表", notes = "巡检项目列表") |
|
|
|
@ApiOperation(value = "巡检项目列表", notes = "巡检项目列表") |
|
|
|
@OperationAnnotation(moduleName = "巡检管理",title = "巡检配置",operatorType = OperatorType.MOBILE, businessType = |
|
|
|
@OperationAnnotation(moduleName = "巡检管理",title = "巡检配置",operatorType = OperatorType.MOBILE, businessType = |
|
|
|
BusinessType.GENCODE, |
|
|
|
BusinessType.GENCODE, |
|
|
|
action = "查询巡检项目管理列表") |
|
|
|
action = "查询巡检项目管理列表") |
|
|
|
public R<IPage<ProjectEntity>> list(ProjectListQueryVO project, Query query) { |
|
|
|
public R<IPage<ProjectEntity>> list(ProjectListQueryVO project, Query query) { |
|
|
|
LambdaQueryWrapper<ProjectEntity> queryWrapper = Condition.getQueryWrapper(new ProjectEntity(),project); |
|
|
|
IPage<ProjectEntity> pages = projectService.getList(project, query); |
|
|
|
queryWrapper.orderByDesc(ProjectEntity::getUpdateTime); |
|
|
|
|
|
|
|
IPage<ProjectEntity> pages = projectService.page(Condition.getPage(query), (!AuthUtil.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.eq(ProjectEntity::getTenantId, AuthUtil.getTenantId()) : queryWrapper); |
|
|
|
|
|
|
|
pages.getRecords().forEach(entity->{ |
|
|
|
|
|
|
|
QueryWrapper<ProjectContentEntity> qw = new QueryWrapper<>(); |
|
|
|
|
|
|
|
qw.lambda().eq(ProjectContentEntity::getProjectId, entity.getId()); |
|
|
|
|
|
|
|
Long contentNum = projectContentService.count(qw); |
|
|
|
|
|
|
|
entity.setContentNum(contentNum.intValue()); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return R.data(pages); |
|
|
|
return R.data(pages); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -89,9 +75,6 @@ public class ProjectController { |
|
|
|
return R.data(projectService.deptProjectTree(project)); |
|
|
|
return R.data(projectService.deptProjectTree(project)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 查询单条 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@ApiOperation(value = "查看详情", notes = "传入id") |
|
|
|
@ApiOperation(value = "查看详情", notes = "传入id") |
|
|
|
@GetMapping("/detail") |
|
|
|
@GetMapping("/detail") |
|
|
|
public R<ProjectEntity> detail(Long id) { |
|
|
|
public R<ProjectEntity> detail(Long id) { |
|
|
@ -99,9 +82,6 @@ public class ProjectController { |
|
|
|
return R.data(project); |
|
|
|
return R.data(project); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 新增或修改 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@PostMapping("/submit") |
|
|
|
@PostMapping("/submit") |
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入巡检项目") |
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入巡检项目") |
|
|
|
public R<Boolean> submit(@Valid @RequestBody ProjectEntity project) { |
|
|
|
public R<Boolean> submit(@Valid @RequestBody ProjectEntity project) { |
|
|
@ -111,9 +91,6 @@ public class ProjectController { |
|
|
|
return R.status(projectService.saveOrUpdate(project)); |
|
|
|
return R.status(projectService.saveOrUpdate(project)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 删除 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@PostMapping("/remove") |
|
|
|
@PostMapping("/remove") |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperation(value = "删除", notes = "传入id集合") |
|
|
|
@ApiOperation(value = "删除", notes = "传入id集合") |
|
|
@ -137,9 +114,6 @@ public class ProjectController { |
|
|
|
return R.success("删除成功!"); |
|
|
|
return R.success("删除成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 启用/停用 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@GetMapping("/disableOrEnable") |
|
|
|
@GetMapping("/disableOrEnable") |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperation(value = "启用/停用", notes = "传入id,以及状态") |
|
|
|
@ApiOperation(value = "启用/停用", notes = "传入id,以及状态") |
|
|
@ -155,9 +129,6 @@ public class ProjectController { |
|
|
|
return R.status(projectService.update(ew)); |
|
|
|
return R.status(projectService.update(ew)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 根据ids 批量复制 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@PostMapping("/insertCopyBatch") |
|
|
|
@PostMapping("/insertCopyBatch") |
|
|
|
@ApiOperation(value = "根据ids 数据库批量复制", notes = "传入id集合") |
|
|
|
@ApiOperation(value = "根据ids 数据库批量复制", notes = "传入id集合") |
|
|
|
public R insertCopyBatch(@ApiParam(value = "主键集合 ,隔开", required = true)@RequestParam String ids, |
|
|
|
public R insertCopyBatch(@ApiParam(value = "主键集合 ,隔开", required = true)@RequestParam String ids, |
|
|
|