Browse Source

修复我的处方

mengkang 5 years ago
parent
commit
3d1f3c1651

+ 22 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -45,6 +45,7 @@ import com.yihu.jw.hospital.mapping.service.PatientMappingService;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.prescription.service.useragent.BaseUserAgent;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
@ -238,6 +239,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private BasePatientWechatDao basePatientWechatDao;
    @Autowired
    private WxPushLogDao wxPushLogDao;
    @Autowired
    private XzzxEntranceService xzzxEntranceService;
    @Value("${demo.flag}")
@ -451,7 +454,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //复诊信息
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId);
        rs.put("outpatient",convertToModel(outpatientDO,WlyyOutpatientVO.class));
        rs.put("doctorCancelType",outpatientDO.getDoctorCancelType());
        rs.put("doctorCancelValue",outpatientDO.getDoctorCancelValue());
        rs.put("doctorCancelRemark",outpatientDO.getDoctorCancelRemark());
        rs.put("payStatus",outpatientDO.getPayStatus());
        //居民详情
        BasePatientDO basePatientDO = basePatientDao.findById(outpatientDO.getPatient());
        rs.put("patientName",basePatientDO.getName());
@ -3281,12 +3287,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,"9");
                   sendWxTemplateMsg(wechatId,wlyyOutpatientDO,"9");
                }
                if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    data.put("type","16");
                    msg+=wlyyOutpatientDO.getPatientName()+",您好! 您有一个视频复诊已被医生取消,取消原因:"+cancelValue+"。取消说明:"+cancelRemark+"。";
//                    sendWxTemplateMsg(wechatId,wlyyOutpatientDO,"16");
                    sendWxTemplateMsg(wechatId,wlyyOutpatientDO,"16");
                }
                data.put("msg",msg);
                messageDO.setData(data.toString());
@ -3369,6 +3375,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                wxPushLogDao.save(wxPushLogDO);
            });
        }else if("xm_xzzx_wx".equalsIgnoreCase(wxId)) {
            BaseDoctorDO doctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
            String MsgUrl="https://www.xmheart.com/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientDO.getPatient();
            xzzxEntranceService.sendXCXMes(wxId,
                   doctorDO.getId(),
                    doctorDO.getIdcard(),
                    outpatientDO.getPatientName()+",您好!您的图文咨询已取消",
                    "通知时间:"+DateUtil.getStringDate(),
                    "通知内容:您的图文咨询订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理",
                    MsgUrl,
                    "wx53f6bb4ac081d840");
        }else if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
        }
    }

+ 3 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasEndpoint.java

@ -186,6 +186,9 @@ public class SaasEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<SaasDO> saasDOS = saasService.search(fields, filters, sorts, page, size);
        if (saasDOS.isEmpty()){
            return null;
        }
        saasDOS.forEach(saas->{
            SaasTypeDictDO saasTypeDictDO = saasTypeDictService.findById(saas.getType());
            saas.setTypeName(saasTypeDictDO.getName());

+ 31 - 20
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -232,26 +232,37 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                "\tAND (hos.org_code = '' OR '' = '')\n" +
                "\tAND (doc.del = '' OR '' = '')\n" +
                ")\n" +
                "\t) tb";
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            sql+=" GROUP BY\n" +
                    "\ttb. ID,\n" +
                    "\ttb.idcard,\n" +
                    "\ttb. NAME,\n" +
                    "\ttb.sex,\n" +
                    "\ttb.mobile,\n" +
                    "\ttb.job_title_name,\n" +
                    "\ttb.status,\n" +
                    "  tb.create_time\n" +
                    "ORDER BY\n" +
                    "\ttb.create_time DESC";
        }else {
            sql+=" GROUP BY\n" +
                    "\ttb. ID\n" +
                    "ORDER BY\n" +
                    "\ttb.create_time DESC";
        }
                "\t) tb" +
                "  GROUP BY\n" +
                "\ttb. ID,\n" +
                "\ttb.idcard,\n" +
                "\ttb. NAME,\n" +
                "\ttb.sex,\n" +
                "\ttb.mobile,\n" +
                "\ttb.job_title_name,\n" +
                "\ttb.status,\n" +
                "  tb.create_time\n" +
                "ORDER BY\n" +
                "\ttb.create_time DESC";
//        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
//            sql+=" GROUP BY\n" +
//                    "\ttb. ID,\n" +
//                    "\ttb.idcard,\n" +
//                    "\ttb. NAME,\n" +
//                    "\ttb.sex,\n" +
//                    "\ttb.mobile,\n" +
//                    "\ttb.job_title_name,\n" +
//                    "\ttb.status,\n" +
//                    "  tb.create_time\n" +
//                    "ORDER BY\n" +
//                    "\ttb.create_time DESC";
//        }else {
//            sql+=" GROUP BY\n" +
//                    "\ttb. ID\n" +
//                    "ORDER BY\n" +
//                    "\ttb.create_time DESC";
//        }
        String finalSql = sql