Pārlūkot izejas kodu

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

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
wangzhinan 4 gadi atpakaļ
vecāks
revīzija
70cef51406

+ 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>

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

@ -70,8 +70,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;
@ -489,10 +493,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 ";
@ -503,10 +507,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);
@ -516,48 +530,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 ";
@ -568,10 +582,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));
@ -3336,14 +3358,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 " +
@ -3361,11 +3383,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) {
@ -3382,7 +3409,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();
        }
@ -3421,24 +3448,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{
@ -3461,18 +3494,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," +
@ -3487,18 +3523,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);
@ -3511,7 +3569,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);
                    }
                }
@ -3978,12 +4036,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);
@ -4298,7 +4362,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;
@ -4409,9 +4473,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 " +
@ -4424,11 +4488,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);
    
@ -4729,7 +4801,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 "+
@ -4738,10 +4810,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+"'";
@ -4751,66 +4833,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);
    }
@ -4848,7 +4938,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 " +
@ -4867,7 +4957,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 " +
@ -4880,7 +4970,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);
@ -4901,7 +4991,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 " +
@ -4920,7 +5010,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 " +
@ -4939,7 +5029,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 " +
@ -4959,7 +5049,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 " +
@ -5817,6 +5907,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;

+ 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;
    }

+ 2 - 2
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.*;
/**

+ 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;
    }*/
}

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

@ -1705,11 +1705,8 @@ public class ImService {
	
	/**
	 * 发送咨询建议
	 * @param jsonObject
	 * @param doctor
	 * @param doctorName
	 * @param outpatientId
	 * @param patient
	 * @return
	 * @throws Exception
	 */

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

@ -19,13 +19,15 @@ 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")
*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 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.

+ 6 - 3
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 = "视图统一查询")
@ -187,8 +190,8 @@ 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);*/
                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);
@ -231,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);
    }

+ 5 - 5
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)
@ -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);
	}

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

@ -164,7 +164,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)
@ -702,8 +702,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));
    }
    
@ -789,7 +801,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);
    }