|
@ -12219,22 +12219,34 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
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);
|
|
|
WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("natTimeConfig");
|
|
|
String isOpen = null;
|
|
|
if (hospitalSysDictDO!=null){
|
|
|
String dictValue = hospitalSysDictDO.getDictValue();
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(dictValue);
|
|
|
isOpen = jsonObject.getString("isOpen");
|
|
|
}
|
|
|
Boolean flag = false;
|
|
|
if (object!=null){
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("MsgInfo");
|
|
|
String Msg = jsonObject.getString("Msg");
|
|
|
if (Msg.contains("Error")){
|
|
|
if (isOpen!=null&&isOpen.equalsIgnoreCase("0")){
|
|
|
//先进行核算检测预约
|
|
|
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);
|
|
|
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;
|
|
|
}else {
|
|
|
flag = true;
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
flag = true;
|
|
|
}
|
|
|
|
|
|
if (flag){
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
|
|
|
baseNatAppointmentDO.setChargeAmount(chargeAmount);
|
|
@ -12978,10 +12990,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
|
|
|
if (null!=baseNatAppointmentDO){
|
|
|
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);
|
|
|
WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("natTimeConfig");
|
|
|
String isOpen = null;
|
|
|
if (hospitalSysDictDO!=null){
|
|
|
String dictValue = hospitalSysDictDO.getDictValue();
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(dictValue);
|
|
|
isOpen = jsonObject.getString("isOpen");
|
|
|
}
|
|
|
Boolean flag = false;
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
|
|
|
if (isOpen!=null&&isOpen.equalsIgnoreCase("0")){
|
|
|
res = entranceService.BS10145("3150000","0001",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
|
|
|
logger.info("核酸检测预约取消"+res);
|
|
|
jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
|
|
|
}else {
|
|
|
com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
|
|
|
object.put("Msg","success");
|
|
|
jsonObject.put("MsgInfo",object);
|
|
|
}
|
|
|
if (jsonObject!=null){
|
|
|
com.alibaba.fastjson.JSONObject object = jsonObject.getJSONObject("MsgInfo");
|
|
|
String Msg = object.getString("Msg");
|
|
@ -14390,4 +14416,80 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
throw e;
|
|
|
}
|
|
|
}
|
|
|
public ObjEnvelop selectNatTime()throws Exception{
|
|
|
ObjEnvelop envelop = new ObjEnvelop();
|
|
|
GregorianCalendar ca = new GregorianCalendar();
|
|
|
//i结果为“0”是上午 结果为“1”是下午
|
|
|
Integer i = ca.get(GregorianCalendar.AM_PM);
|
|
|
WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("natTimeConfig");
|
|
|
String isOpen = null;
|
|
|
String sql = "SELECT COUNT(1) as count FROM `base_nat_appointment` where is_success = 1 and pay_status=1 ";
|
|
|
if (hospitalSysDictDO!=null){
|
|
|
String dictValue = hospitalSysDictDO.getDictValue();
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(dictValue);
|
|
|
String startAm = jsonObject.getString("startAm");
|
|
|
String endAm = jsonObject.getString("endAm");
|
|
|
String startPm = jsonObject.getString("startPm");
|
|
|
String endPm = jsonObject.getString("endPm");
|
|
|
String message1 = jsonObject.getString("message1");
|
|
|
String message2 = jsonObject.getString("message2");
|
|
|
Integer amTotal = jsonObject.getInteger("amTotal");
|
|
|
Integer pmTotal = jsonObject.getInteger("pmTotal");
|
|
|
Date startAmDate = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" "+startAm);
|
|
|
Date endAmDate = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" "+endAm);
|
|
|
Date startPmDate = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" "+startPm);
|
|
|
Date endPmDate = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" "+endPm);
|
|
|
Date now = new Date();
|
|
|
if (i==0){
|
|
|
if (now.getTime()>=startAmDate.getTime()&&now.getTime()<=endAmDate.getTime()){
|
|
|
sql += " and create_time >= '"+DateUtil.dateToStrLong(startAmDate)+"' and create_time <='"+DateUtil.dateToStrLong(endAmDate)+"' ";
|
|
|
}else {
|
|
|
envelop.setMessage(message1);
|
|
|
envelop.setStatus(500);
|
|
|
return envelop;
|
|
|
}
|
|
|
}else if (i==1){
|
|
|
if (now.getTime()>=(startPmDate.getTime())&&now.getTime()<=(endPmDate.getTime())){
|
|
|
sql += " and create_time >= '"+DateUtil.dateToStrLong(startPmDate)+"' and create_time <='"+DateUtil.dateToStrLong(endPmDate)+"' ";
|
|
|
}else {
|
|
|
envelop.setMessage(message1);
|
|
|
envelop.setStatus(500);
|
|
|
return envelop;
|
|
|
}
|
|
|
}
|
|
|
Map<String,Object> map = jdbcTemplate.queryForMap(sql);
|
|
|
logger.info("map"+sql);
|
|
|
Integer count = 0;
|
|
|
if (map!=null){
|
|
|
count= Integer.parseInt(map.get("count").toString());
|
|
|
}
|
|
|
if (i==0){
|
|
|
if (amTotal>count){
|
|
|
Integer remainTotal = amTotal-count;
|
|
|
jsonObject.put("remainTotal",remainTotal);
|
|
|
}else {
|
|
|
envelop.setMessage(message2);
|
|
|
envelop.setStatus(500);
|
|
|
return envelop;
|
|
|
}
|
|
|
}else if (i==1){
|
|
|
if (pmTotal>count){
|
|
|
Integer remainTotal = pmTotal-count;
|
|
|
jsonObject.put("remainTotal",remainTotal);
|
|
|
}else {
|
|
|
envelop.setMessage(message2);
|
|
|
envelop.setStatus(500);
|
|
|
return envelop;
|
|
|
}
|
|
|
}
|
|
|
envelop.setStatus(200);
|
|
|
envelop.setMessage("获取号源成功");
|
|
|
envelop.setObj(jsonObject);
|
|
|
return envelop;
|
|
|
}else {
|
|
|
envelop.setStatus(500);
|
|
|
envelop.setMessage("获取号源失败");
|
|
|
return envelop;
|
|
|
}
|
|
|
}
|
|
|
}
|