Ver código fonte

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

yeshijie 4 anos atrás
pai
commit
973ff350cd
18 arquivos alterados com 283 adições e 93 exclusões
  1. 3 0
      business/base-service/src/main/java/com/yihu/jw/hospital/drugstore/dao/BaseDrugStoreDao.java
  2. 3 3
      business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseBannerDoctorService.java
  3. 2 1
      business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseUserMsgService.java
  4. 124 47
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java
  5. 6 4
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  6. 38 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  7. 28 13
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  8. 5 5
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  9. 6 4
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  10. 32 5
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  11. 4 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java
  12. 1 1
      svr/svr-internet-hospital-job/src/main/resources/application.yml
  13. 3 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  14. 3 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  15. 6 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/file_upload/FileUploadEndpoint.java
  16. 2 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseDoctorBGController.java
  17. 12 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java
  18. 5 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

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

@ -15,5 +15,8 @@ public interface BaseDrugStoreDao extends PagingAndSortingRepository<BaseDrugSto
    @Query(value = " from  BaseDrugStoreDO  where drugStoreCode =?1 and hospitalCode = ?2 ")
    BaseDrugStoreDO findDrugByNameAndCode(String drugStoreCode,String hospitalCode);
    @Query(value = " from  BaseDrugStoreDO  where id =?1 ")
    BaseDrugStoreDO findDrugByid(String drugStoreCode);
}

+ 3 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseBannerDoctorService.java

@ -273,7 +273,7 @@ public class BaseBannerDoctorService
        List<BaseBannerDoctorDO> baseBannerDoctorDOS = this.baseBannerDoctorDao.getBannersBypatients(patientId, doctor);
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = this.wlyyHospitalSysDictDao.findById("banner_give_timeout");
        if (null != baseBannerDoctorDOS&&baseBannerDoctorDOS.size()>0)
        if (null != baseBannerDoctorDOS&&baseBannerDoctorDOS.size()>0&&baseBannerDoctorDOS.size()>=1)
        {
            BaseBannerDoctorDO lastOne = (BaseBannerDoctorDO)baseBannerDoctorDOS.get(0);
            Date lastDate = lastOne.getCreateTime();
@ -372,9 +372,9 @@ public class BaseBannerDoctorService
    {
        List<BaseUserMessageDO> baseBannerDoctorDOS = this.baseUserMessageDao.getMessageByPatientAndDoctor(reciver, sender);
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = this.wlyyHospitalSysDictDao.findById("leave_message_timeout");
        if (null != baseBannerDoctorDOS)
        if (null != baseBannerDoctorDOS&&baseBannerDoctorDOS.size()>=1)
        {
            BaseUserMessageDO lastOne = (BaseUserMessageDO)baseBannerDoctorDOS.get(0);
            BaseUserMessageDO lastOne = baseBannerDoctorDOS.get(0);
            Date lastDate = lastOne.getCreateTime();
            long timeOut = wlyyHospitalSysDictDO.getDictValue() != null ? Long.valueOf(wlyyHospitalSysDictDO.getDictValue()).longValue() : 5L;
            Date current = new Date();

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

@ -476,7 +476,7 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
{
    List<BaseUserMessageDO> baseBannerDoctorDOS = this.baseUserMessageDao.getMessageByPatientAndDoctor(reciver, sender);
    WlyyHospitalSysDictDO wlyyHospitalSysDictDO = this.wlyyHospitalSysDictDao.findById("leave_message_timeout");
    if (null != baseBannerDoctorDOS)
    if (null != baseBannerDoctorDOS&&baseBannerDoctorDOS.size()>=1)
    {
        BaseUserMessageDO lastOne = (BaseUserMessageDO)baseBannerDoctorDOS.get(0);
        Date lastDate = lastOne.getCreateTime();
@ -526,4 +526,5 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
        }
        return true;
    }
}

+ 124 - 47
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java

@ -99,69 +99,53 @@ public class PayInfoNoticeService {
    }
    //导出es查询数据
    public void exportEsPrescription(OutputStream os, List<Map<String,Object>> list) throws Exception{
    public void exportEsPrescription(OutputStream os, List<Map<String,Object>> totallist,List<Map<String,Object>> listDay) throws Exception{
        WorkbookSettings settings = new WorkbookSettings();
        settings.setWriteAccess(null);
        settings.setEncoding("UTF-8");
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os,settings);
        List<Map<String,Object>> totallist = new ArrayList<>();
        if (null!=list&&list.size()>0){
            totallist =list;
        }
       /* HSSFWorkbook workbook = new HSSFWorkbook();
        HSSFSheet sheet = workbook.createSheet("shee1");
        //headers表示excel表中第一行的表头
        HSSFRow row = sheet.createRow(0);
        //在excel表中添加表头
        String[] header = {"医生姓名", "出诊科室", "接诊数量", "开方数量", "物流数量"};
        for(int i=0;i<header.length;i++){
            HSSFCell cell = row.createCell(i);
            HSSFRichTextString text = new HSSFRichTextString(header[i]);
            cell.setCellValue(text);
        }
        workbook.write(os);
        //接诊 +开方+物流
        List<Map<String,Object>> totallist = new ArrayList<>();
        if (null!=list&&list.size()>0){
            totallist =list;
        }
        int rowNum = 1;
        if (null!=totallist&&totallist.size()>0){
            for (int n=0;n<totallist.size();n++) {
                Map<String,Object> object = totallist.get(n);
                HSSFRow row1 = sheet.createRow(rowNum);
                row1.createCell(0).setCellValue(object.get("doctorName").toString());
                row1.createCell(1).setCellValue(null==object.get("deptName")?"":object.get("deptName").toString());
                row1.createCell(2).setCellValue(null==object.get("pickNum")?"":object.get("pickNum").toString());
                row1.createCell(3).setCellValue(null==object.get("preNum")?"":object.get("preNum").toString());
                row1.createCell(4).setCellValue(null==object.get("wlNum")?"":object.get("wlNum").toString());
                rowNum++;
            }
        }
        workbook.write(os);*/
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet", 1);
            String[] header = {"医生姓名", "出诊科室", "接诊数量", "开方数量", "物流数量"};
            int k = 0;
            WritableSheet ws2 = wwb.createSheet("sheet2", 2);
            String[] header = {"医生姓名", "出诊科室","发起问诊", "接诊数量", "开方数量", "物流数量"};
            String[] header2 = {"时间", "发起问诊", "接诊数量", "开方数量", "物流数量"};
        int k = 0;
        int m =0;
            for (String h : header) {
                addCell(ws, 0, k, h);//表名,行,列,header
                k++;
            }
            for (String h : header2) {
                addCell(ws2, 0, m, h);//表名,行,列,header
                m++;
            }
            int i = 1;
            if (null!=totallist&&totallist.size()>0){
                for (int n=0;n<totallist.size();n++) {
                    Map<String,Object> object = totallist.get(n);
                    addCell(ws, i, 0, object.get("doctorName").toString(), "");
                    addCell(ws, i, 1, null==object.get("deptName")?"":object.get("deptName").toString(),"");
                    addCell(ws, i, 2, null==object.get("pickNum")?"":object.get("pickNum").toString(),"");
                    addCell(ws, i, 3, null==object.get("preNum")?"":object.get("preNum").toString(),"");
                    addCell(ws, i, 4, null==object.get("wlNum")?"":object.get("wlNum").toString(),"");
                    addCell(ws, i, 2, null==object.get("total")?"":object.get("total").toString(),"");
                    addCell(ws, i, 3, null==object.get("pickNum")?"":object.get("pickNum").toString(),"");
                    addCell(ws, i, 4, null==object.get("preNum")?"":object.get("preNum").toString(),"");
                    addCell(ws, i, 5, null==object.get("wlNum")?"":object.get("wlNum").toString(),"");
                    i++;
                }
            }
            int j =1;
            if (null!=listDay&&listDay.size()>0){
                for (int n=0;n<listDay.size();n++){
                    Map<String,Object> object = listDay.get(n);
                    addCell(ws2, j, 0, object.get("daliy").toString(), "");
                    addCell(ws2, j, 1, null==object.get("total")?"":object.get("total").toString(),"");
                    addCell(ws2, j, 2, null==object.get("pickNum")?"":object.get("pickNum").toString(),"");
                    addCell(ws2, j, 3, null==object.get("preNum")?"":object.get("preNum").toString(),"");
                    addCell(ws2, j, 4, null==object.get("wlNum")?"":object.get("wlNum").toString(),"");
                    j++;
                }
            }
            wwb.write();
            wwb.close();
        } catch (IOException e) {
@ -195,7 +179,8 @@ public class PayInfoNoticeService {
                "\tcount(*) as \"total\" \n" +
                "FROM\n" +
                "\t wlyy_outpatient t \n" +
                "WHERE 1=1 and t.doctor is not null\n" ;
                "WHERE 1=1 and t.doctor is not null\n " +
                " AND t.doctor!='402803816babc778016babd0dee21112'" ;
        //接诊量
        String sqlDoctorOut = "SELECT\n" +
                "\tt.doctor as \"doctor\",\n" +
@ -204,7 +189,8 @@ public class PayInfoNoticeService {
                "\tcount(*) as \"total\" \n" +
                "FROM\n" +
                "\t wlyy_outpatient t \n" +
                "WHERE 1=1 and t.doctor is not null\n";
                "WHERE 1=1 and t.doctor is not null\n" +
                " AND t.doctor!='402803816babc778016babd0dee21112'";
        //开具处方量
        String sqlPrescription = "SELECT\n" +
                "\tt.doctor as \"doctor\",\n" +
@ -213,7 +199,8 @@ public class PayInfoNoticeService {
                "\tcount(*) as \"total\" \n" +
                "FROM\n" +
                "\t wlyy_prescription t \n" +
                "WHERE 1=1 and t.doctor is not null\n" ;
                "WHERE 1=1 and t.doctor is not null\n" +
                " AND t.doctor!='402803816babc778016babd0dee21112'" ;
        //物流量
        String sqlWL = "SELECT\n" +
                "\to.doctor as \"doctor\",\n" +
@ -224,7 +211,8 @@ public class PayInfoNoticeService {
                " base.wlyy_prescription_expressage t\n" +
                "LEFT JOIN base.wlyy_prescription b ON b.outpatient_id = t.outpatient_id\n" +
                "LEFT JOIN base.wlyy_outpatient o ON o.id= b.outpatient_id\n" +
                "WHERE 1=1 and o.doctor is not null\n" ;
                "WHERE 1=1 and o.doctor is not null\n" +
                " AND o.doctor!='402803816babc778016babd0dee21112'" ;
        if (StringUtils.isNotEmpty(beginTime)){
            wxId="xx";
            if("xm_ykyy_wx".equals(wxId)){
@ -296,7 +284,7 @@ public class PayInfoNoticeService {
                "AND b.drug_fee !=0\n" +
                "AND b.real_order IS not NULL"+
                "\tGROUP BY o.doctor_name,\n" +
                "\to.dept_name,o.doctor";;
                "\to.dept_name,o.doctor";
        List<Map<String,Object>> result = new ArrayList<>();
        List<Map<String,Object>> outPatient=hibenateUtils.createSQLQuery(sqlOutPatient);
        List<Map<String,Object>> docPickup=hibenateUtils.createSQLQuery(sqlDoctorOut);
@ -330,5 +318,94 @@ public class PayInfoNoticeService {
        }
     return result;
    }
    //按天分组查询
    public List<Map<String,Object>> dealSqlQueryGroupDay(String beginTime,String endTime){
        String sqlDemo = "SELECT\n" +
                "\tdate_format( t.create_time, '%Y-%m-%d' ) as \"daliy\",\n" +
                "\tcount( * ) as \"total\" \n" +
                "FROM\n" ;
        //发起复诊量
        String outPatinet =sqlDemo+ "\twlyy_outpatient t where 1=1 AND t.doctor!='402803816babc778016babd0dee21112' and " +
                "t.STATUS IN ( 0,1,2,3 )";
        //接诊
        String outPick  =sqlDemo+  "\twlyy_outpatient t where 1=1 AND t.doctor!='402803816babc778016babd0dee21112' " +
                " and t.STATUS IN (1,2,3) and t.doctor is not null ";
        //处方
        String pre = sqlDemo+"\twlyy_prescription t where 1=1 AND t.doctor!='402803816babc778016babd0dee21112'";
        //物流
        String wl =sqlDemo+" base.wlyy_prescription_expressage t\n" +
                "LEFT JOIN base.wlyy_prescription b ON b.outpatient_id = t.outpatient_id\n" +
                "LEFT JOIN base.wlyy_outpatient o ON o.id= b.outpatient_id\n" +
                "WHERE t.oneself_pickup_flg = 0\n" +
                "AND b.`status`IN(20,32,100)\n" +
                "AND b.drug_fee !=0\n" +
                "AND b.real_order IS not NULL" +
                " AND o.doctor!='402803816babc778016babd0dee21112'";
        String deltime = "";
        if (StringUtils.isNotEmpty(beginTime)){
            wxId="xx";
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    deltime+=" and t.create_time > '" + beginTime + " 00:00:00' ";
                }else {
                    deltime+=" and t.create_time > to_date('" + beginTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                deltime+=" and t.create_time > '" + beginTime + " 00:00:00'";
            }
        }
        if (StringUtils.isNotEmpty(endTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    deltime+="  and t.create_time<'" + endTime + " 23:59:59'";
                }else {
                    deltime+="  and t.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                }
            }else{
                deltime+="  and t.create_time<'" + endTime + " 23:59:59'";
            }
        }
        deltime+=" group by date_format(t.create_time, '%Y-%m-%d');";
        outPatinet+=deltime;
        outPick +=deltime;
        pre +=deltime;
        wl+=deltime;
        List<Map<String,Object>> result = new ArrayList<>();
        List<Map<String,Object>> outPatient=hibenateUtils.createSQLQuery(outPatinet);
        List<Map<String,Object>> docPickup=hibenateUtils.createSQLQuery(outPick);
        List<Map<String,Object>> prescription=hibenateUtils.createSQLQuery(pre);
        List<Map<String,Object>> wls=hibenateUtils.createSQLQuery(wl);
        if(null!=outPatient&&outPatient.size()>0){
            for (Map<String,Object> map:outPatient){
                if (docPickup!=null&&docPickup.size()>0){
                    for (Map<String,Object> pickMap:docPickup){
                        if (pickMap.get("daliy").toString().equalsIgnoreCase(map.get("daliy").toString())){
                            map.put("pickNum",null==pickMap.get("total")?"":pickMap.get("total").toString());
                        }
                    }
                }
                if (prescription!=null&&prescription.size()>0){
                    for (Map<String,Object> preMap:prescription){
                        if (preMap.get("daliy").toString().equalsIgnoreCase(map.get("daliy").toString())){
                            map.put("preNum",null==preMap.get("total")?"":preMap.get("total").toString());
                        }
                    }
                }
                if (wl!=null&&wls.size()>0){
                    for (Map<String,Object> wMap:wls){
                        if (wMap.get("daliy").toString().equalsIgnoreCase(map.get("daliy").toString())){
                            map.put("wlNum",null==wMap.get("total")?"":wMap.get("total").toString());
                        }
                    }
                }
                result.add(map);
            }
        }
        return result;
    }
}

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

@ -542,7 +542,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //药品信息
                List<WlyyPrescriptionInfoVO> infoVOs = new ArrayList<>();
                vo.setInfoVOs(convertToModels(prescriptionInfoDao.findByPrescriptionId(vo.getId(), 1), infoVOs, WlyyPrescriptionInfoVO.class));
                System.out.println("=====PrescriptionId======"+vo.getId());
                convertToModels(prescriptionInfoDao.findByPrescriptionId(vo.getId(), 1), infoVOs, WlyyPrescriptionInfoVO.class);
                vo.setInfoVOs(infoVOs);
                //检查检验信息
                List<WlyyInspectionVO> inspectionVOs = new ArrayList<>();
@ -865,7 +867,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else {
            System.out.println("写入自取信息");
            String drugStoreCode = expressageDO.getHospitalCode();
            BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreDao.findOne(drugStoreCode);
            BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreDao.findDrugByid(drugStoreCode);
            if (null!=baseDrugStoreDO){
                expressageDO.setCityCode(baseDrugStoreDO.getCityCode());
                expressageDO.setCityName(baseDrugStoreDO.getCityName());
@ -873,7 +875,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                expressageDO.setProvinceName(baseDrugStoreDO.getProvinceName());
                expressageDO.setTownCode(baseDrugStoreDO.getTownCode());
                expressageDO.setTownName(baseDrugStoreDO.getTownName());
                expressageDO.setHospitalCode(baseDrugStoreDO.getDrugStoreCode());
                expressageDO.setHospitalCode(baseDrugStoreDO.getHospitalCode());
                expressageDO.setHospitalName(baseDrugStoreDO.getHospitalName());
                expressageDO.setHospitalAddress(baseDrugStoreDO.getAddress());
            }
@ -3655,7 +3657,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //眼科接诊时更新眼科通状态
                if (!flag){
                    if (businessOrderDO!=null){
                        ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"9");
                        ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"2");
                    }
                }
            } else if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {

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

@ -4,6 +4,7 @@ package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.area.BaseDrugStoreDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
@ -22,6 +23,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionExpressageDao;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.prescription.service.useragent.BaseUserAgent;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.order.pay.wx.WeChatConfig;
@ -93,7 +95,10 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    @Value("${pay.flag}")
    private boolean payFlag;
    @Value("${wechat.id}")
    private String wechatId;
    @Autowired
    private YkyyService ykyyService;
    /**
     * 获取居民就诊记录接口
@ -202,7 +207,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
        if (!flag){
            businessOrderService.saveOrder(businessOrderDO);
            businessOrderDO = businessOrderService.saveOrder(businessOrderDO);
        }
        WlyyPatientRegisterTimeDO registerTimeDO = null;
@ -226,9 +231,39 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        expressageDO.setOutpatientId(outpatient.getId());
        prescriptionExpressageDao.save(expressageDO);
        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());
            expressageDO.setOutpatientId(outpatient.getId());
            prescriptionExpressageDao.save(expressageDO);
        }else {
            System.out.println("写入自取信息");
            String drugStoreCode = expressageDO.getHospitalCode();
            BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreDao.findDrugByid(drugStoreCode);
            if (null!=baseDrugStoreDO){
                expressageDO.setCityCode(baseDrugStoreDO.getCityCode());
                expressageDO.setCityName(baseDrugStoreDO.getCityName());
                expressageDO.setProvinceCode(baseDrugStoreDO.getProvinceCode());
                expressageDO.setProvinceName(baseDrugStoreDO.getProvinceName());
                expressageDO.setTownCode(baseDrugStoreDO.getTownCode());
                expressageDO.setTownName(baseDrugStoreDO.getTownName());
                expressageDO.setHospitalCode(baseDrugStoreDO.getHospitalCode());
                expressageDO.setHospitalName(baseDrugStoreDO.getHospitalName());
                expressageDO.setHospitalAddress(baseDrugStoreDO.getAddress());
            }
            expressageDO.setDel(1);
            expressageDO.setCreateTime(new Date());
            expressageDO.setOutpatientId(outpatient.getId());
            prescriptionExpressageDao.save(expressageDO);
        }
        //3.创建候诊室
        createRoom(outpatient, chargeType);
        return outpatient;
    }

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

@ -1662,13 +1662,15 @@ public class YkyyEntranceService {
        String patient = null;
        String admNo= null;
        String registNo=null;
        String deptNo = null;
        if (inspectionDOS!=null&&inspectionDOS.size()!=0){
            WlyyInspectionDO inspectionDO = inspectionDOS.get(0);
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(inspectionDO.getOutpatientId());
            registNo = outpatientDO.getRegisterNo();
            WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(inspectionDO.getPrescriptionId());
            admNo = prescriptionDO.getAdmNo();
            registNo = prescriptionDO.getRealOrder();
            doctor=outpatientDO.getDoctor();
            patient=outpatientDO.getPatient();
            admNo = outpatientDO.getAdmNo();
        }
        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOS){
            YkEmrJcsqDO ykEmrJcsqDO = new YkEmrJcsqDO();
@ -1679,19 +1681,28 @@ public class YkyyEntranceService {
                ykEmrJcsqDO.setJzxh(Integer.parseInt(admNo));
            }
            ykEmrJcsqDO.setXmid(Integer.valueOf(wlyyInspectionDO.getCode()));
            JSONArray jsonArray = this.findZlxm(null,wlyyInspectionDO.getCode());
            if (jsonArray!=null&&jsonArray.size()>0){
                JSONObject deptobject = jsonArray.getJSONObject(0);
                deptNo = deptobject.getString("dept");
            }
            ykEmrJcsqDO.setZxks(deptNo==null?0:Integer.parseInt(deptNo));
            ykEmrJcsqDO.setJcxm(wlyyInspectionDO.getName());
            ykEmrJcsqDO.setXmdj(new BigDecimal(wlyyInspectionDO.getChargeAmount()));
            ykEmrJcsqDO.setSqsl(wlyyInspectionDO.getQuantity());
            ykEmrJcsqDO.setJclx(Integer.valueOf(wlyyInspectionDO.getCheckPart()));
            ykEmrJcsqDO.setXmdw(wlyyInspectionDO.getTotalUnit());
            ykEmrJcsqDO.setZxks(wlyyInspectionDO.getDept()==null?0:Integer.parseInt(wlyyInspectionDO.getDept()));
            ykEmrJcsqDO.setKdsj(new Date());
            ykEmrJcsqDOS.add(ykEmrJcsqDO);
        }
        //同步his
        logger.info("开始同步检查检验");
        String message = this.outPatientOrder(ykEmrJcsqDOS,false,doctor,patient);
        System.out.println(message);
        Map<String,Object> message = this.outPatientOrder(ykEmrJcsqDOS,false,doctor,patient);
        System.out.println(message.get("code")+"-----"+message.get("msg"));
        if ("-1".equalsIgnoreCase(message.get("code").toString())){
           logger.info("同步检查检验失败,错误信息为:"+message.get("msg").toString());
        }
        System.out.println(message.get("code")+"-----"+message.get("msg"));
    }
    /**
@ -2386,7 +2397,7 @@ public class YkyyEntranceService {
        return array;
    }
    //门诊开单操作
    public String outPatientOrder(List<YkEmrJcsqDO> surveys,Boolean demoFlag,String doctor,String patient) throws Exception{
    public Map<String,Object> outPatientOrder(List<YkEmrJcsqDO> surveys,Boolean demoFlag,String doctor,String patient) throws Exception{
        DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
        if (StringUtils.isNoneBlank(doctor)){
            doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
@ -2401,6 +2412,7 @@ public class YkyyEntranceService {
        Integer kdks = 0;
        Integer brid=0;
        JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
        Map<String,Object> resultMap = new HashMap();
        if(jsonArray!=null&&jsonArray.size()>0){
            //获取居民信息
            JSONObject json = jsonArray.getJSONObject(0);
@ -2444,15 +2456,18 @@ public class YkyyEntranceService {
            JSONArray array= new JSONArray();
            if (status==200){
                array = rs.getJSONArray("detailModelList");
                if(array.size()>0){
                    return "success";
                }else {
                    return "failed";
                }
                resultMap.put("code","200");
                resultMap.put("msg",content);
                return resultMap;
            }else {
                resultMap.put("code","-1");
                resultMap.put("msg",content);
                return resultMap;
            }
            return "faild";
        }else {
            return "failed";
            resultMap.put("code","-1");
            resultMap.put("msg","开单信息为空");
            return resultMap;
        }
    }
   //查询检查单

+ 5 - 5
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -488,7 +488,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("reg_subject_code",  dept.length>=1?dept[0]:"");
                jb.put("reg_subject_name", dept.length>=2?dept[1]:"");
                jb.put("reg_price",  "0");
                jb.put("pt_name", info.get("name") == null?"0":info.get("name"));
                jb.put("pt_name", info.get("paName") == null?"0":info.get("paName"));
                jb.put("ge_code",   IdCardUtil.getSexForIdcard_new(info.get("idcard").toString()));
                jb.put("pt_age", IdCardUtil.getAgeForIdcard(info.get("idcard").toString()));
                jb.put("card_type", "1");
@ -881,8 +881,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("visit_doc_name",  info.get("docName")== null? "0":info.get("docName"));
                jb.put("visit_doc_id_no",  info.get("docIdCard")== null? "0":info.get("docIdCard"));
                jb.put("visit_doc_code",  visitDocCode);
                jb.put("visit_dept_code", info.get("dept_code") == null?"0":info.get("dept_code"));
                jb.put("visit_dept_name", info.get("dept_name") == null?"0":info.get("dept_name"));
                jb.put("visit_dept_code",  dept.length>=1?dept[0]:"");
                jb.put("visit_dept_name",  dept.length>=2?dept[1]:"");
                jb.put("pt_no", info.get("patientName")== null? "0":info.get("patientName"));
                jb.put("pt_age", IdCardUtil.getAgeForIdcard(info.get("patIdCard").toString()));
                jb.put("cost_type", "");
@ -1026,8 +1026,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("visit_doc_code", visitDocCode);
                jb.put("visit_subject_code", dept.length>=1?dept[0]:"");
                jb.put("visit_ subject _name",dept.length>=2?dept[1]:"");
                jb.put("visit_dept_code", info.get("dept"));
                jb.put("visit_dept_name", info.get("dept_name"));
                jb.put("visit_dept_code",  dept.length>=1?dept[0]:"");
                jb.put("visit_dept_name",  dept.length>=2?dept[1]:"");
                jb.put("pt_no", info.get("paName"));
                jb.put("pt_age", IdCardUtil.getAgeForIdcard(info.get("paId").toString()));
//                jb.put("cost_type", info.get("charge_type").toString());

+ 6 - 4
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -342,6 +342,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    public Map<String,Object> unifiedorder(Map<String,String> par,String appKey) throws Exception {
        String xml = WeiXinPayUtils.getXmlBeforUnifiedorder(par, appKey);
        Map<String, Object> map = WeiXinPayUtils.unifiedorder(xml,true);
        System.out.println("____wxPayResult"+map.get("wxPayResult"));
        //创建日志记录
        createLog(par,xml,map);
        map.remove("wxPayResult");
@ -469,10 +470,9 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        logger.info("map:"+map.toString());
        Map<String, Object> pay = unifiedorder(map, wxWechatDO.getAppKey());
        String returnCode = pay.get("return_code").toString();
        String resultCode = pay.get("result_code").toString();
        System.out.println("-----返回结果:"+resultCode);
        System.out.println("-----return_code:"+returnCode);
        if (returnCode.equalsIgnoreCase("SUCCESS")){
            String appid = pay.get("appid").toString();
            String mchId = pay.get("mch_id").toString();
@ -625,7 +625,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
     * @param orderRes
     */
    public void createLog(Map<String,String> map,String orderPar,Map<String,Object> orderRes){
        System.out.println("添加支付日志开始");
        WxPayLogDO wxPayLogDO = new WxPayLogDO();
        wxPayLogDO.setSeqNo(map.get("out_trade_no"));
        wxPayLogDO.setOpenId(map.get("openid"));
@ -634,6 +634,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        wxPayLogDO.setOrderParams(orderPar);
        wxPayLogDO.setOrderResponse(orderRes.get("wxPayResult").toString());
        String return_code = orderRes.get("return_code").toString();
        System.out.println("return_code"+return_code);
        if("SUCCESS".equalsIgnoreCase(return_code)){
            wxPayLogDO.setOrderStatus(1);
        }else{
@ -642,6 +643,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        wxPayLogDO.setCreateTime(new Date());
        wxPayLogDO.setPayStatus(0);
        wxPayLogDao.save(wxPayLogDO);
        System.out.println("添加支付日志结束");
    }
@ -1284,7 +1286,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                //眼科接诊时更新眼科通状态
                if (!flag){
                    if (businessOrderDO!=null){
                        ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"9");
                        ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"7");
                    }
                }
            }else if (wxId.equalsIgnoreCase("xm_zsyy_wx")){

+ 32 - 5
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -16,6 +16,7 @@ import com.yihu.jw.entity.base.im.ConsultTeamLogDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.score.BaseEvaluateDO;
import com.yihu.jw.entity.base.score.BaseEvaluateScoreDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.message.BaseBannerDoctorDO;
import com.yihu.jw.entity.hospital.message.BaseUserMessageDO;
@ -27,6 +28,7 @@ import com.yihu.jw.evaluate.score.dao.BaseEvaluateDao;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.consult.dao.WlyyConsultAdviceDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.message.dao.BaseBannerDoctorDao;
import com.yihu.jw.hospital.message.dao.BaseUserMessageDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
@ -122,6 +124,8 @@ public class ImService {
	private PrescriptionService prescriptionService;
	@Autowired
	private BaseBannerDoctorDao baseBannerDoctorDao;
	@Autowired
	private WlyyHospitalSysDictDao hospitalSysDictDao;
	
	@Value("${im.data_base_name}")
	private String data_base_name;
@ -893,11 +897,21 @@ public class ImService {
		JSONObject re = new JSONObject();
		boolean boo = StringUtils.isEmpty(getUnfinishedConsult(patient, doctor));
		logger.info("boo"+boo);
		if (!StringUtils.isEmpty(getUnfinishedConsult(patient, doctor))) {//判断是否有未结束的咨询移到同步方法中
		WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.findById("consultClose");
		boolean flag = false;
		if (sysDictDO!=null){
			if (sysDictDO.getDictCode().equalsIgnoreCase("1")){
				flag = true;
			}
		}
		if (!flag){
			if (!StringUtils.isEmpty(getUnfinishedConsult(patient, doctor))) {//判断是否有未结束的咨询移到同步方法中
//			re.put("status", -3);
//			return re;
			throw new RuntimeException("居民还有未结束的专家咨询!");
				throw new RuntimeException("居民还有未结束的专家咨询!");
			}
		}
		
		JSONObject users = new JSONObject();
		users.put(doctor,0);
@ -1644,7 +1658,17 @@ public class ImService {
					businessOrderDO  = businessOrderDao.selectByRelationCode(consult);
				}
				if (businessOrderDO!=null){
					ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"4");
					String sql ="SELECT * FROM topics t where " +
							"t.id='"+consult+"' and t.reply_user is null and t.reply is null and t.status IN(0,1) ";
					List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
					System.out.println("sql+-----"+sql);
					if (null!=mapList&&mapList.size()>0&&mapList.size()==1){
						//医生没回复的话要把状态改为关闭 status=?
						System.out.println("-------------------进入未回复状态同步--------------------");
						ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"3");
					}else {
						ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"4");
					}
				}
			}
		}
@ -2282,7 +2306,8 @@ public class ImService {
					for (WlyyConsultAdvice consultAdvice:consultAdvices){
						content.append(consultAdvice.getAdviceValue()+",");
					}
					if (content!=null){
					if (content!=null&&content.length()>0){
						System.out.println("content+====="+content);
						content.deleteCharAt(content.length()-1);
					}
					map.put("icd10Name",content);
@ -3100,7 +3125,9 @@ public class ImService {
			sql = "SELECT " +
					" DISTINCT op.id AS \"outpatientId\"," +
					"op.description AS \"title\"," +
					"op.description AS \"symptoms\",";
					"op.description AS \"symptoms\","+
					//添加排序的列
					"op.create_time AS \"createTime\",";
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";

+ 4 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java

@ -175,7 +175,7 @@ public class UnSettledHISPrescriptionService {
     */
    public void unSettledHISPrescription() throws Exception{
        if("xm_ykyy_wx".equals(wechatId)){
            //获取审核失败
            //获取审核失败5306758
            JSONArray jsonArray = ykyyEntranceService.getNoUnsettledPrescription();
            if(jsonArray!=null&&jsonArray.size()>0) {
                for (int i = 0; i<jsonArray.size(); i++){
@ -197,6 +197,7 @@ public class UnSettledHISPrescriptionService {
                        msgObj.put("prescriptionId",prescriptionId);
                        msgObj.put("reason","处方驳回");
                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
                        System.out.println("发送诊断消息开始+"+wlyyOutpatientDO.getId());
                        String immsg = imService.pushPrescriptionBackMsg(msgObj,doctor,doctorName,outpatientId,wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
                        System.out.println("发送诊断消息成功:"+immsg);
                    }
@ -258,6 +259,8 @@ public class UnSettledHISPrescriptionService {
                                }
                                WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
                                wlyyPrescriptionDO.setPrescribeTime(new Date());
                                wlyyPrescriptionDO.setCheckStatus(0);
                                wlyyPrescriptionDO.setCheckReason("审核通过");
                                prescriptionDao.save(wlyyPrescriptionDO);
                                JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                                logger.info("wlyyPrescriptionDO参数入参"+object.toJSONString());

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

@ -206,7 +206,7 @@ hospital:
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  im_list_get: http://192.168.33.197:3000/
  data_base_name: im_internet_hospital
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -421,6 +421,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		msgObj.put("msg",baseDoctorDO.getName()+"结束了咨询");
		msgObj.put("consultcode",consult);
		String jsonStr = "";
		if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (StringUtils.isNoneBlank(cons.getRelationCode())){
@ -454,11 +455,12 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
					free = res.getString("@total_charge");
				}
				if (!free.equalsIgnoreCase("0")){
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getXtgzh(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
				}
				logger.info("发送诊查费支付模板消息end");
			}
		}
		}
		if(1 == resutl){
			jsonStr = "{\"id\":\""+ UUID.randomUUID().toString()+"\",\"sender_id\":\""+doctorCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
		}

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -630,6 +630,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		msgObj.put("msg",basePatientDO.getName()+"结束了咨询");
		msgObj.put("consultcode",consult);
		String jsonStr = "";
		if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(cons.getRelationCode())){
@ -663,11 +664,12 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
					free = res.getString("@total_charge");
				}
				if (!free.equalsIgnoreCase("0")){
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getXtgzh(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
				}
				logger.info("发送诊查费支付模板消息end");
			}
		}
		}
		if(1 == resutl){
			jsonStr = "{\"id\":\""+UUID.randomUUID().toString()+"\",\"sender_id\":\""+patientCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";

+ 6 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/file_upload/FileUploadEndpoint.java

@ -72,6 +72,9 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
            JSONObject json = JSON.parseObject(rs);
            uploadVO = objectMapper.readValue(json.getJSONObject("obj").toJSONString(),UploadVO.class);
        }else if (isClose.equalsIgnoreCase("1")){
            Map<String, Object> map = fileUploadService.uploadImg(file);
            uploadVO.setFullUri(map.get("accessory").toString());
        }
        return success("上传成功", uploadVO);
    }
@ -93,6 +96,9 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
            JSONObject json = JSON.parseObject(rs);
            uploadVO = objectMapper.readValue(json.getJSONObject("obj").toJSONString(),UploadVO.class);
        }else if (isClose.equalsIgnoreCase("1")){
            Map<String, Object> map = fileUploadService.uploadImg(file);
            uploadVO.setFullUri(map.get("accessory").toString());
        }
        return success("上传成功", uploadVO);
    }

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

@ -161,6 +161,7 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
                              @RequestParam(value = "endTime", required = false)String endTime,
                              HttpServletResponse response) throws Exception{
        List<Map<String,Object>> list = payInfoNoticeService.dealSqlQuery(startTime,endTime);
        List<Map<String,Object>> listDay = payInfoNoticeService.dealSqlQueryGroupDay(startTime,endTime);
        OutputStream os = response.getOutputStream();
        response.reset();
        response.setContentType("application/octet-stream; charset=utf-8");
@ -168,6 +169,6 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
        //response.setHeader("Content-Disposition", "attachment;filename="+new String("sss".getBytes(), "ISO8859-1"));qwe
        response.setHeader("content-disposition",
                "attachment;filename=" + URLEncoder.encode("在线诊疗统计情况.xls", "UTF-8"));
        payInfoNoticeService.exportEsPrescription(os,list);
        payInfoNoticeService.exportEsPrescription(os,list,listDay);
    }
}

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

@ -146,7 +146,18 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisit(outpatientJson,expressageJson,registerJson,chargeType);
        if (wlyyOutpatientDO!=null&&null==wlyyOutpatientDO.getId()){
            ObjEnvelop objEnvelop =new ObjEnvelop();
            String msg = "";
            if (1==wlyyOutpatientDO.getRemindCount()){
                msg = "自取";
            }else {
                msg = "快递配送";
            }
            objEnvelop.setMessage("您已经选择过"+msg+"方式,请勿修改");
            objEnvelop.setStatus(300);
            return objEnvelop;
        }
       /* //发送系统消息
        SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(wlyyOutpatientDO);
        //发送IM消息

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

@ -349,7 +349,9 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
                " t.intro as \"intro\",t.category_first_name as \"categoryFirstName\"," +
                " t.category_second_name as \"categorySecondName\" ," +
                "t.content as \"content\",t.image as \"image\",t.create_user_name as \"createUserName\",c.job_title_name as \"jobTitleName\"," +
                "b.dept_name as \"deptName\",b.org_name as \"hospitalName\" from wlyy_knowledge_article t left join wlyy_knowledge_article_dept a " +
                "b.dept_name as \"deptName\",b.org_name as \"hospitalName\"," +
				"t.create_time as \"createTime\" " +
				" from wlyy_knowledge_article t left join wlyy_knowledge_article_dept a " +
                " on a.article_id = t.id left join base_doctor_hospital b on b.doctor_code = t.create_user" +
				" left join base_doctor c on c.id = t.create_user where 1=1 and t.del = 1 and t.status = 1";
		if (StringUtils.isNotBlank(categoryFirst)){
@ -362,7 +364,8 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
            sql+=" and (t.create_user_name like '%"+keyWords+"%' or t.title like '%"+keyWords+"%' or t.content like '%"+keyWords+"%' or a.dept_name like '%"+keyWords+"%' )";
        }
		sql+=" group by t.id ,t.title ,t.intro,t.category_first_name ,t.category_second_name ,c.job_title_name," +
				"t.read_count,t.collection,t.fabulous,t.is_share,t.content ,t.image ,t.create_user_name ,b.dept_name ,b.org_name order by t.create_time desc";
				"t.read_count,t.collection,t.fabulous,t.is_share,t.content ,t.image ,t.create_user_name ,b.dept_name ,b.org_name,t.create_time " +
				" order by t.create_time desc";
        List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<Map<String,Object>> countList = hibenateUtils.createSQLQuery(sql);
        objEnvelop.setObj(result);