Quellcode durchsuchen

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

liubing vor 4 Jahren
Ursprung
Commit
ecba78b384
23 geänderte Dateien mit 1118 neuen und 277 gelöschten Zeilen
  1. 6 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PatientRegisterDao.java
  2. 63 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java
  3. 22 16
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  4. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java
  5. 30 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  6. 3 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  7. 1 4
      business/base-service/src/main/java/com/yihu/jw/internet/service/DataGeneratorService.java
  8. 13 6
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  9. 4 0
      business/base-service/src/mqConfig/esbmq-config.xml
  10. 792 156
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  11. 34 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPatientRegisterDO.java
  12. 5 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java
  13. 4 2
      svr/svr-base/src/main/resources/application.yml
  14. 4 0
      svr/svr-internet-hospital-entrance/src/mqConfig/esbmq-config.xml
  15. 2 2
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/AutoTimeOutRemind.java
  16. 2 2
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java
  17. 36 29
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  18. 36 28
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  19. 29 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseDoctorBGController.java
  20. 2 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java
  21. 26 14
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  22. 0 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java
  23. 3 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

+ 6 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PatientRegisterDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPatientRegisterDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
@ -14,7 +15,10 @@ public interface PatientRegisterDao extends PagingAndSortingRepository<WlyyPatie
    List<WlyyPatientRegisterDO> findByPatientAndDate(String patient,String date);
    List<WlyyPatientRegisterDO> findByPatientAndDateAndDoctor(String patient,String date,String doctor);
    List<WlyyPatientRegisterDO> findByPatientAndDateAndDoctorAndDel(String patient,String date,String doctor,Integer del);
    List<WlyyPatientRegisterDO> findByPatientAndCreateTime(String patient, Date createTime);
    List<WlyyPatientRegisterDO> findByPatientAndCreateTimeAndDel(String patient, Date createTime,Integer del);
    @Query("select a from WlyyPatientRegisterDO a where a.registerNo = ?1 and a.del=1 ")
    WlyyPatientRegisterDO findByRegisterNo(String registerNo);
}

+ 63 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java

@ -1,14 +1,22 @@
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import jxl.write.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.Map;
@Service
public class PayInfoNoticeService {
    @Value("${hospital.url}")
@ -76,6 +84,61 @@ public class PayInfoNoticeService {
        return respCode;
    }
    //导出es查询数据
    public void exportEsPrescription(OutputStream os, com.alibaba.fastjson.JSONObject jsonObject) throws Exception{
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
        //接诊 +开方+物流
        com.alibaba.fastjson.JSONArray totallist = new JSONArray();
        if (null!=jsonObject){
            totallist = jsonObject.getJSONArray("outpatient");
        }
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet", 1);
            String[] header = {"医生姓名", "出诊科室", "接诊数量", "开方数量", "物流数量"};
            int k = 0;
            for (String h : header) {
                addCell(ws, 0, k, h);//表名,行,列,header
                k++;
            }
            int i = 1;
            if (null!=totallist&&totallist.size()>0){
                for (int n=0;n<totallist.size();n++) {
                    JSONObject object = totallist.getJSONObject(i);
                    addCell(ws, i, 0, object.get("doctorName").toString(), "");
                    addCell(ws, i, 1, null==object.get("dept")?"":object.get("dept").toString(),"");
                    addCell(ws, i, 1, null==object.get("out")?"":object.get("out").toString(),"");
                    addCell(ws, i, 1, null==object.get("pre")?"":object.get("pre").toString(),"");
                    addCell(ws, i, 1, null==object.get("sf")?"":object.get("sf").toString(),"");
                    i++;
                }
            }
            wwb.write();
            wwb.close();
        } catch (IOException e) {
            e.printStackTrace();
            if (wwb != null) wwb.close();
            throw e;
        }
    }
    //添加单元格内容
    public void addCell(WritableSheet ws, int row, int column, String data) throws WriteException {
        Label label = new Label(column, row, data);
        ws.addCell(label);
    }
    //添加单元格内容
    public void addCell(WritableSheet ws, int row, int column, String data, String memo) throws WriteException {
        Label label = new Label(column, row, data);
        if (!org.springframework.util.StringUtils.isEmpty(memo)) {
            WritableCellFeatures cellFeatures = new WritableCellFeatures();
            cellFeatures.setComment(memo);
            label.setCellFeatures(cellFeatures);
        }
        ws.addCell(label);
    }
}

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

@ -1638,7 +1638,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //查找居民当天挂号记录
        String date = DateUtil.dateToStr(new Date(), "yyyy-MM-dd");
        List<WlyyPatientRegisterDO> patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctor(outpatientDO.getPatient(), date, doctor);
        List<WlyyPatientRegisterDO> patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctorAndDel(outpatientDO.getPatient(), date, doctor,1);
        if (patientRegisterDOs != null && patientRegisterDOs.size() > 0) {
            WlyyPatientRegisterDO registerDO = patientRegisterDOs.get(0);
            //判断是否已经挂号,如果已经挂号
@ -1652,6 +1652,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                outpatientDO.setConNo(registerDO.getConNo());
                outpatientDO.setRegisterNo(registerDO.getRegisterNo());
                outpatientDO.setAdmDate(registerDO.getCreateTime());
                outpatientDO.setXtgzh(registerDO.getXtgzh());
                outpatientDO.setRealOrder(registerDO.getRealOrder());
                outpatientDao.save(outpatientDO);
                //调用电子病历注册
                manageType = 2;
@ -1693,13 +1695,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            registerDO.setDoctorName(outpatientDO.getDoctorName());
            registerDO.setDept(outpatientDO.getDept());
            registerDO.setDeptName(outpatientDO.getDeptName());
            registerDO.setRealOrder(realOrder);
            registerDO.setXtgzh(xtgzh);
            registerDO.setPatient(outpatientDO.getPatient());
            registerDO.setPatientName(outpatientDO.getPatientName());
            //挂号流水号与挂号次数
            registerDO.setRegisterNo(serialNo);
            registerDO.setConNo(conNo);
            registerDO.setCreateTime(new Date());
            registerDO.setDel(1);
            registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
            patientRegisterDao.save(registerDO);
@ -1728,7 +1732,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            registerDO.setDoctorName(outpatientDO.getDoctorName());
            registerDO.setDept(outpatientDO.getDept());
            registerDO.setDeptName(outpatientDO.getDeptName());
            registerDO.setRealOrder(realOrder);
            registerDO.setXtgzh(xtgzh);
            registerDO.setPatient(outpatientDO.getPatient());
            registerDO.setPatientName(outpatientDO.getPatientName());
            registerDO.setRegisterNo(serialNo);
@ -1766,8 +1771,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if (StringUtils.isNoneBlank(outpatientDO.getRegisterNo())){
                net.sf.json.JSONObject rs = entranceService.BS10138(outpatientDO.getCardNo(), doctorMappingDO.getMappingCode(), outpatientDO.getDept(), outpatientDO.getRegisterNo(), outpatientDO.getWinNo(), demoFlag);
                res= rs.getJSONObject("resquest");
                logger.info("挂号结果 res: " + res.toString());
                logger.info("退号结果 res: " + res.toString());
                String rsCode = res.getString("@RESULT");
                if (rsCode.equalsIgnoreCase("0")){
                    WlyyPatientRegisterDO wlyyPatientRegisterDO = patientRegisterDao.findByRegisterNo(outpatientDO.getRegisterNo());
                    wlyyPatientRegisterDO.setDel(0);
                    patientRegisterDao.save(wlyyPatientRegisterDO);
                }
                //保存日志
                WlyyHttpLogDO log = new WlyyHttpLogDO();
@ -2392,7 +2402,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @return
     */
    public Double getChargeFee(String doctor) {
        DecimalFormat df = new DecimalFormat("#.00");
        DecimalFormat df = new DecimalFormat("0.00");
        Double fee = 0D;
        try {
            BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
@ -7277,17 +7287,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            cardNo = outpatientDO.getCardNo();
                        }
                        logger.info("cardNo:" + cardNo);
                        Double total = 0.0;
                        List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(prescriptionDO.getOutpatientId());
                        for (WlyyPrescriptionDO wlyyPrescriptionDO1:wlyyPrescriptionDOS){
                            total +=wlyyPrescriptionDO1.getDrugFee();
                        }
                        String free = total + "";
                        Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
                        Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
                        List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(patientCode,startTime,endTime);
                        if (wlyyOutpatientDOList==null||wlyyOutpatientDOList.size()==0){
                            free=(Double.parseDouble(free)+15)+"";
                        JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),prescriptionDO.getRealOrder(),demoFlag);
                        net.sf.json.JSONObject res = object.getJSONObject("resquest");
                        logger.info("获取待结算数据 res: " + res.toString());
                        String rsCode = res.getString("@RESULT");
                        String free= 0+"";
                        if ("0".equals(rsCode)) {
                            free = res.getString("@total_charge");
                        }
                        ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1");
                    }

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java

@ -80,7 +80,7 @@ public class XzyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        //查找居民当天挂号记录
        String date = DateUtil.dateToStr(new Date(), "yyyy-MM-dd");
        List<WlyyPatientRegisterDO> patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctor(outpatientDO.getPatient(), date, doctor);
        List<WlyyPatientRegisterDO> patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctorAndDel(outpatientDO.getPatient(), date, doctor,1);
        if (patientRegisterDOs != null && patientRegisterDOs.size() > 0) {
            WlyyPatientRegisterDO registerDO = patientRegisterDOs.get(0);
            //判断是否已经挂号,如果已经挂号

+ 30 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -77,6 +77,8 @@ public class EntranceService {
    private static String BS10111 = "BS10111";
    //线上退号接口
    private static String BS10138 = "BS10138";
    //查询待结算费用
    private static String BS15054 = "BS15054";
    //线上处方接口
    private static String BS10112 = "BS10112";
    //医生挂号权限查询接口
@ -872,9 +874,35 @@ public class EntranceService {
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>" + sourceSysCode + "</SourceSysCode><TargetSysCode>" + targetSysCode + "</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>20000</endNum><Msg><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root>");
            sbs.append("<MsgInfo><endNum>20000</endNum><Msg><as_xml><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root>");
            sbs.append("<resquest card_no=\"" + card_no + "\" doctor=\"" + doctor + "\" dept=\"" + dept + "\" serial_no=\"" + serial_no + "\"   win_no=\"" + win_no + "\" >");
            sbs.append("</resquest></root>]]></Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            sbs.append("</resquest></root>]]></as_xml></Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            //超时等待时间150s
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            logger.info(fid + " resp:" + resp);
        }
        return ConvertUtil.convertListEnvelopInRequest(resp);
    }
    public net.sf.json.JSONObject BS15054(String pid, String realorder,  boolean demoFlag) throws Exception {
        String fid = BS15054;
        logger.info("EntranceService " + fid +pid+realorder);
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            sbs.append("<ESBEntry><AccessControl><Fid>" + fid + "</Fid><UserName>" + mqUser + "</UserName><Password>" + mqPwd + "</Password></AccessControl>");
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>" + sourceSysCode + "</SourceSysCode><TargetSysCode>" + targetSysCode + "</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>20000</endNum><Msg><as_xml><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root>");
            sbs.append("<resquest pid=\"" + pid + "\" realorder=\"" + realorder + "\" >");
            sbs.append("</resquest></root>]]></as_xml></Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            //超时等待时间150s
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);

+ 3 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -1644,7 +1644,9 @@ public class YkyyEntranceService {
            List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(code,1);
            synPrecriptionHis(prescriptionVO,code);
            //同步检查检验
            //synInspect(inspectionDOS);
            if(null!=inspectionDOS&&inspectionDOS.size()>0){
                synInspect(inspectionDOS);
            }
        }
        return wlyyPrescriptionDOs.toString();

+ 1 - 4
business/base-service/src/main/java/com/yihu/jw/internet/service/DataGeneratorService.java

@ -12,9 +12,7 @@ import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.internet.dao.IntUpErrorLogDao;
import com.yihu.jw.internet.entity.InternetUpErrorLogDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -22,7 +20,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
@ -106,7 +103,7 @@ public class DataGeneratorService extends BaseJpaService<InternetUpErrorLogDO, I
        //遍历居民删除预约记录
        while (it.hasNext()) {
            PatientMappingDO patientMappingDO = (PatientMappingDO) it.next();
            List<WlyyPatientRegisterDO> registerDOs = patientRegisterDao.findByPatientAndCreateTime(patientMappingDO.getPatient(),DateUtil.strToDate(date+" 08:00:00"));
            List<WlyyPatientRegisterDO> registerDOs = patientRegisterDao.findByPatientAndCreateTimeAndDel(patientMappingDO.getPatient(),DateUtil.strToDate(date+" 08:00:00"),1);
            if(registerDOs!=null&&registerDOs.size()>0){
                patientRegisterDao.delete(registerDOs);
            }

+ 13 - 6
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -318,7 +318,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                "   b.dept_code AS \"dept_code\"," +
                "   b.dept_name AS \"dept_name\"," +
                "   a.job_title_code AS \"job_title_code\"," +
                "   a.fzrq AS \"fzrq\"" +
                "   a.fzrq AS \"fzrq\"," +
                "   a.photo as \"photo\" " +
                "  from base_doctor a " +
                "      ,base_doctor_hospital b" +
                " where a.id = b.doctor_code" +
@ -326,7 +327,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                "   AND a.job_title_code is NOT NULL " +
                "   AND a.fzrq IS NOT NULL " +
                "   AND a.cert_no IS NOT NULL " +
                "   AND a.prac_no IS NOT NULL ";
                "   AND a.prac_no IS NOT NULL " +
                "  AND b.dept_name IS NOT NULL AND a.del=1 ";
        if(StringUtils.isNotBlank(keyId)){
            sql =  sql +  "  and a.id = '" + keyId + "' ";
@ -349,7 +351,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("organ_code", orgCode);
                jb.put("organ_name", orgName);
                jb.put("doc_name", info.get("name")== null ? "0":info.get("name"));
                jb.put("docimg", "");
                jb.put("docimg",info.get("photo")==null ?null:getImg("https://hlwyy.xmzsh.com/fastdfs/"+info.get("photo").toString()));
                jb.put("id_card", info.get("idcard")== null ? "0":info.get("idcard"));
                jb.put("sex", info.get("sex")== null ? "0":info.get("sex"));
                jb.put("birthday", info.get("birthday")  == null?"1900-01-01": DateUtil.dateToStrShort((Date)info.get("birthday")));
@ -369,9 +371,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("cert_no",  info.get("cert_no")== null ? "0":info.get("cert_no"));
                jb.put("prac_no",  info.get("prac_no")== null ? "0":info.get("prac_no"));
                //资格证书
                jb.put("doc_cert",ImgUtils.getImageStr(imgPath+"doctor"+ File.separator+info.get("name")+File.separator+"zg.jpg"));
                jb.put("doc_cert",ImgUtils.getImageStr(imgPath+"doctor"+ File.separator+info.get("name")+File.separator+"资格证.jpg"));
                //执业证书
                jb.put("cert_doc_prac", ImgUtils.getImageStr(imgPath+"doctor"+ File.separator+info.get("name")+File.separator+"zy.jpg"));
                jb.put("cert_doc_prac", ImgUtils.getImageStr(imgPath+"doctor"+ File.separator+info.get("name")+File.separator+"执业证.jpg"));
                jb.put("txt_introduction",StringUtils.isNoneBlank(superviseDataDict.getTxtIntroduction())?superviseDataDict.getTxtIntroduction():"");
            }catch (Exception e){
@ -822,7 +824,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                        object.put("receiver",doctorDO.getName());
                    }else {
                        BasePatientDO patientDO = patientDao.findById(map1.get("participant_id").toString());
                        object.put("receiver",patientDO.getName());
                        if (patientDO!=null){
                            object.put("receiver",patientDO.getName());
                        }
                    }
                }
                String msg = "";
@ -1728,6 +1732,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
            case "2":
                res = "1";
                break;
            case "3":
                res = "1";
                break;
            default:
                res = "";
        }

+ 4 - 0
business/base-service/src/mqConfig/esbmq-config.xml

@ -29,6 +29,10 @@
				<BS10110_1>EwellQ.S60.BS10110.GET</BS10110_1>
				<BS10111_0>EwellQ.S60.BS10111.PUT</BS10111_0>
				<BS10111_1>EwellQ.S60.BS10111.GET</BS10111_1>
				<BS10138_0>EwellQ.S60.BS10138.PUT</BS10138_0>
				<BS10138_1>EwellQ.S60.BS10138.GET</BS10138_1>
				<BS15054_0>EwellQ.S60.BS15054.PUT</BS15054_0>
				<BS15054_1>EwellQ.S60.BS15054.GET</BS15054_1>
				<BS10112_0>EwellQ.S60.BS10112.PUT</BS10112_0>
				<BS10112_1>EwellQ.S60.BS10112.GET</BS10112_1>
				<BS10114_0>EwellQ.S60.BS10114.PUT</BS10114_0>

+ 792 - 156
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -210,7 +210,7 @@ public class StatisticsEsService {
            List<SaveModel> vedioSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL,"16",null,level2_type);
            JSONArray array = new JSONArray();
            List<String> list = new ArrayList<>();
            DecimalFormat decimalFormat = new DecimalFormat("#.00");
            for (SaveModel saveModel:syngySaveModels){
                if (level2_type.equals(SaveModel.OrgLevel)){
                    if (StringUtils.isNoneBlank(saveModel.getHospital())){
@ -244,7 +244,7 @@ public class StatisticsEsService {
                            if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                                jsonObject.put("code",code);
                                jsonObject.put("name",saveModel.getHospitalName());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                jsonObject.put("specialist",saveModel.getResult1());
                                specialist = saveModel.getResult1();
                                break;
                            }
@ -252,7 +252,7 @@ public class StatisticsEsService {
                            if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                                jsonObject.put("code",code);
                                jsonObject.put("name",saveModel.getDeptName());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                jsonObject.put("specialist",saveModel.getResult1());
                                specialist = saveModel.getResult1();
                                break;
                            }
@ -280,7 +280,7 @@ public class StatisticsEsService {
                                    jsonObject.put("doctorJob",null);
                                }
                                jsonObject.put("doctorName",saveModel.getDoctorName());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                jsonObject.put("specialist",saveModel.getResult1());
                                specialist = saveModel.getResult1();
                                break;
                            }
@ -293,7 +293,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getHospitalName());
                            jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
                            jsonObject.put("synegy",saveModel.getResult1());
                            synegy = saveModel.getResult1();
                            break;
                        }
@ -301,7 +301,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
                            jsonObject.put("synegy",saveModel.getResult1());
                            synegy = saveModel.getResult1();
                            break;
                        }
@ -328,7 +328,7 @@ public class StatisticsEsService {
                            jsonObject.put("doctorCode",code);
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
                            jsonObject.put("synegy",saveModel.getResult1());
                            synegy = saveModel.getResult1();
                            break;
                        }
@ -339,7 +339,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getHospitalName());
                            jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
                            jsonObject.put("topic",saveModel.getResult1());
                            topic = saveModel.getResult1();
                            break;
                        }
@ -347,7 +347,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
                            jsonObject.put("topic",saveModel.getResult1());
                            topic = saveModel.getResult1();
                            break;
                        }
@ -373,7 +373,7 @@ public class StatisticsEsService {
                            }
                            jsonObject.put("doctorCode",code);
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
                            jsonObject.put("topic",saveModel.getResult1());
                            topic = saveModel.getResult1();
                            break;
                        }
@ -384,7 +384,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getHospitalName());
                            jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
                            jsonObject.put("vedio",saveModel.getResult1());
                            vedio = saveModel.getResult1();
                            break;
                        }
@ -392,7 +392,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
                            jsonObject.put("vedio",saveModel.getResult1());
                            vedio = saveModel.getResult1();
                            break;
                        }
@ -418,7 +418,7 @@ public class StatisticsEsService {
                                jsonObject.put("doctorJob",null);
                            }
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
                            jsonObject.put("vedio",saveModel.getResult1());
                            vedio = saveModel.getResult1();
                            break;
                        }
@ -426,8 +426,8 @@ public class StatisticsEsService {
                }
                Double total1 = topic+vedio ;//图文和视频总和
                Double total = topic+vedio+synegy+specialist;//总和
                jsonObject.put("total1",decimalFormat.format(total1));//图文和视频总和
                jsonObject.put("total",decimalFormat.format(total));//总和
                jsonObject.put("total1",total1);//图文和视频总和
                jsonObject.put("total",total);//总和
                array.add(jsonObject);
            }
            object.put("excelData",array);
@ -441,39 +441,40 @@ public class StatisticsEsService {
        //问诊量
        JSONObject object = new JSONObject();
        if (interval==1){
            JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            JSONArray array = dateTotalStatistics3(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
            JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,"3","3",SaveModel.timeLevel_ZL,null);
            JSONArray array1 = dateTotalStatistics3(startDate,endDate,area,level,"3","3",SaveModel.timeLevel_ZL,null);
            object.put("specialistData",array1);
            JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"1");
            JSONArray array2 = dateTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"1");
            object.put("topicData",array2);
            JSONArray array3 = dateTotalStatistics2(startDate,endDate,area,level,"3","2",SaveModel.timeLevel_ZL,null);
            JSONArray array3 = dateTotalStatistics3(startDate,endDate,area,level,"3","2",SaveModel.timeLevel_ZL,null);
            object.put("synergyData",array3);
            JSONArray array4 = dateTotalStatistics2(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"2");
            JSONArray array4 = dateTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"2");
            object.put("vedioData",array4);
        }else if (interval==2){
            JSONArray array = weekTotalStatistics(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            JSONArray array = weekTotalStatisticsDf(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
            JSONArray array1 = weekTotalStatistics2(startDate,endDate,area,level,"3","3",SaveModel.timeLevel_ZL,"1");
            JSONArray array1 = weekTotalStatistics3(startDate,endDate,area,level,"3","3",SaveModel.timeLevel_ZL,"1");
            object.put("specialistData",array1);
            JSONArray array2 = weekTotalStatistics2(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"1");
            JSONArray array2 = weekTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"1");
            object.put("topicData",array2);
            JSONArray array3 = weekTotalStatistics2(startDate,endDate,area,level,"3","2",SaveModel.timeLevel_ZL,null);
            JSONArray array3 = weekTotalStatistics3(startDate,endDate,area,level,"3","2",SaveModel.timeLevel_ZL,null);
            object.put("synergyData",array3);
            JSONArray array4 = weekTotalStatistics2(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"2");
            JSONArray array4 = weekTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"2");
            object.put("vedioData",array4);
        }else if (interval==3){
            JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            JSONArray array = monthTotalStatistics3(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
            JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,"3","3",SaveModel.timeLevel_ZL,"1");
            JSONArray array1 = monthTotalStatistics3(startDate,endDate,area,level,"3","3",SaveModel.timeLevel_ZL,"1");
            object.put("specialistData",array1);
            JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"1");
            JSONArray array2 = monthTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"1");
            object.put("topicData",array2);
            JSONArray array3 = monthTotalStatistics2(startDate,endDate,area,level,"3","2",SaveModel.timeLevel_ZL,null);
            JSONArray array3 = monthTotalStatistics3(startDate,endDate,area,level,"3","2",SaveModel.timeLevel_ZL,null);
            object.put("synergyData",array3);
            JSONArray array4 = monthTotalStatistics2(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"2");
            JSONArray array4 = monthTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"2");
            object.put("vedioData",array4);
        }
        DecimalFormat decimalFormat = new DecimalFormat("0.00");
        if (StringUtils.isNoneBlank(level2_type)){
            //问诊量表格
@ -521,7 +522,7 @@ public class StatisticsEsService {
                            if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                                jsonObject.put("code",code);
                                jsonObject.put("name",saveModel.getHospitalName());
                                jsonObject.put("specialist",saveModel.getResult1());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                specialist = saveModel.getResult1();
                                break;
                            }
@ -529,7 +530,7 @@ public class StatisticsEsService {
                            if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                                jsonObject.put("code",code);
                                jsonObject.put("name",saveModel.getDeptName());
                                jsonObject.put("specialist",saveModel.getResult1());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                specialist = saveModel.getResult1();
                                break;
                            }
@ -557,7 +558,7 @@ public class StatisticsEsService {
                                    jsonObject.put("doctorJob",null);
                                }
                                jsonObject.put("doctorName",saveModel.getDoctorName());
                                jsonObject.put("specialist",saveModel.getResult1());
                                jsonObject.put("specialist",decimalFormat.format(saveModel.getResult1()));
                                specialist = saveModel.getResult1();
                                break;
                            }
@ -570,7 +571,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getHospitalName());
                            jsonObject.put("synegy",saveModel.getResult1());
                            jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
                            synegy = saveModel.getResult1();
                            break;
                        }
@ -578,7 +579,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("synegy",saveModel.getResult1());
                            jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
                            synegy = saveModel.getResult1();
                            break;
                        }
@ -605,7 +606,7 @@ public class StatisticsEsService {
                            jsonObject.put("doctorCode",code);
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("synegy",saveModel.getResult1());
                            jsonObject.put("synegy",decimalFormat.format(saveModel.getResult1()));
                            synegy = saveModel.getResult1();
                            break;
                        }
@ -616,7 +617,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getHospitalName());
                            jsonObject.put("topic",saveModel.getResult1());
                            jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
                            synegy = saveModel.getResult1();
                            break;
                        }
@ -624,7 +625,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("topic",saveModel.getResult1());
                            jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
                            topic = saveModel.getResult1();
                            break;
                        }
@ -650,7 +651,7 @@ public class StatisticsEsService {
                            }
                            jsonObject.put("doctorCode",code);
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("topic",saveModel.getResult1());
                            jsonObject.put("topic",decimalFormat.format(saveModel.getResult1()));
                            topic = saveModel.getResult1();
                            break;
                        }
@ -661,7 +662,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getHospital())&&code.equalsIgnoreCase(saveModel.getHospital())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getHospitalName());
                            jsonObject.put("vedio",saveModel.getResult1());
                            jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
                            vedio = saveModel.getResult1();
                            break;
                        }
@ -669,7 +670,7 @@ public class StatisticsEsService {
                        if (StringUtils.isNoneBlank(saveModel.getDept())&&code.equalsIgnoreCase(saveModel.getDept())){
                            jsonObject.put("code",code);
                            jsonObject.put("name",saveModel.getDeptName());
                            jsonObject.put("vedio",saveModel.getResult1());
                            jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
                            vedio = saveModel.getResult1();
                            break;
                        }
@ -695,7 +696,7 @@ public class StatisticsEsService {
                                jsonObject.put("doctorJob",null);
                            }
                            jsonObject.put("doctorName",saveModel.getDoctorName());
                            jsonObject.put("vedio",saveModel.getResult1());
                            jsonObject.put("vedio",decimalFormat.format(saveModel.getResult1()));
                            vedio = saveModel.getResult1();
                            break;
                        }
@ -703,8 +704,8 @@ public class StatisticsEsService {
                }
                Double total1 = topic+vedio ;//图文和视频总和
                Double total = topic+vedio+synegy+specialist;//总和
                jsonObject.put("total1",total1);//图文和视频总和
                jsonObject.put("total",total);//总和
                jsonObject.put("total1",decimalFormat.format(total1));//图文和视频总和
                jsonObject.put("total",decimalFormat.format(total));//总和
                array.add(jsonObject);
            }
            object.put("excelData",array);
@ -729,7 +730,7 @@ public class StatisticsEsService {
    public JSONObject getPrescriptionLine(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        JSONObject object = new JSONObject();
        //开方量增量曲线
        JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
        JSONArray array = dateTotalStatistics3(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
        object.put("prescriptionLine",array);
        return object;
    }
@ -751,55 +752,80 @@ public class StatisticsEsService {
    public JSONObject getOutPatientCircular(String startDate, String endDate, String area, int level, String index, String level2_type) throws Exception {
        JSONObject object = new JSONObject();
        if (index.equalsIgnoreCase("3")){
            //协同门诊
            SaveModel saveModel1 = null;
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "2");
            //图文复诊
            SaveModel saveModel2 = null;
            //saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","1");
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","1");
            //视频复诊
            SaveModel saveModel3 = null;
/*
    saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","2");
*/
            saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","2");
            Double specialistCount =0.0;
            //专科咨询
            SaveModel saveModel4 = null;
            saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "3");
            specialistCount = saveModel4.getResult1();//专家咨询数量
            Double synergyCount = saveModel1.getResult1();//协同门诊数量
            Double topicCount = saveModel2.getResult1();//图文复诊数量
            Double videoCount = saveModel3.getResult1();//视频复诊数量
            Double total = specialistCount+synergyCount+topicCount+videoCount;//总量
            DecimalFormat decimalFormat = new DecimalFormat("0.00");
            object.put("specialistCount",decimalFormat.format(specialistCount));//专家咨询数
            object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
            object.put("synergyCount",decimalFormat.format(synergyCount));//专家咨询数
            object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
            object.put("topicCount",decimalFormat.format(topicCount));//图文复诊数量
            object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
            object.put("videoCount",decimalFormat.format(videoCount));//视频复诊数量
            object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
            object.put("total",decimalFormat.format(total));
        //协同门诊
        SaveModel saveModel1 = null;
        saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "12");
        //图文复诊
        SaveModel saveModel2 = null;
        //saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","1");
        saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "9");
        //视频复诊
        SaveModel saveModel3 = null;
        }else {
            //协同门诊
            SaveModel saveModel1 = null;
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "12");
            //图文复诊
            SaveModel saveModel2 = null;
            //saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","1");
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "9");
            //视频复诊
            SaveModel saveModel3 = null;
/*
    saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","2");
*/
        saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "16");
        Double specialistCount =0.0;
        //专科咨询
        SaveModel saveModel4 = null;
        saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1");
        specialistCount = saveModel4.getResult1();//专家咨询数量
    /*if(index.equalsIgnoreCase("5")){
        //专家咨询数量
        SaveModel saveModel = null;
        if (StringUtils.isNotEmpty(level2_type)) {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, "4", SaveModel.timeLevel_DDL, level2_type);
        } else {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, "4", SaveModel.timeLevel_DDL);
            saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "16");
            Double specialistCount =0.0;
            //专科咨询
            SaveModel saveModel4 = null;
            saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1");
            specialistCount = saveModel4.getResult1();//专家咨询数量
            Double synergyCount = saveModel1.getResult1();//协同门诊数量
            Double topicCount = saveModel2.getResult1();//图文复诊数量
            Double videoCount = saveModel3.getResult1();//视频复诊数量
            Double total = specialistCount+synergyCount+topicCount+videoCount;//总量
            object.put("specialistCount",specialistCount);//专家咨询数
            object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
            object.put("synergyCount",synergyCount);//专家咨询数
            object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
            object.put("topicCount",topicCount);//图文复诊数量
            object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
            object.put("videoCount",videoCount);//视频复诊数量
            object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
            object.put("total",total);
        }
        specialistCount = saveModel.getResult1();//专家咨询数量
    }else if (index.equalsIgnoreCase("3")){
        specialistCount = 0.0;
    }*/
        Double synergyCount = saveModel1.getResult1();//协同门诊数量
        Double topicCount = saveModel2.getResult1();//图文复诊数量
        Double videoCount = saveModel3.getResult1();//视频复诊数量
        Double total = specialistCount+synergyCount+topicCount+videoCount;//总量
        DecimalFormat decimalFormat = new DecimalFormat("#.00");
        object.put("specialistCount",decimalFormat.format(specialistCount));//专家咨询数
        object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
        object.put("synergyCount",decimalFormat.format(synergyCount));//专家咨询数
        object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
        object.put("topicCount",decimalFormat.format(topicCount));//图文复诊数量
        object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
        object.put("videoCount",decimalFormat.format(videoCount));//视频复诊数量
        object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
        object.put("total",decimalFormat.format(total));
        return object;
    }
@ -1396,54 +1422,513 @@ public class StatisticsEsService {
            json.put("num",0.0);
            result.add(json);
        }
        DecimalFormat decimalFormat = new DecimalFormat("#.00");
//        }
//        }
        if (saveModels != null) {
            // 计算结果
            for (SaveModel saveModel : saveModels) {
                JSONObject json = new JSONObject();
                String range = null;
                if (saveModel.getQuotaDate() != null) {
                    range = df.format(saveModel.getQuotaDate());
                }
                double num = saveModel.getResult1();
                long amount = saveModel.getResult2().longValue();
                for(JSONObject obj : result){
                    if((obj.get("range")+"").equals(range)){
                        obj.put("amount", amount);
                        obj.put("num",num);
                    }
                }
//                json.put("range", range);
//                json.put("amount", amount);
//                result.add(json);
            }
//            if (saveModels != null && saveModels.size() == 1 && saveModels.get(0).getHospital() == null) {
//                List<Map<String, Object>> resultList = DateUtil.findDates(dateFormat.parse(startDate), dateFormat.parse(DateUtil.getNextDay(endDate, 1)));
//                result.clear();
//                for (Map<String, Object> map : resultList) {
//                    JSONObject json = new JSONObject();
//                    json.put("range", map.get("date"));
//                    json.put("amount", 0);
//                    result.add(json);
//                }
//            }
//            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
//            Date startDate1 = sf.parse(startDate);
//            Date endDate1 = sf.parse(endDate);
//            long days = DateUtil.getDays(startDate1,endDate1);
//            Calendar calendar = Calendar.getInstance();
//            calendar.setTime(startDate1);
//            List<JSONObject> resultTemp = new ArrayList<>();
//            for(int i=1;i<=days;i++){
//                calendar.add(calendar.DATE,i);//把日期往后增加一天.整数往后推,负数往前移动
//                String dateString = sf.format(calendar.getTime());
//                Map<String, Object> map = new HashMap<>();
//                map.put("range",sf.format(calendar.getTime()));
//                map.put()
//            }
            // 排序
            result.sort(new Comparator<JSONObject>() {
                @Override
                public int compare(JSONObject o1, JSONObject o2) {
                    if (o1.getString("range").compareTo(o2.getString("range")) > 0) {
                        return 1;
                    } else if (o1.getString("range").compareTo(o2.getString("range")) < 0) {
                        return -1;
                    } else {
                        return 0;
                    }
                }
            });
            JSONArray jsonArray = new JSONArray();
            for (JSONObject object:result){
                jsonArray.add(object);
            }
            return jsonArray;
        } else {
            return new JSONArray();
        }
    }
    /**
     * 总体分析 折线图 按日--0级维度1级维度--两位小数
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @param lowCode
     * @return
     * @throws ParseException
     */
    public JSONArray dateTotalStatistics3(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        List<SaveModel> saveModels = new ArrayList<>();
        //startDate = DateUtil.getNextDay(startDate,-1);
        if (StringUtils.isNotBlank(lowCode)) {
            if (StringUtils.isNoneBlank(lowCode2)){
                saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode,lowCode2);
            }else {
                saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day, lowCode);
            }
        }else if(StringUtils.isNoneBlank(lowCode2)&&!StringUtils.isNoneBlank(lowCode)){
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day,lowCode2);
        }else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_day);
        }
        List<JSONObject> result = new ArrayList<>();
//        if (saveModels != null && saveModels.size() >0) {
        List<Map<String, Object>> resultList = DateUtil.findDates(dateFormat.parse(startDate), dateFormat.parse(DateUtil.getNextDay(endDate, 1)));
//            result.clear();
        for (Map<String, Object> one : resultList) {
            JSONObject json = new JSONObject();
            json.put("range", one.get("date"));
            json.put("amount", 0);
            json.put("num",0.0);
            result.add(json);
        }
//        }
        DecimalFormat decimalFormat = new DecimalFormat("0.00");
        if (saveModels != null) {
            // 计算结果
            for (SaveModel saveModel : saveModels) {
                JSONObject json = new JSONObject();
                String range = null;
                if (saveModel.getQuotaDate() != null) {
                    range = df.format(saveModel.getQuotaDate());
                }
                double num = saveModel.getResult1();
                long amount = saveModel.getResult2().longValue();
                for(JSONObject obj : result){
                    if((obj.get("range")+"").equals(range)){
                        obj.put("amount", amount);
                        obj.put("num",decimalFormat.format(num));
                    }
                }
//                json.put("range", range);
//                json.put("amount", amount);
//                result.add(json);
            }
//            if (saveModels != null && saveModels.size() == 1 && saveModels.get(0).getHospital() == null) {
//                List<Map<String, Object>> resultList = DateUtil.findDates(dateFormat.parse(startDate), dateFormat.parse(DateUtil.getNextDay(endDate, 1)));
//                result.clear();
//                for (Map<String, Object> map : resultList) {
//                    JSONObject json = new JSONObject();
//                    json.put("range", map.get("date"));
//                    json.put("amount", 0);
//                    result.add(json);
//                }
//            }
//            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
//            Date startDate1 = sf.parse(startDate);
//            Date endDate1 = sf.parse(endDate);
//            long days = DateUtil.getDays(startDate1,endDate1);
//            Calendar calendar = Calendar.getInstance();
//            calendar.setTime(startDate1);
//            List<JSONObject> resultTemp = new ArrayList<>();
//            for(int i=1;i<=days;i++){
//                calendar.add(calendar.DATE,i);//把日期往后增加一天.整数往后推,负数往前移动
//                String dateString = sf.format(calendar.getTime());
//                Map<String, Object> map = new HashMap<>();
//                map.put("range",sf.format(calendar.getTime()));
//                map.put()
//            }
            // 排序
            result.sort(new Comparator<JSONObject>() {
                @Override
                public int compare(JSONObject o1, JSONObject o2) {
                    if (o1.getString("range").compareTo(o2.getString("range")) > 0) {
                        return 1;
                    } else if (o1.getString("range").compareTo(o2.getString("range")) < 0) {
                        return -1;
                    } else {
                        return 0;
                    }
                }
            });
            JSONArray jsonArray = new JSONArray();
            for (JSONObject object:result){
                jsonArray.add(object);
            }
            return jsonArray;
        } else {
            return new JSONArray();
        }
    }
    /**
     * 按周统计 折线图
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @param lowCode
     * @return
     * @throws Exception
     */
    private JSONArray weekTotalStatistics(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel) throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        // 起始日期
        Calendar start = Calendar.getInstance();
        start.setTime(DateUtil.strToDate(startDate, DateUtil.YYYY_MM_DD));
        // 第一个统计周期结束日期
        String firstEnd = "";
        // 结束日期
        Calendar end = Calendar.getInstance();
        //因为统计时间是统计到当前时间的前一天,所以这里的时间是提前一天
        Calendar temp = Calendar.getInstance();
        temp.setTime(DateUtil.strToDate(endDate, DateUtil.YYYY_MM_DD));
//        temp.add(Calendar.DAY_OF_MONTH, -1);
        end.setTime(temp.getTime());
        // 起始日期为周几
        int week = start.get(Calendar.DAY_OF_WEEK);
        int incre = 7 - week + 1;
        // 日期集合
        List<Calendar> days = new ArrayList<>();
        days.add(start);
        boolean flag = true;
        int i = 0;
        if (startDate.compareTo(endDate) == 0) {
            flag = false;
            days.add(end);
            firstEnd = df.format(end.getTime());
        }
        // 计算统计日期
        while (flag) {
            Calendar next = Calendar.getInstance();
            next.setTime(days.get(days.size() - 1).getTime());
            if (i == 0) {
                if (incre != 7) {
                    next.add(Calendar.DATE, incre);
                }
            } else {
                next.add(Calendar.DATE, 7);
            }
            if (next.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))) {
                days.add(next);
                if (i == 0) {
                    firstEnd = df.format(next.getTime());
                }
            } else {
                days.add(end);
                flag = false;
                if (i == 0) {
                    firstEnd = df.format(end.getTime());
                }
            }
            i++;
        }
        // 结果集
        Map<String, JSONObject> countResult = new HashMap<>();
//        Date dd = df.parse();
        // 算出每个查询周期
        for (int j = 0; j < days.size() - 1; j++) {
            String startStr = "";
            String endStr = df.format(days.get(j + 1).getTime());
            // 起始、截止日期
            if (j == 0) {
                startStr = df.format(days.get(j).getTime());
            } else {
                Calendar cal = Calendar.getInstance();
                cal.setTime(days.get(j).getTime());
                cal.add(Calendar.DATE, 1);
                startStr = df.format(cal.getTime());
            }
            JSONObject range = new JSONObject();
            range.put("range", endStr);
            range.put("amount", 0);
            range.put("num",0.0);
            countResult.put(endStr, range);
//            if(!DateUtil.getSundayOfThisDate(new Date()).equals(df.format(new Date()))){
//                JSONObject range2 = new JSONObject();
//                range2.put("range", endDate);
//                range2.put("amount", 0);
//                countResult.put(df.format(new Date()), range2);
//            };
        }
        if (startDate.equals(df.format(new Date()))) {
            Calendar preDate = Calendar.getInstance();
            preDate.setTime(df.parse(endDate));
            preDate.add(Calendar.DATE, -1);
            startDate = df.format(preDate.getTime());
        }
        List<SaveModel> saveModels = new ArrayList<>();
        if (StringUtils.isNotBlank(lowCode)) {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode);
        } else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week);
        }
        if (saveModels != null) {
            // 计算结果
            for (SaveModel saveModel : saveModels) {
                String range = "";
                if (saveModel.getQuotaDate() != null) {
                    Calendar quotaDate = Calendar.getInstance();
                    quotaDate.setTime(saveModel.getQuotaDate());
                    quotaDate.add(Calendar.DATE, 6);
                    range = df.format(quotaDate.getTime());
                }
                JSONObject json = countResult.get(range);
//                //因为上述时间集提前一天  但是前端是显示当前时间,所以这里给调整回去
//                if (range.equals(df.format(temp.getTime()))) {
//                    json.put("range", endDate);
//                }
                if (json != null) {
                    long amount = saveModel.getResult2().longValue();
                    double num = saveModel.getResult1();
                    json.put("amount", amount);
                    json.put("num",num);
                }
            }
            List<JSONObject> result = new ArrayList<>(countResult.values());
            // 排序
            result.sort(new Comparator<JSONObject>() {
                @Override
                public int compare(JSONObject o1, JSONObject o2) {
                    if (o1.getString("range").compareTo(o2.getString("range")) > 0) {
                        return 1;
                    } else if (o1.getString("range").compareTo(o2.getString("range")) < 0) {
                        return -1;
                    } else {
                        return 0;
                    }
                }
            });
            JSONArray jsonArray = new JSONArray();
            for (JSONObject object:result){
                jsonArray.add(object);
            }
            return jsonArray;
        } else {
            return new JSONArray();
        }
    }
    /**
     * 按周统计 折线图
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @param lowCode
     * @return
     * @throws Exception
     */
    private JSONArray weekTotalStatisticsDf(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel) throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        // 起始日期
        Calendar start = Calendar.getInstance();
        start.setTime(DateUtil.strToDate(startDate, DateUtil.YYYY_MM_DD));
        // 第一个统计周期结束日期
        String firstEnd = "";
        // 结束日期
        Calendar end = Calendar.getInstance();
        //因为统计时间是统计到当前时间的前一天,所以这里的时间是提前一天
        Calendar temp = Calendar.getInstance();
        temp.setTime(DateUtil.strToDate(endDate, DateUtil.YYYY_MM_DD));
//        temp.add(Calendar.DAY_OF_MONTH, -1);
        end.setTime(temp.getTime());
        // 起始日期为周几
        int week = start.get(Calendar.DAY_OF_WEEK);
        int incre = 7 - week + 1;
        // 日期集合
        List<Calendar> days = new ArrayList<>();
        days.add(start);
        boolean flag = true;
        int i = 0;
        if (startDate.compareTo(endDate) == 0) {
            flag = false;
            days.add(end);
            firstEnd = df.format(end.getTime());
        }
        // 计算统计日期
        while (flag) {
            Calendar next = Calendar.getInstance();
            next.setTime(days.get(days.size() - 1).getTime());
            if (i == 0) {
                if (incre != 7) {
                    next.add(Calendar.DATE, incre);
                }
            } else {
                next.add(Calendar.DATE, 7);
            }
            if (next.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))) {
                days.add(next);
                if (i == 0) {
                    firstEnd = df.format(next.getTime());
                }
            } else {
                days.add(end);
                flag = false;
                if (i == 0) {
                    firstEnd = df.format(end.getTime());
                }
            }
            i++;
        }
        // 结果集
        Map<String, JSONObject> countResult = new HashMap<>();
//        Date dd = df.parse();
        // 算出每个查询周期
        for (int j = 0; j < days.size() - 1; j++) {
            String startStr = "";
            String endStr = df.format(days.get(j + 1).getTime());
            // 起始、截止日期
            if (j == 0) {
                startStr = df.format(days.get(j).getTime());
            } else {
                Calendar cal = Calendar.getInstance();
                cal.setTime(days.get(j).getTime());
                cal.add(Calendar.DATE, 1);
                startStr = df.format(cal.getTime());
            }
            JSONObject range = new JSONObject();
            range.put("range", endStr);
            range.put("amount", 0);
            range.put("num",0.0);
            countResult.put(endStr, range);
//            if(!DateUtil.getSundayOfThisDate(new Date()).equals(df.format(new Date()))){
//                JSONObject range2 = new JSONObject();
//                range2.put("range", endDate);
//                range2.put("amount", 0);
//                countResult.put(df.format(new Date()), range2);
//            };
        }
        if (startDate.equals(df.format(new Date()))) {
            Calendar preDate = Calendar.getInstance();
            preDate.setTime(df.parse(endDate));
            preDate.add(Calendar.DATE, -1);
            startDate = df.format(preDate.getTime());
        }
        List<SaveModel> saveModels = new ArrayList<>();
        if (StringUtils.isNotBlank(lowCode)) {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode);
        } else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week);
        }
        DecimalFormat decimalFormat = new DecimalFormat("0.00");
        if (saveModels != null) {
            // 计算结果
            for (SaveModel saveModel : saveModels) {
                JSONObject json = new JSONObject();
                String range = null;
                String range = "";
                if (saveModel.getQuotaDate() != null) {
                    range = df.format(saveModel.getQuotaDate());
                    Calendar quotaDate = Calendar.getInstance();
                    quotaDate.setTime(saveModel.getQuotaDate());
                    quotaDate.add(Calendar.DATE, 6);
                    range = df.format(quotaDate.getTime());
                }
                double num = saveModel.getResult1();
                long amount = saveModel.getResult2().longValue();
                for(JSONObject obj : result){
                    if((obj.get("range")+"").equals(range)){
                        obj.put("amount", amount);
                        obj.put("num",decimalFormat.format(num));
                    }
                JSONObject json = countResult.get(range);
//                //因为上述时间集提前一天  但是前端是显示当前时间,所以这里给调整回去
//                if (range.equals(df.format(temp.getTime()))) {
//                    json.put("range", endDate);
//                }
                if (json != null) {
                    long amount = saveModel.getResult2().longValue();
                    double num = saveModel.getResult1();
                    json.put("amount", amount);
                    json.put("num",decimalFormat.format(num));
                }
//                json.put("range", range);
//                json.put("amount", amount);
//                result.add(json);
            }
//            if (saveModels != null && saveModels.size() == 1 && saveModels.get(0).getHospital() == null) {
//                List<Map<String, Object>> resultList = DateUtil.findDates(dateFormat.parse(startDate), dateFormat.parse(DateUtil.getNextDay(endDate, 1)));
//                result.clear();
//                for (Map<String, Object> map : resultList) {
//                    JSONObject json = new JSONObject();
//                    json.put("range", map.get("date"));
//                    json.put("amount", 0);
//                    result.add(json);
//                }
//            }
//            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
//            Date startDate1 = sf.parse(startDate);
//            Date endDate1 = sf.parse(endDate);
//            long days = DateUtil.getDays(startDate1,endDate1);
//            Calendar calendar = Calendar.getInstance();
//            calendar.setTime(startDate1);
//            List<JSONObject> resultTemp = new ArrayList<>();
//            for(int i=1;i<=days;i++){
//                calendar.add(calendar.DATE,i);//把日期往后增加一天.整数往后推,负数往前移动
//                String dateString = sf.format(calendar.getTime());
//                Map<String, Object> map = new HashMap<>();
//                map.put("range",sf.format(calendar.getTime()));
//                map.put()
//            }
            List<JSONObject> result = new ArrayList<>(countResult.values());
            // 排序
            result.sort(new Comparator<JSONObject>() {
@ -1469,21 +1954,7 @@ public class StatisticsEsService {
        }
    }
    /**
     * 按周统计 折线图
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @param lowCode
     * @return
     * @throws Exception
     */
    private JSONArray weekTotalStatistics(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel) throws Exception {
    private JSONArray weekTotalStatistics2(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        // 起始日期
@ -1588,11 +2059,19 @@ public class StatisticsEsService {
        List<SaveModel> saveModels = new ArrayList<>();
        if (StringUtils.isNotBlank(lowCode)) {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode);
        } else {
            if (StringUtils.isNoneBlank(lowCode2)){
                saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode,lowCode2);
            }else {
                saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week, lowCode);
            }
        }else if(StringUtils.isNoneBlank(lowCode2)&&StringUtils.isBlank(lowCode)){
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week,lowCode2);
        }
        else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week);
        }
        DecimalFormat decimalFormat = new DecimalFormat("#.00");
        if (saveModels != null) {
            // 计算结果
            for (SaveModel saveModel : saveModels) {
@ -1613,7 +2092,7 @@ public class StatisticsEsService {
                    long amount = saveModel.getResult2().longValue();
                    double num = saveModel.getResult1();
                    json.put("amount", amount);
                    json.put("num",decimalFormat.format(num));
                    json.put("num",num);
                }
            }
@ -1644,7 +2123,20 @@ public class StatisticsEsService {
    }
    private JSONArray weekTotalStatistics2(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
    /**
     * 两位小数
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @param lowCode
     * @param timelevel
     * @param lowCode2
     * @return
     * @throws Exception
     */
    private JSONArray weekTotalStatistics3(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        // 起始日期
@ -1762,6 +2254,7 @@ public class StatisticsEsService {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_week);
        }
        DecimalFormat decimalFormat = new DecimalFormat("0.00");
        if (saveModels != null) {
            // 计算结果
            for (SaveModel saveModel : saveModels) {
@ -1782,7 +2275,7 @@ public class StatisticsEsService {
                    long amount = saveModel.getResult2().longValue();
                    double num = saveModel.getResult1();
                    json.put("amount", amount);
                    json.put("num",num);
                    json.put("num",decimalFormat.format(num));
                }
            }
@ -1907,7 +2400,150 @@ public class StatisticsEsService {
        } else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month);
        }
        DecimalFormat decimalFormat = new DecimalFormat("#.00");
        if (saveModels != null) {
            // 计算结果
            for (SaveModel saveModel : saveModels) {
                String range = "";
                if (saveModel.getQuotaDate() != null) {
                    range = df.format(saveModel.getQuotaDate());
                }
                JSONObject json = countResult.get(range);
                //因为上述时间集提前一天  但是前端是显示当前时间,所以这里给调整回去
                /*if (range.equals(df.format(temp.getTime()))) {
                    json.put("range", endDate);
                }*/
                if (json != null) {
                    long amount = saveModel.getResult2().longValue();
                    double num = saveModel.getResult1();
                    json.put("amount", amount);
                    json.put("num",num);
                }
            }
            List<JSONObject> result = new ArrayList<>(countResult.values());
            // 排序
            result.sort(new Comparator<JSONObject>() {
                @Override
                public int compare(JSONObject o1, JSONObject o2) {
                    if (o1.getString("range").compareTo(o2.getString("range")) > 0) {
                        return 1;
                    } else if (o1.getString("range").compareTo(o2.getString("range")) < 0) {
                        return -1;
                    } else {
                        return 0;
                    }
                }
            });
            JSONArray jsonArray = new JSONArray();
            for (JSONObject object:result){
                jsonArray.add(object);
            }
            return jsonArray;
        } else {
            return new JSONArray();
        }
    }
    /**
     * 按月统计 折线图---两位小数
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @param lowCode
     * @return
     * @throws Exception
     */
    private JSONArray monthTotalStatistics3(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel,String lowCode2) throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        // 起始日期
        Calendar start = Calendar.getInstance();
        start.setTime(DateUtil.strToDate(startDate, DateUtil.YYYY_MM_DD));
        // 结束日期
        Calendar end = Calendar.getInstance();
        //因为统计时间是统计到当前时间的前一天,所以这里的时间是提前一天
        Calendar temp = Calendar.getInstance();
        temp.setTime(DateUtil.strToDate(endDate, DateUtil.YYYY_MM_DD));
//        temp.add(Calendar.DAY_OF_MONTH, -1);
        end.setTime(temp.getTime());
        // 日期集合
        List<Calendar> days = new ArrayList<>();
        days.add(start);
        boolean flag = true;
        int k = 0;
        if (startDate.compareTo(endDate) == 0) {
            flag = false;
       /*     days.add(end);*/
        }
        // 统计日期计算
        while (flag) {
            Calendar next = Calendar.getInstance();
            next.setTime(days.get(days.size() - 1).getTime());
            if (k == 0) {
                next.add(Calendar.MONTH, 1);
            } else {
                next.add(Calendar.MONTH, 1);
            }
            /*next.set(Calendar.DAY_OF_MONTH, 1);
            next.add(Calendar.DAY_OF_MONTH, -1);*/
            if (next.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))) {
                days.add(next);
            } else {
         /*       days.add(end);*/
                flag = false;
            }
            k++;
        }
        // 统计结果
        Map<String, JSONObject> countResult = new HashMap<>();
        for (int i = 0; i < days.size(); i++) {
            String endStr = df.format(days.get(i).getTime());
            JSONObject range = new JSONObject();
            range.put("range", endStr);
            range.put("amount", 0);
            range.put("num",0.0);
            countResult.put(endStr, range);
        }
        if (startDate.equals(df.format(new Date()))) {
            Calendar preDate = Calendar.getInstance();
            preDate.setTime(df.parse(endDate));
            startDate = df.format(preDate.getTime());
        }
        List<SaveModel> saveModels = new ArrayList<>();
        if (StringUtils.isNotBlank(lowCode)) {
            if (StringUtils.isNoneBlank(lowCode2)){
                saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode,lowCode2);
            }else {
                saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode);
            }
        } else if(StringUtils.isNoneBlank(lowCode2)&&StringUtils.isBlank(lowCode)){
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel2OnlySlaveKey2(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month,lowCode2);
        } else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month);
        }
        DecimalFormat decimalFormat = new DecimalFormat("0.00");
        if (saveModels != null) {
            // 计算结果
@ -3043,11 +3679,11 @@ public class StatisticsEsService {
                object.put("totalData",array);//新增量
                JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL,null);//未接诊
                object.put("noReceiveData",array1);//未接诊
                JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,index1,"1",SaveModel.timeLevel_ZL,null);//已接诊
                JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,index1,"1,2",SaveModel.timeLevel_ZL,null);//已接诊
                object.put("haveReceiveData",array2);//已接诊
                JSONArray array3 = dateTotalStatistics2(startDate,endDate,area,level,index,"-1",SaveModel.timeLevel_ZL,null);//患者取消
                object.put("concleData",array3);//患者取消
                JSONArray array4 = dateTotalStatistics2(startDate,endDate,area,level,index,"2",SaveModel.timeLevel_ZL,null);//已结束
                JSONArray array4 = dateTotalStatistics2(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,null);//已结束
                object.put("endData",array4);//已结束
            }
@ -3068,11 +3704,11 @@ public class StatisticsEsService {
                object.put("totalData",array);//新增量
                JSONArray array1 = weekTotalStatistics(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL);//未接诊
                object.put("noReceiveData",array1);;//未接诊
                JSONArray array2 = weekTotalStatistics(startDate,endDate,area,level,index1,"1",SaveModel.timeLevel_ZL);//已接诊
                JSONArray array2 = weekTotalStatistics(startDate,endDate,area,level,index1,"1,2",SaveModel.timeLevel_ZL);//已接诊
                object.put("haveReceiveData",array2);//已接诊
                JSONArray array3 = weekTotalStatistics(startDate,endDate,area,level,index,"-1",SaveModel.timeLevel_ZL);//患者取消
                object.put("concleData",array3);//患者取消
                JSONArray array4 = weekTotalStatistics(startDate,endDate,area,level,index,"2",SaveModel.timeLevel_ZL);//已结束
                JSONArray array4 = weekTotalStatistics(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL);//已结束
                object.put("endData",array3);//已结束
            }
@ -3093,11 +3729,11 @@ public class StatisticsEsService {
                object.put("totalData",array);
                JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL,null);
                object.put("noReceiveData",array1);
                JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,index1,"1",SaveModel.timeLevel_ZL,null);
                JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,index1,"1,2",SaveModel.timeLevel_ZL,null);
                object.put("haveReceiveData",array2);
                JSONArray array3 = monthTotalStatistics2(startDate,endDate,area,level,index,"-1",SaveModel.timeLevel_ZL,null);
                object.put("concleData",array3);
                JSONArray array4 = monthTotalStatistics2(startDate,endDate,area,level,index,"2",SaveModel.timeLevel_ZL,null);
                JSONArray array4 = monthTotalStatistics2(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL,null);
                object.put("endData",array4);
            }
@ -3135,13 +3771,13 @@ public class StatisticsEsService {
            result.put("resultList", getCoutListPC(level, lowLevel, endTotal, total, noRelyTotal,relyTotal,comingTotal));
        }else {
            //已结束
            List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"2");
            List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"3");
            //居民取消
            List<SaveModel> concleTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"-1");
            //咨询总数
            List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel);
            //已接诊
            List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"1");
            List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"1,2");
            //未接诊
            List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"0");
            result.put("resultList", getCoutListPC1(level, lowLevel, endTotal, total, haveReceiveTotal,noReceiveTotal,concleTotal));

+ 34 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPatientRegisterDO.java

@ -23,7 +23,17 @@ public class WlyyPatientRegisterDO extends UuidIdentityEntity {
    private String conNo;//就诊次数
    private String registerNo;//挂号流水号',
    private String date;//yyyy-MM-dd',
    private Integer del;//删除标识
    private Date createTime;//创建时间',
    /**
     * his单据号
     */
    private String xtgzh;
    /**
     * 处方号
     */
    private String realOrder;
    public String getPatient() {
        return patient;
@ -105,4 +115,28 @@ public class WlyyPatientRegisterDO extends UuidIdentityEntity {
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    public String getXtgzh() {
        return xtgzh;
    }
    public void setXtgzh(String xtgzh) {
        this.xtgzh = xtgzh;
    }
    public String getRealOrder() {
        return realOrder;
    }
    public void setRealOrder(String realOrder) {
        this.realOrder = realOrder;
    }
}

+ 5 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

@ -23,6 +23,7 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.apache.axis.utils.Admin;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -444,7 +445,8 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
        JSONObject result = new JSONObject();
        List<OrgTree> orgList = new ArrayList<>();
        // 有归属租户加载saas底下的所有机构树列表,角色为机构管理员时不需要选管理机构
        if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(RoleDO.BaseRoleType.admin.toString(),roleId)){
        String admin ="admin";
        if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(admin,roleId)){
            StringBuilder sql = new StringBuilder("SELECT " +
                    "  tree.* " +
                    " FROM " +
@ -498,8 +500,9 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
    public JSONObject orgChoiceInfo(String saasid,String userId,String roleId) throws IOException {
        JSONObject result = new JSONObject();
        List<OrgTree> orgList = new ArrayList<>();
        String admin = "admin";
        // 有归属租户加载saas底下的所有机构树列表,角色为机构管理员时不需要选管理机构
        if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(RoleDO.BaseRoleType.admin.toString(),roleId)){
        if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(admin,roleId)){
            StringBuilder sql = new StringBuilder("SELECT tree.*  FROM org_tree tree, base_org org, base_org_saas saas WHERE org.code = saas.org_code and 'null'= '{saasid}';");
 //           StringBuilder sql = new StringBuilder("SELECT tree.* FROM base_org base , org_tree tree WHERE base.`code` = tree.code ");
            orgList = jdbcTemplate.query(sql.toString().replace("{saasid}","null"),new BeanPropertyRowMapper(OrgTree.class));

+ 4 - 2
svr/svr-base/src/main/resources/application.yml

@ -358,7 +358,8 @@ wechat:
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
im:
  im_list_get: http://172.26.0.105:3000/
---
spring:
  profiles: jwOracleProd
@ -406,7 +407,8 @@ wechat:
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
im:
  im_list_get: http://172.26.0.105:3000/
---
spring:
  profiles: iotprod

+ 4 - 0
svr/svr-internet-hospital-entrance/src/mqConfig/esbmq-config.xml

@ -24,6 +24,10 @@
				<BS10110_1>EwellQ.S60.BS10110.GET</BS10110_1>
				<BS10111_0>EwellQ.S60.BS10111.PUT</BS10111_0>
				<BS10111_1>EwellQ.S60.BS10111.GET</BS10111_1>
				<BS10138_0>EwellQ.S60.BS10138.PUT</BS10138_0>
				<BS10138_1>EwellQ.S60.BS10138.GET</BS10138_1>
				<BS15054_0>EwellQ.S60.BS15054.PUT</BS15054_0>
				<BS15054_1>EwellQ.S60.BS15054.GET</BS15054_1>
				<BS10112_0>EwellQ.S60.BS10112.PUT</BS10112_0>
				<BS10112_1>EwellQ.S60.BS10112.GET</BS10112_1>
				<BS10114_0>EwellQ.S60.BS10114.PUT</BS10114_0>

+ 2 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/AutoTimeOutRemind.java

@ -32,7 +32,7 @@ import java.util.List;
public class AutoTimeOutRemind implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(AutoTimeOutRemind.class);
    private static String cron = "0 0/5 * * * ?";
    private static String cron = "0 0/30 * * * ?";
    private static String dictName = "remind_patient_job";
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
@ -45,7 +45,7 @@ public class AutoTimeOutRemind implements SchedulingConfigurer {
    @Value("${wechat.ids}")
    private String wxId;
    public AutoTimeOutRemind() {
      cron = "0 0/5 * * * ?";
      cron = "0 0/30 * * * ?";
        System.out.println("创建时的corn"+cron);
    }
    public String change(String corIn){

+ 2 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java

@ -27,9 +27,9 @@ import java.util.List;
@EnableScheduling
public class OverdueJob implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(OverdueJob.class);
    private static String cron = "0 0 1 * * ?";
    private static String cron = "0 0 0 * * ?";
    public OverdueJob(){
        cron="0 0 1 * * ?";
        cron="0 0 0 * * ?";
        System.out.println("初始化时的corn"+cron);
    }
    @Autowired

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

@ -19,6 +19,7 @@ import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.im.dao.ConsultDao;
@ -107,6 +108,8 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	private PatientMappingDao patientMappingDao;
	@Autowired
	private PrescriptionDao prescriptionDao;
	@Autowired
	private EntranceService entranceService;
	
	@Value("${wechat.id}")
	private String wxId;
@ -255,7 +258,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			if(!"xm_ykyy_wx".equals(wxId)){//中山医院-心脏中心需要挂号
				//1.调用退号接口
				logger.info("调用挂号接口====START");
				logger.info("调用退号接口====START");
				String rsCode = "";
				String mes = "";
				if("xm_xzzx_wx".equals(wxId)){ //心脏中心挂号
@ -421,35 +424,39 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (StringUtils.isNoneBlank(cons.getRelationCode())){
			Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
			Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
			List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient(),startTime,endTime);
			//发送诊断支付
			if (wlyyOutpatientDOList==null||wlyyOutpatientDOList.size()==0){
				WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
				List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
				if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
					logger.info("发送诊查费支付模板消息start");
					BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
					String userName = null;
					String idcard = null;
					if (patientDO != null) {
						userName = patientDO.getName();
						idcard = patientDO.getIdcard();
					}
					PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
					String userNo = null;
					if (patientMappingDO != null) {
						userNo = patientMappingDO.getMappingCode();
					}
					String cardNo = null;
					if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
						cardNo = outpatientDO.getCardNo();
					}
					String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, "15", "1");
					logger.info("发送诊查费支付模板消息end");
			WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
			List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
			if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
				logger.info("发送诊查费支付模板消息start");
				BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
				String userName = null;
				String idcard = null;
				if (patientDO != null) {
					userName = patientDO.getName();
					idcard = patientDO.getIdcard();
				}
				PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
				String userNo = null;
				if (patientMappingDO != null) {
					userNo = patientMappingDO.getMappingCode();
				}
				String cardNo = null;
				if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
					cardNo = outpatientDO.getCardNo();
				}
				String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
				net.sf.json.JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),outpatientDO.getRealOrder(),false);
				net.sf.json.JSONObject res = object.getJSONObject("resquest");
				logger.info("获取待结算数据 res: " + res.toString());
				String rsCode = res.getString("@RESULT");
				String free= 0+"";
				if ("0".equals(rsCode)) {
					free = res.getString("@total_charge");
				}
				if (!free.equalsIgnoreCase("0")){
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
				}
				logger.info("发送诊查费支付模板消息end");
			}
		}
		if(1 == resutl){

+ 36 - 28
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -22,6 +22,7 @@ import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.im.dao.ConsultDao;
@ -127,6 +128,8 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	private PatientMappingDao patientMappingDao;
	@Autowired
	private PrescriptionDao prescriptionDao;
	@Autowired
	private EntranceService entranceService;
	@Value("${fastDFS.fastdfs_file_url}")
@ -630,36 +633,41 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(cons.getRelationCode())){
			Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
			Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
			List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient(),startTime,endTime);
			//发送诊断支付
			if (wlyyOutpatientDOList==null||wlyyOutpatientDOList.size()==0){
				WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
				List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
				if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
					logger.info("发送诊查费支付模板消息start");
					BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
					String userName = null;
					String idcard = null;
					if (patientDO != null) {
						userName = patientDO.getName();
						idcard = patientDO.getIdcard();
					}
					PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
					String userNo = null;
					if (patientMappingDO != null) {
						userNo = patientMappingDO.getMappingCode();
					}
					String cardNo = null;
					if (org.apache.commons.lang3.StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
						cardNo = outpatientDO.getCardNo();
					}
					String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, "15", "1");
					logger.info("发送诊查费支付模板消息end");
			WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
			List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
			if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
				logger.info("发送诊查费支付模板消息start");
				BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
				String userName = null;
				String idcard = null;
				if (patientDO != null) {
					userName = patientDO.getName();
					idcard = patientDO.getIdcard();
				}
				PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
				String userNo = null;
				if (patientMappingDO != null) {
					userNo = patientMappingDO.getMappingCode();
				}
				String cardNo = null;
				if (org.apache.commons.lang3.StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
					cardNo = outpatientDO.getCardNo();
				}
				String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
				net.sf.json.JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),outpatientDO.getRealOrder(),false);
				net.sf.json.JSONObject res = object.getJSONObject("resquest");
				logger.info("获取待结算数据 res: " + res.toString());
				String rsCode = res.getString("@RESULT");
				String free= 0+"";
				if ("0".equals(rsCode)) {
					free = res.getString("@total_charge");
				}
				if (!free.equalsIgnoreCase("0")){
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
				}
				logger.info("发送诊查费支付模板消息end");
			}
		}
		if(1 == resutl){
			jsonStr = "{\"id\":\""+UUID.randomUUID().toString()+"\",\"sender_id\":\""+patientCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";

+ 29 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseDoctorBGController.java

@ -1,10 +1,14 @@
package com.yihu.jw.hospital.endpoint.hospital;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.doctor.BaseDoctorBackgroundDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorMessageDO;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.hospital.doctor.dao.service.BaseDoctorBGService;
import com.yihu.jw.hospital.prescription.service.PayInfoNoticeService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
@ -13,6 +17,8 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
@ -22,6 +28,10 @@ import java.util.Map;
public class BaseDoctorBGController extends EnvelopRestEndpoint {
    @Autowired
    private BaseDoctorBGService baseDoctorBGService;
    @Autowired
    private PayInfoNoticeService payInfoNoticeService;
    @Autowired
    private StatisticsEsService statisticsEsService;
    @ApiOperation("获取背景板")
    @PostMapping(value= BaseHospitalRequestMapping.BaseBackground.getAllBackground)
    public Envelop getAllBG( @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
@ -133,4 +143,23 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
                                  @RequestParam(value = "id", required = true)String id) throws Exception{
        return success(baseDoctorBGService.delDoctorMessage(id));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.pushListWrite)
    @ApiOperation(value = "订单导出", notes = "订单导出")
    public void pushListWrite(@ApiParam(name = "status", value = "流程状态,多状态用‘,’分割")
                              @RequestParam(value = "status", required = false)String status,
                              @ApiParam(name = "oneselfPickupFlg", value = "是否自取 1是 0否")
                              @RequestParam(value = "oneselfPickupFlg", required = false)String oneselfPickupFlg,
                              @ApiParam(name = "nameKey", value = "配送员名称")
                              @RequestParam(value = "nameKey", required = false)String nameKey,
                              @ApiParam(name = "startTime", value = "开始时间,yyyy-MM-dd")
                              @RequestParam(value = "startTime", required = false)String startTime,
                              @ApiParam(name = "endTime", value = "结束时间,yyyy-MM-dd")
                              @RequestParam(value = "endTime", required = false)String endTime,
                              HttpServletResponse response) throws Exception{
        JSONObject jsonObject = new JSONObject();
        response.setContentType("octets/stream");
        response.setHeader("Content-Disposition", "attachment; filename="+ new String( "pushDataList.xls"));
        OutputStream os = response.getOutputStream();
        payInfoNoticeService.exportEsPrescription(os,jsonObject);
    }
}

+ 2 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -77,13 +77,13 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                    String Next_Of_Kin_Phone = jsonObject.get("Phone_Number_Business").toString();
                    if(!Next_Of_Kin_Phone.equalsIgnoreCase(phoneNum)){
                        mixEnvelop.setStatus(408);
                        mixEnvelop.setMessage("您所添加的家属的电话有误,无法添加");
                        mixEnvelop.setMessage("您所添加的家属的电话有误,无法发送验证码");
                        return mixEnvelop;
                    }
                }
                if(!Pat_name.equalsIgnoreCase(familyName)){
                    mixEnvelop.setStatus(408);
                    mixEnvelop.setMessage("您所添加的家属的名称有误,无法添加");
                    mixEnvelop.setMessage("您所添加的家属的名称有误,无法发送验证码");
                    return mixEnvelop;
                }
            }

+ 26 - 14
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -850,15 +850,11 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                String voucherNo = waitPayDetailVO.getVoucherNo();
                                List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderList(waitPayDetailVO.getRecipeNo());
                                for (WlyyPrescriptionDO prescriptionDO:prescriptionDOList){
                                    String patient = prescriptionDO.getPatientCode();
                                    if (prescriptionDO.getStatus()!=30){
                                        String fee=null;
                                        String title = null;
                                        Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
                                        Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
                                        List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(prescriptionDO.getPatientCode(),startTime,endTime);
                                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
                                        if (wlyyOutpatientDOList==null&&wlyyOutpatientDOList.size()==0){
                                        if (wlyyOutpatientDO.getHisStatus()==null){
                                            fee=(prescriptionDO.getDrugFee()+15)+"";
                                            title="您在厦门大学附属中山医院有一笔诊察/处方费用已支付完成!结算费用包含本次在线问诊的复诊诊查费:15元。";
                                        }else {
@ -892,15 +888,19 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                            }
                            for (WaitPayDetailVO waitPayDetailVO:listWPD){
                                if (waitPayDetailVO.getItemName().equalsIgnoreCase("互联网医院复诊诊查费")){
                                    WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findByRealOrder(waitPayDetailVO.getRecipeNo());
                                    if (wlyyOutpatientDO!=null){
                                        if (wlyyOutpatientDO.getHisStatus()==null&&wlyyOutpatientDO.getHisStatus()!=1){
                                            String fee="15";
                                            String title="您在厦门大学附属中山医院有一笔诊察/处方费用已支付完成!";
                                            String url = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId()+"";
                                            payInfoNoticeService.pushPrescriptionPay(wlyyOutpatientDO.getConsumer(),wlyyOutpatientDO.getDoctorName(),waitPayDetailVO.getVoucherNo(),null,null,fee,title,url);
                                            outpatientDao.updateHisStatusById(wlyyOutpatientDO.getId(),1);
                                            logger.info("更新门诊结算状态");
                                    logger.info(waitPayDetailVO.getRecipeNo());
                                    List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderList(waitPayDetailVO.getRecipeNo());
                                    if (prescriptionDOList==null||prescriptionDOList.size()==0){
                                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findByRealOrder(waitPayDetailVO.getRecipeNo());
                                        if (wlyyOutpatientDO!=null){
                                            if (wlyyOutpatientDO.getHisStatus()==null){
                                                String fee="15";
                                                String title="您在厦门大学附属中山医院有一笔诊察/处方费用已支付完成!";
                                                String url = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId()+"";
                                                payInfoNoticeService.pushPrescriptionPay(wlyyOutpatientDO.getConsumer(),wlyyOutpatientDO.getDoctorName(),waitPayDetailVO.getVoucherNo(),null,null,fee,title,url);
                                                outpatientDao.updateHisStatusById(wlyyOutpatientDO.getId(),1);
                                                logger.info("更新门诊结算状态");
                                            }
                                        }
                                    }
                                }
@ -938,4 +938,16 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    }
    @PostMapping(value = "/BS15054")
    @ApiOperation(value = "  查询待结算金额")
    public ObjEnvelop BS10138(
            @ApiParam(name = "pid", value = "病人id")
            @RequestParam(value = "pid", required = false) String pid,
            @ApiParam(name = "realorder", value = "处方号")
            @RequestParam(value = "realorder", required = false) String realorder) throws Exception {
        net.sf.json.JSONObject obj = entranceService.BS15054(pid, realorder,false);
        return ObjEnvelop.getSuccess("获取成功",obj);
    }
}

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

@ -1,16 +1,13 @@
package com.yihu.jw.hospital.endpoint.statistics;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.es.util.ElasticsearchUtil;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -19,8 +16,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * Created by wangzhinan on 2019/12/3.
 */
@ -35,8 +30,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private StatisticsEsService statisticsEsService;
    @Autowired
    private ElasticsearchUtil elasticsearchUtil;
    /**
     *

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

@ -77,9 +77,11 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
		String ids = StringUtils.join(split, ",");
		String sql = "update wlyy_knowledge_article a set a.del = 0 where a.id in(" + ids + ")";
		String sqlUser = "update wlyy_knowledge_article_user a set a.del = 0 where a.relation_code in(" + ids + ")";
		String sqlBussiness = "update base_patient_business a set a.del = 0 where a.relation_code in(" + ids + ")";
		int update = jdbcTemplate.update(sql);
		int updateUser = jdbcTemplate.update(sqlUser);
		if (update > 0&&updateUser>0) {
		int updateBussiness  = jdbcTemplate.update(sqlBussiness);
		if (update > 0||updateUser>0||updateBussiness>0) {
			return true;
		}
		return false;