فهرست منبع

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

liubing 4 سال پیش
والد
کامیت
6d7c392424
20فایلهای تغییر یافته به همراه768 افزوده شده و 46 حذف شده
  1. 6 0
      business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorDao.java
  2. 53 1
      business/base-service/src/main/java/com/yihu/jw/file_upload/FileUploadService.java
  3. 4 0
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyChargeDictDao.java
  4. 19 8
      business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java
  5. 10 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java
  6. 343 13
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  7. 53 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  8. 27 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  9. 15 0
      business/base-service/src/main/java/com/yihu/jw/hospital/ykyy/service/YkyyService.java
  10. 7 5
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  11. 3 4
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  12. 67 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java
  13. 2 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  14. 66 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorVO.java
  15. 5 7
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/AesEncryptUtils.java
  16. 36 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  17. 5 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java
  18. 44 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  19. 2 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  20. 1 1
      svr/svr-internet-hospital/src/main/resources/application.yml

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorDao.java

@ -39,4 +39,10 @@ public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO,
    void updateStatus(String doctorId,String status);
    List<BaseDoctorDO> findByIdcard(String idcard);
    @Query("from BaseDoctorDO d where d.yktDoctorId = ?1 AND d.del ='1'")
    BaseDoctorDO findByYktDoctorId(String yktDoctorId);
    @Query("from BaseDoctorDO d where d.idcard = ?1 AND d.del ='1'")
    BaseDoctorDO findByIdcardAndId(String idcard);
}

+ 53 - 1
business/base-service/src/main/java/com/yihu/jw/file_upload/FileUploadService.java

@ -28,10 +28,14 @@ import org.springframework.web.multipart.MultipartFile;
import javax.activation.MimetypesFileTypeMap;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
/**
@ -467,5 +471,53 @@ public class FileUploadService {
        return uploadVO;
    }
    /***
     *
     * 将图片转换为Base64<br>
     * 将base64编码字符串解码成img图片
     * @param imgFile
     * @return
     */
    public static String getImgStr(String imgFile){
        ByteArrayOutputStream data = new ByteArrayOutputStream();
        try {
            // 创建URL
            URL url = new URL(imgFile);
            byte[] by = new byte[1024];
            // 创建链接
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            conn.setConnectTimeout(5000);
            InputStream is = conn.getInputStream();
            // 将内容放到内存中
            int len = -1;
            while ((len = is.read(by)) != -1) {
                data.write(by, 0, len);
            }
            is.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        // 对字节数组Base64编码
        return Base64.getEncoder().encodeToString(data.toByteArray());
    }
    public InputStream getInputStream(String downloadFilePath) throws Exception{
        InputStream inputStream = null;
        //从文件链接里获取文件流
        URL url = new URL(downloadFilePath);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        //设置超时间为3秒
        conn.setConnectTimeout(180 * 1000);
        //防止屏蔽程序抓取而返回403错误
        conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
        //得到输入流
        inputStream = conn.getInputStream();
        return inputStream;
    }
}

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

@ -2,6 +2,7 @@ package com.yihu.jw.hospital.dict;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import javax.transaction.Transactional;
@ -18,4 +19,7 @@ public interface WlyyChargeDictDao extends PagingAndSortingRepository<WlyyCharge
    WlyyChargeDictDO  findByChargeTypeAndDeptTypeCode(String chargeType,String deptTypeCode);
    WlyyChargeDictDO  findByChargeType(String chargeType);
    @Query("from WlyyChargeDictDO d where d.reqFee = ?1 ")
    WlyyChargeDictDO  findByReqFee(Double reqFee);
}

+ 19 - 8
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -380,22 +380,33 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                                if(jsonObject1.get("MEDICALCARD")!=null){
                                    List<PatientMedicareCardDO> patientMedicareCardDOS =  basePatientMedicareCardDao.findByPatientCode(patientDO.getId());
                                    boolean flag = false;
                                    PatientMedicareCardDO patientMedicareCardDO1 = new PatientMedicareCardDO();
                                    for (PatientMedicareCardDO medicareCardDO:patientMedicareCardDOS){
                                        if (medicareCardDO.getParentType().equalsIgnoreCase("A_01")){
                                        if (medicareCardDO.getType().equalsIgnoreCase("A_01")){
                                            flag=true;
                                            patientMedicareCardDO1=medicareCardDO;
                                            break;
                                        }
                                    }
                                    System.out.println("flag"+flag);
                                    PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByCode(jsonObject1.getString("MEDICALCARD"));
                                    if (patientMedicareCardDO==null&&!flag){
                                    if (patientMedicareCardDO==null&&flag==false){
                                        patientMedicareCardDO = new PatientMedicareCardDO();
                                        patientMedicareCardDO.setCode(jsonObject1.getString("MEDICALCARD"));
                                        patientMedicareCardDO.setParentType("A");
                                        patientMedicareCardDO.setType("A_01");
                                        patientMedicareCardDO.setPatientCode(patientDO.getId());
                                        patientMedicareCardDO.setDel("1");
                                        basePatientMedicareCardDao.save(patientMedicareCardDO);
                                    }else if (patientMedicareCardDO!=null&&flag==true&&patientMedicareCardDO1!=null){
                                        patientMedicareCardDO1.setCode(jsonObject1.getString("MEDICALCARD"));
                                        patientMedicareCardDO1.setParentType("A");
                                        patientMedicareCardDO1.setType("A_01");
                                        patientMedicareCardDO1.setPatientCode(patientDO.getId());
                                        patientMedicareCardDO1.setDel("1");
                                        basePatientMedicareCardDao.save(patientMedicareCardDO1);
                                    }
                                    patientMedicareCardDO.setCode(jsonObject1.getString("MEDICALCARD"));
                                    patientMedicareCardDO.setParentType("A");
                                    patientMedicareCardDO.setType("A_01");
                                    patientMedicareCardDO.setPatientCode(patientDO.getId());
                                    patientMedicareCardDO.setDel("1");
                                    basePatientMedicareCardDao.save(patientMedicareCardDO);
                                }
                            }
                        }

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

@ -45,9 +45,19 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("from WlyyOutpatientDO a where a.generalDoctor = ?1 and a.registerDate >=?2 and a.registerDate <=?3 and a.status = ?4 and a.doctor is not null order by registerDate ASC")
    List<WlyyOutpatientDO> findByGeneralDoctor(String generalDoctor, Date startDate,Date endDate,String status);
    @Query("from WlyyOutpatientDO a where a.generalDoctor = ?1 and a.registerDate >=?2 and a.registerDate <=?3 and a.status in(?4) and a.doctor is not null order by registerDate ASC")
    List<WlyyOutpatientDO> findByGeneralDoctorAndStatusAndDate(String generalDoctor, Date startDate,Date endDate,String status);
    @Query("from WlyyOutpatientDO a where a.generalDoctor = ?1 and a.status in(?2) and a.doctor is not null order by registerDate ASC")
    List<WlyyOutpatientDO> findByGeneralDoctorAndStatus(String generalDoctor,String status);
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1")
    List<WlyyOutpatientDO> findByStatus();
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1 and a.outpatientType=?1 and a.registerDate <=?2")
    List<WlyyOutpatientDO> findOutpatientListByOutpatientType(String outpatientType,Date endDate);
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1 and a.createTime<'2020-08-31 23:59:59'")
    List<WlyyOutpatientDO> findPreviousByStatus();
    List<WlyyOutpatientDO> findByDoctorAndCreateTimeAndPatientCancelRemark(String doctor,Date createTime,String patientCancelRemark);

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

@ -868,11 +868,39 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("WX_MONEY");
        Double price = 0.0;
        if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
            price = Double.parseDouble(doctorDO.getFee());
        String chargeType1 = null;
        if (outpatient.getOutpatientType().equalsIgnoreCase("1")){
            if(outpatientDO.getType().equalsIgnoreCase("1")){
                chargeType1 = doctorDO.getTwfzChargeType();
            }else if(outpatientDO.getType().equalsIgnoreCase("2")){
                chargeType1 = doctorDO.getSpfzChargeType();
            }
        }else if (outpatient.getOutpatientType().equalsIgnoreCase("3")){
            if(outpatientDO.getType().equalsIgnoreCase("1")){
                chargeType1 = doctorDO.getTwzxChargeType();
            }else if(outpatientDO.getType().equalsIgnoreCase("2")){
                chargeType1 = doctorDO.getSpzxChargeType();
            }
        }else if (outpatient.getOutpatientType().equalsIgnoreCase("2")){
            chargeType1 = doctorDO.getXtfzChargeType();
        }
        if(doctorDO!=null){
            if (StringUtils.isNoneBlank(chargeType1)){
                WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByChargeType(chargeType1);
                if (chargeDictDO!=null){
                    price = chargeDictDO.getReqFee();
                }else {
                    price = Double.parseDouble(hospitalSysDictDO.getDictValue());
                }
            }
        }else {
            price = Double.parseDouble(hospitalSysDictDO.getDictValue());
        }
        /*if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
            price = Double.parseDouble(doctorDO.getFee());
        }else {
            price = Double.parseDouble(hospitalSysDictDO.getDictValue());
        }*/
        if (price == 0.0) {
            outpatientDO.setPayStatus(1);
        } else {
@ -1460,7 +1488,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " h.dept_code AS \"deptCode\"," +
                " h.dept_Name AS \"deptName\"," +
                " d.outpatient_type AS \"outpatientType\"," +
                " d.consult_status AS \"consultStatus\"" +
                " d.consult_status AS \"consultStatus\"," +
                " d.twfz_charge_type AS \"twfzConsultStatus\"," +
                " d.spfz_charge_type AS \"spfzConsultStatus\"," +
                " d.twzx_charge_type AS \"twzxConsultStatus\"," +
                " d.spzx_charge_type AS \"spzxConsultStatus\"," +
                " d.xtfz_charge_type AS \"xtfzConsultStatus\" " +
                " FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
@ -1546,7 +1579,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    }
                }
                List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
                if (null!=doctor.get("chargeType")){
                String sqlCharge = "SELECT\n" +
                        "\tm.req_fee as \"twfzFee\",\n" +
                        "\ta.req_fee as \"spfzFee\",\n" +
                        "\tb.req_fee as \"spzxFee\",\n" +
                        "\tv.req_fee as \"twzxFee\",\n" +
                        "\td.req_fee as \"xtzxFee\"\n" +
                        "FROM\n" +
                        "\tbase_doctor t\n" +
                        "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                        "WHERE t.id = '"+doctor.get("id")+"' ";
                chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
                /*if (null!=doctor.get("chargeType")){
                    String chargeTypeList = doctor.get("chargeType").toString();
                    if (chargeType.contains(",")){
                        chargeTypeList = chargeType.replace(",","','");
@ -1555,11 +1603,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            "req_fee  as \"reqFee\",dept_type_code as \"deptTypeCode\" " +
                            " from wlyy_charge_dict where 1=1";
                    sqlCharge+=" and charge_type in ( '"+chargeTypeList+"')";
                    if (StringUtils.isNoneBlank(deptTyepCode)){
                        sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')";
                    }
                    chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
                }
                }*/
                doctor.put("chargeTypeList",chargeDictDOLists);
            }
            if (StringUtils.isNotBlank(doctorCode)) {
@ -2828,7 +2877,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     */
    public MixEnvelop findExpressageList(String status, String oneselfPickupFlg, String nameKey, String startTime, String endTime, Integer page, Integer size, String wxId) {
        String totalSql = "SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wlyy_outpatient o " +
                " JOIN wlyy_prescription p ON p.outpatient_id = o.id " +
@ -3462,7 +3511,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
            }
            List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
            String chargeType = doctorDO.getChargeType();
            /*String chargeType = doctorDO.getChargeType();
            if (StringUtils.isNotBlank(chargeType)){
                if (chargeType.contains(",")){
                    chargeType = chargeType.replace(",","','");
@ -3475,7 +3524,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')";
                }
                chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            }
            }*/
            rs.put("chargeTypeList",chargeDictDOLists);
            //机构科室信息
            List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
@ -3728,7 +3777,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
            }
            List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
            /*List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
            String chargeType = doctorDO.getChargeType();
            if (StringUtils.isNotBlank(chargeType)){
                if (chargeType.contains(",")){
@ -3743,7 +3792,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            }
            rs.put("chargeTypeList",chargeDictDOLists);
            rs.put("chargeTypeList",chargeDictDOLists);*/
            List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
            String sqlCharge = "SELECT\n" +
                    "\tm.req_fee as \"twfzFee\",\n" +
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
                    "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    "WHERE t.id = '"+doctorDO.getId()+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            //机构科室信息
            List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
            List<BaseDoctorHospitalDO> hospitalDOList = new ArrayList<>();
@ -5212,7 +5277,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
            }
            List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
            /*List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
            if(null!=map.get("chargeType")){
                String chargeType = map.get("chargeType").toString();
                if (chargeType.contains(",")){
@ -5227,7 +5292,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            }
            map.put("chargeTypeList",chargeDictDOLists);
            map.put("chargeTypeList",chargeDictDOLists);*/
            List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
            String sqlCharge = "SELECT\n" +
                    "\tm.req_fee as \"twfzFee\",\n" +
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
                    "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    "WHERE t.id = '"+map.get("id")+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            //查询医生各项评价平均分
            String sqlscore = "SELECT " +
                    "AVG(a.score) AS \"score\"," +
@ -8718,7 +8799,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (prescriptionDO == null) {
            throw new Exception("处方不存在!");
        }
        List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wxId, prescriptionDO.getPatientCode());
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(oupatientId);
        List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wxId, outpatientDO.getConsumer());
        if (patientWechatDos == null || patientWechatDos.size() == 0) {
            throw new Exception("openid不存在!");
        }
@ -9105,4 +9187,252 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public com.alibaba.fastjson.JSONObject selectHospitalInfo(String doctorId,String orgCode){
        /**
         * 1、今日待就诊:今日当前家庭医生在当前医院的未完成的协同门诊书
         2、下一次就诊时间:当前家庭医生在当前医院下一次未接诊的就诊时间。
         3、服务评分:当前医院的综合服务评分
         4、在线医生:当前医院在班的专科医生数
         5、可预约医生:当前医院有开通协同门诊业务的医生数(包含当前在线)
         6、累计就诊:当前医院累计协同门诊的已接诊数量
         */
        Date startTime  = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
        Date endTime  = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        // 1、今日待就诊:今日当前家庭医生在当前医院的未完成的协同门诊书
        List<WlyyOutpatientDO> outpatientDOS =  outpatientDao.findByGeneralDoctorAndStatusAndDate(doctorId,startTime,endTime,"0,1,2");
        jsonObject.put("NowWaitTotal",outpatientDOS.size());
        //2、下一次就诊时间:当前家庭医生在当前医院下一次未接诊的就诊时间。
        List<WlyyOutpatientDO> outpatientDOList =  outpatientDao.findByGeneralDoctorAndStatus(doctorId,"0");
        if (outpatientDOList!=null&&outpatientDOList.size()!=0){
            jsonObject.put("nextTime",DateUtil.dateToStrLong(outpatientDOList.get(0).getRegisterDate()));
        }else {
            jsonObject.put("nextTime",null);
        }
        //3、服务评分:当前医院的综合服务评分
        //在线医生:当前医院在班的专科医生数
        String sql ="SELECT d.id as \"id\",d.name as \"name\" FROM base_doctor d WHERE (EXISTS (SELECT 1 FROM wlyy_doctor_work_time t WHERE t.doctor = d.id AND t.start_time >=:startTime AND t.end_time <=:endTime ) OR  d.consult_status = '1')";
        Map<String, Object> params = new HashedMap();
        params.put("startTime",startTime);
        params.put("endTime",endTime);
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params);
        jsonObject.put("onlineDoctors",list.size());
        //可预约医生:当前医院有开通协同门诊业务的医生数(包含当前在线)
        sql += " AND outpatient_type IN('xt') ";
        List<Map<String, Object>> specialist = hibenateUtils.createSQLQuery(sql, params);
        jsonObject.put("xtOnlineDoctors",specialist.size());
        //累计就诊:当前医院累计协同门诊的已接诊数量
        List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findOutpatientListByOutpatientType("xt",new Date());
        jsonObject.put("xtOupatients",wlyyOutpatientDOList.size());
        BaseOrgDO orgDO = baseOrgDao.findByCode(orgCode);
        jsonObject.put("orgName",orgDO.getName());
        jsonObject.put("orgPhoto",orgDO.getPhoto());
        jsonObject.put("description",orgDO.getIntro());
        return jsonObject;
    }
    /**
     *
     * @param price
     * @param type
     * @param flag
     * @return
     */
    public String synYktZxPrice(String idcard,Integer price,Integer type,String flag) throws Exception {
        if (StringUtils.isNoneBlank(flag)){
            List<BaseDoctorDO> doctorDOList = baseDoctorDao.findByDel();
            for (BaseDoctorDO doctorDO:doctorDOList){
                String yktDoctor = null;
                DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorDO.getId());
                if (doctorMappingDO!=null){
                    String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
                    com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(doctorResponse);
                    if (jsonObject.getInteger("code")==200){
                        com.alibaba.fastjson.JSONArray array1 = jsonObject.getJSONArray("data");
                        if (array1!=null&&array1.size()!=0){
                            yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID");
                        }
                    }
                    if (StringUtils.isNoneBlank(yktDoctor)){
                        doctorDO.setYktDoctorId(yktDoctor);
                        //图文
                        String twResponse =ykyyService.GetVasPriceByTypeForJkzl(yktDoctor,1);
                        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(twResponse);
                        if (object.getInteger("code")==10000){
                            if (object.containsKey("value")){
                                com.alibaba.fastjson.JSONObject object1 = object.getJSONObject("value");
                                Integer twPrcie=object1.getInteger("price");
                                Double twPrcie1 = Double.parseDouble(twPrcie+"");
                                WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(twPrcie1);
                                if (chargeDictDO==null){
                                    chargeDictDO = new WlyyChargeDictDO();
                                    chargeDictDO.setCreateTime(new Date());
                                    chargeDictDO.setReqFee(twPrcie1);
                                    chargeDictDO.setChargeType(twPrcie+"");
                                    chargeDictDO.setChargeName(twPrcie+"");
                                    chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
                                }
                                doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (!doctorDO.getOutpatientType().contains("zj")){
                                        doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zj");
                                    }
                                }else {
                                    doctorDO.setOutpatientType("zj");
                                }
                            }else {
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (doctorDO.getOutpatientType().contains("zj")){
                                        doctorDO.getOutpatientType().replace(",zj","");
                                    }
                                }else {
                                    doctorDO.setOutpatientType("zj");
                                }
                            }
                        }
                        //视频
                        String spResponse =ykyyService.GetVasPriceByTypeForJkzl(yktDoctor,3);
                        com.alibaba.fastjson.JSONObject jsonObject1 = com.alibaba.fastjson.JSONObject.parseObject(spResponse);
                        if (jsonObject1.getInteger("code")==10000){
                            if (jsonObject1.containsKey("value")){
                                com.alibaba.fastjson.JSONObject object1 = jsonObject1.getJSONObject("value");
                                Integer spPrcie=object1.getInteger("price");
                                Double spPrcie1 = Double.parseDouble(spPrcie+"");
                                WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(spPrcie1);
                                if (chargeDictDO==null){
                                    chargeDictDO = new WlyyChargeDictDO();
                                    chargeDictDO.setCreateTime(new Date());
                                    chargeDictDO.setReqFee(spPrcie1);
                                    chargeDictDO.setChargeType(spPrcie+"");
                                    chargeDictDO.setChargeName(spPrcie+"");
                                    chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
                                }
                                doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (!doctorDO.getOutpatientType().contains("zj")){
                                        doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zj");
                                    }
                                }else {
                                    doctorDO.setOutpatientType("zj");
                                }
                            }else {
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (doctorDO.getOutpatientType().contains("zj")){
                                        doctorDO.getOutpatientType().replace(",zj","");
                                    }
                                }else{
                                    doctorDO.setOutpatientType("zj");
                                }
                            }
                        }
                    }
                    baseDoctorDao.save(doctorDO);
                }
            }
            return "ok";
        }else {
            BaseDoctorDO doctorDO = baseDoctorDao.findByIdcardAndId(idcard);
            if (price==-1){
                if (doctorDO!=null){
                    if (type==1){
                        if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
                            if (doctorDO.getOutpatientType().contains("zj")) {
                                doctorDO.getOutpatientType().replace(",zj", "");
                            }
                        }else {
                            doctorDO.setOutpatientType("zj");
                        }
                    }else if (type==3){
                        if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
                            if (doctorDO.getOutpatientType().contains("zj")) {
                                doctorDO.getOutpatientType().replace(",zj", "");
                            }
                        }else {
                            doctorDO.setOutpatientType("zj");
                        }
                    }
                }else {
                    if (doctorDO==null){
                        return "找不到医生信息!";
                    }
                }
            }else {
                if (doctorDO!=null){
                    if (!StringUtils.isNoneBlank(doctorDO.getYktDoctorId())){
                        String yktDoctor = null;
                        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorDO.getId());
                        if (doctorMappingDO!=null){
                            String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
                            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(doctorResponse);
                            if (jsonObject.getInteger("code")==200){
                                com.alibaba.fastjson.JSONArray array1 = jsonObject.getJSONArray("data");
                                if (array1!=null&&array1.size()!=0){
                                    yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID");
                                }
                            }
                            doctorDO.setYktDoctorId(yktDoctor);
                        }
                    }
                    if (type!=null&&type==1) {
                        Double price1 = Double.parseDouble(price + "");
                        WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(price1);
                        if (chargeDictDO == null) {
                            chargeDictDO = new WlyyChargeDictDO();
                            chargeDictDO.setCreateTime(new Date());
                            chargeDictDO.setReqFee(price1);
                            chargeDictDO.setChargeType(price + "");
                            chargeDictDO.setChargeName(price + "");
                            chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
                        }
                        doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
                        if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
                            if (!doctorDO.getOutpatientType().contains("zj")) {
                                doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zj");
                            }
                        }else {
                            doctorDO.setOutpatientType("zj");
                        }
                    }else if (type!=null&&type==3) {
                        Double price1 = Double.parseDouble(price + "");
                        WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(price1);
                        if (chargeDictDO == null) {
                            chargeDictDO = new WlyyChargeDictDO();
                            chargeDictDO.setCreateTime(new Date());
                            chargeDictDO.setReqFee(price1);
                            chargeDictDO.setChargeType(price + "");
                            chargeDictDO.setChargeName(price + "");
                            chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
                        }
                        doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                        if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
                            if (!doctorDO.getOutpatientType().contains("zj")) {
                                doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zj");
                            }
                        }else {
                            doctorDO.setOutpatientType("zj");
                        }
                    }
                    baseDoctorDao.save(doctorDO);
                    return "ok";
                }else {
                    return "找不到医生信息!";
                }
            }
            return "ok";
        }
    }
}

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

@ -17,7 +17,9 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.doctor.WlyyPatientRegisterTimeDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
@ -26,6 +28,8 @@ import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
import com.yihu.jw.hospital.drugstore.dao.BaseDrugStoreDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
@ -102,8 +106,6 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    @Autowired
    private PatientMappingDao patientMappingDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private DictHospitalDeptDao dictHospitalDeptDao;
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
@ -111,6 +113,12 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    private BaseDoctorRoleDao doctorRoleDao;
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private WlyyChargeDictDao wlyyChargeDictDao;
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
    @Autowired
    private BaseDoctorDao doctorDao;
@ -317,7 +325,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        //1.保存就诊实体
        WlyyOutpatientDO outpatientDO = objectMapper.readValue(outpatientJson, WlyyOutpatientDO.class);
        BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
        BaseDoctorDO doctorDO = doctorDao.findById(outpatientDO.getDoctor());
        outpatientDO.setMjz("mz");
        outpatientDO.setStatus("0");
        outpatientDO.setCreateTime(new Date());
@ -349,6 +357,48 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            businessOrderDO.setOrderType(3);
            businessOrderDO.setOrderCategory("3");
        }
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("WX_MONEY");
        Double price = 0.0;
        String chargeType1 = null;
        if (outpatient.getOutpatientType().equalsIgnoreCase("1")){
            if(outpatientDO.getType().equalsIgnoreCase("1")){
                chargeType1 = doctorDO.getTwfzChargeType();
            }else if(outpatientDO.getType().equalsIgnoreCase("2")){
                chargeType1 = doctorDO.getSpfzChargeType();
            }
        }else if (outpatient.getOutpatientType().equalsIgnoreCase("3")){
            if(outpatientDO.getType().equalsIgnoreCase("1")){
                chargeType1 = doctorDO.getTwzxChargeType();
            }else if(outpatientDO.getType().equalsIgnoreCase("2")){
                chargeType1 = doctorDO.getSpzxChargeType();
            }
        }else if (outpatient.getOutpatientType().equalsIgnoreCase("2")){
            chargeType1 = doctorDO.getXtfzChargeType();
        }
        if(doctorDO!=null){
            if (StringUtils.isNoneBlank(doctorDO.getChargeType())){
                WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByChargeType(chargeType1);
                if (chargeDictDO!=null){
                    price = chargeDictDO.getReqFee();
                }else {
                    price = Double.parseDouble(hospitalSysDictDO.getDictValue());
                }
            }
        }else {
            price = Double.parseDouble(hospitalSysDictDO.getDictValue());
        }
        /*if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
            price = Double.parseDouble(doctorDO.getFee());
        }else {
            price = Double.parseDouble(hospitalSysDictDO.getDictValue());
        }*/
        if (price == 0.0) {
            outpatientDO.setPayStatus(1);
        } else {
            outpatientDO.setPayStatus(0);
        }
        businessOrderDO.setPayPrice(price*100);
        if (!flag){
            businessOrderDO = businessOrderService.saveOrder(businessOrderDO);

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

@ -22,6 +22,7 @@ import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateDao;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.hospital.dict.YkDictIcd10Dao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
@ -30,6 +31,7 @@ import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
@ -48,6 +50,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.*;
@ -136,6 +139,8 @@ public class YkyyEntranceService {
    private YkyyService ykyyService;
    @Autowired
    private PrescriptionEmrDao prescriptionEmrDao;
    @Autowired
    private FileUploadService fileUploadService;
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
@ -998,7 +1003,7 @@ public class YkyyEntranceService {
    }
    public String updateYkTDoctor()throws Exception{
    public String updateYkTDoctor(String fastdfs_file_url)throws Exception{
        List<BaseDoctorDO> baseDoctorDOS = baseDoctorDao.findByDel();
        for (BaseDoctorDO baseDoctorDO:baseDoctorDOS){
            String response="";
@ -1014,12 +1019,31 @@ public class YkyyEntranceService {
                    JSONObject jsonObject = array.getJSONObject(0);
                    DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(baseDoctorDO.getId());
                    String mappingCode = jsonObject.getString("DOCTORCODE");
                    doctorMappingDO.setMappingCode(mappingCode);
                    String photo = jsonObject.getString("doctor_image");
                    if (StringUtils.isNoneBlank(photo)){
                        String name = photo.substring(photo.lastIndexOf("/"),photo.length()-1);
                        InputStream inputStream = fileUploadService.getInputStream(photo);
                        UploadVO uploadVO = new UploadVO();
                        uploadVO = fileUploadService.uploadStream(inputStream,name,fastdfs_file_url);
                        baseDoctorDO.setPhoto(uploadVO.getFullUri());
                    }
                    if (doctorMappingDO==null){
                        doctorMappingDO = new DoctorMappingDO();
                        doctorMappingDO.setMappingCode(mappingCode);
                        doctorMappingDO.setCreateTime(new Date());
                        doctorMappingDO.setDoctor(baseDoctorDO.getId());
                        doctorMappingDO.setDoctorName(baseDoctorDO.getName());
                        doctorMappingDO.setOrgCode("350211A5004");
                        doctorMappingDO.setMappingName(baseDoctorDO.getName());
                        doctorMappingDO.setOrgName("厦门大学附属厦门眼科中心");
                    }else {
                        doctorMappingDO.setMappingCode(mappingCode);
                    }
                    doctorMappingDao.save(doctorMappingDO);
                }else {
                    baseDoctorDO.setDel("0");
                    baseDoctorDao.save(baseDoctorDO);
                }
                baseDoctorDao.save(baseDoctorDO);
            }
        }
        return "success";

+ 15 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/ykyy/service/YkyyService.java

@ -317,6 +317,21 @@ public class YkyyService {
    }
    /**
     * 查询医生咨询价格
     * @param doctorId
     * @param type
     * @return
     */
    public String GetVasPriceByTypeForJkzl(String doctorId,int type){
        String response="";
        String url = yktUrl_90+"api/Share/GetVasPriceByTypeForJkzl?doctorId="+doctorId+"&type="+type;
        response = httpClientUtil.get(url,"GBK");
        logger.info("获取服务价格:"+response);
        return response;
    }
    /**
     *获取家庭成员信息
     *

+ 7 - 5
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -254,17 +254,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            businessOrderDO.setPcCallbackUrl("https://intel.yanketong.com/ims-web/#/yk/consult/record?outpatientId="+businessOrderDO.getRelationCode()+"&verifyCode=");
        }
        List<WlyyHospitalSysDictDO> hospitalSysDictDOS = hospitalSysDictDao.findByDictName("WX_MONEY");
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YKTCONTROL");
        String totalFee = null;
        if (hospitalSysDictDOS!=null&&hospitalSysDictDOS.size()!=0){
            totalFee= hospitalSysDictDOS.get(0).getDictValue();
        if (businessOrderDO!=null&&businessOrderDO.getPayPrice()==null){
            String totalFee = null;
            if (hospitalSysDictDOS!=null&&hospitalSysDictDOS.size()!=0){
                totalFee= hospitalSysDictDOS.get(0).getDictValue();
            }
            businessOrderDO.setPayPrice(StringUtils.isNoneBlank(totalFee)?Double.parseDouble(totalFee):0.0);
        }
        businessOrderDO.setPayPrice(StringUtils.isNoneBlank(totalFee)?Double.parseDouble(totalFee):0.0);
        businessOrderDO = businessOrderDao.save(businessOrderDO);
        String patient = businessOrderDO.getPatient();
        BasePatientDO basePatientDO = patientDao.findById(patient);
        String orderNo = businessOrderDO.getOrderNo();
        String patientId = "";
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YKTCONTROL");
        if (StringUtils.isNoneBlank(basePatientDO.getYktId())){
            patientId = basePatientDO.getYktId();
        }else {

+ 3 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -1,6 +1,5 @@
package com.yihu.jw.entity;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
@ -19,13 +18,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
//==========mysql 环境 id策略======================================================
    @GeneratedValue(generator = "generator")
 /*   @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)
    @Column(name = "id", unique = true, nullable = false)*/
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
   /*@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 67 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java

@ -256,6 +256,27 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
     *眼科同医生id
     */
    private String yktDoctorId;
    /**
     * 图文复诊号别
     */
    private String twfzChargeType;
    /**
     * 视频复诊号别
     */
    private String spfzChargeType;
    /**
     * 图文咨询号别
     */
    private String twzxChargeType;
    /**
     * 视频咨询号别
     */
    private String spzxChargeType;
    /**
     * 协同复诊号别
     */
    private String xtfzChargeType;
    @Column(name = "YKT_DOCTOR_ID")
    public String getYktDoctorId() {
        return yktDoctorId;
@ -657,4 +678,50 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
    public void setCaFlag(Integer caFlag) {
        this.caFlag = caFlag;
    }
    @Column(name = "twfz_charge_type")
    public String getTwfzChargeType() {
        return twfzChargeType;
    }
    public void setTwfzChargeType(String twfzChargeType) {
        this.twfzChargeType = twfzChargeType;
    }
    @Column(name = "spfz_charge_type")
    public String getSpfzChargeType() {
        return spfzChargeType;
    }
    public void setSpfzChargeType(String spfzChargeType) {
        this.spfzChargeType = spfzChargeType;
    }
    @Column(name = "twzx_charge_type")
    public String getTwzxChargeType() {
        return twzxChargeType;
    }
    public void setTwzxChargeType(String twzxChargeType) {
        this.twzxChargeType = twzxChargeType;
    }
    @Column(name = "spzx_charge_type")
    public String getSpzxChargeType() {
        return spzxChargeType;
    }
    public void setSpzxChargeType(String spzxChargeType) {
        this.spzxChargeType = spzxChargeType;
    }
    @Column(name = "xtfz_charge_type")
    public String getXtfzChargeType() {
        return xtfzChargeType;
    }
    public void setXtfzChargeType(String xtfzChargeType) {
        this.xtfzChargeType = xtfzChargeType;
    }
}

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

@ -1406,6 +1406,8 @@ public class BaseHospitalRequestMapping {
        public static final String findPrivateDict  = "/findPrivateDict";
        public static final String savePrivateDict = "/savePrivateDict";
        public static final String delPrivateDict = "/delPrivateDict";
        public static final String findHospitalInfo = "/findHospitalInfo";
        public static final String synYktZxPrice = "/synYktZxPrice";
    }
    /**

+ 66 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorVO.java

@ -196,6 +196,32 @@ public class BaseDoctorVO extends UuidIdentityVOWithOperator {
    @ApiModelProperty("医生归属科室")
    private List<String> department;
    /**
     * 图文复诊号别
     */
    @ApiModelProperty("图文复诊号别")
    private String twfzChargeType;
    /**
     * 视频复诊号别
     */
    @ApiModelProperty("视频复诊号别")
    private String spfzChargeType;
    /**
     * 图文咨询号别
     */
    @ApiModelProperty("图文咨询号别")
    private String twzxChargeType;
    /**
     * 视频咨询号别
     */
    @ApiModelProperty("视频咨询号别")
    private String spzxChargeType;
    /**
     * 协同复诊号别
     */
    @ApiModelProperty("协同复诊号别")
    private String xtfzChargeType;
    /**
     * 上线下线状态
     */
@ -424,4 +450,44 @@ public class BaseDoctorVO extends UuidIdentityVOWithOperator {
    public void setOnline(String online) {
        this.online = online;
    }
    public String getTwfzChargeType() {
        return twfzChargeType;
    }
    public void setTwfzChargeType(String twfzChargeType) {
        this.twfzChargeType = twfzChargeType;
    }
    public String getSpfzChargeType() {
        return spfzChargeType;
    }
    public void setSpfzChargeType(String spfzChargeType) {
        this.spfzChargeType = spfzChargeType;
    }
    public String getTwzxChargeType() {
        return twzxChargeType;
    }
    public void setTwzxChargeType(String twzxChargeType) {
        this.twzxChargeType = twzxChargeType;
    }
    public String getSpzxChargeType() {
        return spzxChargeType;
    }
    public void setSpzxChargeType(String spzxChargeType) {
        this.spzxChargeType = spzxChargeType;
    }
    public String getXtfzChargeType() {
        return xtfzChargeType;
    }
    public void setXtfzChargeType(String xtfzChargeType) {
        this.xtfzChargeType = xtfzChargeType;
    }
}

+ 5 - 7
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/AesEncryptUtils.java

@ -1,13 +1,10 @@
package com.yihu.jw.gateway;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.codec.binary.Base64;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec;
import java.util.HashMap;
import java.util.Map;
/**
 * 前后端数据传输加密工具类
@ -66,10 +63,11 @@ public class AesEncryptUtils {
 
 
    public static void main(String[] args) throws Exception {
        Map map=new HashMap<String,String>();
        map.put("hospital","350211A1002");
        map.put("dictName","consultClose");
        String content = JSONObject.toJSONString(map);
        /*Map map=new HashMap<String,String>();
        map.put("idcard","350322198812052545");
        map.put("price","1");
        map.put("type","1");*/
        String content = "{\"idcard\":\"350322198812052545\",\"price\":\"1\",\"type\":\"1\"}";
        System.out.println("加密前:" + content);
 
        String encrypt = encrypt(content, KEY);

+ 36 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -1755,9 +1755,11 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                if (familyJson.getString("code").equalsIgnoreCase("200")){
                                    JSONObject object1 = familyJson.getJSONObject("data");
                                    JSONArray list = object1.getJSONArray("list");
                                    List<String> iliness = new ArrayList<>();
                                    if (list!=null&&list.size()!=0){
                                        for (int i=0;i<list.size();i++){
                                            JSONObject family = list.getJSONObject(i);
                                            iliness.add(family.getString("ILLNESS"));
                                            if (family.getString("ILLNESS").equalsIgnoreCase("本人")||tel.equalsIgnoreCase(family.getString("TEL"))){
                                                basePatientDO.setDel("1");
                                                basePatientDO.setName(family.getString("NAME"));
@ -1807,11 +1809,45 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                        basePatientDO.setPatientStatus("1");
                                        basePatientDao.save(basePatientDO);
                                    }
                                    String birdth = com.yihu.jw.util.idcard.IdCardUtil.getBirthdayForIdcardStr(basePatientDO.getIdcard());
                                    Integer age = com.yihu.jw.util.idcard.IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard());
                                    Integer sex = basePatientDO.getSex()!=null?basePatientDO.getSex():0;
                                    if (iliness!=null&&iliness.size()!=0){
                                        if (!iliness.contains("本人")){
                                            ykyyService.addFamily(basePatientDO.getUserId(),basePatientDO.getIdcard(),basePatientDO.getName(),sex+"",birdth,age+"",basePatientDO.getMobile());
                                        }
                                    }else {
                                        ykyyService.addFamily(basePatientDO.getUserId(),basePatientDO.getIdcard(),basePatientDO.getName(),sex+"",birdth,age+"",basePatientDO.getMobile());
                                    }
                                }
                            }else {
                                BasePatientDO basePatientDO1 = basePatientDOS.get(0);
                                basePatientDO1.setUserId(userId);
                                basePatientDao.save(basePatientDO1);
                                String familyList = ykyyService.getFamilyList(null,userId);
                                JSONObject familyJson = JSONObject.parseObject(familyList);
                                if (familyJson.getString("code").equalsIgnoreCase("200")){
                                    JSONObject object1 = familyJson.getJSONObject("data");
                                    JSONArray list = object1.getJSONArray("list");
                                    List<String> iliness = new ArrayList<>();
                                    if (list!=null&&list.size()!=0){
                                        for (int i=0;i<list.size();i++) {
                                            JSONObject family = list.getJSONObject(i);
                                            iliness.add(family.getString("ILLNESS"));
                                        }
                                    }
                                    String birdth = com.yihu.jw.util.idcard.IdCardUtil.getBirthdayForIdcardStr(basePatientDO1.getIdcard());
                                    Integer age = com.yihu.jw.util.idcard.IdCardUtil.getAgeForIdcard(basePatientDO1.getIdcard());
                                    Integer sex = basePatientDO.getSex()!=null?basePatientDO.getSex():0;
                                    if (iliness!=null&&iliness.size()!=0){
                                        if (!iliness.contains("本人")){
                                            ykyyService.addFamily(basePatientDO1.getUserId(),basePatientDO1.getIdcard(),basePatientDO1.getName(),sex+"",birdth,age+"",basePatientDO1.getMobile());
                                        }
                                    }else {
                                        ykyyService.addFamily(basePatientDO1.getUserId(),basePatientDO1.getIdcard(),basePatientDO1.getName(),sex+"",birdth,age+"",basePatientDO1.getMobile());
                                    }
                                }
                            }
                        }
                    }

+ 5 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java

@ -19,6 +19,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -34,6 +35,9 @@ import java.util.List;
@Api(tags = "基础字典专用,用于各下拉框数据获取", description = "互联网医院")
public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
    @Autowired
    private BaseCityService cityService;
@ -212,7 +216,7 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "/updateYkTDoctor")
    @ApiOperation(value = "同步眼科通医生信息", notes = "同步眼科通医生信息")
    public Envelop updateYkTDoctor() throws Exception {
        return success(ykyyEntranceService.updateYkTDoctor());
        return success(ykyyEntranceService.updateYkTDoctor(fastdfs_file_url));
    }
//    @GetMapping(value = "/test")
//    @ApiOperation(value = "test", notes = "test")

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

@ -18,6 +18,7 @@ import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
@ -161,6 +162,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private WlyyHttpLogService wlyyHttpLogService;
    @Autowired
    private HospitalSystemMessageService hospitalSystemMessageService;
    @Autowired
    private StatisticsEsService statisticsEsService;
@ -1098,4 +1101,45 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        return wlyyHttpLogService.findLog(startTime,endTime,interfaceName,patient,doctor,page,pageSize);
    }
    @PostMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findHospitalInfo)
    @ApiOperation(value = "查询医院统计信息", notes = "查询医院统计信息")
    public ObjEnvelop selectHospitalInfo(@ApiParam(name = "doctorId", value = "医生id")
                                          @RequestParam(value = "doctorId", required = true)String doctorId,
                                         @ApiParam(name = "orgCode", value = "医院code")
                                         @RequestParam(value = "orgCode", required = true)String orgCode) throws Exception{
        JSONObject object = prescriptionService.selectHospitalInfo(doctorId,orgCode);
        String date = DateUtil.getStringDateShort();
        //服务评分
        JSONObject jsonObject = statisticsEsService.getScoreList(null,date,2,"350200","4");
        if (jsonObject!=null){
            com.alibaba.fastjson.JSONArray array  = jsonObject.getJSONArray("resultList");
            if (array!=null&&array.size()!=0){
                JSONObject object1 = array.getJSONObject(0);
                object.put("scoreRate",object1.getString("scoreRate"));
            }else {
                object.put("scoreRate",null);
            }
        }else {
            object.put("scoreRate",null);
        }
        return success(object);
    }
    @PostMapping(value = BaseHospitalRequestMapping.PatientNoLogin.synYktZxPrice)
    @ApiOperation(value = "同步眼科通医生价格", notes = "同步眼科通医生价格")
    public Envelop synYktZxPrice(@ApiParam(name = "idcard", value = "医生身份证")
                                         @RequestParam(value = "idcard", required = false)String idcard,
                                         @ApiParam(name = "price", value = "价格")
                                         @RequestParam(value = "price", required = false)Integer price,
                                    @ApiParam(name = "type", value = "类型")
                                        @RequestParam(value = "type", required = false)Integer type,
                                    @ApiParam(name = "flag", value = "同步所有医生价格")
                                        @RequestParam(value = "flag", required = false)String flag) throws Exception{
        String object = prescriptionService.synYktZxPrice(idcard,price,type,flag);
        return success(object);
    }
}

+ 2 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -137,6 +137,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "endTime",required = false) String endTime,
                                          @ApiParam(name = "ksdm", value = "科室代码")
                                              @RequestParam(value = "ksdm",required = false) String ksdm) throws Exception {
        startTime = startTime+" 00:00:00";
        endTime =endTime+" 23:59:59";
        List<WlyyOutpatientVO> vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag,ksdm);
        return success(vos);
    }

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

@ -216,7 +216,7 @@ es:
    Statistics: hlw_quota_test
  type:
    Statistics: hlw_quota_test
  host:  http://172.26.0.55:9200
  host:  http://172.26.0.55:9000
  tHost: 172.26.0.55:9300
  clusterName: jkzl
  securityUser: lion:jkzlehr