Browse Source

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

兵兵 4 years ago
parent
commit
e3a2c6b29a
51 changed files with 1990 additions and 414 deletions
  1. 3 0
      business/base-service/src/main/java/com/yihu/jw/hospital/drugstore/dao/BaseDrugStoreDao.java
  2. 3 3
      business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseBannerDoctorService.java
  3. 2 1
      business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseUserMsgService.java
  4. 7 4
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PatientRegisterDao.java
  5. 330 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java
  6. 48 21
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  7. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java
  8. 39 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  9. 30 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  10. 50 17
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  11. 1 4
      business/base-service/src/main/java/com/yihu/jw/internet/service/DataGeneratorService.java
  12. 18 11
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  13. 48 7
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  14. 4 0
      business/base-service/src/mqConfig/esbmq-config.xml
  15. 792 156
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  16. 60 7
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  17. 34 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPatientRegisterDO.java
  18. 13 3
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkEmrJcsqDO.java
  19. 7 6
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj02DO.java
  20. 27 0
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/config/MultipartConfig.java
  21. 3 2
      gateway/ag-basic/src/main/resources/application.yml
  22. 1 1
      gateway/ag-basic/src/main/resources/bootstrap.yml
  23. 1 1
      server/svr-authentication/src/main/resources/bootstrap.yml
  24. 6 6
      svr/svr-base/src/main/java/com/yihu/jw/base/config/MultipartConfig.java
  25. 5 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java
  26. 10 7
      svr/svr-base/src/main/resources/application.yml
  27. 1 1
      svr/svr-base/src/main/resources/bootstrap.yml
  28. 0 13
      svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/interceptor/ActivatedInterceptor.java
  29. 11 6
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java
  30. 4 0
      svr/svr-internet-hospital-entrance/src/mqConfig/esbmq-config.xml
  31. 4 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java
  32. 2 2
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/AutoTimeOutRemind.java
  33. 2 2
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java
  34. 4 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  35. 2 1
      svr/svr-internet-hospital-job/src/main/resources/application.yml
  36. 42 31
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  37. 38 28
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  38. 6 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/file_upload/FileUploadEndpoint.java
  39. 38 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseDoctorBGController.java
  40. 2 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java
  41. 79 22
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  42. 12 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java
  43. 0 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java
  44. 8 3
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java
  45. 1 1
      svr/svr-iot-job/src/main/resources/application.yml
  46. 47 5
      svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java
  47. 5 5
      svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotHospitalService.java
  48. 49 4
      svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java
  49. 86 10
      svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java
  50. 3 3
      svr/svr-iot/src/main/resources/application.yml
  51. 1 1
      svr/svr-iot/src/main/resources/bootstrap.yml

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/drugstore/dao/BaseDrugStoreDao.java

@ -15,5 +15,8 @@ public interface BaseDrugStoreDao extends PagingAndSortingRepository<BaseDrugSto
    @Query(value = " from  BaseDrugStoreDO  where drugStoreCode =?1 and hospitalCode = ?2 ")
    BaseDrugStoreDO findDrugByNameAndCode(String drugStoreCode,String hospitalCode);
    @Query(value = " from  BaseDrugStoreDO  where id =?1 ")
    BaseDrugStoreDO findDrugByid(String drugStoreCode);
}

+ 3 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseBannerDoctorService.java

@ -273,7 +273,7 @@ public class BaseBannerDoctorService
        List<BaseBannerDoctorDO> baseBannerDoctorDOS = this.baseBannerDoctorDao.getBannersBypatients(patientId, doctor);
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = this.wlyyHospitalSysDictDao.findById("banner_give_timeout");
        if (null != baseBannerDoctorDOS&&baseBannerDoctorDOS.size()>0)
        if (null != baseBannerDoctorDOS&&baseBannerDoctorDOS.size()>0&&baseBannerDoctorDOS.size()>=1)
        {
            BaseBannerDoctorDO lastOne = (BaseBannerDoctorDO)baseBannerDoctorDOS.get(0);
            Date lastDate = lastOne.getCreateTime();
@ -372,9 +372,9 @@ public class BaseBannerDoctorService
    {
        List<BaseUserMessageDO> baseBannerDoctorDOS = this.baseUserMessageDao.getMessageByPatientAndDoctor(reciver, sender);
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = this.wlyyHospitalSysDictDao.findById("leave_message_timeout");
        if (null != baseBannerDoctorDOS)
        if (null != baseBannerDoctorDOS&&baseBannerDoctorDOS.size()>=1)
        {
            BaseUserMessageDO lastOne = (BaseUserMessageDO)baseBannerDoctorDOS.get(0);
            BaseUserMessageDO lastOne = baseBannerDoctorDOS.get(0);
            Date lastDate = lastOne.getCreateTime();
            long timeOut = wlyyHospitalSysDictDO.getDictValue() != null ? Long.valueOf(wlyyHospitalSysDictDO.getDictValue()).longValue() : 5L;
            Date current = new Date();

+ 2 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseUserMsgService.java

@ -476,7 +476,7 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
{
    List<BaseUserMessageDO> baseBannerDoctorDOS = this.baseUserMessageDao.getMessageByPatientAndDoctor(reciver, sender);
    WlyyHospitalSysDictDO wlyyHospitalSysDictDO = this.wlyyHospitalSysDictDao.findById("leave_message_timeout");
    if (null != baseBannerDoctorDOS)
    if (null != baseBannerDoctorDOS&&baseBannerDoctorDOS.size()>=1)
    {
        BaseUserMessageDO lastOne = (BaseUserMessageDO)baseBannerDoctorDOS.get(0);
        Date lastDate = lastOne.getCreateTime();
@ -526,4 +526,5 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
        }
        return true;
    }
}

+ 7 - 4
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;
@ -13,8 +14,10 @@ import java.util.List;
public interface PatientRegisterDao extends PagingAndSortingRepository<WlyyPatientRegisterDO, String>, JpaSpecificationExecutor<WlyyPatientRegisterDO> {
    List<WlyyPatientRegisterDO> findByPatientAndDate(String patient,String date);
    List<WlyyPatientRegisterDO> findByPatientAndDateAndDoctor(String patient,String date,String doctor);
    List<WlyyPatientRegisterDO> findByPatientAndCreateTime(String patient, Date createTime);
    @Query("select a from WlyyPatientRegisterDO a where a.patient = ?1 and a.date =?2 and a.doctor=?3 and a.del=?4 ")
    List<WlyyPatientRegisterDO> findByPatientAndDateAndDoctorAndDel(String patient,String date,String doctor,Integer del);
    @Query("select a from WlyyPatientRegisterDO a where a.patient = ?1 and a.createTime=?2 and a.del=?3 ")
    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);
}

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

@ -1,14 +1,28 @@
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 com.yihu.jw.utils.hibernate.HibenateUtils;
import jxl.WorkbookSettings;
import jxl.write.*;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
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.*;
@Service
public class PayInfoNoticeService {
    @Value("${hospital.url}")
@ -17,8 +31,16 @@ public class PayInfoNoticeService {
    private HttpClientUtil httpClientUtil;
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Value("${wechat.id}")
    private String wxId;
    @Value("${wechat.flag}")
    private boolean flag;
    public String pushPrescriptionPay(String patient,String doctorName,String orderNo,String outpatientId,String prescriptionId,String total,String title,String url){
        BasePatientDO patientDO = patientDao.findById(patient);
        if (patientDO!=null){
@ -76,6 +98,314 @@ public class PayInfoNoticeService {
        return respCode;
    }
    //导出es查询数据
    public void exportEsPrescription(OutputStream os, List<Map<String,Object>> totallist,List<Map<String,Object>> listDay) throws Exception{
        WorkbookSettings settings = new WorkbookSettings();
        settings.setWriteAccess(null);
        settings.setEncoding("UTF-8");
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os,settings);
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet", 1);
            WritableSheet ws2 = wwb.createSheet("sheet2", 2);
            String[] header = {"医生姓名", "出诊科室","发起问诊", "接诊数量", "开方数量", "物流数量"};
            String[] header2 = {"时间", "发起问诊", "接诊数量", "开方数量", "物流数量"};
        int k = 0;
        int m =0;
            for (String h : header) {
                addCell(ws, 0, k, h);//表名,行,列,header
                k++;
            }
            for (String h : header2) {
                addCell(ws2, 0, m, h);//表名,行,列,header
                m++;
            }
            int i = 1;
            if (null!=totallist&&totallist.size()>0){
                for (int n=0;n<totallist.size();n++) {
                    Map<String,Object> object = totallist.get(n);
                    addCell(ws, i, 0, object.get("doctorName").toString(), "");
                    addCell(ws, i, 1, null==object.get("deptName")?"":object.get("deptName").toString(),"");
                    addCell(ws, i, 2, null==object.get("total")?"":object.get("total").toString(),"");
                    addCell(ws, i, 3, null==object.get("pickNum")?"":object.get("pickNum").toString(),"");
                    addCell(ws, i, 4, null==object.get("preNum")?"":object.get("preNum").toString(),"");
                    addCell(ws, i, 5, null==object.get("wlNum")?"":object.get("wlNum").toString(),"");
                    i++;
                }
            }
            int j =1;
            if (null!=listDay&&listDay.size()>0){
                for (int n=0;n<listDay.size();n++){
                    Map<String,Object> object = listDay.get(n);
                    addCell(ws2, j, 0, object.get("daliy").toString(), "");
                    addCell(ws2, j, 1, null==object.get("total")?"":object.get("total").toString(),"");
                    addCell(ws2, j, 2, null==object.get("pickNum")?"":object.get("pickNum").toString(),"");
                    addCell(ws2, j, 3, null==object.get("preNum")?"":object.get("preNum").toString(),"");
                    addCell(ws2, j, 4, null==object.get("wlNum")?"":object.get("wlNum").toString(),"");
                    j++;
                }
            }
            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);
    }
    public List<Map<String,Object>> dealSqlQuery(String beginTime,String endTime){
        //发起问诊量
        String sqlOutPatient="SELECT\n" +
                "\tt.doctor as \"doctor\",\n" +
                "\tt.doctor_name as \"doctorName\",\n" +
                "\tt.dept_name as \"deptName\",\n" +
                "\tcount(*) as \"total\" \n" +
                "FROM\n" +
                "\t wlyy_outpatient t \n" +
                "WHERE 1=1 and t.doctor is not null\n " +
                " AND t.doctor!='402803816babc778016babd0dee21112'" ;
        //接诊量
        String sqlDoctorOut = "SELECT\n" +
                "\tt.doctor as \"doctor\",\n" +
                "\tt.doctor_name as \"doctorName\",\n" +
                "\tt.dept_name as \"deptName\",\n" +
                "\tcount(*) as \"total\" \n" +
                "FROM\n" +
                "\t wlyy_outpatient t \n" +
                "WHERE 1=1 and t.doctor is not null\n" +
                " AND t.doctor!='402803816babc778016babd0dee21112'";
        //开具处方量
        String sqlPrescription = "SELECT\n" +
                "\tt.doctor as \"doctor\",\n" +
                "\tt.doctor_name as \"doctorName\",\n" +
                "\tt.dept_name as \"deptName\",\n" +
                "\tcount(*) as \"total\" \n" +
                "FROM\n" +
                "\t wlyy_prescription t \n" +
                "WHERE 1=1 and t.doctor is not null\n" +
                " AND t.doctor!='402803816babc778016babd0dee21112'" ;
        //物流量
        String sqlWL = "SELECT\n" +
                "\to.doctor as \"doctor\",\n" +
                " o.doctor_name as \"doctorName\",\n" +
                " o.dept_name as \"deptName\",\n" +
                " count(*) as \"total\"" +
                "FROM\n" +
                " base.wlyy_prescription_expressage t\n" +
                "LEFT JOIN base.wlyy_prescription b ON b.outpatient_id = t.outpatient_id\n" +
                "LEFT JOIN base.wlyy_outpatient o ON o.id= b.outpatient_id\n" +
                "WHERE 1=1 and o.doctor is not null\n" +
                " AND o.doctor!='402803816babc778016babd0dee21112'" ;
        if (StringUtils.isNotEmpty(beginTime)){
            wxId="xx";
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sqlOutPatient+=" and t.create_time > '" + beginTime + " 00:00:00' ";
                    sqlDoctorOut+=" and t.create_time > '" + beginTime + " 00:00:00' ";
                    sqlPrescription+=" and t.create_time > '" + beginTime + " 00:00:00' ";
                    sqlWL+=" and t.create_time > '" + beginTime + " 00:00:00' ";
                }else {
                    sqlOutPatient+=" and t.create_time > to_date('" + beginTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                    sqlDoctorOut+=" and t.create_time > to_date('" + beginTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                    sqlPrescription+=" and t.create_time > to_date('" + beginTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                    sqlWL+=" and t.create_time > to_date('" + beginTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sqlOutPatient+=" and t.create_time > '" + beginTime + " 00:00:00'";
                sqlDoctorOut+=" and t.create_time > '" + beginTime + " 00:00:00'";
                sqlPrescription+=" and t.create_time > '" + beginTime + " 00:00:00'";
                sqlWL+=" and t.create_time > '" + beginTime + " 00:00:00'";
            }
        }
        if (StringUtils.isNotEmpty(endTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sqlOutPatient+="  and t.create_time<'" + endTime + " 23:59:59'";
                    sqlDoctorOut+="  and t.create_time<'" + endTime + " 23:59:59'";
                    sqlPrescription+="  and t.create_time<'" + endTime + " 23:59:59'";
                    sqlWL+="  and t.create_time<'" + endTime + " 23:59:59'";
                }else {
                    sqlOutPatient+="  and t.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                    sqlDoctorOut+="  and t.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                    sqlPrescription+="  and t.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                    sqlWL+="  and t.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                }
            }else{
                sqlOutPatient+="  and t.create_time<'" + endTime + " 23:59:59'";
                sqlDoctorOut+="  and t.create_time<'" + endTime + " 23:59:59'";
                sqlPrescription+="  and t.create_time<'" + endTime + " 23:59:59'";
                sqlWL+="  and t.create_time<'" + endTime + " 23:59:59'";
            }
        }
        sqlOutPatient+="\tAND t.patient_name NOT IN ( '王志南', '游水连', '林志芳', '郑绩', '陈晓亮', '王培坤' ) \n" +
                "\tAND t.STATUS IN ( 0,1,2,3 )\n" +
                "\tGROUP BY t.doctor_name,\n" +
                "\tt.dept_name,t.doctor";
        sqlDoctorOut+= "\tAND t.patient_name NOT IN ( '王志南', '游水连', '林志芳', '郑绩', '陈晓亮', '王培坤' ) \n" +
                "\tAND t.STATUS IN ( 1, 2, 3 )\n" +
                " and t.pay_status =1 "+
                "\tGROUP BY t.doctor_name,\n" +
                "\tt.dept_name ,t.doctor";
        sqlPrescription+="\tAND t.patient_name NOT IN ( '王志南', '游水连', '林志芳', '郑绩', '陈晓亮', '王培坤' ) \n" +
                "\tGROUP BY t.doctor_name,\n" +
                "\tt.dept_name,t.doctor";
        sqlWL+= "AND t. NAME NOT IN (\n" +
                " '王志南',\n" +
                " '游水连',\n" +
                " '林志芳',\n" +
                " '郑绩',\n" +
                " '陈晓亮',\n" +
                " '王培坤',\n" +
                " '林'\n" +
                ")\n" +
                "AND t.oneself_pickup_flg = 0\n" +
                "\n" +
                "AND b.`status`IN(20,32,100)\n" +
                "AND b.drug_fee !=0\n" +
                "AND b.real_order IS not NULL"+
                "\tGROUP BY o.doctor_name,\n" +
                "\to.dept_name,o.doctor";
        List<Map<String,Object>> result = new ArrayList<>();
        List<Map<String,Object>> outPatient=hibenateUtils.createSQLQuery(sqlOutPatient);
        List<Map<String,Object>> docPickup=hibenateUtils.createSQLQuery(sqlDoctorOut);
        List<Map<String,Object>> prescription=hibenateUtils.createSQLQuery(sqlPrescription);
        List<Map<String,Object>> wl=hibenateUtils.createSQLQuery(sqlWL);
        if(null!=outPatient&&outPatient.size()>0){
            for (Map<String,Object> map:outPatient){
                if (docPickup!=null&&docPickup.size()>0){
                    for (Map<String,Object> pickMap:docPickup){
                        if (pickMap.get("doctor").toString().equalsIgnoreCase(map.get("doctor").toString())){
                            map.put("pickNum",null==pickMap.get("total")?"":pickMap.get("total").toString());
                        }
                    }
                }
                if (prescription!=null&&prescription.size()>0){
                    for (Map<String,Object> pre:prescription){
                        if (pre.get("doctor").toString().equalsIgnoreCase(map.get("doctor").toString())){
                            map.put("preNum",null==pre.get("total")?"":pre.get("total").toString());
                        }
                    }
                }
                if (wl!=null&&wl.size()>0){
                    for (Map<String,Object> wMap:wl){
                        if (wMap.get("doctor").toString().equalsIgnoreCase(map.get("doctor").toString())){
                            map.put("wlNum",null==wMap.get("total")?"":wMap.get("total").toString());
                        }
                    }
                }
                result.add(map);
            }
        }
     return result;
    }
    //按天分组查询
    public List<Map<String,Object>> dealSqlQueryGroupDay(String beginTime,String endTime){
        String sqlDemo = "SELECT\n" +
                "\tdate_format( t.create_time, '%Y-%m-%d' ) as \"daliy\",\n" +
                "\tcount( * ) as \"total\" \n" +
                "FROM\n" ;
        //发起复诊量
        String outPatinet =sqlDemo+ "\twlyy_outpatient t where 1=1 AND t.doctor!='402803816babc778016babd0dee21112' and " +
                "t.STATUS IN ( 0,1,2,3 )";
        //接诊
        String outPick  =sqlDemo+  "\twlyy_outpatient t where 1=1 AND t.doctor!='402803816babc778016babd0dee21112' " +
                " and t.STATUS IN (1,2,3) and t.doctor is not null ";
        //处方
        String pre = sqlDemo+"\twlyy_prescription t where 1=1 AND t.doctor!='402803816babc778016babd0dee21112'";
        //物流
        String wl =sqlDemo+" base.wlyy_prescription_expressage t\n" +
                "LEFT JOIN base.wlyy_prescription b ON b.outpatient_id = t.outpatient_id\n" +
                "LEFT JOIN base.wlyy_outpatient o ON o.id= b.outpatient_id\n" +
                "WHERE t.oneself_pickup_flg = 0\n" +
                "AND b.`status`IN(20,32,100)\n" +
                "AND b.drug_fee !=0\n" +
                "AND b.real_order IS not NULL" +
                " AND o.doctor!='402803816babc778016babd0dee21112'";
        String deltime = "";
        if (StringUtils.isNotEmpty(beginTime)){
            wxId="xx";
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    deltime+=" and t.create_time > '" + beginTime + " 00:00:00' ";
                }else {
                    deltime+=" and t.create_time > to_date('" + beginTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                deltime+=" and t.create_time > '" + beginTime + " 00:00:00'";
            }
        }
        if (StringUtils.isNotEmpty(endTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    deltime+="  and t.create_time<'" + endTime + " 23:59:59'";
                }else {
                    deltime+="  and t.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                }
            }else{
                deltime+="  and t.create_time<'" + endTime + " 23:59:59'";
            }
        }
        deltime+=" group by date_format(t.create_time, '%Y-%m-%d');";
        outPatinet+=deltime;
        outPick +=deltime;
        pre +=deltime;
        wl+=deltime;
        List<Map<String,Object>> result = new ArrayList<>();
        List<Map<String,Object>> outPatient=hibenateUtils.createSQLQuery(outPatinet);
        List<Map<String,Object>> docPickup=hibenateUtils.createSQLQuery(outPick);
        List<Map<String,Object>> prescription=hibenateUtils.createSQLQuery(pre);
        List<Map<String,Object>> wls=hibenateUtils.createSQLQuery(wl);
        if(null!=outPatient&&outPatient.size()>0){
            for (Map<String,Object> map:outPatient){
                if (docPickup!=null&&docPickup.size()>0){
                    for (Map<String,Object> pickMap:docPickup){
                        if (pickMap.get("daliy").toString().equalsIgnoreCase(map.get("daliy").toString())){
                            map.put("pickNum",null==pickMap.get("total")?"":pickMap.get("total").toString());
                        }
                    }
                }
                if (prescription!=null&&prescription.size()>0){
                    for (Map<String,Object> preMap:prescription){
                        if (preMap.get("daliy").toString().equalsIgnoreCase(map.get("daliy").toString())){
                            map.put("preNum",null==preMap.get("total")?"":preMap.get("total").toString());
                        }
                    }
                }
                if (wl!=null&&wls.size()>0){
                    for (Map<String,Object> wMap:wls){
                        if (wMap.get("daliy").toString().equalsIgnoreCase(map.get("daliy").toString())){
                            map.put("wlNum",null==wMap.get("total")?"":wMap.get("total").toString());
                        }
                    }
                }
                result.add(map);
            }
        }
        return result;
    }
}

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

@ -88,6 +88,8 @@ import com.yihu.jw.wechat.enterprise.EnterpriseService;
import com.yihu.jw.wechat.service.BaseSensitiveFilterWordsService;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import com.ylzinfo.ehc.EhcHandler;
import com.ylzinfo.ehc.common.utils.DateUtils;
@ -542,7 +544,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //药品信息
                List<WlyyPrescriptionInfoVO> infoVOs = new ArrayList<>();
                vo.setInfoVOs(convertToModels(prescriptionInfoDao.findByPrescriptionId(vo.getId(), 1), infoVOs, WlyyPrescriptionInfoVO.class));
                System.out.println("=====PrescriptionId======"+vo.getId());
                convertToModels(prescriptionInfoDao.findByPrescriptionId(vo.getId(), 1), infoVOs, WlyyPrescriptionInfoVO.class);
                vo.setInfoVOs(infoVOs);
                //检查检验信息
                List<WlyyInspectionVO> inspectionVOs = new ArrayList<>();
@ -865,7 +869,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else {
            System.out.println("写入自取信息");
            String drugStoreCode = expressageDO.getHospitalCode();
            BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreDao.findOne(drugStoreCode);
            BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreDao.findDrugByid(drugStoreCode);
            if (null!=baseDrugStoreDO){
                expressageDO.setCityCode(baseDrugStoreDO.getCityCode());
                expressageDO.setCityName(baseDrugStoreDO.getCityName());
@ -873,7 +877,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                expressageDO.setProvinceName(baseDrugStoreDO.getProvinceName());
                expressageDO.setTownCode(baseDrugStoreDO.getTownCode());
                expressageDO.setTownName(baseDrugStoreDO.getTownName());
                expressageDO.setHospitalCode(baseDrugStoreDO.getDrugStoreCode());
                expressageDO.setHospitalCode(baseDrugStoreDO.getHospitalCode());
                expressageDO.setHospitalName(baseDrugStoreDO.getHospitalName());
                expressageDO.setHospitalAddress(baseDrugStoreDO.getAddress());
            }
@ -1638,7 +1642,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 +1656,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 +1699,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 +1736,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 +1775,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();
@ -2246,6 +2260,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    ins.setCreateTime(new Date());
                    ins.setPrescriptionId(prescription.getId());
                    ins.setOutpatientId(outPatientId);
                    System.out.println("____outpatientId=="+outPatientId);
                }
                //保存检查检验。
                wlyyInspectionDao.save(inspections);
@ -2392,7 +2407,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);
@ -3644,7 +3659,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //眼科接诊时更新眼科通状态
                if (!flag){
                    if (businessOrderDO!=null){
                        ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"9");
                        ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"2");
                    }
                }
            } else if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {
@ -4708,6 +4723,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " d.job_title_name AS \"jobTitleName\"," +
                " d.charge_type AS \"chargeType\"," +
                " h.dept_name AS \"deptName\"," +
                " dw.workTotal AS \"workTotal\","+
                " d.consult_status AS \"consultStatus\"," +
                " d.outpatient_type AS \"outpatientType\"," +
                " a.total AS \"consultTotal\"," +
@ -4834,9 +4850,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        sql += " and d.del='1' order by dw.workTotal desc,d.consult_status DESC,a.total " + consutlSort;
        sql += " and d.del='1' order by dw.workTotal desc nulls last,d.consult_status DESC nulls last,a.total " + consutlSort;
        String sqlCount = "select count(1) as \"total\" from ( "+sql+" ) t";
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params, page, pagesize);
        /*list.stream().forEach(e->{
            if (null==e.get("consultStatus")){
                e.put("consultStatus",0);
            }
            if (null==e.get("workTotal")){
                e.put("workTotal",0);
            }
        });
        list.stream().sorted(Comparator.comparing((Map<String, Object> h) -> ((String) h.get("workTotal"))).reversed().thenComparing(Comparator.comparing((Map<String, Object> h) -> ((String) h.get("consultStatus")))).reversed());*/
        for (Map<String,Object> map:list){
            String doctor = map.get("id").toString();
            //查询医生各项评价平均分
@ -7277,17 +7302,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");
                    }
@ -8415,4 +8436,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        wlyyPrescriptionDO =  prescriptionDao.save(wlyyPrescriptionDO);
        return wlyyPrescriptionDO;
    }
    public void updateHisStatusByOutpatientId(String outpatientId){
        outpatientDao.updateHisStatusById(outpatientId,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);
            //判断是否已经挂号,如果已经挂号

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

@ -4,6 +4,7 @@ package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.area.BaseDrugStoreDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
@ -22,6 +23,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionExpressageDao;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.prescription.service.useragent.BaseUserAgent;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.order.pay.wx.WeChatConfig;
@ -93,7 +95,10 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    @Value("${pay.flag}")
    private boolean payFlag;
    @Value("${wechat.id}")
    private String wechatId;
    @Autowired
    private YkyyService ykyyService;
    /**
     * 获取居民就诊记录接口
@ -202,7 +207,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
        if (!flag){
            businessOrderService.saveOrder(businessOrderDO);
            businessOrderDO = businessOrderService.saveOrder(businessOrderDO);
        }
        WlyyPatientRegisterTimeDO registerTimeDO = null;
@ -226,9 +231,40 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        expressageDO.setOutpatientId(outpatient.getId());
        prescriptionExpressageDao.save(expressageDO);
        if (0==expressageDO.getOneselfPickupFlg()){
            if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
                expressageDO.setHospitalCode(drugCode);
            }
            System.out.println("进入物流信息");
            expressageDO.setDel(1);
            expressageDO.setAddress(expressageDO.getHospitalAddress());
            expressageDO.setCreateTime(new Date());
            expressageDO.setOutpatientId(outpatient.getId());
            prescriptionExpressageDao.save(expressageDO);
        }else {
            System.out.println("写入自取信息");
            String drugStoreCode = expressageDO.getHospitalCode();
            BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreDao.findDrugByid(drugStoreCode);
            if (null!=baseDrugStoreDO){
                expressageDO.setCityCode(baseDrugStoreDO.getCityCode());
                expressageDO.setCityName(baseDrugStoreDO.getCityName());
                expressageDO.setProvinceCode(baseDrugStoreDO.getProvinceCode());
                expressageDO.setProvinceName(baseDrugStoreDO.getProvinceName());
                expressageDO.setTownCode(baseDrugStoreDO.getTownCode());
                expressageDO.setTownName(baseDrugStoreDO.getTownName());
                expressageDO.setHospitalCode(baseDrugStoreDO.getHospitalCode());
                expressageDO.setHospitalName(baseDrugStoreDO.getHospitalName());
                expressageDO.setHospitalAddress(baseDrugStoreDO.getAddress());
            }
            expressageDO.setDel(1);
            expressageDO.setCreateTime(new Date());
            expressageDO.setOutpatientId(outpatient.getId());
            prescriptionExpressageDao.save(expressageDO);
        }
        //3.创建候诊室
        createRoom(outpatient, chargeType);
        return outpatient;
    }

+ 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);

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

@ -52,6 +52,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
/**
@ -533,7 +534,7 @@ public class YkyyEntranceService {
    /**
     * 查找眼科his 已审核未付款的处方
     * 查找眼科his 审方失败
     * @throws Exception
     */
    public JSONArray getNoUnsettledPrescription() throws Exception{
@ -1644,7 +1645,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();
@ -1658,28 +1661,48 @@ public class YkyyEntranceService {
        String doctor = null;
        String patient = null;
        String admNo= null;
        String registNo=null;
        String deptNo = null;
        if (inspectionDOS!=null&&inspectionDOS.size()!=0){
            WlyyInspectionDO inspectionDO = inspectionDOS.get(0);
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(inspectionDO.getOutpatientId());
            WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(inspectionDO.getPrescriptionId());
            admNo = prescriptionDO.getAdmNo();
            registNo = prescriptionDO.getRealOrder();
            doctor=outpatientDO.getDoctor();
            patient=outpatientDO.getPatient();
            admNo = outpatientDO.getAdmNo();
        }
        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOS){
            YkEmrJcsqDO ykEmrJcsqDO = new YkEmrJcsqDO();
            ykEmrJcsqDO.setJzhm(wlyyInspectionDO.getOutpatientId());
            ykEmrJcsqDO.setJzxh(Integer.parseInt(admNo));
            System.out.println("jcjy=="+wlyyInspectionDO.getOutpatientId());
            ykEmrJcsqDO.setJzhm(registNo);
            if (StringUtils.isNotEmpty(admNo)){
                System.out.println("admno=="+admNo);
                ykEmrJcsqDO.setJzxh(Integer.parseInt(admNo));
            }
            ykEmrJcsqDO.setXmid(Integer.valueOf(wlyyInspectionDO.getCode()));
            JSONArray jsonArray = this.findZlxm(null,wlyyInspectionDO.getCode());
            if (jsonArray!=null&&jsonArray.size()>0){
                JSONObject deptobject = jsonArray.getJSONObject(0);
                deptNo = deptobject.getString("dept");
            }
            ykEmrJcsqDO.setZxks(deptNo==null?0:Integer.parseInt(deptNo));
            ykEmrJcsqDO.setJcxm(wlyyInspectionDO.getName());
            ykEmrJcsqDO.setXmdj(Integer.parseInt(wlyyInspectionDO.getChargeAmount()));
            ykEmrJcsqDO.setXmdj(new BigDecimal(wlyyInspectionDO.getChargeAmount()));
            ykEmrJcsqDO.setSqsl(wlyyInspectionDO.getQuantity());
            ykEmrJcsqDO.setJclx(Integer.valueOf(wlyyInspectionDO.getCheckPart()));
            ykEmrJcsqDO.setXmdw(wlyyInspectionDO.getTotalUnit());
            ykEmrJcsqDO.setKdsj(new Date());
            ykEmrJcsqDOS.add(ykEmrJcsqDO);
        }
        //同步his
        logger.info("开始同步检查检验");
        this.outPatientOrder(ykEmrJcsqDOS,false,doctor,patient);
        Map<String,Object> message = this.outPatientOrder(ykEmrJcsqDOS,false,doctor,patient);
        System.out.println(message.get("code")+"-----"+message.get("msg"));
        if ("-1".equalsIgnoreCase(message.get("code").toString())){
           logger.info("同步检查检验失败,错误信息为:"+message.get("msg").toString());
        }
        System.out.println(message.get("code")+"-----"+message.get("msg"));
    }
    /**
@ -2303,13 +2326,18 @@ public class YkyyEntranceService {
    }
    //查询诊疗项目视图
    public JSONArray findZlxm(String itemName) throws Exception{
    public JSONArray findZlxm(String itemName,String itemCode) throws Exception{
        String sql = "select t.item_code as \"code\",t.item_name as \"name\"," +
                "t.price as \"chargeAmount\",t.total_unit as \"totalUnit\"," +
                "t.zxks as \"dept\" from VEMR_ORDER_ITEM t where 1=1";
        if (StringUtils.isNotEmpty(itemName)){
            sql+=" and t.ITEM_NAME like '%"+itemName+"%'";
        }
        if (StringUtils.isNotEmpty(itemCode)){
            String[] split = itemCode.split(",|,");
            String ids = org.apache.commons.lang.StringUtils.join(split, ",");
            sql+=" and t.item_code in ("+ids+")";
        }
        System.out.println(sql);
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
@ -2369,7 +2397,7 @@ public class YkyyEntranceService {
        return array;
    }
    //门诊开单操作
    public String outPatientOrder(List<YkEmrJcsqDO> surveys,Boolean demoFlag,String doctor,String patient) throws Exception{
    public Map<String,Object> outPatientOrder(List<YkEmrJcsqDO> surveys,Boolean demoFlag,String doctor,String patient) throws Exception{
        DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
        if (StringUtils.isNoneBlank(doctor)){
            doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
@ -2384,6 +2412,7 @@ public class YkyyEntranceService {
        Integer kdks = 0;
        Integer brid=0;
        JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
        Map<String,Object> resultMap = new HashMap();
        if(jsonArray!=null&&jsonArray.size()>0){
            //获取居民信息
            JSONObject json = jsonArray.getJSONObject(0);
@ -2398,6 +2427,7 @@ public class YkyyEntranceService {
        if(jsonArray1!=null&&jsonArray1.size()>0){
            JSONObject json = jsonArray1.getJSONObject(0);
            doctorHis=json.getString("code");
            kdks = Integer.parseInt(json.getString("dept"));
        }
        if (surveys!=null){
            for (YkEmrJcsqDO ykEmrJcsqDO:surveys){
@ -2410,7 +2440,7 @@ public class YkyyEntranceService {
                    ykEmrJcsqDO.setBrxm(brxm);
                    ykEmrJcsqDO.setBrnl(brnl);
                    ykEmrJcsqDO.setKdys(doctorHis);
                    ykEmrJcsqDO.setBrks(114);
                    ykEmrJcsqDO.setBrks(kdks);
                    ykEmrJcsqDO.setTjys(doctorHis);
            }
            String jsonString = JSONObject.toJSONString(surveys);
@ -2426,15 +2456,18 @@ public class YkyyEntranceService {
            JSONArray array= new JSONArray();
            if (status==200){
                array = rs.getJSONArray("detailModelList");
                if(array.size()>0){
                    return "success";
                }else {
                    return "failed";
                }
                resultMap.put("code","200");
                resultMap.put("msg",content);
                return resultMap;
            }else {
                resultMap.put("code","-1");
                resultMap.put("msg",content);
                return resultMap;
            }
            return "faild";
        }else {
            return "failed";
            resultMap.put("code","-1");
            resultMap.put("msg","开单信息为空");
            return resultMap;
        }
    }
   //查询检查单

+ 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);
            }

+ 18 - 11
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){
@ -486,7 +488,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("reg_subject_code",  dept.length>=1?dept[0]:"");
                jb.put("reg_subject_name", dept.length>=2?dept[1]:"");
                jb.put("reg_price",  "0");
                jb.put("pt_name", info.get("name") == null?"0":info.get("name"));
                jb.put("pt_name", info.get("paName") == null?"0":info.get("paName"));
                jb.put("ge_code",   IdCardUtil.getSexForIdcard_new(info.get("idcard").toString()));
                jb.put("pt_age", IdCardUtil.getAgeForIdcard(info.get("idcard").toString()));
                jb.put("card_type", "1");
@ -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 = "";
@ -877,8 +881,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("visit_doc_name",  info.get("docName")== null? "0":info.get("docName"));
                jb.put("visit_doc_id_no",  info.get("docIdCard")== null? "0":info.get("docIdCard"));
                jb.put("visit_doc_code",  visitDocCode);
                jb.put("visit_dept_code", info.get("dept_code") == null?"0":info.get("dept_code"));
                jb.put("visit_dept_name", info.get("dept_name") == null?"0":info.get("dept_name"));
                jb.put("visit_dept_code",  dept.length>=1?dept[0]:"");
                jb.put("visit_dept_name",  dept.length>=2?dept[1]:"");
                jb.put("pt_no", info.get("patientName")== null? "0":info.get("patientName"));
                jb.put("pt_age", IdCardUtil.getAgeForIdcard(info.get("patIdCard").toString()));
                jb.put("cost_type", "");
@ -1022,8 +1026,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("visit_doc_code", visitDocCode);
                jb.put("visit_subject_code", dept.length>=1?dept[0]:"");
                jb.put("visit_ subject _name",dept.length>=2?dept[1]:"");
                jb.put("visit_dept_code", info.get("dept"));
                jb.put("visit_dept_name", info.get("dept_name"));
                jb.put("visit_dept_code",  dept.length>=1?dept[0]:"");
                jb.put("visit_dept_name",  dept.length>=2?dept[1]:"");
                jb.put("pt_no", info.get("paName"));
                jb.put("pt_age", IdCardUtil.getAgeForIdcard(info.get("paId").toString()));
//                jb.put("cost_type", info.get("charge_type").toString());
@ -1728,6 +1732,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
            case "2":
                res = "1";
                break;
            case "3":
                res = "1";
                break;
            default:
                res = "";
        }

File diff suppressed because it is too large
+ 48 - 7
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java


+ 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));

+ 60 - 7
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -16,15 +16,19 @@ import com.yihu.jw.entity.base.im.ConsultTeamLogDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.score.BaseEvaluateDO;
import com.yihu.jw.entity.base.score.BaseEvaluateScoreDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.message.BaseBannerDoctorDO;
import com.yihu.jw.entity.hospital.message.BaseUserMessageDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyConsultAdvice;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateDao;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.consult.dao.WlyyConsultAdviceDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.message.dao.BaseBannerDoctorDao;
import com.yihu.jw.hospital.message.dao.BaseUserMessageDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
@ -49,6 +53,7 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.ylzinfo.onepay.sdk.utils.StringUtil;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -119,6 +124,8 @@ public class ImService {
	private PrescriptionService prescriptionService;
	@Autowired
	private BaseBannerDoctorDao baseBannerDoctorDao;
	@Autowired
	private WlyyHospitalSysDictDao hospitalSysDictDao;
	
	@Value("${im.data_base_name}")
	private String data_base_name;
@ -161,6 +168,8 @@ public class ImService {
	private BaseUserMessageDao userMessageDao;
	@Autowired
	private BaseDoctorHospitalDao doctorHospitalDao;
	@Autowired
	private WlyyConsultAdviceDao wlyyConsultAdviceDao;
	
	@Value("${wechat.id}")
	private String wxId;
@ -888,11 +897,21 @@ public class ImService {
		JSONObject re = new JSONObject();
		boolean boo = StringUtils.isEmpty(getUnfinishedConsult(patient, doctor));
		logger.info("boo"+boo);
		if (!StringUtils.isEmpty(getUnfinishedConsult(patient, doctor))) {//判断是否有未结束的咨询移到同步方法中
		WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.findById("consultClose");
		boolean flag = false;
		if (sysDictDO!=null){
			if (sysDictDO.getDictCode().equalsIgnoreCase("1")){
				flag = true;
			}
		}
		if (!flag){
			if (!StringUtils.isEmpty(getUnfinishedConsult(patient, doctor))) {//判断是否有未结束的咨询移到同步方法中
//			re.put("status", -3);
//			return re;
			throw new RuntimeException("居民还有未结束的专家咨询!");
				throw new RuntimeException("居民还有未结束的专家咨询!");
			}
		}
		
		JSONObject users = new JSONObject();
		users.put(doctor,0);
@ -1639,7 +1658,17 @@ public class ImService {
					businessOrderDO  = businessOrderDao.selectByRelationCode(consult);
				}
				if (businessOrderDO!=null){
					ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"4");
					String sql ="SELECT * FROM topics t where " +
							"t.id='"+consult+"' and t.reply_user is null and t.reply is null and t.status IN(0,1) ";
					List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
					System.out.println("sql+-----"+sql);
					if (null!=mapList&&mapList.size()>0&&mapList.size()==1){
						//医生没回复的话要把状态改为关闭 status=?
						System.out.println("-------------------进入未回复状态同步--------------------");
						ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"3");
					}else {
						ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"4");
					}
				}
			}
		}
@ -2269,7 +2298,21 @@ public class ImService {
					map.put("doctorName",baseDoctorDO.getName());
				}
			}
			if (map.get("id")!=null){
				if("1".equals(type) || "15".equals(type) || type.contains(",")){
					String consultCode = map.get("id").toString();
					List<WlyyConsultAdvice> consultAdvices = wlyyConsultAdviceDao.getByConsult(consultCode);
					StringBuffer content = new StringBuffer();
					for (WlyyConsultAdvice consultAdvice:consultAdvices){
						content.append(consultAdvice.getAdviceValue()+",");
					}
					if (content!=null&&content.length()>0){
						System.out.println("content+====="+content);
						content.deleteCharAt(content.length()-1);
					}
					map.put("icd10Name",content);
				}
			}
		}
		return mapList;
	}
@ -3082,7 +3125,9 @@ public class ImService {
			sql = "SELECT " +
					" DISTINCT op.id AS \"outpatientId\"," +
					"op.description AS \"title\"," +
					"op.description AS \"symptoms\",";
					"op.description AS \"symptoms\","+
					//添加排序的列
					"op.create_time AS \"createTime\",";
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
@ -3151,8 +3196,16 @@ public class ImService {
			sql =sql +" ORDER BY op.create_time DESC";
		}
		
		return hibenateUtils.createSQLQuery(sql);
		List<Map<String,Object>> mapList = hibenateUtils.createSQLQuery(sql);
		for (Map<String,Object> map:mapList){
			if (map.get("patientIdcard")!=null){
				String idcard = map.get("patientIdcard").toString();
				Integer age =IdCardUtil.getAgeForIdcard(idcard);
				map.put("patientAge",age);
			}
		}
		return mapList;
	}
	
	/**

+ 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;
    }
}

+ 13 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkEmrJcsqDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -44,11 +45,20 @@ public class YkEmrJcsqDO {
    private String jcxm;//项目名称
    private Integer qxbz;//0
    private Integer yjxh;//关联ms_yj01里面的yjxh
    private Integer xmdj;//项目单价
    private BigDecimal xmdj;//项目单价
    private String xmdw;//项目单位
    private Integer xmid;//项目id  VEMR_ORDER_ITEM_MX
    private Integer sqsl;//数量
    private Integer jzxh;//就诊序号HLWYS_MZ_JZLS的JZXH对应
    private Integer jsbz;
    @Column(name = "JSBZ")
    public Integer getJsbz() {
        return jsbz;
    }
    public void setJsbz(Integer jsbz) {
        this.jsbz = jsbz;
    }
    @Basic
    @Id
@ -236,11 +246,11 @@ public class YkEmrJcsqDO {
    }
    @Basic
    @Column(name = "XMDJ")
    public Integer getXmdj() {
    public BigDecimal getXmdj() {
        return xmdj;
    }
    public void setXmdj(Integer xmdj) {
    public void setXmdj(BigDecimal xmdj) {
        this.xmdj = xmdj;
    }
    @Basic

+ 7 - 6
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj02DO.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.hospital.prescription;
import javax.persistence.*;
import javax.persistence.criteria.From;
import java.math.BigDecimal;
/*
 * 检查明细
@ -14,9 +15,9 @@ public class YkMsYj02DO {
    private Integer ylxh;//组套明细里关联VEMR_ORDER_ITEM 里面  ITEM_CODE
    private Integer xmlx;//SELECT XMLX  javax.persistence.criteria.From GY_YLSF Where FYXH =l l_fyxh   查询后结果写入
    private Integer yjzx;//明细第一条是1,其它是0
    private Integer Yldj;//单价  select * from  portal_his.gy_ylsf@YKZXTEST where fyxh = l l_fyxh
    private BigDecimal Yldj;//单价  select * from  portal_his.gy_ylsf@YKZXTEST where fyxh = l l_fyxh
    private Integer ylsl;//数量 = 取项目明细 * 医生填的数量  参考截图   fysl
    private Integer hjje;//	合计金额
    private BigDecimal hjje;//	合计金额
    private Integer fygb;//SELECT fygb From GY_YLSF Where FYXH =l l_fyxh  查询后结果写入
    private Integer zfbl;//	默认1
    private Integer zxpb;//默认0
@ -69,11 +70,11 @@ public class YkMsYj02DO {
    }
    @Basic
    @Column(name = "YLDJ")
    public Integer getYldj() {
    public BigDecimal getYldj() {
        return Yldj;
    }
    public void setYldj(Integer yldj) {
    public void setYldj(BigDecimal yldj) {
        Yldj = yldj;
    }
    @Basic
@ -87,11 +88,11 @@ public class YkMsYj02DO {
    }
    @Basic
    @Column(name = "HJJE")
    public Integer getHjje() {
    public BigDecimal getHjje() {
        return hjje;
    }
    public void setHjje(Integer hjje) {
    public void setHjje(BigDecimal hjje) {
        this.hjje = hjje;
    }
    @Basic

+ 27 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/config/MultipartConfig.java

@ -0,0 +1,27 @@
package com.yihu.jw.gateway.config;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.MultipartConfigElement;
import java.io.*;
/**
 * Created by liub on 2020/9/10.
 */
@Configuration
public class MultipartConfig {
    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        String location = "/data/apps/temp";
        File tmpFile = new File(location);
        if (!tmpFile.exists()) {
            tmpFile.mkdirs();
        }
        factory.setLocation(location);
        return factory.createMultipartConfig();
    }
}

+ 3 - 2
gateway/ag-basic/src/main/resources/application.yml

@ -1,6 +1,7 @@
server:
  port: ${server.ag-basic-port}
  tomcat:
    basedir: /data/apps/temp
spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
@ -190,7 +191,7 @@ spring:
spring:
  profiles: iotprod
  datasource:
     url: jdbc:mysql://10.90.32.2:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
     url: jdbc:mysql://10.90.32.3:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
     username: wlyy
     password: jkzlehr@123
  redis:

+ 1 - 1
gateway/ag-basic/src/main/resources/bootstrap.yml

@ -102,7 +102,7 @@ spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.216:1221}
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---

+ 1 - 1
server/svr-authentication/src/main/resources/bootstrap.yml

@ -104,7 +104,7 @@ spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.216:1221}
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---

+ 6 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/config/MultipartConfig.java

@ -6,22 +6,22 @@ import org.springframework.context.annotation.Configuration;
import javax.servlet.MultipartConfigElement;
import java.io.*;
/**
 * Created by liub on 2020/9/8.
 * Created by liub on 2020/9/11.
 */
@Configuration
public class MultipartConfig {
    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        File tmpFile = new File("/data/apps/temp");
        String location = "/data/apps/temp2";
        File tmpFile = new File(location);
        if (!tmpFile.exists()) {
            tmpFile.mkdirs();
        }
        factory.setLocation("/data/apps/temp");
        factory.setLocation(location);
        return factory.createMultipartConfig();
    }
}
}

+ 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));

+ 10 - 7
svr/svr-base/src/main/resources/application.yml

@ -1,7 +1,8 @@
#通用的配置不用区分环境变量.
server:
  port: ${server.svr-base-port}
  tomcat:
      basedir: /data/apps/temp2
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
@ -358,7 +359,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,12 +408,13 @@ 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
  datasource:
    url: jdbc:mysql://10.90.32.2:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://10.90.32.3:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: jkzlehr@123
#    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
@ -419,10 +422,10 @@ spring:
#    password: 123456
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 10.90.32.2:20010,10.90.32.2:20012 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    cluster-nodes: 10.90.32.3:20010,10.90.32.3:20012 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://10.90.32.2:20009,http://10.90.32.2:20011
      uris: http://10.90.32.3:20009,http://10.90.32.3:20011
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
@ -430,7 +433,7 @@ spring:
    user: admin
    password: admin
  redis:
    host: 10.90.32.2 # Redis server host.
    host: 10.90.32.3 # Redis server host.
    port: 20008  # Redis server port.
    password: jkzlehr
fastDFS:

+ 1 - 1
svr/svr-base/src/main/resources/bootstrap.yml

@ -84,7 +84,7 @@ spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.216:1221}
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---

+ 0 - 13
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/interceptor/ActivatedInterceptor.java

@ -1,38 +1,25 @@
package com.yihu.jw.healthyhouse.interceptor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.healthyhouse.constant.LoginInfo;
import com.yihu.jw.healthyhouse.model.user.User;
import com.yihu.jw.healthyhouse.service.user.UserService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.wlyy.HouseUserContant;
import javassist.*;
import javassist.bytecode.CodeAttribute;
import javassist.bytecode.LocalVariableAttribute;
import javassist.bytecode.MethodInfo;
import net.sf.json.JSON;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

+ 11 - 6
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java

@ -28,6 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -248,7 +250,7 @@ public class YkyyController extends EnvelopRestEndpoint {
                                           @RequestParam(value = "table",required = true)String table) throws  Exception{
        List<YkEmrJcsqDO> surveys = EntityUtils.jsonToList(json, YkEmrJcsqDO.class);
        System.out.println(surveys);
        long totalprice=0l;
        BigDecimal totalprice=new BigDecimal(0);
        ListEnvelop mixEnvelop = new ListEnvelop();
        if (surveys!=null){
            for (YkEmrJcsqDO ykEmrJcsqDO:surveys){
@ -258,16 +260,18 @@ public class YkyyController extends EnvelopRestEndpoint {
                if (sqdhList!=null&&sqdhList.size()!=0){
                    sqdh = Long.parseLong(sqdhList.get(0).get("total").toString());
                    System.out.println("sqdh:"+sqdh);
                    String updatesqdh = "update portal_his.gy_identity_ms@ykzxtest set dqz=dqz+1 where bmc = 'EMR_JCSQ'";
                    String updatesqdh = "update portal_his.gy_identity_emr@ykzxtest set dqz=dqz+1 where bmc = 'EMR_JCSQ'";
                    hibenateUtils.updateBySql(updatesqdh);
                }
                ykEmrJcsqDO.setSqdh(sqdh.intValue());
                ykEmrJcsqDO.setJclx(1);
                ykEmrJcsqDO.setJjbz(0);
                ykEmrJcsqDO.setJzlx(1);
                ykEmrJcsqDO.setJczt(1);
                ykEmrJcsqDO.setZfbz(0);
                ykEmrJcsqDO.setQxbz(0);
                totalprice +=ykEmrJcsqDO.getXmdj()*ykEmrJcsqDO.getSqsl();
                ykEmrJcsqDO.setKdsj(new Date());
                ykEmrJcsqDO.setJsbz(0);
                totalprice =ykEmrJcsqDO.getXmdj().multiply(new BigDecimal(ykEmrJcsqDO.getSqsl()));
                System.out.println("totalprice"+totalprice);
                String yjxhSql =" select dqz + 1 as \"total\"  from portal_his.gy_identity_ms@ykzxtest where bmc = 'MS_YJ01'";
                List<Map<String,Object>> yjxhList = hibenateUtils.createSQLQuery(yjxhSql);
@ -337,12 +341,13 @@ public class YkyyController extends EnvelopRestEndpoint {
                        if (fyxhList.size()>0){
                            ykMsYj02DO.setXmlx(Integer.valueOf(fyxhList.get(0).get("xmlx").toString()));
                            ykMsYj02DO.setFygb(Integer.valueOf(fyxhList.get(0).get("fygb").toString()));
                            ykMsYj02DO.setYldj(Integer.valueOf(fyxhList.get(0).get("fydj").toString()));
                            ykMsYj02DO.setHjje(ykMsYj02DO.getYldj()*ykMsYj02DO.getYlsl());
                            ykMsYj02DO.setYldj(new BigDecimal(fyxhList.get(0).get("fydj").toString()));
                            ykMsYj02DO.setHjje(totalprice);
                        }
                        ykMsYj02DO.setZfbl(1);
                        ykMsYj02DO.setZxpb(0);
                        ykMsYj02DO.setZjflag(0);
                        ykMsYj02DO.setHjje(totalprice);
                        System.out.println(ykMsYj02DO);
                        ykyyEntranceService.save(ykMsYj02DO);
                    }

+ 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>

+ 4 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java

@ -175,7 +175,7 @@ public class UnSettledHISPrescriptionService {
     */
    public void unSettledHISPrescription() throws Exception{
        if("xm_ykyy_wx".equals(wechatId)){
            //获取审核失败
            //获取审核失败5306758
            JSONArray jsonArray = ykyyEntranceService.getNoUnsettledPrescription();
            if(jsonArray!=null&&jsonArray.size()>0) {
                for (int i = 0; i<jsonArray.size(); i++){
@ -197,6 +197,7 @@ public class UnSettledHISPrescriptionService {
                        msgObj.put("prescriptionId",prescriptionId);
                        msgObj.put("reason","处方驳回");
                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
                        System.out.println("发送诊断消息开始+"+wlyyOutpatientDO.getId());
                        String immsg = imService.pushPrescriptionBackMsg(msgObj,doctor,doctorName,outpatientId,wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
                        System.out.println("发送诊断消息成功:"+immsg);
                    }
@ -258,6 +259,8 @@ public class UnSettledHISPrescriptionService {
                                }
                                WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
                                wlyyPrescriptionDO.setPrescribeTime(new Date());
                                wlyyPrescriptionDO.setCheckStatus(0);
                                wlyyPrescriptionDO.setCheckReason("审核通过");
                                prescriptionDao.save(wlyyPrescriptionDO);
                                JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                                logger.info("wlyyPrescriptionDO参数入参"+object.toJSONString());

+ 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

+ 4 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -555,6 +555,10 @@ public class JobController extends BaseController {
                    //语句
                    internetCommonService.upNsDoctorRecord(keyId);
                    break; //可选
                case "2.4" :
                    //语句
                    internetCommonService.achNsDoctorRecord(keyId);
                    break; //可选
                case "2.5" :
                    //语句
                    internetCommonService.upAppointmentOnline(startDate,endDate,keyId);

+ 2 - 1
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -206,7 +206,7 @@ hospital:
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  im_list_get: http://192.168.33.197:3000/
  data_base_name: im_internet_hospital
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
@ -214,6 +214,7 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  ids: xm_ykyy_wx
  flag: false #演示环境  true走Mysql数据库  false走Oracle
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService

+ 42 - 31
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)){ //心脏中心挂号
@ -418,40 +421,46 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		msgObj.put("msg",baseDoctorDO.getName()+"结束了咨询");
		msgObj.put("consultcode",consult);
		String jsonStr = "";
		if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
		//结束时医生未开处方则发送模板消息结算
		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.getXtgzh(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
				}
				logger.info("发送诊查费支付模板消息end");
			}
		}
		}
		if(1 == resutl){
			jsonStr = "{\"id\":\""+ UUID.randomUUID().toString()+"\",\"sender_id\":\""+doctorCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
		}
@ -1049,9 +1058,11 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.findZlxm)
	@ApiOperation(value = "诊疗项目查询", notes = "诊疗项目查询")
	public ObjEnvelop findZlxm(@ApiParam(name = "itemName", value = "itemName")
								   @RequestParam(value = "itemName", required = false)String itemName)throws Exception {
								   @RequestParam(value = "itemName", required = false)String itemName,
							   @ApiParam(name = "itemCode", value = "itemCode")
							   @RequestParam(value = "itemCode", required = false)String itemCode)throws Exception {
		JSONArray array= ykyyEntranceService.findZlxm(itemName);
		JSONArray array= ykyyEntranceService.findZlxm(itemName,itemCode);
		ObjEnvelop objEnvelop = new ObjEnvelop();
		objEnvelop.setObj(array);
		return objEnvelop;

+ 38 - 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}")
@ -627,39 +630,46 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		msgObj.put("msg",basePatientDO.getName()+"结束了咨询");
		msgObj.put("consultcode",consult);
		String jsonStr = "";
		if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
		//结束时医生未开处方则发送模板消息结算
		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.getXtgzh(), 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}";

+ 6 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/file_upload/FileUploadEndpoint.java

@ -72,6 +72,9 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
            JSONObject json = JSON.parseObject(rs);
            uploadVO = objectMapper.readValue(json.getJSONObject("obj").toJSONString(),UploadVO.class);
        }else if (isClose.equalsIgnoreCase("1")){
            Map<String, Object> map = fileUploadService.uploadImg(file);
            uploadVO.setFullUri(map.get("accessory").toString());
        }
        return success("上传成功", uploadVO);
    }
@ -93,6 +96,9 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
            JSONObject json = JSON.parseObject(rs);
            uploadVO = objectMapper.readValue(json.getJSONObject("obj").toJSONString(),UploadVO.class);
        }else if (isClose.equalsIgnoreCase("1")){
            Map<String, Object> map = fileUploadService.uploadImg(file);
            uploadVO.setFullUri(map.get("accessory").toString());
        }
        return success("上传成功", uploadVO);
    }

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

@ -1,18 +1,26 @@
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.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
@ -22,6 +30,12 @@ import java.util.Map;
public class BaseDoctorBGController extends EnvelopRestEndpoint {
    @Autowired
    private BaseDoctorBGService baseDoctorBGService;
    @Autowired
    private PayInfoNoticeService payInfoNoticeService;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private StatisticsEsService statisticsEsService;
    @ApiOperation("获取背景板")
    @PostMapping(value= BaseHospitalRequestMapping.BaseBackground.getAllBackground)
    public Envelop getAllBG( @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
@ -133,4 +147,28 @@ 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{
        List<Map<String,Object>> list = payInfoNoticeService.dealSqlQuery(startTime,endTime);
        List<Map<String,Object>> listDay = payInfoNoticeService.dealSqlQueryGroupDay(startTime,endTime);
        OutputStream os = response.getOutputStream();
        response.reset();
        response.setContentType("application/octet-stream; charset=utf-8");
        response.setCharacterEncoding("UTF-8");
        //response.setHeader("Content-Disposition", "attachment;filename="+new String("sss".getBytes(), "ISO8859-1"));qwe
        response.setHeader("content-disposition",
                "attachment;filename=" + URLEncoder.encode("在线诊疗统计情况.xls", "UTF-8"));
        payInfoNoticeService.exportEsPrescription(os,list,listDay);
    }
}

+ 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;
                }
            }

File diff suppressed because it is too large
+ 79 - 22
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java


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

@ -146,7 +146,18 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisit(outpatientJson,expressageJson,registerJson,chargeType);
        if (wlyyOutpatientDO!=null&&null==wlyyOutpatientDO.getId()){
            ObjEnvelop objEnvelop =new ObjEnvelop();
            String msg = "";
            if (1==wlyyOutpatientDO.getRemindCount()){
                msg = "自取";
            }else {
                msg = "快递配送";
            }
            objEnvelop.setMessage("您已经选择过"+msg+"方式,请勿修改");
            objEnvelop.setStatus(300);
            return objEnvelop;
        }
       /* //发送系统消息
        SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(wlyyOutpatientDO);
        //发送IM消息

+ 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;
    /**
     *

+ 8 - 3
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;
@ -347,7 +349,9 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
                " t.intro as \"intro\",t.category_first_name as \"categoryFirstName\"," +
                " t.category_second_name as \"categorySecondName\" ," +
                "t.content as \"content\",t.image as \"image\",t.create_user_name as \"createUserName\",c.job_title_name as \"jobTitleName\"," +
                "b.dept_name as \"deptName\",b.org_name as \"hospitalName\" from wlyy_knowledge_article t left join wlyy_knowledge_article_dept a " +
                "b.dept_name as \"deptName\",b.org_name as \"hospitalName\"," +
				"t.create_time as \"createTime\" " +
				" from wlyy_knowledge_article t left join wlyy_knowledge_article_dept a " +
                " on a.article_id = t.id left join base_doctor_hospital b on b.doctor_code = t.create_user" +
				" left join base_doctor c on c.id = t.create_user where 1=1 and t.del = 1 and t.status = 1";
		if (StringUtils.isNotBlank(categoryFirst)){
@ -360,7 +364,8 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
            sql+=" and (t.create_user_name like '%"+keyWords+"%' or t.title like '%"+keyWords+"%' or t.content like '%"+keyWords+"%' or a.dept_name like '%"+keyWords+"%' )";
        }
		sql+=" group by t.id ,t.title ,t.intro,t.category_first_name ,t.category_second_name ,c.job_title_name," +
				"t.read_count,t.collection,t.fabulous,t.is_share,t.content ,t.image ,t.create_user_name ,b.dept_name ,b.org_name order by t.create_time desc";
				"t.read_count,t.collection,t.fabulous,t.is_share,t.content ,t.image ,t.create_user_name ,b.dept_name ,b.org_name,t.create_time " +
				" order by t.create_time desc";
        List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<Map<String,Object>> countList = hibenateUtils.createSQLQuery(sql);
        objEnvelop.setObj(result);

+ 1 - 1
svr/svr-iot-job/src/main/resources/application.yml

@ -153,7 +153,7 @@ wechat:
spring:
  profiles: iotprod
  datasource:
    url: jdbc:mysql://10.90.32.2:20002/xmiot?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://10.90.32.3:20002/xmiot?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: jkzlehr@123
wlyy:

+ 47 - 5
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -13,19 +13,16 @@ import com.yihu.jw.restmodel.iot.device.IotPatientDeviceVO;
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 com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import iot.device.LocationDataVO;
import jxl.demo.Write;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.io.Writer;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -447,6 +444,8 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
            @RequestParam(value = "diseaseCondition",required = false) Integer diseaseCondition,
            @ApiParam(name = "type", value = "1高血压 2糖尿病", defaultValue = "")
            @RequestParam(value = "type",required = false) String type,
            @ApiParam(name="deviceType",value="设备类型 对应设备字典库的DEVICE_TYPE值",required = true)
            @RequestParam(value="deviceType",required = true) String deviceType,
            @ApiParam(name="page",value="第几页(默认第一页)",defaultValue = "1")
            @RequestParam(value="page",required = false) Integer page,
            @ApiParam(name="pageSize",value="每页几行(默认10条记录)",defaultValue = "10")
@ -458,7 +457,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
            if(pageSize==null){
                pageSize = 10;
            }
            return monitorPlatformService.findDeviceLocations(diseaseCondition,page,pageSize,type);
            return monitorPlatformService.findDeviceLocations(diseaseCondition,page,pageSize,type,deviceType);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError("操作失败");
@ -618,6 +617,49 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
        }
    }
    /**
     * 根据患者标志获取健康指标
     * @param idcard 患者指标
     * @param type 健康指标类型(1血糖,2血压,3体重,4腰围)
     * @return 操作结果
     */
    @RequestMapping(value = "health_index/listByIdcard",method = RequestMethod.POST)
    @ApiOperation("根据患者标志获取健康指标")
    public String getHealthIndexByIdcard(@ApiParam(name="idcard",value="居民身份证",defaultValue = "P20160901001")
                                         @RequestParam(value="idcard",required = true) String idcard,
                                         @ApiParam(name="type",value="指标类型",defaultValue = "1")
                                         @RequestParam(value="type",required = true) int type,
                                         @ApiParam(name="begin",value="开始时间",defaultValue = "2016-07-23 00:00:00")
                                         @RequestParam(value="begin",required = true) String begin,
                                         @ApiParam(name="end",value="开始时间",defaultValue = "2016-08-23 00:00:00")
                                         @RequestParam(value="end",required = true) String end,
                                         @ApiParam(name="page",value="第几页",defaultValue = "1")
                                         @RequestParam(value="page",required = true) int page,
                                         @ApiParam(name="pagesize",value="每页几行",defaultValue = "10")
                                         @RequestParam(value="pagesize",required = true) int pagesize,HttpServletRequest request) {
        try {
            return monitorPlatformService.getHealthIndexByIdcard(idcard, type, begin, end, page, pagesize,request);
        } catch (Exception ex) {
            ex.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    /**
     * 获取居民信息
     */
    @RequestMapping(value = "patientInfo",method = RequestMethod.GET)
    @ApiOperation("获取居民信息")
    public String patientInfo(@ApiParam(name="idcard",value="居民身份证",defaultValue = "P20160901001")
                              @RequestParam(value="idcard",required = true) String idcard) {
        try {
            return monitorPlatformService.patientInfo(idcard);
        } catch (Exception ex) {
            ex.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    /**
     * 返回接口处理结果
     *

+ 5 - 5
svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotHospitalService.java

@ -50,11 +50,11 @@ public class IotHospitalService extends BaseJpaService<IotHospitalDO, IotHospita
            sql += "and h.level = '" + level + "' ";
        }
        //数据权限过滤
        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
        if(!orgList.contains(userAgent.commonHospital)){
            sql += " and h.saas_id in ("+orgUserService.getUserOrg(orgList)+")";
        }
//        //数据权限过滤
//        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
//        if(!orgList.contains(userAgent.commonHospital)){
//            sql += " and h.saas_id in ("+orgUserService.getUserOrg(orgList)+")";
//        }
        if(page != null && pageSize != null){
            Long count = Long.valueOf(jdbcTemplate.queryForList(sql).size());

+ 49 - 4
svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java

@ -4,19 +4,21 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.iot.dao.equipment.IotEquipmentDetailDao;
import com.yihu.iot.util.excel.EntityUtils;
import com.yihu.iot.util.excel.HibenateUtils;
import com.yihu.jw.datainput.Data;
import com.yihu.jw.entity.iot.equipment.IotEquipmentDetailDO;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import iot.device.LocationDataVO;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.sql.*;
import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@Service
public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, IotEquipmentDetailDao> {
@ -168,4 +170,47 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
       return list;
    }
    public List<LocationDataVO> getEquipmentLocation(Integer page, Integer size){
        List<Map<String, Object>> jsonArray = new ArrayList<>();
        List<LocationDataVO> result = new ArrayList<>();
        String sql = "SELECT  " +
                "id AS id,  " +
                "device_code AS deviceSn, " +
                "applicant_name AS name, " +
                "device_name AS equimentName, " +
                "latitude AS lat, " +
                "longitude AS lon, " +
                "create_time AS createTime " +
                "FROM " +
                "iot_equipmet_detail LIMIT "+(page-1)*size+","+size;
        jsonArray = jdbcTemplate.queryForList(sql);
        for (Map<String, Object> jsobj:jsonArray){
            LocationDataVO locationDataVO = new LocationDataVO();
            GeoPoint geoPoint = new GeoPoint(Double.valueOf(jsobj.get("lat").toString()),Double.valueOf(jsobj.get("lon").toString()));
            locationDataVO.setId((String) jsobj.get("id"));
            locationDataVO.setIdCard(null);
            locationDataVO.setCategoryCode("5");
            locationDataVO.setDeviceSn((String) jsobj.get("deviceSn"));
            locationDataVO.setLocation(geoPoint);
            locationDataVO.setDeviceTime(null);
            locationDataVO.setLabel(null);
            locationDataVO.setDiseaseCondition(5);
            locationDataVO.setCreateTime(jsobj.get("createTime").toString());
            locationDataVO.setName((String) jsobj.get("name"));
            locationDataVO.setCode(null);
            locationDataVO.setEquimentName((String) jsobj.get("equimentName"));
            result.add(locationDataVO);
        }
        return result;
    }
    public Integer getEquipmentCount(){
        String sql = "SELECT count(1) totalCount FROM iot_equipmet_detail ";
        Integer totalCount = jdbcTemplate.queryForObject(sql,Integer.class);
        return totalCount;
    }
}

+ 86 - 10
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -9,6 +9,7 @@ import com.yihu.iot.service.common.MyJdbcTemplate;
import com.yihu.iot.service.device.IotPatientDeviceService;
import com.yihu.iot.service.equipment.IotEqtDetailService;
import com.yihu.iot.service.label.FigureLabelSerachService;
import com.yihu.iot.service.platform.IotInterfaceLogService;
import com.yihu.iot.util.excel.HibenateUtils;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.equipment.IotEquipmentDetailDO;
@ -26,6 +27,7 @@ import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.*;
@ -64,13 +66,15 @@ public class MonitorPlatformService  {
    private HibenateUtils hibenateUtils;
    @Autowired
    private IotSystemDictDao iotSystemDictDao;
    @Autowired
    private IotInterfaceLogService iotInterfaceLogService;
    /**
     * 获取位置信息
     * @param diseaseCondition
     * @return
     */
    public MixEnvelop<LocationDataVO, LocationDataVO> findDeviceLocations(Integer diseaseCondition, Integer page, Integer size, String type) throws IOException {
    public MixEnvelop<LocationDataVO, LocationDataVO> findDeviceLocations(Integer diseaseCondition, Integer page, Integer size, String type,String deviceType) throws IOException {
        MixEnvelop<LocationDataVO, LocationDataVO> envelop = new MixEnvelop<>();
        MixEnvelop<LocationDataVO, LocationDataVO> envelopTmp = null;
        JSONArray jsonArray = new JSONArray();
@ -103,6 +107,9 @@ public class MonitorPlatformService  {
            envelop.setTotalCount(total);
            return envelop;
        }else {
            List<LocationDataVO> euipmentList = new ArrayList<>();
            int totalEqCount=0;
            int totalCount=0;
            //查找全部
            if(diseaseCondition!=null){
                JSONObject json = new JSONObject();
@ -112,15 +119,43 @@ public class MonitorPlatformService  {
                json.put("value",diseaseCondition);
                jsonArray.add(json);
            }
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("filter",jsonArray);
            jsonObject.put("page",page);
            jsonObject.put("size",size);
            List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
            List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
            //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
            envelop.getDetailModelList().addAll(list2);
            envelop.setTotalCount(iotPatientDeviceService.getESCount(jsonObject.toString()));
            //小屋总数
            if(deviceType.contains("5")){
               totalEqCount = iotEqtDetailService.getEquipmentCount();
            }
            String[] categoryCodes= deviceType.split(",");
            if(categoryCodes.length==1&&"5".equals(deviceType)){
                euipmentList = iotEqtDetailService.getEquipmentLocation(page,size);
                envelop.getDetailModelList().addAll(euipmentList);
            }
            else{
                if(deviceType.contains("5")){
                    euipmentList = iotEqtDetailService.getEquipmentLocation(page,size);
                    envelop.getDetailModelList().addAll(euipmentList);
                }
                for (String categoryCode:categoryCodes){
                     if(!"5".equals(categoryCode)){
                         JSONObject json = new JSONObject();
                         json.put("andOr","and");
                         json.put("field","categoryCode");
                         json.put("condition","=");
                         json.put("value",Integer.parseInt(categoryCode));
                         jsonArray.add(json);
                         JSONObject jsonObject = new JSONObject();
                         jsonObject.put("filter",jsonArray);
                         jsonObject.put("page",page);
                         jsonObject.put("size",size);
                         List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                         List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                         //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                         envelop.getDetailModelList().addAll(list2);
                         totalCount += iotPatientDeviceService.getESCount(jsonObject.toString());
                         jsonArray.remove(json);
                     }
                }
            }
            envelop.setTotalCount(totalCount>totalEqCount?totalCount:totalEqCount);
            return envelop;
        }
    }
@ -367,6 +402,47 @@ public class MonitorPlatformService  {
        return sendGet(url,params);
    }
    /**
     * 根据患者标志获取健康指标
     * @param idcard
     * @param type
     * @param begin
     * @param end
     * @param page
     * @param pagesize
     * @return
     */
    public String getHealthIndexByIdcard(String idcard,int type, String begin,String end, int page,int pagesize,HttpServletRequest request) {
        String url = "/wlyygc/iot_monitoring/health_index/listByIdcard";
        Map<String, Object> params = new HashMap<>();
        params.put("idcard",idcard);
        params.put("begin",begin);
        params.put("end",end);
        params.put("type",type);
        params.put("page",page);
        params.put("pagesize",pagesize);
        try{
            //记录log
            iotInterfaceLogService.saveLog("zy808081724b116c017254d437fe000b",JSONObject.toJSONString(params),null, request,200,"getHealthIndexByIdcard");
        }catch (Exception e){
            e.printStackTrace();
        }
        return sendGet(url,params);
    }
    /**
     * 获取居民信息
     * @param idcard
     * @return
     */
    public String patientInfo(String idcard) {
        String url = "/wlyygc/iot_monitoring/patientInfo";
        Map<String, Object> params = new HashMap<>();
        params.put("idcard",idcard);
        return sendGet(url,params);
    }
    /**
     * 质控情况

+ 3 - 3
svr/svr-iot/src/main/resources/application.yml

@ -231,14 +231,14 @@ wechat:
spring:
  profiles: iotprod
  datasource:
    url: jdbc:mysql://10.90.32.2:20002/xmiot?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://10.90.32.3:20002/xmiot?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: jkzlehr@123
  elasticsearch:
    cluster-name: jkzl #默认即为elasticsearch  集群名
    cluster-nodes: 10.90.32.2:20011,10.90.32.2:20011 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    cluster-nodes: 10.90.32.3:20011,10.90.32.3:20011 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    jest:
      uris: http://10.90.32.2:20011,http://10.90.32.2:20012
      uris: http://10.90.32.3:20011,http://10.90.32.3:20012
  wlyy:
    url: http://www.xmtyw.cn/wlyytest/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62

+ 1 - 1
svr/svr-iot/src/main/resources/bootstrap.yml

@ -102,5 +102,5 @@ spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.120.216:1221}
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}