|
@ -370,6 +370,11 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
com.alibaba.fastjson.JSONObject returnData = (com.alibaba.fastjson.JSONObject)reData.get(0);
|
|
|
p.setVisitNo(returnData.getString("VISIT_NO"));
|
|
|
p.setRecipeNo(returnData.getString("RECIPE_NO"));
|
|
|
//设置状态为待支付
|
|
|
p.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
|
|
|
//设置审核通过
|
|
|
reviewed.setStatus(1);
|
|
|
reviewed.setReviewedTime(new Date());
|
|
|
prescriptionDao.save(p);
|
|
|
return 1;
|
|
|
}else{
|
|
@ -764,16 +769,25 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
JSONObject json = new JSONObject(mes);
|
|
|
Integer state = json.getInt("state");
|
|
|
String code = json.getString("prescription");
|
|
|
return sendRMess(code ,state);
|
|
|
}catch (Exception e){
|
|
|
logger.error("报文解析失败!",e);
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
public int sendRMess(String code ,Integer state){
|
|
|
try {
|
|
|
Prescription prescription = prescriptionDao.findByCode(code);
|
|
|
Patient p = patientDao.findByCode(prescription.getPatient());
|
|
|
if(state!=null&&state==1){
|
|
|
prescriptionNoticesService.sendMessages(prescription.getPatient(),prescription.getDoctorName(),null,1,1,"prescription/html/re-prescription_info.html?openid=" + p.getOpenid() + "&toUser=" + p.getCode()+ "&toName=" + p.getName() +"&code="+prescription.getCode());
|
|
|
}else{
|
|
|
prescriptionNoticesService.sendMessages(prescription.getPatient(),prescription.getDoctorName(),null,1,2,"prescription/html/re-prescription_info.html?openid=" + p.getOpenid() + "&toUser=" + p.getCode()+ "&toName=" + p.getName() +"&code="+prescription.getCode());
|
|
|
if (state != null && state == 1) {
|
|
|
prescriptionNoticesService.sendMessages(prescription.getPatient(), prescription.getDoctorName(), null, 1, 1, "prescription/html/re-prescription_info.html?openid=" + p.getOpenid() + "&toUser=" + p.getCode() + "&toName=" + p.getName() + "&code=" + prescription.getCode());
|
|
|
} else {
|
|
|
prescriptionNoticesService.sendMessages(prescription.getPatient(), prescription.getDoctorName(), null, 1, 2, "prescription/html/re-prescription_info.html?openid=" + p.getOpenid() + "&toUser=" + p.getCode() + "&toName=" + p.getName() + "&code=" + prescription.getCode());
|
|
|
}
|
|
|
return 1;
|
|
|
}catch (Exception e){
|
|
|
logger.error("续方消息发送失败!",e);
|
|
|
} catch (Exception e) {
|
|
|
logger.error("续方消息发送失败!", e);
|
|
|
}
|
|
|
return 0;
|
|
|
}
|