Browse Source

部分接口异动到nologin 统计修改

wangjun 4 years ago
parent
commit
57a09db0f9

+ 18 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/dict/service/WlyyHospitalSysDictService.java

@ -1,10 +1,14 @@
package com.yihu.jw.hospital.dict.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.family.BasePatientMemberDictDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.family.dao.BasePatientMemberDictDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
@ -23,6 +27,10 @@ public class WlyyHospitalSysDictService extends BaseJpaService<WlyyHospitalSysDi
    private HibenateUtils hibenateUtils;
    @Autowired
    private ObjectMapper objectMapper;
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    //查字典
    public List<Map<String,Object>> findDictsByNameCode(String name,String code,String value,Integer page ,Integer pageSize){
        String  sql = "select t.id as \"id\"," +
@ -75,4 +83,14 @@ public class WlyyHospitalSysDictService extends BaseJpaService<WlyyHospitalSysDi
        }
        return msg;
    }
    public  String findByDoctorMappingCode(String code){
        String doctorId = "";
        if (StringUtils.isNoneBlank(code)){
            List<BaseDoctorDO> list = baseDoctorDao.findByIdcard(code);
            if (list!=null&&list.size()>0){
                doctorId=list.get(0).getId();
            }
        }
        return doctorId;
    }
}

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

@ -3827,10 +3827,12 @@ public class StatisticsEsService {
            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);
            logger.info("total"+total==null?"0":String.valueOf(total.size())+";"+total.get(0).getResult1());
            //已接诊
            List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"1,2,3");
            //未接诊
            List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"0");
            logger.info("noReceiveTotal"+noReceiveTotal==null?"0":String.valueOf(noReceiveTotal.size())+";"+noReceiveTotal.get(0).getResult1());
            result.put("resultList", getCoutListPC1(level, lowLevel, endTotal, total, haveReceiveTotal,noReceiveTotal,concleTotal));
    }
@ -3920,10 +3922,14 @@ public class StatisticsEsService {
            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) {
            endRs = endRs==null?new SaveModel():endRs;
            totalRs = totalRs==null?new SaveModel():totalRs;
            concleRs = concleRs==null?new SaveModel():concleRs;
            noReceiveRs = noReceiveRs==null?new SaveModel():noReceiveRs;
            haveReceiveRs = haveReceiveRs==null?new SaveModel():haveReceiveRs;
            /*if (endRs == null || totalRs == null || concleRs == null || noReceiveRs==null || haveReceiveRs == null) {
                continue;
            }
            }*/
            //合并结果集
            Integer totalNm = totalRs.getResult2().intValue();
            Integer endNm = endRs.getResult2().intValue();

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

@ -372,7 +372,7 @@ public class ElasticsearchUtil {
            }
        }
        sql.append(groupBy);
        logger.info("sql:"+sql);
        return excute(sql.toString(), SaveModel.class, "", "");
    }
@ -696,7 +696,7 @@ public class ElasticsearchUtil {
            }
        }
        sql.append(groupBy);
        logger.info("sql:"+sql);
        return excute(sql.toString(), SaveModel.class, "", "");
    }

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

@ -1,9 +1,11 @@
package com.yihu.jw.hospital.endpoint.dict;
import com.yihu.jw.dict.service.PrivateDictService;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.hospital.dict.service.WlyyHospitalSysDictService;
import com.yihu.jw.hospital.endpoint.message.SystemMessageController;
import com.yihu.jw.hospital.message.service.BaseBannerService;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -13,6 +15,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -30,6 +33,10 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
    private PrivateDictService privateDictService;
    @Autowired
    private WlyyHospitalSysDictService wlyyHospitalSysDictService;
    @Autowired
    private SystemMessageService systemMessageService;
    @ApiOperation("查询隐私策略")
    @PostMapping(value= BaseHospitalRequestMapping.PatientNoLogin.findPrivateDict)
@ -96,4 +103,35 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
        return success(wlyyHospitalSysDictService.updateOrCreateDict(json));
    }
    @GetMapping(value = BaseHospitalRequestMapping.SystemMessage.searchMessagePageList)
    @ApiOperation(value = "获取线上就诊消息列表")
    public Envelop searchMessagePageList(
            @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 = "type", value = "类型")
            @RequestParam(value = "type", required = false) String type,
            @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(org.apache.commons.lang.StringUtils.isBlank(filters)){
            filters="del=1";
        }else{
            String doctorId = wlyyHospitalSysDictService.findByDoctorMappingCode(filters);
            filters="receiver="+doctorId+";del=1";
            if (StringUtils.isNotBlank(type)){
                filters = filters+";type="+type;
            }
        }
        List<SystemMessageDO> list  = systemMessageService.search(fields,filters,sorts,page,pageSize);
        int count = (int) systemMessageService.getCount(filters);
        return success(list, count, page, pageSize, SystemMessageDO.class);
    }
}

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

@ -32,6 +32,7 @@ import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.service.consult.KnowledgeArticleService;
import com.yihu.jw.hospital.service.consult.KnowledgeCategoryService;
import com.yihu.jw.hospital.service.consult.QrcodeService;
import com.yihu.jw.hospital.service.consult.SysDictService;
import com.yihu.jw.im.service.ImService;
@ -175,6 +176,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private YkyyPrescriptionService ykyyPrescriptionService;
    @Autowired
    private KnowledgeCategoryService knowledgeCategoryService;
    @Autowired
    private BaseBannerDoctorService baseBannerDoctorService;
@ -1362,5 +1365,45 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        JSONObject jsonObject = baseBannerDoctorService.getDoctorBanners(doctor);
        return success(jsonObject);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptByHospital)
    @ApiOperation(value = "查询机构底下部门", notes = "查询机构底下部门")
    public ListEnvelop findDeptByHospital(@ApiParam(name = "orgCode", value = "机构code")
                                          @RequestParam(value = "orgCode", required = true)String orgCode,
                                          @ApiParam(name = "dept", value = "需要置顶部门")
                                          @RequestParam(value = "dept", required = false)String dept,
                                          @ApiParam(name = "consultDeptFlag", value = "1为查询开通服务部门")
                                          @RequestParam(value = "consultDeptFlag", required = false)String consultDeptFlag) {
        return success(prescriptionService.findDeptByHospital(orgCode,dept,consultDeptFlag));
    }
    @GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.getArticleGroup)
    @ApiOperation(value = "查询分类")
    public MixEnvelop getGroup(){
        MixEnvelop envelop = knowledgeCategoryService.findAllGroup();
        return envelop;
    }
    @PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findArticleByCategoryAndName)
    @ApiOperation(value = "查询文章")
    public MixEnvelop findArticleByCategoryAndName(@ApiParam(name = "categoryFirst", value = "一级分类code")
                                                   @RequestParam(value = "categoryFirst",required = false)String categoryFirst,
                                                   @ApiParam(name = "categorySecond", value = "二级分类code")
                                                   @RequestParam(value = "categorySecond",required = false)String categorySecond,
                                                   @ApiParam(name = "keyWords", value = "关键词")
                                                   @RequestParam(value = "keyWords",required = false)String keyWords,
                                                   @ApiParam(name = "page", value = "当前页")
                                                   @RequestParam(value = "page",required = false)Integer page,
                                                   @ApiParam(name = "pageSize", value = "分页大小)")
                                                   @RequestParam(value = "pageSize",required = false)Integer pageSize)throws Exception {
        MixEnvelop mixEnvelop=knowledgeArticleService.findArticleByCategoryAndName(categoryFirst,categorySecond,keyWords,page,pageSize);
        return mixEnvelop;
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findAllHospital)
    @ApiOperation(value = "查询所有机构", notes = "查询所有机构")
    public ListEnvelop findAllHospital(@ApiParam(name = "level", value = "医院等级")
                                       @RequestParam(value = "level", required = false)Integer level,
                                       @ApiParam(name = "keyWord", value = "名字关键字")
                                       @RequestParam(value = "keyWord", required = false)String keyWord) {
        return success(prescriptionService.findAllHospital(level,keyWord));
    }
}