suqinyi 1 anno fa
parent
commit
9a1b554c38

File diff suppressed because it is too large
+ 73 - 35
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java


+ 2 - 2
starter/elasticsearch-starter/src/main/java/com/yihu/jw/elasticsearch/ElasticSearch7Pool.java

@ -93,8 +93,8 @@ public class ElasticSearch7Pool {
    public ResultSet restHighLevelClientStream(String sql) throws Exception {
//        Connection connection = DriverManager.getConnection("jdbc:es://http://172.26.0.55:9200","elastic","elastic");
        Connection connection = DriverManager.getConnection("jdbc:es://http://172.26.0.168:9200/","elastic","elastic");
//        Connection connection = DriverManager.getConnection("jdbc:es://" + hosts, userName, password);
//        Connection connection = DriverManager.getConnection("jdbc:es://http://172.26.0.168:9200/","elastic","elastic");
        Connection connection = DriverManager.getConnection("jdbc:es://" + hosts, userName, password);
        Statement statement = connection.createStatement();
        ResultSet resultSet = statement.executeQuery(sql);
//        connection.close();

+ 2 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleEndpoint.java

@ -242,9 +242,10 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
			if (flag) {
				return success("操作成功");
			}else{
				return failed("操作失败");
				return failed("存在一级或二级分类,删除失败");
			}
		}catch (Exception e){
			e.printStackTrace();
			return failedException2(e);
		}
		

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

@ -3,7 +3,12 @@ package com.yihu.jw.hospital.endpoint.statistics;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.restmodel.hospital.statistics.ScreenQvo;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
@ -13,6 +18,7 @@ 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.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -39,6 +45,12 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private StatisticsEsService statisticsEsService;
    @Autowired
    private ImService imService;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    /**
@ -1264,8 +1276,8 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    /**
     * 获取【科室、医生】的接诊量接诊率排名
     * 参数:
     * 科室参数:strJson={"startDate":"2023-07-01","endDate":"2023-07-20","area":"350211A1002","level":4,"deptCode":"1190000","flag":"1"}
     * 医生参数:strJson={"startDate":"2023-07-17","endDate":"2023-07-20","area":"","level":5,"flag":"1"}
     * 科室参数:strJson={"startDate":"2020-07-01","endDate":"2023-07-20","area":"350211A1002","level":4,"deptCode":"1190000","flag":"1"}
     * 医生参数:strJson={"startDate":"2020-07-17","endDate":"2023-07-20","area":"","level":5,"flag":"1"}
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.getDeptOrDoctorVolumeList)
    @ApiOperation(value = " 获取【科室、医生】的接诊量接诊率排名")
@ -1619,7 +1631,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    public Envelop getDoctorSeverScopeDetail(@RequestParam(required = true) String strJson) {
        try {
            ScreenQvo qvo = JSON.parseObject(strJson, ScreenQvo.class);
            List<Map<String, Object>> result = statisticsEsService.getDoctorSeverScopeDetail(qvo);
            Map<String, Object> result = statisticsEsService.getDoctorSeverScopeDetail(qvo);
            return success(result);
        } catch (Exception e) {
            e.printStackTrace();
@ -1637,7 +1649,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    public Envelop getDoctorFreeDetail(@RequestParam(required = true) String strJson) {
        try {
            ScreenQvo qvo = JSON.parseObject(strJson, ScreenQvo.class);
            List<Map<String, Object>> result = statisticsEsService.getDoctorFreeDetail(qvo);
            Map<String, Object>  result = statisticsEsService.getDoctorFreeDetail(qvo);
            return success(result);
        } catch (Exception e) {
            e.printStackTrace();
@ -1731,4 +1743,63 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = BaseHospitalRequestMapping.DodtorIM.records2)
    @ApiOperation(value = "医生咨询记录查询")
    public Envelop records2(
            @ApiParam(name = "doctor", value = "医生id")
            @RequestParam(value = "doctor",required = false) String doctor,
            @ApiParam(name = "title", value = "咨询标题关键字")
            @RequestParam(value = "title",required = false) String title,
            @ApiParam(name = "patient", value = "患者id")
            @RequestParam(value = "patient",required = false) String patient,
            @ApiParam(name = "id", value = "咨询ID")
            @RequestParam(value = "id",required = false) String id,
            @ApiParam(name = "type", value = "咨询类型")
            @RequestParam(value = "type",required = true) String type,
            @ApiParam(name = "status", value = "咨询状态:0全部,1候诊中,2就诊中,3结束")
            @RequestParam(value = "status",required = true) Integer status,
            @ApiParam(name = "start_time", value = "开始时间 YYYY-MM-DD HH:MM:SS")
            @RequestParam(value = "start_time",required = false) String start_time,
            @ApiParam(name = "end_time", value = "结束时间 YYYY-MM-DD HH:MM:SS")
            @RequestParam(value = "end_time",required = false) String end_time,
            @ApiParam(name = "page", value = "第几页")
            @RequestParam(value = "page",required = false) int page,
            @ApiParam(name = "pagesize", value = "分页大小")
            @RequestParam(value = "pagesize",required = false) int pagesize
    )throws Exception{
        try {
            List<Map<String,Object>>  data = imService.findConsultRecordByDoctorNew(doctor, id,type,status, page,pagesize, title,start_time,end_time,patient);
            if (data != null) {
                for(Map<String,Object> consult :data){
                    //如果是协同门诊,多返回全科医生的详细信息
                    if(12 == Integer.parseInt(consult.get("type").toString()) && StringUtils.isNoneBlank((String)consult.get("generalDoctor"))){
                        BaseDoctorDO baseDoctorDO = baseDoctorDao.findByIdAndDel((String)consult.get("generalDoctor"));
                        List<BaseDoctorHospitalDO> baseDoctorHospitalDOList = baseDoctorHospitalDao.findByDoctorCode((String)consult.get("generalDoctor"));
                        if(baseDoctorDO!=null){
                            consult.put("generalDoctorName", baseDoctorDO.getName());
                        }
                        if (baseDoctorHospitalDOList!=null&&baseDoctorHospitalDOList.size()!=0){
                            BaseDoctorHospitalDO baseDoctorHospitalDO = baseDoctorHospitalDOList.get(0);
                            consult.put("generalOrgName",baseDoctorHospitalDO.getOrgName());
                            consult.put("generalDeptName",baseDoctorHospitalDO.getDeptName());
                        }
                    }
                }
            }
            Long total = imService.countConsultRecordByDoctor2(doctor, id,type,status,title,start_time,end_time);
            JSONObject result = new JSONObject();
            result.put("total",total);
            result.put("list",data);
            return success(result);
        } catch (Exception e){
            return failedException(e);
        }
    }
}

+ 10 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeCategoryService.java

@ -53,12 +53,17 @@ public class KnowledgeCategoryService extends BaseJpaService<KnowledgeCategoryDO
	
	@Transactional
	public Boolean updateDel(String code) {
		List<KnowledgeArticleDO> byCategory = articleDao.findByCategory(code);
		if (null != byCategory && byCategory.size() > 0) {
			return false;
		try {
			List<KnowledgeArticleDO> byCategory = articleDao.findByCategory(code);
			if (null != byCategory && byCategory.size() > 0) {
				return false;
			}
			knowledgeCategoryDao.updateDel(code);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		knowledgeCategoryDao.updateDel(code);
		return true;
		return false;
	}
	public MixEnvelop findAllGroup(){
		String sqlPid = "select id as \"id\",name as \"name\",pid as \"pid\" from wlyy_knowledge_category  where pid = '0' and del = 1";

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

@ -1530,12 +1530,12 @@ es:
    Statistics: hlw_quota_test
#  host:  http://172.26.0.55:9000
#  tHost: 172.26.0.55:9300
  host: http://172.26.0.112:9200
  tHost: http://172.26.0.112:9200
  host: http://172.26.0.168:9200
  tHost: http://172.26.0.168:9200
  clusterName: jkzl
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
  user: elastic
  password: elastic
# 上传文件临时路径配置
FileTempPath: