|
@ -18,6 +18,7 @@ import com.yihu.wlyy.repository.doctor.SignPatientLabelDao;
|
|
import com.yihu.wlyy.repository.doctor.SignPatientLabelInfoDao;
|
|
import com.yihu.wlyy.repository.doctor.SignPatientLabelInfoDao;
|
|
import com.yihu.wlyy.repository.patient.*;
|
|
import com.yihu.wlyy.repository.patient.*;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
|
import com.yihu.wlyy.service.app.account.PatientInfoService;
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
@ -74,6 +75,8 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
SignFamilyRenewDao signFamilyRenewDao;
|
|
SignFamilyRenewDao signFamilyRenewDao;
|
|
@Autowired
|
|
@Autowired
|
|
SignPatientLabelInfoDao signPatientLabelInfoDao;
|
|
SignPatientLabelInfoDao signPatientLabelInfoDao;
|
|
|
|
@Autowired
|
|
|
|
PatientInfoService patientInfoService;
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
|
@ -86,7 +89,8 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
*/
|
|
*/
|
|
public JSONObject getPatient(String patient) throws Exception {
|
|
public JSONObject getPatient(String patient) throws Exception {
|
|
JSONObject json = new JSONObject();
|
|
JSONObject json = new JSONObject();
|
|
Patient p = patientDao.findByCode(patient);
|
|
|
|
|
|
// Patient p = patientDao.findByCode(patient);
|
|
|
|
PatientVO p = patientInfoService.getPatientVOByCode(patient);
|
|
|
|
|
|
if (p == null) {
|
|
if (p == null) {
|
|
throw new Exception("patient info can not find");
|
|
throw new Exception("patient info can not find");
|
|
@ -119,6 +123,15 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
json.put("address", p.getAddress());
|
|
json.put("address", p.getAddress());
|
|
// 社保号
|
|
// 社保号
|
|
json.put("ssc", p.getSsc());
|
|
json.put("ssc", p.getSsc());
|
|
|
|
|
|
|
|
//病情类型:0健康,1高血压,2糖尿病,(1,2)高血压+糖尿病
|
|
|
|
json.put("disease",p.getDisease());
|
|
|
|
// 病情:0绿标,1黄标,2红标,
|
|
|
|
json.put("diseaseCondition",p.getDiseaseCondition());
|
|
|
|
//预警状态
|
|
|
|
json.put("standardStatus",p.getStandardStatus());
|
|
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
|
|
json.put("deviceType",p.getDeviceType());
|
|
|
|
|
|
SignFamily ssSign = signFamilyDao.findSignByPatient(patient, 1);
|
|
SignFamily ssSign = signFamilyDao.findSignByPatient(patient, 1);
|
|
SignFamily familySign = signFamilyDao.findSignByPatient(patient, 2);
|
|
SignFamily familySign = signFamilyDao.findSignByPatient(patient, 2);
|
|
@ -267,10 +280,12 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
Calendar today = Calendar.getInstance();
|
|
Calendar today = Calendar.getInstance();
|
|
Calendar startDate = Calendar.getInstance();
|
|
Calendar startDate = Calendar.getInstance();
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
sql = "select * " +
|
|
|
|
|
|
sql = "select DISTINCT * " +
|
|
" from " +
|
|
" from " +
|
|
" wlyy_sign_family " +
|
|
|
|
" where (doctor = ? or doctor_health = ?) and status > 0 and admin_team_code = ? ";
|
|
|
|
|
|
" wlyy_sign_family t1" +
|
|
|
|
" LEFT JOIN wlyy_patient p on p.code = t1.patient "+
|
|
|
|
" LEFT JOIN wlyy_sign_patient_label_info t2 on t2.patient = t1.patient and t2.label_type = 3 and t2.status=1 "+
|
|
|
|
" where (t1.doctor = ? or t1.doctor_health = ?) and t1.status > 0 and t1.admin_team_code = ? ";
|
|
|
|
|
|
if (labelCode.equals("1")) {
|
|
if (labelCode.equals("1")) {
|
|
int week = today.get(Calendar.DAY_OF_WEEK) - 2;
|
|
int week = today.get(Calendar.DAY_OF_WEEK) - 2;
|
|
@ -279,53 +294,43 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
week = 6;
|
|
week = 6;
|
|
}
|
|
}
|
|
startDate.add(Calendar.DATE, -week);
|
|
startDate.add(Calendar.DATE, -week);
|
|
sql += " and apply_date between '" + (df.format(startDate.getTime()) + " 00:00:00")
|
|
|
|
|
|
sql += " and t1.apply_date between '" + (df.format(startDate.getTime()) + " 00:00:00")
|
|
+ "' and '" + (df.format(today.getTime()) + " 23:59:59'");
|
|
+ "' and '" + (df.format(today.getTime()) + " 23:59:59'");
|
|
} else if (labelCode.equals("2")) {
|
|
} else if (labelCode.equals("2")) {
|
|
startDate.set(Calendar.DATE, 1);
|
|
startDate.set(Calendar.DATE, 1);
|
|
sql += " and apply_date between '" + (df.format(startDate.getTime()) + " 00:00:00")
|
|
|
|
|
|
sql += " and t1.apply_date between '" + (df.format(startDate.getTime()) + " 00:00:00")
|
|
+ "' and '" + (df.format(today.getTime()) + " 23:59:59'");
|
|
+ "' and '" + (df.format(today.getTime()) + " 23:59:59'");
|
|
} else if (labelCode.equals("3")) {
|
|
} else if (labelCode.equals("3")) {
|
|
startDate.add(Calendar.DATE, 30);
|
|
startDate.add(Calendar.DATE, 30);
|
|
sql += " and end between '" + (df.format(today.getTime()) + " 00:00:00")
|
|
|
|
|
|
sql += " and t1.end between '" + (df.format(today.getTime()) + " 00:00:00")
|
|
+ "' and '" + (df.format(startDate.getTime()) + " 23:59:59'");
|
|
+ "' and '" + (df.format(startDate.getTime()) + " 23:59:59'");
|
|
} else {
|
|
} else {
|
|
throw new Exception("label is not exist");
|
|
throw new Exception("label is not exist");
|
|
}
|
|
}
|
|
sql += " order by openid desc,convert(name using gbk) ";
|
|
|
|
|
|
sql += " order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk) ";
|
|
args = new Object[]{doctor, doctor, teamCode};
|
|
args = new Object[]{doctor, doctor, teamCode};
|
|
}else if("1".equals(labelType)){
|
|
}else if("1".equals(labelType)){
|
|
sql = "SELECT " +
|
|
|
|
" f.* " +
|
|
|
|
"FROM " +
|
|
|
|
" wlyy_sign_family_server s ,( " +
|
|
|
|
" SELECT " +
|
|
|
|
" t1.*, p.openid AS ptOpenid " +
|
|
|
|
|
|
sql =" SELECT " +
|
|
|
|
" DISTINCT t1.* " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_sign_family t1, " +
|
|
|
|
" wlyy_patient p " +
|
|
|
|
" WHERE " +
|
|
|
|
" p. CODE = t1.patient " +
|
|
|
|
" AND ( " +
|
|
|
|
|
|
" wlyy_sign_family t1 " +
|
|
|
|
" LEFT JOIN wlyy_patient p on p. CODE = t1.patient " +
|
|
|
|
" LEFT JOIN wlyy_sign_patient_label_info t2 on t2.patient = t1.patient and t2.label_type = 3 and t2.status=1 "+
|
|
|
|
" LEFT JOIN wlyy_sign_family_server s on s.sign_code = t1.code and s.server_type = '"+labelCode+"' "+
|
|
|
|
" WHERE ( " +
|
|
" t1.doctor = ? " +
|
|
" t1.doctor = ? " +
|
|
" OR t1.doctor_health = ? " +
|
|
" OR t1.doctor_health = ? " +
|
|
" ) " +
|
|
" ) " +
|
|
" AND t1. STATUS > 0 AND t1.admin_team_code = ?";
|
|
" AND t1. STATUS > 0 AND t1.admin_team_code = ?";
|
|
if(isSlowDisease){
|
|
|
|
sql = sql + " AND p.disease >0 " ;
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(diseaseCondition)){
|
|
if(StringUtils.isNotBlank(diseaseCondition)){
|
|
sql = sql + " AND p.disease_condition ="+diseaseCondition;
|
|
sql = sql + " AND p.disease_condition ="+diseaseCondition;
|
|
}
|
|
}
|
|
sql = sql +" ) f " +
|
|
|
|
"WHERE " +
|
|
|
|
" f. CODE = s.sign_code " +
|
|
|
|
" AND s.server_type ='"+labelCode+"' ORDER BY f.ptOpenid DESC";
|
|
|
|
|
|
sql = sql +" order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk) ";
|
|
args = new Object[]{doctor, doctor, teamCode};
|
|
args = new Object[]{doctor, doctor, teamCode};
|
|
}else if("3".equals(labelType) && isSlowDisease){
|
|
}else if("3".equals(labelType) && isSlowDisease){
|
|
//慢病管理
|
|
//慢病管理
|
|
sql = "SELECT " +
|
|
sql = "SELECT " +
|
|
" DISTINCT t1.* " +
|
|
|
|
|
|
" DISTINCT t1.* " +
|
|
" FROM wlyy_sign_family t1 " +
|
|
" FROM wlyy_sign_family t1 " +
|
|
" LEFT JOIN wlyy_patient p on p.code = t1.patient "+
|
|
" LEFT JOIN wlyy_patient p on p.code = t1.patient "+
|
|
" RIGHT JOIN wlyy_sign_patient_label_info t2 on t2.patient = t1.patient ";
|
|
" RIGHT JOIN wlyy_sign_patient_label_info t2 on t2.patient = t1.patient ";
|
|
@ -355,11 +360,12 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
" left join " +
|
|
" left join " +
|
|
" (select l.patient,l.label,l.label_type,l.label_name from wlyy_sign_family f left join wlyy_sign_patient_label_info l on f.patient = l.patient where (f.doctor = '" + doctor + "' or f.doctor_health = '" + doctor + "') and f.status > 0 and l.label_type = ? and l.status = 1) t2 " +
|
|
" (select l.patient,l.label,l.label_type,l.label_name from wlyy_sign_family f left join wlyy_sign_patient_label_info l on f.patient = l.patient where (f.doctor = '" + doctor + "' or f.doctor_health = '" + doctor + "') and f.status > 0 and l.label_type = ? and l.status = 1) t2 " +
|
|
" on t1.patient = t2.patient " +
|
|
" on t1.patient = t2.patient " +
|
|
|
|
" left join wlyy_patient p on p.code = t1.patient "+
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" t2.patient is null " +
|
|
" t2.patient is null " +
|
|
" AND (t1.doctor = ? or t1.doctor_health = ?) " +
|
|
" AND (t1.doctor = ? or t1.doctor_health = ?) " +
|
|
" AND t1.status > 0 " +
|
|
" AND t1.status > 0 " +
|
|
" AND t1.admin_team_code = ? order by t1.openid desc,convert(t1.name using gbk) ";
|
|
|
|
|
|
" AND t1.admin_team_code = ? order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk)";
|
|
|
|
|
|
args = new Object[]{labelType, doctor, doctor, teamCode};
|
|
args = new Object[]{labelType, doctor, doctor, teamCode};
|
|
}else {
|
|
}else {
|
|
@ -368,6 +374,7 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_sign_family t1, " +
|
|
" wlyy_sign_family t1, " +
|
|
" wlyy_sign_patient_label_info t2 " +
|
|
" wlyy_sign_patient_label_info t2 " +
|
|
|
|
" wlyy_patient p "+
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" t2.label = ? " +
|
|
" t2.label = ? " +
|
|
" AND t2.label_type = ? " +
|
|
" AND t2.label_type = ? " +
|
|
@ -375,7 +382,7 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
" AND t1.patient = t2.patient " +
|
|
" AND t1.patient = t2.patient " +
|
|
" AND (t1.doctor = ? or t1.doctor_health = ?)" +
|
|
" AND (t1.doctor = ? or t1.doctor_health = ?)" +
|
|
" AND t1.status > 0 " +
|
|
" AND t1.status > 0 " +
|
|
" AND t1.admin_team_code = ? order by t1.openid desc,convert(t1.name using gbk) ";
|
|
|
|
|
|
" AND t1.admin_team_code = ? order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,p.openid DESC ,convert(t1.name using gbk)";
|
|
|
|
|
|
args = new Object[]{labelCode, labelType, doctor, doctor, teamCode};
|
|
args = new Object[]{labelCode, labelType, doctor, doctor, teamCode};
|
|
}
|
|
}
|
|
@ -2299,9 +2306,23 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
|
|
|
if (signList != null && signList.size() > 0) {
|
|
if (signList != null && signList.size() > 0) {
|
|
for (Map<String, Object> sign : signList) {
|
|
for (Map<String, Object> sign : signList) {
|
|
Patient p = patientDao.findByCode(sign.get("patient") == null ? "" : sign.get("patient").toString());
|
|
|
|
|
|
|
|
if (p == null) {
|
|
|
|
|
|
PatientVO p = new PatientVO();
|
|
|
|
List<PatientVO> plist = new ArrayList<>();
|
|
|
|
if(sign.get("patient") != null){
|
|
|
|
String patientsql = "select a.*,b.deviceType as deviceType,c.disease as disease from wlyy_patient a" +
|
|
|
|
" left join (select user,sum(category_code) deviceType FROM wlyy_patient_device GROUP BY user) b on a.code = b.user" +
|
|
|
|
" left join (select patient,group_concat(label) disease from wlyy_sign_patient_label_info where label_type = 3 and status=1 " +
|
|
|
|
" and (label = 1 or label = 2) and patient = '"+sign.get("patient").toString()+"' GROUP BY patient) c on a.code = c.patient" +
|
|
|
|
" where a.status =1 and a.code = '"+sign.get("patient").toString()+"'";
|
|
|
|
|
|
|
|
plist = jdbcTemplate.query(patientsql,new BeanPropertyRowMapper(PatientVO.class));
|
|
|
|
|
|
|
|
if(plist.isEmpty()){
|
|
|
|
continue;
|
|
|
|
}else{
|
|
|
|
p = plist.get(0);
|
|
|
|
}
|
|
|
|
}else{
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@ -2425,6 +2446,17 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
// 缴费情况
|
|
// 缴费情况
|
|
json.put("expensesStatus", "1");
|
|
json.put("expensesStatus", "1");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//病情类型:0健康,1高血压,2糖尿病,3高血压+糖尿病
|
|
|
|
json.put("disease", p.getDisease());
|
|
|
|
// 病情:0绿标,1黄标,2红标,
|
|
|
|
json.put("diseaseCondition", p.getDiseaseCondition());
|
|
|
|
//预警状态
|
|
|
|
json.put("standardStatus", p.getStandardStatus());
|
|
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
|
|
json.put("deviceType",p.getDeviceType());
|
|
|
|
|
|
|
|
|
|
boolean epTime = false;
|
|
boolean epTime = false;
|
|
try {
|
|
try {
|
|
epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", p.getCode());
|
|
epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", p.getCode());
|
|
@ -2552,9 +2584,23 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
|
|
|
if (signList != null && signList.size() > 0) {
|
|
if (signList != null && signList.size() > 0) {
|
|
for (Map<String, Object> sign : signList) {
|
|
for (Map<String, Object> sign : signList) {
|
|
Patient p = patientDao.findByCode(sign.get("patient") == null ? "" : sign.get("patient").toString());
|
|
|
|
|
|
|
|
if (p == null) {
|
|
|
|
|
|
PatientVO p = new PatientVO();
|
|
|
|
List<PatientVO> plist = new ArrayList<>();
|
|
|
|
if(sign.get("patient") != null){
|
|
|
|
String patientsql = "select a.*,b.deviceType as deviceType,c.disease as disease from wlyy_patient a" +
|
|
|
|
" left join (select user,sum(category_code) deviceType FROM wlyy_patient_device GROUP BY user) b on a.code = b.user" +
|
|
|
|
" left join (select patient,group_concat(label) disease from wlyy_sign_patient_label_info where label_type = 3 and status=1 " +
|
|
|
|
" and (label = 1 or label = 2) and patient = '"+sign.get("patient").toString()+"' GROUP BY patient) c on a.code = c.patient" +
|
|
|
|
" where a.status =1 and a.code = '"+sign.get("patient").toString()+"'";
|
|
|
|
|
|
|
|
plist = jdbcTemplate.query(patientsql,new BeanPropertyRowMapper(PatientVO.class));
|
|
|
|
|
|
|
|
if(plist.isEmpty()){
|
|
|
|
continue;
|
|
|
|
}else{
|
|
|
|
p = plist.get(0);
|
|
|
|
}
|
|
|
|
}else{
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@ -2678,6 +2724,16 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
// 缴费情况
|
|
// 缴费情况
|
|
json.put("expensesStatus", "1");
|
|
json.put("expensesStatus", "1");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//病情类型:0健康,1高血压,2糖尿病,3高血压+糖尿病
|
|
|
|
json.put("disease", p.getDisease());
|
|
|
|
// 病情:0绿标,1黄标,2红标,
|
|
|
|
json.put("diseaseCondition", p.getDiseaseCondition());
|
|
|
|
//预警状态
|
|
|
|
json.put("standardStatus", p.getStandardStatus());
|
|
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
|
|
json.put("deviceType",p.getDeviceType());
|
|
|
|
|
|
boolean epTime = false;
|
|
boolean epTime = false;
|
|
try {
|
|
try {
|
|
epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", p.getCode());
|
|
epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", p.getCode());
|
|
@ -3342,6 +3398,7 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
" DISTINCT t1.* " +
|
|
" DISTINCT t1.* " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_sign_family t1 " +
|
|
" wlyy_sign_family t1 " +
|
|
|
|
" LEFT JOIN wlyy_patient p on p.code = t1.patient "+
|
|
(isIdcard ? ",wlyy_patient p " : "") +
|
|
(isIdcard ? ",wlyy_patient p " : "") +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
(isIdcard ? " t1.patient = p.code and " : "") +
|
|
(isIdcard ? " t1.patient = p.code and " : "") +
|
|
@ -3355,9 +3412,23 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
|
|
|
if (signList != null && signList.size() > 0) {
|
|
if (signList != null && signList.size() > 0) {
|
|
for (Map<String, Object> sign : signList) {
|
|
for (Map<String, Object> sign : signList) {
|
|
Patient p = patientDao.findByCode(sign.get("patient") == null ? "" : sign.get("patient").toString());
|
|
|
|
|
|
|
|
if (p == null) {
|
|
|
|
|
|
PatientVO p = new PatientVO();
|
|
|
|
List<PatientVO> plist = new ArrayList<>();
|
|
|
|
if(sign.get("patient") != null){
|
|
|
|
String patientsql = "select a.*,b.deviceType as deviceType,c.disease as disease from wlyy_patient a" +
|
|
|
|
" left join (select user,sum(category_code) deviceType FROM wlyy_patient_device GROUP BY user) b on a.code = b.user" +
|
|
|
|
" left join (select patient,group_concat(label) disease from wlyy_sign_patient_label_info where label_type = 3 and status=1 " +
|
|
|
|
" and (label = 1 or label = 2) and patient = '"+sign.get("patient").toString()+"' GROUP BY patient) c on a.code = c.patient" +
|
|
|
|
" where a.status =1 and a.code = '"+sign.get("patient").toString()+"'";
|
|
|
|
|
|
|
|
plist = jdbcTemplate.query(patientsql,new BeanPropertyRowMapper(PatientVO.class));
|
|
|
|
|
|
|
|
if(plist.isEmpty()){
|
|
|
|
continue;
|
|
|
|
}else{
|
|
|
|
p = plist.get(0);
|
|
|
|
}
|
|
|
|
}else{
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@ -3465,6 +3536,16 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
// 缴费情况
|
|
// 缴费情况
|
|
json.put("expensesStatus", "1");
|
|
json.put("expensesStatus", "1");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//病情类型:0健康,1高血压,2糖尿病,3高血压+糖尿病
|
|
|
|
json.put("disease", p.getDisease());
|
|
|
|
// 病情:0绿标,1黄标,2红标,
|
|
|
|
json.put("diseaseCondition", p.getDiseaseCondition());
|
|
|
|
//预警状态
|
|
|
|
json.put("standardStatus", p.getStandardStatus());
|
|
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
|
|
json.put("deviceType",p.getDeviceType());
|
|
|
|
|
|
boolean epTime = false;
|
|
boolean epTime = false;
|
|
try {
|
|
try {
|
|
epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", p.getCode());
|
|
epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", p.getCode());
|
|
@ -3520,9 +3601,23 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
|
|
|
|
if (signList != null && signList.size() > 0) {
|
|
if (signList != null && signList.size() > 0) {
|
|
for (Map<String, Object> sign : signList) {
|
|
for (Map<String, Object> sign : signList) {
|
|
Patient p = patientDao.findByCode(sign.get("patient") == null ? "" : sign.get("patient").toString());
|
|
|
|
|
|
|
|
if (p == null) {
|
|
|
|
|
|
PatientVO p = new PatientVO();
|
|
|
|
List<PatientVO> plist = new ArrayList<>();
|
|
|
|
if(sign.get("patient") != null){
|
|
|
|
String patientsql = "select a.*,b.deviceType as deviceType,c.disease as disease from wlyy_patient a" +
|
|
|
|
" left join (select user,sum(category_code) deviceType FROM wlyy_patient_device GROUP BY user) b on a.code = b.user" +
|
|
|
|
" left join (select patient,group_concat(label) disease from wlyy_sign_patient_label_info where label_type = 3 and status=1 " +
|
|
|
|
" and (label = 1 or label = 2) and patient = '"+sign.get("patient").toString()+"' GROUP BY patient) c on a.code = c.patient" +
|
|
|
|
" where a.status =1 and a.code = '"+sign.get("patient").toString()+"'";
|
|
|
|
|
|
|
|
plist = jdbcTemplate.query(patientsql,new BeanPropertyRowMapper(PatientVO.class));
|
|
|
|
|
|
|
|
if(plist.isEmpty()){
|
|
|
|
continue;
|
|
|
|
}else{
|
|
|
|
p = plist.get(0);
|
|
|
|
}
|
|
|
|
}else{
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@ -3630,6 +3725,16 @@ public class SignPatientLabelInfoService extends BaseService {
|
|
// 缴费情况
|
|
// 缴费情况
|
|
json.put("expensesStatus", "1");
|
|
json.put("expensesStatus", "1");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//病情类型:0健康,1高血压,2糖尿病,3高血压+糖尿病
|
|
|
|
json.put("disease", p.getDisease());
|
|
|
|
// 病情:0绿标,1黄标,2红标,
|
|
|
|
json.put("diseaseCondition", p.getDiseaseCondition());
|
|
|
|
//预警状态
|
|
|
|
json.put("standardStatus", p.getStandardStatus());
|
|
|
|
//设备状态:0未绑定,1血糖仪,2血压仪,3血糖仪+血压仪
|
|
|
|
json.put("deviceType",p.getDeviceType());
|
|
|
|
|
|
boolean epTime = false;
|
|
boolean epTime = false;
|
|
try {
|
|
try {
|
|
epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", p.getCode());
|
|
epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", p.getCode());
|