Prechádzať zdrojové kódy

Merge branch 'dev' of huangwenjie/patient-co-management into dev

chenweida 7 rokov pred
rodič
commit
5a797aeba0

+ 30 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/followup/FollowUpDao.java

@ -6,6 +6,7 @@
package com.yihu.wlyy.repository.followup;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
@ -27,7 +28,35 @@ public interface FollowUpDao extends PagingAndSortingRepository<Followup, Long>,
    @Query(value = "select a.* from wlyy_followup a where a.doctor_code in ?1 and a.patient_code = ?2 and a.followup_class=?3 and a.status ='1' order by a.followup_date DESC limit 1",nativeQuery = true)
    Followup findLastFollowup(String[] doctors,String patientCode,String followClass) throws Exception;
    
    /**
     * 查找所有的随访数据
     * @param patient
     * @param teamCode
     * @param pageable
     * @return
     */
    @Query("select d.code,d.name,d.photo,a.followupType,a.followupClass,a.status,a.createTime,a.updateTime,a.followupManagerStatus,c.code,c.name,c.photo" + ",a.followupDate,a.followupPlanDate,a.followupNextDate,a.id,a.followupNo from Followup a, Doctor d, Doctor c where a.doctorCode = d.code and a.creater = c.code and a.patientCode = ?1 and a.adminTeamCode = ?2 and a.status > 0")
    Page<Object> findByPatientAndTeam(String patient, Long teamCode, Pageable pageable);
    
    /**
     * 查找所有的随访计划(未开始的归类为计划)
     * @param patient
     * @param teamCode
     * @param pageable
     * @return
     */
    @Query("select d.code,d.name,d.photo,a.followupType,a.followupClass,a.status,a.createTime,a.updateTime,a.followupManagerStatus,c.code,c.name,c.photo" + ",a.followupDate,a.followupPlanDate,a.followupNextDate,a.id,a.followupNo from Followup a, Doctor d, Doctor c where a.doctorCode = d.code and a.creater = c.code and a.patientCode = ?1 and a.adminTeamCode = ?2 and a.status = '2'")
    Page<Object> findPlanByPatientAndTeam(String patient, Long teamCode, Pageable pageable);
    /**
     * 查找所有的随访记录(进行中的,已完整的的归类为计划)
     * @param patient
     * @param teamCode
     * @param pageable
     * @return
     */
    @Query("select d.code,d.name,d.photo,a.followupType,a.followupClass,a.status,a.createTime,a.updateTime,a.followupManagerStatus,c.code,c.name,c.photo" + ",a.followupDate,a.followupPlanDate,a.followupNextDate,a.id,a.followupNo from Followup a, Doctor d, Doctor c where a.doctorCode = d.code and a.creater = c.code and a.patientCode = ?1 and a.adminTeamCode = ?2 and (a.status = '1' or a.status = '3')")
    Page<Object> findRecordByPatientAndTeam(String patient, Long teamCode, Pageable pageable);
}

+ 15 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java

@ -184,12 +184,25 @@ public class FollowUpService extends BaseService {
     * @param teamCode
     * @param page
     * @param pageSize
     * @param type 类型:0全部,1计划,2记录
     * @return
     */
    public JSONArray getListByPatientAndTeam(String patient, Long teamCode, int page, int pageSize) {
    public JSONArray getListByPatientAndTeam(String patient, Long teamCode, int page, int pageSize, int type) {
        Sort sort = new Sort(Sort.Direction.DESC,"createTime");
        PageRequest pageRequest = new PageRequest(page, pageSize,sort);
        Page<Object> result = followupDao.findByPatientAndTeam(patient, teamCode, pageRequest);
        Page<Object> result = null;
        
        if(type == 0){
            result = followupDao.findByPatientAndTeam(patient, teamCode, pageRequest);
        }else if(type == 1){
            //已经开始的就是记录
            result = followupDao.findPlanByPatientAndTeam(patient, teamCode, pageRequest);
        }else if(type == 2){
            //未开始的就是计划
            result = followupDao.findRecordByPatientAndTeam(patient, teamCode, pageRequest);
        }else{}
                
        
        JSONArray array = new JSONArray();
        if (result != null && result.getContent().size() > 0) {

+ 4 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/followup/DoctorFollowUpController.java

@ -61,13 +61,14 @@ public class DoctorFollowUpController extends BaseController {
     * @param pagesize
     * @return
     */
    @RequestMapping(value = "/list_by_team", method = {RequestMethod.GET,RequestMethod.POST})
    @RequestMapping(value = "/list_by_team", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "查询居民随访列表")
    public String getListByPatientAndTeam(@RequestParam @ApiParam(value = "居民Code") String patient,
                                          @RequestParam @ApiParam(value = "团队code") Long teamCode,
                                          @RequestParam @ApiParam(value = "第几页") int page,
                                          @RequestParam @ApiParam(value = "页大小") int pagesize) {
                                          @RequestParam @ApiParam(value = "页大小") int pagesize,
                                          @RequestParam(value = "type",required = false) @ApiParam(value = "类型:0全部,1计划,2记录",defaultValue = "0") int type) {
        try {
            if (StringUtils.isEmpty(patient)) {
                return error(-1, "请输入需查询的居民");
@ -77,7 +78,7 @@ public class DoctorFollowUpController extends BaseController {
            }
            page = page > 0 ? page - 1 : 0;
            JSONArray result = followUpService.getListByPatientAndTeam(patient, teamCode, page, pagesize);
            JSONArray result = followUpService.getListByPatientAndTeam(patient, teamCode, page, pagesize,type);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();