|
@ -78,12 +78,9 @@ import com.yihu.jw.util.common.LatitudeUtils;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
|
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
|
|
|
import com.yihu.jw.utils.CheckSumBuilder;
|
|
|
import com.yihu.jw.utils.GenerateUserSig;
|
|
|
import com.yihu.jw.utils.PinYinUtils;
|
|
|
import com.yihu.jw.utils.*;
|
|
|
import com.yihu.jw.utils.Pkis.PKIService_PortType;
|
|
|
import com.yihu.jw.utils.Pkis.PKIService_ServiceLocator;
|
|
|
import com.yihu.jw.utils.WebserviceUtil;
|
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
|
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
|
|
|
import com.yihu.jw.wechat.dao.WechatDao;
|
|
@ -274,6 +271,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
private YxTokenMappingDao yxTokenMappingDao;
|
|
|
@Autowired
|
|
|
private BaseNatAppointmentDao baseNatAppointmentDao;
|
|
|
@Autowired
|
|
|
private PayInfoNoticeService payInfoNoticeService;
|
|
|
|
|
|
|
|
|
|
|
@ -8265,7 +8264,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if ("0".equals(rsCode)) {
|
|
|
free = res.getString("@total_charge");
|
|
|
}
|
|
|
ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1");
|
|
|
ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1","WX_PUB");
|
|
|
}else {
|
|
|
throw new Exception(map.get("mes").toString());
|
|
|
}
|
|
@ -8363,7 +8362,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if ("0".equals(rsCode)) {
|
|
|
free = res.getString("@total_charge");
|
|
|
}*/
|
|
|
ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, "", "");
|
|
|
ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, "", "","WX_PUB");
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@ -10458,207 +10457,254 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return null;
|
|
|
}
|
|
|
public Map saveNatAppointment(String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
|
|
|
String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm) throws Exception {
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
|
|
|
baseNatAppointmentDO.setMedicare(mediaCard);
|
|
|
baseNatAppointmentDO.setName(name);
|
|
|
baseNatAppointmentDO.setCardNo(cardNo);
|
|
|
baseNatAppointmentDO.setCardType(cardType);
|
|
|
baseNatAppointmentDO.setAddress(address);
|
|
|
baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
|
|
|
baseNatAppointmentDO.setCityName(cityName);
|
|
|
baseNatAppointmentDO.setFirstJobCode(firstJobCode);
|
|
|
baseNatAppointmentDO.setFirstJobName(firstJobName);
|
|
|
baseNatAppointmentDO.setSecondJobCode(secondJobCode);
|
|
|
baseNatAppointmentDO.setSecondJobName(secondJobName);
|
|
|
baseNatAppointmentDO.setProvinceName(provinceName);
|
|
|
baseNatAppointmentDO.setTownName(townName);
|
|
|
baseNatAppointmentDO.setStreetName(streetName);
|
|
|
baseNatAppointmentDO.setPatientId(patientId);
|
|
|
baseNatAppointmentDO.setIsSuccess("0");
|
|
|
baseNatAppointmentDO.setPayStatus("0");
|
|
|
baseNatAppointmentDO.setCreateTime(new Date());
|
|
|
baseNatAppointmentDO.setMobile(mobile);
|
|
|
baseNatAppointmentDO.setInspectionCode("鼻/咽拭子");
|
|
|
baseNatAppointmentDO.setInspectionName("鼻/咽拭子");
|
|
|
baseNatAppointmentDO.setIcdCode("Z00.000");
|
|
|
baseNatAppointmentDO.setChargeCode("361322");
|
|
|
baseNatAppointmentDO.setWinNo("6");
|
|
|
baseNatAppointmentDO.setDept("3150000");
|
|
|
baseNatAppointmentDO.setDeptName("感染疾病科");
|
|
|
baseNatAppointmentDO.setAmpm(pm);
|
|
|
baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag) throws Exception {
|
|
|
Map returnMap = new HashMap();
|
|
|
net.sf.json.JSONObject jsondate = new JSONObject();
|
|
|
jsondate.put("checkPart","鼻/咽拭子");
|
|
|
jsondate.put("cardNo",mediaCard);
|
|
|
jsondate.put("chargeFlag","2");
|
|
|
jsondate.put("chargeCode","361322");
|
|
|
jsondate.put("icdCode","Z00.000");
|
|
|
jsondate.put("socialNo",cardNo);
|
|
|
jsondate.put("tellPhone",mobile);
|
|
|
jsondate.put("address1",provinceName);
|
|
|
jsondate.put("address2",cityName);
|
|
|
jsondate.put("address3",townName);
|
|
|
jsondate.put("address4",streetName);
|
|
|
jsondate.put("address5",2);
|
|
|
jsondate.put("area",address);
|
|
|
jsondate.put("winNo",6);
|
|
|
jsondate.put("target",2);
|
|
|
jsondate.put("quantity",1);
|
|
|
Map<String,Object> map = findRandomDoctor();
|
|
|
net.sf.json.JSONObject rs = new JSONObject();
|
|
|
if (map!=null){
|
|
|
//先进行核算检测预约
|
|
|
String result = entranceService.BS10144("3150000","0001",natTime,mediaCard,name,cardNo,mobile,pm,demoFlag);
|
|
|
com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
|
|
|
logger.info("核酸检测预约结束"+result);
|
|
|
Boolean flag = false;
|
|
|
if (object!=null){
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("MsgInfo");
|
|
|
String Msg = jsonObject.getString("Msg");
|
|
|
if (Msg.contains("Error")){
|
|
|
throw new Exception(Msg);
|
|
|
}else {
|
|
|
flag = true;
|
|
|
|
|
|
if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
|
|
|
net.sf.json.JSONObject jsondate = new JSONObject();
|
|
|
jsondate.put("checkPart","鼻/咽拭子");
|
|
|
jsondate.put("cardNo",mediaCard);
|
|
|
jsondate.put("chargeFlag","2");
|
|
|
jsondate.put("chargeCode","361322");
|
|
|
jsondate.put("icdCode","Z00.000");
|
|
|
jsondate.put("socialNo",cardNo);
|
|
|
jsondate.put("tellPhone",mobile);
|
|
|
jsondate.put("address1",provinceName);
|
|
|
jsondate.put("address2",cityName);
|
|
|
jsondate.put("address3",townName);
|
|
|
jsondate.put("address4",streetName);
|
|
|
jsondate.put("address5",2);
|
|
|
jsondate.put("area",address);
|
|
|
jsondate.put("winNo",6);
|
|
|
jsondate.put("target",2);
|
|
|
jsondate.put("quantity",1);
|
|
|
Map<String,Object> map = findRandomDoctor();
|
|
|
net.sf.json.JSONObject rs = new JSONObject();
|
|
|
if (map!=null){
|
|
|
//先进行核算检测预约
|
|
|
String result = entranceService.BS10144("3150000","0001",natTime,mediaCard,name,cardNo,mobile,pm,demoFlag);
|
|
|
com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
|
|
|
logger.info("核酸检测预约结束"+result);
|
|
|
Boolean flag = false;
|
|
|
if (object!=null){
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("MsgInfo");
|
|
|
String Msg = jsonObject.getString("Msg");
|
|
|
if (Msg.contains("Error")){
|
|
|
returnMap.put("msg",Msg);
|
|
|
returnMap.put("status","-1");
|
|
|
return returnMap;
|
|
|
}else {
|
|
|
flag = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (flag){
|
|
|
try {
|
|
|
rs = entranceService.BS10111(mediaCard, map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag);
|
|
|
net.sf.json.JSONObject res = rs.getJSONObject("resquest");
|
|
|
logger.info("挂号结果 res: " + res.toString());
|
|
|
String rsCode = res.getString("@RESULT");
|
|
|
if ("0".equals(rsCode)) {
|
|
|
//存储挂号号
|
|
|
// {"resquest":{"@RESULT":"0","@MSG":"完成","@serial_no":"47770476","@times":"28"}}
|
|
|
String serialNo = (String) res.get("@serial_no");
|
|
|
String conNo = (String) res.get("@times");
|
|
|
String xtgzh = (String) res.get("@xtgzh");
|
|
|
String realOrder = (String) res.get("@real_order");
|
|
|
logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
|
|
|
jsondate.put("serialNo",serialNo);
|
|
|
jsondate.put("dept",map.get("deptCode").toString());
|
|
|
jsondate.put("doctor",map.get("doctorMappingCode").toString());
|
|
|
baseNatAppointmentDO.setRegisterNo(serialNo);
|
|
|
//保存日志
|
|
|
WlyyHttpLogDO log = new WlyyHttpLogDO();
|
|
|
log.setCode("registerOutPatient");
|
|
|
log.setName("挂号");
|
|
|
log.setPatient(patientId);
|
|
|
log.setDoctor(map.get("doctorCode").toString());
|
|
|
log.setResponse(rs.toString());
|
|
|
log.setStatus(rsCode);
|
|
|
log.setCreateTime(new Date());
|
|
|
wlyyHttpLogDao.save(log);
|
|
|
if (flag){
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
|
|
|
baseNatAppointmentDO.setMedicare(mediaCard);
|
|
|
baseNatAppointmentDO.setName(name);
|
|
|
baseNatAppointmentDO.setCardNo(cardNo);
|
|
|
baseNatAppointmentDO.setCardType(cardType);
|
|
|
baseNatAppointmentDO.setAddress(address);
|
|
|
baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
|
|
|
baseNatAppointmentDO.setCityName(cityName);
|
|
|
baseNatAppointmentDO.setFirstJobCode(firstJobCode);
|
|
|
baseNatAppointmentDO.setFirstJobName(firstJobName);
|
|
|
baseNatAppointmentDO.setSecondJobCode(secondJobCode);
|
|
|
baseNatAppointmentDO.setSecondJobName(secondJobName);
|
|
|
baseNatAppointmentDO.setProvinceName(provinceName);
|
|
|
baseNatAppointmentDO.setTownName(townName);
|
|
|
baseNatAppointmentDO.setStreetName(streetName);
|
|
|
baseNatAppointmentDO.setPatientId(patientId);
|
|
|
baseNatAppointmentDO.setIsSuccess("0");
|
|
|
baseNatAppointmentDO.setPayStatus("0");
|
|
|
baseNatAppointmentDO.setCreateTime(new Date());
|
|
|
baseNatAppointmentDO.setMobile(mobile);
|
|
|
baseNatAppointmentDO.setInspectionCode("鼻/咽拭子");
|
|
|
baseNatAppointmentDO.setInspectionName("鼻/咽拭子");
|
|
|
baseNatAppointmentDO.setIcdCode("Z00.000");
|
|
|
baseNatAppointmentDO.setChargeCode("361322");
|
|
|
baseNatAppointmentDO.setWinNo("6");
|
|
|
baseNatAppointmentDO.setDept("3150000");
|
|
|
baseNatAppointmentDO.setDeptName("感染疾病科");
|
|
|
baseNatAppointmentDO.setAmpm(pm);
|
|
|
baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
try {
|
|
|
rs = entranceService.BS10111(mediaCard, map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag);
|
|
|
net.sf.json.JSONObject res = rs.getJSONObject("resquest");
|
|
|
logger.info("挂号结果 res: " + res.toString());
|
|
|
String rsCode = res.getString("@RESULT");
|
|
|
if ("0".equals(rsCode)) {
|
|
|
//存储挂号号
|
|
|
// {"resquest":{"@RESULT":"0","@MSG":"完成","@serial_no":"47770476","@times":"28"}}
|
|
|
String serialNo = (String) res.get("@serial_no");
|
|
|
String conNo = (String) res.get("@times");
|
|
|
String xtgzh = (String) res.get("@xtgzh");
|
|
|
String realOrder = (String) res.get("@real_order");
|
|
|
logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
|
|
|
jsondate.put("serialNo",serialNo);
|
|
|
jsondate.put("dept",map.get("deptCode").toString());
|
|
|
jsondate.put("doctor",map.get("doctorMappingCode").toString());
|
|
|
baseNatAppointmentDO.setRegisterNo(serialNo);
|
|
|
//保存日志
|
|
|
WlyyHttpLogDO log = new WlyyHttpLogDO();
|
|
|
log.setCode("registerOutPatient");
|
|
|
log.setName("挂号");
|
|
|
log.setPatient(patientId);
|
|
|
log.setDoctor(map.get("doctorCode").toString());
|
|
|
log.setResponse(rs.toString());
|
|
|
log.setStatus(rsCode);
|
|
|
log.setCreateTime(new Date());
|
|
|
wlyyHttpLogDao.save(log);
|
|
|
|
|
|
} else if ("-2".equals(rsCode)) {
|
|
|
String serialNo = (String) res.get("@serial_no");
|
|
|
String xtgzh = (String) res.get("@xtgzh");
|
|
|
String realOrder = (String) res.get("@real_order");
|
|
|
String conNo = (String) res.get("@times");
|
|
|
jsondate.put("serialNo",serialNo);
|
|
|
jsondate.put("dept",map.get("deptCode").toString());
|
|
|
jsondate.put("doctor",map.get("doctorMappingCode").toString());
|
|
|
logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
|
|
|
//保存日志
|
|
|
WlyyHttpLogDO log = new WlyyHttpLogDO();
|
|
|
log.setCode("registerOutPatient");
|
|
|
log.setName("挂号");
|
|
|
log.setPatient(patientId);
|
|
|
log.setDoctor(map.get("doctorCode").toString());
|
|
|
log.setResponse(rs.toString());
|
|
|
log.setStatus(rsCode);
|
|
|
log.setCreateTime(new Date());
|
|
|
wlyyHttpLogDao.save(log);
|
|
|
}else {
|
|
|
returnMap.put("msg","请求挂号失败");
|
|
|
returnMap.put("status","-1");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
return returnMap;
|
|
|
}
|
|
|
baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
|
|
|
baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
|
|
|
|
|
|
} else if ("-2".equals(rsCode)) {
|
|
|
String serialNo = (String) res.get("@serial_no");
|
|
|
String xtgzh = (String) res.get("@xtgzh");
|
|
|
String realOrder = (String) res.get("@real_order");
|
|
|
String conNo = (String) res.get("@times");
|
|
|
jsondate.put("serialNo",serialNo);
|
|
|
jsondate.put("dept",map.get("deptCode").toString());
|
|
|
jsondate.put("doctor",map.get("doctorMappingCode").toString());
|
|
|
logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
logger.info("开单开始");
|
|
|
logger.info("saveNatAppointment params:"+jsondate.toString());
|
|
|
com.alibaba.fastjson.JSONArray array = new com.alibaba.fastjson.JSONArray();
|
|
|
array.add(jsondate);
|
|
|
try {
|
|
|
JSONObject jsonObject = entranceService.BS10112(array.toString(),demoFlag);
|
|
|
//判断返回结果
|
|
|
String prers = jsonObject.getString("@RESULT");
|
|
|
//保存日志
|
|
|
WlyyHttpLogDO log = new WlyyHttpLogDO();
|
|
|
log.setCode("registerOutPatient");
|
|
|
log.setName("挂号");
|
|
|
log.setCode("saveNatAppointment");
|
|
|
log.setName("核酸检测开方");
|
|
|
log.setPatient(patientId);
|
|
|
log.setDoctor(map.get("doctorCode").toString());
|
|
|
log.setResponse(rs.toString());
|
|
|
log.setStatus(rsCode);
|
|
|
log.setResponse(jsonObject.toString());
|
|
|
log.setRequest(jsondate.toString());
|
|
|
log.setCreateTime(new Date());
|
|
|
wlyyHttpLogDao.save(log);
|
|
|
}else {
|
|
|
returnMap.put("msg","请求挂号失败");
|
|
|
returnMap.put("status","-1");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
return returnMap;
|
|
|
}
|
|
|
baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
|
|
|
baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
|
|
|
if ("0".equals(prers)) {
|
|
|
String realOrder = jsonObject.getString("@real_order");
|
|
|
String voucherNo = jsonObject.getString("@xtgzh0");
|
|
|
baseNatAppointmentDO.setRealOrder(realOrder);
|
|
|
baseNatAppointmentDO.setIsSuccess("1");
|
|
|
baseNatAppointmentDO.setVoucherNo(voucherNo);
|
|
|
baseNatAppointmentDO =baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
logger.info("模板消息推送标识pushFlag"+pushFlag);
|
|
|
if (!StringUtils.isNoneBlank(pushFlag)){
|
|
|
String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
|
|
|
String applyDepaName = map.get("deptName").toString();
|
|
|
String applyDoctorName = map.get("doctorName").toString();
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patientId);
|
|
|
String userName = null;
|
|
|
String idcard = null;
|
|
|
if (patientDO != null) {
|
|
|
userName = patientDO.getName();
|
|
|
idcard = patientDO.getIdcard();
|
|
|
}
|
|
|
String hisId = patientMappingService.findHisPatNoByPatient(patientId,mediaCard);
|
|
|
logger.info("cardNo:" + cardNo);
|
|
|
JSONObject jsonObject1 =entranceService.BS15054(hisId,realOrder,demoFlag);
|
|
|
net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest");
|
|
|
logger.info("获取待结算数据 res: " + res.toString());
|
|
|
String rsCode = res.getString("@RESULT");
|
|
|
String free= 0+"";
|
|
|
if ("0".equals(rsCode)) {
|
|
|
free = res.getString("@total_charge");
|
|
|
}
|
|
|
ylzPayService.msgPush("01", mediaCard, "01", patientDO.getMobile(), "00", hisId, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1",pushChannel);
|
|
|
}else {
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
logger.info("开单开始");
|
|
|
logger.info("saveNatAppointment params:"+jsondate.toString());
|
|
|
com.alibaba.fastjson.JSONArray array = new com.alibaba.fastjson.JSONArray();
|
|
|
array.add(jsondate);
|
|
|
try {
|
|
|
JSONObject jsonObject = entranceService.BS10112(array.toString(),demoFlag);
|
|
|
//判断返回结果
|
|
|
String prers = jsonObject.getString("@RESULT");
|
|
|
//保存日志
|
|
|
WlyyHttpLogDO log = new WlyyHttpLogDO();
|
|
|
log.setCode("saveNatAppointment");
|
|
|
log.setName("核酸检测开方");
|
|
|
log.setPatient(patientId);
|
|
|
log.setDoctor(map.get("doctorCode").toString());
|
|
|
log.setResponse(jsonObject.toString());
|
|
|
log.setRequest(jsondate.toString());
|
|
|
log.setCreateTime(new Date());
|
|
|
wlyyHttpLogDao.save(log);
|
|
|
if ("0".equals(prers)) {
|
|
|
String realOrder = jsonObject.getString("@real_order");
|
|
|
String voucherNo = jsonObject.getString("@xtgzh0");
|
|
|
baseNatAppointmentDO.setRealOrder(realOrder);
|
|
|
baseNatAppointmentDO.setIsSuccess("1");
|
|
|
baseNatAppointmentDO.setVoucherNo(voucherNo);
|
|
|
baseNatAppointmentDO =baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
|
|
|
String applyDepaName = map.get("deptName").toString();
|
|
|
|
|
|
|
|
|
String applyDoctorName = map.get("doctorName").toString();
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patientId);
|
|
|
String userName = null;
|
|
|
String idcard = null;
|
|
|
if (patientDO != null) {
|
|
|
userName = patientDO.getName();
|
|
|
idcard = patientDO.getIdcard();
|
|
|
}
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patientId);
|
|
|
String userNo = null;
|
|
|
if (patientMappingDO != null) {
|
|
|
userNo = patientMappingDO.getMappingCode();
|
|
|
}
|
|
|
/* String title="您在厦门大学附属中山医院有一笔交易已支付完成!";
|
|
|
String pushPayLog = payInfoNoticeService.pushPrescriptionPayAndHsjc(baseNatAppointmentDO.getPatientId(),baseNatAppointmentDO.getDoctorName(),waitPayDetailVO.getVoucherNo(),natAppointmentDO.getId()+"",fee,title,null,waitPayDetailVO.getRecipeNo());
|
|
|
*/
|
|
|
}
|
|
|
|
|
|
logger.info("cardNo:" + cardNo);
|
|
|
JSONObject jsonObject1 =entranceService.BS15054(patientMappingDO.getMappingCode(),realOrder,demoFlag);
|
|
|
net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest");
|
|
|
logger.info("获取待结算数据 res: " + res.toString());
|
|
|
String rsCode = res.getString("@RESULT");
|
|
|
String free= 0+"";
|
|
|
if ("0".equals(rsCode)) {
|
|
|
free = res.getString("@total_charge");
|
|
|
}
|
|
|
ylzPayService.msgPush("01", mediaCard, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1");
|
|
|
|
|
|
/*//成功后发送模板消息
|
|
|
sendNatWxTemplat(name,cardNo,mobile,natTime,realOrder,"natAppointmentRemind");*/
|
|
|
}else{
|
|
|
returnMap.put("msg","核酸检测开方失败");
|
|
|
returnMap.put("status","-1");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
return returnMap;
|
|
|
}else{
|
|
|
returnMap.put("msg","核酸检测开方失败");
|
|
|
returnMap.put("status","-1");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
return returnMap;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
returnMap.put("msg","预约成功");
|
|
|
returnMap.put("status","200");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
returnMap.put("realOrder",baseNatAppointmentDO.getRealOrder());
|
|
|
}
|
|
|
}
|
|
|
return returnMap;
|
|
|
}else if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
|
|
|
baseNatAppointmentDO.setMedicare(mediaCard);
|
|
|
baseNatAppointmentDO.setName(name);
|
|
|
baseNatAppointmentDO.setCardNo(cardNo);
|
|
|
baseNatAppointmentDO.setCardType(cardType);
|
|
|
baseNatAppointmentDO.setAddress(address);
|
|
|
baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
|
|
|
baseNatAppointmentDO.setCityName(cityName);
|
|
|
baseNatAppointmentDO.setFirstJobCode(firstJobCode);
|
|
|
baseNatAppointmentDO.setFirstJobName(firstJobName);
|
|
|
baseNatAppointmentDO.setSecondJobCode(secondJobCode);
|
|
|
baseNatAppointmentDO.setSecondJobName(secondJobName);
|
|
|
baseNatAppointmentDO.setProvinceName(provinceName);
|
|
|
baseNatAppointmentDO.setTownName(townName);
|
|
|
baseNatAppointmentDO.setStreetName(streetName);
|
|
|
baseNatAppointmentDO.setPatientId(patientId);
|
|
|
baseNatAppointmentDO.setIsSuccess("0");
|
|
|
baseNatAppointmentDO.setPayStatus("0");
|
|
|
baseNatAppointmentDO.setCreateTime(new Date());
|
|
|
baseNatAppointmentDO.setMobile(mobile);
|
|
|
baseNatAppointmentDO.setInspectionCode("鼻/咽拭子");
|
|
|
baseNatAppointmentDO.setInspectionName("鼻/咽拭子");
|
|
|
baseNatAppointmentDO.setIcdCode("Z00.000");
|
|
|
baseNatAppointmentDO.setChargeCode("361322");
|
|
|
baseNatAppointmentDO.setWinNo("6");
|
|
|
baseNatAppointmentDO.setDept("3150000");
|
|
|
baseNatAppointmentDO.setDeptName("感染疾病科");
|
|
|
baseNatAppointmentDO.setAmpm(pm);
|
|
|
baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
returnMap.put("msg","预约成功");
|
|
|
returnMap.put("status","200");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
returnMap.put("realOrder",baseNatAppointmentDO.getRealOrder());
|
|
|
return returnMap;
|
|
|
}
|
|
|
|
|
|
|
|
|
return returnMap;
|
|
|
}
|
|
|
public MixEnvelop getNatRecords(String patientId,String id,String payStatus,String appointmentTime, String isSuccess,Integer page ,Integer pageSize){
|
|
|
try {
|
|
|
savePayStatusByHis(patientId);
|
|
|
logger.info("同步结束");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
String sql = "select t.name as \"name\"," +
|
|
|
"t.card_no as \"cardNo\"," +
|
|
|
"t.card_type as \"cardType\"," +
|
|
@ -10700,6 +10746,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
sql+=" order by t.appointment_time desc ";
|
|
|
List<Map<String ,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
|
|
|
List<Map<String ,Object>> listCount = hibenateUtils.createSQLQuery(sql);
|
|
|
logger.info("查询数据"+sql);
|
|
|
MixEnvelop mixnvelop = new MixEnvelop();
|
|
|
if (listCount!=null&&listCount.size()>0){
|
|
|
mixnvelop.setCurrPage(page);
|
|
@ -10712,6 +10759,33 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
public void savePayStatusByHis(String patientId) throws Exception {
|
|
|
List<BaseNatAppointmentDO> baseNatAppointmentDOList = baseNatAppointmentDao.findPayStatusByPatientId(patientId);
|
|
|
for (BaseNatAppointmentDO baseNatAppointmentDO:baseNatAppointmentDOList){
|
|
|
String hisId = patientMappingService.findHisPatNoByPatient(patientId,baseNatAppointmentDO.getMedicare());
|
|
|
logger.info("cardNo:" + baseNatAppointmentDO.getMedicare());
|
|
|
JSONObject jsonObject1 =entranceService.BS15054(hisId,baseNatAppointmentDO.getRealOrder(),demoFlag);
|
|
|
net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest");
|
|
|
logger.info("获取待结算数据 res: " + res.toString());
|
|
|
String rsCode = res.getString("@RESULT");
|
|
|
String free= 0+"";
|
|
|
String settleFlag = "";
|
|
|
if ("0".equals(rsCode)) {
|
|
|
free = res.getString("@total_charge");
|
|
|
settleFlag = res.getString("@settle_flag");
|
|
|
if (StringUtils.isNoneBlank(settleFlag)&&settleFlag.equalsIgnoreCase("Y")){
|
|
|
baseNatAppointmentDO.setPayStatus("1");
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNoneBlank(free)&&free.equalsIgnoreCase("0")){
|
|
|
baseNatAppointmentDO.setPayStatus("1");
|
|
|
}
|
|
|
baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public List<Map<String,Object>> findBaseAddress(String addressFlag,String parentName){
|
|
|
String sql="";
|
|
|
if ("1".equalsIgnoreCase(addressFlag)){
|
|
@ -10805,267 +10879,58 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
//先调预约核酸检测的接口
|
|
|
public Map natAppointment(String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
|
|
|
String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName) throws Exception {
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
|
|
|
baseNatAppointmentDO.setMedicare(mediaCard);
|
|
|
baseNatAppointmentDO.setName(name);
|
|
|
baseNatAppointmentDO.setCardNo(cardNo);
|
|
|
baseNatAppointmentDO.setCardType(cardType);
|
|
|
baseNatAppointmentDO.setAddress(address);
|
|
|
baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDate(natTime,"yyyy-MM-dd hh:mm:ss"));
|
|
|
baseNatAppointmentDO.setCityName(cityName);
|
|
|
baseNatAppointmentDO.setFirstJobCode(firstJobCode);
|
|
|
baseNatAppointmentDO.setFirstJobName(firstJobName);
|
|
|
baseNatAppointmentDO.setSecondJobCode(secondJobCode);
|
|
|
baseNatAppointmentDO.setSecondJobName(secondJobName);
|
|
|
baseNatAppointmentDO.setProvinceName(provinceName);
|
|
|
baseNatAppointmentDO.setTownName(townName);
|
|
|
baseNatAppointmentDO.setStreetName(streetName);
|
|
|
baseNatAppointmentDO.setPatientId(patientId);
|
|
|
baseNatAppointmentDO.setIsSuccess("0");
|
|
|
baseNatAppointmentDO.setPayStatus("0");
|
|
|
baseNatAppointmentDO.setCreateTime(new Date());
|
|
|
baseNatAppointmentDO.setMobile(mobile);
|
|
|
baseNatAppointmentDO.setInspectionCode("鼻/咽拭子");
|
|
|
baseNatAppointmentDO.setInspectionName("鼻/咽拭子");
|
|
|
baseNatAppointmentDO.setIcdCode("Z00.000");
|
|
|
baseNatAppointmentDO.setChargeCode("361322");
|
|
|
baseNatAppointmentDO.setWinNo("6");
|
|
|
baseNatAppointmentDO.setDept("3150000");
|
|
|
baseNatAppointmentDO.setDeptName("感染疾病科");
|
|
|
baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
Map<String,Object> returnMap = new HashMap();
|
|
|
//先进行核算检测预约
|
|
|
String result = entranceService.BS10144("3150000","0001",natTime,mediaCard,name,cardNo,mobile,demoFlag);
|
|
|
com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
|
|
|
logger.info("核酸检测预约结束"+result);
|
|
|
if (object!=null){
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("MsgInfo");
|
|
|
String Msg = jsonObject.getString("Msg");
|
|
|
if (Msg.contains("Error")){
|
|
|
throw new Exception(Msg);
|
|
|
}else {
|
|
|
baseNatAppointmentDO.setIsSuccess("1");
|
|
|
baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
returnMap.put("msg","预约成功");
|
|
|
}
|
|
|
}else {
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
returnMap.put("msg","预约失败");
|
|
|
}
|
|
|
return returnMap;
|
|
|
}
|
|
|
//预约核酸成功后通过订单id去挂号生成订单
|
|
|
public Map<String,Object> registerAndNatPre(Integer id) throws Exception{
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
|
|
|
Map<String,Object> map = findRandomDoctor();
|
|
|
Map<String,Object> returnMap = new HashMap<>();
|
|
|
if (baseNatAppointmentDO!=null){
|
|
|
net.sf.json.JSONObject jsondate = new JSONObject();
|
|
|
jsondate.put("checkPart","鼻/咽拭子");
|
|
|
jsondate.put("cardNo",baseNatAppointmentDO.getMedicare());
|
|
|
jsondate.put("chargeFlag","2");
|
|
|
jsondate.put("chargeCode","361322");
|
|
|
jsondate.put("icdCode","Z00.000");
|
|
|
jsondate.put("socialNo",baseNatAppointmentDO.getCardNo());
|
|
|
jsondate.put("tellPhone",baseNatAppointmentDO.getMobile());
|
|
|
jsondate.put("address1",baseNatAppointmentDO.getProvinceName());
|
|
|
jsondate.put("address2",baseNatAppointmentDO.getCityName());
|
|
|
jsondate.put("address3",baseNatAppointmentDO.getTownName());
|
|
|
jsondate.put("address4",baseNatAppointmentDO.getStreetName());
|
|
|
jsondate.put("address5","");
|
|
|
jsondate.put("area",baseNatAppointmentDO.getAddress());
|
|
|
jsondate.put("winNo","6");
|
|
|
jsondate.put("target","1");
|
|
|
jsondate.put("quantity","1");
|
|
|
if("1".equalsIgnoreCase(baseNatAppointmentDO.getIsSuccess())){
|
|
|
logger.info("挂号开始");
|
|
|
String date = DateUtil.dateToStr(new Date(), "yyyy-MM-dd");
|
|
|
if (map!=null){
|
|
|
List<WlyyPatientRegisterDO> patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctorAndDel(baseNatAppointmentDO.getPatientId(), date,map.get("doctorCode").toString() ,1);
|
|
|
net.sf.json.JSONObject rs = new JSONObject();
|
|
|
if (patientRegisterDOs != null && patientRegisterDOs.size() > 0) {
|
|
|
WlyyPatientRegisterDO registerDO = patientRegisterDOs.get(0);
|
|
|
//判断是否已经挂号,如果已经挂号
|
|
|
if (StringUtils.isNotBlank(registerDO.getConNo()) && StringUtils.isNotBlank(registerDO.getRegisterNo())) {
|
|
|
net.sf.json.JSONObject res = new JSONObject();
|
|
|
res.put("@RESULT", "0");
|
|
|
logger.info("已经挂号 res: " + res.toString());
|
|
|
jsondate.put("serialNo",registerDO.getRegisterNo());
|
|
|
jsondate.put("dept",map.get("deptCode").toString());
|
|
|
jsondate.put("doctor",map.get("doctorMappingCode").toString());
|
|
|
baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
|
|
|
}else {
|
|
|
returnMap.put("msg","已经挂号的数据有误");
|
|
|
returnMap.put("status","-1");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
return returnMap;
|
|
|
}
|
|
|
}else {
|
|
|
rs = entranceService.BS10111(baseNatAppointmentDO.getMedicare(), map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag);
|
|
|
net.sf.json.JSONObject res = rs.getJSONObject("resquest");
|
|
|
logger.info("挂号结果 res: " + res.toString());
|
|
|
String rsCode = res.getString("@RESULT");
|
|
|
if ("0".equals(rsCode)) {
|
|
|
//存储挂号号
|
|
|
// {"resquest":{"@RESULT":"0","@MSG":"完成","@serial_no":"47770476","@times":"28"}}
|
|
|
String serialNo = (String) res.get("@serial_no");
|
|
|
String conNo = (String) res.get("@times");
|
|
|
String xtgzh = (String) res.get("@xtgzh");
|
|
|
String realOrder = (String) res.get("@real_order");
|
|
|
logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
|
|
|
jsondate.put("serialNo",serialNo);
|
|
|
jsondate.put("dept",map.get("deptCode").toString());
|
|
|
jsondate.put("doctor",map.get("doctorMappingCode").toString());
|
|
|
//存储就诊记录
|
|
|
WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
|
|
|
// 存储挂号医生与挂号科室
|
|
|
registerDO.setDoctor(map.get("doctorCode").toString());
|
|
|
registerDO.setDoctorName(map.get("doctorName").toString());
|
|
|
registerDO.setDept(map.get("deptCode").toString());
|
|
|
registerDO.setDeptName(map.get("deptName").toString());
|
|
|
registerDO.setRealOrder(realOrder);
|
|
|
registerDO.setXtgzh(xtgzh);
|
|
|
registerDO.setPatient(baseNatAppointmentDO.getPatientId());
|
|
|
registerDO.setPatientName(baseNatAppointmentDO.getName());
|
|
|
//挂号流水号与挂号次数
|
|
|
registerDO.setRegisterNo(serialNo);
|
|
|
registerDO.setConNo(conNo);
|
|
|
registerDO.setCreateTime(new Date());
|
|
|
registerDO.setDel(1);
|
|
|
registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
|
|
|
patientRegisterDao.save(registerDO);
|
|
|
//保存日志
|
|
|
WlyyHttpLogDO log = new WlyyHttpLogDO();
|
|
|
log.setCode("registerNat");
|
|
|
log.setName("挂号");
|
|
|
log.setPatient(baseNatAppointmentDO.getPatientId());
|
|
|
log.setDoctor(map.get("doctorCode").toString());
|
|
|
log.setResponse(rs.toString());
|
|
|
log.setStatus(rsCode);
|
|
|
log.setCreateTime(new Date());
|
|
|
wlyyHttpLogDao.save(log);
|
|
|
|
|
|
} else if ("-2".equals(rsCode)) {
|
|
|
String serialNo = (String) res.get("@serial_no");
|
|
|
String xtgzh = (String) res.get("@xtgzh");
|
|
|
String realOrder = (String) res.get("@real_order");
|
|
|
String conNo = (String) res.get("@times");
|
|
|
jsondate.put("serialNo",serialNo);
|
|
|
jsondate.put("dept",map.get("deptCode").toString());
|
|
|
jsondate.put("doctor",map.get("doctorMappingCode").toString());
|
|
|
logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
|
|
|
//存储就诊记录
|
|
|
WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
|
|
|
registerDO.setDoctor(map.get("doctorCode").toString());
|
|
|
registerDO.setDoctorName(map.get("doctorName").toString());
|
|
|
registerDO.setDept(map.get("deptCode").toString());
|
|
|
registerDO.setDeptName(map.get("deptName").toString());
|
|
|
registerDO.setRealOrder(realOrder);
|
|
|
registerDO.setXtgzh(xtgzh);
|
|
|
registerDO.setPatient(baseNatAppointmentDO.getPatientId());
|
|
|
registerDO.setPatientName(baseNatAppointmentDO.getName());
|
|
|
registerDO.setRegisterNo(serialNo);
|
|
|
registerDO.setConNo(conNo);
|
|
|
registerDO.setCreateTime(new Date());
|
|
|
registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
|
|
|
patientRegisterDao.save(registerDO);
|
|
|
//保存日志
|
|
|
WlyyHttpLogDO log = new WlyyHttpLogDO();
|
|
|
log.setCode("registerOutPatient");
|
|
|
log.setName("挂号");
|
|
|
log.setPatient(baseNatAppointmentDO.getPatientId());
|
|
|
log.setDoctor(map.get("doctorCode").toString());
|
|
|
log.setResponse(rs.toString());
|
|
|
log.setStatus(rsCode);
|
|
|
log.setCreateTime(new Date());
|
|
|
wlyyHttpLogDao.save(log);
|
|
|
}else {
|
|
|
returnMap.put("msg","请求挂号失败");
|
|
|
returnMap.put("status","-1");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
return returnMap;
|
|
|
}
|
|
|
baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
|
|
|
}
|
|
|
logger.info("开单开始");
|
|
|
logger.info("NatPre params:"+jsondate.toString());
|
|
|
com.alibaba.fastjson.JSONArray array = new com.alibaba.fastjson.JSONArray();
|
|
|
array.add(jsondate);
|
|
|
try {
|
|
|
JSONObject jsonObject = entranceService.BS10112(array.toString(),demoFlag);
|
|
|
//判断返回结果
|
|
|
String prers = jsonObject.getString("@RESULT");
|
|
|
//保存日志
|
|
|
WlyyHttpLogDO log = new WlyyHttpLogDO();
|
|
|
log.setCode("NatAppointment");
|
|
|
log.setName("核酸检测开方");
|
|
|
log.setPatient(baseNatAppointmentDO.getPatientId());
|
|
|
log.setDoctor(map.get("doctorCode").toString());
|
|
|
log.setResponse(jsonObject.toString());
|
|
|
log.setRequest(jsondate.toString());
|
|
|
log.setCreateTime(new Date());
|
|
|
wlyyHttpLogDao.save(log);
|
|
|
if ("0".equals(prers)) {
|
|
|
String realOrder = jsonObject.getString("@real_order");
|
|
|
baseNatAppointmentDO.setRealOrder(realOrder);
|
|
|
baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
|
|
|
String applyDepaName = map.get("deptName").toString();
|
|
|
String voucherNo = jsonObject.getString("@xtgzh0");
|
|
|
String applyDoctorName = map.get("doctorName").toString();
|
|
|
BasePatientDO patientDO = basePatientDao.findById(baseNatAppointmentDO.getPatientId());
|
|
|
String userName = null;
|
|
|
String idcard = null;
|
|
|
if (patientDO != null) {
|
|
|
userName = patientDO.getName();
|
|
|
idcard = patientDO.getIdcard();
|
|
|
}
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(baseNatAppointmentDO.getPatientId());
|
|
|
String userNo = null;
|
|
|
if (patientMappingDO != null) {
|
|
|
userNo = patientMappingDO.getMappingCode();
|
|
|
}
|
|
|
/*JSONObject jsonObject1 =entranceService.BS15054(patientMappingDO.getMappingCode(),realOrder,demoFlag);
|
|
|
net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest");
|
|
|
logger.info("获取待结算数据 res: " + res.toString());
|
|
|
String rsCode = res.getString("@RESULT");*/
|
|
|
String free= 80+"";
|
|
|
/*if ("0".equals(rsCode)) {
|
|
|
free = res.getString("@total_charge");
|
|
|
}*/
|
|
|
ylzPayService.msgPush("01", baseNatAppointmentDO.getMedicare(), "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1");
|
|
|
|
|
|
/*//成功后发送模板消息
|
|
|
sendNatWxTemplat(name,cardNo,mobile,natTime,realOrder,"natAppointmentRemind");*/
|
|
|
}else{
|
|
|
returnMap.put("msg","核酸检测开方失败");
|
|
|
returnMap.put("status","-1");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
return returnMap;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
returnMap.put("msg","预约成功");
|
|
|
returnMap.put("status","200");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
}else {
|
|
|
returnMap.put("msg","医生映射表找不到对应信息");
|
|
|
returnMap.put("status","-1");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
}
|
|
|
}else{
|
|
|
returnMap.put("msg","该单状态出错:"+baseNatAppointmentDO.getIsSuccess());
|
|
|
returnMap.put("status","-1");
|
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
|
}
|
|
|
public String sendAlipayMessage(String patientId,String code,String fee,String redirdctUrl,String reserverTime,String realorder) throws Exception {
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
|
|
|
/* ⽀付提醒通知:
|
|
|
code: 通知代码,⽀付提醒为“2” open_id:⽀付宝⽤户ID user_name: 姓名 order_id: 订单号
|
|
|
create_time: 订单创建时间 fee: ⾦额 url:通知详情跳转链接*/
|
|
|
/*预约成功通知:
|
|
|
code: 通知代码,预约为“4” open_id: ⽀付宝⽤户ID user_name: 姓名 unit_name: 科室名
|
|
|
doctor_name: 医⽣名 order_time: 预约时间 order_no: 预约号*/
|
|
|
|
|
|
/* ⽀付成功通知:
|
|
|
code:通知代码,⽀付成功为“3” open_id:⽀付宝⽤户ID first: 您好,恭喜⽀付成功! fee: ⾦额
|
|
|
fee_type_name: 费⽤类型 url: 通知详情跳转链接 remark: 备注,以\n换⾏*/
|
|
|
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patientId);
|
|
|
|
|
|
if (code.equalsIgnoreCase("3")){
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("open_id",patientDO.getAlipayId());
|
|
|
jsonObject.put("first",patientDO.getName()+"您好,您有一笔交易支付成功!支付明细如下:");
|
|
|
jsonObject.put("fee_type_name","核酸预约申请");
|
|
|
jsonObject.put("fee",fee);
|
|
|
jsonObject.put("url",redirdctUrl);
|
|
|
String remark = "发票流水号:"+realorder+"\n" +
|
|
|
"点击查看核酸预约开单信息\n" ;
|
|
|
jsonObject.put("remark",remark);
|
|
|
}else if (code.equalsIgnoreCase("13")){
|
|
|
/* code: 通知代码,预约为“13” open_id: ⽀付宝⽤户ID first: 第⼀⾏ keyword1: 第⼆⾏ keyword2: 第三⾏
|
|
|
remark: 备注 url: 详情链接*/
|
|
|
jsonObject.put("code",code);
|
|
|
jsonObject.put("open_id",patientDO.getAlipayId());
|
|
|
jsonObject.put("first","尊敬的用户"+patientDO.getName()+",您已完成线上自助核酸检测预约申请");
|
|
|
jsonObject.put("keyword1",DateUtil.getStringDate());
|
|
|
jsonObject.put("keyword2","申请人:"+patientDO.getName()+"\n" +
|
|
|
"预约时间:"+reserverTime+"\n" +
|
|
|
"发票流水号:"+realorder+"");
|
|
|
String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\n" +
|
|
|
"2、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
|
|
|
jsonObject.put("remark",remark);
|
|
|
jsonObject.put("url",redirdctUrl);
|
|
|
}
|
|
|
|
|
|
String url = "https://xmzsyyfwc.xmpbinfo.cn/weixin/1/notification/push/nucleictest";
|
|
|
logger.info("jsonObject"+jsonObject.toJSONString());
|
|
|
String encdata = AES.encrypt("3bdc154ed1e44a9c9f44451a16d8e0aa",jsonObject.toJSONString());
|
|
|
Map<String, String> params = new HashedMap();
|
|
|
params.put("encdata",encdata);
|
|
|
String reponse = httpClientUtil.httpPost(url,params);
|
|
|
logger.info("支付宝模板消息"+reponse);
|
|
|
return reponse;
|
|
|
|
|
|
}
|
|
|
return returnMap;
|
|
|
}
|
|
|
|
|
|
}
|