Browse Source

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

humingfen 5 years ago
parent
commit
1814bbc240
100 changed files with 6557 additions and 124 deletions
  1. 53 9
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 253 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  3. 1725 0
      business/base-service/src/main/java/com/yihu/jw/internet/service/ykyy/YkyyInternetService.java
  4. 22 4
      business/base-service/src/main/java/com/yihu/jw/utils/ImgUtils.java
  5. 77 1
      business/base-service/src/main/java/com/yihu/jw/wechat/enterprise/EnterpriseService.java
  6. 9 0
      business/base-service/src/main/java/com/yihu/jw/wlyy/service/WlyyBusinessService.java
  7. 1024 3
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  8. 105 4
      business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java
  9. 7 1
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  10. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseCityDO.java
  11. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseCommitteeDO.java
  12. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseProvinceDO.java
  13. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseStreetDO.java
  14. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseTownDO.java
  15. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/customize/UserHideModuleInterfaceDO.java
  16. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictDiseaseDO.java
  17. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictDoctorDutyDO.java
  18. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictHealthProblemDO.java
  19. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictHospitalDeptDO.java
  20. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictIcd10DO.java
  21. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictJobTitleDO.java
  22. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictMedicineDO.java
  23. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictMedicineDistributeOrgDO.java
  24. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictMedicineDosageFormDO.java
  25. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictMedicineSubjectDO.java
  26. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorHospitalDO.java
  27. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorRoleDO.java
  28. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorRoleInfoDO.java
  29. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseModuleRoleDO.java
  30. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/DoctorSpecialDiseaseDo.java
  31. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageDO.java
  32. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageTypeDO.java
  33. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgSaasDO.java
  34. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgUserDO.java
  35. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/AccountAppealDO.java
  36. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/FeedbackDO.java
  37. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/HelpCenterDO.java
  38. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/PatientMedicareCardDO.java
  39. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/role/BaseRoleMenuDO.java
  40. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/role/RoleAuthorityDO.java
  41. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/role/RoleMenuDO.java
  42. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasBusinessCardDO.java
  43. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/team/BaseTeamMemberDO.java
  44. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/theme/ThemeDO.java
  45. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/version/AppVersionDO.java
  46. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/JsApiTicket.java
  47. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxPayLogDO.java
  48. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxUrlConfigDO.java
  49. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/dimension/DimensionDo.java
  50. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/dimension/DimensionQuotaDo.java
  51. 0 1
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dict/WlyyChargeDictDO.java
  52. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/doctor/BaseDoctorZsInfoDO.java
  53. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/mapping/HospitalDeptMappingDO.java
  54. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyInspectionPartsDictDO.java
  55. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyDeptDO.java
  56. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyInspLabelInfoDO.java
  57. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyLabelInfoDO.java
  58. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/myFamily/PatientApplyLog.java
  59. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/RehabilitationServiceItemDO.java
  60. 10 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  61. 2 3
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/area/BaseCommitteeVO.java
  62. 2 4
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/team/BaseTeamMemberVO.java
  63. 7 0
      gateway/ag-basic/src/main/resources/bootstrap.yml
  64. 7 0
      server/svr-authentication/src/main/resources/bootstrap.yml
  65. 2 4
      svr/svr-base/src/main/java/com/yihu/jw/base/service/org/OrgTree.java
  66. 7 0
      svr/svr-base/src/main/resources/bootstrap.yml
  67. 42 0
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/EnterpriseController.java
  68. 7 0
      svr/svr-internet-hospital-job/pom.xml
  69. 22 82
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/event/ApplicationEvent.java
  70. 27 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  71. 37 0
      svr/svr-internet-hospital-job/src/main/resources/application.yml
  72. 8 2
      svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml
  73. 30 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java
  74. 7 3
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  75. 285 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java
  76. 3 2
      svr/svr-internet-hospital/src/main/resources/application.yml
  77. 0 0
      svr/svr-oracle-test/sql/sql
  78. 25 0
      svr/svr-oracle-test/src/main/java/com/yihu/SvrInternetHospitalApplication.java
  79. 27 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/config/BeanConfig.java
  80. 18 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/config/SpringSecurityAuditorAware.java
  81. 44 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/config/SwaggerDocs.java
  82. 19 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/ConsultPriceDao.java
  83. 19 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/KnowledgeArticleDao.java
  84. 19 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/KnowledgeArticleDeptDao.java
  85. 18 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/KnowledgeCategoryDao.java
  86. 13 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/ReservationSettingDao.java
  87. 20 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/SysDictDao.java
  88. 28 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/WlyyPatientExpressageAddrDao.java
  89. 33 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/account/PatientEndpoint.java
  90. 49 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/analysis/AnalysisEndPoint.java
  91. 108 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/appointment/AppointmentEndPoint.java
  92. 198 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleEndpoint.java
  93. 202 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java
  94. 120 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java
  95. 101 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/consult/ConsultPriceEndpoint.java
  96. 746 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  97. 614 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  98. 101 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/consult/ReservationSettingEndpoint.java
  99. 157 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/consult/SysDictEndpoint.java
  100. 0 0
      svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/demo/HibenateDemoEndpoint.java

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

@ -50,6 +50,7 @@ import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wlyy.wlyyhttp.WlyyHttpService;
import com.yihu.mysql.query.BaseJpaService;
@ -80,7 +81,7 @@ import java.lang.Boolean;
import java.util.*;
/**
 * Created by Trick on 2019/5/17
 * Created by Trick on 2019/5/17.
 */
@Service
@Transactional
@ -1112,7 +1113,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " h.org_code = '"+orgCode+"'" +
                " AND r.role_code ='specialist'";
        if(StringUtils.isNotBlank(chargeType)){
            totalSql+=" AND d.charge_type ='"+chargeType+"'";
            if("all".equals(chargeType)){
                //不过滤号别
            }else{
                totalSql+=" AND d.charge_type ='"+chargeType+"'";
            }
        }else{
            //不传号别过滤不为为空
            totalSql+=" AND d.charge_type is not null ";
        }
        if(StringUtils.isNotBlank(dept)){
            totalSql+= " AND h.dept_code = '"+dept+"' " ;
@ -1146,7 +1155,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " h.org_code = '"+orgCode+"'"+
                " AND r.role_code ='specialist'";
        if(StringUtils.isNotBlank(chargeType)){
            sql+=" AND d.charge_type ='"+chargeType+"'";
            if("all".equals(chargeType)){
                //不过滤号别
            }else{
                sql+=" AND d.charge_type ='"+chargeType+"'";
            }
        }else{
            //不传号别过滤不为为空
            sql+=" AND d.charge_type is not null ";
        }
        if(StringUtils.isNotBlank(dept)){
            sql+= " AND h.dept_code = '"+dept+"' " ;
@ -2250,12 +2266,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
               BaseOrgDO org = baseOrgDao.findByCode(hospitalDOs.get(0).getOrgCode());
               rs.put("winNo",org.getWinNo());
               rs.put("deptName",hospitalDOs.get(0).getDeptName());
                rs.put("dept",hospitalDOs.get(0).getDeptCode());
               rs.put("dept",hospitalDOs.get(0).getDeptCode());
            }else{
               rs.put("hospital",null);
               rs.put("winNo",null);
               rs.put("deptName",null);
                rs.put("dept",null);
               rs.put("dept",null);
            }
@ -2301,7 +2317,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
            //专家咨询
            String zjCountsql = "SELECT id FROM wlyy_consult_team WHERE doctor='"+doctor+"' AND (type=1 OR type=15)";
            List<Map<String,Object>> zjList = jdbcTemplate.queryForList(sql);
            List<Map<String,Object>> zjList = jdbcTemplate.queryForList(zjCountsql);
    
            if(zjList!=null&&zjList.size()>0){
                rs.put("zjCount",zjList.size());
@ -4332,14 +4348,42 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
       return entranceService.BS10008(idcard,patientId,admitNum,ybcard,demoFlag);
    }
    public List<Map<String,Object>> findDoctorByName(String name){
    /**
     * 获取医生信息
     * @param hospital
     * @param name
     * @return
     */
    public List<Map<String,Object>> findDoctorByName(String hospital, String name,String chargeType){
        String sql ="SELECT " +
                " d.id AS \"id\", " +
                " d.`name` AS \"name\"" +
                " FROM " +
                " base_doctor d " +
                " WHERE " +
                " base_doctor d ";
        if(StringUtils.isNotBlank(hospital)){
            sql +=" JOIN base_doctor_hospital h ON h.doctor_code = d.id";
        }
        sql +=" JOIN base_doctor_role r ON r.doctor_code = d.id ";
        sql +=" WHERE " +
                " d. NAME LIKE '%"+name+"%'";
        if(StringUtils.isNotBlank(hospital)){
            sql +=" AND h.org_code ='"+hospital+"'";
        }
        if(StringUtils.isNotBlank(chargeType)){
            if("all".equals(chargeType)){
                //查询全部号源
            }else{
                sql+=" AND d.charge_type ='"+chargeType+"'";
            }
        }else{
            sql+=" AND d.charge_type is not null ";
        }
        sql += " AND r.role_code ='specialist'";
        logger.info("findDoctorByName :"+sql);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        if(list!=null&&list.size()>0){
            for(int i=0;i<list.size();i++){

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

@ -1,24 +1,276 @@
package com.yihu.jw.hospital.prescription.service.entrance;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import javafx.scene.DepthTest;
import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Random;
/**
 * 眼科医院专用service
 * Created by Trick on 2020/1/19.
 */
@Service
@Transactional
public class YkyyEntranceService {
    private static Logger logger = LoggerFactory.getLogger(YkyyEntranceService.class);
    private final static String url="http://192.168.20.55:10023/ykyy/createSQLQuery";
    private final static String orgCode ="350211A5004";
    private final static String orgName ="厦门大学附属厦门眼科中心";
    @Autowired
    private DictHospitalDeptDao hospitalDeptDao;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    @Autowired
    private BaseDoctorRoleDao baseDoctorRoleDao;
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
        return hibenateUtils.createSQLQuery( sql,  params,  page,  size);
        return hibenateUtils.createSQLQuery(sql,params,page,size);
    }
    /**
     * 同步科室信息
     * @return
     * @throws Exception
     */
    public String updateYkyyDept()throws Exception{
        String sql ="select code AS \"code\",name as \"name\",consultdeptflag as \"consultDeptFlag\" from V_HLW_KSXX";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("updateYkyyDept:"+sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            JSONArray array = rs.getJSONArray("detailModelList");
            logger.info("dept size:"+array.size());
            if(array!=null&&array.size()>0){
                for(int i=0;i<array.size();i++){
                    JSONObject deptjson = array.getJSONObject(i);
                    String code = deptjson.getString("code");
                    List<DictHospitalDeptDO> list = hospitalDeptDao.findByOrgCodeAndCode(orgCode,code);
                    if(list!=null&&list.size()>0){
                        DictHospitalDeptDO deptDO = list.get(0);
                        deptDO.setName(deptjson.getString("name"));
                        deptDO.setConsultDeptFlag(deptjson.getString("consultdeptflag"));
                        hospitalDeptDao.save(deptDO);
                    }else {
                        //新增
                        DictHospitalDeptDO deptDO = new DictHospitalDeptDO();
                        deptDO.setOrgCode(orgCode);
                        deptDO.setCode(code);
                        deptDO.setName(deptjson.getString("name"));
                        deptDO.setConsultDeptFlag(deptjson.getString("consultdeptflag"));
                        deptDO.setCreateTime(new Date());
                        hospitalDeptDao.save(deptDO);
                    }
                }
            }
        }
        return "success";
    }
    public String updateYkyyDoctor()throws Exception{
        String sql ="select y.code AS \"code\",y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\" from v_Hlw_Ysxx y where y.idcard is not null";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            JSONArray array = rs.getJSONArray("detailModelList");
            logger.info("doctor size:"+array.size());
            if(array!=null&&array.size()>0) {
                for (int i = 0; i < array.size(); i++) {
                    JSONObject doctorJson = array.getJSONObject(i);
                    String idcard = doctorJson.getString("idcard");
                    //过滤身份证脏数据
                    if(idcard.length()>=15){
                        List<BaseDoctorDO> doctorDOs = baseDoctorDao.findByIdcard(idcard);
                        if(doctorDOs!=null&&doctorDOs.size()>0){
                            BaseDoctorDO doctor = doctorDOs.get(0);
                            String salt = randomString(5);
                            String pw = idcard.substring(idcard.length() - 6);
                            doctor.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                            doctor.setSalt(salt);
                            doctor.setJobTitleCode(doctorJson.getString("jobtitlecode"));
                            doctor.setJobTitleName(doctorJson.getString("jobTitleName"));
//                            doctor.setExpertise(doctorJson.getString("expertise"));
//                            doctor.setIntroduce(doctorJson.getString("introduce"));
//                            doctor.setMobile(doctorJson.getString("mobile"));
                            BaseDoctorDO temp = baseDoctorDao.save(doctor);
                            List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByOrgCodeAndDeptCodeAndDoctorCode(orgCode,doctorJson.getString("dept"),doctor.getId());
                            if(hospitalDOs!=null&&hospitalDOs.size()>0){
                                //机构信息部门信息
                                BaseDoctorHospitalDO hospitalDO = hospitalDOs.get(0);
                                hospitalDO.setDeptCode(doctorJson.getString("dept"));
                                hospitalDO.setDeptName(doctorJson.getString("deptName"));
                                hospitalDO.setDel("1");
                                baseDoctorHospitalDao.save(hospitalDO);
                            }
                        }else{
                            //新增医生
                            BaseDoctorDO doctor = new BaseDoctorDO();
                            doctor.setName(doctorJson.getString("name"));
                            doctor.setIdcard(idcard);
                            doctor.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)));
                            doctor.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
                            doctor.setProvinceCode("350000");
                            doctor.setProvinceName("福建省");
                            doctor.setTownCode("350203");
                            doctor.setTownName("思明区");
                            doctor.setCityCode("350200");
                            doctor.setCityName("厦门市");
//                            doctor.setExpertise(doctorJson.getString("expertise"));
//                            doctor.setIntroduce(doctorJson.getString("introduce"));
//                            doctor.setMobile(doctorJson.getString("mobile"));
                            //认证信息设置
                            String salt = randomString(5);
                            String pw = idcard.substring(idcard.length() - 6);
                            doctor.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                            doctor.setSalt(salt);
                            doctor.setDel("1");
                            doctor.setEnabled(1);
                            doctor.setLocked(0);
                            doctor.setCreateTime(new Date());
                            doctor.setJobTitleCode(doctorJson.getString("jobtitlecode"));
                            doctor.setJobTitleName(doctorJson.getString("jobTitleName"));
                            BaseDoctorDO temp = baseDoctorDao.save(doctor);
                            //机构信息部门信息
                            BaseDoctorHospitalDO hospitalDO = new BaseDoctorHospitalDO();
                            hospitalDO.setDoctorCode(temp.getId());
                            hospitalDO.setOrgCode(orgCode);
                            hospitalDO.setOrgName(orgName);
                            hospitalDO.setDeptCode(doctorJson.getString("dept"));
                            hospitalDO.setDeptName(doctorJson.getString("deptName"));
                            hospitalDO.setDel("1");
                            baseDoctorHospitalDao.save(hospitalDO);
                            //保存角色
                            BaseDoctorRoleDO role = new BaseDoctorRoleDO();
                            role.setDoctorCode(temp.getId());
                            role.setRoleCode("specialist");
                            baseDoctorRoleDao.save(role);
                            //保存mapping
                            DoctorMappingDO mappingDO = new DoctorMappingDO();
                            mappingDO.setIdcard(idcard);
                            mappingDO.setDoctor(temp.getId());
                            mappingDO.setDoctorName(temp.getName());
                            mappingDO.setOrgCode(orgCode);
                            mappingDO.setOrgName(orgName);
                            mappingDO.setMappingCode(doctorJson.getString("code"));
                            mappingDO.setMappingName(temp.getName());
                            mappingDO.setCreateTime(new Date());
                            doctorMappingDao.save(mappingDO);
                        }
                    }
                }
            }
        }
        return "success";
    }
    public String randomString(int length) {
        String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        StringBuffer buffer = new StringBuffer();
        Random random = new Random();
        for(int i = 0; i < length; ++i) {
            int pos = random.nextInt(str.length());
            buffer.append(str.charAt(pos));
        }
        return buffer.toString();
    }
//    public String test(){
//
//        DictHospitalDeptDO deptDO = new DictHospitalDeptDO();
////        deptDO.setId(5);
//        deptDO.setOrgCode("test");
//        deptDO.setCode("test");
//        deptDO.setName("test");
//        deptDO.setConsultDeptFlag("test");
//        deptDO.setCreateTime(new Date());
//        hospitalDeptDao.save(deptDO);
//
////        BaseDoctorHospitalDO hospitalDO = new BaseDoctorHospitalDO();
////        hospitalDO.setDeptName("test");
////        hospitalDO.setDeptCode("test");
////        hospitalDO.setOrgCode("test");
////        hospitalDO.setOrgName("test");
////        hospitalDO.setDeptCode("test");
////        hospitalDO.setDeptName("test");
////        hospitalDO.setDel("1");
////        baseDoctorHospitalDao.save(hospitalDO);
//        return "ok";
//    }
}

File diff suppressed because it is too large
+ 1725 - 0
business/base-service/src/main/java/com/yihu/jw/internet/service/ykyy/YkyyInternetService.java


+ 22 - 4
business/base-service/src/main/java/com/yihu/jw/utils/ImgUtils.java

@ -2,10 +2,7 @@ package com.yihu.jw.utils;
import sun.misc.BASE64Encoder;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.*;
import java.net.URL;
/**
@ -62,4 +59,25 @@ public class ImgUtils {
        //转化方法2
//        return new String(Base64.encodeBase64(data));
    }
    public static String getImageStr(String imgFile) {
        //将图片文件转化为字节数组字符串,并对其进行Base64编码处理
        InputStream in = null;
        byte[] data = null;
        //读取图片字节数组
        try
        {
            in = new FileInputStream(imgFile);
            data = new byte[in.available()];
            in.read(data);
            in.close();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        //对字节数组Base64编码
        BASE64Encoder encoder = new BASE64Encoder();
        return encoder.encode(data);//返回Base64编码过的字节数组字符串
    }
}

+ 77 - 1
business/base-service/src/main/java/com/yihu/jw/wechat/enterprise/EnterpriseService.java

@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2020/2/8.
@ -124,7 +125,7 @@ public class EnterpriseService {
        return "";
    }
    public String sendMKMesByMobile(String enterpriseId,String mobile,String content)throws Exception{
    public String  sendMKMesByMobile(String enterpriseId,String mobile,String content)throws Exception{
        WxEnterpriseUserDO user = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(enterpriseId,mobile);
        if(user!=null){
@ -154,6 +155,28 @@ public class EnterpriseService {
        return "";
    }
    public String sendXCXMesByDoctor(String enterpriseId, String doctor, String appid,String page, String title, String description, Boolean emphasis_first_item, String content_item)throws Exception {
        BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctor);
        if (baseDoctorDO != null && StringUtils.isNotBlank(baseDoctorDO.getMobile())) {
            WxEnterpriseUserDO user = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(enterpriseId, baseDoctorDO.getMobile());
            if (user != null) {
                return sendXCXMes(enterpriseId,user.getUserid(),appid,page,title,description,emphasis_first_item,content_item);
            }
        }
        return "";
    }
    public String sendXCXMesByMobile(String enterpriseId, String mobile, String appid,String page, String title, String description, Boolean emphasis_first_item, String content_item)throws Exception{
        WxEnterpriseUserDO user = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(enterpriseId,mobile);
        if(user!=null){
            return sendXCXMes(enterpriseId,user.getUserid(),appid,page,title,description,emphasis_first_item,content_item);
        }
        return "";
    }
    public String sendTWMes(String enterpriseId,String userId,String title,String description,String url)throws Exception{
        String mesurl = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="+getToken(enterpriseId);
@ -250,6 +273,59 @@ public class EnterpriseService {
        return rs;
    }
    /**
     *
     touser	否	成员ID列表(消息接收者,多个接收者用‘|’分隔,最多支持1000个)
     toparty	否	部门ID列表,多个接收者用‘|’分隔,最多支持100个。
     totag	否	标签ID列表,多个接收者用‘|’分隔,最多支持100个。
     msgtype	是	消息类型,此时固定为:miniprogram_notice
     appid	是	小程序appid,必须是与当前小程序应用关联的小程序
     page	否	点击消息卡片后的小程序页面,仅限本小程序内的页面。该字段不填则消息点击后不跳转。
     title	是	消息标题,长度限制4-12个汉字(支持id转译)
     description	否	消息描述,长度限制4-12个汉字(支持id转译)
     emphasis_first_item	否	是否放大第一个content_item
     content_item	否	消息内容键值对,最多允许10个item
     key	是	长度10个汉字以内
     value	是	长度30个汉字以内(支持id转译)
     enable_id_trans	否	表示是否开启id转译,0表示否,1表示是,默认0
     enable_duplicate_check	否	表示是否开启重复消息检查,0表示否,1表示是,默认0
     duplicate_check_interval	否	表示是否重复消息检查的时间间隔,默认1800s,最大不超过4小时
     * @throws Exception
     */
    public String sendXCXMes(String enterpriseId, String userId, String appid,String page, String title, String description, Boolean emphasis_first_item, String content_item)throws Exception{
        String mesurl = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="+getToken(enterpriseId);
        JSONObject param = new JSONObject();
        param.put("touser",userId);
        param.put("toparty","");
        param.put("totag","");
        param.put("msgtype","miniprogram_notice");
        JSONObject miniprogram_notice = new JSONObject();
        miniprogram_notice.put("appid",appid);
        miniprogram_notice.put("page",page);
        miniprogram_notice.put("title",title);
        miniprogram_notice.put("description",description);
        miniprogram_notice.put("emphasis_first_item",emphasis_first_item);
        JSONArray contents = JSONArray.parseArray(content_item);
        miniprogram_notice.put("content_item",contents);
        param.put("miniprogram_notice",miniprogram_notice);
        param.put("enable_id_trans",0);
        param.put("enable_duplicate_check",0);
        logger.info("XCXparam:"+param.toJSONString());
        String rs = HttpUtil.sendPost(mesurl,param.toJSONString());
        logger.info("XCXMes:"+rs);
        return rs;
    }
    public JSONArray getUserInfo(String enterpriseId,String dept)throws Exception{
        logger.info("getUserInfo dept:"+dept);

+ 9 - 0
business/base-service/src/main/java/com/yihu/jw/wlyy/service/WlyyBusinessService.java

@ -522,6 +522,7 @@ public class WlyyBusinessService {
                                String salt = randomString(5);
                                String pw = idcard.substring(idcard.length() - 6);
                                doctor.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                                doctor.setSalt(salt);
                                doctor.setDel("1");
                                doctor.setEnabled(1);
                                doctor.setLocked(0);
@ -626,4 +627,12 @@ public class WlyyBusinessService {
        }
    }
    public static void main(String ag[]){
        String id = "350212198709121575";
        String salt = "dfgtr";
        String pw = id.substring(id.length() - 6);
        String  spw = MD5.md5Hex(pw + "{" + salt + "}");
        System.out.println(spw);
    }
}

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

@ -155,12 +155,36 @@ public class StatisticsEsService {
        if (interval==1){
            JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
            JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,"5","1",SaveModel.timeLevel_ZL,null);
            object.put("specialistData",array1);
            JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,"5","9",SaveModel.timeLevel_ZL,null);
            object.put("topicData",array2);
            JSONArray array3 = dateTotalStatistics2(startDate,endDate,area,level,"5","12",SaveModel.timeLevel_ZL,null);
            object.put("synergyData",array3);
            JSONArray array4 = dateTotalStatistics2(startDate,endDate,area,level,"5","16",SaveModel.timeLevel_ZL,null);
            object.put("vedioData",array4);
        }else if (interval==2){
            JSONArray array = weekTotalStatistics(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
            JSONArray array1 = weekTotalStatistics(startDate,endDate,area,level,"5","1",SaveModel.timeLevel_ZL);
            object.put("specialistData",array1);
            JSONArray array2 = weekTotalStatistics(startDate,endDate,area,level,"5","9",SaveModel.timeLevel_ZL);
            object.put("topicData",array2);
            JSONArray array3 = weekTotalStatistics(startDate,endDate,area,level,"5","12",SaveModel.timeLevel_ZL);
            object.put("synergyData",array3);
            JSONArray array4 = weekTotalStatistics(startDate,endDate,area,level,"5","16",SaveModel.timeLevel_ZL);
            object.put("vedioData",array4);
        }else if (interval==3){
            JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
            JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,"5","1",SaveModel.timeLevel_ZL);
            object.put("specialistData",array1);
            JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,"5","9",SaveModel.timeLevel_ZL);
            object.put("topicData",array2);
            JSONArray array3 = monthTotalStatistics2(startDate,endDate,area,level,"5","12",SaveModel.timeLevel_ZL);
            object.put("synergyData",array3);
            JSONArray array4 = monthTotalStatistics2(startDate,endDate,area,level,"5","16",SaveModel.timeLevel_ZL);
            object.put("vedioData",array4);
        }
        if (StringUtils.isNoneBlank(level2_type)){
@ -1422,6 +1446,141 @@ public class StatisticsEsService {
    }
    /**
     * 按月统计 折线图-排班
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @param lowCode
     * @return
     * @throws Exception
     */
    private JSONArray monthTotalStatistics2AndMonth(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));
        // 结束日期
        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)) {
            saveModels = elasticsearchUtil.findDateQuotaLevel0AndPaibanLine(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month, lowCode);
        } else {
            saveModels = elasticsearchUtil.findDateQuotaLevel0AndPaibanLine(startDate, endDate, area, level, index, timelevel, SaveModel.interval_month,null);
        }
        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 开始时间
@ -1518,6 +1677,111 @@ public class StatisticsEsService {
        return result;
    }
    public List<Map<String, Object>> getCoutList1(Integer level, String lowLevel, List<SaveModel> endConsult, List<SaveModel> total, List<SaveModel> noReceive) {
        Map<String, Object> relyMap = new HashMap<>();
        Map<String, Object> totalMap = new HashMap<>();
        Map<String, Object> noReceiveMap = new HashMap<>();
        org.json.JSONObject result = new org.json.JSONObject();
        String low_level = StringUtils.isEmpty(lowLevel) ? String.valueOf(level + 1) : lowLevel;
        //转换结束数
        for (SaveModel saveModel : endConsult) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                relyMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                relyMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                relyMap.put(saveModel.getHospital(), saveModel);
            }
        }
        ;
        //转换总咨询数
        for (SaveModel saveModel : total) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                totalMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                totalMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                totalMap.put(saveModel.getHospital(), saveModel);
            }
        }
        ;
        //转换已结束
        for (SaveModel saveModel : noReceive) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                noReceiveMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                noReceiveMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                noReceiveMap.put(saveModel.getHospital(), saveModel);
            }
        }
        ;
        List<Map<String, Object>> resultMaps = new ArrayList<>();
        for (String key : totalMap.keySet()) {
            Map<String, Object> rs = new HashMap<>();
            SaveModel relyRs = (SaveModel) relyMap.get(key);
            SaveModel totalRs = (SaveModel) totalMap.get(key);
            SaveModel onRelyRs = (SaveModel) noReceiveMap.get(key);
            if (relyRs == null || totalRs == null || onRelyRs == null) {
                continue;
            }
            //合并结果集
            Integer totalNm = totalRs.getResult2().intValue();
            Integer endNm = relyRs.getResult2().intValue();
            Integer noRelyNm = onRelyRs.getResult2().intValue();
//            rs.put("name", relyRs.get(area+"Name"));
            if (SaveModel.doctorLevel.equals(low_level)) {
                rs.put("name", relyRs.getDoctorName());
            } else if (SaveModel.deptLevel.equals(low_level)) {
                rs.put("name", relyRs.getDeptName());
            } else if (SaveModel.OrgLevel.equals(low_level)) {
                rs.put("name", relyRs.getHospitalName());
            }
            rs.put("noReceiveCount", noRelyNm);
            rs.put("endCount", endNm);
            rs.put("total", totalNm);
            rs.put("code", key);
            if (totalNm != null && totalNm != 0) {
                if (endNm != null && endNm != 0) {
                    double rr = (double) endNm / totalNm * 100;
                    DecimalFormat df = new DecimalFormat("0.00");
                    rs.put("endRate", df.format(rr) + "%");
                    rs.put("endDoubleRate", rr);
                } else {
                    rs.put("endRate", "0.00%");
                    rs.put("endDoubleRate", 0.0);
                }
                if (noRelyNm != null && noRelyNm != 0) {
                    double rr = (double) noRelyNm / totalNm * 100;
                    DecimalFormat df = new DecimalFormat("0.00");
                    rs.put("noRelyRate", df.format(rr) + "%");
                    rs.put("noRelyDoubleRate", rr);
                } else {
                    rs.put("noRelyRate", "0.00%");
                    rs.put("noRelyDoubleRate", 0.0);
                }
            } else {
                rs.put("endRate", "0.00%");
                rs.put("endDoubleRate", 0.0);
                rs.put("noRelyRate", "0.00%");
                rs.put("noRelyDoubleRate", 0.0);
            }
            resultMaps.add(rs);
        }
        //根据为回复数排序
        Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                return (Integer) o1.get("total") < (Integer) o2.get("total") ? 1 : ((Integer) o1.get("total") == (Integer) o2.get("total") ? 0 : -1);
            }
        });
        return resultMaps;
    }
    public List<Map<String, Object>> getCoutList(Integer level, String lowLevel, List<SaveModel> endConsult, List<SaveModel> total, List<SaveModel> noRely) {
        Map<String, Object> relyMap = new HashMap<>();
        Map<String, Object> totalMap = new HashMap<>();
@ -1684,7 +1948,7 @@ public class StatisticsEsService {
    public JSONObject getScoreList(String startTime,String endTime,int level, String area, String lowLevel) throws Exception {
        JSONObject result1 = new JSONObject();
        //咨询总数
        //评价总分
        List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(endTime, endTime, area, level, "9", SaveModel.timeLevel_DDL, lowLevel);
        Map<String, Object> totalMap = new HashMap<>();
        org.json.JSONObject result = new org.json.JSONObject();
@ -1724,7 +1988,7 @@ public class StatisticsEsService {
            rs.put("code", key);
            resultMaps.add(rs);
        }
        //根据为回复数排序
        //根据为评价比例排序
        Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
@ -1811,7 +2075,7 @@ public class StatisticsEsService {
            JSONArray array = weekTotalStatistics(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
        }else if (interval==3){
            JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            JSONArray array = monthTotalStatistics2AndMonth(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
        }
        return object;
@ -1891,6 +2155,8 @@ public class StatisticsEsService {
            Double scoreNm = totalRs.getResult1();//总分数
            if (SaveModel.doctorLevel.equals(low_level)) {
                rs.put("name", totalRs.getDoctorName());
                BaseDoctorDO doctorDO = doctorDao.findById(totalRs.getDoctor());
                rs.put("doctorJob",doctorDO.getJobTitleName());
            } else if (SaveModel.deptLevel.equals(low_level)) {
                rs.put("name", totalRs.getDeptName());
            } else if (SaveModel.OrgLevel.equals(low_level)) {
@ -1915,4 +2181,759 @@ public class StatisticsEsService {
    /**
     * 咨询统计总量
     * @param startDate 开始时间
     * @param endDate 结束时间
     * @param area 区域
     * @param level
     * @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
     * @return
     * @throws Exception
     */
    public JSONObject getConsultHead(String startDate, String endDate, String area, int level, String index) throws Exception {
        JSONObject object = new JSONObject();
        if (index.equalsIgnoreCase("6")){
            //总量
            SaveModel saveModel = null;
            //已回复
            SaveModel saveModel1 = null;
            //已结束
            SaveModel saveModel2 = null;
            //未回复
            SaveModel saveModel3 = null;
            //居民取消
            SaveModel saveModel4 = null;
            //进行中
            SaveModel saveModel5 = null;
            String index1= (Integer.parseInt(index)+1)+"";
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL);
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,"1");
            saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,"0");
            saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,"-1");
            saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,"0");
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,"1");
            object.put("consultTotal",saveModel.getResult1());
            object.put("haveReplyTotal",saveModel1.getResult1());
            object.put("endTotal",saveModel2.getResult1());
            object.put("notReplyTotal",saveModel3.getResult1());
            object.put("cancelTotal",saveModel4.getResult1());
            object.put("comingTotal",saveModel5.getResult1());
            object.put("notReplyRate",getRange(saveModel3.getResult1().intValue(),saveModel.getResult1().intValue(),2));//未回复率
        }else {
            //总量
            SaveModel saveModel = null;
            //已接诊
            SaveModel saveModel1 = null;
            //未接诊
            SaveModel saveModel2 = null;
            //已结束
            SaveModel saveModel3 = null;
            //居民取消
            SaveModel saveModel4 = null;
         /*   //进行中
            SaveModel saveModel5 = null;*/
            String index1= (Integer.parseInt(index)+1)+"";
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, index1, SaveModel.timeLevel_ZL);
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,"1");
            saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,"2");
            saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index, SaveModel.timeLevel_ZL,"-1");
/*
            saveModel5 = elasticsearchUtil.findOneDateQuotaLevel1(startDate, area, level, index1, SaveModel.timeLevel_ZL,"0");
*/
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(startDate,endDate, area, level, index1, SaveModel.timeLevel_ZL,"0");
            object.put("consultTotal",saveModel.getResult1());//咨询总量
            object.put("haveReceiveTotal",saveModel1.getResult1());//已接诊
            object.put("noReceiveTotal",saveModel2.getResult1());//未接诊
            object.put("endTotal",saveModel3.getResult1());//已结束
            object.put("cancelTotal",saveModel4.getResult1());//居民取消
/*            object.put("comingTotal",saveModel5.getResult1());*/
            object.put("notReceiveRate",getRange(saveModel2.getResult1().intValue(),saveModel.getResult1().intValue(),2));//未接诊比例
        }
        return object;
    }
    /**
     * 咨询统计曲线
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
     * @param interval
     * @param level2_type
     * @return
     * @throws Exception
     */
    public JSONObject getConsultLine(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        String index1= (Integer.parseInt(index)+1)+"";
        //问诊量
        JSONObject object = new JSONObject();
        if (interval==1){
            JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
        }else if (interval==2){
            JSONArray array = weekTotalStatistics(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
        }else if (interval==3){
            JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
        }
        return object;
    }
    /**
     * 咨询统计表格
     * @param startTime
     * @param endTime
     * @param level
     * @param area
     * @param lowLevel
     * @param  index 专家咨询6,图文复诊11,专家协同13,视频复诊15
     * @return
     * @throws Exception
     */
    public JSONObject getConsultingList(String startTime,String endTime,int level, String area, String lowLevel,String index) throws Exception {
        JSONObject result = new JSONObject();
        if(index.equalsIgnoreCase("6")){
            String index1= (Integer.parseInt(index)+1)+"";
            //已结束
            List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,"1");
            //咨询总数
            List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel);
            //未回复数
            List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"0");
            result.put("resultList", getCoutList(level, lowLevel, endTotal, total, noRelyTotal));
        }else {
            String index1= (Integer.parseInt(index)+1)+"";
            //未接诊
            List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,"0");
            //咨询总数
            List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel);
            //已结束
            List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"2");
            result.put("resultList", getCoutList1(level, lowLevel, endTotal, total, noReceiveTotal));
        }
        return result;
    }
    /**
     * app端首页门诊量统计
     * @param startDate
     * @param endDate
     * @param area
     * @param level 专家咨询6,图文复诊11,专家协同13,视频复诊15
     * @param index
     * @return
     * @throws Exception
     */
    public JSONObject getConsultTotalApp(String startDate, String endDate, String area, int level, String index) throws Exception {
        JSONObject object = new JSONObject();
        String str[] = new String[]{};
        if (StringUtils.isNoneBlank(index)){
            str =index.split(",");
        }
        for (int i=0;i<str.length;i++){
            String index1 = (Integer.parseInt(str[i])+1)+"";
            SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level,index1 , SaveModel.timeLevel_ZL);
            object.put("index_"+str[i],saveModel.getResult1());
        }
        return object;
    }
    /**
     * app端门诊量统计维度-圆形比例
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @return
     * @throws Exception
     */
    public JSONObject getConsultCircularApp(String startDate, String endDate, String area, int level) throws Exception {
        JSONObject object = new JSONObject();
        //协同门诊
        SaveModel saveModel1 = null;
        saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "14", SaveModel.timeLevel_ZL);
        //图文复诊
        SaveModel saveModel2 = null;
        saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL);
        //视频复诊
        SaveModel saveModel3 = null;
        saveModel3 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL);
        Double specialistCount =0.0;
        //专科咨询
        SaveModel saveModel4 = null;
        saveModel4 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "7", SaveModel.timeLevel_ZL);
        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);
        return object;
    }
    /**
     * app端门诊量统计-按照日周月
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @param interval
     * @param level2_type
     * @return
     * @throws Exception
     */
    public JSONObject getConsultLineApp(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        //问诊量
        JSONObject object = new JSONObject();
        if (interval==1){
            JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
        }else if (interval==2){
            JSONArray array = weekTotalStatistics(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
        }else if (interval==3){
            JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
        }
        return object;
    }
    /**
     * 门诊量统计-app端
     * @param startTime
     * @param endTime
     * @param level
     * @param area
     * @param lowLevel
     * @param index
     * @return
     * @throws Exception
     */
    public JSONObject getConsultListApp(String startTime,String endTime,int level, String area, String lowLevel,String index) throws Exception {
        JSONObject result1 = new JSONObject();
        //门诊量总数
        List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel);
        Map<String, Object> totalMap = new HashMap<>();
        org.json.JSONObject result = new org.json.JSONObject();
        String low_level = StringUtils.isEmpty(lowLevel) ? String.valueOf(level + 1) : lowLevel;
        //转换总咨询数
        for (SaveModel saveModel : total) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                totalMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                totalMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                totalMap.put(saveModel.getHospital(), saveModel);
            }
        }
        ;
        List<Map<String, Object>> resultMaps = new ArrayList<>();
        for (String key : totalMap.keySet()) {
            Map<String, Object> rs = new HashMap<>();
            SaveModel totalRs = (SaveModel) totalMap.get(key);
            if (totalRs == null) {
                continue;
            }
            //合并结果集
            Double totalNm = totalRs.getResult2();//总人数
            Double consultNm = totalRs.getResult1();//总分数
            if (SaveModel.doctorLevel.equals(low_level)) {
                rs.put("name", totalRs.getDoctorName());
            } else if (SaveModel.deptLevel.equals(low_level)) {
                rs.put("name", totalRs.getDeptName());
            } else if (SaveModel.OrgLevel.equals(low_level)) {
                rs.put("name", totalRs.getHospitalName());
            }
            rs.put("total", totalNm);
            rs.put("consultRate",getDoubleRange(consultNm,totalNm,0));
            rs.put("code", key);
            resultMaps.add(rs);
        }
        //根据为评价比例排序
        Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                return (Double) o1.get("total") < (Double) o2.get("total") ? 1 : ((Double) o1.get("total") == (Double) o2.get("total") ? 0 : -1);
            }
        });
        result1.put("resultList", resultMaps);
        return result1;
    }
    /**
     * 咨询统计曲线-PC
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
     * @param interval
     * @param level2_type
     * @return
     * @throws Exception
     */
    public JSONObject getConsultLinePC(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        String index1= (Integer.parseInt(index)+1)+"";
        //问诊量
        JSONObject object = new JSONObject();
        if (interval==1){
            if (index.equalsIgnoreCase("6")){
                JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL,null);
                object.put("totalData",array);//新增量
                JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,index,"0",SaveModel.timeLevel_ZL,null);//未回复
                object.put("noReplyData",array1);//未回复
                JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL,null);//已回复
                object.put("replyData",array2);//已回复
                JSONArray array3 = dateTotalStatistics2(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL,null);//进行中
                object.put("commingData",array3);//进行中
                JSONArray array4 = dateTotalStatistics2(startDate,endDate,area,level,index1,"1",SaveModel.timeLevel_ZL,null);//已完成
                object.put("endData",array4);//已完成
            }else {
                JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL,null);
                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);//已接诊
                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);//已结束
                object.put("endData",array4);//已结束
            }
        }else if (interval==2){
            if (index.equalsIgnoreCase("6")){
                JSONArray array = weekTotalStatistics(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL);
                object.put("totalData",array);//新增量
                JSONArray array1 = weekTotalStatistics(startDate,endDate,area,level,index,"0",SaveModel.timeLevel_ZL);//未回复
                object.put("noReplyData",array1);;//未回复
                JSONArray array2 = weekTotalStatistics(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL);//已回复
                object.put("replyData",array2);//已回复
                JSONArray array3 = weekTotalStatistics(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL);//进行中
                object.put("commingData",array3);//进行中
                JSONArray array4 = weekTotalStatistics(startDate,endDate,area,level,index1,"1",SaveModel.timeLevel_ZL);//已完成
                object.put("endData",array3);//进行中
            }else {
                JSONArray array = weekTotalStatistics(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL);
                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);//已接诊
                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);//已结束
                object.put("endData",array3);//已结束
            }
        }else if (interval==3){
            if (index.equalsIgnoreCase("6")){
                JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL);
                object.put("totalData",array);
                JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,index,"0",SaveModel.timeLevel_ZL);
                object.put("noReplyData",array1);
                JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,index,"1",SaveModel.timeLevel_ZL);
                object.put("replyData",array2);
                JSONArray array3 = monthTotalStatistics2(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL);
                object.put("commingData",array3);
                JSONArray array4 = monthTotalStatistics2(startDate,endDate,area,level,index1,"1",SaveModel.timeLevel_ZL);
                object.put("endData",array4);
            }else {
                JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index1,null,SaveModel.timeLevel_ZL);
                object.put("totalData",array);
                JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL);
                object.put("noReceiveData",array1);
                JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,index1,"1",SaveModel.timeLevel_ZL);
                object.put("haveReceiveData",array2);
                JSONArray array3 = monthTotalStatistics2(startDate,endDate,area,level,index,"-1",SaveModel.timeLevel_ZL);
                object.put("concleData",array3);
                JSONArray array4 = monthTotalStatistics2(startDate,endDate,area,level,index,"2",SaveModel.timeLevel_ZL);
                object.put("endData",array4);
            }
        }
        return object;
    }
    /**
     * 咨询统计表格-PC
     * @param startTime
     * @param endTime
     * @param level
     * @param area
     * @param lowLevel
     * @param  index 专家咨询6,图文复诊11,专家协同13,视频复诊15
     * @return
     * @throws Exception
     */
    public JSONObject getConsultingListPC(String startTime,String endTime,int level, String area, String lowLevel,String index) throws Exception {
        JSONObject result = new JSONObject();
        String index1= (Integer.parseInt(index)+1)+"";
//        timeKey= "2017-11-01 00:00:00";
        if(index.equalsIgnoreCase("6")){
            //已结束
            List<SaveModel> endTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,"1");
            //进行中
            List<SaveModel> comingTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,"0");
            //咨询总数
            List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel);
            //未回复数
            List<SaveModel> noRelyTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"0");
            //已回复数
            List<SaveModel> relyTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"1");
            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> 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> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"0");
            result.put("resultList", getCoutListPC1(level, lowLevel, endTotal, total, haveReceiveTotal,noReceiveTotal,concleTotal));
        }
        return result;
    }
    /**
     * 在线复诊、协同复诊转换
     * @param level
     * @param lowLevel
     * @param endConsult
     * @param total
     * @return
     */
    public List<Map<String, Object>> getCoutListPC1(Integer level, String lowLevel, List<SaveModel> endConsult, List<SaveModel> total, List<SaveModel> haveReceive,List<SaveModel> noReceive,List<SaveModel> concle) {
        Map<String, Object> endMap = new HashMap<>();
        Map<String, Object> totalMap = new HashMap<>();
        Map<String, Object> noReceiveMap = new HashMap<>();
        Map<String, Object> concleMap = new HashMap<>();
        Map<String, Object> haveReceiveMap = new HashMap<>();
        org.json.JSONObject result = new org.json.JSONObject();
        String low_level = StringUtils.isEmpty(lowLevel) ? String.valueOf(level + 1) : lowLevel;
        //转换结束数
        for (SaveModel saveModel : endConsult) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                endMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                endMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                endMap.put(saveModel.getHospital(), saveModel);
            }
        }
        //转换已接诊
        for (SaveModel saveModel : haveReceive) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                haveReceiveMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                haveReceiveMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                haveReceiveMap.put(saveModel.getHospital(), saveModel);
            }
        }
        //转换总咨询数
        for (SaveModel saveModel : total) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                totalMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                totalMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                totalMap.put(saveModel.getHospital(), saveModel);
            }
        }
        //转换未接诊
        for (SaveModel saveModel : noReceive) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                noReceiveMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                noReceiveMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                noReceiveMap.put(saveModel.getHospital(), saveModel);
            }
        }
        //转换已取消
        for (SaveModel saveModel : concle) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                concleMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                concleMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                concleMap.put(saveModel.getHospital(), saveModel);
            }
        }
        List<Map<String, Object>> resultMaps = new ArrayList<>();
        for (String key : totalMap.keySet()) {
            Map<String, Object> rs = new HashMap<>();
            SaveModel endRs = (SaveModel) endMap.get(key);
            SaveModel totalRs = (SaveModel) totalMap.get(key);
            SaveModel concleRs = (SaveModel) concleMap.get(key);
            SaveModel noReceiveRs = (SaveModel) noReceiveMap.get(key);
            SaveModel haveReceiveRs = (SaveModel) haveReceiveMap.get(key);
            if (endRs == null || totalRs == null || concleRs == null || noReceiveRs==null || haveReceiveRs == null) {
                continue;
            }
            //合并结果集
            Integer totalNm = totalRs.getResult2().intValue();
            Integer endNm = endRs.getResult2().intValue();
            Integer concleNm = concleRs.getResult2().intValue();
            Integer noReceiveNm = noReceiveRs.getResult2().intValue();
            Integer haveReceiveNm = haveReceiveRs.getResult2().intValue();
//            rs.put("name", relyRs.get(area+"Name"));
            if (SaveModel.doctorLevel.equals(low_level)) {
                rs.put("name", endRs.getDoctorName());
            } else if (SaveModel.deptLevel.equals(low_level)) {
                rs.put("name", endRs.getDeptName());
            } else if (SaveModel.OrgLevel.equals(low_level)) {
                rs.put("name", endRs.getHospitalName());
            }
            rs.put("concleCount", concleNm);
            rs.put("endCount", endNm);
            rs.put("total", totalNm);
            rs.put("noReceiveCount", noReceiveNm);
            rs.put("haveReceiveCount", haveReceiveNm);
            rs.put("code", key);
            resultMaps.add(rs);
        }
        //根据为咨询总数排序
        Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                return (Integer) o1.get("total") < (Integer) o2.get("total") ? 1 : ((Integer) o1.get("total") == (Integer) o2.get("total") ? 0 : -1);
            }
        });
        return resultMaps;
    }
    public List<Map<String, Object>> getCoutListPC(Integer level, String lowLevel, List<SaveModel> endConsult, List<SaveModel> total, List<SaveModel> noRely,List<SaveModel> reply,List<SaveModel> coming) {
        Map<String, Object> endMap = new HashMap<>();
        Map<String, Object> totalMap = new HashMap<>();
        Map<String, Object> noRelyMap = new HashMap<>();
        Map<String, Object> relyMap = new HashMap<>();
        Map<String, Object> comingMap = new HashMap<>();
        org.json.JSONObject result = new org.json.JSONObject();
        String low_level = StringUtils.isEmpty(lowLevel) ? String.valueOf(level + 1) : lowLevel;
        //转换结束数
        for (SaveModel saveModel : endConsult) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                endMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                endMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                endMap.put(saveModel.getHospital(), saveModel);
            }
        }
        //转换进行数
        for (SaveModel saveModel : coming) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                comingMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                comingMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                comingMap.put(saveModel.getHospital(), saveModel);
            }
        }
        //转换总咨询数
        for (SaveModel saveModel : total) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                totalMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                totalMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                totalMap.put(saveModel.getHospital(), saveModel);
            }
        }
        //转换未回复
        for (SaveModel saveModel : noRely) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                noRelyMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                noRelyMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                noRelyMap.put(saveModel.getHospital(), saveModel);
            }
        }
        //转换已回复
        for (SaveModel saveModel : reply) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                relyMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                relyMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                relyMap.put(saveModel.getHospital(), saveModel);
            }
        }
        List<Map<String, Object>> resultMaps = new ArrayList<>();
        for (String key : totalMap.keySet()) {
            Map<String, Object> rs = new HashMap<>();
            SaveModel endRs = (SaveModel) endMap.get(key);
            SaveModel totalRs = (SaveModel) totalMap.get(key);
            SaveModel onRelyRs = (SaveModel) noRelyMap.get(key);
            SaveModel relyRs = (SaveModel) relyMap.get(key);
            SaveModel comingRs = (SaveModel) relyMap.get(key);
            if (endRs == null || totalRs == null || onRelyRs == null || relyRs==null || comingRs == null) {
                continue;
            }
            //合并结果集
            Integer totalNm = totalRs.getResult2().intValue();
            Integer endNm = endRs.getResult2().intValue();
            Integer noRelyNm = onRelyRs.getResult2().intValue();
            Integer relyNm = relyRs.getResult2().intValue();
            Integer comingNm = comingRs.getResult2().intValue();
//            rs.put("name", relyRs.get(area+"Name"));
            if (SaveModel.doctorLevel.equals(low_level)) {
                rs.put("name", endRs.getDoctorName());
            } else if (SaveModel.deptLevel.equals(low_level)) {
                rs.put("name", endRs.getDeptName());
            } else if (SaveModel.OrgLevel.equals(low_level)) {
                rs.put("name", endRs.getHospitalName());
            }
            rs.put("noRelyCount", noRelyNm);
            rs.put("endCount", endNm);
            rs.put("total", totalNm);
            rs.put("relyCount", relyNm);
            rs.put("comingCount", comingNm);
            rs.put("code", key);
            if (totalNm != null && totalNm != 0) {
                if (endNm != null && endNm != 0) {
                    double rr = (double) endNm / totalNm * 100;
                    DecimalFormat df = new DecimalFormat("0.00");
                    rs.put("endRate", df.format(rr) + "%");
                    rs.put("endDoubleRate", rr);
                } else {
                    rs.put("endRate", "0.00%");
                    rs.put("endDoubleRate", 0.0);
                }
                if (noRelyNm != null && noRelyNm != 0) {
                    double rr = (double) noRelyNm / totalNm * 100;
                    DecimalFormat df = new DecimalFormat("0.00");
                    rs.put("noRelyRate", df.format(rr) + "%");
                    rs.put("noRelyDoubleRate", rr);
                } else {
                    rs.put("noRelyRate", "0.00%");
                    rs.put("noRelyDoubleRate", 0.0);
                }
            } else {
                rs.put("endRate", "0.00%");
                rs.put("endDoubleRate", 0.0);
                rs.put("noRelyRate", "0.00%");
                rs.put("noRelyDoubleRate", 0.0);
            }
            resultMaps.add(rs);
        }
        //根据为咨询总数排序
        Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                return (Integer) o1.get("total") < (Integer) o2.get("total") ? 1 : ((Integer) o1.get("total") == (Integer) o2.get("total") ? 0 : -1);
            }
        });
        return resultMaps;
    }
    /**
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index 6专家,13协同,17、在线复诊
     * @param timeLevel
     * @return
     * @throws Exception
     */
    public JSONObject getIndexTotalApp(String startDate, String endDate, String area, int level, String index,String timeLevel) throws Exception {
        JSONObject object = new JSONObject();
        String str[] = new String[]{};
        if (StringUtils.isNoneBlank(index)){
            str =index.split(",");
        }
        for (int i=0;i<str.length;i++){
            String index1 = (Integer.parseInt(str[i])+1)+"";
            if (index1.equalsIgnoreCase("12")){
                SaveModel saveModel1 = null;//图文
                SaveModel saveModel2 = null;//视频
                if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_ZL)){
                    saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level,"12" , SaveModel.timeLevel_ZL);
                    saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level,"16" , SaveModel.timeLevel_ZL);
                }else if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_DDL)){
                    saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level,"12" , SaveModel.timeLevel_DDL);
                    saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level,"16" , SaveModel.timeLevel_DDL);
                }
                Double topicTotal = saveModel1.getResult1();
                Double vedioTotal = saveModel2.getResult1();
                object.put("index_11_15",vedioTotal+topicTotal);//在线复诊
            }else {
                SaveModel saveModel = null;
                if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_ZL)){
                    saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level,index1 , SaveModel.timeLevel_ZL);
                }else if (timeLevel.equalsIgnoreCase(SaveModel.timeLevel_DDL)){
                    saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level,index1 , SaveModel.timeLevel_DDL);
                }
                object.put("index_"+str[i],saveModel.getResult1());
            }
        }
        return object;
    }
}

+ 105 - 4
business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java

@ -377,6 +377,107 @@ public class ElasticsearchUtil {
    }
    /**
     * 按照医生人数统计-不重复
     * 获取所有指标的增量、到达量
     * 备注:原来接口的一级指标对应现在的
     *
     * @param startDate 开始时间
     * @param endDate   结束时间
     * @param area      区域code
     * @param level     等级
     * @param index     指标
     * @param timeLevel 1增量 2到达量
     * @param interval  1日 2周 3月
     * @param lowLevel  下一级区域等级
     * @return
     * @throws Exception
     */
    public List findDateQuotaLevel0AndPaibanLine(String startDate, String endDate, String area, int level, String index, String timeLevel, String interval, String lowLevel) throws Exception {
        //时间格式转换  yyyy-MM-dd转成 2017-07-17T00:00:00+0800
        if (StringUtils.isNotEmpty(startDate)) {
            if (startDate.length() > 10) {
                startDate = changeTime(startDate);
            } else {
                startDate = changeDate(startDate);
            }
        }
        if (StringUtils.isNotEmpty(endDate)) {
            if (endDate.length() > 10) {
                endDate = changeTime(endDate);
            } else {
                endDate = changeDate(endDate);
            }
        }
        StringBuffer sql = new StringBuffer();
        StringBuffer groupBy = new StringBuffer();
        String low_level = level + "";
        if (StringUtils.isNotEmpty(lowLevel)) {
            low_level = lowLevel;
        }
        if (SaveModel.doctorLevel.equals(low_level)) {
            sql.append("select doctor,doctorName,count(doctor) result1, count(doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by doctor,doctorName");
        }else if (SaveModel.deptLevel.equals(low_level)) {
            sql.append("select dept,deptName,count(DISTINCT doctor) result1, count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by ");
        } else if (SaveModel.OrgLevel.equals(low_level)) {
            sql.append("select hospital,hospitalName,count(DISTINCT doctor) result1,count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by ");
        } else if (SaveModel.townLevel.equals(low_level)) {
            sql.append("select town,townName,count(DISTINCT doctor) result1,count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by ");
        } else if (SaveModel.cityLevel.equals(low_level)) {
            sql.append("select city,cityName,count(DISTINCT doctor) result1,count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by ");
        }
        if (StringUtils.isNotEmpty(area)) {
            if (SaveModel.doctorLevel.equals(level + "")) {
                sql.append(" doctor='" + area + "'");
            }else if (SaveModel.deptLevel.equals(level + "")) {
                sql.append(" dept='" + area + "'");
            } else if (SaveModel.OrgLevel.equals(level + "")) {
                sql.append(" hospital='" + area + "'");
            } else if (SaveModel.townLevel.equals(level + "")) {
                sql.append(" town='" + area + "'");
            } else if (SaveModel.cityLevel.equals(level + "")) {
                sql.append(" city='" + area + "'");
            }
            sql.append(" and ");
        }
//        sql.append(" quotaCode='" + index + "'  ");
        sql.append(" quotaCode in(" + index + ")  ");
        sql.append(" and timeLevel='" + timeLevel + "'  ");
        sql.append(" and areaLevel='6'");
        sql.append(" and result1<>0 ");
        if (StringUtils.isNotEmpty(startDate)) {
            sql.append(" and quotaDate>='" + startDate + "'");
        }
        if (StringUtils.isNotEmpty(endDate)) {
            sql.append(" and quotaDate<='" + endDate + "'");
        }
        //根据时间维度分组
        if (StringUtils.isNotEmpty(interval)) {
            if (SaveModel.interval_month.equals(interval)) {
                groupBy.append(" date_histogram(field='quotaDate','interval'='month','time_zone'='+08:00','alias'='quotaDate') ");
            } else if (SaveModel.interval_week.equals(interval)) {
                groupBy.append(" date_histogram(field='quotaDate','interval'='week','time_zone'='+08:00','alias'='quotaDate') ");
            } else if (SaveModel.interval_day.equals(interval)) {
                groupBy.append(" date_histogram(field='quotaDate','interval'='1d','time_zone'='+08:00','alias'='quotaDate') ");
            }
        }
        sql.append(groupBy);
        return excute(sql.toString(), SaveModel.class, "", "");
    }
    /**
     * 按照医生人数统计-不重复
@ -422,16 +523,16 @@ public class ElasticsearchUtil {
            groupBy.append("  group by doctor,doctorName");
        }else if (SaveModel.deptLevel.equals(low_level)) {
            sql.append("select dept,deptName,count(DISTINCT doctor) result1, count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by dept,deptName");
            groupBy.append("  group by dept");
        } else if (SaveModel.OrgLevel.equals(low_level)) {
            sql.append("select hospital,hospitalName,count(DISTINCT doctor) result1,count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by hospital,hospitalName");
            groupBy.append("  group by hospital");
        } else if (SaveModel.townLevel.equals(low_level)) {
            sql.append("select town,townName,count(DISTINCT doctor) result1,count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by town,townName");
            groupBy.append("  group by town");
        } else if (SaveModel.cityLevel.equals(low_level)) {
            sql.append("select city,cityName,count(DISTINCT doctor) result1,count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by city,cityName");
            groupBy.append("  group by city");
        }
        if (StringUtils.isNotEmpty(area)) {

+ 7 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -7,7 +7,7 @@ import javax.persistence.*;
import java.io.Serializable;
/**
 * Integer类型的主键基类
 * Integer类型的主键基类,需要根据不同环境打包
 * Created by progr1mmer on 2018/8/13.
 */
@MappedSuperclass
@ -17,9 +17,15 @@ public abstract class IntegerIdentityEntity implements Serializable {
    protected Integer id;
    @Id
//==========mysql 环境 id策略======================================================
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
//    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;
    }

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseCityDO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "base_city")
@SequenceGenerator(name="id_generated", sequenceName="BASE_CITY_SEQ")
public class BaseCityDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseCommitteeDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -15,6 +16,7 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "base_committee")
@SequenceGenerator(name="id_generated", sequenceName="BASE_COMMITTEE_SEQ")
public class BaseCommitteeDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseProvinceDO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "base_province")
@SequenceGenerator(name="id_generated", sequenceName="BASE_PROVINCE_SEQ")
public class BaseProvinceDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseStreetDO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "base_street")
@SequenceGenerator(name="id_generated", sequenceName="BASE_STREET_SEQ")
public class BaseStreetDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseTownDO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "base_town")
@SequenceGenerator(name="id_generated", sequenceName="BASE_TOWN_SEQ")
public class BaseTownDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/customize/UserHideModuleInterfaceDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -13,6 +14,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "base_user_hide_module_interface")
@SequenceGenerator(name="id_generated", sequenceName="BASE_USER_HIDE_MODULE_INTERFACE_SEQ")
public class UserHideModuleInterfaceDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictDiseaseDO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "dict_disease")
@SequenceGenerator(name="id_generated", sequenceName="DICT_DISEASE_SEQ")
public class DictDiseaseDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictDoctorDutyDO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "dict_doctor_duty")
@SequenceGenerator(name="id_generated", sequenceName="DICT_DOCTOR_DUTY_SEQ")
public class DictDoctorDutyDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictHealthProblemDO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "dict_health_problem")
@SequenceGenerator(name="id_generated", sequenceName="DICT_HEALTH_PROBLEM_SEQ")
public class DictHealthProblemDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictHospitalDeptDO.java

@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -18,6 +19,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "dict_hospital_dept")
@SequenceGenerator(name="id_generated", sequenceName="DICT_HOSPITAL_DEPT_SEQ")
public class DictHospitalDeptDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictIcd10DO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "dict_icd10")
@SequenceGenerator(name="id_generated", sequenceName="DICT_ICD10_SEQ")
public class DictIcd10DO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictJobTitleDO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "dict_job_title")
@SequenceGenerator(name="id_generated", sequenceName="DICT_JOB_TITLE_SEQ")
public class DictJobTitleDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictMedicineDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "dict_medicine")
@SequenceGenerator(name="id_generated", sequenceName="DICT_MEDICINE_SEQ")
public class DictMedicineDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictMedicineDistributeOrgDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "dict_medicine_distribute_org")
@SequenceGenerator(name="id_generated", sequenceName="DICT_MEDICINE_DISTRIBUTE_ORG_SEQ")
public class DictMedicineDistributeOrgDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictMedicineDosageFormDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "dict_medicine_dosage_form")
@SequenceGenerator(name="id_generated", sequenceName="DICT_MEDICINE_DOSAGE_FORM_SEQ")
public class DictMedicineDosageFormDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictMedicineSubjectDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "dict_medicine_subject")
@SequenceGenerator(name="id_generated", sequenceName="DICT_MEDICINE_SUBJECT_SEQ")
public class DictMedicineSubjectDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorHospitalDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.doctor;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "base_doctor_hospital")
@SequenceGenerator(name="id_generated", sequenceName="BASE_DOCTOR_HOSPITAL_SEQ")
public class BaseDoctorHospitalDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorRoleDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.doctor;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "base_doctor_role")
@SequenceGenerator(name="id_generated", sequenceName="BASE_DOCTOR_ROLE_SEQ")
public class BaseDoctorRoleDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorRoleInfoDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.doctor;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -15,6 +16,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "base_doctor_role_info")
@SequenceGenerator(name="id_generated", sequenceName="BASE_DOCTOR_ROLE_INFO_SEQ")
public class BaseDoctorRoleInfoDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseModuleRoleDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.doctor;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "base_module_role")
@SequenceGenerator(name="id_generated", sequenceName="BASE_MODULE_ROLE_SEQ")
public class BaseModuleRoleDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/DoctorSpecialDiseaseDo.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -13,6 +14,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "wlyy_doctor_special_disease")
@SequenceGenerator(name="id_generated", sequenceName="WLYY_DOCTOR_SPECIAL_DISEASE_SEQ")
public class DoctorSpecialDiseaseDo extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageDO.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "base_message")
@SequenceGenerator(name="id_generated", sequenceName="BASE_MESSAGE_SEQ")
public class BaseMessageDO extends IntegerIdentityEntity {

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageTypeDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.message;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "base_message_type")
@SequenceGenerator(name="id_generated", sequenceName="BASE_MESSAGE_TYPE_SEQ")
public class BaseMessageTypeDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgSaasDO.java

@ -8,6 +8,7 @@ import org.springframework.util.StringUtils;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -20,6 +21,7 @@ import javax.persistence.Table;
@Entity
@Table(name = "base_org_saas")
@Component
@SequenceGenerator(name="id_generated", sequenceName="BASE_ORG_SAAS_SEQ")
public class BaseOrgSaasDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgUserDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -15,6 +16,7 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "base_org_user")
@SequenceGenerator(name="id_generated", sequenceName="BASE_ORG_USER_SEQ")
public class BaseOrgUserDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/AccountAppealDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.patient;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "account_appeal")
@SequenceGenerator(name="id_generated", sequenceName="ACCOUNT_APPEAL_SEQ")
public class AccountAppealDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/FeedbackDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.patient;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "feedback")
@SequenceGenerator(name="id_generated", sequenceName="FEEDBACK_SEQ")
public class FeedbackDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/HelpCenterDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.patient;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "help_center")
@SequenceGenerator(name="id_generated", sequenceName="HELP_CENTER_SEQ")
public class HelpCenterDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/PatientMedicareCardDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.patient;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "patient_medicare_card")
@SequenceGenerator(name="id_generated", sequenceName="PATIENT_MEDICARE_CARD_SEQ")
public class PatientMedicareCardDO extends IntegerIdentityEntity {
   public enum ParentType {

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/role/BaseRoleMenuDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.role;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -15,6 +16,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "base_role_menu")
@SequenceGenerator(name="id_generated", sequenceName="BASE_ROLE_MENU_SEQ")
public class BaseRoleMenuDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/role/RoleAuthorityDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -13,6 +14,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "base_role_authority")
@SequenceGenerator(name="id_generated", sequenceName="BASE_ROLE_AUTHORITY_SEQ")
public class RoleAuthorityDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/role/RoleMenuDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -12,6 +13,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "base_role_menu")
@SequenceGenerator(name="id_generated", sequenceName="BASE_ROLE_MENU_SEQ")
public class RoleMenuDO extends IntegerIdentityEntity {
	/**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasBusinessCardDO.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -18,6 +19,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "base_saas_business_card")
@SequenceGenerator(name="id_generated", sequenceName="BASE_SAAS_BUSINESS_CARD_SEQ")
public class SaasBusinessCardDO extends IntegerIdentityEntity {
    public enum Type {

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/team/BaseTeamMemberDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
*/
@Entity
@Table(name = "base_team_member")
@SequenceGenerator(name="id_generated", sequenceName="BASE_TEAM_MEMBER_SEQ")
public class BaseTeamMemberDO extends IntegerIdentityEntityWithOperator {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/theme/ThemeDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -12,6 +13,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "base_theme")
@SequenceGenerator(name="id_generated", sequenceName="BASE_THEME_SEQ")
public class ThemeDO extends IntegerIdentityEntity {
    //主题风格

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/version/AppVersionDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.version;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -14,6 +15,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "app_version")
@SequenceGenerator(name="id_generated", sequenceName="APP_VERSION_SEQ")
public class AppVersionDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/JsApiTicket.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -12,6 +13,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "wx_jsapi_ticket")
@SequenceGenerator(name="id_generated", sequenceName="WX_JSAPI_TICKET_SEQ")
public class JsApiTicket extends IntegerIdentityEntity {
    private static final long serialVersionUID = -3297644428262254694L;

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxPayLogDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.wx;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -11,6 +12,7 @@ import java.util.Date;
 */
@Entity(name = "WxPayLogDO")
@Table(name = "wlyy_wx_pay_log")
@SequenceGenerator(name="id_generated", sequenceName="WLYY_WX_PAY_LOG_SEQ")
public class WxPayLogDO extends IntegerIdentityEntity {
    private String seqNo;//支付订单号',

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxUrlConfigDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.base.wx;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -10,6 +11,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "wx_url_config")
@SequenceGenerator(name="id_generated", sequenceName="WX_URL_CONFIG_SEQ")
public class WxUrlConfigDO extends IntegerIdentityEntity {
    private String url;

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/dimension/DimensionDo.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.dimension;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -11,6 +12,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "dimension")
@SequenceGenerator(name="id_generated", sequenceName="DIMENSION_SEQ")
public class DimensionDo extends IntegerIdentityEntity {
    private String code;

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/dimension/DimensionQuotaDo.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.dimension;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -11,6 +12,7 @@ import javax.persistence.Table;
@Entity
@Table(name = "dimension_quota")
@SequenceGenerator(name="id_generated", sequenceName="DIMENSION_QUOTA_SEQ")
public class DimensionQuotaDo extends IntegerIdentityEntity {
    private String quotaCode;
    private String dimensionCode;

+ 0 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dict/WlyyChargeDictDO.java

@ -1,6 +1,5 @@
package com.yihu.jw.entity.hospital.dict;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/doctor/BaseDoctorZsInfoDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.hospital.doctor;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -11,6 +12,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "base_doctor_zs_info")
@SequenceGenerator(name="id_generated", sequenceName="BASE_DOCTOR_ZS_INFO_SEQ")
public class BaseDoctorZsInfoDO extends IntegerIdentityEntity {
    private String staffCode;

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/mapping/HospitalDeptMappingDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.hospital.mapping;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -11,6 +12,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "wlyy_hospital_dept_mapping")
@SequenceGenerator(name="id_generated", sequenceName="WLYY_HOSPITAL_DEPT_MAPPING_SEQ")
public class HospitalDeptMappingDO extends IntegerIdentityEntity {
    /**
     * 第三方序号

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyInspectionPartsDictDO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -12,6 +13,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "wlyy_inspection_parts_dict")
@SequenceGenerator(name="id_generated", sequenceName="WLYY_INSPECTION_PARTS_DICT_SEQ")
public class WlyyInspectionPartsDictDO extends IntegerIdentityEntity {
    private String code;//部位业务code',

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyDeptDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import org.springframework.beans.factory.annotation.Autowired;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -11,6 +12,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "wlyy_survey_dept")
@SequenceGenerator(name="id_generated", sequenceName="WLYY_SURVEY_DEPT_SEQ")
public class WlyySurveyDeptDO extends IntegerIdentityEntity {
    /**

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyInspLabelInfoDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -11,6 +12,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "wlyy_survey_insp_label_info")
@SequenceGenerator(name="id_generated", sequenceName="WLYY_SURVEY_INSP_LABEL_INFO_SEQ")
public class WlyySurveyInspLabelInfoDO extends IntegerIdentityEntity {
    private String surveyTempCode;//问卷模板编码',

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyLabelInfoDO.java

@ -4,6 +4,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
@ -11,6 +12,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "wlyy_survey_label_info")
@SequenceGenerator(name="id_generated", sequenceName="WLYY_SURVEY_LABEL_INFO_SEQ")
public class WlyySurveyLabelInfoDO extends IntegerIdentityEntity {
    private String surveyTempCode;//问卷模板编码',

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/myFamily/PatientApplyLog.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -13,6 +14,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "patient_apply_for_log")
@SequenceGenerator(name="id_generated", sequenceName="PATIENT_APPLY_FOR_LOG_SEQ")
public class PatientApplyLog extends IntegerIdentityEntity {
    private String familyMemberName;//家庭成员名称

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/RehabilitationServiceItemDO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -12,6 +13,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "wlyy_rehabilitation_service_item")
@SequenceGenerator(name="id_generated", sequenceName="WLYY_REHABILITATION_SERVICE_ITEM_SEQ")
public class RehabilitationServiceItemDO extends IntegerIdentityEntity {
    private String code;

+ 10 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -659,6 +659,16 @@ public class BaseHospitalRequestMapping {
        public static final String scheduleHead = "/scheduleHead";
        public static final String scheduleLine = "/scheduleLine";
        public static final String scheduleList = "/scheduleList";
        public static final String consultHead = "/consultHead";
        public static final String consultLine = "/consultLine";
        public static final String consultList= "/consultList";
        public static final String consultTotalApp = "/consultTotalApp";
        public static final String consultCircularApp = "/consultCircularApp";
        public static final String consultLineApp = "/consultLineApp";
        public static final String consultListApp = "/consultListApp";
        public static final String consultLinePC = "/consultLinePC";
        public static final String consultListPC = "/consultListPC";
        public static final String indexTotalApp = "/indexTotalApp";
    }

+ 2 - 3
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/area/BaseCommitteeVO.java

@ -1,7 +1,6 @@
package com.yihu.jw.restmodel.base.area;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.restmodel.UuidIdentityVOWithOperator;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -19,7 +18,7 @@ import io.swagger.annotations.ApiModelProperty;
 * @since 1.
 */
@ApiModel(value = "BaseCommitteeVO", description = "居委会")
public class BaseCommitteeVO extends IntegerIdentityEntity {
public class BaseCommitteeVO extends IntegerIdentityVO {
    /**
	 * 省标识

+ 2 - 4
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/team/BaseTeamMemberVO.java

@ -1,10 +1,8 @@
package com.yihu.jw.restmodel.base.team;
import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import com.yihu.jw.restmodel.UuidIdentityVOWithOperator;
import com.yihu.jw.restmodel.IntegerIdentityVOWithOperator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
@ -20,7 +18,7 @@ import java.util.Date;
 * @since 1.
 */
@ApiModel(value = "BaseTeamMemberVO", description = "团队成员")
public class BaseTeamMemberVO extends IntegerIdentityEntityWithOperator {
public class BaseTeamMemberVO extends IntegerIdentityVOWithOperator {
    /**
	 * 团队ID

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

@ -75,4 +75,11 @@ spring:
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.120.210:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: xmjwlocal
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://10.95.22.193:1221}
      label: ${wlyy.spring.config.label:master}

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

@ -69,4 +69,11 @@ spring:
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.120.210:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: xmjwlocal
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://10.95.22.193:1221}
      label: ${wlyy.spring.config.label:master}

+ 2 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/service/org/OrgTree.java

@ -3,13 +3,11 @@ package com.yihu.jw.base.service.org;
import com.yihu.jw.base.service.org.tree.TreeNode;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.*;
@Entity
@Table(name = "org_tree")
@SequenceGenerator(name="id_generated", sequenceName="ORG_TREE_SEQ")
public class OrgTree extends IntegerIdentityEntity implements TreeNode {
    private String code;
    private String parentCode;

+ 7 - 0
svr/svr-base/src/main/resources/bootstrap.yml

@ -38,3 +38,10 @@ spring:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:local}
---
spring:
  profiles: xmjwlocal
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://10.95.22.193:1221}
      label: ${wlyy.spring.config.label:master}

+ 42 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/EnterpriseController.java

@ -78,6 +78,48 @@ public class EnterpriseController extends EnvelopRestEndpoint {
        return success(enterpriseService.sendMKMesByMobile(enterpriseId,mobile,content));
    }
    @PostMapping(value = "/sendXCXMesByDoctor")
    @ApiOperation(value = "发送小程序消息")
    public Envelop sendXCXMesByDoctor(@ApiParam(name = "enterpriseId", value = "企业id", required = true)
                                          @RequestParam(value = "enterpriseId")String enterpriseId,
                                      @ApiParam(name = "doctor", value = "医生手机号", required = true)
                                          @RequestParam(value = "doctor")String doctor,
                                      @ApiParam(name = "appid", value = "appid", required = true)
                                          @RequestParam(value = "appid")String appid,
                                      @ApiParam(name = "page", value = "跳转地址", required = true)
                                          @RequestParam(value = "page")String page,
                                      @ApiParam(name = "title", value = "标题", required = true)
                                          @RequestParam(value = "title")String title,
                                      @ApiParam(name = "description", value = "描述", required = true)
                                          @RequestParam(value = "description")String description,
                                      @ApiParam(name = "emphasis_first_item", value = "是否首行放大", required = true)
                                          @RequestParam(value = "emphasis_first_item")Boolean emphasis_first_item,
                                      @ApiParam(name = "content_item", value = "内容JSON数组字符串", required = true)
                                          @RequestParam(value = "content_item")String content_item) throws Exception{
        return success(enterpriseService.sendXCXMesByDoctor(enterpriseId,doctor,appid,page,title,description,emphasis_first_item,content_item));
    }
    @PostMapping(value = "/sendXCXMesByMobile")
    @ApiOperation(value = "发送小程序消息")
    public Envelop sendXCXMesByMobile(@ApiParam(name = "enterpriseId", value = "企业id", required = true)
                                          @RequestParam(value = "enterpriseId")String enterpriseId,
                                      @ApiParam(name = "mobile", value = "手机号", required = true)
                                      @RequestParam(value = "mobile")String mobile,
                                      @ApiParam(name = "appid", value = "appid", required = true)
                                          @RequestParam(value = "appid")String appid,
                                      @ApiParam(name = "page", value = "跳转地址", required = true)
                                          @RequestParam(value = "page")String page,
                                      @ApiParam(name = "title", value = "标题", required = true)
                                          @RequestParam(value = "title")String title,
                                      @ApiParam(name = "description", value = "描述", required = true)
                                          @RequestParam(value = "description")String description,
                                      @ApiParam(name = "emphasis_first_item", value = "是否首行放大", required = true)
                                          @RequestParam(value = "emphasis_first_item")Boolean emphasis_first_item,
                                      @ApiParam(name = "content_item", value = "内容JSON数组字符串", required = true)
                                          @RequestParam(value = "content_item")String content_item) throws Exception{
        return success(enterpriseService.sendXCXMesByMobile(enterpriseId,mobile,appid,page,title,description,emphasis_first_item,content_item));
    }
    @PostMapping(value = "/saveAllUser")
    @ApiOperation(value = "拉取用户信息")
    public Envelop saveAllUser(

+ 7 - 0
svr/svr-internet-hospital-job/pom.xml

@ -146,6 +146,13 @@
            <version>2.4.4</version>
        </dependency>
        <!--oracle驱动-->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3</version>
        </dependency>
    </dependencies>
    <build>

+ 22 - 82
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/event/ApplicationEvent.java

@ -28,97 +28,37 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
    public void onApplicationEvent(ContextRefreshedEvent ContextRefreshedEvent) {
        try {
            //互联网医院处方状态更新job
            if (!quartzHelper.isExistJob("prescriptionStatus_update_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prescriptionStatus_update_job");
                quartzHelper.addJob(PrescriptionStatusUpdateJob.class, trigger, "prescriptionStatus_update_job", new HashMap<String, Object>());
                logger.info("prescriptionStatus_update_job  job success");
            } else {
                logger.info("prescriptionStatus_update_job  job exist");
            }
            //门诊过期
            if (!quartzHelper.isExistJob("prescription_overdue_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prescription_overdue_job");
                quartzHelper.addJob(PrescriptionOverdueJob.class, trigger, "prescription_overdue_job", new HashMap<String, Object>());
                logger.info("prescription_overdue_job  job success");
            } else {
                logger.info("prescription_overdue_job  job exist");
            }
            //互联网医院 监管平台上报
            if (!quartzHelper.isExistJob("data_upload_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_job");
                quartzHelper.addJob(DataUploadJob.class, trigger, "data_upload_job", new HashMap<String, Object>());
                logger.info("data_upload_job  job success");
            } else {
                logger.info("data_upload_job  job exist");
            }
            //2.5 网上预约挂号上传
//            if (!quartzHelper.isExistJob("data_upload_25_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_25_job");
//                quartzHelper.addJob(DataUpload25Job.class, trigger, "data_upload_25_job", new HashMap<String, Object>());
//                logger.info("data_upload_25_job  job success");
//            } else {
//                logger.info("data_upload_25_job  job exist");
//            }
//
//            //2.6 网上医技预约上传开始
//            if (!quartzHelper.isExistJob("data_upload_26_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_26_job");
//                quartzHelper.addJob(DataUpload26Job.class, trigger, "data_upload_26_job", new HashMap<String, Object>());
//                logger.info("data_upload_26_job  job success");
//            } else {
//                logger.info("data_upload_26_job  job exist");
//            }
//
//            //2.7 医生评价信息开始
//            if (!quartzHelper.isExistJob("data_upload_27_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_27_job");
//                quartzHelper.addJob(DataUpload27Job.class, trigger, "data_upload_27_job", new HashMap<String, Object>());
//                logger.info("data_upload_27_job  job success");
//=================中山医院发布启动======================================================
//            //互联网医院处方状态更新job
//            if (!quartzHelper.isExistJob("prescriptionStatus_update_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prescriptionStatus_update_job");
//                quartzHelper.addJob(PrescriptionStatusUpdateJob.class, trigger, "prescriptionStatus_update_job", new HashMap<String, Object>());
//                logger.info("prescriptionStatus_update_job  job success");
//            } else {
//                logger.info("data_upload_27_job  job exist");
//                logger.info("prescriptionStatus_update_job  job exist");
//            }
//
//            //2.8 网络咨询服务信息开始
//            if (!quartzHelper.isExistJob("data_upload_28_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_28_job");
//                quartzHelper.addJob(DataUpload28Job.class, trigger, "data_upload_28_job", new HashMap<String, Object>());
//                logger.info("data_upload_28_job  job success");
//            //门诊过期
//            if (!quartzHelper.isExistJob("prescription_overdue_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prescription_overdue_job");
//                quartzHelper.addJob(PrescriptionOverdueJob.class, trigger, "prescription_overdue_job", new HashMap<String, Object>());
//                logger.info("prescription_overdue_job  job success");
//            } else {
//                logger.info("data_upload_28_job  job exist");
//                logger.info("prescription_overdue_job  job exist");
//            }
//
//            //2.9 网络诊疗服务信息
//            if (!quartzHelper.isExistJob("data_upload_29_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_29_job");
//                quartzHelper.addJob(DataUpload29Job.class, trigger, "data_upload_29_job", new HashMap<String, Object>());
//                logger.info("data_upload_29_job  job success");
//            } else {
//                logger.info("data_upload_29_job  job exist");
//            }
//
//            //2.10 电子处方表
//            if (!quartzHelper.isExistJob("data_upload_210_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_210_job");
//                quartzHelper.addJob(DataUpload210Job.class, trigger, "data_upload_210_job", new HashMap<String, Object>());
//                logger.info("data_upload_210_job  job success");
//            //互联网医院 监管平台上报
//            if (!quartzHelper.isExistJob("data_upload_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_job");
//                quartzHelper.addJob(DataUploadJob.class, trigger, "data_upload_job", new HashMap<String, Object>());
//                logger.info("data_upload_job  job success");
//            } else {
//                logger.info("data_upload_210_job  job exist");
//            }
//
//            //2.11 电子处方_药品明细表
//            if (!quartzHelper.isExistJob("data_upload_211_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_211_job");
//                quartzHelper.addJob(DataUpload211Job.class, trigger, "data_upload_211_job", new HashMap<String, Object>());
//                logger.info("data_upload_211_job  job success");
//            } else {
//                logger.info("data_upload_211_job  job exist");
//                logger.info("data_upload_job  job exist");
//            }
//=================中山医院发布启动======================================================
        } catch (Exception e) {
            logger.info("followup_plan_remind job start failed");

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

@ -4,6 +4,7 @@ import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.internet.service.DataGeneratorService;
import com.yihu.jw.internet.service.InternetService;
import com.yihu.jw.internet.service.ykyy.YkyyInternetService;
import com.yihu.jw.job.DataUploadJob;
import com.yihu.jw.job.PrescriptionOverdueJob;
import com.yihu.jw.job.PrescriptionStatusUpdateJob;
@ -48,6 +49,9 @@ public class JobController extends BaseController {
    @Autowired
    private DataGeneratorService dataGeneratorService;
    @Autowired
    private YkyyInternetService ykyyInternetService;
    @Autowired
    public JobController(JobService jobService, QuartzHelper quartzHelper) {
        this.jobService = jobService;
@ -388,4 +392,27 @@ public class JobController extends BaseController {
            return error(-1, "数据已经删除");
        }
    }
    @RequestMapping(value = "/ykyyUpload", method = RequestMethod.GET)
    @ApiOperation("上传")
    public String ykyyUpload(String id) {
        try {
            switch(id){
                case "2.2" :
                    ykyyInternetService.upNsOrganBas();
                    break; //可选
                case "2.3" :
                    //语句
                    ykyyInternetService.upNsDoctorRecord(null,null,null);
                    break; //可选
                default : //可选
                    //语句
            }
            return write(200, "执行成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "执行失败");
        }
    }
}

+ 37 - 0
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -100,6 +100,41 @@ im:
  data_base_name: im_internet_hospital
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
---
spring:
  profiles: jwOracleProd
  datasource:
    driver-class-name: oracle.jdbc.driver.OracleDriver
    url: jdbc:oracle:thin:@172.26.0.141:1521:helowin
    username: normal
    password: normal
  jpa:
    properties:
      hibernate:
        dialect: org.hibernate.dialect.Oracle10gDialect
        show_sql: true
    database: oracle
hlwyyEntrance:
  url: http://172.16.1.42:10023
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
---
spring:
  profiles: jwprod
@ -124,3 +159,5 @@ im:
  data_base_name: im
fastDFS:
  fastdfs_file_url: http://192.0.33.26:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/

+ 8 - 2
svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-internet-hospital-job
    name: svr-internet-hospital-job-yx
  cloud:
    config:
      failFast: true
@ -22,7 +22,13 @@ spring:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: jwOracleProd
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: jwprod

+ 30 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java

@ -10,6 +10,7 @@ import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.org.service.BaseOrgInfoService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
@ -53,6 +54,9 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private WlyyBusinessService wlyyBusinessService;
    @Autowired
    private YkyyEntranceService ykyyEntranceService;
    /**
     * 获取市列表信息
     * @return
@ -144,6 +148,8 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
        }
    }
    //==================区域互联网======================================
    @GetMapping(value = "/findByTown")
    @ApiOperation(value = "获取街道信息", notes = "获取街道信息")
    public Envelop findByTown(@ApiParam(name = "town", value = "区级code")
@ -168,5 +174,29 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    public Envelop findWlyyDoctor() throws Exception{
        return success(wlyyBusinessService.findWlyyDoctor());
    }
    //===============区域互联网===========================================
    //===============眼科中心信息同步======================================
    @GetMapping(value = "/updateYkyyDept")
    @ApiOperation(value = "同步科室数据", notes = "同步医生数据")
    public Envelop updateYkyyDept() throws Exception{
        return success(ykyyEntranceService.updateYkyyDept());
    }
    @GetMapping(value = "/updateYkyyDoctor")
    @ApiOperation(value = "同步医生信息", notes = "同步医生信息")
    public Envelop updateYkyyDoctor() throws Exception {
        return success(ykyyEntranceService.updateYkyyDoctor());
    }
//    @GetMapping(value = "/test")
//    @ApiOperation(value = "test", notes = "test")
//    public Envelop test() throws Exception {
//        return success(ykyyEntranceService.test());
//    }
    //===============眼科中心信息同步======================================
}

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

@ -934,9 +934,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorByName)
    @ApiOperation(value = "获取医生信息")
    public ListEnvelop findDoctorByName(@ApiParam(name = "name", value = "医生名称")
                                        @RequestParam(value = "name",required = false)String name) {
        return success(prescriptionService.findDoctorByName(name));
    public ListEnvelop findDoctorByName(@ApiParam(name = "hospital", value = "医院code")
                                        @RequestParam(value = "hospital",required = false)String hospital,
                                        @ApiParam(name = "name", value = "医生名称")
                                        @RequestParam(value = "name",required = false)String name,
                                        @ApiParam(name = "chargeType", value = "号别")
                                        @RequestParam(value = "chargeType",required = false)String chargeType) {
        return success(prescriptionService.findDoctorByName(hospital,name,chargeType));
    }

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

@ -503,4 +503,289 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
        return success(result);
    }
    /**
     * 咨询列表
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2 市  3区  4医院 5、科室 6医生
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.consultHead)
    @ApiOperation(value = " 咨询分析-头部")
    public ObjEnvelop getConsultHead(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index) {
        //新版与旧版统计适配
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getConsultHead(startDate, endDate, area, level, index);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    /**
     * 咨询列表
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2 市  3区  4医院 5、科室 6医生
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.consultLine)
    @ApiOperation(value = "咨询分析曲线")
    public ObjEnvelop getConsultLine(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = false)int interval,
            @RequestParam(required = false) String level2_type) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getConsultLine(startDate, endDate, area, level, index, interval,level2_type);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    /**
     * 咨询列表
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2 市  3区  4医院 5、科室 6医生
     * @param lowLevel 2 市  3区  4医院 5、科室 6医生
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.consultList)
    @ApiOperation(value = "咨询列表")
    public ObjEnvelop getConsultingList(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = true) String lowLevel) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getConsultingList(startDate, endDate,level,area,lowLevel,index);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    /**
     * app端首页门诊量统计
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index 5咨询量,6专家咨询,11图文复诊,13专科协同,15视频复诊
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.consultTotalApp)
    @ApiOperation(value = "app端首页门诊量统计")
    public ObjEnvelop getConsultTotalApp(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index) {
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getConsultTotalApp(startDate, endDate, area, level, index);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    /**
     * app端首页门诊量-圆形图
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.consultCircularApp)
    @ApiOperation(value = "app端首页门诊量-圆形图")
    public ObjEnvelop getConsultCircularApp(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level) {
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getConsultCircularApp(startDate, endDate, area, level);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    /**
     * app端首页门诊量统计-曲线图
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index 5
     * @param interval
     * @param level2_type
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.consultLineApp)
    @ApiOperation(value = "app端首页门诊量统计-曲线图")
    public ObjEnvelop getConsultLineApp(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = true)Integer interval,
            @RequestParam(required = false)String level2_type) {
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getConsultLineApp(startDate, endDate, area, level, index,interval,level2_type);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.consultListApp)
    @ApiOperation(value = "app端首页门诊量统计-表格")
    public ObjEnvelop getConsultListApp(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = true)String lowLevel) {
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getConsultListApp(startDate, endDate,level,area, lowLevel,index);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    /**
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
     * @param interval
     * @param level2_type
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.consultLinePC)
    @ApiOperation(value = "pc端首页门诊量统计-曲线图")
    public ObjEnvelop getConsultLinePC(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = true)Integer interval,
            @RequestParam(required = false)String level2_type) {
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getConsultLinePC(startDate, endDate, area, level, index,interval,level2_type);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    /**
     *pc端首页门诊量统计-表格
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index 专家咨询6,图文复诊11,专家协同13,视频复诊15
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.consultListPC)
    @ApiOperation(value = "pc端首页门诊量统计-表格")
    public ObjEnvelop getConsultLinePC(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = true)String lowLevel) {
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getConsultingListPC(startDate, endDate, level,area,lowLevel, index);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    /**
     * app端首页数据统计
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index 6专家,13协同,11、在线复诊
     * @param timeLevel
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.indexTotalApp)
    @ApiOperation(value = "app端首页数据统计")
    public ObjEnvelop getIndexTotalApp(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = true)String timeLevel) {
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getIndexTotalApp(startDate, endDate,area, level,index,timeLevel);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
}

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

@ -357,9 +357,10 @@ es:
    Statistics: hlw_quota_test
  type:
    Statistics: hlw_quota_test
  host:  http://172.26.0.112:9200
  tHost: 172.26.0.112:9300
  host:  http://172.26.0.55:9200
  tHost: 172.26.0.55:9300
  clusterName: jkzl
  securityUser: elastic:changeme
#是否开启i健康接口 0关闭,1开启
testPattern:
  sign: 0

+ 0 - 0
svr/svr-oracle-test/sql/sql


+ 25 - 0
svr/svr-oracle-test/src/main/java/com/yihu/SvrInternetHospitalApplication.java

@ -0,0 +1,25 @@
package com.yihu;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
/**
 * Created by Trick on 2019/5/13.
 */
@SpringBootApplication
@EnableJpaAuditing
public class SvrInternetHospitalApplication extends SpringBootServletInitializer {
    public static void main(String[] args)  {
        SpringApplication.run(SvrInternetHospitalApplication.class, args);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SvrInternetHospitalApplication.class);
    }
}

+ 27 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/config/BeanConfig.java

@ -0,0 +1,27 @@
package com.yihu.jw.hospital.config;
import com.yihu.jw.hospital.prescription.service.PrescriptionExpressageService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class BeanConfig {
    //顺丰快递接口请求地址
    @Value("${express.sf_url}")
    private String sf_url;
    //顺丰快递接口接入编码
    @Value("${express.sf_code}")
    private String sf_code;
    //顺丰快递接口checkword
    @Value("${express.sf_check_word}")
    private String sf_check_word;
    @Bean(name = "prescriptionExpressageService")
    PrescriptionExpressageService prescriptionExpressageService(){
        return new PrescriptionExpressageService(sf_url,sf_code,sf_check_word);
    }
}

+ 18 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/config/SpringSecurityAuditorAware.java

@ -0,0 +1,18 @@
package com.yihu.jw.hospital.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;
@Configuration
public class SpringSecurityAuditorAware implements AuditorAware {
    @Override
    public Object getCurrentAuditor() {
//        return Optional.ofNullable(SecurityContextHolder.getContext())
//                .map(SecurityContext::getAuthentication)
//                .filter(Authentication::isAuthenticated)
//                .map(Authentication::getPrincipal);
////                .map(Authentication::getDetails);
        return "123";
    }
}

+ 44 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/config/SwaggerDocs.java

@ -0,0 +1,44 @@
package com.yihu.jw.hospital.config;
import io.github.swagger2markup.GroupBy;
import io.github.swagger2markup.Language;
import io.github.swagger2markup.Swagger2MarkupConfig;
import io.github.swagger2markup.Swagger2MarkupConverter;
import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder;
import io.github.swagger2markup.markup.builder.MarkupLanguage;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
 * Created by lith on 2018/11/23
 */
public class SwaggerDocs {
    public static void main(String[] args) throws Exception {
        //1.请求 http://ip:port/swagger-resources获取group
        String group = "Default";
        //2.定义请求地址 new URL("http://ip:port/v2/api-docs?group=" + groupName)
        //项目的swagger-ui地址
        URL remoteSwaggerFile = new URL("http://127.0.0.1:10022/v2/api-docs?group=" + group);
        //3.定义文件输出路径
        String prefix = Thread.currentThread().getContextClassLoader().getResource("").getPath();
        //文档输出地址
        Path outputFile = Paths.get(prefix.substring(prefix.lastIndexOf(":") + 1, prefix.indexOf("target") - 1) + "/build/" + group);
        Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
                .withMarkupLanguage(MarkupLanguage.ASCIIDOC)
                .withOutputLanguage(Language.ZH)
                .withPathsGroupedBy(GroupBy.TAGS)
                .withGeneratedExamples()
                .withoutInlineSchema()
                //.withBasePathPrefix()
                .build();
        Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(remoteSwaggerFile)
                .withConfig(config)
                .build();
        converter.toFile(outputFile);
    }
}

+ 19 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/ConsultPriceDao.java

@ -0,0 +1,19 @@
package com.yihu.jw.hospital.dao.consult;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalConsultPriceDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface ConsultPriceDao extends PagingAndSortingRepository<WlyyHospitalConsultPriceDO, String>, JpaSpecificationExecutor<WlyyHospitalConsultPriceDO>  {
    // 根据机构编码查询所有计费列表
    List<WlyyHospitalConsultPriceDO> findByHospital(String hospital);
    // 根据机构编码、服务科室、医生类型、服务对象,查询单条价格记录
    WlyyHospitalConsultPriceDO findByHospitalAndDeptAndDoctorJobAndServiceRange(String hospital, String dept, String doctorJob, String serviceRange);
    // 根据id 查询已有记录
    WlyyHospitalConsultPriceDO findById(String id);
}

+ 19 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/KnowledgeArticleDao.java

@ -0,0 +1,19 @@
package com.yihu.jw.hospital.dao.consult;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import java.util.List;
/**
 * 健康文章DAO
 * @author huangwenjie
 * @date 2019/9/10 14:07
 */
public interface KnowledgeArticleDao extends PagingAndSortingRepository<KnowledgeArticleDO, String>, JpaSpecificationExecutor<KnowledgeArticleDO> {
	@Query("select a from KnowledgeArticleDO a where a.del=1 and (categoryFirst = ?1 or categorySecond=?1)")
	List<KnowledgeArticleDO> findByCategory(String category);
}

+ 19 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/KnowledgeArticleDeptDao.java

@ -0,0 +1,19 @@
package com.yihu.jw.hospital.dao.consult;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDeptDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * 健康文章部门关系DAO
 * @author huangwenjie
 * @date 2019/9/18 10:03
 */
public interface KnowledgeArticleDeptDao extends PagingAndSortingRepository<KnowledgeArticleDeptDO, String>, JpaSpecificationExecutor<KnowledgeArticleDeptDO> {
	
	List<KnowledgeArticleDeptDO> findByArticleId(String articleId);
	
	List<KnowledgeArticleDeptDO> findByDept(String dept);
}

+ 18 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/KnowledgeCategoryDao.java

@ -0,0 +1,18 @@
package com.yihu.jw.hospital.dao.consult;
import com.yihu.jw.entity.hospital.article.KnowledgeCategoryDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
/**
 * 健康文章分类
 * @author huangwenjie
 */
public interface KnowledgeCategoryDao extends PagingAndSortingRepository<KnowledgeCategoryDO, String>, JpaSpecificationExecutor<KnowledgeCategoryDO> {
	@Query("update KnowledgeCategoryDO c set c.del = 0 where c.id = ?1")
	@Modifying
	void updateDel(String id);
}

+ 13 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/ReservationSettingDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.hospital.dao.consult;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalReservationSettingDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface ReservationSettingDao extends PagingAndSortingRepository<WlyyHospitalReservationSettingDO, String>, JpaSpecificationExecutor<WlyyHospitalReservationSettingDO>  {
    // 根据id 查询已有记录
    WlyyHospitalReservationSettingDO findById(String id);
}

+ 20 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/SysDictDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.hospital.dao.consult;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface SysDictDao extends PagingAndSortingRepository<WlyyHospitalSysDictDO, String>, JpaSpecificationExecutor<WlyyHospitalSysDictDO>  {
    WlyyHospitalSysDictDO findByHospitalAndDictCode(String hospital, String dictCode);
    List<WlyyHospitalSysDictDO> findByHospitalAndDictName(String hospital, String dictName);
    WlyyHospitalSysDictDO findById(String id);
    List<WlyyHospitalSysDictDO> findByDictName(String dictName);
}

+ 28 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/dao/consult/WlyyPatientExpressageAddrDao.java

@ -0,0 +1,28 @@
package com.yihu.jw.hospital.dao.consult;
import com.yihu.jw.entity.hospital.prescription.WlyyPatientExpressageAddrDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * 
 * 居民收获地址 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2019年06月12日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface WlyyPatientExpressageAddrDao extends PagingAndSortingRepository<WlyyPatientExpressageAddrDO, String>, JpaSpecificationExecutor<WlyyPatientExpressageAddrDO>  {
    boolean existsByPatientAndIsDefault(String patient, Integer isDefault);
    List<WlyyPatientExpressageAddrDO> queryByPatientAndIsDefault(String patient, Integer isDefault);
    List<WlyyPatientExpressageAddrDO> queryByPatient(String patient);
}

+ 33 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/account/PatientEndpoint.java

@ -0,0 +1,33 @@
package com.yihu.jw.hospital.endpoint.account;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("patient" )
@Api(tags = "用户基础信息", description = "互联网医院")
public class PatientEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private BasePatientService basePatientService;
    @GetMapping(value = BaseRequestMapping.BasePatient.getPatientById)
    @ApiOperation(value = "获取居民信息")
    public Envelop getPatientById(
            @ApiParam(name = "id", value = "居民id")
            @RequestParam(value = "id", required = true) String id) throws Exception {
        String result = basePatientService.getPatientById(id);
        return success(result);
    }
}

+ 49 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/analysis/AnalysisEndPoint.java

@ -0,0 +1,49 @@
package com.yihu.jw.hospital.endpoint.analysis;
import com.yihu.jw.hospital.service.analysis.AnalysisService;
import com.yihu.jw.restmodel.web.Envelop;
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 io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * @author zmk
 * @vsrsion 1.0
 * Created at 2019/11/21
 */
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.Analysis.PREFIX)
@Api(value = "分析总览", description = "分析总览", tags = {"互联网医院 - 医生分析总览接口"})
public class AnalysisEndPoint extends EnvelopRestEndpoint {
    private static Logger logger = LoggerFactory.getLogger(AnalysisEndPoint.class);
    @Autowired
    private AnalysisService analysisService;
    @GetMapping(value= BaseHospitalRequestMapping.Analysis.queryAnalysis)
    @ApiOperation("查询分析数据")
    public Envelop queryAnalysis(
            @ApiParam(name = "doctor", value = "doctor", required = true)
            @RequestParam(value = "doctor", required = true)String doctor,
            @ApiParam(name = "startTime", value = "startTime", required = true)
            @RequestParam(value = "startTime", required = true)String startTime,
            @ApiParam(name = "endTime", value = "endTime", required = true)
            @RequestParam(value = "endTime", required = false)String endTime)throws Exception{
        Object num = analysisService.queryAnalysis(doctor,startTime,endTime);
        return success(num);
    }
}

+ 108 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/appointment/AppointmentEndPoint.java

@ -0,0 +1,108 @@
package com.yihu.jw.hospital.endpoint.appointment;
import com.yihu.jw.hospital.appointment.service.AppointmentService;
import com.yihu.jw.hospital.appointment.service.SpecialDiseaseService;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.web.ListEnvelop;
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 io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created by Trick on 2019/10/30.
 */
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.Appointment.PREFIX)
@Api(value = "预约挂号", description = "预约挂号", tags = {"预约挂号接口"})
public class AppointmentEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private AppointmentService appointmentService;
    @Autowired
    private SpecialDiseaseService specialDiseaseService;
    @GetMapping(value = BaseHospitalRequestMapping.Appointment.getDoctorSchedule)
    @ApiOperation(value = "获取医生号源")
    public ListEnvelop getDoctorSchedule(@ApiParam(name = "dept", value = "部门ID")
                                         @RequestParam(value = "dept",required = false) String dept,
                                         @ApiParam(name = "docMappingCode", value = "中山医院医生ID精确查询")
                                         @RequestParam(value = "docMappingCode",required = false)String docMappingCode,
                                         @ApiParam(name = "nameKey", value = "医生姓名模糊")
                                         @RequestParam(value = "nameKey",required = false)String nameKey,
                                         @ApiParam(name = "specialCode", value = "专科")
                                         @RequestParam(value = "specialCode",required = false)String specialCode,
                                         @ApiParam(name = "chargeType", value = "号别")
                                         @RequestParam(value = "chargeType",required = false)String chargeType,
                                         @ApiParam(name = "startDate", value = "开始时间")
                                         @RequestParam(value = "startDate",required = true)String startDate,
                                         @ApiParam(name = "endDate", value = "结束时间")
                                         @RequestParam(value = "endDate",required = true)String endDate) throws Exception {
        return success(appointmentService.getDoctorSchedule( dept,  docMappingCode, nameKey, specialCode, chargeType, startDate, endDate));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Appointment.getDoctorScheduleTime)
    @ApiOperation(value = "获取医生具体号源时间")
    public ListEnvelop getDoctorScheduleTime(@ApiParam(name = "dept", value = "部门ID")
                                         @RequestParam(value = "dept",required = true) String dept,
                                         @ApiParam(name = "docMappingCode", value = "医生ID精确查询")
                                         @RequestParam(value = "docMappingCode",required = true)String docMappingCode,
                                         @ApiParam(name = "date", value = "日期")
                                         @RequestParam(value = "date",required = true)String date,
                                         @ApiParam(name = "ampm", value = "上午a,下午p")
                                         @RequestParam(value = "ampm",required = true)String ampm) throws Exception {
        return success(appointmentService.getDoctorScheduleTime(dept,docMappingCode,date,ampm));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Appointment.getAppointmentList)
    @ApiOperation(value = "获取预约记录列表")
    public ListEnvelop getAppointmentList(@ApiParam(name = "idcard", value = "患者idcard")
                                          @RequestParam(value = "idcard",required = false) String idcard,
                                          @ApiParam(name = "doctor", value = "医生ID精确查询")
                                          @RequestParam(value = "doctor",required = false)String doctor,
                                          @ApiParam(name = "doctorName", value = "医生姓名模糊")
                                          @RequestParam(value = "doctorName",required = false)String doctorName,
                                          @ApiParam(name = "dept", value = "部门")
                                          @RequestParam(value = "dept",required = false)String dept,
                                          @ApiParam(name = "chargeType", value = "号别")
                                          @RequestParam(value = "chargeType",required = false)String chargeType,
                                          @ApiParam(name = "startDate", value = "开始时间")
                                          @RequestParam(value = "startDate",required = true)String startDate,
                                          @ApiParam(name = "endDate", value = "结束时间")
                                          @RequestParam(value = "endDate",required = true)String endDate) throws Exception {
        return success(appointmentService.getAppointmentList(idcard,doctor,doctorName,dept,startDate,endDate,chargeType));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Appointment.makeAppointment)
    @ApiOperation(value = "预约")
    public ObjEnvelop makeAppointment(@ApiParam(name = "appointmentJson", value = "预约实体")
                                       @RequestParam(value = "appointmentJson",required = false) String appointmentJson) throws Exception {
        return success(appointmentService.makeAppointment(appointmentJson));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Appointment.cancelAppointment)
    @ApiOperation(value = "取消预约")
    public ObjEnvelop cancelAppointment(@ApiParam(name = "appointmentJson", value = "预约实体")
                                        @RequestParam(value = "appointmentJson",required = false) String appointmentJson) throws Exception {
        return success(appointmentService.cancelAppointment(appointmentJson));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Appointment.getDoctorByMappingCode)
    @ApiOperation(value = "转化医生映射code")
    public ObjEnvelop getDoctorByMappingCode(@ApiParam(name = "mappingCode", value = "患者ID")
                                        @RequestParam(value = "mappingCode",required = false) String mappingCode) throws Exception {
        return success(appointmentService.getDoctorByMappingCode(mappingCode));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Appointment.findAllSpecialDisease)
    @ApiOperation(value = "获取专病字典")
    public ListEnvelop findAllSpecialDisease() throws Exception {
        return success(specialDiseaseService.findAllSpecialDisease());
    }
}

+ 198 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleEndpoint.java

@ -0,0 +1,198 @@
package com.yihu.jw.hospital.endpoint.article;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeCategoryDO;
import com.yihu.jw.hospital.service.consult.KnowledgeArticleService;
import com.yihu.jw.hospital.service.consult.KnowledgeCategoryService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
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 io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
 * 健康文章
 * @author huangwenjie
 */
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.PREFIX)
@Api(value = "健康文章", description = "健康文章接口", tags = {"健康文章接口"})
public class ArticleEndpoint extends EnvelopRestEndpoint {
	
	@Autowired
	private KnowledgeArticleService  knowledgeArticleService;
	
	@Autowired
	private KnowledgeCategoryService knowledgeCategoryService;
	
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchKnowledgePageList)
	@ApiOperation(value = "获取文章列表")
	public Envelop searchKnowledgePageList(
//			@ApiParam(name = "category_first", value = "1级分类编码")
//			@RequestParam(value = "category_first", required = false) String category_first,
//			@ApiParam(name = "category_secend", value = "2级分类编码")
//			@RequestParam(value = "category_second", required = false) String category_second,
//			@ApiParam(name = "keyword", value = "关键字")
//			@RequestParam(value = "keyword", required = false) String keyword,
//			@ApiParam(name = "status", value = "审核状态:0未审核,1已审核")
//			@RequestParam(value = "status", required = false) String status,
//			@ApiParam(name = "start", value = "开始时间")
//			@RequestParam(value = "start", required = false) String start,
//			@ApiParam(name = "end", value = "结束时间")
//			@RequestParam(value = "end", required = false) String end,
			@ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
			@RequestParam(value = "fields", required = false) String fields,
			@ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
			@RequestParam(value = "filters", required = false) String filters,
			@ApiParam(name = "sorts", value = "排序,规则参见说明文档")
			@RequestParam(value = "sorts", required = false) String sorts,
			@ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
			@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
			@ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
			@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
		if(StringUtils.isBlank(filters)){
			filters=filters+"del=1";
		}else{
			filters=filters+";del=1";
		}
		
		List<KnowledgeArticleDO> list  = knowledgeArticleService.search(fields,filters,sorts,page,pageSize);
		List<KnowledgeArticleDO> totals  = knowledgeArticleService.search(fields,filters,sorts);
		
		JSONObject result = new JSONObject();
		result.put("total",totals.size());
		result.put("detailModelList",list);
		
		return success(result);
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.queryById)
	@ApiOperation(value = "根据id查询文章")
	public Envelop queryByCode(
			@ApiParam(name = "id", value = "id", required = true)
			@RequestParam(value = "id", required = true)String id) throws Exception{
			KnowledgeArticleDO articleDO = knowledgeArticleService.retrieve(id);
		return success(articleDO);
	}
	
	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.deleteById)
	@ApiOperation(value = "根据id删除文章")
	public Envelop deleteById(
			@ApiParam(name = "id", value = "id,多个使用英文逗号分隔", required = true)
			@RequestParam(value = "id", required = true)String id)throws Exception {
			knowledgeArticleService.delArticle(id);
			return success("操作成功");
	}
	
	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.saveArticle)
	@ApiOperation(value = "保存/更新文章")
	public Envelop saveArticle(
			@ApiParam(name = "jsonData", value = "Json数据", required = true)
			@RequestParam String jsonData)throws Exception {
		knowledgeArticleService.saveArticle(jsonData);
		return success("操作成功");
	}
	
	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.reviewArticle)
	@ApiOperation(value = "审核/退回文章")
	public Envelop saveArticle(
			@ApiParam(name = "articleId", value = "文章ID")
			@RequestParam(value = "articleId", required = true) String articleId,
			@ApiParam(name = "status", value = "0未审核,1已审核,2退回")
			@RequestParam(value = "status", required = true) Integer status,
			@ApiParam(name = "reason", value = "退回理由")
			@RequestParam(value = "reason", required = false) String reason
	)throws Exception {
		knowledgeArticleService.reviewArticle(articleId,status,reason);
		return success("操作成功");
	}
	
	
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchCategoryList)
	@ApiOperation(value = "获取分类列表")
	public ListEnvelop searchCategoryList(
			@ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
			@RequestParam(value = "fields", required = false) String fields,
			@ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
			@RequestParam(value = "filters", required = false) String filters,
			@ApiParam(name = "sorts", value = "排序,规则参见说明文档")
			@RequestParam(value = "sorts", required = false) String sorts,
			@ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
			@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
			@ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
			@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
		List<KnowledgeCategoryDO> list  = knowledgeCategoryService.search(fields,filters,sorts,page,pageSize);
		List<KnowledgeCategoryDO> result = new ArrayList<>();
		for(KnowledgeCategoryDO knowledgeCategoryDO:list){
			if(knowledgeCategoryDO.getDel() == 1){
				result.add(knowledgeCategoryDO);
			}
		}
		return success(result);
	}
	
	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.saveCategory)
	@ApiOperation(value = "保存/更新分类")
	public Envelop saveCategory(
			@ApiParam(name = "jsonData", value = "Json数据", required = true)
			@RequestParam String jsonData)throws Exception {
		knowledgeCategoryService.saveCategory(jsonData);
		return success("操作成功");
	}
	
	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.updateDel)
	@ApiOperation(value = "根据分类code删除分类")
	public Envelop updateDel(
			@ApiParam(name = "id", value = "id", required = true)
			@RequestParam(value = "id", required = true)String id)throws Exception {
		Boolean flag = knowledgeCategoryService.updateDel(id);
		if (flag) {
			return success("操作成功");
		}else{
			return failed("操作失败");
		}
		
	}
	@PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.saveArticleDept)
	@ApiOperation(value = "设置文章发送的科室")
	public ObjEnvelop saveArticleDept(@ApiParam(name = "articleId", value = "文章ID")
	                                 @RequestParam(value = "articleId",required = true)String articleId,
	                                 @ApiParam(name = "sdJsons", value = "部门与科室关系json")
	                                 @RequestParam(value = "sdJsons",required = true)String sdJsons)throws Exception {
		return success(knowledgeArticleService.saveArticleDept(articleId,sdJsons));
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findDeptByArticle)
	@ApiOperation(value = "查询文章下的科室")
	public ListEnvelop findDeptByArticle(@ApiParam(name = "articleId", value = "文章ID")
	                                    @RequestParam(value = "articleId",required = true)String articleId)throws Exception {
		return success(knowledgeArticleService.findDeptByArticle(articleId));
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findArticleByDept)
	@ApiOperation(value = "查询部门下发放的文章")
	public ListEnvelop findArticleByDept(@ApiParam(name = "dept", value = "科室")
	                                    @RequestParam(value = "dept",required = true)String dept)throws Exception {
		return success(knowledgeArticleService.findArticleByDept(dept));
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.saveDeptArticle)
	@ApiOperation(value = "设置科室发送的文章")
	public ObjEnvelop saveDeptArticle(@ApiParam(name = "dept", value = "部门code")
	                                 @RequestParam(value = "dept",required = true)String dept,
	                                 @ApiParam(name = "sdJsons", value = "部门与科室关系json")
	                                 @RequestParam(value = "sdJsons",required = false)String sdJsons)throws Exception {
		return success(knowledgeArticleService.saveDeptArticle(dept,sdJsons));
	}
}

+ 202 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java

@ -0,0 +1,202 @@
package com.yihu.jw.hospital.endpoint.base;
import com.yihu.jw.area.service.BaseCityService;
import com.yihu.jw.area.service.BaseStreetService;
import com.yihu.jw.dict.service.BaseDictJobTitleService;
import com.yihu.jw.dict.service.HospitalDeptService;
import com.yihu.jw.doctor.service.BaseDoctorHosService;
import com.yihu.jw.entity.base.area.BaseCityDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.org.service.BaseOrgInfoService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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 cws on 2019/5/28.
 */
@RestController
@RequestMapping("internet/base" )
@Api(tags = "基础字典专用,用于各下拉框数据获取", description = "互联网医院")
public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseCityService cityService;
    @Autowired
    private HospitalDeptService hospitalDeptService;
    @Autowired
    private BaseDictJobTitleService baseDictJobTitleService;
    @Autowired
    private BaseDoctorHosService baseDoctorHosService;
    @Autowired
    private BaseOrgInfoService baseOrgInfoService;
    @Autowired
    private BaseStreetService baseStreetService;
    @Autowired
    private WlyyBusinessService wlyyBusinessService;
    @Autowired
    private YkyyEntranceService ykyyEntranceService;
    /**
     * 获取市列表信息
     * @return
     */
    @GetMapping(value = "/getCity")
    @ApiOperation(value = "获取市列表信息", notes = "基础数据获取")
    public Envelop getCity() throws Exception {
        List<BaseCityDO> res =  cityService.getAllCity();
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("无法获取市列表信息!");
        }
    }
    /**
     * 根据市编码,获取该市范围内所有的医院列表信息
     * @return
     */
    @GetMapping(value = "/getOrgByCity")
    @ApiOperation(value = "根据市编码,获取该市范围内所有的医院列表信息", notes = "基础数据获取")
    public Envelop getOrgByCity(
            @ApiParam(name = "cityCode", value = "市编码")
            @RequestParam(value = "cityCode", required = false) String cityCode,
            @ApiParam(name = "level", value = "等级医院,1等级医院,2.社区医院")
            @RequestParam(value = "level", required = false) Integer level) {
        List<BaseOrgDO> res =  baseOrgInfoService.getOrgByCity(cityCode,level);
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("该市未维护医院信息!");
        }
    }
    /**
     * 根据机构编码获取部门列表信息
     * @param orgCode
     * @return
     */
    @GetMapping(value = "/getDeptByOrgCode")
    @ApiOperation(value = "根据机构编码获取部门列表信息", notes = "基础数据获取")
    public Envelop getDeptByOrgCode(
            @ApiParam(name = "orgCode", value = "机构编码")
            @RequestParam(value = "orgCode", required = false) String orgCode,
            @ApiParam(name = "consultDeptFlag", value = "是否是就诊科室,1为查询门诊,不传为全部")
            @RequestParam(value = "consultDeptFlag", required = false) String consultDeptFlag)  {
        List<DictHospitalDeptDO> res =  hospitalDeptService.getHosDeptByCode(orgCode,consultDeptFlag);
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("无法获取该机构的部门列表信息!");
        }
    }
    /**
     * 根据机构编码及科室信息获取科室内所有医生列表信息
     * @param orgCode
     * @return
     */
    @GetMapping(value = "/getDoctorByOrgAndDept")
    @ApiOperation(value = "根据机构编码及科室信息获取科室内所有医生列表信息", notes = "基础数据获取")
    public Envelop getDoctorByOrgAndDept(
            @ApiParam(name = "orgCode", value = "机构编码")
            @RequestParam(value = "orgCode", required = false) String orgCode,
            @ApiParam(name = "deptCode", value = "部门编码")
            @RequestParam(value = "deptCode", required = false) String deptCode) {
        List<BaseDoctorHospitalDO> res =  baseDoctorHosService.getDoctorByOrgAndDept(orgCode,deptCode);
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("无法获取该机构科室下的医生信息!");
        }
    }
    /**
     * 获取机构职称信息
     * @return
     */
    @GetMapping(value = "/getJobBySaasId")
    @ApiOperation(value = "获取机构职称信息", notes = "基础数据获取")
    public Envelop getJobBySaasId(
            @ApiParam(name = "saasId", value = "租户ID,当为空的情况下查询所有")
            @RequestParam(value = "saasId", required = false) String saasId)  {
        List<DictJobTitleDO> res= baseDictJobTitleService.getBySaasId(saasId);
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("无法获取该机构的职称信息!");
        }
    }
    //==================区域互联网======================================
    @GetMapping(value = "/findByTown")
    @ApiOperation(value = "获取街道信息", notes = "获取街道信息")
    public Envelop findByTown(@ApiParam(name = "town", value = "区级code")
                              @RequestParam(value = "town", required = true) String town)  {
        return success(baseStreetService.findByTown(town));
    }
    @GetMapping(value = "/findWlyyHospital")
    @ApiOperation(value = "同步医院信息", notes = "同步医院信息")
    public Envelop findWlyyHospital() throws Exception {
        return success(wlyyBusinessService.findWlyyHospital());
    }
    @GetMapping(value = "/findWlyyDept")
    @ApiOperation(value = "同步部门信息", notes = "同步部门信息")
    public Envelop findWlyyDept()  throws Exception{
        return success(wlyyBusinessService.findWlyyDept());
    }
    @GetMapping(value = "/findWlyyDoctor")
    @ApiOperation(value = "同步医生信息", notes = "同步医生信息")
    public Envelop findWlyyDoctor() throws Exception{
        return success(wlyyBusinessService.findWlyyDoctor());
    }
    //===============区域互联网===========================================
    //===============眼科中心信息同步======================================
    @GetMapping(value = "/updateYkyyDept")
    @ApiOperation(value = "同步科室数据", notes = "同步医生数据")
    public Envelop updateYkyyDept() throws Exception{
        return success(ykyyEntranceService.updateYkyyDept());
    }
    @GetMapping(value = "/updateYkyyDoctor")
    @ApiOperation(value = "同步医生信息", notes = "同步医生信息")
    public Envelop updateYkyyDoctor() throws Exception {
        return success(ykyyEntranceService.updateYkyyDoctor());
    }
    @GetMapping(value = "/test")
    @ApiOperation(value = "test", notes = "test")
    public Envelop test() throws Exception {
        return success(ykyyEntranceService.test());
    }
    //===============眼科中心信息同步======================================
}

+ 120 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java

@ -0,0 +1,120 @@
package com.yihu.jw.hospital.endpoint.config;
import com.yihu.jw.doctor.service.BaseDoctorService;
import com.yihu.jw.entity.base.doctor.BaseDoctorVo;
import com.yihu.jw.restmodel.web.Envelop;
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 io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * @author zmk
 * @vsrsion 1.0
 * Created at 2019/12/9
 */
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.DoctorSetting.PREFIX)
@Api(tags = "互联网医院后台医生服务配置", description = "互联网医院后台医生服务配置")
public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseDoctorService baseDoctorService;
    @GetMapping(value = BaseHospitalRequestMapping.DoctorSetting.queryList)
    @ApiOperation(value = "获取分页列表")
    public Envelop queryList(
            @ApiParam(name = "city", value = "市区")
            @RequestParam(value = "city", required = false) String city,
            @ApiParam(name = "hospital", value = "机构")
            @RequestParam(value = "hospital", required = false) String hospital,
            @ApiParam(name = "status", value = "状态")
            @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "name", value = "科室或医生名称")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "type", value = "咨询类型")
            @RequestParam(value = "type", required = false) String type,
            @ApiParam(name = "typeCode", value = "分部,无分部不传")
            @RequestParam(value = "typeCode", required = false)String typeCode,
            @ApiParam(name = "dept", value = "部门")
            @RequestParam(value = "dept", required = false)String dept,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "pageSize", value = "页码", required = true, defaultValue = "10")
            @RequestParam(value = "pageSize") int pageSize) throws Exception {
        return baseDoctorService.queryList(city,hospital,status,name,type,typeCode,dept,page,pageSize);
    }
    @GetMapping(value = BaseHospitalRequestMapping.DoctorSetting.queryById)
    @ApiOperation(value = "根据医生id查询详情")
    public Envelop queryById(
            @ApiParam(name = "doctorId", value = "医生id")
            @RequestParam(value = "doctorId", required = true) String doctorId,
            @ApiParam(name = "typeCode", value = "分部,无不传")
            @RequestParam(value = "typeCode", required = false)String typeCode)throws Exception{
        Object object = baseDoctorService.queryById(doctorId,typeCode);
        if (null != object){
            return success("查询成功",object);
        }
        return failed("查询失败");
    }
    @PostMapping(value = BaseHospitalRequestMapping.DoctorSetting.update)
    @ApiOperation(value = "修改医生服务配置")
    public Envelop update(
            @ApiParam(name = "baseDoctorVo", value = "JSON数据", required = true)
            @RequestParam(value = "baseDoctorVo") String baseDoctorVo)throws Exception{
        JSONObject jsonObject = JSONObject.fromObject(baseDoctorVo);
        Boolean update = baseDoctorService.update(jsonObject);
        if (!update){
            return failed("保存失败,参数不可为空");
        }
        return success("保存成功");
    }
    @PostMapping(value = BaseHospitalRequestMapping.DoctorSetting.updateList)
    @ApiOperation(value = "批量修改医生服务配置")
    public Envelop updateList(
            @ApiParam(name = "baseDoctorVos", value = "JSON数据", required = true)
            @RequestParam(value = "baseDoctorVos") String baseDoctorVos)throws Exception{
        JSONArray jsonArray = JSONArray.fromObject(baseDoctorVos);
        Boolean update = baseDoctorService.updateList(jsonArray);
        return success("保存成功");
    }
    @GetMapping(value = BaseHospitalRequestMapping.DoctorSetting.updateStatus)
    @ApiOperation(value = "修改医生状态")
    public Envelop updateStatus(
            @ApiParam(name = "doctorId", value = "状态")
            @RequestParam(value = "doctorId", required = true) String doctorId,
            @ApiParam(name = "status", value = "状态")
            @RequestParam(value = "status", required = true) String status)throws Exception{
        baseDoctorService.updateStatus(doctorId,status);
        return success("修改成功");
    }
    @PostMapping(value = BaseHospitalRequestMapping.DoctorSetting.updateDoctorPw)
    @ApiOperation(value = "修改医生账号密码")
    public Envelop updateDoctorPw(@ApiParam(name = "id", value = "医生ID")
                                  @RequestParam(value = "id", required = true)String id,
                                  @ApiParam(name = "pw", value = "密码")
                                  @RequestParam(value = "pw", required = true)String pw)throws Exception{
        return success(baseDoctorService.updateDoctorPw(id,pw));
    }
}

+ 101 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/consult/ConsultPriceEndpoint.java

@ -0,0 +1,101 @@
package com.yihu.jw.hospital.endpoint.consult;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalConsultPriceDO;
import com.yihu.jw.hospital.service.consult.ConsultPriceService;
import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalConsultPriceVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2019/5/16.
 */
@RestController
@RequestMapping("internet/consult/price" )
@Api(tags = "医院咨询计费价目表", description = "互联网医院")
public class ConsultPriceEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private ConsultPriceService consultPriceService;
    /**
     * 新增咨询计费信息
     * @param jsonData
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/create")
    @ApiOperation(value = "新增咨询计费信息", notes = "新增咨询计费信息")
    public Envelop createConsultPrice(
            @ApiParam(name = "json_data", value = "JSON数据", required = true, defaultValue = "15")
            @RequestParam(value = "json_data") String jsonData ) throws Exception {
        int flag = -1;
        WlyyHospitalConsultPriceDO wlyyHospitalConsultPriceDO = new WlyyHospitalConsultPriceDO();
        Map dataDetail  = JSONObject.fromObject(jsonData);
        String hospital = dataDetail.get("hospital").toString();
        // 获取到职称及服务对象列表,拆分成json数组,再进行处理
        String data = dataDetail.get("data") == "" ? "": dataDetail.get("data") .toString();
        JSONArray array = JSONArray.fromObject(data);
        if (array.size() > 0) {
                for (int i = 0; i < array.size(); i++) {
                JSONObject jsonObject = array.getJSONObject(i);
                wlyyHospitalConsultPriceDO = consultPriceService.saveConsultPrice(jsonObject,hospital);
                if(wlyyHospitalConsultPriceDO != null){
                    flag = 0;
                }else{
                    break;
                }
            }
        }
        if(flag == 0){
            return success("新增咨费成功!");
        }else{
            return failed("新增咨费失败!");
        }
    }
    @GetMapping(value = "/search")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<WlyyHospitalConsultPriceVO> page(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<WlyyHospitalConsultPriceDO> wlyyHospitalConsultPriceDOS = consultPriceService.search(fields, filters, sorts, page, size);
        int count = (int) consultPriceService.getCount(filters);
        return success(wlyyHospitalConsultPriceDOS, count, page, size, WlyyHospitalConsultPriceVO.class);
    }
    @PostMapping(value = "/delete")
    @ApiOperation(value = "删除指定ID的咨费记录", notes = "新增咨询计费信息")
    public Envelop deleteConsultPrice(
            @ApiParam(name = "id", value = "唯一标识ID")
            @RequestParam(value = "id", required = false) String id) {
        consultPriceService.deleteConsultPrice(id);
        return success("删除成功!");
    }
}

File diff suppressed because it is too large
+ 746 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java


File diff suppressed because it is too large
+ 614 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java


+ 101 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/consult/ReservationSettingEndpoint.java

@ -0,0 +1,101 @@
package com.yihu.jw.hospital.endpoint.consult;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalReservationSettingDO;
import com.yihu.jw.hospital.service.consult.ReservationSettingService;
import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalReservationSettingVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2019/5/16.
 */
@RestController
@RequestMapping("internet/reservation/setting" )
@Api(tags = "服务配置", description = "互联网医院")
public class ReservationSettingEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private ReservationSettingService reservationSettingService;
    @PostMapping(value = "/create")
    @ApiOperation(value = "新增服务配置信息", notes = "服务配置")
    public Envelop createResverationSetting(
            @ApiParam(name = "json_data", value = "JSON数据", required = true, defaultValue = "15")
            @RequestParam(value = "json_data") String jsonData ) throws Exception {
        int flag = -1;
        WlyyHospitalReservationSettingDO wlyyHospitalReservationSettingDO = new WlyyHospitalReservationSettingDO();
        Map dataDetail  = JSONObject.fromObject(jsonData);
        Map baseInfo = new HashMap();
        String hospital = dataDetail.get("hospital").toString();
        baseInfo.put("city",dataDetail.get("city").toString());
        baseInfo.put("cityName",dataDetail.get("cityName").toString());
        baseInfo.put("town",dataDetail.get("town").toString());
        baseInfo.put("townName",dataDetail.get("townName").toString());
        baseInfo.put("hospital",dataDetail.get("hospital").toString());
        baseInfo.put("hospitalName",dataDetail.get("hospitalName").toString());
        // 获取到职称及服务对象列表,拆分成json数组,再进行处理
        String data = dataDetail.get("data") == "" ? "": dataDetail.get("data") .toString();
        JSONArray array = JSONArray.fromObject(data);
        if (array.size() > 0) {
                for (int i = 0; i < array.size(); i++) {
                JSONObject jsonObject = array.getJSONObject(i);
                    wlyyHospitalReservationSettingDO = reservationSettingService.saveReverationSetting(jsonObject,baseInfo);
                if(wlyyHospitalReservationSettingDO != null){
                    flag = 0;
                }else{
                    break;
                }
            }
        }
        if(flag == 0){
            return success("新增服务配置成功!");
        }else{
            return failed("新增服务配置失败!");
        }
    }
    @GetMapping(value = "/search")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<WlyyHospitalReservationSettingVO> page(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<WlyyHospitalReservationSettingDO> wlyyHospitalReservationSettingDOS = reservationSettingService.search(fields, filters, sorts, page, size);
        int count = (int) reservationSettingService.getCount(filters);
        return success(wlyyHospitalReservationSettingDOS, count, page, size, WlyyHospitalReservationSettingVO.class);
    }
    @PostMapping(value = "/delete")
    @ApiOperation(value = "删除指定ID的配置服务记录", notes = "服务配置")
    public Envelop deleteConsultPrice(
            @ApiParam(name = "id", value = "唯一标识ID")
            @RequestParam(value = "id", required = false) String id) {
        reservationSettingService.deleteReservationSetting(id);
        return success("删除成功!");
    }
}

+ 157 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/consult/SysDictEndpoint.java

@ -0,0 +1,157 @@
package com.yihu.jw.hospital.endpoint.consult;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.service.consult.SysDictService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2019/5/16.
 */
@RestController
@RequestMapping("internet/consult/sysdict" )
@Api(tags = "互联网医院功能业务字典及开关设置表", description = "互联网医院")
public class SysDictEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private SysDictService sysDictService;
    /**
     * 新增功能业务字典
     * @param jsonData
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/create")
    @ApiOperation(value = "新增&修改功能业务字典", notes = "互联网医院功能业务字典及开关设置表")
    public Envelop createSysDict(
            @ApiParam(name = "json_data", value = "JSON数据", required = true)
            @RequestParam(value = "json_data") String jsonData )  throws Exception {
        int flag = -1;
        Envelop envelop = new Envelop();
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = new WlyyHospitalSysDictDO();
        Map dataDetail  = JSONObject.fromObject(jsonData);
        String hospital = dataDetail.get("hospital") == "" ? "": dataDetail.get("hospital") .toString();
        String dictName = dataDetail.get("dictName") == "" ? "": dataDetail.get("dictName") .toString();
        String data = dataDetail.get("data") == "" ? "": dataDetail.get("data") .toString();
        JSONArray array = JSONArray.fromObject(data);
        if(array.size()>0) {
            for (int i = 0; i < array.size(); i++) {
                JSONObject jsonObject = array.getJSONObject(i);
                wlyyHospitalSysDictDO = sysDictService.saveConsultSetting(jsonObject, hospital, dictName);
                if (wlyyHospitalSysDictDO != null) {
                    flag = 0;
                    continue;
                } else {
                    break;
                }
            }
            if (flag < 0) {
                return failed("配置新增失败!");
            } else {
                return success("配置新增成功!", wlyyHospitalSysDictDO);
            }
        }else{
            return failed("获取待更新配置项失败!");
        }
    }
    /**
     * 该接口实现按医院编号、字典名称、字典项编码进行查询的功能
     * 字典及项值约定:
     * dictName( 候诊延时: WaitingDelay )  dictCode ( 等待时长:WaitingTime  过号延时保号: OverdueDelay   过号延时时长: OverdueTime  延时退费规则: DelayedRefundRule )
     * dictName( 邀请专家配置: InvitedConfig )   dictCode ( 支付配置:PayType  邀请确认:InvitedValid   退费规则:RefundRule )
     */
    @GetMapping(value = "/findByHosAndDn")
    @ApiOperation(value = "基于医院编号及字典名称,查询配置列表", notes = "互联网医院功能业务字典及开关设置表")
    public Envelop findByHosAndDn(
            @ApiParam(name = "hospital", value = "医院编码", required = true)
            @RequestParam(value = "hospital", required = true) String hospital,
            @ApiParam(name = "dictName", value = "字典名称", defaultValue = "")
            @RequestParam(value = "dictName", required = false) String dictName ) throws Exception {
        List<WlyyHospitalSysDictDO>  wlyyHospitalSysDictDOS = new ArrayList<WlyyHospitalSysDictDO>();
        wlyyHospitalSysDictDOS = sysDictService.findByHospitalAndDictName(hospital,dictName);
        Map res = new HashMap();
        res.put("hospital",hospital);
        res.put("dictName",dictName);
        if(wlyyHospitalSysDictDOS != null){
            for(WlyyHospitalSysDictDO wlyyHospitalSysDictDO : wlyyHospitalSysDictDOS){
                res.put(wlyyHospitalSysDictDO.getDictCode().toString(),wlyyHospitalSysDictDO.getDictValue().toString());
            }
            return success("查询配置信息成功!",res);
        }else{
            return failed("配置信息未存储,请先保存!");
        }
    }
    /**
     * 根据医院编号及字典编码,获取配置界面中某一配置项的值信息
     * dictName( 候诊延时: WaitingDelay )  dictCode ( 等待时长:WaitingTime  过号延时保号: OverdueDelay   过号延时时长: OverdueTime  延时退费规则: DelayedRefundRule )
     * dictName( 邀请专家配置: InvitedConfig )   dictCode ( 支付配置:PayType  邀请确认:InvitedValid   退费规则:RefundRule )
     * @param hospital
     * @param dictCode
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/findByHosAndDc")
    @ApiOperation(value = "基于医院编号、字典名称及字典项编码,查询指定配置", notes = "互联网医院功能业务字典及开关设置表")
    public ObjEnvelop findByHosAndDc(
            @ApiParam(name = "hospital", value = "医院编码", required = true)
            @RequestParam(value = "hospital", required = true) String hospital,
            @ApiParam(name = "dictCode", value = "字典项编码", defaultValue = "")
            @RequestParam(value = "dictCode", required = false) String dictCode ) throws Exception {
        ObjEnvelop objEnvelop = new ObjEnvelop();
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = new WlyyHospitalSysDictDO();
        wlyyHospitalSysDictDO = sysDictService.findByHospitalAndDictCode(hospital,dictCode);
        if(wlyyHospitalSysDictDO != null){
            objEnvelop.setObj(wlyyHospitalSysDictDO);
            objEnvelop.setStatus(200);
            objEnvelop.setMessage("查询配置信息成功!");
        }else{
            objEnvelop.setStatus(-1);
            objEnvelop.setMessage("对不起,未查询到相关的配置信息!");
        }
        return objEnvelop;
    }
    
    @Override
    public com.alibaba.fastjson.JSONObject getUserAgent() {
        return super.getUserAgent();
    }
    @GetMapping(value = "/findByHosAndDict")
    @ApiOperation(value = "根据医院和字典名查询")
    public Envelop findByHosAndDict(
            @ApiParam(name = "hospital", value = "医院编码", required = true)
            @RequestParam(value = "hospital", required = true) String hospital,
            @ApiParam(name = "dictName", value = "字典名称", required = true)
            @RequestParam(value = "dictName", required = true) String dictName ) throws Exception {
        List<Map<String, Object>> list = sysDictService.findByHosAndDict(hospital, dictName);
        return success("查询成功",list);
    }
}

+ 0 - 0
svr/svr-oracle-test/src/main/java/com/yihu/jw/hospital/endpoint/demo/HibenateDemoEndpoint.java


Some files were not shown because too many files changed in this diff