|
@ -74,10 +74,10 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
List<Map<String,Object>> diseases = new ArrayList<>();
|
|
|
Map<String,Object> dis1 = new HashMap<>();
|
|
|
dis1.put("code","1");
|
|
|
dis1.put("name","糖尿病");
|
|
|
dis1.put("name","高血压");
|
|
|
Map<String,Object> dis2 = new HashMap<>();
|
|
|
dis2.put("code","2");
|
|
|
dis2.put("name","高血压");
|
|
|
dis2.put("name","糖尿病");
|
|
|
diseases.add(dis1);
|
|
|
diseases.add(dis2);
|
|
|
rs.put("diseases",diseases);
|
|
@ -112,6 +112,7 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
sqlBuffer.append(" AND p.create_time <= ?");
|
|
|
params.add(endDate+" 23:59:59");
|
|
|
}
|
|
|
sqlBuffer.append(" ORDER BY p.create_time DESC ");
|
|
|
if(page!=null&&page>0&&size!=null&&size>0){
|
|
|
sqlBuffer.append(" LIMIT "+(page-1)*size+","+size);
|
|
|
}
|
|
@ -171,7 +172,7 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
Long s = (prescription.getCreateTime().getTime()-new Date().getTime())/1000;
|
|
|
rs.put("time",s);
|
|
|
if(s>172800){
|
|
|
prescription.setStatus(-3);
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.pay_outtime.getValue());
|
|
|
prescriptionDao.save(prescription);
|
|
|
}
|
|
|
}else{
|
|
@ -189,12 +190,12 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
*/
|
|
|
public int cancelPrescriotion(String code){
|
|
|
Prescription p = prescriptionDao.findByCode(code);
|
|
|
p.setStatus(-2);
|
|
|
p.setStatus(PrescriptionLog.PrescriptionLogStatus.patient_canel.getValue());
|
|
|
prescriptionDao.save(p);
|
|
|
//患者操作日志
|
|
|
PrescriptionLog log = new PrescriptionLog();
|
|
|
log.setCode(getCode());
|
|
|
log.setStatus(-2);
|
|
|
log.setStatus(PrescriptionLog.PrescriptionLogStatus.patient_canel.getValue());
|
|
|
log.setType(-1);
|
|
|
log.setCreateTime(new Date());
|
|
|
log.setPrescriptionCode(p.getCode());
|
|
@ -259,19 +260,18 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
|
|
|
public void setSQL(StringBuffer pre_sql,List<Object> params,String state,String startDate,String endDate,String nameKeyword,Integer page,Integer size){
|
|
|
if(StringUtils.isNotBlank(state)){
|
|
|
pre_sql.append(" AND pr.status = ?");
|
|
|
params.add(state);
|
|
|
pre_sql.append(" AND pr.status IN ("+state+") ");
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(startDate)){
|
|
|
pre_sql.append(" AND pr.create_time >= ?");
|
|
|
pre_sql.append(" AND pr.create_time >= ? ");
|
|
|
params.add(startDate);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(endDate)){
|
|
|
pre_sql.append(" AND pr.create_time <= ?");
|
|
|
pre_sql.append(" AND pr.create_time <= ? ");
|
|
|
params.add(endDate);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(nameKeyword)){
|
|
|
pre_sql.append(" AND pr.patient_name like ?");
|
|
|
pre_sql.append(" AND pr.patient_name like ? ");
|
|
|
params.add("%"+nameKeyword+"%");
|
|
|
}
|
|
|
pre_sql.append(" GROUP BY pr.code ORDER BY pr.create_time DESC");
|
|
@ -304,11 +304,11 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
Prescription p = prescriptionDao.findByCode(code);
|
|
|
if("1".equals(state)){
|
|
|
//审核通过
|
|
|
p.setStatus(10);
|
|
|
p.setStatus(PrescriptionLog.PrescriptionLogStatus.reviewed_success.getValue());
|
|
|
p.setReviewedTime(new Date());
|
|
|
}else{
|
|
|
//审核不通过
|
|
|
p.setStatus(-1);
|
|
|
p.setStatus(PrescriptionLog.PrescriptionLogStatus.no_reviewed.getValue());
|
|
|
p.setReviewedReason(reason);
|
|
|
p.setReviewedTime(new Date());
|
|
|
}
|
|
@ -410,4 +410,11 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
public String upload(){
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
public JSONArray getDrugTimes(){
|
|
|
|
|
|
List<SystemDict> list = systemDictDao.findByLikeName("%PRES_DRUG_TIME_%");
|
|
|
|
|
|
return new JSONArray(list);
|
|
|
}
|
|
|
}
|