Browse Source

# 根据设备获取巡检项目/内容接口开发

zhongwei
haungxing 1 year ago
parent
commit
a361ea8ffa
  1. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/ProjectService.java
  2. 9
      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

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/ProjectService.java

@ -48,5 +48,5 @@ public interface ProjectService extends BaseService<ProjectEntity>{
* @param emCodes 设备编号逗号分隔
* @return Map key-emCode value-projectVO
*/
Map<String,ProjectVO> getProjectAndContentByEmCodes(String emCodes);
List<ProjectVO> getProjectAndContentByEmCodes(String emCodes);
}

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

@ -133,15 +133,10 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectMapper, ProjectEn
}
@Override
public Map<String, ProjectVO> getProjectAndContentByEmCodes(String emCodes) {
public List<ProjectVO> getProjectAndContentByEmCodes(String emCodes) {
Query query = new Query();
query.setCurrent(1);
query.setSize(-1);
Map<String,ProjectVO> result = new HashMap<>();
Stream.of(emCodes.split(",")).forEach(emCode -> {
ProjectVO project = this.getProjectAndContentByEmCode(emCode,new ContentDTO(),query);
result.put(emCode,project);
});
return result;
return Stream.of(emCodes.split(",")).map(emCode -> this.getProjectAndContentByEmCode(emCode, new ContentDTO(), query)).collect(Collectors.toList());
}
}

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

@ -165,7 +165,7 @@ public class ProjectController {
@GetMapping("/getProjectAndContentByEmCodes")
@ApiOperation(value = "根据多个设备编号(逗号分隔)获取项目以及内容列表(分页展示)")
@ApiOperationSupport(order = 8)
public R<Map<String,ProjectVO>> getProjectAndContentByEmCodes(@RequestParam String emCodes) {
public R<List<ProjectVO>> getProjectAndContentByEmCodes(@RequestParam String emCodes) {
return R.data(projectService.getProjectAndContentByEmCodes(emCodes));
}
}

Loading…
Cancel
Save