Переглянути джерело

Merge branch 'dev' of wujunjie/patient-management into dev

linzhuo 8 роки тому
батько
коміт
a7379912c3

+ 22 - 18
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultDao.java

@ -9,28 +9,32 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.wlyy.entity.consult.Consult;
public interface ConsultDao extends PagingAndSortingRepository<Consult, Long>, JpaSpecificationExecutor<Consult> {
	
	Consult findByCode(String code);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.symptoms like ?2 order by a.czrq desc")
	Page<Object> findByPatient(String patient,String title, Pageable pageRequest);
    Consult findByCode(String code);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1'and a.symptoms like ?2 order by a.czrq desc")
	Page<Object> findByPatient(String patient,String title, long id, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatient(String patient, String title, Pageable pageRequest);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' order by a.czrq desc")
	Page<Object> findByPatient(String patient, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1'and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatient(String patient, String title, long id, Pageable pageRequest);
	// 查询患者咨询记录
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1'order by a.czrq desc")
	Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' order by a.czrq desc")
    Page<Object> findByPatient(String patient, Pageable pageRequest);
	@Query("select count(a) from Consult a,ConsultTeamDoctor b  where a.code = b.consult and a.patient=?1 and b.to=?2 and b.from is null")
	Integer findByPatient(String patientCode,String doctorCode);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1'order by a.czrq desc")
    Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.adminTeamId,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and b.adminTeamId = ?2 and a.del = '1' order by a.czrq desc")
	Page<Object> findByPatientAndTeam(String patient,Long team, Pageable pageRequest);
    @Query("select count(a) from Consult a,ConsultTeamDoctor b  where a.code = b.consult and a.patient=?1 and b.to=?2 and b.from is null")
    Integer findByPatient(String patientCode, String doctorCode);
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.adminTeamId,b.team from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and b.adminTeamId = ?2 and a.del = '1' order by a.czrq desc")
    Page<Object> findByPatientAndTeam(String patient, Long team, Pageable pageRequest);
    //获取咨询的状态
    @Query("select a.type from Consult a,ConsultTeam b where a.code = b.consult and a.code = ?1 ")
    int findTypeByCode(String code);
}

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -1277,7 +1277,7 @@ public class SignPatientLabelInfoService extends BaseService {
                " AND ( sf.doctor_health is null or sf.doctor_health ='' ) " +
                "  AND (p.name like ? or p.address like ? or p.idcard like ? ) " +
                " ORDER BY  p.name DESC,p.address DESC, p.idcard DESC " +
                " limit "+(page-1)+","+pagesize;
                " limit "+(page-1)*pagesize+","+pagesize;
        List<Map<String, Object>> datas = jdbcTemplate.queryForList(sql, teamCode, "%" + filter + "%", "%" + filter + "%", "%" + filter + "%");
        if (datas != null && datas.size() > 0) {

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -2658,7 +2658,7 @@ public class FamilyContractService extends BaseService {
                    " and sf.admin_team_code = ? " +
                    " AND (p.name like ? or p.address like ? or p.idcard like ? ) " +
                    " ORDER BY  p.name DESC,p.address DESC, p.idcard DESC " +
                    " limit "+(page-1)+","+pagesize;
                    " limit "+(page-1)*pagesize+","+pagesize;
            //查找居民
            datas = jdbcTemplate.queryForList(sql, doctorCode, team,"%"+filter+"%","%"+filter+"%","%"+filter+"%");
@ -2682,7 +2682,7 @@ public class FamilyContractService extends BaseService {
                    " and sf.admin_team_code = ? " +
                    " AND (p.name like ? or p.address like ? or p.idcard like ? ) " +
                    " ORDER BY  p.name DESC,p.address DESC, p.idcard DESC " +
                    " limit "+(page-1)+","+pagesize;
                    " limit "+(page-1)*pagesize+","+pagesize;
            //查找居民
            datas = jdbcTemplate.queryForList(sql, doctorCode, team,"%"+filter+"%","%"+filter+"%","%"+filter+"%");

+ 6 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/im/imController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.web.common.im;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.repository.consult.ConsultDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.util.ImUtill;
@ -31,6 +32,8 @@ public class imController extends BaseController {
    private SignFamilyDao signFamilyDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private ConsultDao consultDao;
    /**
     * 获取单个咨询
@ -84,6 +87,7 @@ public class imController extends BaseController {
                String sex = ob.get("sex").toString();
                String startId = ob.get("start_message_id").toString();
                String endId = ob.get("end_message_id").toString();
                int type = consultDao.findTypeByCode(id);
                if (StringUtils.isNotEmpty(createTime)){
                    Date date = sdf.parse(createTime);
                    map.put("create_time",sdf.format(date));
@ -97,6 +101,8 @@ public class imController extends BaseController {
                map.put("description", description);
                map.put("start_message_id", startId);
                map.put("end_message_id", endId);
//                咨询类型:1三师咨询,2家庭医生咨询,3图文咨询,4公共咨询,5病友圈
                map.put("type", type);
                list.add(map);
            }

+ 13 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -967,26 +967,35 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            @RequestParam(required = false) String patientName,
            Long teamCode) {
        try {
            labelType = "4";
            teamCode = (long)646;
            List listNum = new ArrayList();
            Map patients = new HashMap();
            JSONObject list = familyContractService.findNoHealthSignFamilyHealth(getUID(), labelType, patientName, teamCode);
            JSONArray jsonAr = new JSONArray(list);
            String str = "jj";
            List<SignFamily> signFamily = familyContractService.findNoHealthSignFamilyNum(teamCode);
            List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode);
            for (SignPatientLabel label : s) {
                Map map = new HashMap();
                String labelName = label.getLabelName();
                JSONArray jsonArray = list.getJSONArray(label.getLabelName());
                List codes = new ArrayList();
               /* List codes = new ArrayList();
                for (Object patient:jsonArray) {
                    JSONObject jsonObject = new JSONObject(patient.toString());
                    String code = jsonObject.get("code").toString();
                    codes.add(code);
                }
                }*/
                int length = jsonArray.length();
                map.put("label", labelName);
                map.put("number", length);
                map.put("codes", codes);
//                map.put("codes", codes);
                listNum.add(map);
            }
            return write(200, "查询成功!", "data", listNum);
            patients.put("count",list.length());
            patients.put("count",signFamily.size());
            patients.put("patients",listNum);
            return write(200, "查询成功!", "data", patients);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "查询失败");