Переглянути джерело

Merge branch 'dev' of wangjun/wlyy2.0 into dev

wangzhinan 4 роки тому
батько
коміт
ac4364f433

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

@ -15,7 +15,8 @@ import java.util.List;
public interface WlyyChargeDictDao extends PagingAndSortingRepository<WlyyChargeDictDO, String>, JpaSpecificationExecutor<WlyyChargeDictDO> {
public interface WlyyChargeDictDao extends PagingAndSortingRepository<WlyyChargeDictDO, String>, JpaSpecificationExecutor<WlyyChargeDictDO> {
    List<WlyyChargeDictDO>  findByDeptTypeCode(String deptTypeCode);
    List<WlyyChargeDictDO>  findByDeptTypeCode(String deptTypeCode);
    @Query("from WlyyChargeDictDO d where 1=1 ")
    List<WlyyChargeDictDO>  findAllDict();
    WlyyChargeDictDO  findByChargeTypeAndDeptTypeCode(String chargeType,String deptTypeCode);
    WlyyChargeDictDO  findByChargeTypeAndDeptTypeCode(String chargeType,String deptTypeCode);
    WlyyChargeDictDO  findByChargeType(String chargeType);
    WlyyChargeDictDO  findByChargeType(String chargeType);

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

@ -0,0 +1,96 @@
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;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class WlyyHospitalSysDictService extends BaseJpaService<WlyyHospitalSysDictDO, WlyyHospitalSysDictDao> {
    @Autowired
    private  WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    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\"," +
                " t.dict_name  as \"dictName\","+
                " t.dict_code  as \"dictCode\","+
                " t.dict_value   as \"dictValue\","+
                " t.py_code  as \"pyCode\","+
                " t.hospital  as \"hospital\","+
                " t.create_time as \"createTime\""+
                " from wlyy_hospital_sys_dict t where 1=1 ";
        if (StringUtils.isNoneBlank(name)){
            sql+=" and t.dict_name like '%"+name+"%'";
        }
        if (StringUtils.isNoneBlank(code)){
            sql+=" and t.dict_code like '%"+code+"%'";
        }
        if (StringUtils.isNoneBlank(value)){
            sql+=" and t.dict_value like '%"+value+"%'";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        return  list;
    }
    //根据id修改或新增字典
    public WlyyHospitalSysDictDO updateOrCreateDict(String json) throws  Exception{
        WlyyHospitalSysDictDO  wlyyHospitalSysDictDO = objectMapper.readValue(json, WlyyHospitalSysDictDO.class);
        if(StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getId())){
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO1 = wlyyHospitalSysDictDao.findById(wlyyHospitalSysDictDO.getId());
            wlyyHospitalSysDictDO1.setDictValue(wlyyHospitalSysDictDO.getDictValue());
            wlyyHospitalSysDictDO1.setDictCode(wlyyHospitalSysDictDO.getDictCode());
            wlyyHospitalSysDictDO1.setDictName(wlyyHospitalSysDictDO.getDictName());
            wlyyHospitalSysDictDO1.setHospital(wlyyHospitalSysDictDO.getHospital());
            wlyyHospitalSysDictDO1.setPyCode(wlyyHospitalSysDictDO.getPyCode());
            return wlyyHospitalSysDictDao.save(wlyyHospitalSysDictDO1);
        }
        return wlyyHospitalSysDictDao.save(wlyyHospitalSysDictDO);
    }
    //根据id删除字典
    public String  deleteDictById(String id){
        String msg = "";
        if (StringUtils.isNoneBlank(id)){
           WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById(id);
           if (wlyyHospitalSysDictDO!=null) {
               wlyyHospitalSysDictDao.delete(id);
               msg = "删除成功";
           }else {
               msg = "没有这条记录";
           }
        }else{
            msg = "id为空";
        }
        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;
    }
}

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

@ -3185,7 +3185,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    }
    public List<WlyyChargeDictVO> findByDeptTypeCode(String deptTypeCode) {
    public List<WlyyChargeDictVO> findByDeptTypeCode(String deptTypeCode) {
        List<WlyyChargeDictDO> dictDOs = wlyyChargeDictDao.findByDeptTypeCode(deptTypeCode);
        List<WlyyChargeDictDO> dictDOs = new ArrayList<>();
        if(StringUtils.isNoneBlank(deptTypeCode)){
            dictDOs = wlyyChargeDictDao.findByDeptTypeCode(deptTypeCode);
        }else {
            dictDOs = wlyyChargeDictDao.findAllDict();
        }
        List<WlyyChargeDictVO> dictVOs = new ArrayList<>();
        List<WlyyChargeDictVO> dictVOs = new ArrayList<>();
        return convertToModels(dictDOs, dictVOs, WlyyChargeDictVO.class);
        return convertToModels(dictDOs, dictVOs, WlyyChargeDictVO.class);
    }
    }
@ -9756,19 +9761,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                                }
                                }
                                doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                                doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (!doctorDO.getOutpatientType().contains("zjsp")){
                                        doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zjsp");
                                    if (!doctorDO.getOutpatientType().contains("zxsp")){
                                        doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zxsp");
                                    }
                                    }
                                }else {
                                }else {
                                    doctorDO.setOutpatientType("zjsp");
                                    doctorDO.setOutpatientType("zxsp");
                                }
                                }
                            }else {
                            }else {
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (doctorDO.getOutpatientType().contains("zjsp")){
                                        doctorDO.getOutpatientType().replace(",zjsp","");
                                    if (doctorDO.getOutpatientType().contains("zxsp")){
                                        doctorDO.getOutpatientType().replace(",zxsp","");
                                    }
                                    }
                                }else{
                                }else{
                                    doctorDO.setOutpatientType("zjsp");
                                    doctorDO.setOutpatientType("zxsp");
                                }
                                }
                            }
                            }
@ -9854,11 +9859,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        }
                        }
                        doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                        doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                        if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
                        if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
                            if (!doctorDO.getOutpatientType().contains("zjsp")) {
                                doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zjsp");
                            if (!doctorDO.getOutpatientType().contains("zxsp")) {
                                doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zxsp");
                            }
                            }
                        }else {
                        }else {
                            doctorDO.setOutpatientType("zjsp");
                            doctorDO.setOutpatientType("zxsp");
                        }
                        }
                    }
                    }
                    baseDoctorDao.save(doctorDO);
                    baseDoctorDao.save(doctorDO);

+ 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> 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> 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> 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");
            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));
            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 concleRs = (SaveModel) concleMap.get(key);
            SaveModel noReceiveRs = (SaveModel) noReceiveMap.get(key);
            SaveModel noReceiveRs = (SaveModel) noReceiveMap.get(key);
            SaveModel haveReceiveRs = (SaveModel) haveReceiveMap.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;
                continue;
            }
            }*/
            //合并结果集
            //合并结果集
            Integer totalNm = totalRs.getResult2().intValue();
            Integer totalNm = totalRs.getResult2().intValue();
            Integer endNm = endRs.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);
        sql.append(groupBy);
        logger.info("sql:"+sql);
        return excute(sql.toString(), SaveModel.class, "", "");
        return excute(sql.toString(), SaveModel.class, "", "");
    }
    }
@ -696,7 +696,7 @@ public class ElasticsearchUtil {
            }
            }
        }
        }
        sql.append(groupBy);
        sql.append(groupBy);
        logger.info("sql:"+sql);
        return excute(sql.toString(), SaveModel.class, "", "");
        return excute(sql.toString(), SaveModel.class, "", "");
    }
    }

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

@ -1421,6 +1421,9 @@ public class BaseHospitalRequestMapping {
        public static final String findDictById = "/findDictById";
        public static final String findDictById = "/findDictById";
        public static final String updateDictById = "/updateDictById";
        public static final String updateDictById = "/updateDictById";
        public static final String findDictByCode = "/findDictByCode";
        public static final String findDictByCode = "/findDictByCode";
        public static final String findDict = "/findDict";
        public static final String delDict = "/delDict";
        public static final String createOrUpdateDict = "/createOrUpdateDict";
    }
    }
    /**
    /**

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

@ -1,20 +1,29 @@
package com.yihu.jw.hospital.endpoint.dict;
package com.yihu.jw.hospital.endpoint.dict;
import com.yihu.jw.dict.service.PrivateDictService;
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.endpoint.message.SystemMessageController;
import com.yihu.jw.hospital.message.service.BaseBannerService;
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.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.PatientNoLogin.PREFIX)
@RequestMapping(value = BaseHospitalRequestMapping.PatientNoLogin.PREFIX)
@Api(value = "隐私策略管理", description = "隐私策略管理", tags = {"互联网医院 - 隐私策略管理"})
@Api(value = "隐私策略管理", description = "隐私策略管理", tags = {"互联网医院 - 隐私策略管理"})
@ -22,6 +31,12 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
    private static Logger logger = LoggerFactory.getLogger(PrivateDictEndpoint.class);
    private static Logger logger = LoggerFactory.getLogger(PrivateDictEndpoint.class);
    @Autowired
    @Autowired
    private PrivateDictService privateDictService;
    private PrivateDictService privateDictService;
    @Autowired
    private WlyyHospitalSysDictService wlyyHospitalSysDictService;
    @Autowired
    private SystemMessageService systemMessageService;
    @ApiOperation("查询隐私策略")
    @ApiOperation("查询隐私策略")
    @PostMapping(value= BaseHospitalRequestMapping.PatientNoLogin.findPrivateDict)
    @PostMapping(value= BaseHospitalRequestMapping.PatientNoLogin.findPrivateDict)
@ -58,4 +73,65 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
        MixEnvelop mixEnvelop =privateDictService.deleteById(id);
        MixEnvelop mixEnvelop =privateDictService.deleteById(id);
        return mixEnvelop;
        return mixEnvelop;
    }
    }
    @ApiOperation("查询字典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.findDict)
    public ListEnvelop findDict(@ApiParam(name = "name", value = "name", required = false)
                                     @RequestParam(value = "name", required = false)String name,
                                @ApiParam(name = "code", value = "code", required = false)
                                @RequestParam(value = "code", required = false)String code,
                                @ApiParam(name = "value", value = "value", required = false)
                                    @RequestParam(value = "value", required = false)String value1,
                                @ApiParam(name = "page", value = "page", required = false)
                                    @RequestParam(value = "page", required = false) Integer page,
                                @ApiParam(name = "pageSize", value = "pageSize", required = false)
                                    @RequestParam(value = "pageSize", required = false)Integer pageSize){
        return success(wlyyHospitalSysDictService.findDictsByNameCode(name,code,value1,page,pageSize));
    }
    @ApiOperation("删除字典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.delDict)
    public Envelop delDict(@ApiParam(name = "id", value = "id", required = true)
                                     @RequestParam(value = "id", required = true)String id){
        return success(wlyyHospitalSysDictService.deleteDictById(id));
    }
    @ApiOperation("新增/修改字典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.createOrUpdateDict)
    public Envelop createOrUpdateDict(@ApiParam(name = "json", value = "id", required = true)
                           @RequestParam(value = "json", required = true)String json) throws Exception{
        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);
    }
}
}

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

@ -24,12 +24,15 @@ import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
import com.yihu.jw.hospital.message.service.BaseBannerDoctorService;
import com.yihu.jw.hospital.message.service.BaseUserMsgService;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.*;
import com.yihu.jw.hospital.prescription.service.*;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.service.consult.KnowledgeArticleService;
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.QrcodeService;
import com.yihu.jw.hospital.service.consult.SysDictService;
import com.yihu.jw.hospital.service.consult.SysDictService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.service.ImService;
@ -96,13 +99,14 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private static final Logger logger = LoggerFactory.getLogger(PatientNoLoginEndPoint.class);
    private static final Logger logger = LoggerFactory.getLogger(PatientNoLoginEndPoint.class);
    @Autowired
    @Autowired
    private BusinessOrderService businessOrderService;
    private BusinessOrderService businessOrderService;
    @Autowired
    private BaseDoctorInfoService baseDoctorInfoService;
    @Autowired
    @Autowired
    private PrescriptionExpressageService sfexpressService;
    private PrescriptionExpressageService sfexpressService;
    @Autowired
    @Autowired
    private QrcodeService qrcodeService;
    private QrcodeService qrcodeService;
    @Autowired
    private BaseUserMsgService baseUserMsgService;
    @Autowired
    @Autowired
    private PrescriptionService prescriptionService;
    private PrescriptionService prescriptionService;
    @Autowired
    @Autowired
@ -172,8 +176,11 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @Autowired
    @Autowired
    private YkyyPrescriptionService ykyyPrescriptionService;
    private YkyyPrescriptionService ykyyPrescriptionService;
    @Autowired
    private KnowledgeCategoryService knowledgeCategoryService;
    @Autowired
    private BaseBannerDoctorService baseBannerDoctorService;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
@ -1264,4 +1271,139 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        return success(prescriptionService.findSysByDictCode(dictCode));
        return success(prescriptionService.findSysByDictCode(dictCode));
    }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientIM.getDoctorConsultCount)
    @ApiOperation(value = "医生端:查询会话视频邀请状态", notes = "医生端:查询会话视频邀请状态")
    public Envelop getDoctorConsultCount(@ApiParam(name = "doctorids", value = "会话ID")
                                         @RequestParam(value = "doctorids",required = true) String doctorids)throws Exception  {
        return success("查询成功",imService.getDoctorConsultCount(doctorids));
    }
    @ApiOperation("医生评论展示")
    @PostMapping(value= BaseHospitalRequestMapping.UserMessage.showMessage)
    public Envelop showMessage(@ApiParam(name = "doctor", value = "doctor", required = false)
                               @RequestParam(value = "doctor", required = false)String doctor,
                               @ApiParam(name = "showAll", value = "showAll", required = false)
                               @RequestParam(value = "showAll", required = false)String showAll,
                               @ApiParam(name = "showAllType", value = "showAllType", required = false)
                               @RequestParam(value = "showAllType", required = false)String showAllType,
                               @ApiParam(name = "beginTime", value = "beginTime", required = false)
                               @RequestParam(value = "beginTime", required = false)String beginTime,
                               @ApiParam(name = "endTime", value = "endTime", required = false)
                               @RequestParam(value = "endTime", required = false)String endTime,
                               @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){
        return baseUserMsgService.getMessage(doctor,showAll,showAllType,beginTime,endTime,page,pageSize);
    }
    @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(org.apache.commons.lang.StringUtils.isBlank(filters)){
            filters=filters+"del=1";
        }else{
            filters=filters+";del=1";
        }
        List<KnowledgeArticleDO> list  = knowledgeArticleService.search(fields,filters,sorts,page,pageSize);
        for (KnowledgeArticleDO knowledgeArticleDO:list){
            List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());
            if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                knowledgeArticleDO.setDeptName(doctorHospitalDO.getDeptName());
                knowledgeArticleDO.setHospitalName(doctorHospitalDO.getOrgName());
            }
            KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(knowledgeArticleDO.getId(),getUID());
            if (knowledgeArticleUserDO!=null){
                if (knowledgeArticleUserDO.getUsed()!=null&&knowledgeArticleUserDO.getUsed()==1){
                    knowledgeArticleDO.setIsUsed(1);
                }
            }
        }
        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.Prescription.popularityIncrease)
    @ApiOperation(value = "医生人气值增长")
    public Envelop popularityIncrease (
            @ApiParam(name = "doctor", value = "医生id")
            @RequestParam(value = "doctor", required = false) String doctor) throws Exception {
        BaseDoctorDO baseDoctorDO=baseDoctorInfoService.popularityIncrease(doctor);
        return  success("操作成功",baseDoctorDO);
    }
    @ApiOperation("查询赠送锦旗")
    @PostMapping(value= BaseHospitalRequestMapping.DoctorBanner.getBanner)
    public Envelop getBanners(@ApiParam(name = "doctor", value = "doctor", required = false)
                              @RequestParam(value = "doctor", required = false)String doctor){
        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));
    }
}
}