Browse Source

# 根据设备查询巡检内容、巡检项目接口调整(service)

zhongwei
haungxing 1 year ago
parent
commit
7e9b34eab8
  1. 10
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java
  2. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java
  3. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java

10
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ProjectClient.java

@ -3,6 +3,7 @@ package com.hnac.hzinfo.inspect.obj.feign;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO;
import com.hnac.hzinfo.inspect.obj.request.ProjectContentRequest;
import com.hnac.hzinfo.inspect.obj.services.ProjectService; import com.hnac.hzinfo.inspect.obj.services.ProjectService;
import com.hnac.hzinfo.inspect.obj.vo.ProjectVO; import com.hnac.hzinfo.inspect.obj.vo.ProjectVO;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -41,9 +42,12 @@ public class ProjectClient extends BladeController implements IProjectClient {
} }
@Override @Override
@GetMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE) @PostMapping(GET_PROJECT_AND_CONTENT_BY_EM_CODE)
public R<ProjectVO> getProjectAndContentByEmCode(@NotNull @Valid String emCode, ContentDTO content, Query query) { public R<ProjectVO> getProjectAndContentByEmCode(@RequestBody ProjectContentRequest request) {
return R.data(projectService.getProjectAndContentByEmCode(emCode,content,query)); Query query = new Query();
query.setSize(request.getSize());
query.setCurrent(request.getCurrent());
return R.data(projectService.getProjectAndContentByEmCode(request.getEmCode(), request.getContentDTO(), query));
} }
} }

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java

@ -123,8 +123,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectMapper, ProjectEn
LambdaQueryWrapper<ContentEntity> wrapper = Condition.getQueryWrapper(BeanUtil.copy(content,ContentEntity.class)).lambda(); LambdaQueryWrapper<ContentEntity> wrapper = Condition.getQueryWrapper(BeanUtil.copy(content,ContentEntity.class)).lambda();
wrapper.in(CollectionUtil.isNotEmpty(contentIdList),ContentEntity::getId, contentIdList); wrapper.in(CollectionUtil.isNotEmpty(contentIdList),ContentEntity::getId, contentIdList);
IPage page = contentService.page(Condition.getPage(query), wrapper); IPage page = contentService.page(Condition.getPage(query), wrapper);
page.setRecords(ContentWrapper.build().listVO(page.getRecords())); projectVO.setContentList(ContentWrapper.build().listVO(page.getRecords()));
projectVO.setContentList(page);
} }
return projectVO; return projectVO;
} }

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java

@ -154,7 +154,7 @@ public class ProjectController {
@GetMapping("/getProjectAndContentByEmCode") @GetMapping("/getProjectAndContentByEmCode")
@ApiOperation(value = "根据设备编号获取项目以及内容列表(分页展示)") @ApiOperation(value = "根据设备编号获取项目以及内容列表(分页展示)")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
public R<ProjectVO> getProjectAndContentByEmCode(@NotNull @Valid String emCode, ContentDTO content, Query query) { public R getProjectAndContentByEmCode(String emCode, ContentDTO content, Query query) {
return R.data(projectService.getProjectAndContentByEmCode(emCode,content,query)); return R.data(projectService.getProjectAndContentByEmCode(emCode,content,query));
} }
} }

Loading…
Cancel
Save