|
@ -12,8 +12,6 @@ import com.yihu.jw.entity.base.dict.DictDeptDescDO;
|
|
|
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
|
|
|
|
|
|
import com.yihu.jw.entity.base.im.ConsultDo;
|
|
|
import com.yihu.jw.entity.base.im.ConsultTeamDo;
|
|
|
import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO;
|
|
|
import com.yihu.jw.entity.base.org.BaseOrgDO;
|
|
@ -46,6 +44,7 @@ import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
|
|
|
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
|
|
|
import com.yihu.jw.hospital.mapping.service.DoctorMappingService;
|
|
|
import com.yihu.jw.hospital.mapping.service.PatientMappingService;
|
|
|
import com.yihu.jw.hospital.message.dao.BaseBannerDoctorDao;
|
|
|
import com.yihu.jw.hospital.message.service.SystemMessageService;
|
|
|
import com.yihu.jw.hospital.prescription.dao.*;
|
|
|
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
|
|
@ -62,8 +61,6 @@ import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
|
|
|
import com.yihu.jw.restmodel.base.dict.DictHospitalDeptVO;
|
|
|
import com.yihu.jw.restmodel.base.org.BaseOrgVO;
|
|
|
import com.yihu.jw.restmodel.base.wx.WxGraphicMessageVO;
|
|
|
import com.yihu.jw.restmodel.base.wx.WxReplySceneVO;
|
|
|
import com.yihu.jw.restmodel.hospital.archive.ArchiveVO;
|
|
|
import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
|
|
|
import com.yihu.jw.restmodel.hospital.doctor.WlyyDoctorWorkTimeVO;
|
|
@ -77,12 +74,14 @@ import com.yihu.jw.util.common.IdCardUtil;
|
|
|
import com.yihu.jw.util.common.LatitudeUtils;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
|
|
|
import com.yihu.jw.utils.StringUtil;
|
|
|
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;
|
|
|
import com.yihu.jw.wechat.dao.WxPushLogDao;
|
|
|
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
|
|
|
import com.yihu.jw.wechat.service.BaseSensitiveFilterWordsService;
|
|
|
import com.yihu.jw.wechat.service.WxAccessTokenService;
|
|
|
import com.yihu.mysql.query.BaseJpaService;
|
|
|
import com.yihu.utils.security.MD5;
|
|
@ -213,8 +212,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
@Autowired
|
|
|
private WlyyConsultAdviceDao wlyyConsultAdviceDao;
|
|
|
@Autowired
|
|
|
private BaseDoctorPatientDao baseDoctorPatientDao;
|
|
|
@Autowired
|
|
|
private BaseUserAgent userAgent;
|
|
|
|
|
|
@Autowired
|
|
@ -222,8 +219,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
@Autowired
|
|
|
private YlzPayService ylzPayService;
|
|
|
@Autowired
|
|
|
private BasePatientMedicareCardDao patientMedicareCardDao;
|
|
|
@Autowired
|
|
|
private PatientMappingDao patientMappingDao;
|
|
|
@Autowired
|
|
|
private WechatDao wechatDao;
|
|
@ -245,6 +240,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
@Autowired
|
|
|
private DictDeptDescDao dictDeptDescDao;
|
|
|
|
|
|
@Autowired
|
|
|
private BaseSensitiveFilterWordsService baseSensitiveFilterWordsService;
|
|
|
@Autowired
|
|
|
private BaseBannerDoctorDao baseBannerDoctorDao;
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${demo.flag}")
|
|
|
private boolean demoFlag;
|
|
|
@Value("${wechat.id}")
|
|
@ -293,6 +295,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patient);
|
|
|
outpatientVO.setSex(patientDO.getSex() + "");
|
|
|
outpatientVO.setBirthday(patientDO.getBirthday());
|
|
|
outpatientVO.setIdcard(patientDO.getIdcard());
|
|
|
return outpatientVO;
|
|
|
}
|
|
|
return null;
|
|
@ -390,7 +393,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}else {
|
|
|
condition = "to_char(o.register_date ,'yyyy-MM-dd hh24:mi:ss' ) AS \"registerDate\",";
|
|
|
}
|
|
|
condition = "to_char(o.register_date ,'yyyy-MM-dd hh24:mi:ss' ) AS \"registerDate\",";
|
|
|
} else {
|
|
|
condition = "date_format(o.register_date ,'%Y-%m-%d %H:%i:%S' ) AS registerDate,";
|
|
|
}
|
|
@ -455,6 +457,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
}
|
|
|
sql += " AND o.outpatient_type != '2' ORDER BY o.create_time DESC ";
|
|
|
logger.info("sql="+sql);
|
|
|
List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params, page, size);
|
|
|
|
|
|
return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
|
|
@ -479,7 +482,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("patientCancelType", outpatientDO.getPatientCancelType());
|
|
|
rs.put("patientCancelValue", outpatientDO.getPatientCancelValue());
|
|
|
rs.put("patientCancelRemark", outpatientDO.getPatientCancelRemark());
|
|
|
rs.put("operator", userAgent.getUID());
|
|
|
rs.put("operator",outpatientDO.getOperator());
|
|
|
//居民详情
|
|
|
BasePatientDO basePatientDO = basePatientDao.findById(outpatientDO.getPatient());
|
|
|
rs.put("patientName", basePatientDO.getName());
|
|
@ -593,7 +596,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
totalSql += " and create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
totalSql += " and create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
totalSql += " and create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
totalSql += " AND create_time >='" + startTime + " 00:00:00'";
|
|
|
}
|
|
@ -601,7 +609,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
totalSql += " and create_time <= to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
totalSql += " and create_time <= str_to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
totalSql += " and create_time <= to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
totalSql += " AND create_time <='" + endTime + " 23:59:59'";
|
|
|
}
|
|
@ -668,14 +680,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
sql += " AND create_time >='" + startTime + " 00:00:00'";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and create_time <= to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and create_time <= str_to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and create_time <= to_date('" + startTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
sql += " AND create_time <='" + endTime + " 23:59:59'";
|
|
|
}
|
|
@ -770,9 +790,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
|
|
|
WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
|
|
|
WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("WX_MONEY");
|
|
|
Double price = 0.0;
|
|
|
if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
|
|
|
price = Double.parseDouble(doctorDO.getFee());
|
|
|
}else {
|
|
|
price = Double.parseDouble(hospitalSysDictDO.getDictValue());
|
|
|
}
|
|
|
if (price == 0.0) {
|
|
|
outpatientDO.setPayStatus(1);
|
|
@ -2113,16 +2136,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
outpatientDao.save(outpatientDO);
|
|
|
//先下单
|
|
|
businessOrderService.savePrescriptionOrder(prescription.getId());
|
|
|
//同步his
|
|
|
ykyyEntranceService.findByRealOrder(prescription.getId(),demoFlag);
|
|
|
List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findById(prescription.getId());
|
|
|
if (prescriptionDOList != null && prescriptionDOList.size() != 0) {
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDOList.get(0);
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
|
|
|
logger.info("cfsb", wlyyPrescriptionDO.getRealOrder());
|
|
|
ykyyService.updateDrugorderInfo(businessOrderDO.getOrderNo(), wlyyPrescriptionDO.getOrderId(), wlyyPrescriptionDO.getRealOrder());
|
|
|
if(!demoFlag){
|
|
|
//同步his
|
|
|
ykyyEntranceService.findByRealOrder(prescription.getId(),demoFlag);
|
|
|
List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findById(prescription.getId());
|
|
|
if (prescriptionDOList != null && prescriptionDOList.size() != 0) {
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDOList.get(0);
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
|
|
|
logger.info("cfsb", wlyyPrescriptionDO.getRealOrder());
|
|
|
ykyyService.updateDrugorderInfo(businessOrderDO.getOrderNo(), wlyyPrescriptionDO.getOrderId(), wlyyPrescriptionDO.getRealOrder());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
result.put("code", 1);
|
|
|
result.put("mes", "诊断完成");
|
|
|
return result;
|
|
@ -2487,7 +2513,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
totalSql += " and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
totalSql += " and e.create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
totalSql += " and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
totalSql += " AND e.create_time >='" + startTime + " 00:00:00'";
|
|
|
}
|
|
@ -2495,7 +2525,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
totalSql += " and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
totalSql += " and e.create_time <= str_to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
totalSql += " and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
totalSql += " AND e.create_time <='" + endTime + " 23:59:59'";
|
|
|
}
|
|
@ -2509,7 +2543,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
String sql = "SELECT ";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql = sql + "to_char(e.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
if (flag){
|
|
|
sql = sql + "date_format(e.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
}else {
|
|
|
sql = sql + "to_char(e.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql = sql + "date_format(e.create_time,'%Y-%m-%d %H:%i:%S' ) AS \"createTime\",";
|
|
|
}
|
|
@ -2537,7 +2576,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and e.create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
sql += " AND e.create_time >='" + startTime + " 00:00:00'";
|
|
|
}
|
|
@ -2545,12 +2588,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endTime)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and e.create_time <= str_to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += " AND e.create_time <='" + endTime + " 23:59:59'";
|
|
|
}
|
|
|
|
|
|
}
|
|
|
sql +=" order by e.create_time desc ";
|
|
|
/* sql += " LIMIT " + (page - 1) * size + "," + size + "";*/
|
|
|
List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, page, size);
|
|
|
for (Map<String, Object> map : list) {
|
|
@ -3038,6 +3087,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("expertise", doctorDO.getExpertise());
|
|
|
rs.put("introduce", doctorDO.getIntroduce());
|
|
|
rs.put("consultStatus", doctorDO.getConsultStatus());// 咨询在线状态
|
|
|
rs.put("img",doctorDO.getImg());//风采图
|
|
|
rs.put("visitHospitalName",doctorDO.getVisitHospitalName());//出诊医院
|
|
|
rs.put("visitHospital",doctorDO.getVisitHospital());
|
|
|
rs.put("background",doctorDO.getBackground());//背景图
|
|
|
rs.put("backgroundId",doctorDO.getBackgroundId());//背景图id
|
|
|
rs.put("visitDeptName",doctorDO.getVisitDeptName());//出诊科室
|
|
|
rs.put("visitDept",doctorDO.getVisitDept());
|
|
|
|
|
|
//机构科室信息
|
|
|
List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
|
|
@ -3140,6 +3196,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
} else {
|
|
|
rs.put("scoreDoctor", null);
|
|
|
}
|
|
|
int count = baseBannerDoctorDao.getTotalBannerCount(doctor);
|
|
|
rs.put("bannerCount",count);
|
|
|
|
|
|
//查询评价明细
|
|
|
String sqlScoreList = "SELECT " +
|
|
@ -3159,12 +3217,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"LEFT JOIN wlyy_consult_team c ON c.consult=b.relation_code AND c.doctor='" + doctor + "' " +
|
|
|
"WHERE a.relation_code=b.id AND b.doctor='" + doctor + "' order by b.create_time DESC ";
|
|
|
List<Map<String, Object>> scoreList = jdbcTemplate.queryForList(sqlScoreList);
|
|
|
|
|
|
if (scoreList != null && scoreList.size() > 0) {
|
|
|
|
|
|
// Set<String> datelist = new HashSet<>();
|
|
|
|
|
|
HashMap<String, List<Map<String, Object>>> waitinglist = new HashMap<>();
|
|
|
/* HashMap<String, List<Map<String, Object>>> waitinglist = new HashMap<>();
|
|
|
|
|
|
if (scoreList != null && scoreList.size() > 0) {
|
|
|
for (Map<String, Object> scorepatient : scoreList) {
|
|
@ -3182,7 +3238,38 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
waitinglist.put(id, _cu);
|
|
|
}
|
|
|
}
|
|
|
}*/
|
|
|
List<com.alibaba.fastjson.JSONArray> waitinglist = new ArrayList<>();
|
|
|
if (scoreList != null && scoreList.size() > 0) {
|
|
|
List<String> stringList = new ArrayList<>();
|
|
|
for (Map<String, Object> scorepatient : scoreList) {
|
|
|
String id = (String) scorepatient.get("id");
|
|
|
if (id == null) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (!stringList.contains(id)){
|
|
|
stringList.add(id);
|
|
|
}
|
|
|
String content = (String)scorepatient.get("content");
|
|
|
if (StringUtils.isNotEmpty(content)){
|
|
|
String replace = baseSensitiveFilterWordsService.filterSensitiveWords(content);
|
|
|
scorepatient.put("content",replace);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
for (String str:stringList){
|
|
|
com.alibaba.fastjson.JSONArray array = new com.alibaba.fastjson.JSONArray();
|
|
|
for (Map<String, Object> scorepatient : scoreList){
|
|
|
String id = (String) scorepatient.get("id");
|
|
|
if (id!=null&&str.equalsIgnoreCase(id)){
|
|
|
array.add(scorepatient);
|
|
|
}
|
|
|
}
|
|
|
waitinglist.add(array);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
rs.put("scoreList", waitinglist);
|
|
|
} else {
|
|
|
rs.put("scoreList", null);
|
|
@ -3192,6 +3279,44 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
public BaseDoctorDO updateDoctorInfo(String id, String img,String background,String expertise,String visitHospital,String visitHospitalName,String visitDept,String visitDeptName,String backgroundId){
|
|
|
if (StringUtils.isNoneBlank(id)){
|
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(id);
|
|
|
if (StringUtils.isNoneBlank(img)){
|
|
|
baseDoctorDO.setImg(img);
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNoneBlank(background)){
|
|
|
baseDoctorDO.setBackground(background);
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNoneBlank(expertise)){
|
|
|
baseDoctorDO.setExpertise(expertise);
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNoneBlank(visitHospital)){
|
|
|
baseDoctorDO.setVisitHospital(visitHospital);
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNoneBlank(visitHospitalName)){
|
|
|
baseDoctorDO.setVisitHospitalName(visitHospitalName);
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNoneBlank(visitDept)){
|
|
|
baseDoctorDO.setVisitDept(visitDept);
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(visitDeptName)){
|
|
|
baseDoctorDO.setVisitDeptName(visitDeptName);
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(backgroundId)){
|
|
|
baseDoctorDO.setBackgroundId(backgroundId);
|
|
|
}
|
|
|
return baseDoctorDao.save(baseDoctorDO);
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public Map<String, Object> findDoctorBaseInfo(String doctor) {
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
|
|
|
|
|
@ -3210,6 +3335,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("townCode", doctorDO.getTownCode());
|
|
|
rs.put("townName", doctorDO.getTownName());
|
|
|
rs.put("consultStatus", doctorDO.getConsultStatus());// 咨询在线状态
|
|
|
rs.put("img",doctorDO.getImg());//风采图
|
|
|
rs.put("visitHospitalName",doctorDO.getVisitHospitalName());//出诊医院
|
|
|
rs.put("visitHospital",doctorDO.getVisitHospital());
|
|
|
rs.put("background",doctorDO.getBackground());//背景图
|
|
|
rs.put("backgroundId",doctorDO.getBackgroundId());//背景图id
|
|
|
rs.put("visitDeptName",doctorDO.getVisitDeptName());//出诊科室
|
|
|
rs.put("visitDept",doctorDO.getVisitDept());
|
|
|
|
|
|
//机构科室信息
|
|
|
List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
|
|
@ -3303,6 +3435,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
//更改门诊状态
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outPatientId);
|
|
|
wlyyOutpatientDO.setStatus("-1");
|
|
|
//报错拒诊操作人
|
|
|
wlyyOutpatientDO.setOperator(userAgent.getUID());
|
|
|
String description = null;
|
|
|
if (1 == operator) {
|
|
|
//居民取消
|
|
@ -3338,12 +3472,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
|
|
|
data.put("type", "9");
|
|
|
msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个图文复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
|
|
|
sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "doctorRefuse", "");
|
|
|
sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "doctorRefuseRemind", "");
|
|
|
}
|
|
|
if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
|
|
|
data.put("type", "16");
|
|
|
msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个视频复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
|
|
|
sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "doctorRefuse", "");
|
|
|
sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "doctorRefuseRemind", "");
|
|
|
}
|
|
|
data.put("msg", msg);
|
|
|
messageDO.setData(data.toString());
|
|
@ -3371,14 +3505,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
|
|
|
businessOrderService.orderRefund(wxId, wlyyOutpatientDO.getPatient(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
|
|
|
} else if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {
|
|
|
/*
|
|
|
businessOrderService.ylzOrderRefund(wxId, wlyyOutpatientDO.getPatient(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
|
|
|
|
|
|
*/
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
rs.put("code", 1);
|
|
|
rs.put("mes", "取消成功");
|
|
|
rs.put("patientName",wlyyOutpatientDO.getPatientName());
|
|
|
rs.put("doctor",wlyyOutpatientDO.getDoctor());
|
|
|
rs.put("doctorName",wlyyOutpatientDO.getDoctorName());
|
|
|
rs.put("patientCode",wlyyOutpatientDO.getPatient());
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
@ -3394,10 +3533,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
BaseDoctorDO consDoctorDO = new BaseDoctorDO();
|
|
|
BasePatientDO consPatientDO = new BasePatientDO();
|
|
|
BaseDoctorHospitalDO hospitalDO = new BaseDoctorHospitalDO();
|
|
|
//获取咨询的信息
|
|
|
String msgUrl="";
|
|
|
if (consultTeam!=null){
|
|
|
consDoctorDO = baseDoctorDao.findById(consultTeam.getDoctor());
|
|
|
consPatientDO = basePatientDao.findById(consultTeam.getPatient());
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(consultTeam.getDoctor());
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()>=0){
|
|
|
hospitalDO=doctorHospitalDOS.get(0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
WlyyOutpatientDO outpatientDO = new WlyyOutpatientDO();
|
|
@ -3409,6 +3554,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
patientDO = basePatientDao.findById(outpatientDO.getPatient());
|
|
|
}
|
|
|
|
|
|
logger.info("titelType:"+titelType+"&&remindMsg:"+remindMsg+"&&type"+type);
|
|
|
|
|
|
|
|
|
String contentMsg = "";
|
|
|
String first = "";
|
|
@ -3423,74 +3570,108 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
contentMsg = "您的视频复诊订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理";
|
|
|
first = outpatientDO.getPatientName() + ",您好!您的视频复诊已取消";
|
|
|
}
|
|
|
|
|
|
logger.info("doctorRefuseRemind医生拒诊入参:outpatientId="+outpatientId);
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
|
} else if ("payRemind".equalsIgnoreCase(titelType)) {
|
|
|
|
|
|
if ("9".equals(type)) {
|
|
|
contentMsg = "您有一个图文复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = outpatientDO.getPatientName() + ",您好!您有一个图文复诊订单待支付,请及时支付。";
|
|
|
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
|
logger.info("图文复诊订单待支付微信消息模板推送开始");
|
|
|
} else if ("16".equals(type)) {
|
|
|
contentMsg = "您有一个视频复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = outpatientDO.getPatientName() + ",您好!您有一个视频复诊订单待支付,请及时支付。";
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
|
logger.info("视频复诊订单待支付微信消息模板推送开始");
|
|
|
}
|
|
|
if ("1".equals(type)) {
|
|
|
contentMsg = "您有一个图文咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = consPatientDO.getName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
|
|
|
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();
|
|
|
logger.info("视频咨询订单待支付微信消息模板推送开始");
|
|
|
}
|
|
|
|
|
|
} else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
|
|
|
first = outpatientDO.getPatientName() + ",您好! 医生已为您开具处方,请及时支付。";
|
|
|
contentMsg = "医生已为您开具处方,请及时支付。";
|
|
|
remark = "点击完成支付,如您已支付请忽略本条信息";
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+outpatientId;
|
|
|
logger.info("处方支付微信消息模板推送开始");
|
|
|
} else if ("msgRemind".equalsIgnoreCase(titelType)) {
|
|
|
first = outpatientDO.getPatientName() + ",您好!";
|
|
|
contentMsg = "" + remindMsg;
|
|
|
remark = "请您尽快回复";
|
|
|
} else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
|
|
|
first = doctorDO.getName() + doctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
|
|
|
if ("16".equals(type)) {
|
|
|
contentMsg = "您的视频复诊已开始,错过将重新排队";
|
|
|
remark = "点击消息进入视频诊室接听视频通话,开始视频咨询。";
|
|
|
} else if ("17".equals(type)) {
|
|
|
contentMsg = "您的视频咨询已开始,错过将重新排队";
|
|
|
remark = "点击消息进入视频诊室接听视频通话,开始视频复诊。";
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(outpatientId)){
|
|
|
if ("16".equals(type)) {
|
|
|
first = doctorDO.getName() + doctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
|
|
|
contentMsg = "您的视频复诊已开始,错过将重新排队";
|
|
|
remark = "点击消息进入视频诊室接听视频通话,开始视频咨询。";
|
|
|
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 = "点击消息进入视频诊室接听视频通话,开始视频复诊。";
|
|
|
msgUrl="/ims-wx/index.html#/zx/prechat?consultCode="+consultTeam.getConsult();
|
|
|
logger.info("视频咨询已接诊提醒微信模板消息发送开始");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
|
|
|
|
|
|
if ("16".equals(type)) {
|
|
|
first = "您的视频复诊已预约成功。";
|
|
|
contentMsg = "预计" + outpatientDO.getDoctorName() + "医生将于" + DateUtil.dateToStrLong(outpatientDO.getRegisterDate()) + " 与您进行视频复诊。请留意微信公众号消息。";
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/preChat?type=16&outpatientId="+outpatientId;
|
|
|
logger.info("视频复诊已预约成功微信消息模板推送开始");
|
|
|
} else if ("17".equals(type)) {
|
|
|
first = "您的视频咨询已预约成功。";
|
|
|
contentMsg = "预计" + consDoctorDO.getName() + "医生将于" + DateUtil.dateToStrLong(consultTeam.getCzrq()) + " 与您进行视频咨询。请留意微信公众号消息。";
|
|
|
msgUrl="/ims-wx/index.html#/zx/prechat?consultCode="+consultTeam.getConsult();
|
|
|
logger.info("视频咨询已预约成功微信消息模板推送开始");
|
|
|
}
|
|
|
|
|
|
remark = "咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
|
|
|
} else if ("evaluateRemind".equalsIgnoreCase(titelType)) {
|
|
|
if (consultTeam.getType()!=null&&1==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条图文咨询已结束,请及时对咨询医生进行评价。";
|
|
|
logger.info("图文咨询服务评价微信消息模板推送开始");
|
|
|
}
|
|
|
if (consultTeam.getType()!=null&&9==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条图文复诊已结束,请及时对咨询医生进行评价。";
|
|
|
logger.info("图文复诊服务评价微信消息模板推送开始");
|
|
|
}
|
|
|
if (consultTeam.getType()!=null&&16==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条视频复诊已结束,请及时对咨询医生进行评价。";
|
|
|
logger.info("视频复诊服务评价微信消息模板推送开始");
|
|
|
}
|
|
|
if (consultTeam.getType()!=null&&17==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条视频咨询已结束,请及时对咨询医生进行评价。";
|
|
|
logger.info("视频咨询服务评价微信消息模板推送开始");
|
|
|
}
|
|
|
contentMsg = "请对" + consDoctorDO.getName() + "医生的服务进行评价";
|
|
|
msgUrl="/ims-wx/index.html#/fuwupingjia?consultCode="+consultTeam.getConsult();
|
|
|
}
|
|
|
|
|
|
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wxId)) {
|
|
|
List<BasePatientWechatDo> ps = new ArrayList<BasePatientWechatDo>();
|
|
|
if (StringUtils.isNotEmpty(outpatientId)){
|
|
|
ps = basePatientWechatDao.findByWechatIdAndPatientId(wxId, outpatientDO.getPatient());
|
|
|
}
|
|
|
if (consultTeam!=null){
|
|
|
ps = basePatientWechatDao.findByWechatIdAndPatientId(wxId, consultTeam.getPatient());
|
|
|
}
|
|
|
|
|
|
List<BasePatientWechatDo> ps = basePatientWechatDao.findByWechatIdAndPatientId(wxId, outpatientDO.getPatient());
|
|
|
if (ps.isEmpty()) {
|
|
|
logger.info("该用户" + outpatientDO.getPatientName() + "没有openid,无法推送模版消息,用户ID:" + outpatientDO.getPatient() + "wechatId:" + wxId);
|
|
|
return;
|
|
@ -3510,28 +3691,47 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
newConfig.setKeyword1(config.getKeyword1() + outpatientDO.getHospitalName());
|
|
|
newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getDoctorName());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + doctorDO.getFee());
|
|
|
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
logger.info("眼科微信消息模板推送 医生拒诊开始");
|
|
|
} else if ("payRemind".equalsIgnoreCase(titelType)) {
|
|
|
scene = "zxzfts";
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_pay_notice", scene, 1);
|
|
|
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
|
|
|
if ("9".equals(type)) {
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + "图文复诊支付");
|
|
|
} else if ("16".equals(type)) {
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + "视频复诊支付");
|
|
|
} else if ("1".equals(type)) {
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "图文咨询"));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + "图文咨询支付");
|
|
|
} else if ("17".equals(type)) {
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + "视频咨询支付");
|
|
|
//就诊支付
|
|
|
if (StringUtils.isNotEmpty(outpatientId)){
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_pay_notice_jz", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
|
|
|
if ("9".equals(type)) {
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + "图文复诊支付");
|
|
|
} else if ("16".equals(type)) {
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + "视频复诊支付");
|
|
|
}
|
|
|
newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getHospitalName());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + 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(config.getKeyword1() + "图文咨询支付");
|
|
|
} else if ("17".equals(type)) {
|
|
|
newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + "视频咨询支付");
|
|
|
}
|
|
|
newConfig.setKeyword2(config.getKeyword2() + hospitalDO.getOrgName());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + consDoctorDO.getName());
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
|
|
|
logger.info("眼科微信消息模板推送 咨询支付提醒开始");
|
|
|
}
|
|
|
newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getHospitalName());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + outpatientDO.getDoctorName());
|
|
|
|
|
|
} else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
|
|
|
scene = "cfzfts";
|
|
@ -3542,6 +3742,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
newConfig.setKeyword1(config.getKeyword1() + "处方支付");
|
|
|
newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getHospitalName());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + outpatientDO.getDoctorName());
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
logger.info("眼科微信消息模板推送 处方支付提醒开始");
|
|
|
} else if ("msgRemind".equalsIgnoreCase(titelType)) {
|
|
|
scene = "zxxxtx";
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_msg_notice", scene, 1);
|
|
@ -3549,52 +3752,110 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + remindMsg);
|
|
|
newConfig.setKeyword2(config.getKeyword2() + DateUtil.getStringDate());
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
} else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
|
|
|
scene = "mzxxtx";
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_msg_notice", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
|
|
|
newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
|
|
|
newConfig.setFirst(config.getFirst().replace("key2", doctorDO.getJobTitleName()));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + outpatientDO.getDoctorName());
|
|
|
newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getAdmDate());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + outpatientDO.getDeptName());
|
|
|
newConfig.setKeyword4(config.getKeyword4() + outpatientDO.getIcd10Name());
|
|
|
if ("16".equals(type)) {
|
|
|
newConfig.setRemark(config.getRemark().replaceFirst("key1", "视频复诊"));
|
|
|
} else if ("17".equals(type)) {
|
|
|
newConfig.setRemark(config.getRemark().replaceFirst("key1", "视频咨询"));
|
|
|
if (StringUtils.isNotEmpty(outpatientId)){
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_msg_notice_jz", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
|
|
|
newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getDoctorName()).replace("key2", doctorDO.getJobTitleName()));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + outpatientDO.getDoctorName());
|
|
|
newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getAdmDate());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + outpatientDO.getDeptName());
|
|
|
newConfig.setKeyword4(config.getKeyword4() + outpatientDO.getIcd10Name());
|
|
|
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() + "" + 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(config.getKeyword1() + consDoctorDO.getName());
|
|
|
newConfig.setKeyword2(config.getKeyword2() + consultTeam.getCzrq());//咨询暂无挂号时间
|
|
|
newConfig.setKeyword3(config.getKeyword3() + hospitalDO.getDeptName());
|
|
|
newConfig.setKeyword4(config.getKeyword4() + 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("眼科微信消息模板推送 视频咨询接诊提醒开始");
|
|
|
}
|
|
|
|
|
|
} else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
|
|
|
scene = "spwzyytx";
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_video_notice", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
if ("16".equals(type)) {
|
|
|
newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频复诊"));
|
|
|
} else if ("17".equals(type)) {
|
|
|
newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频咨询"));
|
|
|
|
|
|
if (StringUtils.isNotEmpty(outpatientId)){
|
|
|
WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_video_notice_fz", scene, 1);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
if ("16".equals(type)) {
|
|
|
newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频复诊"));
|
|
|
}
|
|
|
newConfig.setKeyword1(config.getKeyword1() + outpatientDO.getPatientName());
|
|
|
newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getDeptName());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + outpatientDO.getDoctorName());
|
|
|
newConfig.setKeyword4(config.getKeyword4() + outpatientDO.getRegisterDate());
|
|
|
newConfig.setKeyword5(config.getKeyword5() + generalDoctorWaitingNumber(doctorDO.getId(), wxId, outpatientId));
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
logger.info("眼科微信消息模板推送 视频问诊预约提醒开始");
|
|
|
}
|
|
|
newConfig.setKeyword1(config.getKeyword1() + outpatientDO.getPatientName());
|
|
|
newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getDeptName());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + outpatientDO.getDoctorName());
|
|
|
newConfig.setKeyword4(config.getKeyword4() + outpatientDO.getRegisterDate());
|
|
|
newConfig.setKeyword5(config.getKeyword5() + generalDoctorWaitingNumber(doctorDO.getId(), wxId, outpatientId));
|
|
|
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", "视频咨询"));
|
|
|
}
|
|
|
newConfig.setKeyword1(config.getKeyword1() + consPatientDO.getName());
|
|
|
newConfig.setKeyword2(config.getKeyword2() + hospitalDO.getDeptName());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + consDoctorDO.getName());
|
|
|
newConfig.setKeyword4(config.getKeyword4() + consultTeam.getCzrq());
|
|
|
newConfig.setKeyword5(config.getKeyword5() + 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);
|
|
|
BeanUtils.copyProperties(config, newConfig);
|
|
|
newConfig.setFirst(config.getFirst().replaceFirst("key1", outpatientDO.getPatientName()));
|
|
|
newConfig.setKeyword1(config.getKeyword1() + outpatientDO.getHospitalName());
|
|
|
newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getDoctorName());
|
|
|
newConfig.setFirst(config.getFirst().replaceFirst("key1", consPatientDO.getName()));
|
|
|
newConfig.setKeyword2(config.getKeyword2() + hospitalDO.getOrgName());
|
|
|
newConfig.setKeyword3(config.getKeyword3() + consDoctorDO.getName());
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
|
|
|
logger.info("眼科微信消息模板推送 服务评价提醒开始");
|
|
|
}
|
|
|
|
|
|
//发起微信消息模板推送
|
|
|
newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
|
|
|
|
|
|
logger.info("=======setUrl========" + newConfig.getUrl());
|
|
|
WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
|
|
|
|
|
|
for (BasePatientWechatDo one : ps) {
|
|
|
weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), one.getOpenid(), newConfig);
|
|
|
logger.info("发送的消息="+ com.alibaba.fastjson.JSONObject.toJSONString(newConfig));
|
|
|
try {
|
|
|
logger.info("调用眼科微信模板消息接口的入参:AccessToken="+wxAccessTokenDO.getAccessToken()+"---Openid="+one.getOpenid());
|
|
|
weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), one.getOpenid(), newConfig);
|
|
|
logger.info("发送成功");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
logger.info("发送失败,error="+e.getMessage());
|
|
|
}
|
|
|
|
|
|
//保存发送模板记录,
|
|
|
WxPushLogDO wxPushLogDO = new WxPushLogDO();
|
|
|
wxPushLogDO.setCreateTime(new Date());
|
|
@ -3608,28 +3869,66 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
} else if ("xm_xzzx_wx".equalsIgnoreCase(wxId)) {
|
|
|
|
|
|
String MsgUrl = "https://www.xmheart.com/ims-wx/index.html#/returnVisit/record?outpatientId=" + outpatientDO.getPatient();
|
|
|
|
|
|
String responseMsg = xzzxEntranceService.sendXCXMes(wxId,
|
|
|
patientDO.getId(),
|
|
|
patientDO.getIdcard(),
|
|
|
first,
|
|
|
contentMsg,
|
|
|
remark,
|
|
|
MsgUrl,
|
|
|
"wx53f6bb4ac081d840");
|
|
|
String responseMsg="";
|
|
|
String prefix="https://www.xmheart.com";
|
|
|
if(StringUtils.isNotEmpty(outpatientId)){
|
|
|
responseMsg = xzzxEntranceService.sendXCXMes(wxId,
|
|
|
patientDO.getId(),
|
|
|
patientDO.getIdcard(),
|
|
|
first,
|
|
|
contentMsg,
|
|
|
remark,
|
|
|
prefix+msgUrl,
|
|
|
"wx53f6bb4ac081d840");
|
|
|
}
|
|
|
|
|
|
if (consultTeam!=null&&consPatientDO!=null){
|
|
|
responseMsg = xzzxEntranceService.sendXCXMes(wxId,
|
|
|
consPatientDO.getId(),
|
|
|
consPatientDO.getIdcard(),
|
|
|
first,
|
|
|
contentMsg,
|
|
|
remark,
|
|
|
prefix+msgUrl,
|
|
|
"wx53f6bb4ac081d840");
|
|
|
}
|
|
|
|
|
|
logger.info("url="+prefix+msgUrl);
|
|
|
String msg="first:"+first+"contentMsg:"+contentMsg+"remark:"+remark;
|
|
|
logger.info("发送的信息="+msg);
|
|
|
logger.info("XZZX_Msg_" + titelType + "=" + responseMsg);
|
|
|
|
|
|
} else if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {
|
|
|
String MsgUrl = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId=" + outpatientDO.getPatient();
|
|
|
String responseMsg = entranceService.ehospitalNotice(patientDO.getName(),
|
|
|
patientDO.getIdcard(),
|
|
|
patientDO.getMobile(),
|
|
|
first,
|
|
|
MsgUrl,
|
|
|
contentMsg,
|
|
|
remark
|
|
|
);
|
|
|
if ("prescriptionPayRemind".equalsIgnoreCase(titelType)){
|
|
|
return;
|
|
|
}
|
|
|
String responseMsg="";
|
|
|
String prefix="https://hlwyy.xmzsh.com";
|
|
|
if(StringUtils.isNotEmpty(outpatientId)){
|
|
|
responseMsg = entranceService.ehospitalNotice(
|
|
|
patientDO.getName(),
|
|
|
patientDO.getIdcard(),
|
|
|
patientDO.getMobile(),
|
|
|
first,
|
|
|
prefix+msgUrl,
|
|
|
contentMsg,
|
|
|
remark
|
|
|
);
|
|
|
}
|
|
|
if (consultTeam!=null&&consPatientDO!=null){
|
|
|
responseMsg = entranceService.ehospitalNotice(
|
|
|
consPatientDO.getName(),
|
|
|
consPatientDO.getIdcard(),
|
|
|
consPatientDO.getMobile(),
|
|
|
first,
|
|
|
prefix+msgUrl,
|
|
|
contentMsg,
|
|
|
remark
|
|
|
);
|
|
|
}
|
|
|
logger.info("url="+prefix+msgUrl);
|
|
|
String msg="first:"+first+"-----contentMsg:"+contentMsg+"-----remark:"+remark;
|
|
|
logger.info("发送的信息="+msg);
|
|
|
logger.info("ZSYY_Msg" + titelType + "=" + responseMsg);
|
|
|
}
|
|
|
}
|
|
@ -3724,7 +4023,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"patient.birthday AS \"birthday\"," +
|
|
|
"room.consult_type AS \"consult_type\",";
|
|
|
if ("xm_ykyy_wx".equals(wechatId)) {
|
|
|
sql += "to_char(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\",";
|
|
|
if(flag){
|
|
|
sql += "date_format(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\",";
|
|
|
}else {
|
|
|
sql += "to_char(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format,";
|
|
|
}
|
|
@ -3767,7 +4071,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
sql += " AND outpatient.dept='" + dept + "' ";
|
|
|
}
|
|
|
|
|
|
|
|
|
logger.info("接口名称:findWaitingRoomOutpatientByDoctor-->sql="+sql);
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
if (list != null && list.size() > 0) {
|
|
|
//根据身份证计算年龄
|
|
@ -3812,8 +4116,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
String totalSql = "SELECT count(id) AS \"total\" FROM wlyy_hospital_waiting_room WHERE visit_status=1 ";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
totalSql += " and reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
totalSql += " and reservation_time <= to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
totalSql += " and reservation_time >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
totalSql += " and reservation_time <= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
} else {
|
|
|
totalSql += " and reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
totalSql += " and reservation_time <= to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
totalSql += " AND reservation_time >='" + DateUtil.dateToStrShort(new Date()) + " 00:00:00'";
|
|
|
totalSql += " AND reservation_time <='" + DateUtil.dateToStrShort(new Date()) + " 23:59:59'";
|
|
@ -3884,8 +4194,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
waitingSql += " AND room.reservation_time >= to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
waitingSql += " AND room.reservation_time <= to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') GROUP BY room.doctor,room.doctor_name";
|
|
|
if (flag){
|
|
|
waitingSql += " AND room.reservation_time >= str_to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
waitingSql += " AND room.reservation_time <= str_to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') GROUP BY room.doctor,room.doctor_name";
|
|
|
}else {
|
|
|
waitingSql += " AND room.reservation_time >= to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
waitingSql += " AND room.reservation_time <= to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') GROUP BY room.doctor,room.doctor_name";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
waitingSql = waitingSql + "AND room.reservation_time>='" + date + " 00:00:00' AND room.reservation_time<='" + date + " 23:59:59' GROUP BY room.doctor,room.doctor_name; ";
|
|
|
}
|
|
@ -3928,7 +4244,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"patient.birthday AS \"birthday\"," +
|
|
|
"room.consult_type AS \"consult_type\",";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
onlineSql = onlineSql + "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",ceil((sysdate-to_date(to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'))* 24 * 60) AS \"time_cost\",";
|
|
|
if(flag){
|
|
|
onlineSql = onlineSql + "date_format(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",ceil((sysdate-to_date(date_format(room.reservation_time,'YYYY-MM-DD hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'))* 24 * 60) AS \"time_cost\",";
|
|
|
}else {
|
|
|
onlineSql = onlineSql + "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",ceil((sysdate-to_date(to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss'))* 24 * 60) AS \"time_cost\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
onlineSql = onlineSql + "date_format(room.reservation_time,'%Y-%m-%d %H:%i:%S' ) AS \"time\",TIMESTAMPDIFF(MINUTE, room.reservation_time,NOW()) AS \"time_cost\",";
|
|
|
}
|
|
@ -3953,8 +4274,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
onlineSql = onlineSql+ "AND room.reservation_time>='"+date+" 00:00:00' AND room.reservation_time<='"+date+" 23:59:59' GROUP BY room.doctor";
|
|
|
*/
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wxId)) {
|
|
|
onlineSql += " AND room.reservation_time >= to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
onlineSql += " AND room.reservation_time <= to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') ";
|
|
|
if (flag){
|
|
|
onlineSql += " AND room.reservation_time >= str_to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
onlineSql += " AND room.reservation_time <= str_to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') ";
|
|
|
}else {
|
|
|
onlineSql += " AND room.reservation_time >= to_date('" + date + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
onlineSql += " AND room.reservation_time <= to_date('" + date + " 23:59:59','YYYY-MM-DD HH24:MI:SS') ";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
onlineSql = onlineSql + "AND room.reservation_time>='" + date + " 00:00:00' AND room.reservation_time<='" + date + " 23:59:59' ";
|
|
|
}
|
|
@ -4175,7 +4502,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
params.put("endTime", date);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(orgCode)) {
|
|
|
sql += " AND h.org_code = :orgCode";
|
|
|
sql += " AND h.org_code =:orgCode";
|
|
|
params.put("orgCode", orgCode);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(diseaseKey)) {
|
|
@ -4189,7 +4516,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(dept)) {
|
|
|
sql += " AND h.dept_code = :dept ";
|
|
|
sql += " AND h.dept_code =:dept ";
|
|
|
params.put("dept", dept);
|
|
|
|
|
|
}
|
|
@ -4552,7 +4879,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if (one.getEndTime().before(workTimeDO.getStartTime()) || one.getStartTime().after(workTimeDO.getEndTime())) {
|
|
|
|
|
|
} else {
|
|
|
throw new Exception("您选择的时间与“开始时间-结束时间”的医院排班/自己排班冲突,请重新选择!");
|
|
|
throw new Exception("您选择的时间与“开始时间:"+DateUtil.dateToStrLong(one.getStartTime())+"-结束时间:"+DateUtil.dateToStrLong(one.getEndTime())+"”的医院排班/自己排班冲突,请重新选择!");
|
|
|
}
|
|
|
|
|
|
}
|
|
@ -4753,7 +5080,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public List<Map<String, Object>> getVideoPrescriptionByDoctor(String doctor, String general_doctor, String wxId) {
|
|
|
String condition = "";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
if (flag){
|
|
|
condition += "date_format(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
}else {
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
condition += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS \"time\",";
|
|
|
}
|
|
@ -4819,8 +5151,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public String generalDoctorWaitingNumber(String doctor, String wxId, String outpatientId) {
|
|
|
String condition = "";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
if (flag){
|
|
|
condition += "date_format(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "date_format(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
}else {
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
condition += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS \"time\",";
|
|
|
condition += "date_format(room.reservation_time ,'%Y-%m-%d' ) AS \"group_date\",";
|
|
@ -4857,7 +5195,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
// "AND room.reservation_time>='"+DateUtil.getStringDate("yyyy-MM-dd")+" 00:00:00"+"' ";*/
|
|
|
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " AND room.reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if(flag){
|
|
|
sql += " AND room.reservation_time >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " AND room.reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += " AND room.reservation_time >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
|
|
|
}
|
|
@ -4877,8 +5220,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public com.alibaba.fastjson.JSONArray getWaitingForVisitVideoPrescriptionByDoctor(String doctor, String wxId) {
|
|
|
String condition = "";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
if(flag){
|
|
|
condition += "date_format(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "date_format(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
}else{
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
condition += "to_char(room.reservation_time,'YYYY-MM-DD') AS \"group_date\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
condition += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS \"time\",";
|
|
|
condition += "date_format(room.reservation_time ,'%Y-%m-%d' ) AS \"group_date\",";
|
|
@ -4915,7 +5264,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
// "AND room.reservation_time>='"+DateUtil.getStringDate("yyyy-MM-dd")+" 00:00:00"+"' ";*/
|
|
|
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " AND room.reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if(flag){
|
|
|
sql += " AND room.reservation_time >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " AND room.reservation_time >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += " AND room.reservation_time >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
|
|
|
}
|
|
@ -5104,14 +5458,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
System.out.println("获取顺丰物流面单信息:6");
|
|
|
|
|
|
}
|
|
|
wlyyPrescriptionDOS.setStatus(32);
|
|
|
prescriptionDao.save(wlyyPrescriptionDOS);
|
|
|
|
|
|
if (sfexpress_obj != null && StringUtils.isNoneBlank(sfexpress_obj.getMailno())) {
|
|
|
com.alibaba.fastjson.JSONObject object = sfexpressService.postSFOrderQueryService(sfexpress_obj);
|
|
|
System.out.println("获取顺丰物流面单信息7-1"+object.toJSONString());
|
|
|
System.out.println("获取顺丰物流面单信息:7");
|
|
|
com.alibaba.fastjson.JSONObject sfJsonObject = new com.alibaba.fastjson.JSONObject();
|
|
|
|
|
|
sfJsonObject.put("mailno", sfexpress_obj.getMailno());
|
|
|
sfJsonObject.put("mailtype", "标准快递");
|
|
|
sfJsonObject.put("destcode", "592");
|
|
|
sfJsonObject.put("destcode", object.getString("destRouteLabel"));
|
|
|
if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {
|
|
|
sfJsonObject.put("j_name", "厦门大学附属中山医院");
|
|
|
sfJsonObject.put("j_phone", "4003008888");
|
|
@ -5140,11 +5498,121 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
System.out.println("获取顺丰物流面单信息:8");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
System.out.println("获取顺丰物流面单信息:9");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据门诊唯一号,处方号,到顺丰下单,下单成功返回面单信息--心脏和眼科
|
|
|
*
|
|
|
* @param admNo 门诊唯一号
|
|
|
* @param realOrder 处方号
|
|
|
* @return
|
|
|
*/
|
|
|
public Object getSFExpressInfoNew(String admNo, String realOrder, String wxId) throws Exception {
|
|
|
|
|
|
//根据门诊唯一号取就诊记录
|
|
|
// List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByAdmNo(admNo);
|
|
|
|
|
|
if (StringUtils.isNoneBlank(realOrder)){
|
|
|
String str[] = realOrder.split(";");
|
|
|
Object result = "";
|
|
|
for (int i=0;i<str.length;i++){
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDOS = prescriptionDao.findByAdmNoAndRealOrder(admNo,str[i]);
|
|
|
System.out.println("获取顺丰物流面单信息:wlyyPrescriptionDOS != null=" + wlyyPrescriptionDOS != null);
|
|
|
if (wlyyPrescriptionDOS != null) {
|
|
|
List<WlyyPrescriptionExpressageDO> expressageDOList = sfexpressService.findByField("outpatientId", wlyyPrescriptionDOS.getOutpatientId());
|
|
|
WlyyPrescriptionExpressageDO sfexpress_obj = null;
|
|
|
System.out.println("获取顺丰物流面单信息:CollectionUtils.isEmpty(expressageDOList)=" + CollectionUtils.isEmpty(expressageDOList));
|
|
|
if (CollectionUtils.isEmpty(expressageDOList)) {
|
|
|
throw new Exception("顺丰快递下单失败,未找到该处方的派送地址!");
|
|
|
} else {
|
|
|
System.out.println("获取顺丰物流面单信息:1");
|
|
|
sfexpress_obj = expressageDOList.get(0);
|
|
|
System.out.println("获取顺丰物流面单信息:2");
|
|
|
BasePatientDO basePatientDO = basePatientDao.findById(wlyyPrescriptionDOS.getPatientCode());
|
|
|
//如果该处方的快递单号已生成,则说明已经下单成功,不需要重复下单,直接返回面单信息
|
|
|
System.out.println("获取顺丰物流面单信息:3");
|
|
|
if (org.apache.commons.lang.StringUtils.isNotBlank(sfexpress_obj.getMailno())) {
|
|
|
//处方已下单成功
|
|
|
System.out.println("获取顺丰物流面单信息:4");
|
|
|
} else {
|
|
|
//如果该处方的快递单号未生成,则继续下单
|
|
|
//根据业务订单号判断是否已经下单成功
|
|
|
//--2020.05.20--顺丰V2.0接口已不提供查询接口,直接单下单--START
|
|
|
// boolean go_on = sfexpressService.sfOrderSearchService(sfexpress_obj);
|
|
|
//
|
|
|
// //如果该业务订单号未下单成功过,则重新下单
|
|
|
// if(go_on){
|
|
|
// //请求顺丰接口下单,成功下单后,返回快递单号
|
|
|
// sfexpress_obj = sfexpressService.postSFOrderService(sfexpress_obj);
|
|
|
// //保存快递单号和增加处方物流记录为配送
|
|
|
// sfexpressService.updatePrescriptionExpressage(sfexpress_obj);
|
|
|
// }
|
|
|
//--2020.05.20--顺丰V2.0接口已不提供查询接口,直接单下单--END
|
|
|
|
|
|
//请求顺丰接口下单,成功下单后,返回快递单号
|
|
|
sfexpress_obj = sfexpressService.postSFOrderService(sfexpress_obj);
|
|
|
System.out.println("获取顺丰物流面单信息:5");
|
|
|
//保存快递单号和增加处方物流记录为配送
|
|
|
sfexpressService.updatePrescriptionExpressage(sfexpress_obj);
|
|
|
System.out.println("获取顺丰物流面单信息:6");
|
|
|
|
|
|
}
|
|
|
wlyyPrescriptionDOS.setStatus(32);
|
|
|
prescriptionDao.save(wlyyPrescriptionDOS);
|
|
|
if (sfexpress_obj != null && StringUtils.isNoneBlank(sfexpress_obj.getMailno())) {
|
|
|
com.alibaba.fastjson.JSONObject object = sfexpressService.postSFOrderQueryService(sfexpress_obj);
|
|
|
System.out.println("获取顺丰物流面单信息7-1"+object.toJSONString());
|
|
|
System.out.println("获取顺丰物流面单信息:7");
|
|
|
/* com.alibaba.fastjson.JSONObject sfJsonObject = new com.alibaba.fastjson.JSONObject();*/
|
|
|
|
|
|
/*sfJsonObject.put("mailno", sfexpress_obj.getMailno());
|
|
|
sfJsonObject.put("mailtype", "标准快递");
|
|
|
sfJsonObject.put("destcode", object.getString("destRouteLabel"));
|
|
|
if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {
|
|
|
sfJsonObject.put("j_name", "厦门大学附属中山医院");
|
|
|
sfJsonObject.put("j_phone", "4003008888");
|
|
|
sfJsonObject.put("j_townName", "思明区");
|
|
|
sfJsonObject.put("j_address", "湖滨南路201-209号");
|
|
|
} else if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
|
|
|
sfJsonObject.put("j_name", "厦门大学附属中山医院");
|
|
|
sfJsonObject.put("j_phone", "4003008888");
|
|
|
sfJsonObject.put("j_townName", "思明区");
|
|
|
sfJsonObject.put("j_address", "湖滨南路201-209号");
|
|
|
}
|
|
|
|
|
|
sfJsonObject.put("j_provinceName", "福建省");
|
|
|
sfJsonObject.put("j_cityName", "厦门市");
|
|
|
sfJsonObject.put("d_name", sfexpress_obj.getName());
|
|
|
sfJsonObject.put("d_provinceName", sfexpress_obj.getProvinceName());
|
|
|
sfJsonObject.put("d_cityName", sfexpress_obj.getCityName());
|
|
|
sfJsonObject.put("d_townName", sfexpress_obj.getTownName());
|
|
|
sfJsonObject.put("d_address", sfexpress_obj.getAddress());
|
|
|
sfJsonObject.put("d_phone", sfexpress_obj.getMobile());
|
|
|
sfJsonObject.put("express_type", 11);
|
|
|
sfJsonObject.put("pay_method", 2);
|
|
|
sfJsonObject.put("receive_time", "");
|
|
|
sfJsonObject.put("dispensaryType", 2);*/
|
|
|
result = object;
|
|
|
System.out.println("获取顺丰物流面单信息:8");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
System.out.println("获取顺丰物流面单信息:9");
|
|
|
|
|
|
}
|
|
|
return result;
|
|
|
}else {
|
|
|
return "处方号未空!";
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据类型获取候诊居民数量
|
|
|
*
|
|
@ -5161,7 +5629,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"base_patient patient " +
|
|
|
"WHERE " +
|
|
|
"outpatient.patient=patient.id " +
|
|
|
"AND outpatient.status in (0,1) " +
|
|
|
"AND outpatient.status in (0,1,2) " +
|
|
|
"AND outpatient.doctor='" + doctor + "' " +
|
|
|
"AND outpatient.pay_status = 1 " +
|
|
|
"AND outpatient.outpatient_type= '" + outpatient_type + "' ";
|
|
@ -5169,7 +5637,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
sql = sql + " AND outpatient.type= '" + type + "' ";
|
|
|
if ("2".equals(type)) {//视频复诊才需要判断时间,
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
} else {
|
|
|
sql = sql + " AND outpatient.register_date is not null AND outpatient.register_date >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
|
|
|
}
|
|
@ -5177,11 +5649,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
} else if ("2".equals(outpatient_type)) {
|
|
|
//协同门诊也需要判断时间
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql = sql + " AND outpatient.register_date is not null AND outpatient.register_date >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
|
|
|
}
|
|
|
}
|
|
|
logger.info("接口名称:doctorReviewConsultCount-->sql="+sql);
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
Long waitVideoCount = 0l;
|
|
@ -5252,6 +5730,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
outpatientDO.setIdcard(patientDO.getIdcard());
|
|
|
outpatientDO.setOutpatientType("2");
|
|
|
outpatientDO.setCreateTime(new Date());
|
|
|
outpatientDO.setPayStatus(1);
|
|
|
|
|
|
if (outpatientDO.getRegisterDate() == null) {
|
|
|
outpatientDO.setRegisterDate(new Date());
|
|
@ -5386,10 +5865,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if (consultTeamDo!=null){
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findById(consultTeamDo.getDoctor());
|
|
|
BasePatientDO patientDO = basePatientDao.findById(consultTeamDo.getPatient());
|
|
|
if (consultTeamDo.getType().equals("17")){
|
|
|
if (consultTeamDo.getType()==17){
|
|
|
type = "17";
|
|
|
msg = patientDO.getName() + ",您好!您有一个视频咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
|
|
|
}else if (consultTeamDo.getType().equals("1")){
|
|
|
}else if (consultTeamDo.getType()==1){
|
|
|
type = "1";
|
|
|
msg = patientDO.getName() + ",您好!您有一个图文咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
|
|
|
}
|
|
@ -5475,6 +5954,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
room.setDeptName(outpatientDO.getDeptName());
|
|
|
room.setDoctor(outpatientDO.getDoctor());
|
|
|
room.setDoctorName(outpatientDO.getDoctorName());
|
|
|
room.setConsultType(Integer.parseInt(outpatientDO.getType()));
|
|
|
room.setChargeType(chargeType);
|
|
|
}
|
|
|
hospitalWaitingRoomDao.save(roomDOs);
|
|
@ -5597,7 +6077,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if (StringUtils.isNotBlank(startDate)) {
|
|
|
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sqlTotal += " and o.register_date >= to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sqlTotal += " and o.register_date >= str_to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sqlTotal += " and o.register_date >= to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sqlTotal += " AND o.register_date >='" + startDate + " 00:00:00' ";
|
|
|
}
|
|
@ -5605,7 +6090,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endDate)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sqlTotal += " and o.register_date <= to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sqlTotal += " and o.register_date <= str_to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sqlTotal += " and o.register_date <= to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sqlTotal += " AND o.register_date <='" + endDate + " 23:59:59' ";
|
|
|
}
|
|
@ -5664,14 +6154,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" o.general_doctor = '" + generalDoctor + "'";
|
|
|
if (StringUtils.isNotBlank(startDate)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and o.register_date >= to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and o.register_date >= str_to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and o.register_date >= to_date('" + startDate + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += " AND o.register_date >='" + startDate + " 00:00:00' ";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endDate)) {
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql += " and o.register_date <= to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
if (flag){
|
|
|
sql += " and o.register_date <= str_to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " and o.register_date <= to_date('" + endDate + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql += " AND o.register_date <='" + endDate + " 23:59:59' ";
|
|
|
}
|
|
@ -5785,7 +6285,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"wlyy_outpatient outpatient " +
|
|
|
"WHERE " +
|
|
|
" room.outpatient_id=outpatient.id " +
|
|
|
"AND outpatient.status = 0 AND room.doctor IS NULL AND outpatient.dept='" + dept + "' ";
|
|
|
"AND outpatient.status = 0 AND room.doctor IS NULL AND outpatient.pay_status=1 AND outpatient.dept='" + dept + "' ";
|
|
|
|
|
|
List<Map<String, Object>> alltotal = jdbcTemplate.queryForList(sqlAll);
|
|
|
|
|
@ -5804,7 +6304,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"wlyy_outpatient outpatient " +
|
|
|
"WHERE " +
|
|
|
" room.outpatient_id=outpatient.id " +
|
|
|
"AND outpatient.status = 0 AND room.doctor IS NULL AND room.reservation_type=1 AND room.consult_type=1 AND outpatient.dept='" + dept + "' ";
|
|
|
"AND outpatient.status = 0 AND room.doctor IS NULL AND outpatient.pay_status=1 AND room.reservation_type=1 AND room.consult_type=1 AND outpatient.dept='" + dept + "' ";
|
|
|
|
|
|
List<Map<String, Object>> imgtotal = jdbcTemplate.queryForList(imgAll);
|
|
|
|
|
@ -5823,7 +6323,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"wlyy_outpatient outpatient " +
|
|
|
"WHERE " +
|
|
|
" room.outpatient_id=outpatient.id " +
|
|
|
"AND outpatient.status = 0 AND room.doctor IS NULL AND room.reservation_type=1 AND room.consult_type=2 AND outpatient.dept='" + dept + "' ";
|
|
|
"AND outpatient.status = 0 AND room.doctor IS NULL AND outpatient.pay_status=1 AND room.reservation_type=1 AND room.consult_type=2 AND outpatient.dept='" + dept + "' ";
|
|
|
|
|
|
List<Map<String, Object>> sptotal = jdbcTemplate.queryForList(spsql);
|
|
|
|
|
@ -5843,7 +6343,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"wlyy_outpatient outpatient " +
|
|
|
"WHERE " +
|
|
|
" room.outpatient_id=outpatient.id " +
|
|
|
"AND outpatient.status = 0 AND room.doctor IS NULL AND room.reservation_type=2 AND outpatient.dept='" + dept + "' ";
|
|
|
"AND outpatient.status = 0 AND room.doctor IS NULL AND outpatient.pay_status=1 AND room.reservation_type=2 AND outpatient.dept='" + dept + "' ";
|
|
|
|
|
|
List<Map<String, Object>> xttotal = jdbcTemplate.queryForList(xtsql);
|
|
|
|
|
@ -5904,7 +6404,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
String condition = "";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
condition = "to_char(p.register_date,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
if (flag){
|
|
|
condition = "date_format(p.register_date,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
}else {
|
|
|
condition = "to_char(p.register_date,'YYYY-MM-DD hh24:mi:ss') AS \"time\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
condition = "date_format(p.register_date,'%Y-%m-%d %H:%i:%S' ) AS \"time\",";
|
|
|
}
|
|
@ -5912,9 +6417,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
String sql = "SELECT " + condition + "d.NAME as \"doctorName\",d.job_title_name as \"job_title_name\",d.photo AS \"photo\",p.id as \"outpatientid\" FROM wlyy_outpatient p,base_doctor d " +
|
|
|
"WHERE p.patient='" + patient + "' AND p.doctor=d.id AND p.status=0 ";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
if (flag){
|
|
|
sql += " AND p.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
sql += " AND p.register_date <= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}else {
|
|
|
sql += " AND p.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
sql += " AND p.register_date <= to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
}
|
|
|
|
|
|
sql += " AND p.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
|
|
|
sql += " AND p.register_date <= to_date('" + DateUtil.dateToStrShort(new Date()) + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
|
|
|
} else {
|
|
|
sql += " BETWEEN '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' AND '" + DateUtil.dateToStrShort(new Date()) + " 23:59:59' ";
|
|
|
}
|
|
@ -6238,7 +6748,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"\tp.idcard as \"idcard\",\n" +
|
|
|
"\tp.ssc as \"ssc\",\n";
|
|
|
if ("xm_ykyy_wx".equals(wxId)) {
|
|
|
sql = sql + "to_char(p.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
if (flag){
|
|
|
sql = sql + "date_format(p.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
}else {
|
|
|
sql = sql + "to_char(p.create_time,'YYYY-MM-DD hh24:mi:ss') AS \"createTime\",";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
sql = sql + "date_format(p.create_time,'%Y-%m-%d %H:%i:%S' ) AS \"createTime\",";
|
|
|
}
|
|
@ -6312,6 +6827,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
count = hibenateUtils.objTransformLong(total.get(0).get("total"));
|
|
|
}
|
|
|
Map<String, Object> map = new HashedMap();
|
|
|
/* for (Map<String,Object> map1:mapList){
|
|
|
String outpatientId = null;
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(map1.get("doctor").toString());
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
|
|
|
}
|
|
|
}*/
|
|
|
map.put("count", count);
|
|
|
map.put("list", mapList);
|
|
|
maps.add(map);
|
|
@ -6632,6 +7155,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public WlyyPrescriptionVO selectByPrescriptionId(String prescriptionId) throws Exception {
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
|
|
|
if (wlyyPrescriptionDO != null) {
|
|
|
List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(wlyyPrescriptionDO.getDoctor());
|
|
|
String deptName = null;
|
|
|
String hospitalName =null;
|
|
|
String sex = null;
|
|
|
String age = null;
|
|
|
String cardNo = null;
|
|
|
if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
deptName = doctorHospitalDO.getDeptName();
|
|
|
hospitalName = doctorHospitalDO.getOrgName();
|
|
|
}
|
|
|
BasePatientDO patientDO = basePatientDao.findById(wlyyPrescriptionDO.getPatientCode());
|
|
|
if (patientDO!=null){
|
|
|
sex = patientDO.getSex()+"";
|
|
|
age = DateUtil.getAgeForIdcard(patientDO.getIdcard())+"";
|
|
|
}
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
|
|
|
if (outpatientDO!=null){
|
|
|
cardNo = outpatientDO.getCardNo();
|
|
|
}
|
|
|
com.alibaba.fastjson.JSONObject objectString = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(wlyyPrescriptionDO);
|
|
|
WlyyPrescriptionVO prescriptionVO = com.alibaba.fastjson.JSONObject.toJavaObject(objectString, WlyyPrescriptionVO.class);
|
|
|
List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId, 1);
|
|
@ -6662,8 +7205,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
inspectionVOList.add(inspectionVO);
|
|
|
}
|
|
|
prescriptionVO.setInspectionVOs(inspectionVOList);
|
|
|
prescriptionVO.setAge(StringUtils.isNoneBlank(wlyyPrescriptionDO.getIdcard()) ? IdCardUtil.getAgeForIdcard(wlyyPrescriptionDO.getIdcard()) + "" : null);
|
|
|
prescriptionVO.setSex(StringUtils.isNoneBlank(wlyyPrescriptionDO.getIdcard()) ? IdCardUtil.getSexForIdcard_new(wlyyPrescriptionDO.getIdcard()) : null);
|
|
|
prescriptionVO.setAge(age);
|
|
|
prescriptionVO.setSex(sex);
|
|
|
prescriptionVO.setDeptName(deptName);
|
|
|
prescriptionVO.setHospitalName(hospitalName);
|
|
|
prescriptionVO.setCardNo(cardNo);
|
|
|
return prescriptionVO;
|
|
|
}
|
|
|
return null;
|
|
@ -7137,20 +7683,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"\t) \n" +
|
|
|
"WHERE\n" +
|
|
|
"\tROWNUM >= " + (page - 1) * size;
|
|
|
logger.info("oracleSql=" + oracleSql);
|
|
|
list = jdbcTemplate.query(oracleSql, new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
|
|
|
if (flag){
|
|
|
sql.append(" limit ").append((page - 1) * size).append(",").append(size);
|
|
|
logger.info("MySql=" + sql.toString());
|
|
|
list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
|
|
|
}else {
|
|
|
logger.info("oracleSql=" + oracleSql);
|
|
|
list = jdbcTemplate.query(oracleSql, new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
|
|
|
}
|
|
|
} else {
|
|
|
// sql+=" LIMIT " + (page - 1) * size + "," + size + "";
|
|
|
sql.append(" limit ").append((page - 1) * size).append(",").append(size);
|
|
|
logger.info("MySql=" + sql.toString());
|
|
|
list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
|
|
|
}
|
|
|
|
|
|
|
|
|
// List<WlyyPrescriptionVO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
|
|
|
logger.info("countSql=" + countSql.toString());
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList(countSql.toString());
|
|
|
long count = Long.parseLong(mapList.get(0).get("count").toString());
|
|
|
logger.info("sql=" + sql.toString());
|
|
|
logger.info("countSql=" + countSql.toString());
|
|
|
return PageEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find, list, page, size, count);
|
|
|
}
|
|
|
|
|
@ -7263,12 +7815,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
} else {
|
|
|
deptDescDOList = dictDeptDescDao.findByOrgCode(orgCode, keyName);
|
|
|
}
|
|
|
deptDescDOList.forEach(one -> {
|
|
|
one.setDeptDescription(null);
|
|
|
List<DictDeptDescDO> res = new ArrayList<>();
|
|
|
deptDescDOList.forEach(one->{
|
|
|
DictDeptDescDO descDO = new DictDeptDescDO();
|
|
|
BeanUtils.copyProperties(one,descDO);
|
|
|
descDO.setDeptDescription(null);
|
|
|
res.add(descDO);
|
|
|
});
|
|
|
if (deptDescDOList == null || deptDescDOList.size() == 0) {
|
|
|
return MixEnvelop.getError("无科室信息");
|
|
|
}
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, deptDescDOList);
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, res);
|
|
|
}
|
|
|
|
|
|
}
|