update===>:修改小程序查询筛查结果时,查询筛查项目列表。
This commit is contained in:
parent
3e28c16035
commit
5eb498766e
@ -3,11 +3,17 @@ package com.xinelu.applet.controller.appletscreeningproject;
|
|||||||
import com.xinelu.common.core.controller.BaseController;
|
import com.xinelu.common.core.controller.BaseController;
|
||||||
import com.xinelu.common.core.domain.R;
|
import com.xinelu.common.core.domain.R;
|
||||||
import com.xinelu.manage.domain.screeningproject.ScreeningProject;
|
import com.xinelu.manage.domain.screeningproject.ScreeningProject;
|
||||||
import com.xinelu.manage.service.screeningproject.IScreeningProjectService;
|
import com.xinelu.manage.dto.screeningrecord.ScreeningRecordDTO;
|
||||||
|
import com.xinelu.manage.service.screeningrecord.IScreeningRecordService;
|
||||||
|
import com.xinelu.manage.vo.screeningrecord.ScreeningRecordVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -22,12 +28,29 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@Api(tags = "项目控制器-小程序")
|
@Api(tags = "项目控制器-小程序")
|
||||||
public class AppletScreeningProjectController extends BaseController {
|
public class AppletScreeningProjectController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private IScreeningProjectService projectService;
|
private IScreeningRecordService screeningRecordService;
|
||||||
|
|
||||||
@ApiOperation("筛查项目列表")
|
@ApiOperation("筛查项目列表")
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public R<List<ScreeningProject>> list(ScreeningProject project) {
|
public R<List<ScreeningProject>> list(ScreeningRecordDTO query) {
|
||||||
List<ScreeningProject> list = projectService.findList(project);
|
// 查询居民预约过的项目
|
||||||
return R.ok(list);
|
List<ScreeningProject> projectList = new ArrayList<>();
|
||||||
|
|
||||||
|
query.setScreeningType("1");
|
||||||
|
List<ScreeningRecordVo> recordList = screeningRecordService.list(query);
|
||||||
|
if (CollectionUtils.isNotEmpty(recordList)) {
|
||||||
|
// 按照项目进行分组
|
||||||
|
Map<String, List<ScreeningRecordVo>> groupByProject = recordList.stream()
|
||||||
|
.collect(Collectors.groupingBy(ScreeningRecordVo::getProjectId));
|
||||||
|
for (String projectId : groupByProject.keySet()) {
|
||||||
|
ScreeningProject project = new ScreeningProject();
|
||||||
|
project.setProjectId(projectId);
|
||||||
|
project.setProjectName(groupByProject.get(projectId).get(0).getProjectName());
|
||||||
|
project.setHospitalId(groupByProject.get(projectId).get(0).getHospitalId());
|
||||||
|
project.setHospitalName(groupByProject.get(projectId).get(0).getHospitalName());
|
||||||
|
projectList.add(project);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return R.ok(projectList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user