|
@ -2,12 +2,15 @@ package com.yihu.jw.hospital.prescription.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import com.yihu.jw.dict.dao.BaseDictJobTitleDao;
|
|
|
|
import com.yihu.jw.dict.dao.BaseJobCategoryDao;
|
|
import com.yihu.jw.dict.dao.DictDeptDescDao;
|
|
import com.yihu.jw.dict.dao.DictDeptDescDao;
|
|
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
|
|
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
|
|
import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
|
|
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
|
|
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
|
|
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
|
|
import com.yihu.jw.entity.base.area.BaseDrugStoreDO;
|
|
import com.yihu.jw.entity.base.area.BaseDrugStoreDO;
|
|
|
|
import com.yihu.jw.entity.base.dict.BaseJobCategoryDO;
|
|
import com.yihu.jw.entity.base.dict.DictDeptDescDO;
|
|
import com.yihu.jw.entity.base.dict.DictDeptDescDO;
|
|
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
|
|
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
@ -15,6 +18,7 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
|
|
import com.yihu.jw.entity.base.im.ConsultTeamDo;
|
|
import com.yihu.jw.entity.base.im.ConsultTeamDo;
|
|
import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO;
|
|
import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO;
|
|
import com.yihu.jw.entity.base.org.BaseOrgDO;
|
|
import com.yihu.jw.entity.base.org.BaseOrgDO;
|
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
|
|
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
|
|
import com.yihu.jw.entity.base.wx.*;
|
|
import com.yihu.jw.entity.base.wx.*;
|
|
@ -126,6 +130,8 @@ import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import static javafx.scene.input.KeyCode.L;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Created by Trick on 2019/5/17.
|
|
* Created by Trick on 2019/5/17.
|
|
*/
|
|
*/
|
|
@ -273,6 +279,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
private BaseNatAppointmentDao baseNatAppointmentDao;
|
|
private BaseNatAppointmentDao baseNatAppointmentDao;
|
|
@Autowired
|
|
@Autowired
|
|
private PayInfoNoticeService payInfoNoticeService;
|
|
private PayInfoNoticeService payInfoNoticeService;
|
|
|
|
@Autowired
|
|
|
|
private BaseJobCategoryDao jobCategoryDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -4403,7 +4411,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
|
|
newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
|
|
newConfig.setKeyword1( "处方支付");
|
|
newConfig.setKeyword1( "处方支付");
|
|
newConfig.setKeyword2(outpatientDO.getHospitalName());
|
|
newConfig.setKeyword2(outpatientDO.getHospitalName());
|
|
newConfig.setKeyword3( outpatientDO.getDoctorName());
|
|
|
|
|
|
newConfig.setKeyword3(outpatientDO.getDoctorName());
|
|
//发起微信消息模板推送
|
|
//发起微信消息模板推送
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
logger.info("眼科微信消息模板推送 处方支付提醒开始");
|
|
logger.info("眼科微信消息模板推送 处方支付提醒开始");
|
|
@ -10457,7 +10465,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
public Map saveNatAppointment(String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
|
|
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,String pushChannel,String pushFlag,String cardNoType) throws Exception {
|
|
|
|
|
|
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,String cardNoType,String consumer) throws Exception {
|
|
Map returnMap = new HashMap();
|
|
Map returnMap = new HashMap();
|
|
if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
|
|
if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
|
|
net.sf.json.JSONObject jsondate = new JSONObject();
|
|
net.sf.json.JSONObject jsondate = new JSONObject();
|
|
@ -10688,7 +10696,45 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
baseNatAppointmentDO.setDept("3150000");
|
|
baseNatAppointmentDO.setDept("3150000");
|
|
baseNatAppointmentDO.setDeptName("感染疾病科");
|
|
baseNatAppointmentDO.setDeptName("感染疾病科");
|
|
baseNatAppointmentDO.setAmpm(pm);
|
|
baseNatAppointmentDO.setAmpm(pm);
|
|
|
|
baseNatAppointmentDO.setHospitalFlag(pushFlag);
|
|
|
|
baseNatAppointmentDO.setConsumer(consumer);
|
|
|
|
BasePatientDO basePatientDO = basePatientDao.findById(consumer);
|
|
|
|
baseNatAppointmentDO.setConsumerName(basePatientDO.getName());
|
|
baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
|
//添加订单
|
|
|
|
BusinessOrderDO businessDO = new BusinessOrderDO();
|
|
|
|
businessDO.setPatient(consumer);
|
|
|
|
businessDO.setPatientName(basePatientDO.getName());
|
|
|
|
businessDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
|
|
|
|
businessDO.setCreateTime(new Date());
|
|
|
|
businessDO.setStatus(0);
|
|
|
|
businessDO.setRelationCode(baseNatAppointmentDO.getId()+"");
|
|
|
|
businessDO.setRelationName("核酸检测订单");
|
|
|
|
businessDO.setOrderCategory("6");
|
|
|
|
businessDO.setOrderType(12);
|
|
|
|
businessDO.setPayPrice(8000.0);
|
|
|
|
businessDO.setRematk("核酸检测订单");
|
|
|
|
businessDO.setDescription("核酸检测订单");
|
|
|
|
businessDO.setPayType(1);
|
|
|
|
businessDO.setUpdateTime(new Date());
|
|
|
|
businessOrderDao.save(businessDO);
|
|
|
|
logger.info("建档开始");
|
|
|
|
com.alibaba.fastjson.JSONObject jdObject = ykyyEntranceService.patientJDKH(patientId, cardNo,name,mobile,mediaCard);
|
|
|
|
logger.info("建档结束");
|
|
|
|
logger.info("更新建档信息");
|
|
|
|
BaseJobCategoryDO jobCategoryDO =jobCategoryDao.findByName(firstJobName);
|
|
|
|
Float zy= 0f;
|
|
|
|
if (jobCategoryDO!=null){
|
|
|
|
zy=Float.parseFloat(jobCategoryDO.getId()+"");
|
|
|
|
}
|
|
|
|
ykyyEntranceService.updatePatientJd(patientId,address,mobile,zy,demoFlag);
|
|
|
|
//同步眼科医院
|
|
|
|
logger.info("开始同步眼科医院");
|
|
|
|
ykyyEntranceService.saveKsjc(baseNatAppointmentDO,demoFlag);
|
|
|
|
|
|
|
|
//预约成功后发送支付模板消息
|
|
|
|
sendYktemplateMessage(baseNatAppointmentDO.getId(),false);
|
|
|
|
logger.info("结束同步眼科医院");
|
|
returnMap.put("msg","预约成功");
|
|
returnMap.put("msg","预约成功");
|
|
returnMap.put("status","200");
|
|
returnMap.put("status","200");
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
returnMap.put("id",baseNatAppointmentDO.getId());
|
|
@ -10706,7 +10752,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
if (!StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
|
|
if (!StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
|
|
throw new Exception("核酸项目不存在");
|
|
throw new Exception("核酸项目不存在");
|
|
}
|
|
}
|
|
|
|
|
|
logger.info("模板消息推送标识pushFlag"+pushFlag);
|
|
logger.info("模板消息推送标识pushFlag"+pushFlag);
|
|
if (!StringUtils.isNoneBlank(pushFlag)){
|
|
if (!StringUtils.isNoneBlank(pushFlag)){
|
|
String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
|
|
String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
|
|
@ -10775,16 +10820,101 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
logger.info("支付宝模板消息"+reponse);
|
|
logger.info("支付宝模板消息"+reponse);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
return "发送成功!";
|
|
return "发送成功!";
|
|
}
|
|
}
|
|
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();
|
|
|
|
|
|
public String sendYktemplateMessage(Integer id,boolean isPayed) {
|
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
|
|
|
|
if (baseNatAppointmentDO==null){
|
|
|
|
return "核酸项目不存在,发送失败";
|
|
|
|
}
|
|
|
|
List<BasePatientWechatDo> ps = new ArrayList<BasePatientWechatDo>();
|
|
|
|
BasePatientDO patientDO = basePatientDao.findById(baseNatAppointmentDO.getPatientId());
|
|
|
|
String userName = "";
|
|
|
|
if (patientDO != null) {
|
|
|
|
userName = patientDO.getName();
|
|
|
|
}
|
|
|
|
if (StringUtils.isNotEmpty(baseNatAppointmentDO.getConsumer())){
|
|
|
|
ps = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, baseNatAppointmentDO.getConsumer());
|
|
|
|
}
|
|
|
|
if (ps.isEmpty()) {
|
|
|
|
logger.info("该用户没有openid,无法推送模版消息,用户ID:" + baseNatAppointmentDO.getConsumer() + "wechatId:" + wechatId);
|
|
}
|
|
}
|
|
|
|
Map<String,Object> map = ykyyEntranceService.findYkDoctor(baseNatAppointmentDO.getHospitalFlag());
|
|
|
|
WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
|
|
|
|
for (BasePatientWechatDo one : ps) {
|
|
|
|
try {
|
|
|
|
if (isPayed){
|
|
|
|
//眼科预约成功后消息提醒
|
|
|
|
WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
|
|
|
|
String scene = "hsyycgtx";
|
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_hsyycg_notice", scene, 1);
|
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
|
newConfig.setFirst(config.getFirst().replace("key1",userName));
|
|
|
|
newConfig.setKeyword1("核酸检测预约单支付");
|
|
|
|
if ("3".equalsIgnoreCase(baseNatAppointmentDO.getHospitalFlag())){
|
|
|
|
newConfig.setKeyword2("厦门大学附属厦门眼科中心思北院区");
|
|
|
|
}else {
|
|
|
|
newConfig.setKeyword2("厦门大学附属厦门眼科中心五缘院区");
|
|
|
|
}
|
|
|
|
newConfig.setKeyword3(map.get("doctorName")==null?"":map.get("doctorName").toString());
|
|
|
|
newConfig.setKeyword4(userName);
|
|
|
|
newConfig.setKeyword5(DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()));
|
|
|
|
newConfig.setRemark(config.getRemark().replace("key1",userName).replace("key2",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime())));
|
|
|
|
newConfig.setUrl(newConfig.getUrl()+baseNatAppointmentDO.getId());
|
|
|
|
logger.info("=======setUrlhsyycgtx========" + newConfig.getUrl());
|
|
|
|
logger.info("发送的消息="+ com.alibaba.fastjson.JSONObject.toJSONString(newConfig));
|
|
|
|
logger.info("调用眼科微信模板消息接口的入参:AccessToken="+wxAccessTokenDO.getAccessToken()+"---Openid="+one.getOpenid());
|
|
|
|
weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), one.getOpenid(), newConfig);
|
|
|
|
//保存发送模板记录,
|
|
|
|
WxPushLogDO wxPushLogDO = new WxPushLogDO();
|
|
|
|
wxPushLogDO.setCreateTime(new Date());
|
|
|
|
wxPushLogDO.setOpenid(one.getOpenid());
|
|
|
|
wxPushLogDO.setReceiver(baseNatAppointmentDO.getPatientId());
|
|
|
|
wxPushLogDO.setWechatId(wechatId);
|
|
|
|
wxPushLogDO.setScene(scene);
|
|
|
|
wxPushLogDao.save(wxPushLogDO);
|
|
|
|
}else {
|
|
|
|
WxTemplateConfigDO newPayNotice = new WxTemplateConfigDO();
|
|
|
|
String scenePayNotice= "hszftx";
|
|
|
|
//眼科核酸预约成功后支付提醒
|
|
|
|
WxTemplateConfigDO configPayNotice = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_hszf_notice", scenePayNotice, 1);
|
|
|
|
BeanUtils.copyProperties(configPayNotice, newPayNotice);
|
|
|
|
newPayNotice.setFirst(configPayNotice.getFirst().replace("key1",userName));
|
|
|
|
newPayNotice.setKeyword1("核酸检测预约单支付");
|
|
|
|
if ("3".equalsIgnoreCase(baseNatAppointmentDO.getHospitalFlag())){
|
|
|
|
newPayNotice.setKeyword2("厦门大学附属厦门眼科中心思北院区");
|
|
|
|
}else {
|
|
|
|
newPayNotice.setKeyword2("厦门大学附属厦门眼科中心五缘院区");
|
|
|
|
}
|
|
|
|
newPayNotice.setKeyword3(map.get("doctorName")==null?"":map.get("doctorName").toString());
|
|
|
|
newPayNotice.setRemark(configPayNotice.getRemark());
|
|
|
|
newPayNotice.setUrl(configPayNotice.getUrl()+baseNatAppointmentDO.getId());
|
|
|
|
logger.info("=======setUrlhszftx========" + newPayNotice.getUrl());
|
|
|
|
logger.info("发送的消息="+ com.alibaba.fastjson.JSONObject.toJSONString(newPayNotice));
|
|
|
|
logger.info("发送核酸预约模板消息成功");
|
|
|
|
logger.info("调用眼科微信模板消息支付提醒接口的入参:AccessToken="+wxAccessTokenDO.getAccessToken()+"---Openid="+one.getOpenid());
|
|
|
|
weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), one.getOpenid(), newPayNotice);
|
|
|
|
//保存发送模板记录,
|
|
|
|
WxPushLogDO wxPushLogDO = new WxPushLogDO();
|
|
|
|
wxPushLogDO.setCreateTime(new Date());
|
|
|
|
wxPushLogDO.setOpenid(one.getOpenid());
|
|
|
|
wxPushLogDO.setReceiver(baseNatAppointmentDO.getPatientId());
|
|
|
|
wxPushLogDO.setWechatId(wechatId);
|
|
|
|
wxPushLogDO.setScene(scenePayNotice);
|
|
|
|
wxPushLogDao.save(wxPushLogDO);
|
|
|
|
logger.info("发送核酸预约模板消息支付提醒成功");
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
logger.info("发送核酸预约模板消息失败,error="+e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "发送成功!";
|
|
|
|
}
|
|
|
|
|
|
|
|
public MixEnvelop getNatRecords(String patientId,String id,String payStatus,String appointmentTime, String isSuccess,Integer page ,Integer pageSize){
|
|
String sql = "select t.name as \"name\"," +
|
|
String sql = "select t.name as \"name\"," +
|
|
"t.card_no as \"cardNo\"," +
|
|
"t.card_no as \"cardNo\"," +
|
|
"t.card_type as \"cardType\"," +
|
|
"t.card_type as \"cardType\"," +
|
|
@ -10796,12 +10926,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
"t.pay_status as \"payStatus\"," +
|
|
"t.pay_status as \"payStatus\"," +
|
|
"t.medicare as \"medicare\","+
|
|
"t.medicare as \"medicare\","+
|
|
"t.voucher_no as \"voucherNo\","+
|
|
"t.voucher_no as \"voucherNo\","+
|
|
|
|
"t.dept as \"dept\","+
|
|
|
|
"t.dept_name as \"deptName\","+
|
|
"t.id as \"id\"," +
|
|
"t.id as \"id\"," +
|
|
"t.card_no_type as \"cardNoType\"," +
|
|
"t.card_no_type as \"cardNoType\"," +
|
|
|
|
"t.HOSPITAL_FLAG as \"hospitalFlag\"," +
|
|
"t.appointment_time as \"appointmentTime\" " +
|
|
"t.appointment_time as \"appointmentTime\" " +
|
|
" from base_nat_appointment t where 1=1 ";
|
|
" from base_nat_appointment t where 1=1 ";
|
|
if (StringUtils.isNoneBlank(patientId)){
|
|
if (StringUtils.isNoneBlank(patientId)){
|
|
sql+=" and t.patient_id ='"+patientId+"'";
|
|
|
|
|
|
sql+=" and t.consumer ='"+patientId+"'";
|
|
}
|
|
}
|
|
if (StringUtils.isNoneBlank(id)){
|
|
if (StringUtils.isNoneBlank(id)){
|
|
sql+=" and t.id ='"+id+"'";
|
|
sql+=" and t.id ='"+id+"'";
|
|
@ -10905,54 +11038,71 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
try {
|
|
try {
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
|
|
if (null!=baseNatAppointmentDO){
|
|
if (null!=baseNatAppointmentDO){
|
|
res = entranceService.BS10145("3150000","0001",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
|
|
|
|
logger.info("核酸检测预约取消"+res);
|
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
|
|
|
|
Boolean flag = false;
|
|
|
|
if (jsonObject!=null){
|
|
|
|
com.alibaba.fastjson.JSONObject object = jsonObject.getJSONObject("MsgInfo");
|
|
|
|
String Msg = object.getString("Msg");
|
|
|
|
if (Msg.contains("Error")){
|
|
|
|
throw new Exception(Msg);
|
|
|
|
}else {
|
|
|
|
baseNatAppointmentDO.setIsSuccess("-1");
|
|
|
|
baseNatAppointmentDO.setCancelReson("患者本人取消");
|
|
|
|
baseNatAppointmentDO.setCancelTime(new Date());
|
|
|
|
baseNatAppointmentDO.setCancelBy(patientId);
|
|
|
|
baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
|
if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
|
|
|
|
//删除处方
|
|
|
|
logger.info("删除处方开始");
|
|
|
|
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",2);
|
|
|
|
jsondate.put("area",baseNatAppointmentDO.getAddress());
|
|
|
|
jsondate.put("winNo",6);
|
|
|
|
jsondate.put("target",2);
|
|
|
|
jsondate.put("quantity",1);
|
|
|
|
jsondate.put("serialNo",baseNatAppointmentDO.getRegisterNo());
|
|
|
|
jsondate.put("dept",baseNatAppointmentDO.getDept());
|
|
|
|
jsondate.put("doctor",baseNatAppointmentDO.getDoctorId());
|
|
|
|
jsondate.put("realOrder",baseNatAppointmentDO.getRealOrder());
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
|
array.add(jsondate);
|
|
|
|
JSONObject object1 = entranceService.BS10112(array.toString(),demoFlag);
|
|
|
|
logger.info("删除处方结束");
|
|
|
|
}
|
|
|
|
|
|
if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
|
|
|
|
res = entranceService.BS10145("3150000","0001",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
|
|
|
|
logger.info("核酸检测预约取消"+res);
|
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
|
|
|
|
Boolean flag = false;
|
|
|
|
if (jsonObject!=null){
|
|
|
|
com.alibaba.fastjson.JSONObject object = jsonObject.getJSONObject("MsgInfo");
|
|
|
|
String Msg = object.getString("Msg");
|
|
|
|
if (Msg.contains("Error")){
|
|
|
|
throw new Exception(Msg);
|
|
|
|
}else {
|
|
|
|
baseNatAppointmentDO.setIsSuccess("-1");
|
|
|
|
baseNatAppointmentDO.setCancelReson("患者本人取消");
|
|
|
|
baseNatAppointmentDO.setCancelTime(new Date());
|
|
|
|
baseNatAppointmentDO.setCancelBy(patientId);
|
|
|
|
baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
|
if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
|
|
|
|
//删除处方
|
|
|
|
logger.info("删除处方开始");
|
|
|
|
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",2);
|
|
|
|
jsondate.put("area",baseNatAppointmentDO.getAddress());
|
|
|
|
jsondate.put("winNo",6);
|
|
|
|
jsondate.put("target",2);
|
|
|
|
jsondate.put("quantity",1);
|
|
|
|
jsondate.put("serialNo",baseNatAppointmentDO.getRegisterNo());
|
|
|
|
jsondate.put("dept",baseNatAppointmentDO.getDept());
|
|
|
|
jsondate.put("doctor",baseNatAppointmentDO.getDoctorId());
|
|
|
|
jsondate.put("realOrder",baseNatAppointmentDO.getRealOrder());
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
|
array.add(jsondate);
|
|
|
|
JSONObject object1 = entranceService.BS10112(array.toString(),demoFlag);
|
|
|
|
logger.info("删除处方结束");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
|
|
|
|
baseNatAppointmentDO.setIsSuccess("-1");
|
|
|
|
baseNatAppointmentDO.setCancelReson("患者本人取消");
|
|
|
|
baseNatAppointmentDO.setCancelTime(new Date());
|
|
|
|
baseNatAppointmentDO.setCancelBy(patientId);
|
|
|
|
baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
|
if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
|
|
|
|
logger.info("同步his订单状态"+baseNatAppointmentDO.getRealOrder());
|
|
|
|
String updateJcsq = "update V_EMR_JCSQ set ZFBZ = 1 where yjxh = "+baseNatAppointmentDO.getRealOrder();
|
|
|
|
ykyyEntranceService.updateHisStatus(updateJcsq);
|
|
|
|
String update01sq = "update V_MS_YJ01 set ZFPB = 1 where yjxh = "+baseNatAppointmentDO.getRealOrder();
|
|
|
|
ykyyEntranceService.updateHisStatus(update01sq);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|