|
@ -422,47 +422,47 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
|
|
msgObj.put("consultcode",consult);
|
|
msgObj.put("consultcode",consult);
|
|
String jsonStr = "";
|
|
String jsonStr = "";
|
|
if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
|
|
if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
|
|
//结束时医生未开处方则发送模板消息结算
|
|
|
|
ConsultDo cons = consultDao.findOne(consult);
|
|
|
|
if (StringUtils.isNoneBlank(cons.getRelationCode())){
|
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
|
|
|
|
List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
|
|
|
|
if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
|
|
|
|
logger.info("发送诊查费支付模板消息start");
|
|
|
|
BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
|
|
|
|
String userName = null;
|
|
|
|
String idcard = null;
|
|
|
|
if (patientDO != null) {
|
|
|
|
userName = patientDO.getName();
|
|
|
|
idcard = patientDO.getIdcard();
|
|
|
|
}
|
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
|
|
|
|
String userNo = null;
|
|
|
|
if (patientMappingDO != null) {
|
|
|
|
userNo = patientMappingDO.getMappingCode();
|
|
|
|
}
|
|
|
|
String cardNo = null;
|
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
|
|
|
|
cardNo = outpatientDO.getCardNo();
|
|
|
|
}
|
|
|
|
String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
|
|
|
|
net.sf.json.JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),outpatientDO.getRealOrder(),false);
|
|
|
|
net.sf.json.JSONObject res = object.getJSONObject("resquest");
|
|
|
|
logger.info("获取待结算数据 res: " + res.toString());
|
|
|
|
String rsCode = res.getString("@RESULT");
|
|
|
|
String free= 0+"";
|
|
|
|
if ("0".equals(rsCode)) {
|
|
|
|
if (res.getString("@settle_flag").equalsIgnoreCase("N")){
|
|
|
|
free = res.getString("@total_charge");
|
|
|
|
|
|
//结束时医生未开处方则发送模板消息结算
|
|
|
|
ConsultDo cons = consultDao.findOne(consult);
|
|
|
|
if (StringUtils.isNoneBlank(cons.getRelationCode())){
|
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
|
|
|
|
List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
|
|
|
|
if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
|
|
|
|
logger.info("发送诊查费支付模板消息start");
|
|
|
|
BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
|
|
|
|
String userName = null;
|
|
|
|
String idcard = null;
|
|
|
|
if (patientDO != null) {
|
|
|
|
userName = patientDO.getName();
|
|
|
|
idcard = patientDO.getIdcard();
|
|
}
|
|
}
|
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
|
|
|
|
String userNo = null;
|
|
|
|
if (patientMappingDO != null) {
|
|
|
|
userNo = patientMappingDO.getMappingCode();
|
|
|
|
}
|
|
|
|
String cardNo = null;
|
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
|
|
|
|
cardNo = outpatientDO.getCardNo();
|
|
|
|
}
|
|
|
|
String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
|
|
|
|
net.sf.json.JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),outpatientDO.getRealOrder(),false);
|
|
|
|
net.sf.json.JSONObject res = object.getJSONObject("resquest");
|
|
|
|
logger.info("获取待结算数据 res: " + res.toString());
|
|
|
|
String rsCode = res.getString("@RESULT");
|
|
|
|
String free= 0+"";
|
|
|
|
if ("0".equals(rsCode)) {
|
|
|
|
if (res.getString("@settle_flag").equalsIgnoreCase("N")){
|
|
|
|
free = res.getString("@total_charge");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!free.equalsIgnoreCase("0")){
|
|
|
|
ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getXtgzh(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
|
|
|
|
}
|
|
|
|
logger.info("发送诊查费支付模板消息end");
|
|
}
|
|
}
|
|
if (!free.equalsIgnoreCase("0")){
|
|
|
|
ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getXtgzh(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
|
|
|
|
}
|
|
|
|
logger.info("发送诊查费支付模板消息end");
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if(1 == resutl){
|
|
if(1 == resutl){
|
|
jsonStr = "{\"id\":\""+ UUID.randomUUID().toString()+"\",\"sender_id\":\""+doctorCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
|
|
jsonStr = "{\"id\":\""+ UUID.randomUUID().toString()+"\",\"sender_id\":\""+doctorCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
|
|
}
|
|
}
|