|
@ -368,13 +368,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @param size
|
|
|
* @return
|
|
|
*/
|
|
|
public MixEnvelop findReOutpatientList(String patient, Integer status, String startTime, String endTime, Integer page, Integer size) {
|
|
|
public MixEnvelop findReOutpatientList(String patient, Integer status, String startTime, String endTime,String outpatientType, Integer page, Integer size) {
|
|
|
String totalSql = "SELECT " +
|
|
|
" COUNT(1) AS \"total\" " +
|
|
|
" FROM " +
|
|
|
" wlyy_outpatient o " +
|
|
|
" WHERE " +
|
|
|
" o.patient =:patient AND o.outpatient_type != '2' ";
|
|
|
" o.patient =:patient ";
|
|
|
Map<String, Object> totalParams = new HashedMap();
|
|
|
totalParams.put("patient", patient);
|
|
|
if (status != null) {
|
|
@ -390,6 +390,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
totalParams.put("endTime", DateUtil.strToDateLong(endTime + " 23:59:59"));
|
|
|
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(outpatientType)){
|
|
|
totalSql+=" AND o.outpatient_type = :outpatientType ";
|
|
|
totalParams.put("outpatientType", outpatientType);
|
|
|
}
|
|
|
/* totalParams.add(patient);
|
|
|
if(status!=null){
|
|
|
totalSql += " AND o.status = ? ";
|
|
@ -430,6 +434,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" o.hospital_name AS \"hospitalName\"," +
|
|
|
" o.win_no AS \"winNo\"," +
|
|
|
" o.type AS \"type\"," +
|
|
|
" o.outpatient_type AS \"outpatientType\"," +
|
|
|
" o.dept AS \"dept\", " +
|
|
|
" o.dept_name AS \"deptName\", " +
|
|
|
" o.patient AS \"patient\", " +
|
|
@ -482,10 +487,28 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
params.put("endTime", DateUtil.strToDateLong(endTime + " 23:59:59"));
|
|
|
|
|
|
}
|
|
|
sql += " AND o.outpatient_type != '2' ORDER BY o.create_time DESC ";
|
|
|
if (StringUtils.isNotBlank(outpatientType)){
|
|
|
sql+=" AND o.outpatient_type = '"+outpatientType+"' ORDER BY o.create_time DESC ";
|
|
|
}
|
|
|
logger.info("sql="+sql);
|
|
|
List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params, page, size);
|
|
|
|
|
|
if(list!=null&&list.size()>0){
|
|
|
for(Map<String, Object> map:list){
|
|
|
String outpatientId = map.get("id").toString();
|
|
|
String status2 = map.get("status")==null?"":map.get("status").toString();
|
|
|
String consultSql = "select t.id as \"id\" from wlyy_consult t where t.relation_code ='"+outpatientId+"'";
|
|
|
List<Map<String, Object>> consultList = hibenateUtils.createSQLQuery(consultSql);
|
|
|
if (consultList!=null&&consultList.size()>0){
|
|
|
if (status2.equalsIgnoreCase("0")&&null!=consultList.get(0).get("id")){
|
|
|
map.put("haveConsult","1");
|
|
|
}else {
|
|
|
map.put("haveConsult","1");
|
|
|
}
|
|
|
}else {
|
|
|
map.put("haveConsult","0");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
|
|
|
}
|
|
|
|
|
@ -1143,7 +1166,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public Map<String, Object> checkOutpatient(String patient,String wxId,boolean flag,String outpatientType) throws Exception {
|
|
|
//-1卡余额不足,,-2 存在未结束的诊断热 1成功
|
|
|
Map<String, Object> rs = new HashedMap();
|
|
|
WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("consultAccount");
|
|
|
WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("consultAccount");
|
|
|
String accountControl = "0";
|
|
|
if (null!=wlyyHospitalSysDictDO){
|
|
|
accountControl = wlyyHospitalSysDictDO.getDictValue();
|
|
@ -1559,7 +1582,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
chargeTypeList = chargeType.replace(",","','");
|
|
|
}
|
|
|
String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
"req_fee as \"reqFee\",zj_fee as \"zjFee\",xt_fee as \"xtFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeTypeList+"')";
|
|
|
if (StringUtils.isNoneBlank(deptTyepCode)){
|
|
@ -3475,7 +3498,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
chargeType = chargeType.replace(",","','");
|
|
|
}
|
|
|
String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
"req_fee as \"reqFee\",zj_fee as \"zjFee\",xt_fee as \"xtFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeType+"')";
|
|
|
if (StringUtils.isNoneBlank(deptTyepCode)){
|
|
@ -3742,7 +3765,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
chargeType = chargeType.replace(",","','");
|
|
|
}
|
|
|
String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
"req_fee as \"reqFee\",zj_fee as \"zjFee\",xt_fee as \"xtFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeType+"')";
|
|
|
if(StringUtils.isNoneBlank(deptTyepCode)){
|
|
@ -4039,12 +4062,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if ("1".equals(type)) {
|
|
|
contentMsg = "您有一个图文咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = consPatientDO.getName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
|
|
|
msgUrl="/ims-wx/index.html#/chatRoom?type=1&consultCode="+consultTeam.getConsult();
|
|
|
if (StringUtils.isNotBlank(outpatientId)){
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
|
}else{
|
|
|
msgUrl="/ims-wx/index.html#/chatRoom?type=1&consultCode="+consultTeam.getConsult();
|
|
|
}
|
|
|
logger.info("图文咨询订单待支付微信消息模板推送开始");
|
|
|
} else if ("17".equals(type)) {
|
|
|
contentMsg = "您有一个视频咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = consPatientDO.getName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
|
|
|
msgUrl="/ims-wx/index.html#/chatRoom?type=1&consultCode="+consultTeam.getConsult();
|
|
|
if (StringUtils.isNotBlank(outpatientId)){
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
|
}else{
|
|
|
msgUrl="/ims-wx/index.html#/chatRoom?type=1&consultCode="+consultTeam.getConsult();
|
|
|
}
|
|
|
logger.info("视频咨询订单待支付微信消息模板推送开始");
|
|
|
}
|
|
|
|
|
@ -4059,7 +4090,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
contentMsg = "" + remindMsg;
|
|
|
remark = "请您尽快回复";
|
|
|
} else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
|
|
|
if (StringUtils.isNotEmpty(outpatientId)){
|
|
|
|
|
|
if ("16".equals(type)) {
|
|
|
first = doctorDO.getName() + doctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
|
|
|
contentMsg = "您的视频复诊已开始,错过将重新排队";
|
|
@ -4067,8 +4098,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/preChat?type=16&outpatientId="+outpatientId;
|
|
|
logger.info("视频问诊已接诊提醒微信模板消息发送开始");
|
|
|
}
|
|
|
}
|
|
|
if (consultTeam!=null){
|
|
|
if ("17".equals(type)) {
|
|
|
first = consDoctorDO.getName() + consDoctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
|
|
|
contentMsg = "您的视频咨询已开始,错过将重新排队";
|
|
|
remark = "点击消息进入视频诊室接听视频通话,开始视频复诊。";
|
|
|
if (StringUtils.isNotEmpty(outpatientId)){
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/preChat?type=17&outpatientId="+outpatientId;
|
|
|
}else{
|
|
|
msgUrl="/ims-wx/index.html#/zx/prechat?consultCode="+consultTeam.getConsult();
|
|
|
}
|
|
|
logger.info("视频咨询已接诊提醒微信模板消息发送开始");
|
|
|
}
|
|
|
/*if (consultTeam!=null){
|
|
|
if ("17".equals(type)) {
|
|
|
first = consDoctorDO.getName() + consDoctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
|
|
|
contentMsg = "您的视频咨询已开始,错过将重新排队";
|
|
@ -4076,7 +4117,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
msgUrl="/ims-wx/index.html#/zx/prechat?consultCode="+consultTeam.getConsult();
|
|
|
logger.info("视频咨询已接诊提醒微信模板消息发送开始");
|
|
|
}
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
} else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
|
|
|
|
|
@ -4088,7 +4129,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
} else if ("17".equals(type)) {
|
|
|
first = "您的视频咨询已预约成功。";
|
|
|
contentMsg = "预计" + consDoctorDO.getName() + "医生将于" + DateUtil.dateToStrLong(consultTeam.getCzrq()) + " 与您进行视频咨询。请留意微信公众号消息。";
|
|
|
msgUrl="/ims-wx/index.html#/zx/prechat?consultCode="+consultTeam.getConsult();
|
|
|
if (StringUtils.isNotEmpty(outpatientId)){
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/preChat?type=17&outpatientId="+outpatientId;
|
|
|
}else{
|
|
|
msgUrl="/ims-wx/index.html#/zx/prechat?consultCode="+consultTeam.getConsult();
|
|
|
}
|
|
|
logger.info("视频咨询已预约成功微信消息模板推送开始");
|
|
|
}
|
|
|
remark = "咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
|
|
@ -4166,17 +4211,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
|
|
|
newConfig.setKeyword1( "视频复诊支付");
|
|
|
}
|
|
|
newConfig.setKeyword2(outpatientDO.getHospitalName());
|
|
|
newConfig.setKeyword3(outpatientDO.getDoctorName());
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
logger.info("眼科微信消息模板推送 就诊支付提醒开始");
|
|
|
}
|
|
|
//咨询支付
|
|
|
if (consultTeam!=null){
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_pay_notice_zx", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
newConfig.setFirst(config.getFirst().replace("key1", consPatientDO.getName()));
|
|
|
if ("1".equals(type)) {
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "图文咨询"));
|
|
|
newConfig.setKeyword1("图文咨询支付");
|
|
@ -4184,13 +4218,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
|
|
|
newConfig.setKeyword1("视频咨询支付");
|
|
|
}
|
|
|
newConfig.setKeyword2( hospitalDO.getOrgName());
|
|
|
newConfig.setKeyword3( consDoctorDO.getName());
|
|
|
newConfig.setKeyword2(outpatientDO.getHospitalName());
|
|
|
newConfig.setKeyword3(outpatientDO.getDoctorName());
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
|
|
|
logger.info("眼科微信消息模板推送 咨询支付提醒开始");
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
logger.info("眼科微信消息模板推送 就诊支付提醒开始");
|
|
|
}else {
|
|
|
//咨询支付
|
|
|
if (consultTeam!=null){
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_pay_notice_zx", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
newConfig.setFirst(config.getFirst().replace("key1", consPatientDO.getName()));
|
|
|
if ("1".equals(type)) {
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "图文咨询"));
|
|
|
newConfig.setKeyword1("图文咨询支付");
|
|
|
} else if ("17".equals(type)) {
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
|
|
|
newConfig.setKeyword1("视频咨询支付");
|
|
|
}
|
|
|
newConfig.setKeyword2( hospitalDO.getOrgName());
|
|
|
newConfig.setKeyword3( consDoctorDO.getName());
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
|
|
|
logger.info("眼科微信消息模板推送 咨询支付提醒开始");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
|
|
|
scene = "cfzfts";
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_prescription_pay_notice", scene, 1);
|
|
@ -4226,42 +4278,46 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
newConfig.setKeyword4( outpatientDO.getIcd10Name());
|
|
|
if ("16".equals(type)) {
|
|
|
newConfig.setRemark(config.getRemark().replace("key1", "视频复诊"));
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
} else if ("17".equals(type)) {
|
|
|
newConfig.setRemark(config.getRemark().replace("key1", "视频咨询"));
|
|
|
newConfig.setUrl(newConfig.getUrl().replace("type=16","type=17") + "" + outpatientDO.getId());
|
|
|
}
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
logger.info("眼科微信消息模板推送 视频问诊接诊提醒开始");
|
|
|
}
|
|
|
|
|
|
if (consultTeam!=null){
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_msg_notice_zx", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
|
|
|
newConfig.setFirst(config.getFirst().replace("key1", consPatientDO.getName()).replace("key2", consDoctorDO.getJobTitleName()));
|
|
|
newConfig.setKeyword1( consDoctorDO.getName());
|
|
|
newConfig.setKeyword2(DateUtil.dateToStrLong(consultTeam.getCzrq()));//咨询暂无挂号时间
|
|
|
newConfig.setKeyword3( hospitalDO.getDeptName());
|
|
|
newConfig.setKeyword4( consultTeam.getSymptoms());
|
|
|
if ("16".equals(type)) {
|
|
|
newConfig.setRemark(config.getRemark().replace("key1", "视频复诊"));
|
|
|
} else if ("17".equals(type)) {
|
|
|
newConfig.setRemark(config.getRemark().replace("key1", "视频咨询"));
|
|
|
logger.info("眼科微信消息模板推送 视频问诊接诊提醒开始");
|
|
|
}else {
|
|
|
if (consultTeam!=null){
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_msg_notice_zx", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
|
|
|
newConfig.setFirst(config.getFirst().replace("key1", consPatientDO.getName()).replace("key2", consDoctorDO.getJobTitleName()));
|
|
|
newConfig.setKeyword1( consDoctorDO.getName());
|
|
|
newConfig.setKeyword2(DateUtil.dateToStrLong(consultTeam.getCzrq()));//咨询暂无挂号时间
|
|
|
newConfig.setKeyword3( hospitalDO.getDeptName());
|
|
|
newConfig.setKeyword4( consultTeam.getSymptoms());
|
|
|
if ("16".equals(type)) {
|
|
|
newConfig.setRemark(config.getRemark().replace("key1", "视频复诊"));
|
|
|
} else if ("17".equals(type)) {
|
|
|
newConfig.setRemark(config.getRemark().replace("key1", "视频咨询"));
|
|
|
}
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
|
|
|
logger.info("眼科微信消息模板推送 视频咨询接诊提醒开始");
|
|
|
}
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
|
|
|
logger.info("眼科微信消息模板推送 视频咨询接诊提醒开始");
|
|
|
}
|
|
|
|
|
|
} else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
|
|
|
scene = "spwzyytx";
|
|
|
|
|
|
if (StringUtils.isNotEmpty(outpatientId)){
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_video_notice_fz", scene, 1);
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_video_notice", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
if ("16".equals(type)) {
|
|
|
newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频复诊"));
|
|
|
}
|
|
|
if ("17".equals(type)) {
|
|
|
newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频咨询"));
|
|
|
}
|
|
|
newConfig.setKeyword1( outpatientDO.getConsumerName());
|
|
|
newConfig.setKeyword2( outpatientDO.getDeptName());
|
|
|
newConfig.setKeyword3( outpatientDO.getDoctorName());
|
|
@ -4270,24 +4326,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
logger.info("眼科微信消息模板推送 视频问诊预约提醒开始");
|
|
|
}
|
|
|
if (consultTeam!=null){
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_video_notice_zx", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
if ("17".equals(type)) {
|
|
|
newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频咨询"));
|
|
|
}else {
|
|
|
if (consultTeam!=null){
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_video_notice", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
if ("17".equals(type)) {
|
|
|
newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频咨询"));
|
|
|
}
|
|
|
newConfig.setKeyword1(consPatientDO.getName());
|
|
|
newConfig.setKeyword2(hospitalDO.getDeptName());
|
|
|
newConfig.setKeyword3(consDoctorDO.getName());
|
|
|
newConfig.setKeyword4(DateUtil.dateToStrLong(consultTeam.getCzrq()));
|
|
|
newConfig.setKeyword5(generalDoctorWaitingNumber(consDoctorDO.getId(), wxId, outpatientId));
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
logger.info("眼科微信消息模板推送 视频咨询预约提醒开始");
|
|
|
}
|
|
|
newConfig.setKeyword1(consPatientDO.getName());
|
|
|
newConfig.setKeyword2(hospitalDO.getDeptName());
|
|
|
newConfig.setKeyword3(consDoctorDO.getName());
|
|
|
newConfig.setKeyword4(DateUtil.dateToStrLong(consultTeam.getCzrq()));
|
|
|
newConfig.setKeyword5(generalDoctorWaitingNumber(consDoctorDO.getId(), wxId, outpatientId));
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
logger.info("眼科微信消息模板推送 视频咨询预约提醒开始");
|
|
|
}
|
|
|
|
|
|
|
|
|
} else if ("evaluateRemind".equalsIgnoreCase(titelType)) {
|
|
|
scene = "fwqjtx";
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_evaluate_notice", scene, 1);
|
|
@ -4539,10 +4594,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
sql += " AND room.reservation_type=2 ";
|
|
|
} else if (4==type){
|
|
|
//专家咨询
|
|
|
sql += " AND room.reservation_type=3 AND room.consult_type in (1,2,3)";
|
|
|
} else {
|
|
|
sql += " AND room.reservation_type=3 AND room.consult_type =1";
|
|
|
} else if (1==type) {
|
|
|
//在线复诊
|
|
|
sql += " AND room.reservation_type=1 AND room.consult_type=" + type;
|
|
|
sql += " AND room.reservation_type=1 AND room.consult_type =1";
|
|
|
}else {
|
|
|
sql += " AND room.consult_type =1";
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNoneBlank(dept)) {
|
|
@ -4551,7 +4608,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if(StringUtils.isNoneBlank(sex)){
|
|
|
sql += " AND patient.sex=" + sex + " ";
|
|
|
}if(StringUtils.isNoneBlank(keyword)){
|
|
|
sql += " AND patient.name like '%" + keyword + "%' ";
|
|
|
sql += " AND outpatient.patient_name like '%" + keyword + "%' ";
|
|
|
}
|
|
|
if(StringUtils.isNoneBlank(ageGroup)){
|
|
|
String[] age = ageGroup.split(",");
|
|
@ -5251,7 +5308,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
chargeType = chargeType.replace(",","','");
|
|
|
}
|
|
|
String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
"req_fee as \"reqFee\",zj_fee as \"zjFee\",xt_fee as \"xtFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeType+"')";
|
|
|
if (StringUtils.isNoneBlank(deptTyepCode)){
|
|
@ -5840,6 +5897,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"AND room.outpatient_id=outpatient.id " +
|
|
|
"AND consult.relation_code=outpatient.id " +
|
|
|
"AND outpatient.pay_status=1 " +
|
|
|
"AND outpatient.outpatient_type!=3 " +
|
|
|
"AND consult.status = 0 ";
|
|
|
if (StringUtils.isNoneBlank(doctor)) {
|
|
|
sql = sql + "AND room.doctor='" + doctor + "' " +
|
|
@ -5944,7 +6002,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return waitCount.toString();
|
|
|
}
|
|
|
|
|
|
public com.alibaba.fastjson.JSONArray getWaitingForVisitVideoPrescriptionByDoctor(String doctor, String wxId,String outpatientType) {
|
|
|
public com.alibaba.fastjson.JSONArray getWaitingForVisitVideoPrescriptionByDoctor(String doctor, String wxId,String outpatientType,String keyWord) {
|
|
|
String condition = "";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
if(flag){
|
|
@ -5993,10 +6051,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"AND room.reservation_time is not null ";/* +
|
|
|
"AND room.reservation_time >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' order by room.reservation_time ASC ";
|
|
|
// "AND room.reservation_time>='"+DateUtil.getStringDate("yyyy-MM-dd")+" 00:00:00"+"' ";*/
|
|
|
if(StringUtils.isNotBlank(outpatientType)){
|
|
|
sql+=" AND outpatient.type= 2 and outpatient.outpatient_type ="+outpatientType;
|
|
|
}else {
|
|
|
sql+=" AND room.consult_type= 2 ";
|
|
|
if(StringUtils.isNotBlank(outpatientType)&&"1".equalsIgnoreCase(outpatientType)){
|
|
|
sql+=" AND room.consult_type= 2 and room.reservation_type in (1,2)";
|
|
|
} else if (StringUtils.isNotBlank(outpatientType)&&"4".equalsIgnoreCase(outpatientType)) {
|
|
|
sql+=" AND room.consult_type= 2 and room.reservation_type = 3";
|
|
|
} else {
|
|
|
sql += " AND room.consult_type= 2 ";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(keyWord)){
|
|
|
sql += " AND outpatient.patient_name like '%"+keyWord+"%'";
|
|
|
}
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
if(flag){
|