Przeglądaj źródła

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

mengkang 4 lat temu
rodzic
commit
a944c5cbec
17 zmienionych plików z 545 dodań i 211 usunięć
  1. 7 0
      business/base-service/pom.xml
  2. 259 144
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 12 8
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java
  4. 3 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  5. 7 5
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java
  6. 4 4
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  7. 20 12
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  8. 52 0
      business/base-service/src/main/java/com/yihu/jw/order/pay/ylz/YlzPayService.java
  9. 3 6
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  10. 37 2
      common/common-util/src/main/java/com/yihu/jw/util/wechat/WeiXinPayUtils.java
  11. 68 0
      common/common-util/src/main/java/com/yihu/jw/util/wechat/wxhttp/HttpUtil.java
  12. 0 2
      gateway/ag-basic/src/main/resources/application.yml
  13. 11 0
      server/svr-authentication/pom.xml
  14. 17 15
      server/svr-authentication/src/main/resources/application.yml
  15. 22 1
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java
  16. 6 6
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  17. 17 5
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

+ 7 - 0
business/base-service/pom.xml

@ -93,6 +93,13 @@
            <version>1.0</version>
        </dependency>
        <!--解析html-->
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.11.2</version>
        </dependency>
        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>

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

@ -78,8 +78,12 @@ import com.ylzinfo.ehc.trans.TransResponse;
import jxl.write.*;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.xml.XMLSerializer;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -502,10 +506,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param size
     * @return
     */
    public MixEnvelop findPrescriptionList(String patient, String status,String startTime, String endTime, Integer page, Integer size){
    public MixEnvelop findPrescriptionList(String patient, String status,String startTime, String endTime, Integer page, Integer size,String wxId){
        String totalSql ="SELECT " +
                " count(1) AS total " +
                " count(1) AS \"total\" " +
                " FROM " +
                " wlyy_prescription p ";
        totalSql += " WHERE 1=1 ";
@ -516,10 +520,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            totalSql+=" AND p.status IN ("+status+")";
        }
        if(StringUtils.isNotBlank(startTime)){
            totalSql += " AND create_time >='"+startTime+" 00:00:00'";
            if("xm_ykyy_wx".equals(wxId)){
                totalSql +=" and create_time >= to_date('"+startTime+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            }else {
                totalSql += " AND create_time >='"+startTime+" 00:00:00'";
            }
        }
        if(StringUtils.isNotBlank(endTime)){
            totalSql += " AND create_time <='"+endTime+" 23:59:59'";
            if("xm_ykyy_wx".equals(wxId)){
                totalSql +=" and create_time <= to_date('"+startTime+" 23:59:59','YYYY-MM-DD HH24:MI:SS')";
            }else {
                totalSql += " AND create_time <='"+endTime+" 23:59:59'";
            }
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
@ -529,48 +543,48 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        String sql ="SELECT " +
                " p.id, " +
                " p.real_order AS realOrder," +
                " p.origin_real_order AS originRealOrder," +
                " p.adm_no AS admNo," +
                " p.origin_adm_no AS originAdmNo," +
                " p.serial_no AS serialNo," +
                " p.type AS type, " +
                " p.patient_code AS patientCode, " +
                " p.patient_name AS patientName, " +
                " p.ssc AS ssc, " +
                " p.doctor AS doctor, " +
                " p.doctor_name AS doctorName, " +
                " p.`status` AS `status`, " +
                " p.mk_fail_reason AS mkFailReason, " +
                " p.mk_time AS mk_time, " +
                " p.prescribe_reason AS prescribeReason, " +
                " p.prescribe_time AS prescribeTime, " +
                " p.pay_time AS payTime, " +
                " p.dosage_time AS dosageTime, " +
                " p.finish_time AS finishTime, " +
                " p.create_time AS createTime, " +
                " p.dept AS dept, " +
                " p.dept_name AS deptName, " +
                " p.hospital AS hospital, " +
                " p.hospital_name AS hospitalName, " +
                " p.consult AS consult, " +
                " p.dispensary_type AS dispensaryType, " +
                " p.reason AS reason, " +
                " p.remark AS remark, " +
                " p.cancel_reason AS cancelReason, " +
                " p.ca_cert_data AS caCertData, " +
                " p.ca_message AS caMessage, " +
                " p.digital_sign_no AS digitalSignNo, " +
                " p.original_data_abstract AS originalDataAbstract, " +
                " p.str_original_data AS strOriginalData, " +
                " p.his_dept_code AS hisDeptCode, " +
                " p.his_doctor_code AS hisDoctorCode, " +
                " p.his_gister_type_code AS hisGisterTypeCode, " +
                " p.his_rate_type_code AS hisRateTypeCode, " +
                " p.his_hospital AS hisHospital, " +
                " p.his_register_fee AS hisRegisterFee, " +
                " p.pay_status AS payStatus " +
                " p.id as \"id\", " +
                " p.real_order AS \"realOrder\"," +
                " p.origin_real_order AS \"originRealOrder\"," +
                " p.adm_no AS \"admNo\"," +
                " p.origin_adm_no AS \"originAdmNo\"," +
                " p.serial_no AS \"serialNo\"," +
                " p.type AS \"type\", " +
                " p.patient_code AS \"patientCode\", " +
                " p.patient_name AS \"patientName\", " +
                " p.ssc AS \"ssc\", " +
                " p.doctor AS \"doctor\", " +
                " p.doctor_name AS \"doctorName\", " +
                " p.status AS \"status\", " +
                " p.mk_fail_reason AS \"mkFailReason\", " +
                " p.mk_time AS \"mk_time\", " +
                " p.prescribe_reason AS \"prescribeReason\", " +
                " p.prescribe_time AS \"prescribeTime\", " +
                " p.pay_time AS \"payTime\", " +
                " p.dosage_time AS \"dosageTime\", " +
                " p.finish_time AS \"finishTime\", " +
                " p.create_time AS \"createTime\", " +
                " p.dept AS \"dept\", " +
                " p.dept_name AS \"deptName\", " +
                " p.hospital AS \"hospital\", " +
                " p.hospital_name AS \"hospitalName\", " +
                " p.consult AS \"consult\", " +
                " p.dispensary_type AS \"dispensaryType\", " +
                " p.reason AS \"reason\", " +
                " p.remark AS \"remark\", " +
                " p.cancel_reason AS \"cancelReason\", " +
                " p.ca_cert_data AS \"caCertData\", " +
                " p.ca_message AS \"caMessage\", " +
                " p.digital_sign_no AS \"digitalSignNo\", " +
                " p.original_data_abstract AS \"originalDataAbstract\", " +
                " p.str_original_data AS \"strOriginalData\", " +
                " p.his_dept_code AS \"hisDeptCode\", " +
                " p.his_doctor_code AS \"hisDoctorCode\", " +
                " p.his_gister_type_code AS \"hisGisterTypeCode\", " +
                " p.his_rate_type_code AS \"hisRateTypeCode\", " +
                " p.his_hospital AS \"hisHospital\", " +
                " p.his_register_fee AS \"hisRegisterFee\", " +
                " p.pay_status AS \"payStatus\" " +
                " FROM " +
                " wlyy_prescription p " +
                " WHERE 1=1 ";
@ -581,10 +595,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            sql+=" AND p.status IN ("+status+")";
        }
        if(StringUtils.isNotBlank(startTime)){
            sql += " AND create_time >='"+startTime+" 00:00:00'";
            if("xm_ykyy_wx".equals(wxId)){
                sql +=" and create_time >= to_date('"+startTime+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            }else {
                sql += " AND create_time >='"+startTime+" 00:00:00'";
            }
        }
        if(StringUtils.isNotBlank(endTime)){
            sql += " AND create_time <='"+endTime+" 23:59:59'";
            if("xm_ykyy_wx".equals(wxId)){
                sql +=" and create_time <= to_date('"+startTime+" 23:59:59','YYYY-MM-DD HH24:MI:SS')";
            }else {
                sql += " AND create_time <='"+endTime+" 23:59:59'";
            }
        }
        sql += " LIMIT " + (page - 1) * size + "," + size + "";
        List<WlyyPrescriptionVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyyPrescriptionVO.class));
@ -3149,7 +3171,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param operator 1居民 2医生
     * @return
     */
    public Map<String,Object> cancelOutPatient(String outPatientId,String cancelType,String cancelValue,String cancelRemark,Integer operator){
    public Map<String,Object> cancelOutPatient(String outPatientId,String cancelType,String cancelValue,String cancelRemark,Integer operator,String wxId) {
        Map<String,Object> rs = new HashedMap();
        //判断医生是否接诊
@ -3170,16 +3192,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //更改门诊状态
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outPatientId);
        wlyyOutpatientDO.setStatus("-1");
        String description = null;
        if (1 == operator){
            //居民取消
            wlyyOutpatientDO.setPatientCancelRemark(cancelRemark);
            wlyyOutpatientDO.setPatientCancelType(cancelType);
            wlyyOutpatientDO.setPatientCancelValue(cancelValue);
            description = "居民取消";
        }else{
            //医生拒绝接诊
            wlyyOutpatientDO.setDoctorCancelRemark(cancelRemark);
            wlyyOutpatientDO.setDoctorCancelType(cancelType);
            wlyyOutpatientDO.setDoctorCancelValue(cancelValue);
            description = "医生拒绝接诊";
        }
        outpatientDao.save(wlyyOutpatientDO);
@ -3189,7 +3214,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(list!=null&&list.size()>0){
            patientRegisterTimeDao.delete(list);
        }
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
        try {
            if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
                businessOrderService.orderRefund(wxId,wlyyOutpatientDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),description);
            }else if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                businessOrderService.ylzOrderRefund(wxId,wlyyOutpatientDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),description);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        rs.put("code",1);
        rs.put("mes","取消成功");
        return  rs;
@ -3342,14 +3377,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public List<Map<String,Object>> findWaitingRoomPatient(String dept, Integer type) {
        
        String sql ="SELECT " +
                "patient.id AS id," +
                "patient.name AS name," +
                "patient.sex AS sex," +
                "patient.idcard AS idcard," +
                "patient.photo AS photo," +
                "waitingroom.reservation_type AS type," +
                "waitingroom.consult_type AS consult_type," +
                "waitingroom.reservation_time AS reservation_time " +
                "patient.id AS \"id\"," +
                "patient.name AS \"name\"," +
                "patient.sex AS \"sex\"," +
                "patient.idcard AS \"idcard\"," +
                "patient.photo AS \"photo\"," +
                "waitingroom.reservation_type AS \"type\"," +
                "waitingroom.consult_type AS \"consult_type\"," +
                "waitingroom.reservation_time AS \"reservation_time\" " +
                "FROM " +
                "wlyy_hospital_waiting_room waitingroom," +
                "base_patient patient " +
@ -3367,11 +3402,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return list;
    }
    
    public JSONObject findWaitingRoomStatusCount(String dept) {
    public JSONObject findWaitingRoomStatusCount(String dept,String wxId) {
        
        String totalSql = "SELECT count(id) AS total FROM wlyy_hospital_waiting_room WHERE visit_status=1 ";
        totalSql += " AND reservation_time >='"+DateUtil.dateToStrShort(new Date())+" 00:00:00'";
        totalSql += " AND reservation_time <='"+DateUtil.dateToStrShort(new Date())+" 23:59:59'";
        String totalSql = "SELECT count(id) AS \"total\" FROM wlyy_hospital_waiting_room WHERE visit_status=1 ";
        if("xm_ykyy_wx".equals(wxId)){
            totalSql +=" and reservation_time >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            totalSql +=" and reservation_time <= to_date('"+DateUtil.dateToStrShort(new Date())+" 23:59:59','YYYY-MM-DD HH24:MI:SS')";
        }else {
            totalSql += " AND reservation_time >='"+DateUtil.dateToStrShort(new Date())+" 00:00:00'";
            totalSql += " AND reservation_time <='"+DateUtil.dateToStrShort(new Date())+" 23:59:59'";
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
@ -3388,7 +3428,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return result;
    }
    
    public List<JSONObject> findClinicRoomList(String dept,String date,String consult_status) {
    public List<JSONObject> findClinicRoomList(String dept,String date,String consult_status,String wxId) {
        if(StringUtils.isBlank(date)){
            date = DateUtil.getStringDateShort();
        }
@ -3399,7 +3439,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(StringUtils.isNoneBlank(dept)){
            doctorsql = doctorsql + " and dept = '"+dept+"' ";
        }
        doctorsql = doctorsql+ " GROUP BY doctor";
        doctorsql = doctorsql+ " GROUP BY doctor,doctor_name,dept,dept_name";
    
        List<Map<String,Object>> doctorlist = jdbcTemplate.queryForList(doctorsql);
    
@ -3427,24 +3467,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        
        //获取预约了今天的候诊居民
        String waitingSql ="SELECT count(op.id) AS waitCount," +
                "room.doctor AS doctor, " +
                "room.doctor_name AS doctorName " +
        String waitingSql ="SELECT count(op.id) AS \"waitCount\"," +
                "room.doctor AS \"doctor\", " +
                "room.doctor_name AS \"doctorName\" " +
                "FROM wlyy_outpatient op,wlyy_hospital_waiting_room room " +
                "WHERE op.status=0 AND room.outpatient_id=op.id AND room.consult_type=2 " +
                "AND room.doctor IS NOT NULL ";
        if(StringUtils.isNoneBlank(dept)){
            waitingSql = waitingSql + " and op.dept = '"+dept+"' ";
        }
        waitingSql = waitingSql + "AND room.reservation_time>='"+date+" 00:00:00' AND room.reservation_time<='"+date+" 23:59:59' GROUP BY room.doctor; ";
    
        if("xm_ykyy_wx".equals(wxId)){
            waitingSql +=" AND room.reservation_time >= to_date('"+date+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            waitingSql +=" AND room.reservation_time <= to_date('"+date+" 23:59:59','YYYY-MM-DD HH24:MI:SS') GROUP BY room.doctor,room.doctor_name";
        }else {
            waitingSql = waitingSql + "AND room.reservation_time>='"+date+" 00:00:00' AND room.reservation_time<='"+date+" 23:59:59' GROUP BY room.doctor,room.doctor_name; ";
        }
        List<Map<String,Object>> waitinglist = jdbcTemplate.queryForList(waitingSql);
        if(waitinglist!=null&&waitinglist.size()>0){
            //根据身份证计算年龄
            for(Map<String,Object> waitObj :waitinglist){
                String doctor = (String) waitObj.get("doctor");
                if(StringUtils.isNoneBlank(doctor)){
                    Long waitCount = (Long) waitObj.get("waitCount");
                    Long waitCount = Long.parseLong(waitObj.get("waitCount").toString()) ;
                    if(result.keySet().contains(doctor)){
                        result.get(doctor).put("waiting_count",waitCount);
                    }else{
@ -3467,18 +3513,21 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        
        //获取进行中的居民
        String onlineSql ="SELECT " +
                "room.outpatient_id AS id," +
                "room.patient_id AS patient_id," +
                "room.patient_name AS patient_name," +
                "patient.sex AS sex," +
                "patient.idcard AS idcard," +
                "patient.photo AS photo," +
                "patient.birthday AS birthday," +
                "room.consult_type AS consult_type," +
                "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS time," +
                "TIMESTAMPDIFF(MINUTE, room.reservation_time,NOW()) AS time_cost," +
                "room.doctor AS doctor, " +
                "room.doctor_name AS doctorName " +
                "room.outpatient_id AS \"id\"," +
                "room.patient_id AS \"patient_id\"," +
                "room.patient_name AS \"patient_name\"," +
                "patient.sex AS \"sex\"," +
                "patient.idcard AS \"idcard\"," +
                "patient.photo AS \"photo\"," +
                "patient.birthday AS \"birthday\"," +
                "room.consult_type AS \"consult_type\",";
        if("xm_ykyy_wx".equals(wxId)){
            onlineSql = onlineSql + "to_char(room.reservation_time,'YYYY-MM-DD hh24:mi:ss')  AS \"time\",ROUND(TO_NUMBER(to_date(room.reservation_time,'yyyy-mm-dd hh24:mi:ss')-sysdate ) * 24 * 60) as \"time_cost\",";
        }else{
            onlineSql = onlineSql + "date_format(room.reservation_time,'%Y-%m-%d %H:%i:%S' )  AS \"time\",TIMESTAMPDIFF(MINUTE, room.reservation_time,NOW()) AS \"time_cost\",";
        }
                onlineSql=onlineSql+"room.doctor AS \"doctor\", " +
                "room.doctor_name AS \"doctorName\" " +
                "FROM " +
                "wlyy_hospital_waiting_room room," +
                "base_patient patient," +
@ -3493,18 +3542,40 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(StringUtils.isNoneBlank(dept)){
            onlineSql = onlineSql + " and outpatient.dept = '"+dept+"' ";
        }
/*
        onlineSql = onlineSql+ "AND room.reservation_time>='"+date+" 00:00:00' AND room.reservation_time<='"+date+" 23:59:59' GROUP BY room.doctor";
        
*/
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            onlineSql +=" AND room.reservation_time >= to_date('"+date+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            onlineSql +=" AND room.reservation_time <= to_date('"+date+" 23:59:59','YYYY-MM-DD HH24:MI:SS') ";
        }else {
            onlineSql = onlineSql+ "AND room.reservation_time>='"+date+" 00:00:00' AND room.reservation_time<='"+date+" 23:59:59' ";
        }
        List<Map<String,Object>> onlinelist = jdbcTemplate.queryForList(onlineSql);
        if(onlinelist!=null&&onlinelist.size()>0){
            //根据身份证计算年龄
            for(Map<String,Object> onlineObj :onlinelist){
            List<String> doctors = new ArrayList<>();
            List<Map<String,Object>> onlines = new ArrayList<>();
            for (Map<String,Object> onlineObj :onlinelist){
                String doctor = (String) onlineObj.get("doctor");
                if (doctors!=null&&doctors.size()!=0){
                    if (!doctors.contains(doctor)){
                        doctors.add(doctor);
                        onlines.add(onlineObj);
                    }
                }else {
                    doctors.add(doctor);
                    onlines.add(onlineObj);
                }
            }
            for(Map<String,Object> onlineObj :onlines){
                String doctor = (String) onlineObj.get("doctor");
                if(StringUtils.isNoneBlank(doctor)){
                    if(result.keySet().contains(doctor)){
                        result.get(doctor).put("visit_status",2);
                        result.get(doctor).put("patient_name",(String) onlineObj.get("patient_name"));
                        result.get(doctor).put("time_cost",(Long) onlineObj.get("time_cost"));
                        result.get(doctor).put("time_cost",Long.parseLong(onlineObj.get("time_cost").toString()));
                    }else{
                        JSONObject jsonObject = new JSONObject();
                        jsonObject.put("id",doctor);
@ -3517,7 +3588,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        jsonObject.put("visit_status",2);
                        jsonObject.put("waiting_count",0);
                        jsonObject.put("patient_name",(String) onlineObj.get("patient_name"));
                        jsonObject.put("time_cost",(Long) onlineObj.get("time_cost"));
                        jsonObject.put("time_cost",Long.parseLong(onlineObj.get("time_cost").toString()));
                        result.put(doctor,jsonObject);
                    }
                }
@ -3988,12 +4059,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public Map<String,Object> updatePatientInfo(String patient,String name,String idcard,String ssc){
    public Map<String,Object> updatePatientInfo(String patient,String name,String idcard,String ssc,Integer sex,String townCode,String townName,String committeeCode,String committeeName,String address){
        Map<String,Object> rs = new HashedMap();
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        basePatientDO.setName(name);
        basePatientDO.setIdcard(idcard);
        basePatientDO.setSex(sex);
        basePatientDO.setTownCode(townCode);
        basePatientDO.setTownName(townName);
        basePatientDO.setCommitteeCode(committeeCode);
        basePatientDO.setCommitteeName(committeeName);
        basePatientDO.setAddress(address);
        basePatientDO = basePatientDao.save(basePatientDO);
        if (patientMedicareCardDO!=null){
            patientMedicareCardDO.setCode(ssc);
@ -4308,7 +4385,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        Long videoOnlineCount = 0l;
        if (rstotal != null && rstotal.size() > 0) {
            videoOnlineCount = (Long) rstotal.get(0).get("total");
            videoOnlineCount = Long.parseLong(rstotal.get(0).get("total").toString()) ;
        }
    
        return videoOnlineCount;
@ -4419,9 +4496,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param type 1图文 2视频
     * @return
     */
    public Long getWaitVideoCount(String doctor,String type,String outpatient_type) {
    public Long getWaitVideoCount(String doctor,String type,String outpatient_type,String wxId) {
        String sql ="SELECT " +
                "count(outpatient.id) AS total " +
                "count(outpatient.id) AS \"total\" " +
                "FROM " +
                "wlyy_outpatient outpatient," +
                "base_patient patient " +
@ -4434,11 +4511,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if("1".equals(outpatient_type)){//复诊
            sql =  sql + " AND outpatient.type= '"+type+"' ";
            if("2".equals(type)){//视频复诊才需要判断时间,
                sql =  sql + " AND outpatient.register_date is not null AND  outpatient.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
                if("xm_ykyy_wx".equals(wxId)){
                    sql +=" AND outpatient.register_date is not null and outpatient.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                }else {
                    sql =  sql + " AND outpatient.register_date is not null AND  outpatient.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
                }
            }
        }else if("2".equals(outpatient_type)){
            //协同门诊也需要判断时间
            sql =  sql + " AND outpatient.register_date is not null AND  outpatient.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
            if("xm_ykyy_wx".equals(wxId)){
                sql +=" AND outpatient.register_date is not null and outpatient.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            }else {
                sql =  sql + " AND outpatient.register_date is not null AND  outpatient.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
            }
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
    
@ -4777,7 +4862,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param status
     * @return
     */
    public Envelop findByGeneralDoctor(String generalDoctor,String startDate,String endDate,String status,String sort,Integer page,Integer size){
    public Envelop findByGeneralDoctor(String generalDoctor,String startDate,String endDate,String status,String sort,Integer page,Integer size,String wxId){
        String sqlTotal ="SELECT " +
                " count(1) AS total "+
@ -4786,10 +4871,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " WHERE " +
                " o.general_doctor = '"+generalDoctor+"'";
        if(StringUtils.isNotBlank(startDate)){
            sqlTotal += " AND o.register_date >='"+startDate+" 00:00:00' ";
            if("xm_ykyy_wx".equals(wxId)){
                sqlTotal +=" and o.register_date >= to_date('"+startDate+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            }else {
                sqlTotal += " AND o.register_date >='"+startDate+" 00:00:00' ";
            }
        }
        if(StringUtils.isNotBlank(endDate)){
            sqlTotal += " AND o.register_date <='"+endDate+" 23:59:59' ";
            if("xm_ykyy_wx".equals(wxId)){
                sqlTotal +=" and o.register_date <= to_date('"+endDate+" 23:59:59','YYYY-MM-DD HH24:MI:SS')";
            }else {
                sqlTotal += " AND o.register_date <='"+endDate+" 23:59:59' ";
            }
        }
        if(StringUtils.isNotBlank(status)){
            sqlTotal += " AND o.status ='"+status+"'";
@ -4799,66 +4894,74 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        Long total = 0l;
        if (rstotal != null && rstotal.size() > 0) {
            total = (Long) rstotal.get(0).get("total");
            total = Long.parseLong(rstotal.get(0).get("total").toString());
        }
        String sql ="SELECT " +
                " o.id AS id, " +
                " o.adm_no AS admNo, " +
                " o.origin_adm_no AS originAdmNo, " +
                " o.register_no AS registerNo, " +
                " o.origin_register_no AS originRegisterNo, " +
                " o.origin_con_no AS originConNo, " +
                " o.con_no AS conNo, " +
                " o.outpatient_type AS outpatientType, " +
                " o.type AS type, " +
                " o.hospital AS hospital, " +
                " o.hospital_name AS hospitalName, " +
                " o.win_no AS winNo, " +
                " o.dept AS dept, " +
                " o.dept_name AS deptName, " +
                " o.patient AS patient, " +
                " o.patient_name AS patientName, " +
                " o.doctor AS doctor, " +
                " o.doctor_name AS doctorName, " +
                " o.general_doctor AS generalDoctor, " +
                " o.general_doctor_name AS generalDoctorName, " +
                " o.idcard AS idcard, " +
                " o.card_no AS cardNo, " +
                " o.mjz AS mjz, " +
                " o.icd10 AS icd10, "+
                " o.icd10_name AS icd10Name, " +
                " o.advice AS advice, " +
                " o.adm_date AS admDate, " +
                " o.description AS description, " +
                " o.disease_img AS diseaseImg, " +
                " o.create_time AS createTime, " +
                " o.con_date AS conDate, " +
                " o.patient_cancel_type AS patientCancelType, " +
                " o.patient_cancel_value AS patientCancelValue, " +
                " o.patient_cancel_remark AS patientCancelRemark, " +
                " o.register_date AS registerDate, " +
                " o.`status` AS STATUS, " +
                " o.evaluate_status AS evaluateStatus " +
                " o.id AS \"id\", " +
                " o.adm_no AS \"admNo\", " +
                " o.origin_adm_no AS \"originAdmNo\", " +
                " o.register_no AS \"registerNo\", " +
                " o.origin_register_no AS \"originRegisterNo\", " +
                " o.origin_con_no AS \"originConNo\", " +
                " o.con_no AS \"conNo\", " +
                " o.outpatient_type AS \"outpatientType\", " +
                " o.type AS \"type\", " +
                " o.hospital AS \"hospital\", " +
                " o.hospital_name AS \"hospitalName\", " +
                " o.win_no AS \"winNo\", " +
                " o.dept AS \"dept\", " +
                " o.dept_name AS \"deptName\", " +
                " o.patient AS \"patient\", " +
                " o.patient_name AS \"patientName\", " +
                " o.doctor AS \"doctor\", " +
                " o.doctor_name AS \"doctorName\", " +
                " o.general_doctor AS \"generalDoctor\", " +
                " o.general_doctor_name AS \"generalDoctorName\", " +
                " o.idcard AS \"idcard\", " +
                " o.card_no AS \"cardNo\", " +
                " o.mjz AS \"mjz\", " +
                " o.icd10 AS \"icd10\", "+
                " o.icd10_name AS \"icd10Name\", " +
                " o.advice AS \"advice\", " +
                " o.adm_date AS \"admDate\", " +
                " o.description AS \"description\", " +
                " o.disease_img AS \"diseaseImg\", " +
                " o.create_time AS \"createTime\", " +
                " o.con_date AS \"conDate\", " +
                " o.patient_cancel_type AS \"patientCancelType\", " +
                " o.patient_cancel_value AS \"patientCancelValue\", " +
                " o.patient_cancel_remark AS \"patientCancelRemark\", " +
                " o.register_date AS \"registerDate\", " +
                " o.status AS \"STATUS\", " +
                " o.evaluate_status AS \"evaluateStatus\" " +
                " FROM " +
                " wlyy_outpatient o " +
                " WHERE " +
                " o.general_doctor = '"+generalDoctor+"'";
        if(StringUtils.isNotBlank(startDate)){
            sql+=" AND o.register_date >='"+startDate+" 00:00:00'";
            if("xm_ykyy_wx".equals(wxId)){
                sql +=" and o.register_date >= to_date('"+startDate+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            }else {
                sql += " AND o.register_date >='"+startDate+" 00:00:00' ";
            }
        }
        if(StringUtils.isNotBlank(endDate)){
            sql+=" AND o.register_date <='"+endDate+" 23:59:59'";
            if("xm_ykyy_wx".equals(wxId)){
                sql +=" and o.register_date <= to_date('"+endDate+" 23:59:59','YYYY-MM-DD HH24:MI:SS')";
            }else {
                sql += " AND o.register_date <='"+endDate+" 23:59:59' ";
            }
        }
        if(StringUtils.isNotBlank(status)){
            sql+=" AND o.status ='"+status+"'";
        }
        if(StringUtils.isNotBlank(sort)){
            sql += " ORDER BY o.register_date "+sort+" LIMIT " + (page - 1) * size + "," + size + "";
            sql += " ORDER BY o.register_date "+sort;
        }else{
            sql += " ORDER BY o.register_date ASC LIMIT " + (page - 1) * size + "," + size + "";
            sql += " ORDER BY o.register_date ASC ";
        }
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,size);
        //List<WlyyOutpatientDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyyOutpatientDO.class));
        return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, total);
    }
@ -4896,7 +4999,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //统计科预约医生
        String sql = "SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " base_doctor d " +
                " JOIN base_doctor_role r ON d.id = r.doctor_code " +
@ -4915,7 +5018,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //统计在线医生
        String onlineSql="SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " base_doctor d " +
                " JOIN base_doctor_role r ON d.id = r.doctor_code " +
@ -4928,7 +5031,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        Long onlineTotal = 0l;
        if (oltotal != null && oltotal.size() > 0) {
            onlineTotal = (Long) oltotal.get(0).get("total");
            onlineTotal = Long.parseLong(oltotal.get(0).get("total").toString());
        }
        rs.put("onlineTotal",onlineTotal);
@ -4949,7 +5052,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        //总数
        String sqlAll = "SELECT " +
                " COUNT(room.outpatient_id) AS total " +
                " COUNT(room.outpatient_id) AS \"total\" " +
                "FROM " +
                "wlyy_hospital_waiting_room room," +
                "wlyy_outpatient outpatient " +
@ -4968,7 +5071,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        //图文复诊
        String imgAll = "SELECT " +
                " COUNT(room.outpatient_id) AS total " +
                " COUNT(room.outpatient_id) AS \"total\" " +
                "FROM " +
                "wlyy_hospital_waiting_room room," +
                "wlyy_outpatient outpatient " +
@ -4987,7 +5090,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        //视频复诊
        String spsql = "SELECT " +
                " COUNT(room.outpatient_id) AS total " +
                " COUNT(room.outpatient_id) AS \"total\" " +
                "FROM " +
                "wlyy_hospital_waiting_room room," +
                "wlyy_outpatient outpatient " +
@ -5007,7 +5110,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        
        //协同门诊
        String xtsql = "SELECT " +
                " COUNT(room.outpatient_id) AS total " +
                " COUNT(room.outpatient_id) AS \"total\" " +
                "FROM " +
                "wlyy_hospital_waiting_room room," +
                "wlyy_outpatient outpatient " +
@ -5892,6 +5995,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                params);
        logger.info("调用电子病历查询接口请求成功,返回值xmlstr:" + returnValue);
        XMLSerializer xmlSerializer = new XMLSerializer();
        net.sf.json.JSON json = xmlSerializer.read(returnValue);
        logger.info("返回json"+json);
        Object retInfo=  ((JSONObject) json).get("HtResponse");
        logger.info("retInfo:"+retInfo);
        if(retInfo!=null){
            JSONObject jsonObject = (JSONObject)retInfo;
            String content =jsonObject.getString("XML_CONT");
            Document doc = Jsoup.parse(content);
            Elements rows = doc.select("table[class=list]").get(0).select("tr");
        }
        return returnValue;
    }

+ 12 - 8
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java

@ -118,14 +118,18 @@ public class XzyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
        String doctorFlag =  doctorMappingDO.getDoctorName()+"/"+doctorMappingDO.getMappingCode();
        JSONArray response =  xzzxEntranceService.registeredOperate(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),doctorDO.getChargeType());
        JSONObject res = response.getJSONObject(0);
        logger.info("挂号结果 res: " + response.toString());
        String rsCode = res.getString("registerNo");
        JSONObject res =  xzzxEntranceService.registeredOperate(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),doctorDO.getChargeType());
        logger.info("挂号结果 res: " + res.toString());
        JSONObject object = res.getJSONObject("returnContents");
        String rsCode = "";
        if (object!=null){
        if ("0".equals(rsCode)) {
        }
        rsCode = object.getString("registerNo");
        if (StringUtils.isNoneBlank(rsCode)) {
            //存储挂号号
            String serialNo = (String) res.get("registerNo");
            String serialNo = object.getString("registerNo");
            outpatientDO.setRegisterNo(serialNo);
            outpatientDO.setAdmDate(new Date());
            logger.info("挂号流水 registerNo: ");
@ -178,9 +182,9 @@ public class XzyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        log.setName("挂号");
        log.setPatient(outpatientDO.getPatient());
        log.setDoctor(doctor);
        log.setResponse(response.toString());
        log.setResponse(res.toString());
        log.setRequest("outPatientId=" + outPatientId + "&doctor=" + doctor);
        log.setStatus(rsCode);
        log.setStatus("1");
        log.setCreateTime(new Date());
        wlyyHttpLogDao.save(log);
        return res;

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

@ -317,7 +317,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            object.put("charge_code",map.get("ypdm"));
            object.put("drugname",map.get("ypmc"));
            object.put("specification",map.get("yfgg"));
            object.put("pack_unit_name",map.get("yfdw"));
            object.put("pack_unit_name",map.get("jldw"));
            object.put("yfdw",map.get("yfdw"));
            object.put("pack_size",map.get("yfbz"));
            object.put("yfsx",map.get("yfsx"));//药房属性
            object.put("ypjl",map.get("ypjl"));//药剂量
@ -373,6 +374,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            JSONObject object = new JSONObject();
            object.put("FREQ_CODE",map.get("pcmc"));
            object.put("FREQ_NAME",map.get("pcmc1"));
            object.put("MRSC",map.get("mrcs"));
            array.add(object);
        }
        return array;

+ 7 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -876,6 +876,7 @@ public class XzzxEntranceService{
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        logger.info("clinicclass:"+clinicclass);
        if (!StringUtils.isEmpty(doctor)&&!doctor.equalsIgnoreCase("null")){
            condition += "<doctor>"+doctor+"</doctor>";
        }
@ -1492,17 +1493,18 @@ public class XzzxEntranceService{
     * @param clinicclass 挂号类别(必填)
     * @return
     */
    public JSONArray registeredOperate(String doctor,String dept,String sickId,String clinicclass){
        JSONArray array = new JSONArray();
    public JSONObject registeredOperate(String doctor,String dept,String sickId,String clinicclass){
        JSONObject jsonObject= new JSONObject();
        String response="";
        String url = entranceUrl+"registered?doctor="+doctor+"&dept="+dept+"&sickId="+sickId+"&clinicclass"+clinicclass;
        logger.info("clinicclass:"+clinicclass);
        String url = entranceUrl+"registered?doctor="+doctor+"&dept="+dept+"&sickId="+sickId+"&clinicclass="+clinicclass;
        response = httpClientUtil.get(url,"GBK");
        logger.info("response:"+response);
        JSONObject object = JSONObject.parseObject(response);
        if (object.getInteger("status")==200){
            array = JSONArray.parseArray(object.getString("obj")).getJSONArray(0);
            jsonObject = JSONObject.parseObject(object.getString("obj"));
        }
        return array;
        return jsonObject;
    }

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

@ -53,9 +53,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.transaction.Transactional;
import java.security.acl.LastOwnerException;
import java.util.*;
/**
@ -1203,7 +1203,7 @@ public class YkyyEntranceService {
     * @return
     */
    public JSONArray findSypc(String pcbm) throws Exception {
        String sql = "select s.pcbm as \"pcbm\",s.pcmc as \"pcmc\",s.pcmc1 as \"pcmc1\" from v_hlw_sypc s where 1=1 ";
        String sql = "select s.mrcs as \"mrcs\",s.pcbm as \"pcbm\",s.pcmc as \"pcmc\",s.pcmc1 as \"pcmc1\" from v_hlw_sypc s where 1=1 ";
        if (StringUtils.isNoneBlank(pcbm)){
            sql+=" and lower(s.pcbm)='"+pcbm.toLowerCase()+"' ";
        }
@ -1803,7 +1803,7 @@ public class YkyyEntranceService {
                    hlwCf02DO.setFYGB(17);//费用归并
                    hlwCf02DO.setZFBL(1.0);//自负比例
                    hlwCf02DO.setYFDW(wlyyPrescriptionInfoVO.getPackUnitName());
                    hlwCf02DO.setMRCS(Integer.parseInt(wlyyPrescriptionInfoVO.getDosage()));//每日次数
                    hlwCf02DO.setMRCS(StringUtils.isNoneBlank(wlyyPrescriptionInfoVO.getGroupNo())?Integer.parseInt(wlyyPrescriptionInfoVO.getGroupNo()):0);//每日次数
                    hlwCf02DO.setYFBZ(wlyyPrescriptionInfoVO.getPackQuantity());
                    hlwCf02DO.setYPYF(wlyyPrescriptionInfoVO.getUsageCode());
                    hlwCf02DO.setGYTJ(wlyyPrescriptionInfoVO.getYpyf());

+ 20 - 12
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -38,6 +38,7 @@ import com.yihu.jw.util.common.QrcodeUtil;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.WeiXinPayUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.ByteToInputStream;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
@ -275,7 +276,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        businessOrderDO.setStatus(0);
        businessOrderDO.setCreateTime(new Date());
        businessOrderDO.setUpdateTime(new Date());
        businessOrderDO.setOrderNo("HLWYY"+businessOrderDO.getOrderType()+System.currentTimeMillis());
        businessOrderDO.setOrderNo("HLWYY"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
        businessOrderDO = businessOrderDao.save(businessOrderDO);
        List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
        String openId = "";
@ -332,13 +333,11 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    public Map<String,Object> refund(Map<String,String> par,String appKey) throws Exception {
        String xml = WeiXinPayUtils.getXmlBeforUnifiedorder(par, appKey);
        Map<String, Object> map = WeiXinPayUtils.refund(xml,true);
        //创建日志记录
        createLog(par,xml,map);
        map.remove("wxPayResult");
        return map;
    public String refund(Map<String,String> par,String appKey) throws Exception {
        String xml= WeiXinPayUtils.getXmlBeforUnifiedorder(par, appKey);
        logger.info("xml:"+xml);
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("REFUND");
        return HttpUtil.doRefund("https://api.mch.weixin.qq.com/secapi/pay/refund",xml,hospitalSysDictDO.getDictCode(),hospitalSysDictDO.getDictValue());
    }
@ -486,7 +485,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        if (patientDO==null){
            throw new Exception("this patient not exit");
        }
        BusinessOrderRefundDO orderRefundDO = new BusinessOrderRefundDO();
        BusinessOrderRefundDO orderRefundDO = orderRefundDao.selectByOrderNo(orderNo);
        if (orderRefundDO==null){
            orderRefundDO = new BusinessOrderRefundDO();
        }
        orderRefundDO.setCreateTime(new Date());
        orderRefundDO.setUpdateTime(new Date());
        orderRefundDO.setStatus(1);
@ -495,12 +497,15 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        orderRefundDO.setRefundPrice(refundPrice);
        orderRefundDO.setAppId(wxWechatDO.getAppId());
        orderRefundDO.setMchId(wxWechatDO.getMchId());
        orderRefundDO.setOutRefundNo("HLWYY"+businessOrderDO.getOrderType()+System.currentTimeMillis());
        orderRefundDO.setOutRefundNo("HLWYY"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
        orderRefundDO.setPatient(patient);
        orderRefundDO.setPatientName(patientDO.getName());
        orderRefundDO.setRefundDesc(description);
        orderRefundDO = orderRefundDao.save(orderRefundDO);
        Map<String,Object> map = refund(wechatId,orderRefundDO.getOrderNo(),orderRefundDO.getOutRefundNo(),orderRefundDO.getOrderPrice().toString(),orderRefundDO.getRefundPrice().toString(),orderRefundDO.getRefundDesc());
        Integer orderPrice = orderRefundDO.getOrderPrice().intValue();
        Integer refundPrice1 = orderRefundDO.getRefundPrice().intValue();
        Map<String,Object> map = refund(wechatId,orderRefundDO.getOrderNo(),orderRefundDO.getOutRefundNo(),orderPrice.toString(),refundPrice1.toString(),orderRefundDO.getRefundDesc());
        logger.info("map"+map);
        if (map.get("return_code").toString().equalsIgnoreCase("SUCCESS")){
            orderRefundDO.setStatus(2);
            orderRefundDO.setRefundTime(new Date());
@ -531,7 +536,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        map.put("refund_fee",refundFee);
        map.put("total_fee",totalFee);
        map.put("refund_desc",descrption);
        Map<String, Object> refund = refund(map, wxWechatDO.getAppKey());
        logger.info("map:"+map);
        String res = refund(map, wxWechatDO.getAppKey());
        Map<String, Object> refund  =  XMLUtil.xmltoMap(res);
        return refund;
    }

+ 52 - 0
business/base-service/src/main/java/com/yihu/jw/order/pay/ylz/YlzPayService.java

@ -225,4 +225,56 @@ public class YlzPayService {
        logService.saveHttpLog(isSuccess, "hop.trade.tradeQuery", "互联网医院查询订单", "POST", null,JSON.toJSONString(param), object, error,logService.onepayType);
        return object;
    }
   /* public String msgPush(String hisCustId,String operatorId,String operatorName,String cardType,String cardNo,String accountType,String amount,
                         String withdrawMode,String outChargeNo,String outRefundNo,String idNo){
        String object  = null;
        Boolean isSuccess = true;
        String error = null;
        OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findById("ylz_pay_config");
        if(oauthYlzConfigDO==null){
            return "未找到支付配置文件";
        }
        String appId = oauthYlzConfigDO.getAppId();
        String appSecret = oauthYlzConfigDO.getAppKey();
        String onepayUrl = oauthYlzConfigDO.getUrl();
        String signType=oauthYlzConfigDO.getSignType();
        String encryptType = oauthYlzConfigDO.getEncType();
        HisOnepayClient onepayClient = new HisOnepayClient(onepayUrl, appId, appSecret, signType, encryptType);
        RefundParams param = new RefundParams();
        try {
            param.setTermNo("123456");
            param.setHisCustId(hisCustId);
            param.setOperatorId(operatorId);
            param.setOperatorName(operatorName);
            param.setCardType(cardType);
            param.setCardNo(cardNo);
            param.setAccountType(accountType);
            param.setAmount(amount);
            param.setWithdrawMode(withdrawMode);
            param.setOutChargeNo(outChargeNo);
            param.setOutRefundNo(outRefundNo);
            param.setIdNo(idNo);
            ResponseParams<RefundResult> response = onepayClient.refund(param);
            onepayClient.mmpMsgPush();
            if (response.getRespCode().equals("000000")){
                object = JSON.toJSONString(response);
            }else {
                isSuccess = false;
                object = JSON.toJSONString(response);
                error = "请求失败,返回结果:" + response.getRespCode() + "," + response.getRespMsg();
            }
        } catch (Exception e) {
            e.printStackTrace();
            isSuccess = false;
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            e.printStackTrace(pw);
            error = sw.toString();
        }
        logService.saveHttpLog(isSuccess, "hop.trade.refund", "互联网医院退款", "POST", null,JSON.toJSONString(param), object, error,logService.onepayType);
        return object;
    }*/
}

+ 3 - 6
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1701,7 +1701,7 @@ public class ImService {
		
		//获取诊断
		List<WlyyPrescriptionDiagnosisVO> wlyyPrescriptionDiagnosisVOS = wlyyPrescriptionVO.getDiagnosisVOs();
		if(!wlyyPrescriptionDiagnosisVOS.isEmpty()){
		if(wlyyPrescriptionDiagnosisVOS!=null&&wlyyPrescriptionDiagnosisVOS.size()!=0){
			String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS),"1");
		}
		
@ -1712,8 +1712,8 @@ public class ImService {
		object.put("outpatientid",wlyyPrescriptionVO.getOutpatientId());
		object.put("prescriptionid",wlyyPrescriptionVO.getId());
		object.put("ispay",wlyyPrescriptionVO.getPayStatus());
		if(!infoVOs.isEmpty()){
			String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "27", JSON.toJSONString(infoVOs),"1");
		if(infoVOs!=null&&infoVOs.size()!=0){
			String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "27", JSON.toJSONString(object),"1");
		}
//		imUtil.sendImMsg("402803816babc778016babca6d540008", "梁敬兴", "3ae2673512154d5280d1dcf5ffa5626d_808080eb6c84eacb016c8dc118e9002f_9", "24", "[{\"id\":\"808080eb6c84eacb016c8dc172810037\",\"createTime\":null,\"createUser\":null,\"createUserName\":null,\"updateTime\":null,\"updateUser\":null,\"updateUserName\":null,\"prescriptionId\":\"808080eb6c84eacb016c8dc1727f0036\",\"code\":\"D21.002  \",\"name\":\"耳软骨良性肿瘤\",\"type\":1}]","1");
@ -1745,11 +1745,8 @@ public class ImService {
	
	/**
	 * 发送咨询建议
	 * @param jsonObject
	 * @param doctor
	 * @param doctorName
	 * @param outpatientId
	 * @param patient
	 * @return
	 * @throws Exception
	 */

+ 37 - 2
common/common-util/src/main/java/com/yihu/jw/util/wechat/WeiXinPayUtils.java

@ -43,6 +43,22 @@ public class WeiXinPayUtils {
    }
    public static Map<String, String> getXmlBeforRefund(Map<String, String> param,String appKey) throws Exception {
        synchronized (WeiXinPayUtils.class) {
            param.put("nonce_str",generateNonceStr());
            WXPayConstants.SignType  wxSignType = WXPayConstants.SignType.MD5;
            String signType = param.get("sign_type");
            if("HMAC-SHA256".equalsIgnoreCase(signType)){
                wxSignType = WXPayConstants.SignType.HMACSHA256;
            }
            //获取微信签名
            String signature = WeiXinPayUtils.generateSignature(param, appKey, wxSignType);
            param.put("sign",signature);
            return param;
        }
    }
    /**
     * 调起支付的接口
     * @param param
@ -271,9 +287,12 @@ public class WeiXinPayUtils {
        return sb.toString().toUpperCase();
    }
    public static void main(String[] args) throws Exception {
        HashMap<String, String> map = new HashMap<>();
        map.put("appid","wx0a06b75a40b28f2a");
       /* map.put("appid","wx0a06b75a40b28f2a");
        map.put("mch_id","1516700601");
        map.put("body","腾讯充值中心-QQ会员充值");
        map.put("out_trade_no","20181127112445");
@ -281,8 +300,24 @@ public class WeiXinPayUtils {
        map.put("spbill_create_ip","192.168.6.109");
        map.put("notify_url","http://www.baidu.com");
        map.put("trade_type","JSAPI");
        map.put("openid", "oDGGt0QrJvH-YbDCHFgjd3Exc0Sw");
        map.put("openid", "oDGGt0QrJvH-YbDCHFgjd3Exc0Sw");*/
        map.put("refund_desc","居民取消");
        map.put("out_trade_no","HLWYY11590725608773494100");
        map.put("out_refund_no","HLWYY11590732364418");
        map.put("appid","wxa67b466e6ab64bba");
        map.put("refund_fee","1.0");
        map.put("total_fee","1.0");
        map.put("mch_id","1588010801");
        map.put("sign","E0177065CD96FC04061BEFDB8507A909");
        map.put("nonce_str","U3AVJwvwRhaiWqLFETMbZWPWoVb4CgHF");
        map.put("refund_fee_type","CNY");
        map.put("sign_type","MD5");
/*
        Map<String, Object> pay = unifiedorder(map, "yF4e9Rr1sVdqCF6c7cqqMPSNsCjYGyf9");
*/
        Map<String, Object> pay = refund(map, "a27cbed6078fa7195e51902d9ab18497");
        System.out.println("123123"+pay);
        System.out.println("--------------"+pay);
    }

+ 68 - 0
common/common-util/src/main/java/com/yihu/jw/util/wechat/wxhttp/HttpUtil.java

@ -1,14 +1,26 @@
package com.yihu.jw.util.wechat.wxhttp;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContexts;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import javax.net.ssl.SSLContext;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.security.KeyStore;
/**
 * Created by Trick on 2018/8/21.
@ -210,4 +222,60 @@ public class HttpUtil {
        return buffer.toString();
    }
/*
    public static String SSLCERT_PATH="";//证书的路径
    public static String SSLCERT_PASSWORD=;//证书的密籍*/
    public static String doRefund(String url,String data,String path,String password) throws Exception {
        String SSLCERT_PATH=path;
        String SSLCERT_PASSWORD=password;
        //注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的
        KeyStore keyStore = KeyStore.getInstance("PKCS12");
        //指向你的证书的绝对路径,带着证书去访问
        FileInputStream instream = new FileInputStream(new File(SSLCERT_PATH));//P12文件目录
        try {
            //下载证书时的密码、默认密码是你的MCHID mch_id
            keyStore.load(instream, SSLCERT_PASSWORD.toCharArray());//这里写密码
        } finally {
            instream.close();
        }
        //下载证书时的密码、默认密码是你的MCHID mch_id
        SSLContext sslcontext = SSLContexts.custom()
                .loadKeyMaterial(keyStore, SSLCERT_PASSWORD.toCharArray())//这里也是写密码的
                .build();
        // Allow TLSv1 protocol only
        SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
                sslcontext,
                new String[] { "TLSv1" },
                null,
                SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
        CloseableHttpClient httpclient = HttpClients.custom()
                .setSSLSocketFactory(sslsf)
                .build();
        try {
            logger.info("进入2");
            HttpPost httpost = new HttpPost(url); // 设置响应头信息
            httpost.addHeader("Connection", "keep-alive");
            httpost.addHeader("Accept", "*/*");
            httpost.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
            httpost.addHeader("Host", "api.mch.weixin.qq.com");
            httpost.addHeader("X-Requested-With", "XMLHttpRequest");
            httpost.addHeader("Cache-Control", "max-age=0");
            httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) ");
            httpost.setEntity(new StringEntity(data, "UTF-8"));
            logger.info("进入1");
            CloseableHttpResponse response = httpclient.execute(httpost);
            try {
                HttpEntity entity = response.getEntity();
                String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8");
                EntityUtils.consume(entity);
                return jsonStr;
            } finally {
                response.close();
            }
        } finally {
            httpclient.close();
        }
    }
}

+ 0 - 2
gateway/ag-basic/src/main/resources/application.yml

@ -32,8 +32,6 @@ hystrix:
  command:
    default:
      execution:
        timeout:
          enabled: true
        isolation:
          thread:
            timeoutInMilliseconds: 4800000

+ 11 - 0
server/svr-authentication/pom.xml

@ -75,6 +75,11 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <!-- <scope>runtime</scope> -->
        </dependency>
        <!-- Redis  -->
        <dependency>
@ -119,6 +124,12 @@
            <groupId>com.yihu</groupId>
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-jdbc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- 易联众工具-->

+ 17 - 15
server/svr-authentication/src/main/resources/application.yml

@ -5,21 +5,23 @@ server:
spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 100
    max-idle: 100 #最大空闲连接
    min-idle: 10 #最小空闲连接
    validation-query-timeout: 20
    log-validation-errors: true
    validation-interval: 60000 #避免过度验证,保证验证不超过这个频率——以毫秒为单位。如果一个连接应该被验证,但上次验证未达到指定间隔,将不再次验证。
    validation-query: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
    test-on-borrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
    test-on-return: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
    idle-timeout: 20000
    connection-test-query: SELECT 1
    num-tests-per-eviction-run: 100 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量,最好和maxActive
    test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
    min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
    hikari:
      registerMbeans: true
      max-active: 100
      max-idle: 100 #最大空闲连接
      min-idle: 10 #最小空闲连接
      validation-query-timeout: 20
      log-validation-errors: true
      validation-interval: 60000 #避免过度验证,保证验证不超过这个频率——以毫秒为单位。如果一个连接应该被验证,但上次验证未达到指定间隔,将不再次验证。
      validation-query: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
      test-on-borrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
      test-on-return: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
      idle-timeout: 20000
      connection-test-query: SELECT 1
      num-tests-per-eviction-run: 100 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量,最好和maxActive
      test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
      min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
      time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
  redis:
    database: 0 # Database index used by the connection factory.
    timeout: 0 # Connection timeout in milliseconds.

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

@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.axis.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
@ -49,6 +50,8 @@ public class YkyyController extends EnvelopRestEndpoint {
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Value("${wechat.id}")
    private String wxId;
    @GetMapping(value = "/createSQLQuery")
    @ApiOperation(value = "视图统一查询")
@ -128,9 +131,16 @@ public class YkyyController extends EnvelopRestEndpoint {
            Long cfhm = 0L;
            if (cfsbList!=null&&cfsbList.size()!=0){
                cfsb = Long.parseLong(cfsbList.get(0).get("total").toString());
                System.out.println("cfsb:"+cfsb);
                String updateCfsb = "update portal_his.gy_identity_ms@xec_link set dqz=dqz+1 where bmc = 'MS_CF01'";
                hibenateUtils.updateBySql(updateCfsb);
            }
            if (cfhmList!=null&&cfhmList.size()!=0){
                cfhm = Long.parseLong(cfhmList.get(0).get("total").toString());
                System.out.println("cfhm:"+cfhm);
                String updateCfhm = "update portal_his.gy_identity_ms@xec_link set dqz=dqz+1 where bmc = 'MS_CF01_CFHM'";
                hibenateUtils.updateBySql(updateCfhm);
            }
            hlwCf01VO.setCFSB(cfsb.intValue());
            hlwCf01VO.setCFHM(cfhm+"");
@ -138,6 +148,7 @@ public class YkyyController extends EnvelopRestEndpoint {
            object1.put("cfsb",cfsb);
            object1.put("cfhm",cfhm);
            ykyyEntranceService.save(hlwCf01VO);
            envelop.setObj(object1);
        }else if (table.equalsIgnoreCase("HLW_CF02")){
            HlwCf02DO hlwCf02VO =  JSONObject.toJavaObject(object,HlwCf02DO.class);
@ -146,12 +157,15 @@ public class YkyyController extends EnvelopRestEndpoint {
            Long sbxh = 0L;
            if (sbxhList!=null&&sbxhList.size()!=0){
                sbxh = Long.parseLong(sbxhList.get(0).get("total").toString());
                String updateSbxh = "update portal_his.gy_identity_ms@xec_link set dqz=dqz+1 where bmc = 'MS_CF02'";
                hibenateUtils.updateBySql(updateSbxh);
            }
            JSONObject object1 = new JSONObject();
            object1.put("sbxh",sbxh);
            envelop.setObj(object1);
            hlwCf02VO.setSBXH(sbxh.intValue());
            ykyyEntranceService.save(hlwCf02VO);
        }else if(table.equalsIgnoreCase("HlwYsMzJbzdDO")){
            // portal_his.gy_identity_ms@xec_link
            HlwYsMzJbzdDO hlwYsMzJbzdDO =  JSONObject.toJavaObject(object,HlwYsMzJbzdDO.class);
@ -160,6 +174,8 @@ public class YkyyController extends EnvelopRestEndpoint {
            Long jlbh = 0L;
            if (sbxhList!=null&&sbxhList.size()!=0){
                jlbh = Long.parseLong(sbxhList.get(0).get("total").toString());
                String updateJlbh = "update portal_his.gy_identity_ms@xec_link set dqz=dqz+1 where bmc = 'YS_MZ_JBZD'";
                hibenateUtils.updateBySql(updateJlbh);
            }
            JSONObject object1 = new JSONObject();
            object1.put("jlbh",jlbh);
@ -174,12 +190,15 @@ public class YkyyController extends EnvelopRestEndpoint {
            Long sbxh = 0L;
            if (sbxhList!=null&&sbxhList.size()!=0){
                sbxh = Long.parseLong(sbxhList.get(0).get("total").toString());
                String updateSbxh = "update portal_his.gy_identity_ms@xec_link set dqz=dqz+1 where bmc = 'MS_GHMX'";
                hibenateUtils.updateBySql(updateSbxh);
            }
            JSONObject object1 = new JSONObject();
            object1.put("sbxh",sbxh);
            envelop.setObj(object1);
            hlwGhmxDO.setSBXH(sbxh.intValue());
            ykyyEntranceService.save(hlwGhmxDO);
        }else if(table.equalsIgnoreCase("HlwYsMzJzLsDO")){
            // portal_his.gy_identity_ms@xec_link
            HlwYsMzJzLsDO hlwYsMzJzLsDO =  JSONObject.toJavaObject(object,HlwYsMzJzLsDO.class);
@ -188,6 +207,8 @@ public class YkyyController extends EnvelopRestEndpoint {
            Long jzxh = 0L;
            if (sbxhList!=null&&sbxhList.size()!=0){
                jzxh = Long.parseLong(sbxhList.get(0).get("total").toString());
                String updateJzxh = "update portal_his.gy_identity_ms@xec_link set dqz=dqz+1 where bmc = 'YS_MZ_JZLS'";
                hibenateUtils.updateBySql(updateJzxh);
            }
            JSONObject object1 = new JSONObject();
            object1.put("jzxh",jzxh);
@ -213,7 +234,7 @@ public class YkyyController extends EnvelopRestEndpoint {
        }
        //专家咨询
        result.put("zxCount",imService.sessionCountByType(doctor.getId(),1,0));
        result.put("fzCount",prescriptionService.getWaitVideoCount(doctor.getId(),"1","1"));//图文复诊数量
        result.put("fzCount",prescriptionService.getWaitVideoCount(doctor.getId(),"1","1",wxId));//图文复诊数量
        return success("请求成功",result);
    }

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

@ -129,7 +129,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "dept", value = "部门CODE")
			@RequestParam(value = "dept",required = false) String dept){
//		String result = "{\"waiting_count\":20,\"outpatient_count\":30,\"waiting_count_difference\":5,\"outpatient_count_difference\":-5,\"yesterday_waiting_count\":15,\"yesterday_outpatient_count\":25}";
		return success("请求成功",prescriptionService.findWaitingRoomStatusCount(dept));
		return success("请求成功",prescriptionService.findWaitingRoomStatusCount(dept,wxId));
	}
	
	
@ -143,7 +143,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "consult_status", value = "0离线,1空闲,2接诊中")
			@RequestParam(value = "consult_status",required = false) String consult_status){
//		String result = "[{\"id\":\"XXD2019887711\",\"doctor_name\":\"蔡建春\",\"visit_status\":0,\"patient_name\":\"张三\",\"visit_time\":\"2019-06-21 08:30:00\",\"time_cost\":50,\"waiting_count\":26,\"room_name\":\"01诊室\"},{\"id\":\"XXD2019887712\",\"doctor_name\":\"蔡阿梅\",\"visit_status\":1,\"patient_name\":\"李四\",\"visit_time\":\"2019-06-21 09:30:00\",\"time_cost\":60,\"waiting_count\":33,\"room_name\":\"02诊室\"}]";
		return success("请求成功",prescriptionService.findClinicRoomList(dept,date,consult_status));
		return success("请求成功",prescriptionService.findClinicRoomList(dept,date,consult_status,wxId));
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.findClinicRoomStatus)
@ -455,7 +455,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	                                   @ApiParam(name = "cancelRemark", value = "取消原因详细说明")
	                                   @RequestParam(value = "cancelRemark", required = false)String cancelRemark) {
		
		return success(prescriptionService.cancelOutPatient(outPatientId,cancelType,cancelValue,cancelRemark,2));
		return success(prescriptionService.cancelOutPatient(outPatientId,cancelType,cancelValue,cancelRemark,2,wxId));
	}
	
	
@ -534,9 +534,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	                                            @RequestParam(value = "doctor",required = true) String doctor){
		JSONObject result = new JSONObject();
		logger.info("action:doctorReviewConsultCount--start:"+DateUtil.dateToStrLong(new Date()));
		result.put("imgCount",prescriptionService.getWaitVideoCount(doctor,"1","1"));//图文复诊数量
		result.put("videoCount",prescriptionService.getWaitVideoCount(doctor,"2","1"));//视频复诊数量
		result.put("xtCount",prescriptionService.getWaitVideoCount(doctor,"","2"));//协同门诊候诊数量
		result.put("imgCount",prescriptionService.getWaitVideoCount(doctor,"1","1",wxId));//图文复诊数量
		result.put("videoCount",prescriptionService.getWaitVideoCount(doctor,"2","1",wxId));//视频复诊数量
		result.put("xtCount",prescriptionService.getWaitVideoCount(doctor,"","2",wxId));//协同门诊候诊数量
		logger.info("action:doctorReviewConsultCount--end:"+DateUtil.dateToStrLong(new Date()));
		return success("请求成功",result);
	}

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

@ -161,7 +161,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                                                  @RequestParam(value = "page", required = false)Integer page,
                                                                                  @ApiParam(name = "size", value = "每页大小")
                                                                                  @RequestParam(value = "size", required = true) Integer size) {
        return prescriptionService.findPrescriptionList(patient,status,startTime,endTime,page,size);
        return prescriptionService.findPrescriptionList(patient,status,startTime,endTime,page,size,wxId);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findReOutpatientList)
@ -541,7 +541,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @ApiParam(name = "cancelRemark", value = "取消原因详细说明")
                                       @RequestParam(value = "cancelRemark", required = false)String cancelRemark) {
        
        return success(prescriptionService.cancelOutPatient(outPatientId,cancelType,cancelValue,cancelRemark,1));
        return success(prescriptionService.cancelOutPatient(outPatientId,cancelType,cancelValue,cancelRemark,1,wxId));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findCancelReasonList)
@ -699,8 +699,20 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "ssc", value = "社保卡")
                                      @RequestParam(value = "ssc", required = true)String ssc,
                                      @ApiParam(name = "idcard", value = "居民身份证")
                                       @RequestParam(value = "idcard", required = true)String idcard){
        return success(prescriptionService.updatePatientInfo(patient,name,idcard,ssc));
                                       @RequestParam(value = "idcard", required = true)String idcard,
                                      @ApiParam(name = "sex", value = "性别")
                                          @RequestParam(value = "sex", required = false)Integer sex,
                                      @ApiParam(name = "town", value = "所在区code")
                                          @RequestParam(value = "town", required = false)String town,
                                      @ApiParam(name = "townName", value = "所在区名称")
                                          @RequestParam(value = "townName", required = false)String townName,
                                      @ApiParam(name = "committeeCode", value = "居委会code")
                                          @RequestParam(value = "committeeCode", required = false)String committeeCode,
                                      @ApiParam(name = "committeeName", value = "居委会code")
                                          @RequestParam(value = "committeeName", required = false)String committeeName,
                                      @ApiParam(name = "address", value = "常驻地址")
                                          @RequestParam(value = "address", required = false)String address){
        return success(prescriptionService.updatePatientInfo(patient,name,idcard,ssc,sex,town,townName,committeeCode,committeeName,address));
    }
@ -786,7 +798,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "page", required = true)Integer page,
                                       @ApiParam(name = "size", value = "每页大小")
                                       @RequestParam(value = "size", required = true)Integer size) {
        return prescriptionService.findByGeneralDoctor(generalDoctor,startDate,endDate,status,sort,page,size);
        return prescriptionService.findByGeneralDoctor(generalDoctor,startDate,endDate,status,sort,page,size,wxId);
    }