Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

yeshijie 7 years ago
parent
commit
b5c26d2f27

+ 5 - 3
common/common-entity/src/main/java/com/yihu/device/entity/DevicePatientHealthIndex.java

@ -51,7 +51,7 @@ public class DevicePatientHealthIndex extends IdEntity {
	//设备编号
	private String deviceSn;
	private int status;//状态:0为标准,1为异常
	private Integer status;//状态:0为标准,1为异常
	public String getUser() {
		return user;
@ -188,11 +188,13 @@ public class DevicePatientHealthIndex extends IdEntity {
		this.deviceSn = deviceSn;
	}
	public int getStatus() {
	public Integer getStatus() {
		return status;
	}
	public void setStatus(int status) {
	public void setStatus(Integer status) {
		this.status = status;
	}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientDao.java

@ -65,6 +65,6 @@ public interface PatientDao extends PagingAndSortingRepository<Patient, Long> {
    @Query("select distinct p.openid from Patient p where p.openid is not null and p.openid <> '' ")
    List<String> findOpenids();
    @Query(value=" select p.* from wlyy_patient p INNER JOIN wlyy_sign_family s on s.patient = p.code WHERE s.status > 0  and p.disease >0 and p.status>0 and s.admin_team_code = ?1",nativeQuery = true)
    @Query(value=" select distinct p.* from wlyy_patient p INNER JOIN wlyy_sign_family s on s.patient = p.code WHERE s.status > 0  and p.disease >0 and p.status>0 and s.admin_team_code = ?1",nativeQuery = true)
    List<Patient> findAllSignPatientTeamcode(String teamcode);
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -942,7 +942,7 @@ public class PatientHealthIndexService extends BaseService {
        }
        sql = sql +conditionApp +
                " GROUP BY user,value1,value2,value3,value4,value5,value6,value7,type,record_date,sort_date " +
                " order by sort_date desc ,record_date desc limit "+0+" ,"+1000+" ";
                " order by record_date desc ,sort_date desc limit "+0+" ,"+1000+" ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String,Object> map:list){
            JSONObject json = new JSONObject();
@ -1043,7 +1043,7 @@ public class PatientHealthIndexService extends BaseService {
                    " and record_date <= '"+end+"' " +
                    " and del = '1' " +
                    " GROUP BY user,value1,value2,value3,value4,value5,value6,value7,type,record_date,sort_date " +
                    " order by sort_date desc ,record_date desc limit "+pageRequest.getOffset()+" ,"+pageRequest.getPageSize()+" ";
                    " order by record_date desc ,sort_date desc limit "+pageRequest.getOffset()+" ,"+pageRequest.getPageSize()+" ";
            List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
            for (Map<String,Object> map:list){
                JSONObject json = new JSONObject();

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

@ -3883,11 +3883,11 @@ public class SignPatientLabelInfoService extends BaseService {
                                //判断微信绑定情况
                                re = openid1.compareTo(openid2);
                            }else{
                                re = disease2 - disease1;
                                re = disease1 - disease2;
                            }
                        }else{
                            re = diseaseCondition2 - diseaseCondition1;
                            re = diseaseCondition1 - diseaseCondition2;
                        }

+ 40 - 10
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -1085,8 +1085,12 @@ public class PrescriptionInfoService extends BaseService {
            param.add(endDate + " 23:59:59");
        }
        if (StringUtils.isNotBlank(hospital)) {
            pre_sql.append(" AND e.hospital_code = ? ");
            param.add(hospital);
            if("other".equals(hospital)){
                pre_sql.append(" AND (e.patient_hospital_code IS NULL OR e.patient_hospital_code ='') ");
            }else{
                pre_sql.append(" AND e.patient_hospital_code = ? ");
                param.add(hospital);
            }
        }
        if (StringUtils.isNotBlank(state)) {
            pre_sql.append(" AND pr.status = ? ");
@ -1126,8 +1130,12 @@ public class PrescriptionInfoService extends BaseService {
            param.add(endDate + " 23:59:59");
        }
        if (StringUtils.isNotBlank(hospital)) {
            pre_sql.append(" AND e.hospital_code = ? ");
            param.add(hospital);
            if("other".equals(hospital)){
                pre_sql.append(" AND (e.patient_hospital_code IS NULL OR e.patient_hospital_code ='')");
            }else{
                pre_sql.append(" AND e.patient_hospital_code = ? ");
                param.add(hospital);
            }
        }
        if (StringUtils.isNotBlank(state)) {
            pre_sql.append(" AND pr.status = ? ");
@ -1174,8 +1182,22 @@ public class PrescriptionInfoService extends BaseService {
        //
        Doctor d = doctorDao.findByCode(doctor);
        if (d != null && StringUtils.isNotBlank(d.getHospital())) {
            String h = d.getHospital().substring(0, 8);
            String sql = "SELECT h.`code`,h.`name` FROM dm_hospital h WHERE h.`code` LIKE '%" + h + "%' ";
            //String h = d.getHospital().substring(0, 8);
            // String sql = "SELECT h.`code`,h.`name` FROM dm_hospital h WHERE h.`code` LIKE '%" + h + "%' ";
            String sql = " SELECT " +
                    " e.patient_hospital_name AS name, " +
                    " e.patient_hospital_code AS code " +
                    " FROM " +
                    " wlyy_prescription_expressage e " +
                    " WHERE " +
                    " ( " +
                    "  e.accept_code = '"+doctor+"' " +
                    "  OR e.expressage_code = '"+doctor+"' " +
                    " ) " +
                    " AND e.patient_hospital_code IS NOT NULL " +
                    " AND e.patient_hospital_code <> '' " +
                    " GROUP BY " +
                    " e.patient_hospital_code ";
            List<Map<String, Object>> hs = jdbcTemplate.queryForList(sql);
            rs.put("hospitals", hs);
        } else {
@ -1367,8 +1389,12 @@ public class PrescriptionInfoService extends BaseService {
            param.add(endDate + " 23:59:59");
        }
        if (StringUtils.isNotBlank(hospital)) {
            pre_sql.append(" AND e.patient_hospital_code = ? ");
            param.add(hospital);
            if("other".equals(hospital)){
                pre_sql.append(" AND (e.patient_hospital_code IS NULL OR e.patient_hospital_code ='')");
            }else{
                pre_sql.append(" AND e.patient_hospital_code = ? ");
                param.add(hospital);
            }
        }
        if (StringUtils.isNotBlank(state)) {
            pre_sql.append(" AND pr.status = ? ");
@ -1409,8 +1435,12 @@ public class PrescriptionInfoService extends BaseService {
            param.add(endDate + " 23:59:59");
        }
        if (StringUtils.isNotBlank(hospital)) {
            pre_sql.append(" AND e.patient_hospital_code = ? ");
            param.add(hospital);
            if("other".equals(hospital)){
                pre_sql.append(" AND (e.patient_hospital_code IS NULL OR e.patient_hospital_code ='')");
            }else{
                pre_sql.append(" AND e.patient_hospital_code = ? ");
                param.add(hospital);
            }
        }
        if (StringUtils.isNotBlank(state)) {
            pre_sql.append(" AND pr.status = ? ");

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthController.java

@ -290,6 +290,7 @@ public class DoctorHealthController extends BaseController {
			}
			return write(200, "查询成功", "data", map);
		} catch (Exception ex) {
			error(ex);
			return invalidUserException(ex, -1, ex.getMessage());
		}
	}