wangzhinan vor 2 Wochen
Ursprung
Commit
2acfbd3a8c

+ 9 - 1
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -1981,7 +1981,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        logger.info("进入无需支付");
        String baseUrl = prescriptionService.findDomainUrlInDict();
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
        WlyyHospitalSysDictDO changeMethod = hospitalSysDictDao.findById("consultPay").get();
        WlyyHospitalSysDictDO changeMethod = hospitalSysDictDao.findById("consultPay").orElse(null);
        String changeflag="0";
        if(null!=changeMethod){
            changeflag = changeMethod.getDictValue();
@ -2039,6 +2039,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                        String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId();
                        prescriptionService.sendZsMsgFlow("OL_PAY_SUCCESS",wlyyOutpatientDO.getId(),"",msgUrl,"已支付问诊费");
                    }
                    if("xm_dsyy_wx".equalsIgnoreCase(wechatId)){
                        BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(outpatientDO.getDoctor());
                        prescriptionService.sendSms(doctorDO.getMobile(),"医生您好,患者"+outpatientDO.getPatientName()+"向您发起了"+title+",请及时前往互联网医院查看并答复。","2");
                    }
                    System.out.println("发送企业模板消息成功");
                }
            }
@ -2094,6 +2098,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId();
                    prescriptionService.sendZsMsgFlow("OL_PAY_SUCCESS",wlyyOutpatientDO.getId(),"",msgUrl,"已支付问诊费");
                }
                if("xm_dsyy_wx".equalsIgnoreCase(wechatId)){
                    BaseDoctorDO doctorDO = doctorDao.findByIdAndDel(outpatientDO.getDoctor());
                    prescriptionService.sendSms(doctorDO.getMobile(),"医生您好,患者"+outpatientDO.getPatientName()+"向您发起了"+title+",请及时前往互联网医院查看并答复。","2");
                }
                System.out.println("发送企业模板消息成功");
            }
        } else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")) {

+ 14 - 3
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -7248,17 +7248,21 @@ public class StatisticsEsService {
    /**
     * 全院诊室患者
     */
    public JSONObject orgConsultPatient(String startDate,String endDate){
    public JSONObject orgConsultPatient(String startDate,String endDate,String dept){
        JSONObject json = new JSONObject();
        String sql = "SELECT COUNT(if(op.`status`=3,1,null)) status3,COUNT(if(op.`status`=1,1,null)) status2 " +
                ",COUNT(if(op.`status`=0 and op.pay_status=1,1,null)) status1 from  wlyy_outpatient op " +
                "where 1=1 ";
        if(StringUtils.isNotBlank(dept)){
            sql += " and op.dept='"+dept+"' ";
        }
        if(StringUtils.isNotBlank(startDate)){
            sql += " and create_time>='"+startDate+"' ";
        }
        if(StringUtils.isNotBlank(endDate)){
            sql += " and create_time<'"+endDate+"' ";
        }
        logger.info("sql===="+sql);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list.size()>0){
            Map<String,Object> map = list.get(0);
@ -7276,13 +7280,18 @@ public class StatisticsEsService {
    /**
     * 科室诊室患者
     */
    public List<Map<String,Object>> deptConsultPatient(String startDate,String endDate){
    public List<Map<String,Object>> deptConsultPatient(String startDate,String endDate,String dept){
        String sql = "SELECT d.code,d.name,if(t.status1 is null,0,t.status1) status1, " +
                "if(t.status2 is null,0,t.status2) status2,if(t.status3 is null,0,t.status3) status3 " +
                "from dict_hospital_dept d LEFT JOIN ( " +
                "SELECT COUNT(if(op.`status`=3,1,null)) status3,COUNT(if(op.`status`=1,1,null)) status2 " +
                ",COUNT(if(op.`status`=0 and op.pay_status=1,1,null)) status1, op.dept from  wlyy_outpatient op " +
                "where 1=1 ";
        String sqlCondition = "";
        if(StringUtils.isNotBlank(dept)){
            sql += " and op.dept='"+dept+"' ";
            sqlCondition +=" and d.code = '"+dept+"' ";
        }
        if(StringUtils.isNotBlank(startDate)){
            sql += " and create_time>='"+startDate+"' ";
        }
@ -7290,8 +7299,10 @@ public class StatisticsEsService {
            sql += " and create_time<'"+endDate+"' ";
        }
        sql += " GROUP BY op.dept) t on d.code=t.dept " +
                "WHERE d.consult_dept_flag=1 " +
                "WHERE d.consult_dept_flag=1 " +sqlCondition+
                "ORDER BY t.status3 desc";
        logger.info("sql===="+sql);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }

+ 29 - 2
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -118,7 +118,6 @@ public class ImService {
    @Autowired
    public ImUtil imUtil;
    public FileUtil fileUtil;
    @Autowired
    protected HttpServletRequest request;
@ -3225,13 +3224,18 @@ public class ImService {
            }
            String msg2 = "医生已接诊,该候诊将自动结束";
//            String msg2 = "医生已完成接诊,您可以点击右上角的【结束咨询】按钮,结束当前候诊";
            //踢出非客服的医生
            if (imUtil.sessionIsExist(session_id26)) {
                imUtil.sendImMsg(sender_id, sender_name, session_id26, "51", json.toJSONString(), "1", null);
                imUtil.sendImMsg(sender_id, sender_name, session_id26, "52", msg2, "1", null);
                sendDaozhenWaicengMessage(session_id26,sender_id);
            }
            if (imUtil.sessionIsExist(session_id27)) {
                imUtil.sendImMsg(sender_id, sender_name, session_id27, "51", json.toJSONString(), "1", null);
                imUtil.sendImMsg(sender_id, sender_name, session_id27, "52", msg2, "1", null);
                sendDaozhenWaicengMessage(session_id27,sender_id);
            }
        } catch (Exception e) {
@ -3239,6 +3243,25 @@ public class ImService {
        }
    }
    /**
     * 发送外层导诊消息
     * @param session_id
     * @param sender_id
     */
    public void sendDaozhenWaicengMessage(String session_id,String sender_id){
        String participantsSql = "SELECT p.participant_id from im.participants p,base_doctor d " +
                "WHERE p.session_id='"+session_id+"' and p.participant_id=d.id and p.participant_id!='customer'";
        List<Map<String,Object>> participantsList = jdbcTemplate.queryForList(participantsSql);
        for (Map<String,Object> participants:participantsList){
            System.out.println("发送外层SOCKET消息:协同门诊医生抢单之后,通知全科医生修改状态");
            JSONObject object = new JSONObject();
            object.put("socket_sms_type",15);
            object.put("relation_code",session_id);
            sendWaiSocketMessage(sender_id,participants.get("participant_id")+"",object.toString(),"1");
        }
    }
    /**
     * 导诊的咨询对话
     *
@ -4570,7 +4593,7 @@ public class ImService {
    }
    public MixEnvelop recordByDoctor(String doctor, String id, String type, Integer status, String title, String start_time, String end_time, String patient) { //
    public MixEnvelop recordByDoctor(String doctor, String id, String type, Integer status, String title, String start_time, String end_time, String patient,String dept) { //
        String sql = "";
        sql = "SELECT\n" +
                "\ta.patient_name AS \"pname\",\n" +
@ -4663,6 +4686,10 @@ public class ImService {
        if (!StringUtils.isEmpty(id)) {
            sql += " and a.id = '" + id + "'";
        }
        if (!StringUtils.isEmpty(dept)) {
            sql += " and a.dept = '" + dept + "'";
        }
        sql = sql + "\tORDER BY a.create_time desc ";
        List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(sql);

+ 9 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/im/ImJobService.java

@ -1,7 +1,9 @@
package com.yihu.jw.service.im;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.knowledge.BaseSystemDialogSetting;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.service.RobotService;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.knowledge.dao.BaseSystemDialogSettingDao;
@ -31,7 +33,8 @@ public class ImJobService {
    private String imDbName;
    @Autowired
    private RobotService robotService;
    @Autowired
    private ImService imService;
    /**
     *
@ -98,6 +101,11 @@ public class ImJobService {
                            "WHERE p.session_id='"+sessionId+"' and p.participant_id=d.id and p.participant_id!='customer'";
                    List<Map<String,Object>> participantsList = jdbcTemplate.queryForList(participantsSql);
                    for (Map<String,Object> participants:participantsList){
                        System.out.println("发送外层SOCKET消息:协同门诊医生抢单之后,通知全科医生修改状态");
                        JSONObject object = new JSONObject();
                        object.put("socket_sms_type",15);
                        object.put("relation_code",sessionId);
                        imService.sendWaiSocketMessage("system",participants.get("participant_id")+"",object.toString(),"1");
                        imUtil.deleteParticipants(sessionId, participants.get("participant_id")+"");
                    }
                    imUtil.updateSessionStatus(sessionId,"1");

+ 1 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -339,6 +339,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
						String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientCode;
						prescriptionService.sendZsMsgFlow("OL_WZ_START",outpatientCode,"",msgUrl,"医生已接诊");
					}
				}catch (Exception e){
					e.printStackTrace();
				}

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -1013,6 +1013,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "title",required = false) String title,
                                     @ApiParam(name = "patient", value = "患者id")
                                         @RequestParam(value = "patient",required = false) String patient,
                                     @ApiParam(name = "dept", value = "科室id")
                                         @RequestParam(value = "dept",required = false) String dept,
                                     @ApiParam(name = "id", value = "咨询ID")
                                         @RequestParam(value = "id",required = false) String id,
                                     @ApiParam(name = "type", value = "咨询类型")
@ -1026,7 +1028,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            HttpServletResponse response) throws Exception {
        try{
            MixEnvelop expressages = imService.recordByDoctor(doctor, id, type, status, title, start_time, end_time, patient);//
            MixEnvelop expressages = imService.recordByDoctor(doctor, id, type, status, title, start_time, end_time, patient,dept);//
            List<Map<String, Object>> list = expressages.getDetailModelList();
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename=" + new String("searchRecordWrite.xls"));

+ 7 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -1872,10 +1872,12 @@ class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "全院诊室患者")
    public ObjEnvelop orgConsultPatient(@ApiParam(name = "startTime", value = "开始时间 YYYY-MM-DD HH:MM:SS")
                                      @RequestParam(value = "startTime", required = false) String startTime,
                                        @ApiParam(name = "dept", value = "科室编码")
                                        @RequestParam(value = "dept", required = false) String dept,
                                      @ApiParam(name = "endTime", value = "结束时间 YYYY-MM-DD HH:MM:SS")
                                      @RequestParam(value = "endTime", required = false) String endTime) {
        try {
            JSONObject result = statisticsEsService.orgConsultPatient(startTime,endTime);
            JSONObject result = statisticsEsService.orgConsultPatient(startTime,endTime,dept);
            return ObjEnvelop.getSuccess("查询成功",result);
        } catch (Exception e) {
            e.printStackTrace();
@ -1887,9 +1889,11 @@ class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    public ListEnvelop deptConsultPatient(@ApiParam(name = "startTime", value = "开始时间 YYYY-MM-DD HH:MM:SS")
                                        @RequestParam(value = "startTime", required = false) String startTime,
                                        @ApiParam(name = "endTime", value = "结束时间 YYYY-MM-DD HH:MM:SS")
                                        @RequestParam(value = "endTime", required = false) String endTime) {
                                        @RequestParam(value = "endTime", required = false) String endTime,
                                          @ApiParam(name = "dept", value = "科室编码")
                                              @RequestParam(value = "dept", required = false) String dept) {
        try {
            List<Map<String,Object>> result = statisticsEsService.deptConsultPatient(startTime,endTime);
            List<Map<String,Object>> result = statisticsEsService.deptConsultPatient(startTime,endTime,dept);
            return ListEnvelop.getSuccess("查询成功",result);
        } catch (Exception e) {
            e.printStackTrace();

+ 2 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/common/StatisticsController.java

@ -147,10 +147,11 @@ public class StatisticsController extends EnvelopRestEndpoint {
    @ApiOperation(value = "设备分析头部统计")
    public ObjEnvelop deviceAnalysisTop(@ApiParam(name = "isTH", value = "是否返回同环比 1是 其他否", required = false)
                                        @RequestParam(required = false) String isTH,
                                        @RequestParam(required = false) String dept,
                                        @RequestParam(required = false) String startDate,
                                        @RequestParam(required = false) String endDate) {
        try {
            JSONObject json = statisticsService.deviceAnalysisTop(startDate,endDate,isTH);
            JSONObject json = statisticsService.deviceAnalysisTop(startDate,endDate,isTH,dept);
            return ObjEnvelop.getSuccess("查询成功",json);
        } catch (Exception e) {
            e.printStackTrace();

+ 17 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/common/service/StatisticsService.java

@ -551,7 +551,7 @@ public class StatisticsService {
     * 8、【血糖仪上传】:展示查询时间段内所有血糖仪设备的数据上传次数;
     * 9、【血压计上传】:展示查询时间段内所有血压计设备的数据上传次数;
     */
    public JSONObject deviceAnalysisTop(String startDate,String endDate,String isTH) throws Exception{
    public JSONObject deviceAnalysisTop(String startDate,String endDate,String isTH,String dept) throws Exception{
        JSONObject json = new JSONObject();
        // 计算上一个周期  开始时间period[0] 、结束时间period[1]
        String[] period = calculatePreviousPeriod(startDate, endDate);
@ -569,6 +569,22 @@ public class StatisticsService {
        String filterUploadH = "";
        String filterDeptH = "";
        String filterDeptUseH = "";
        if (StringUtils.isNoneBlank(dept)){
            filterDevice += " and d.dept = '"+dept+"' ";
            filterDeviceT += " and d.dept = '"+dept+"' ";
            filterDeviceH += " and d.dept = '"+dept+"' ";
            filterUpload +=" and dept ='"+dept+"'  ";
            filterUploadT +=" and dept ='"+dept+"'  ";
            filterUploadH +=" and dept ='"+dept+"'  ";
            filterDept += " and dept ='"+dept+"' ";
            filterDeptUse += " and d.dept='"+dept+"' ";
            filterDeptH += " and dept ='"+dept+"' ";
            filterDeptUseH += " and d.dept='"+dept+"' ";
            filterDeptT += " and dept ='"+dept+"' ";
            filterDeptUseT += " and d.dept='"+dept+"' ";
        }
        if(StringUtils.isNotBlank(startDate)){
            filterDevice += " and d.apply_date>='"+startDate+"' ";
            filterDept += " and apply_date>='"+startDate+"' ";

+ 2 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/followup/controller/DoctorFollowUpController.java

@ -63,6 +63,7 @@ public class DoctorFollowUpController extends BaseController {
            @ApiParam(value = "业务来源的选项为:全部来源、诊后康复(其余选项待后期新增)") @RequestParam(value = "businessSource", required = false) String businessSource,
            @ApiParam(value = "居民姓名") @RequestParam(value = "patientName", required = false) String patientName,
            @ApiParam(value = "居民姓名或者医生姓名") @RequestParam(value = "keyName", required = false) String keyName,
            @ApiParam(value = "科室编码") @RequestParam(value = "dept", required = false) String dept,
            @ApiParam(value = "当前页") @RequestParam(value = "page") Integer page,
            @ApiParam(value = "显示记录数") @RequestParam(value = "size") Integer size,
            @ApiParam(value = "随访状态:全部状态、2未完成、1已完成") @RequestParam(value = "followupStatus", required = false) String followupStatus,
@ -71,7 +72,7 @@ public class DoctorFollowUpController extends BaseController {
            @ApiParam(value = "结束时间") @RequestParam(value = "endDate", required = false) String endDate) {
        try {
            return followUpService.followupPage(businessType, businessSource, startDate, endDate, patientName,keyName,
                    followupStatus,doctorName, page, size);
                    followupStatus,doctorName, dept, page, size);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("查询失败");

+ 4 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/followup/service/FollowUpService.java

@ -90,7 +90,7 @@ public class FollowUpService {
    //随访记录列表
    public PageEnvelop followupPage(String businessType, String businessSource, String startDate, String endDate, String patientName,
                                    String keyName,String followupStatus,String doctorName, Integer page, Integer size){
                                    String keyName,String followupStatus,String doctorName,String dept, Integer page, Integer size){
        String sql = "SELECT DISTINCT f.id,f.patient_name patientName,f.patient_code patientCode,p.photo,p.idcard,p.birthday,p.sex,p.mobile, " +
                "f.doctor_code doctorCode,f.doctor_name doctorName,pl.disease_name businessTypeName,pl.disease businessType,ip.id itemPlanId, " +
                "h.dept_code deptCode,h.dept_name deptName,f.`status`,date_format(f.followup_date, '%Y-%m-%d %H:%i:%s') followupDate,'诊后康复' businessSource," +
@ -119,6 +119,9 @@ public class FollowUpService {
        if (StringUtils.isNotBlank(patientName)){
            filter += " and f.patient_name like '%" + patientName + "%' ";
        }
        if (StringUtils.isNotBlank(dept)){
            filter += " and h2.dept_code ='" + dept + "' ";
        }
        if(StringUtils.isNotBlank(followupStatus)){
            filter += " and f.status='"+followupStatus+"' ";

+ 4 - 2
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/controller/DeviceController.java

@ -232,11 +232,12 @@ public class DeviceController extends BaseController {
    public Envelop searchList(
            @RequestParam(value = "deviceName",required = false)String deviceName,
            @RequestParam(value = "deviceCode",required = false) String deviceCode,
            @RequestParam(value = "deptCode",required = false) String deptCode,
            @RequestParam(value = "linkman",required = false) String linkman,
            @RequestParam(value = "page",required = false)Integer page,
            @RequestParam(value = "pageSize",required = false)Integer pageSize){
        try {
            return deviceService.searchDeviceList(deviceName,deviceCode,linkman, page, pageSize);
            return deviceService.searchDeviceList(deviceName,deviceCode,deptCode,linkman, page, pageSize);
        }catch (Exception ex){
            ex.printStackTrace();
            return Envelop.getError("操作失败!");
@ -356,11 +357,12 @@ public class DeviceController extends BaseController {
            @RequestParam(value = "deviceName",required = false) String deviceName,
            @RequestParam(value = "categoryCode",required = false) String categoryCode,
            @RequestParam(value = "deviceSn",required = false) String deviceSn,
            @RequestParam(value = "deptCode",required = false) String deptCode,
            @RequestParam(value = "userName",required = false) String userName,
            @RequestParam(value = "page") Integer page,
            @RequestParam(value = "pageSize") Integer pageSize){
        try {
            List<WlyyPatientDeviceVO> patientDevices = deviceService.patientDeviceList(deviceName,categoryCode, deviceSn, userName, page, pageSize);
            List<WlyyPatientDeviceVO> patientDevices = deviceService.patientDeviceList(deviceName,categoryCode, deviceSn,deptCode,userName, page, pageSize);
            Long totalcount = deviceService.patientDeviceListCount(deviceName,categoryCode, deviceSn, userName);
            return PageEnvelop.getSuccessListWithPage("操作成功",patientDevices,page,pageSize,totalcount);
        }catch (Exception ex){

+ 8 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/service/DeviceService.java

@ -273,7 +273,7 @@ public class DeviceService {
		return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
	}
	public PageEnvelop searchDeviceList(String deviceName,String deviceCode,String linkman,Integer page,Integer pageSize){
	public PageEnvelop searchDeviceList(String deviceName,String deviceCode,String deptCode,String linkman,Integer page,Integer pageSize){
		if(page == null){
			page = 1;
		}
@ -289,6 +289,9 @@ public class DeviceService {
		if(StringUtils.isNotBlank(deviceName)){
			filter += " and device_name like '%"+deviceName+"%'";
		}
		if(StringUtils.isNotBlank(deptCode)){
			filter += " and dept = '"+deptCode+"'";
		}
		if(StringUtils.isNotBlank(linkman)){
			filter += " and linkman like '%"+linkman+"%'";
		}
@ -372,6 +375,7 @@ public class DeviceService {
	public List<WlyyPatientDeviceVO> patientDeviceList(String deviceName,
												   String categoryCode,
												   String deviceSn,
													String dept,
												   String userName,
												   Integer page, Integer pageSize) {
		List<WlyyPatientDeviceVO> list = new ArrayList<>();
@ -383,6 +387,9 @@ public class DeviceService {
		if(StringUtils.isNotBlank(userName)){
			sql = sql + "AND p.name like '%"+userName+"%' ";
		}
		if(StringUtils.isNotBlank(dept)){
			sql = sql + "AND d.dept = '"+dept+"' ";
		}
		if(StringUtils.isNotBlank(deviceSn)){
			sql = sql + "AND d.device_sn like '%"+deviceSn+"%' ";