Browse Source

定时发送消息 和反馈意见

wangjun 4 years ago
parent
commit
91c1bd5118
19 changed files with 602 additions and 116 deletions
  1. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java
  2. 3 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionExpressageDao.java
  3. 5 13
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  4. 14 6
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  5. 47 30
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  6. 10 0
      business/base-service/src/main/java/com/yihu/jw/hospital/suggest/dao/BaseSuggestionDao.java
  7. 16 0
      business/base-service/src/main/java/com/yihu/jw/hospital/suggest/dao/BaseSuggestionDictDao.java
  8. 163 0
      business/base-service/src/main/java/com/yihu/jw/hospital/suggest/service/BaseSuggestionDictService.java
  9. 11 0
      business/base-service/src/main/java/com/yihu/jw/hospital/suggest/service/BaseSuggestionService.java
  10. 16 16
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  11. 30 30
      business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java
  12. 7 7
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj02DO.java
  13. 109 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/suggest/BaseSuggestionDO.java
  14. 84 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/suggest/BaseSuggestionDictDO.java
  15. 5 5
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java
  16. 45 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/OutPatientRemindJob.java
  17. 20 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  18. 2 1
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  19. 13 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -40,5 +40,7 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("select count(id) from  WlyyOutpatientDO a where a.outpatientType = ?1 and a.doctor = ?2 and a.admDate >=?3 and a.admDate <=?4")
    Integer countByTime(String type,String doctor,Date startTime,Date endTime);
    @Query("from WlyyOutpatientDO a where a.status = 0 ")
    List<WlyyOutpatientDO> findWaitingOutpatient();
}

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

@ -23,4 +23,7 @@ public interface PrescriptionExpressageDao extends PagingAndSortingRepository<Wl
    @Modifying
    @Query("update WlyyPrescriptionExpressageDO p set p.mailno=?2  where p.id=?1")
    void updateMailNoById(String id, String mailno);
    @Query("from WlyyPrescriptionExpressageDO p where p.outpatientId=?1 and p.oneselfPickupFlg = 1 order by p.createTime desc")
    List<WlyyPrescriptionExpressageDO> findByOutpatientIdAndOneSelfPick(String outpatientId);
}

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

@ -826,6 +826,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //2.物流信息
        WlyyPrescriptionExpressageDO expressageDO = objectMapper.readValue(expressageJson, WlyyPrescriptionExpressageDO.class);
        if (0==expressageDO.getOneselfPickupFlg()){
            /*if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
                expressageDO.setHospitalCode(drugCode);
            }*/
            System.out.println("进入物流信息");
            expressageDO.setDel(1);
            expressageDO.setCreateTime(new Date());
@ -2136,28 +2140,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if (StringUtils.isNotBlank(inspectionJson)) {
                List<WlyyInspectionDO> inspections = (List<WlyyInspectionDO>) com.alibaba.fastjson.JSONArray.parseArray(inspectionJson, WlyyInspectionDO.class);
                List<YkEmrJcsqDO> surveys = new ArrayList<>();
                for (WlyyInspectionDO ins : inspections) {
                    YkEmrJcsqDO ykEmrJcsqDO =new YkEmrJcsqDO();
                    ins.setDel(1);
                    ins.setCreateTime(new Date());
                    ins.setPrescriptionId(prescription.getId());
                    ins.setOutpatientId(outPatientId);
                    ykEmrJcsqDO.setJzhm(outPatientId);
                    ykEmrJcsqDO.setJzxh(Integer.valueOf(outpatientDO.getAdmNo()));
                    ykEmrJcsqDO.setXmid(Integer.valueOf(ins.getCode()));
                    ykEmrJcsqDO.setJcxm(ins.getName());
                    ykEmrJcsqDO.setXmdj(Integer.valueOf(ins.getChargeAmount()));
                    ykEmrJcsqDO.setSqsl(Integer.valueOf(ins.getQuantity()));
                    ykEmrJcsqDO.setJclx(Integer.valueOf(ins.getCheckPart()));
                    ykEmrJcsqDO.setXmdw(ins.getTotalUnit());
                    surveys.add(ykEmrJcsqDO);
                }
                //保存检查检验。
                wlyyInspectionDao.save(inspections);
                //同步his
                ykyyEntranceService.outPatientOrder(surveys,false,doctorMappingDO.getDoctor(),outpatientDO.getPatient());
                //计算检查检验费用
                prescription.setInspectFee(getInsFee(inspections));

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

@ -35,6 +35,7 @@ import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -106,14 +107,14 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     * @return
     * @throws Exception
     */
    public  List<WlyyOutpatientVO> findOutpatientList(String patient, String startTime, String endTime, boolean demoFlag)throws Exception{
    public  List<WlyyOutpatientVO> findOutpatientList(String patient, String startTime, String endTime, boolean demoFlag,String ksdm)throws Exception{
        logger.info("findOutpatientList patient:"+patient);
        String patNo =patientMappingService.findYkyyPatNoByPatient(patient,demoFlag);
        if(StringUtils.isBlank(patNo)){
            return null;
        }
        logger.info("findOutpatientList patNo "+patNo);
        return ykyyEntranceService.BS30025(patNo,null,startTime,endTime,demoFlag);
        return ykyyEntranceService.BS30025(patNo,null,startTime,endTime,demoFlag,ksdm);
    }
@ -136,14 +137,14 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     * @return
     * @throws Exception
     */
    public  WlyyOutpatientVO findOutpatientInfo(String patient,String conNo, boolean demoFlag)throws Exception{
    public  WlyyOutpatientVO findOutpatientInfo(String patient,String conNo, boolean demoFlag,String ksdm)throws Exception{
        logger.info("findOutpatientList patient:"+patient);
        String patNo =patientMappingService.findYkyyPatNoByPatient(patient,demoFlag);
        if(StringUtils.isBlank(patNo)){
            return null;
        }
        logger.info("findOutpatientList patNo "+patNo);
        List<WlyyOutpatientVO> wlyyOutpatientVOS = ykyyEntranceService.BS30025(patNo,conNo,null,null,demoFlag);
        List<WlyyOutpatientVO> wlyyOutpatientVOS = ykyyEntranceService.BS30025(patNo,conNo,null,null,demoFlag,ksdm);
        if (wlyyOutpatientVOS!=null&&wlyyOutpatientVOS.size()!=0){
            WlyyOutpatientVO outpatientVO = wlyyOutpatientVOS.get(0);
            BasePatientDO patientDO = basePatientDao.findById(patient);
@ -312,7 +313,14 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     `pack_quantity` int(11) DEFAULT NULL COMMENT '包装数量',
     PRIMARY KEY (`id`),
     */
    public JSONArray getDrugDictionary(String chargeCode, String pyKey, String winNo, String groupNo) throws Exception {
    public JSONArray getDrugDictionary(String chargeCode, String pyKey, String winNo, String groupNo,String oupatientId) throws Exception {
        String hisCode = "";
        if (StringUtils.isNotEmpty(oupatientId)){
            List<WlyyPrescriptionExpressageDO> wlyyPrescriptionExpressageDOS = prescriptionExpressageDao.findByOutpatientIdAndOneSelfPick(oupatientId);
            if (wlyyPrescriptionExpressageDOS.size()>0){
                hisCode = wlyyPrescriptionExpressageDOS.get(0).getHospitalCode();
            }
        }
        JSONArray mapList = new JSONArray();
        if (demoFlag){
            JSONObject jsonObject = new JSONObject();
@ -339,7 +347,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            jsonObject.put("py_code","WSSB12ZS");
            mapList.add(jsonObject);
        }else {
            mapList = ykyyEntranceService.findYkYpxx(chargeCode, null, null, pyKey,groupNo);
            mapList = ykyyEntranceService.findYkYpxx(chargeCode, null, null, pyKey,hisCode);
        }
        JSONArray array = new JSONArray();
        for (int i=0;i<mapList.size();i++){

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

@ -27,10 +27,7 @@ import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.hospital.dict.YkDictIcd10Dao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
@ -46,6 +43,7 @@ import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -134,6 +132,8 @@ public class YkyyEntranceService {
    private DictDoctorDutyDao dictDoctorDutyDao;
    @Autowired
    private BasePatientMedicareCardDao patientMedicareCardDao;
    @Autowired
    private WlyyInspectionDao wlyyInspectionDao;
    @Autowired
    private YkyyService ykyyService;
@ -385,7 +385,7 @@ public class YkyyEntranceService {
     * @return
     * @throws Exception
     */
    public List<WlyyOutpatientVO> BS30025(String PAT_NO, String conNo, String startTime, String endTime, boolean demoFlag) throws Exception {
    public List<WlyyOutpatientVO> BS30025(String PAT_NO, String conNo, String startTime, String endTime, boolean demoFlag,String ksdm) throws Exception {
        String fid = "BS30025";
        logger.info("EntranceService " + fid + " PAT_NO :" + PAT_NO + " conNo:" + conNo + " startTime:" + startTime + " endTime:" + endTime);
@ -434,7 +434,7 @@ public class YkyyEntranceService {
            jsonArray.add(jsonObject);
            jsonArray.add(jsonObject2);
        }else {
            jsonArray = findV_ZKSG_HZCX_HIS(patientMappingDO.getMappingCode(),conNo,startTime,endTime);
            jsonArray = findV_ZKSG_HZCX_HIS(patientMappingDO.getMappingCode(),conNo,startTime,endTime,ksdm);
        }
        //查找眼科数据
        if (jsonArray.size() == 0) {
@ -486,7 +486,7 @@ public class YkyyEntranceService {
                JSONArray array = findV_ZKSG_JCCX(PAT_NO,wlyyOutpatientVO.getAdmNo(),demoFlag);
                for (int j=0;j<array.size();j++){
                    JSONObject object = array.getJSONObject(j);
                    String ksdm = object.getString("ksdm");//科室代码
                    String ksdm1 = object.getString("ksdm");//科室代码
                    String fymc = object.getString("fymc");//费用名称
                    String fydj = object.getString("fydj");//单价
                    String fysl = object.getString("fysl");//数量
@ -496,7 +496,7 @@ public class YkyyEntranceService {
                    WlyyInspectionVO wlyyInspectionVO = new WlyyInspectionVO();
                    wlyyInspectionVO.setName(fymc);
                    wlyyInspectionVO.setDeptName(zxks);
                    wlyyInspectionVO.setDept(ksdm);
                    wlyyInspectionVO.setDept(ksdm1);
                    wlyyInspectionVO.setQuantity(Integer.parseInt(fysl));
                    inspectionVOList.add(wlyyInspectionVO);
                }
@ -556,7 +556,7 @@ public class YkyyEntranceService {
     * HIS就诊患者历史查询
     * @throws Exception
     */
    public JSONArray findV_ZKSG_HZCX_HIS(String brid,String conNo,String startTime,String endTime) throws Exception{
    public JSONArray findV_ZKSG_HZCX_HIS(String brid,String conNo,String startTime,String endTime,String ksdm) throws Exception{
        String sql = "SELECT to_char(h.KSSJ ,'yyyy/MM/dd hh24:mi:ss' ) as KSSJ,h.BRID,h.BRXM,h.SJHM,h.JZKH,h.SFZH,h.BRXZ,h.YSDM,h.KDYS" +
                ",h.KSDM,h.KSMC,h.ZDMC,h.JZXH from V_ZKSG_HZCX_HIS h WHERE h.BRID = "+brid+" ";
        if(!StringUtil.isBlank(conNo)){
@ -567,6 +567,8 @@ public class YkyyEntranceService {
        }
        if(!StringUtil.isBlank(endTime)){
            sql += " and h.KSSJ <= to_date('"+endTime+"', 'YYYY-MM-DD HH24:MI:SS')";
        }if(!StringUtil.isBlank(ksdm)){
            sql += " and h.KSDM = " + ksdm;
        }
        sql += " order by h.KSSJ desc";
@ -1636,13 +1638,47 @@ public class YkyyEntranceService {
            synPrescriptionDiagnosis(prescriptionVO,code,demoFlag);
            prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
            List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(code,1);
            synPrecriptionHis(prescriptionVO,code);
            //同步检查检验
           /* synInspect(inspectionDOS);*/
        }
        return wlyyPrescriptionDOs.toString();
    }
    //同步检查检验
    public void  synInspect(List<WlyyInspectionDO> inspectionDOS) throws Exception {
        List<YkEmrJcsqDO> ykEmrJcsqDOS = new ArrayList<>();
        String doctor = null;
        String patient = null;
        String admNo= null;
        if (inspectionDOS!=null&&inspectionDOS.size()!=0){
            WlyyInspectionDO inspectionDO = inspectionDOS.get(0);
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(inspectionDO.getOutpatientId());
            doctor=outpatientDO.getDoctor();
            patient=outpatientDO.getPatient();
            admNo = outpatientDO.getAdmNo();
        }
        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOS){
            YkEmrJcsqDO ykEmrJcsqDO = new YkEmrJcsqDO();
            ykEmrJcsqDO.setJzhm(wlyyInspectionDO.getOutpatientId());
            ykEmrJcsqDO.setJzxh(Integer.parseInt(admNo));
            ykEmrJcsqDO.setXmid(Integer.valueOf(wlyyInspectionDO.getCode()));
            ykEmrJcsqDO.setJcxm(wlyyInspectionDO.getName());
            ykEmrJcsqDO.setXmdj(Integer.parseInt(wlyyInspectionDO.getChargeAmount()));
            ykEmrJcsqDO.setSqsl(wlyyInspectionDO.getQuantity());
            ykEmrJcsqDO.setJclx(Integer.valueOf(wlyyInspectionDO.getCheckPart()));
            ykEmrJcsqDO.setXmdw(wlyyInspectionDO.getTotalUnit());
            ykEmrJcsqDOS.add(ykEmrJcsqDO);
        }
        //同步his
        logger.info("开始同步检查检验");
        this.outPatientOrder(ykEmrJcsqDOS,false,doctor,patient);
    }
    /**
     * 根据身份证查找his医生
     * @param idcard
@ -2332,16 +2368,11 @@ public class YkyyEntranceService {
    //门诊开单操作
    public String outPatientOrder(List<YkEmrJcsqDO> surveys,Boolean demoFlag,String doctor,String patient) throws Exception{
        DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
        PatientMappingDO patientMappingDO =new PatientMappingDO();
        if (StringUtils.isNotEmpty(doctor)){
        if (StringUtils.isNoneBlank(doctor)){
            doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        }
        if(StringUtils.isNotEmpty(patient)){
            patientMappingDO = patientMappingDao.findByPatient(patient);
        }
        BasePatientDO patientDO = basePatientDao.findById(patient);
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        System.out.println();
        Integer brxb = 0;
        String brxm = "";
        Date csny =null;
@ -2365,10 +2396,6 @@ public class YkyyEntranceService {
            JSONObject json = jsonArray1.getJSONObject(0);
            doctorHis=json.getString("code");
        }
        // 同一个医生同一个病人,一天一条挂号记录。
        JSONArray ja = fingHlwGhmx(patientMappingDO.getMappingCode(),doctorMappingDO.getMappingCode());
        if (surveys!=null){
            for (YkEmrJcsqDO ykEmrJcsqDO:surveys){
                    ykEmrJcsqDO.setBrid(brid);
@ -2461,15 +2488,9 @@ public class YkyyEntranceService {
    public String outPatientOrderYk(String jsonDate,Boolean demoFlag,String doctor,String patient) throws Exception{
        List<YkEmrJcsqDO> surveys = EntityUtils.jsonToList(jsonDate,YkEmrJcsqDO.class);
        DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
        PatientMappingDO patientMappingDO =new PatientMappingDO();
        if (StringUtils.isNotEmpty(doctor)){
            doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        }
        if(StringUtils.isNotEmpty(patient)){
            patientMappingDO = patientMappingDao.findByPatient(patient);
        }
        BasePatientDO patientDO = basePatientDao.findById(patient);
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        Integer brxb = 0;
        String brxm = "";
@ -2494,10 +2515,6 @@ public class YkyyEntranceService {
            JSONObject json = jsonArray1.getJSONObject(0);
            doctorHis=json.getString("code");
        }
        // 同一个医生同一个病人,一天一条挂号记录。
        JSONArray ja = fingHlwGhmx(patientMappingDO.getMappingCode(),doctorMappingDO.getMappingCode());
        if (surveys!=null){
            for (YkEmrJcsqDO ykEmrJcsqDO:surveys){
                ykEmrJcsqDO.setBrid(brid);

+ 10 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/suggest/dao/BaseSuggestionDao.java

@ -0,0 +1,10 @@
package com.yihu.jw.hospital.suggest.dao;
import com.yihu.jw.entity.hospital.message.BaseBannerDO;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseSuggestionDao extends PagingAndSortingRepository<BaseSuggestionDO, String>, JpaSpecificationExecutor<BaseSuggestionDO> {
}

+ 16 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/suggest/dao/BaseSuggestionDictDao.java

@ -0,0 +1,16 @@
package com.yihu.jw.hospital.suggest.dao;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDO;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface BaseSuggestionDictDao extends PagingAndSortingRepository<BaseSuggestionDictDO, String>, JpaSpecificationExecutor<BaseSuggestionDictDO> {
    @Query( value = "select max(t.is_sort) AS \"zuida\" from base_suggestions_dict t",nativeQuery = true)
    Integer getMaxSort();
    @Query( value = "select min(t.is_sort) AS \"zuixiao\" from base_suggestions_dict t",nativeQuery = true)
    Integer getMinSort();
}

+ 163 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/suggest/service/BaseSuggestionDictService.java

@ -0,0 +1,163 @@
package com.yihu.jw.hospital.suggest.service;
import com.yihu.jw.entity.hospital.message.BaseBannerDO;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDO;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDictDO;
import com.yihu.jw.hospital.suggest.dao.BaseSuggestionDictDao;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class BaseSuggestionDictService extends BaseJpaService<BaseSuggestionDictDO, BaseSuggestionDictDao> {
    @Autowired
    private BaseSuggestionDictDao baseSuggestionDictDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    /**
     * 建议类型上移
     * @param
     * @return
     * @throws Exception
     */
    public BaseSuggestionDictDO upSuggestion(String id) throws Exception{
        BaseSuggestionDictDO baseSuggestionDictDO = baseSuggestionDictDao.findOne(id);
        int maxSort = baseSuggestionDictDao.getMaxSort();
        int sort = 0;
        if(null!=baseSuggestionDictDO){
            sort = baseSuggestionDictDO.getIsSort();
        }
        if (maxSort==sort){
            throw new Exception("不能上移");
        }
        String sql = "select t.id AS \"id\" from base_suggestions_dict t where t.is_sort > "+sort+" order by t.is_sort asc ";
        System.out.println(sql);
        List<Map<String,Object>> list=hibenateUtils.createSQLQuery(sql,1,1);
        BaseSuggestionDictDO upPrevious = new BaseSuggestionDictDO();
        if (list.size()>0){
            String prviousBannerId = list.get(0).get("id").toString();
            upPrevious =baseSuggestionDictDao.findOne(prviousBannerId);
        }
        //交换sort值
        baseSuggestionDictDO.setIsSort(upPrevious.getIsSort());
        upPrevious.setIsSort(sort);
        baseSuggestionDictDao.save(baseSuggestionDictDO);
        baseSuggestionDictDao.save(upPrevious);
        return baseSuggestionDictDO;
    }
    /**
     * 建议类型下移
     * @param
     * @return
     * @throws Exception
     */
    public BaseSuggestionDictDO downSuggestion(String id) throws Exception{
        BaseSuggestionDictDO baseSuggestionDictDO = baseSuggestionDictDao.findOne(id);
        int minSort = baseSuggestionDictDao.getMinSort();
        int sort = 0;
        if(null!=baseSuggestionDictDO){
            sort = baseSuggestionDictDO.getIsSort();
        }
        if (minSort==sort){
            throw new Exception("不能下移");
        }
        String sql = " select id AS \"id\" from base_suggestions_dict where is_sort < "+sort+" order by is_sort desc ";
        List<Map<String,Object>> list=hibenateUtils.createSQLQuery(sql,1,1);
        BaseSuggestionDictDO downPrevious = new BaseSuggestionDictDO();
        if (list.size()>0){
            String prviousId = list.get(0).get("id").toString();
            downPrevious =baseSuggestionDictDao.findOne(prviousId);
        }
        //交换sort值
        baseSuggestionDictDO.setIsSort(downPrevious.getIsSort());
        downPrevious.setIsSort(sort);
        baseSuggestionDictDao.save(baseSuggestionDictDO);
        baseSuggestionDictDao.save(downPrevious);
        return baseSuggestionDictDO;
    }
    /**
     * 建议类型新增
     * @param
     * @return
     * @throws Exception
     */
    public BaseSuggestionDictDO createSuggestionType(BaseSuggestionDictDO baseSuggestionDictDO){
        String sql = "select max(is_sort) as \"isSort\" from base_suggestions_dict";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        Map<String,Object> map = list.get(0);
        int sort = 0;
        if (null!=map.get("isSort")){
            if(null!=map){
                sort = Integer.valueOf(map.get("isSort").toString());
            }
        }
        baseSuggestionDictDO.setIsSort(sort+1);
        baseSuggestionDictDO.setUpdateTime(new Date());
        baseSuggestionDictDO.setCreateTime(new Date());
        BaseSuggestionDictDO result =  baseSuggestionDictDao.save(baseSuggestionDictDO);
        return result;
    }
    /**
     * 更新
     * @param
     * @return
     * @throws Exception
     */
    public BaseSuggestionDictDO updateSuggest(String id,String suggestName,String suggestDes,String isDel,String updateUser,String updateUserName){
        BaseSuggestionDictDO baseSuggestionDictDO = baseSuggestionDictDao.findOne(id);
        if (null == baseSuggestionDictDO){
            return null;
        }
        if (!StringUtil.isEmpty(suggestName)){
            baseSuggestionDictDO.setSuggestName(suggestName);
            baseSuggestionDictDO.setUpdateTime(new Date());
        }
        if (!StringUtil.isEmpty(suggestDes)){
            baseSuggestionDictDO.setSuggestDescribe(suggestDes);
        }
        if (!StringUtil.isEmpty(updateUser)){
            baseSuggestionDictDO.setUpdateUser(updateUser);
        }
        if (!StringUtil.isEmpty(updateUserName)){
            baseSuggestionDictDO.setUpdateUser(updateUserName);
        }
        if (!StringUtil.isEmpty(isDel)){
            baseSuggestionDictDO.setIsDel(Integer.valueOf(isDel));
        }
        baseSuggestionDictDao.save(baseSuggestionDictDO);
        return baseSuggestionDictDO;
    }
    /**
     * 删除
     * @param
     * @return
     * @throws Exception
     */
    public Boolean deleteSuggest(String id){
        BaseSuggestionDictDO baseSuggestionDictDO = baseSuggestionDictDao.findOne(id);
        if (null == baseSuggestionDictDO){
            return false;
        }
        baseSuggestionDictDao.delete(id);
        return true;
    }
    /*
    *   根据建议名称 或者描述查询
    *
     */
    public List<Map<String,Object>> findByNameAndDes(String name,String des){
        String sql = "select t.id as\"id\",t.suggest_name as\"suggestName\",t.suggest_describe as\"suggestDescribe\"," +
                "t.is_del as\"isDel\",t.is_sort as\"isSort\",t.create_time as\"createTime\"" +
                " from base_suggestions_dict t where 1=1";
        List<Map<String,Object>> list= hibenateUtils.createSQLQuery(sql);
        return list;
    }
}

+ 11 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/suggest/service/BaseSuggestionService.java

@ -0,0 +1,11 @@
package com.yihu.jw.hospital.suggest.service;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDO;
import com.yihu.jw.hospital.suggest.dao.BaseSuggestionDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
@Service
public class BaseSuggestionService extends BaseJpaService<BaseSuggestionDO, BaseSuggestionDao> {
}

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

@ -122,13 +122,13 @@ public class StatisticsEsService {
        object.put("prescriptionRate",prescriptionRate);//开方率
        String startTime = DateUtil.getStringDateShort()+" 00:00:00";
        String endTime = DateUtil.getStringDateShort() +" 23:59:59";
        String sql = "select count(*) as total from base.wlyy_consult_oupatient_info o where  o.create_time >='"+startTime+"' and o.create_time <='"+endTime+"'";
        String sql = "select count(*) as \"total\" from base.wlyy_consult_oupatient_info o where  o.create_time >='"+startTime+"' and o.create_time <='"+endTime+"'";
        if (level==4){
            sql += " and o.doctor IN (SELECT doctor_code FROM `base_doctor_hospital` dh where dh.org_code ='"+area+"' and dh.del=1)";
            sql += " and o.doctor IN (SELECT doctor_code as \"doctor_code\" FROM `base_doctor_hospital` dh where dh.org_code ='"+area+"' and dh.del=1)";
        }if (level==2){
            sql += " AND 1=1 ";
        }else if (level==5){
            sql += " and o.doctor IN (SELECT doctor_code FROM `base_doctor_hospital` dh where dh.dept_code ='"+area+"' and dh.del=1)";
            sql += " and o.doctor IN (SELECT doctor_code as \"doctor_code\" FROM `base_doctor_hospital` dh where dh.dept_code ='"+area+"' and dh.del=1)";
        }else if (level==6){
            sql +=" and o.doctor='"+area+"'";
        }
@ -911,10 +911,10 @@ public class StatisticsEsService {
        String sql = null;
        JSONObject object1= new JSONObject();
        if (flag==1){
            sql="SELECT dhd.CODE AS dept_code, dhd. NAME AS dept_name, CASE WHEN c. COUNT IS NOT NULL THEN " +
                    "c. COUNT ELSE 0 END AS COUNT FROM DICT_HOSPITAL_DEPT dhd " +
                    "LEFT JOIN ( SELECT dh.DEPT_CODE, hd. NAME AS dept_name, " +
                    "COUNT(dh.DOCTOR_CODE) AS COUNT FROM BASE_DOCTOR bd " +
            sql="SELECT dhd.CODE AS \"dept_code\", dhd. NAME AS \"dept_name\", CASE WHEN c. COUNT IS NOT NULL THEN " +
                    "c. COUNT ELSE 0 END AS \"COUNT\" FROM DICT_HOSPITAL_DEPT dhd " +
                    "LEFT JOIN ( SELECT dh.DEPT_CODE as\"DEPT_CODE\", hd. NAME AS \"dept_name\", " +
                    "COUNT(dh.DOCTOR_CODE) AS \"COUNT\" FROM BASE_DOCTOR bd " +
                    "LEFT JOIN BASE_DOCTOR_HOSPITAL dh ON bd. ID = dh.DOCTOR_CODE " +
                    "RIGHT JOIN DICT_HOSPITAL_DEPT hd ON hd.CODE = dh.DEPT_CODE " +
                    "WHERE bd.DEL = 1 AND bd.job_title_code IN('1201','1301','1401','1101','066','067','061','1310','061','065')  AND  bd.OUTPATIENT_TYPE IS NOT NULL GROUP BY dh.DEPT_CODE, hd. NAME " +
@ -947,7 +947,7 @@ public class StatisticsEsService {
        }else if (flag ==2) {
            List<SaveModel> saveModels = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null, "6");
            String deptSql = "select hd.CODE,hd.NAME from DICT_HOSPITAL_DEPT hd where hd.ORG_CODE ='" + area + "' and CONSULT_DEPT_FLAG=1";
            String deptSql = "select hd.CODE as \"CODE\",hd.NAME as \"NAME\" from DICT_HOSPITAL_DEPT hd where hd.ORG_CODE ='" + area + "' and CONSULT_DEPT_FLAG=1";
            List<Map<String, Object>> mapList = jdbcTemplate.queryForList(deptSql);
            List<JSONObject> result = new ArrayList<>();
            for (SaveModel saveModel : saveModels) {
@ -1016,11 +1016,11 @@ public class StatisticsEsService {
    public JSONObject getDoctorTotal(String startDate, String endDate, String area, int level, String index, String level2_type,Integer flag) throws Exception {
        JSONObject object = new JSONObject();
        if (flag==1){
            String sql = "SELECT bd.JOB_TITLE_CODE, bd.JOB_TITLE_NAME, COUNT(bd.ID) as count FROM " +
            String sql = "SELECT bd.JOB_TITLE_CODE as \"JOB_TITLE_CODE\", bd.JOB_TITLE_NAME as \"JOB_TITLE_NAME\", COUNT(bd.ID) as \"count\" FROM " +
                    "BASE_DOCTOR bd, BASE_DOCTOR_HOSPITAL bdh,DICT_HOSPITAL_DEPT dhd  WHERE bd.ID = bdh.DOCTOR_CODE AND dhd.code = bdh.DEPT_CODE AND bd.DEL = 1 " +
                    " AND bdh.DEL = 1 AND bd.OUTPATIENT_TYPE IS NOT NULL AND bd.job_title_code IN('1201','1301','1401','1101','066','067','061','1310','061','065') " ;
            String sqlCount = "SELECT COUNT(bd.ID) as total FROM " +
            String sqlCount = "SELECT COUNT(bd.ID) as \"total\" FROM " +
                    "BASE_DOCTOR bd, BASE_DOCTOR_HOSPITAL bdh,DICT_HOSPITAL_DEPT dhd WHERE bd.ID = bdh.DOCTOR_CODE AND dhd.code = bdh.DEPT_CODE AND bd.DEL = 1 " +
                    " AND bdh.DEL = 1 AND bd.OUTPATIENT_TYPE IS NOT NULL AND dhd.CONSULT_DEPT_FLAG='1' AND bd.job_title_code IN('1201','1301','1401','1101','066','067','061','1310','061','065') ";
@ -1058,7 +1058,7 @@ public class StatisticsEsService {
                buffer.deleteCharAt(buffer.length()-1);
            }
            if (buffer.length()>0){
                String sql ="SELECT bd.JOB_TITLE_CODE, bd.JOB_TITLE_NAME,COUNT(bd.ID) AS total FROM BASE_DOCTOR bd WHERE  bd.DEL = 1";
                String sql ="SELECT bd.JOB_TITLE_CODE as \"JOB_TITLE_CODE\", bd.JOB_TITLE_NAME as \"JOB_TITLE_NAME\" ,COUNT(bd.ID) AS \"total\" FROM BASE_DOCTOR bd WHERE  bd.DEL = 1";
                sql +="  AND bd.ID IN("+buffer+")";
                sql +="  GROUP BY bd.JOB_TITLE_CODE,bd.JOB_TITLE_NAME";
                List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);//各职称人数
@ -1076,8 +1076,8 @@ public class StatisticsEsService {
    public JSONObject getDoctorStatisticsExcel(String startDate, String endDate, String area, int level, String index, String level2_type,Integer flag) throws Exception {
        JSONObject object = new JSONObject();
        if (flag==1){//开通医生
            String sql ="SELECT bd.ID, bd.NAME, bd.OUTPATIENT_TYPE, " +
                    "dhd.code AS dept_code, dhd.name AS dept_name,bd.JOB_TITLE_NAME  FROM " +
            String sql ="SELECT bd.ID as\"ID\", bd.NAME as\"NAME\", bd.OUTPATIENT_TYPE as\"OUTPATIENT_TYPE\", " +
                    "dhd.code AS \"dept_code\", dhd.name AS \"dept_name\",bd.JOB_TITLE_NAME as\"JOB_TITLE_NAME\" FROM " +
                    "BASE_DOCTOR bd, BASE_DOCTOR_HOSPITAL bdh, " +
                    "DICT_HOSPITAL_DEPT dhd WHERE bd.ID = bdh.DOCTOR_CODE " +
                    "AND dhd.code = bdh.DEPT_CODE " +
@ -1085,7 +1085,7 @@ public class StatisticsEsService {
                    "AND bdh.DEL = 1 " +
                    "AND bd.OUTPATIENT_TYPE IS NOT NULL " +
                    " AND dhd.CONSULT_DEPT_FLAG='1' AND bd.job_title_code IN('1201','1301','1401','1101','066','067','061','1310','061','065')";
            String deptSql = "select hd.CODE,hd.NAME from DICT_HOSPITAL_DEPT hd where CONSULT_DEPT_FLAG=1";
            String deptSql = "select hd.CODE as \"CODE\",hd.NAME as \"NAME\" from DICT_HOSPITAL_DEPT hd where CONSULT_DEPT_FLAG=1";
            if (level==4){//科室
                sql+=" AND dhd.ORG_CODE = '"+area+"'";
                deptSql+=" AND hd.ORG_CODE ='" + area + "'";
@ -1181,7 +1181,7 @@ public class StatisticsEsService {
            //专科
            List<SaveModel> specialistModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level,index, SaveModel.timeLevel_ZL,"1",null, "6");
            String deptSql = "select hd.CODE,hd.NAME from DICT_HOSPITAL_DEPT hd where CONSULT_DEPT_FLAG=1";
            String deptSql = "select hd.CODE as \"CODE\",hd.NAME as \"NAME\" from DICT_HOSPITAL_DEPT hd where CONSULT_DEPT_FLAG=1";
            if (level==4){//科室
                deptSql+=" AND hd.ORG_CODE ='" + area + "'";
            }else if (level==5){//医生
@ -2536,7 +2536,7 @@ public class StatisticsEsService {
        }else if (SaveModel.doctorLevel.equalsIgnoreCase(level.toString())){
            condition +=" and dh.doctor_code = '"+area+"'";
        }
        String sql = "SELECT COUNT(*) total FROM `base_doctor_role` dr LEFT JOIN base_doctor_hospital dh ON dr.doctor_code = dh.doctor_code where dr.role_code='specialist' "+condition;
        String sql = "SELECT COUNT(*) as \"total\" FROM `base_doctor_role` dr LEFT JOIN base_doctor_hospital dh ON dr.doctor_code = dh.doctor_code where dr.role_code='specialist' "+condition;
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
        Long doctorCount = 0L;
        if (mapList!=null&&mapList.size()!=0){

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

@ -318,16 +318,16 @@ public class ElasticsearchUtil {
            low_level = lowLevel;
        }
        if (SaveModel.doctorLevel.equals(low_level)) {
            sql.append("select doctor,doctorName,sum(result1) result1, sum(result2) result2 from " + esIndex + " where ");
            sql.append("select doctor as \"doctor\",doctorName as \"doctorName\",sum(result1) as \"result1\", sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by doctor,doctorName");
        }else if (SaveModel.deptLevel.equals(low_level)) {
            sql.append("select dept,deptName,sum(result1) result1, sum(result2) result2 from " + esIndex + " where ");
            sql.append("select dept as \"dept\",deptName as \"deptName\",sum(result1) as \"result1\", sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by dept,deptName");
        } else if (SaveModel.OrgLevel.equals(low_level)) {
            sql.append("select hospital,hospitalName,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
            sql.append("select hospital as \"hospital\" ,hospitalName as \"hospitalName\",sum(result1) as \"result1\",sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by hospital,hospitalName");
        } else if (SaveModel.townLevel.equals(low_level)) {
            sql.append("select town,townName,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
            sql.append("select town as \"town\",townName as\"townName\",sum(result1) as \"result1\",sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by town,townName");
        } else if (SaveModel.cityLevel.equals(low_level)) {
            sql.append("select city,cityName,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
@ -417,19 +417,19 @@ public class ElasticsearchUtil {
            low_level = lowLevel;
        }
        if (SaveModel.doctorLevel.equals(low_level)) {
            sql.append("select doctor,doctorName,count(doctor) result1, count(doctor) result2 from " + esIndex + " where ");
            sql.append("select doctor as \"doctor\",doctorName as \"doctorName\",count(doctor) as \"result1\", count(doctor) as \"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 ");
            sql.append("select dept as \"dept\",deptName as \"deptName\",count(DISTINCT doctor) as \"result1\", count(DISTINCT doctor) as \"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 ");
            sql.append("select hospital as \"hospital\",hospitalName as \"hospitalName\",count(DISTINCT doctor) as \"result1\",count(DISTINCT doctor) as \"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 ");
            sql.append("select town as \"town\",townName as \"townName\",count(DISTINCT doctor) as \"result1\",count(DISTINCT doctor) as \"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 ");
            sql.append("select city as \"city\",cityName as \"cityName\",count(DISTINCT doctor) as \"result1\",count(DISTINCT doctor) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by ");
        }
@ -519,19 +519,19 @@ public class ElasticsearchUtil {
            low_level = lowLevel;
        }
        if (SaveModel.doctorLevel.equals(low_level)) {
            sql.append("select doctor,doctorName,count(doctor) result1, count(doctor) result2 from " + esIndex + " where ");
            sql.append("select doctor as \"doctor\",doctorName as \"doctor\",count(doctor) as \"result1\", count(doctor) as \"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 ");
            sql.append("select dept as \"dept\",deptName as \"deptName\",count(DISTINCT doctor) as \"result1\", count(DISTINCT doctor) as \"result2\" from " + esIndex + " where ");
            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 ");
            sql.append("select hospital as \"hospital\",hospitalName as \"hospitalName\",count(DISTINCT doctor) as \"result1\",count(DISTINCT doctor) as \"result2\" from " + esIndex + " where ");
            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 ");
            sql.append("select town as \"town\",townName as \"townName\",count(DISTINCT doctor) as \"result1\",count(DISTINCT doctor) as \"result2\" from " + esIndex + " where ");
            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 ");
            sql.append("select city as \"city\",cityName as \"cityName\",count(DISTINCT doctor) as \"result1\",count(DISTINCT doctor) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by city");
        }
@ -620,32 +620,32 @@ public class ElasticsearchUtil {
            low_level = lowLevel;
        }
        if (SaveModel.doctorLevel.equals(low_level)) {
            sql.append("select doctor,doctorName,slaveKey1,slaveKey1Name,sum(result1) result1, sum(result2) result2,quotaDate from " + esIndex + " where ");
            sql.append("select doctor as \"doctor\",doctorName as \"doctorName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",sum(result1) as \"result1\", sum(result2) as \"result2\",quotaDate as \"quotaDate\" from " + esIndex + " where ");
            groupBy.append("  group by doctor,doctorName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1)&&!slaveKey1.contains(",")&&(!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1))) {
                groupBy.append(",slaveKey1,slaveKey1Name");
            }
        }
        if (SaveModel.deptLevel.equals(low_level)) {
            sql.append("select dept,deptName,slaveKey1,slaveKey1Name,sum(result1) result1, sum(result2) result2,quotaDate from " + esIndex + " where ");
            sql.append("select dept as \"dept\",deptName as \"deptName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",sum(result1) result1 as \"result1\", sum(result2) as \"result2\",quotaDate as \"quotaDate\" from " + esIndex + " where ");
            groupBy.append("  group by dept,deptName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1)&&!slaveKey1.contains(",")&&(!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1))) {
                groupBy.append(",slaveKey1,slaveKey1Name");
            }
        } else if (SaveModel.OrgLevel.equals(low_level)) {
            sql.append("select hospital,hospitalName,slaveKey1,slaveKey1Name,sum(result1) result1,sum(result2) result2,quotaDate from " + esIndex + " where ");
            sql.append("select hospital as \"hospital\",hospitalName as \"hospitalName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",sum(result1)  as \"result1\",sum(result2) as \"result2\",quotaDate as \"quotaDate\" from " + esIndex + " where ");
            groupBy.append("  group by hospital,hospitalName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1)&&!slaveKey1.contains(",")&&(!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1))) {
                groupBy.append(",slaveKey1,slaveKey1Name");
            }
        } else if (SaveModel.townLevel.equals(low_level)) {
            sql.append("select town,townName,slaveKey1,slaveKey1Name,sum(result1) result1,sum(result2) result2,quotaDate from " + esIndex + " where ");
            sql.append("select town as \"town\",townName as \"townName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",sum(result1) as \"result1\",sum(result2) as \"result2\",quotaDate as \"quotaDate\" from " + esIndex + " where ");
            groupBy.append("  group by town,townName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1)&&!slaveKey1.contains(",")&&(!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1))) {
                groupBy.append(",slaveKey1,slaveKey1Name");
            }
        } else if (SaveModel.cityLevel.equals(low_level)) {
            sql.append("select city,cityName,slaveKey1,slaveKey1Name,sum(result1) result1,sum(result2) result2,quotaDate from " + esIndex + " where ");
            sql.append("select city as \"city\",cityName as \"cityName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",sum(result1) as \"result1\",sum(result2) as \"result2\",quotaDate as \"quotaDate\" from " + esIndex + " where ");
            groupBy.append("  group by city,cityName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1)&&!slaveKey1.contains(",")&&(!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1))) {
                groupBy.append(",slaveKey1,slaveKey1Name");
@ -741,7 +741,7 @@ public class ElasticsearchUtil {
            low_level = lowLevel;
        }
        if (SaveModel.doctorLevel.equals(low_level)) {
            sql.append("select doctor,doctorName,slaveKey1,slaveKey1Name,slaveKey2,slaveKey2Name,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
            sql.append("select doctor as\"doctor\",doctorName as\"doctorName\",slaveKey1 as\"slaveKey1\",slaveKey1Name as\"slaveKey1Name\",slaveKey2 as\"slaveKey2\",slaveKey2Name as\"slaveKey2Name\",sum(result1) as \"result1\",sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by doctor,doctorName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1)) {
                groupBy.append(",slaveKey1,slaveKey1Name");
@ -750,7 +750,7 @@ public class ElasticsearchUtil {
                groupBy.append(",slaveKey2,slaveKey2Name");
            }
        }else if (SaveModel.deptLevel.equals(low_level)) {
            sql.append("select dept,deptName,slaveKey1,slaveKey1Name,slaveKey2,slaveKey2Name,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
            sql.append("select dept as \"dept\",deptName as \"deptName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",slaveKey2 as \"slaveKey2\",slaveKey2Name as \"slaveKey2Name\",sum(result1) as \"result1\",sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by dept,deptName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1)) {
                groupBy.append(",slaveKey1,slaveKey1Name");
@ -759,7 +759,7 @@ public class ElasticsearchUtil {
                groupBy.append(",slaveKey2,slaveKey2Name");
            }
        } else if (SaveModel.OrgLevel.equals(low_level)) {
            sql.append("select hospital,hospitalName,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
            sql.append("select hospital as \"hospital\",hospitalName as \"hospitalName\",sum(result1) as \"result1\",sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by hospital,hospitalName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1)) {
                groupBy.append(",slaveKey1,slaveKey1Name");
@ -768,7 +768,7 @@ public class ElasticsearchUtil {
                groupBy.append(",slaveKey2,slaveKey2Name");
            }
        } else if (SaveModel.townLevel.equals(low_level)) {
            sql.append("select town,townName,slaveKey1,slaveKey1Name,slaveKey2,slaveKey2Name,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
            sql.append("select town as \"town\",townName as \"townName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",slaveKey2 as \"slaveKey2\",slaveKey2Name as \"slaveKey2Name\",sum(result1) as \"result1\",sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by town,townName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1)) {
                groupBy.append(",slaveKey1,slaveKey1Name");
@ -777,7 +777,7 @@ public class ElasticsearchUtil {
                groupBy.append(",slaveKey2,slaveKey2Name");
            }
        } else if (SaveModel.cityLevel.equals(low_level)) {
            sql.append("select city,cityName,slaveKey1,slaveKey1Name,slaveKey2,slaveKey2Name,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
            sql.append("select city as \"city\",cityName as \"cityName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",slaveKey2 as \"result1\",slaveKey2Name as \"result1\",sum(result1) as \"result1\",sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by city,cityName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1)) {
                groupBy.append(",slaveKey1,slaveKey1Name");
@ -922,19 +922,19 @@ public class ElasticsearchUtil {
            low_level = lowLevel;
        }
        if (SaveModel.doctorLevel.equals(low_level)) {
            sql.append("select doctor,doctorName,slaveKey1,slaveKey1Name,sum(result1) result1, sum(result2) result2 from " + esIndex + " where ");
            sql.append("select doctor as \"doctor\",doctorName as \"doctorName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",sum(result1) as \"result1\", sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by doctor,doctorName,slaveKey1,slaveKey1Name");
        }else if (SaveModel.deptLevel.equals(low_level)) {
            sql.append("select dept,deptName,slaveKey1,slaveKey1Name,sum(result1) result1, sum(result2) result2 from " + esIndex + " where ");
            sql.append("select dept as \"dept\",deptName as \"deptName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",sum(result1) as \"result1\", sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by dept,deptName,slaveKey1,slaveKey1Name");
        } else if (SaveModel.OrgLevel.equals(low_level)) {
            sql.append("select hospital,hospitalName,slaveKey1,slaveKey1Name,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
            sql.append("select hospital as \"hospital\",hospitalName as \"hospitalName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",sum(result1) as \"result1\",sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by hospital,hospitalName,slaveKey1,slaveKey1Name");
        } else if (SaveModel.townLevel.equals(low_level)) {
            sql.append("select town,townName,slaveKey1,slaveKey1Name,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
            sql.append("select town as \"town\",townName as \"townName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",sum(result1) as \"result1\",sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by town,townName,slaveKey1,slaveKey1Name");
        } else if (SaveModel.cityLevel.equals(low_level)) {
            sql.append("select city,cityName,slaveKey1,slaveKey1Name,sum(result1) result1,sum(result2) result2 from " + esIndex + " where ");
            sql.append("select city as \"city\",cityName as \"cityName\",slaveKey1 as \"slaveKey1\",slaveKey1Name as \"slaveKey1Name\",sum(result1) as \"result1\",sum(result2) as \"result2\" from " + esIndex + " where ");
            groupBy.append("  group by city,cityName,slaveKey1,slaveKey1Name");
        }
@ -1714,7 +1714,7 @@ public class ElasticsearchUtil {
        }
        StringBuffer sb = new StringBuffer();
        sb.append("select sum(result1) result1,sum(result2) result2 from ").append(esIndex)
        sb.append("select sum(result1) as\" result1\",sum(result2) as \"result2\" from ").append(esIndex)
                .append(" where city='350200' and quotaCode in(").append(index)
                .append(") and timeLevel='1' and areaLevel='6' and quotaDate>='").append(startDate).append("' ");
        sb.append("and quotaDate<='").append(endDate).append("'");

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

@ -13,7 +13,7 @@ public class YkMsYj02DO {
    private Integer yjxh ;//Ms_yi01里的yjxh
    private Integer ylxh;//组套明细里关联VEMR_ORDER_ITEM 里面  ITEM_CODE
    private Integer xmlx;//SELECT XMLX  javax.persistence.criteria.From GY_YLSF Where FYXH =l l_fyxh   查询后结果写入
    private Integer yjxz;//明细第一条是1,其它是0
    private Integer yjzx;//明细第一条是1,其它是0
    private Integer Yldj;//单价  select * from  portal_his.gy_ylsf@YKZXTEST where fyxh = l l_fyxh
    private Integer ylsl;//数量 = 取项目明细 * 医生填的数量  参考截图   fysl
    private Integer hjje;//	合计金额
@ -41,7 +41,7 @@ public class YkMsYj02DO {
        this.yjxh = yjxh;
    }
    @Basic
    @Column(name = "YLX")
    @Column(name = "YLXH")
    public Integer getYlxh() {
        return ylxh;
    }
@ -59,13 +59,13 @@ public class YkMsYj02DO {
        this.xmlx = xmlx;
    }
    @Basic
    @Column(name = "YJXZ")
    public Integer getYjxz() {
        return yjxz;
    @Column(name = "YJZX")
    public Integer getYjzx() {
        return yjzx;
    }
    public void setYjxz(Integer yjxz) {
        this.yjxz = yjxz;
    public void setYjzx(Integer yjzx) {
        this.yjzx = yjzx;
    }
    @Basic
    @Column(name = "YLDJ")

+ 109 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/suggest/BaseSuggestionDO.java

@ -0,0 +1,109 @@
package com.yihu.jw.entity.hospital.suggest;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by wj on 2020/0811.
 */
@Entity
@Table(name = "base_suggestion")
public class BaseSuggestionDO extends UuidIdentityEntityWithOperator {
    /**
     *建议类型id
     */
    @Column(name = "suggest_id")
    private String suggestId;
    /*
     *建议内容
     */
    @Column(name = "suggest_content")
    private String suggestContent;
    /**
     *上传图片地址
     */
    @Column(name = "suggest_img_url")
    private String suggestImgUrl;
    /**
     *填写建议的用户id
     */
    @Column(name = "suggest_user_id")
    private String suggestUserId;
    /**
     * 用户名
     */
    @Column(name = "suggest_user_name")
    private String  suggestUserName;
    /*
     *用户手机号
     */
    @Column(name = "suggest_user_phone")
    private String  suggestUserPhone;
    /*
     *删除标识 1正常 0删除
     */
    @Column(name = "is_del")
    private Integer  isDel;
    public String getSuggestId() {
        return suggestId;
    }
    public void setSuggestId(String suggestId) {
        this.suggestId = suggestId;
    }
    public String getSuggestContent() {
        return suggestContent;
    }
    public void setSuggestContent(String suggestContent) {
        this.suggestContent = suggestContent;
    }
    public String getSuggestImgUrl() {
        return suggestImgUrl;
    }
    public void setSuggestImgUrl(String suggestImgUrl) {
        this.suggestImgUrl = suggestImgUrl;
    }
    public String getSuggestUserId() {
        return suggestUserId;
    }
    public void setSuggestUserId(String suggestUserId) {
        this.suggestUserId = suggestUserId;
    }
    public String getSuggestUserName() {
        return suggestUserName;
    }
    public void setSuggestUserName(String suggestUserName) {
        this.suggestUserName = suggestUserName;
    }
    public String getSuggestUserPhone() {
        return suggestUserPhone;
    }
    public void setSuggestUserPhone(String suggestUserPhone) {
        this.suggestUserPhone = suggestUserPhone;
    }
    public Integer getIsDel() {
        return isDel;
    }
    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }
}

+ 84 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/suggest/BaseSuggestionDictDO.java

@ -0,0 +1,84 @@
package com.yihu.jw.entity.hospital.suggest;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 *
 */
@Entity
@Table(name = "base_suggestions_dict")
public class BaseSuggestionDictDO extends UuidIdentityEntityWithOperator {
    /**
     *版本号
     */
    @Column(name = "saas_id")
    private String saasId;
    /*
     *建议名称
     */
    @Column(name = "suggest_name")
    private String suggestName;
    /**
     *建议描述
     */
    @Column(name = "suggest_describe")
    private String suggestDescribe;
    /**
     *是否删除 1正常 0删除
     */
    @Column(name = "is_del")
    private Integer isDel;
    /**
     * 排序
     */
    @Column(name = "is_sort")
    private Integer  isSort;
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getSuggestName() {
        return suggestName;
    }
    public void setSuggestName(String suggestName) {
        this.suggestName = suggestName;
    }
    public String getSuggestDescribe() {
        return suggestDescribe;
    }
    public void setSuggestDescribe(String suggestDescribe) {
        this.suggestDescribe = suggestDescribe;
    }
    public Integer getIsDel() {
        return isDel;
    }
    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }
    public Integer getIsSort() {
        return isSort;
    }
    public void setIsSort(Integer isSort) {
        this.isSort = isSort;
    }
}

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

@ -269,7 +269,7 @@ public class YkyyController extends EnvelopRestEndpoint {
                ykEmrJcsqDO.setQxbz(0);
                totalprice +=ykEmrJcsqDO.getXmdj()*ykEmrJcsqDO.getSqsl();
                System.out.println("totalprice"+totalprice);
                String yjxhSql =" select dqz + 1 as \"total\"  from portal_his.gy_identity_emr@ykzxtest where bmc = 'MS_YJ01'";
                String yjxhSql =" select dqz + 1 as \"total\"  from portal_his.gy_identity_ms@ykzxtest where bmc = 'MS_YJ01'";
                List<Map<String,Object>> yjxhList = hibenateUtils.createSQLQuery(yjxhSql);
                Long yjxh = 0L;
                if (yjxhList!=null&&yjxhList.size()!=0){
@ -312,12 +312,12 @@ public class YkyyController extends EnvelopRestEndpoint {
                    int i = 0;
                    //明细可能会有多条
                    for (Map<String,Object> map:sbxlMap){
                        String sbxhSql =" select dqz + 1 as \"total\"  from portal_his.gy_identity_emr@ykzxtest where bmc = 'MS_YJ02'";
                        String sbxhSql =" select dqz + 1 as \"total\"  from portal_his.gy_identity_ms@ykzxtest where bmc = 'MS_YJ02'";
                        List<Map<String,Object>> sbxhList = hibenateUtils.createSQLQuery(sbxhSql);
                        Long sbxh = 0L;
                        if (sbxhList!=null&&sbxhList.size()!=0){
                            sbxh = Long.parseLong(sbxhList.get(0).get("total").toString());
                            System.out.println("yjxh:"+yjxh);
                            System.out.println("sbxh:"+sbxh);
                            String updateyjxh = "update portal_his.gy_identity_ms@ykzxtest set dqz=dqz+1 where bmc = 'MS_YJ02'";
                            hibenateUtils.updateBySql(updateyjxh);
                        }
@ -327,7 +327,7 @@ public class YkyyController extends EnvelopRestEndpoint {
                        ykMsYj02DO.setYlxh(ykEmrJcsqDO.getXmid());
                        Integer sqsl = ykEmrJcsqDO.getSqsl();
                        ykMsYj02DO.setYlsl(Integer.valueOf(map.get("fysl").toString())*sqsl);
                        ykMsYj02DO.setYjxz(i==0?1:0);
                        ykMsYj02DO.setYjzx(i==0?1:0);
                        i++;
                        String fyxhSql ="select t.xmlx as \"xmlx\",t.fydj as \"fydj\",t.fygb as \"fygb\"" +
                                " from portal_his.GY_YLSF@ykzxtest t " +
@ -335,7 +335,7 @@ public class YkyyController extends EnvelopRestEndpoint {
                        List<Map<String,Object>> fyxhList = hibenateUtils.createSQLQuery(fyxhSql);
                        if (fyxhList.size()>0){
                            ykMsYj02DO.setXmlx(Integer.valueOf(fyxhList.get(0).get("XMLX").toString()));
                            ykMsYj02DO.setXmlx(Integer.valueOf(fyxhList.get(0).get("xmlx").toString()));
                            ykMsYj02DO.setFygb(Integer.valueOf(fyxhList.get(0).get("fygb").toString()));
                            ykMsYj02DO.setYldj(Integer.valueOf(fyxhList.get(0).get("fydj").toString()));
                            ykMsYj02DO.setHjje(ykMsYj02DO.getYldj()*ykMsYj02DO.getYlsl());

+ 45 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/OutPatientRemindJob.java

@ -0,0 +1,45 @@
package com.yihu.jw.job;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.util.ImUtil;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
 * Created by Trick on 2020/3/11
 */
public class OutPatientRemindJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(OutPatientRemindJob.class);
    @Autowired
    public ImUtil imUtil;
    @Autowired
    private OutpatientDao outpatientDao;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        List<WlyyOutpatientDO> wlyyOutpatientDOS= outpatientDao.findWaitingOutpatient();
        String senderId ="";
        String reciverId = "";
        String content = "您邀请的医师暂无应答,您可以选择继续等待或者取消邀请。";
        logger.info("---本次要发送的消息数量+"+wlyyOutpatientDOS.size());
        if (null!=wlyyOutpatientDOS){
            for (WlyyOutpatientDO wlyyOutpatientDO:wlyyOutpatientDOS){
                logger.info("--便利发送消息");
                senderId = wlyyOutpatientDO.getPatient();
                logger.info("---发送人id"+senderId);
                reciverId = wlyyOutpatientDO.getDoctor();
                logger.info("---接受人Id"+reciverId);
                imUtil.sendMessage(senderId,reciverId,"1",content);
                logger.info("--发送结束");
            }
        }
    }
}

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

@ -1,6 +1,7 @@
package com.yihu.jw.web.quota;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.job.QuartzJobConfig;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.internet.service.DataGeneratorService;
import com.yihu.jw.internet.service.InternetCommonService;
@ -10,6 +11,7 @@ import com.yihu.jw.job.*;
import com.yihu.jw.job.ykyy.UnSettledHISPrescriptionJob;
import com.yihu.jw.job.ykyy.UpdateStatusByPayTimeJob;
import com.yihu.jw.job.ykyy.YkyyDataUploadJob;
import com.yihu.jw.repository.job.QuartzJobConfigDao;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.service.quota.JobService;
import com.yihu.jw.util.SystemConf;
@ -58,6 +60,8 @@ public class JobController extends BaseController {
    private InternetCommonService internetCommonService;
    @Autowired
    private WxTemplateService wxTemplateService;
    @Autowired
    private QuartzJobConfigDao wlyyJobConfigDao;
    @Autowired
    public JobController(JobService jobService, QuartzHelper quartzHelper) {
@ -186,6 +190,21 @@ public class JobController extends BaseController {
                    } else {
                        logger.info("pay_status_notice_job  job exist");
                    }
                case "out_patient_remind_job":
                    //互联网医院 待结算消息推送
                    if (!quartzHelper.isExistJob("out_patient_remind_job")) {
                        QuartzJobConfig quartzJobConfig = wlyyJobConfigDao.findById("18");
                        String trigger = "";
                        if (quartzJobConfig.getQuartzCron()==null){
                            trigger = SystemConf.getInstance().getSystemProperties().getProperty("out_patient_remind_job");
                        }else {
                            trigger = quartzJobConfig.getQuartzCron();
                        }
                        quartzHelper.addJob(OutPatientRemindJob.class, trigger, "out_patient_remind_job", new HashMap<String, Object>());
                        logger.info("out_patient_remind_job  job success");
                    } else {
                        logger.info("out_patient_remind_job  job exist");
                    }
                    break;
                default :
@ -337,7 +356,7 @@ public class JobController extends BaseController {
    @ApiOperation("处方状态变更")
    public String PrescriptionStatusUpdateJob() {
        try {
            quartzHelper.startNow(PrescriptionStatusUpdateJob.class, UUID.randomUUID().toString(), null);
                quartzHelper.startNow(PrescriptionStatusUpdateJob.class, UUID.randomUUID().toString(), null);
            return write(200, "启动成功");
        } catch (Exception e) {
            error(e);

+ 2 - 1
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -7,7 +7,8 @@ prescription_overdue_job=0 0 1 * * ?
#每天13 点触发
data_upload_job=0 0 2 * * ?
#每10分钟触发一次
out_patient_remind_job = 0 0/10 * * * ? 
#-------------------------中山医院end-----------------------------#
#-------------------------眼科医院-----------------------------#
data_ykupload_job=0 0 0 * * ?

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

@ -99,8 +99,10 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @ApiParam(name = "startTime", value = "开始时间")
                                          @RequestParam(value = "startTime",required = false) String startTime,
                                          @ApiParam(name = "endTime", value = "结束时间")
                                          @RequestParam(value = "endTime",required = false) String endTime) throws Exception {
        List<WlyyOutpatientVO> vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag);
                                          @RequestParam(value = "endTime",required = false) String endTime,
                                          @ApiParam(name = "ksdm", value = "科室代码")
                                              @RequestParam(value = "ksdm",required = false) String ksdm) throws Exception {
        List<WlyyOutpatientVO> vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag,ksdm);
        return success(vos);
    }
@ -109,8 +111,10 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop findOutpatientInfo(@ApiParam(name = "patient", value = "居民id")
                                         @RequestParam(value = "patient",required = false) String patient,
                                         @ApiParam(name = "conNo", value = "就诊次数")
                                         @RequestParam(value = "conNo",required = false) String conNo)throws Exception{
        WlyyOutpatientVO obj = prescriptionService.findOutpatientInfo(patient,conNo,demoFlag);
                                         @RequestParam(value = "conNo",required = false) String conNo,
                                         @ApiParam(name = "ksdm", value = "科室编号")
                                             @RequestParam(value = "ksdm",required = false) String ksdm)throws Exception{
        WlyyOutpatientVO obj = prescriptionService.findOutpatientInfo(patient,conNo,demoFlag,ksdm);
        return success(obj);
    }
@ -165,9 +169,11 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "pyKey", required = false)String pyKey,
                                         @ApiParam(name = "winNo", value = "分部编码")
                                         @RequestParam(value = "winNo", required = false)String winNo,
                                         @ApiParam(name = "groupNo", value = "药房编码")
                                         @RequestParam(value = "groupNo", required = false)String groupNo)throws Exception {
        return success(prescriptionService.getDrugDictionary(drugNo,pyKey,winNo,groupNo));
                                         @ApiParam(name = "groupNo", value = "分组")
                                         @RequestParam(value = "groupNo", required = false)String groupNo,
                                         @ApiParam(name = "oupatienId", value = "门诊Id")
                                             @RequestParam(value = "oupatienId", required = false)String oupatienId)throws Exception {
        return success(prescriptionService.getDrugDictionary(drugNo,pyKey,winNo,groupNo,oupatienId));
    }