Jelajahi Sumber

Merge branch 'dev' of wangjun/wlyy2.0 into dev

wangzhinan 3 tahun lalu
induk
melakukan
208e6b7b0a
20 mengubah file dengan 523 tambahan dan 33 penghapusan
  1. 42 12
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 3 0
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  3. 2 2
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java
  4. 5 0
      business/base-service/src/main/java/com/yihu/jw/wechat/enterprise/EnterpriseService.java
  5. 3 3
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  6. 8 5
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  7. 95 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseExceptionDictDO.java
  8. 76 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseExceptionLogDO.java
  9. 60 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseExceptionServerDictDO.java
  10. 10 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java
  11. 46 1
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/DidiFilterProcessor.java
  12. 83 0
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/BaseExceptionService.java
  13. 0 3
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/BaseLoginLogService.java
  14. 14 0
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/dao/BaseExceptionDictDao.java
  15. 8 0
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/dao/BaseExceptionLogDao.java
  16. 11 0
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/dao/BaseExceptionServerDictDao.java
  17. 38 0
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/security/BeanUtil.java
  18. 1 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/RemindDoctorService.java
  19. 6 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  20. 12 4
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

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

@ -3792,6 +3792,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                    "WHERE t.id = '"+doctorDO.getId()+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            //System.out.println(chargeDictDOLists.get(1));
            rs.put("chargeTypeList",chargeDictDOLists);
            //机构科室信息
            List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
@ -5096,7 +5097,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @query_status 0:图文复诊候诊 1:图文复诊抢单列表
     * @dept 部门
     */
    public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept,String sex,String keyword,String ageGroup) {
    public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept,String sex,String keyword,String ageGroup,String patient) {
        String sql = "SELECT " +
                "room.outpatient_id AS \"id\"," +
@ -5177,6 +5178,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }if(StringUtils.isNoneBlank(keyword)){
            sql += " AND outpatient.patient_name like '%" + keyword + "%' ";
        }
        if(StringUtils.isNoneBlank(patient)){
            sql += " AND (outpatient.patient= '" + patient + "' or outpatient.consumer ='"+patient+"') ";
        }
        if(StringUtils.isNoneBlank(ageGroup)){
            String[] age = ageGroup.split(",");
            Calendar nowBegin = Calendar.getInstance();
@ -9864,13 +9868,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param size
     * @return
     */
    public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size,String patient,String isSelectDrug) {
    public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size,String patient,String isSelectDrug,boolean consumerflag) {
        BasePatientDO patientDO = basePatientDao.findById(patient);
        if (patientDO==null){
            return PageEnvelop.getError("找不到该患者",-1);
        }
        StringBuffer sql = new StringBuffer(" SELECT DISTINCT b.*, c.oneself_pickup_flg,f.job_title_code,f.job_title_name  FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id  WHERE o.consumer = '");
        StringBuffer countSql = new StringBuffer("select COUNT(DISTINCT b.id) count FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id  WHERE o.consumer = '");
        /*if (consumerflag){
            sql.append(" WHERE o.consumer = '");
            countSql.append(" WHERE o.consumer = '");
        }else{
            sql.append(" WHERE o.patient = '");
            countSql.append(" WHERE o.patient = '");
        }*/
        sql.append(patient).append("') b  LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        countSql.append(patient).append("') b  LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        if (StringUtils.isNoneBlank(isSelectDrug)){
@ -9917,14 +9928,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    " b.doctor_name LIKE '%" + keyName + "%' " +
                    " OR b.dept_name LIKE'%" + keyName + "%' " +
                    " OR b.hospital_name LIKE '%" + keyName + "%' " +
                    " OR d.drug_name LIKE '%" + keyName + "%' " +
                    " OR m.drug_name LIKE '%" + keyName + "%' " +
                    " OR b.real_order LIKE '%" + keyName + "%' " +
                    ")");
            countSql.append(" and (" +
                    " b.doctor_name LIKE '%" + keyName + "%' " +
                    " OR b.dept_name LIKE'%" + keyName + "%' " +
                    " OR b.hospital_name LIKE '%" + keyName + "%' " +
                    " OR d.drug_name LIKE '%" + keyName + "%' " +
                    " OR m.drug_name LIKE '%" + keyName + "%' " +
                    " OR b.real_order LIKE '%" + keyName + "%' " +
                    ")");
        }
@ -10308,13 +10319,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
       return envelop;
    }
    //应声开具处方管理
    public MixEnvelop prescriptionManage(String keyWord,String doctorId,String startTime,String endTime,String checkStatus,Integer page,Integer pageSize){
    public MixEnvelop prescriptionManage(String keyWord,String doctorId,String startTime,String endTime,String checkStatus,String status,Integer page,Integer pageSize){
        String sql = " select p.create_time as \"createTime\"," +
                " p.patient_name as \"patientName\"," +
                " o.idcard as \"idcard\"," +
                " o.card_no as \"cardNo\"," +
                " p.check_status as \"checkStatus\"," +
                " p.id as \"id\"," +
                " p.status as \"status\"," +
                " p.check_reason as \"checkReason\" " +
                " from wlyy_prescription p left join wlyy_outpatient o on p.outpatient_id  = o.id" +
                " where  1=1 ";
@ -10327,6 +10339,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else {
            sql+=" and p.check_status != 4";
        }
        if(StringUtils.isNotBlank(status)){
            if ("0".equalsIgnoreCase(status)){
                sql+=" and p.status = 20";
            }else if ("-4".equalsIgnoreCase(status)){
                sql+=" and p.status = -4";
            } else {
                sql+=" and p.status > 20";
            }
        }
        if(StringUtils.isNotBlank(doctorId)){
            sql+=" and p.doctor = '"+doctorId+"'";
        }
@ -10425,6 +10447,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                /*prescriptionDao.updateCheckStatus(prescriptionId,2,reason,20);*/
                logger.info("作废处方开始" + prescriptionDO.getCheckStatus());
                WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
                WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
                DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
                List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId, 1);
@ -10456,19 +10479,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                try {
                    net.sf.json.JSONObject jsonObject = entranceService.BS10112(jsonData.toJSONString(), demoFlag);
                    wlyyHttpLogDO.setResponse(jsonObject.toString());
                }catch (Exception e){
                    e.printStackTrace();
                    return "删除失败";
                    return "作废失败";
                }
                wlyyHttpLogDO.setRequest(jsonData.toJSONString());
                wlyyHttpLogDO.setName("作废处方");
                wlyyHttpLogDO.setCreateTime(new Date());
                wlyyHttpLogDO.setCode(outpatientDO.getId());
                wlyyHttpLogDao.save(wlyyHttpLogDO);
            }
            prescriptionDO.setStatus(-1);
            prescriptionDO.setCheckStatus(4);
            prescriptionDO.setCheckReason("已删除");
            prescriptionDO.setStatus(-4);
            prescriptionDO.setDisableTime(new Date());
            prescriptionDO.setCheckStatus(5);
            prescriptionDO.setCheckReason("已作废");
            prescriptionDao.save(prescriptionDO);
            return "删除成功";
            return "已作废";
        }else {
            return "删除失败";
            return "作废失败";
        }
    }

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -752,6 +752,9 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            orderRefundDao.save(orderRefundDO);
            updatePayStatusByRefund(orderNo);
        }
        if (businessOrderDO!=null){
            ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"2");
        }
        return map;
    }

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java

@ -547,14 +547,14 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
                    " b.doctor_name LIKE '%" + keyName + "%' " +
                    " OR b.dept_name LIKE'%" + keyName + "%' " +
                    " OR b.hospital_name LIKE '%" + keyName + "%' " +
                    " OR d.drug_name LIKE '%" + keyName + "%' " +
                    " OR m.drug_name LIKE '%" + keyName + "%' " +
                    " OR b.real_order LIKE '%" + keyName + "%' " +
                    ")");
            countSql.append(" and (" +
                    " b.doctor_name LIKE '%" + keyName + "%' " +
                    " OR b.dept_name LIKE'%" + keyName + "%' " +
                    " OR b.hospital_name LIKE '%" + keyName + "%' " +
                    " OR d.drug_name LIKE '%" + keyName + "%' " +
                    " OR m.drug_name LIKE '%" + keyName + "%' " +
                    " OR b.real_order LIKE '%" + keyName + "%' " +
                    ")");
        }

+ 5 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/enterprise/EnterpriseService.java

@ -182,16 +182,21 @@ public class EnterpriseService {
            WxEnterpriseUserDO user = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(enterpriseId,baseDoctorDO.getMobile());
            if(user!=null){
                res =sendTWMes(enterpriseId,user.getUserid(),title,description,url);
                logger.info("开始保存日志");
                logger.info("url==="+url);
                try {
                    if (StringUtils.isNoneBlank(url)){
                        logger.info("进入保存接口");
                        String outPatientId = url.substring(url.lastIndexOf("=")+1,url.length());
                        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
                        wlyyHttpLogDO.setDoctor(doctor);
                        wlyyHttpLogDO.setRequest(url);
                        wlyyHttpLogDO.setName(title);
                        wlyyHttpLogDO.setCode(outPatientId);
                        wlyyHttpLogDO.setCreateTime(new Date());
                        wlyyHttpLogDO.setRequest("enterpriseId:"+enterpriseId+",doctor:"+doctor+",url:"+url);
                        wlyyHttpLogDO.setResponse(res);
                        logger.info(res);
                        wlyyHttpLogDao.save(wlyyHttpLogDO);
                    }
                }catch (Exception e){

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

@ -4044,7 +4044,7 @@ public class StatisticsEsService {
            }else {
                JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,null);
                object.put("totalData",array);//新增量
                JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"0");//未接诊
                JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"0");//未接诊
                object.put("noReceiveData",array1);//未接诊
                JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"1");//已接诊
                object.put("haveReceiveData",array2);//已接诊
@ -4069,7 +4069,7 @@ public class StatisticsEsService {
            }else {
                JSONArray array = weekTotalStatistics8(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,null);
                object.put("totalData",array);//新增量
                JSONArray array1 = weekTotalStatistics8(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"0");//未接诊
                JSONArray array1 = weekTotalStatistics8(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"0");//未接诊
                object.put("noReceiveData",array1);;//未接诊
                JSONArray array2 = weekTotalStatistics8(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"1");//已接诊
                object.put("haveReceiveData",array2);//已接诊
@ -4094,7 +4094,7 @@ public class StatisticsEsService {
            }else {
                JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,null);
                object.put("totalData",array);
                JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"0");
                JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"0");
                object.put("noReceiveData",array1);
                JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"1");
                object.put("haveReceiveData",array2);

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

@ -4012,7 +4012,7 @@ public class ImService {
	public List<Map<String,Object>>  findConsultRecordByDoctorNew(String doctor, String id,
															   String type, Integer status,
															   int page,int pagesize,
															   String title,String start_time,String end_time) {
															   String title,String start_time,String end_time,String patient) {
		String  sql = "";
		sql = "SELECT " +
				"a.id AS \"id\"," +
@ -4063,6 +4063,9 @@ public class ImService {
		if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)) {
			sql += " AND op.doctor='" + doctor + "' ";
		}
        if (org.apache.commons.lang.StringUtils.isNotBlank(patient)) {
            sql += " AND (op.consumer='" + patient + "' or op.patient ='"+patient + "')";
        }
		if (!StringUtils.isEmpty(title)) {
			title = "%" + title + "%";
@ -4506,8 +4509,8 @@ public class ImService {
				"  t.idcard as \"idcard\"," +
				"  t.mobile as \"mobile\"," +
				"  op.doctor as \"doctor\"" +
				" from wlyy_outpatient op left join base_patient t " +
				" on t.id = op.patient where t.del ='1' and op.status!= -1";
				" from base_patient t  left join  wlyy_outpatient op " +
				" on (t.id = op.consumer or t.id = op.patient) where t.del ='1' and op.status!= -1";
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(doctor)){
			sql+=" and op.doctor = '"+doctor+"'";
		}
@ -4529,7 +4532,7 @@ public class ImService {
				sql +=" AND op.outpatient_type in (1,2,3) ";
			}
		}
		sql+=" order by op.create_time  ";
		sql+=" order by op.create_time  desc ";
		logger.info("findRecordByDoctorSQL==="+sql);
		List<Map<String,Object>>  list = hibenateUtils.createSQLQuery(sql,page,pagesize);
		for (Map<String,Object> map:list){
@ -4555,7 +4558,7 @@ public class ImService {
					"  t.mobile as \"mobile\"," +
					"  op.doctor as \"doctor\"" +
					" from wlyy_outpatient op left join  base_patient t " +
					" on t.id = op.patient where t.del ='1' and op.status!= -1";
					" on (t.id = op.consumer or t.id = op.patient) where t.del ='1' and op.status!= -1";
			if (org.apache.commons.lang3.StringUtils.isNoneBlank(doctor)){
				sql+=" and op.doctor = '"+doctor+"'";
			}

+ 95 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseExceptionDictDO.java

@ -0,0 +1,95 @@
package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "base_exception_dict")
public class BaseExceptionDictDO extends UuidIdentityEntity {
    private String code;
    private String exceptionMessage;
    private Date createTime;
    private String isDel;
    private String modelName;
    private String exceptionType;
    private String exceptionTypeName;
    private String remindContent;
    @Column(name = "remind_content")
    public String getRemindContent() {
        return remindContent;
    }
    public void setRemindContent(String remindContent) {
        this.remindContent = remindContent;
    }
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "exception_message")
    public String getExceptionMessage() {
        return exceptionMessage;
    }
    public void setExceptionMessage(String exceptionMessage) {
        this.exceptionMessage = exceptionMessage;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "is_del")
    public String getIsDel() {
        return isDel;
    }
    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
    @Column(name = "model_name")
    public String getModelName() {
        return modelName;
    }
    public void setModelName(String modelName) {
        this.modelName = modelName;
    }
    @Column(name = "exception_type")
    public String getExceptionType() {
        return exceptionType;
    }
    public void setExceptionType(String exceptionType) {
        this.exceptionType = exceptionType;
    }
    @Column(name = "exception_type_name")
    public String getExceptionTypeName() {
        return exceptionTypeName;
    }
    public void setExceptionTypeName(String exceptionTypeName) {
        this.exceptionTypeName = exceptionTypeName;
    }
}

+ 76 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseExceptionLogDO.java

@ -0,0 +1,76 @@
package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "base_exception_log")
public class BaseExceptionLogDO extends UuidIdentityEntity {
    private String serviceCode;
    private String exceptionCode;
    private String exceptionType;
    private Date createTime;
    private String request;
    private String response;
    @Column(name = "service_code")
    public String getServiceCode() {
        return serviceCode;
    }
    public void setServiceCode(String serviceCode) {
        this.serviceCode = serviceCode;
    }
    @Column(name = "exception_code")
    public String getExceptionCode() {
        return exceptionCode;
    }
    public void setExceptionCode(String exceptionCode) {
        this.exceptionCode = exceptionCode;
    }
    @Column(name = "exception_type")
    public String getExceptionType() {
        return exceptionType;
    }
    public void setExceptionType(String exceptionType) {
        this.exceptionType = exceptionType;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "request")
    public String getRequest() {
        return request;
    }
    public void setRequest(String request) {
        this.request = request;
    }
    @Column(name = "response")
    public String getResponse() {
        return response;
    }
    public void setResponse(String response) {
        this.response = response;
    }
}

+ 60 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseExceptionServerDictDO.java

@ -0,0 +1,60 @@
package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "base_exception_server_dict")
public class BaseExceptionServerDictDO extends UuidIdentityEntity {
    private String name;
    private Date createTime;
    private Date updateTime;
    private String isDel;
    private String path;
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    @Column(name = "is_del")
    public String getIsDel() {
        return isDel;
    }
    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
    @Column(name = "path_url")
    public String getPath() {
        return path;
    }
    public void setPath(String path) {
        this.path = path;
    }
}

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java

@ -277,6 +277,16 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
    private String diagnosisName;
    private String diagnosisSubName;
    private Date disableTime;
    @Column(name = "disable_time")
    public Date getDisableTime() {
        return disableTime;
    }
    public void setDisableTime(Date disableTime) {
        this.disableTime = disableTime;
    }
    /**
     * 处方审方唯一标识
     */

+ 46 - 1
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/DidiFilterProcessor.java

@ -4,6 +4,20 @@ import com.netflix.zuul.FilterProcessor;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
import com.yihu.jw.entity.base.dict.BaseExceptionLogDO;
import com.yihu.jw.gateway.methlog.BaseExceptionService;
import com.yihu.jw.gateway.methlog.dao.BaseExceptionDictDao;
import com.yihu.jw.gateway.methlog.dao.BaseExceptionLogDao;
import com.yihu.jw.gateway.methlog.dao.BaseExceptionServerDictDao;
import com.yihu.jw.gateway.security.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created with IntelliJ IDEA.
@ -12,6 +26,7 @@ import com.netflix.zuul.exception.ZuulException;
 * @Date: 2021/5/19
 * @Description:
 */
@Component
public class DidiFilterProcessor extends FilterProcessor {
    @Override
    public Object processZuulFilter(ZuulFilter filter) throws ZuulException {
@ -19,8 +34,38 @@ public class DidiFilterProcessor extends FilterProcessor {
            return super.processZuulFilter(filter);
        } catch (ZuulException e) {
            if (e.nStatusCode==500){
                String message="";
                String cause="";
                String serviceId="";
                String responseCode="";
                String exceptionType="";
                BaseExceptionLogDao baseExceptionLogDao = BeanUtil.getBean(BaseExceptionLogDao.class);
                //BaseExceptionDictDao baseExceptionDictDao = BeanUtil.getBean(BaseExceptionDictDao.class);
                BaseExceptionService baseExceptionService = BeanUtil.getBean(BaseExceptionService.class);
                List<Map<String,Object>> list = baseExceptionService.findExceptionDict("","110001","","1");
                RequestContext ctx = RequestContext.getCurrentContext();
                ZuulException e1 = new ZuulException("123456",10085,"10000");
                List<Map<String,Object>> serviceList=baseExceptionService.findExceptionService("","","1","");
                for (Map<String,Object> map:serviceList){
                    if (ctx.getRequest().getServletPath().contains(map.get("pathUrl").toString())){
                        serviceId=map.get("id").toString();
                        break;
                    }
                }
                if (list!=null&&list.size()>0){
                    message = list.get(0).get("remindContent").toString();
                    cause=list.get(0).get("exceptionMessage").toString();
                    responseCode=serviceId+list.get(0).get("code").toString();
                    exceptionType = list.get(0).get("exceptionType").toString();
                }
                ZuulException e1 = new ZuulException(message, StringUtils.isEmpty(responseCode)?99999999:Integer.valueOf(responseCode),cause);
                BaseExceptionLogDO baseExceptionLogDO = new BaseExceptionLogDO();
                baseExceptionLogDO.setCreateTime(new Date());
                baseExceptionLogDO.setExceptionType(exceptionType);
                baseExceptionLogDO.setServiceCode(serviceId);
                baseExceptionLogDO.setExceptionCode(responseCode);
                baseExceptionLogDO.setRequest(ctx.getRequest().toString());
                baseExceptionLogDO.setResponse(ctx.toString());
                baseExceptionLogDao.save(baseExceptionLogDO);
                ctx.set("failed.exception", e1);
                ctx.set("failed.filter", filter);
                throw e1 ;

+ 83 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/BaseExceptionService.java

@ -0,0 +1,83 @@
package com.yihu.jw.gateway.methlog;
import com.yihu.jw.entity.base.dict.BaseExceptionServerDictDO;
import com.yihu.jw.gateway.methlog.dao.BaseExceptionDictDao;
import com.yihu.jw.gateway.methlog.dao.BaseExceptionLogDao;
import com.yihu.jw.gateway.methlog.dao.BaseExceptionServerDictDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
@Component
public class BaseExceptionService {
    @Autowired
    private BaseExceptionDictDao baseExceptionDictDao;
    @Autowired
    private BaseExceptionLogDao baseExceptionLogDao;
    @Autowired
    private BaseExceptionServerDictDao baseExceptionServerDictDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public String findServiceByPath(String path){
        BaseExceptionServerDictDO baseExceptionServerDictDO = baseExceptionServerDictDao.findServiceByPath(path);
        String id ="";
        if (baseExceptionServerDictDO !=null){
            id = baseExceptionServerDictDO.getId();
        }
        return id;
    }
    public List<Map<String,Object>> findExceptionDict(String id,String code,String exceptionType,String isDel){
        String sql = "select t.id as \"id\"," +
                " t.code as \"code\"," +
                " t.exception_message as \"exceptionMessage\"," +
                " t.create_time as \"createTime\"," +
                " t.is_del \"isDel\"," +
                " t.model_name as \"modelName\"," +
                " t.exception_type as \"exceptionType\"," +
                " t.exception_type_name as \"exceptionTypeName\"," +
                " t.remind_content as \"remindContent\"" +
                " from base_exception_dict t where 1=1";
        if (!StringUtils.isEmpty(id)){
            sql+=" and t.id ='"+id+"'";
        }
        if (!StringUtils.isEmpty(code)){
            sql+=" and t.code ='"+code+"'";
        }
        if (!StringUtils.isEmpty(exceptionType)){
            sql+=" and t.exception_type ='"+exceptionType+"'";
        }
        if (!StringUtils.isEmpty(isDel)){
            sql+=" and t.is_del ='"+isDel+"'";
        }
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
    public List<Map<String,Object>> findExceptionService(String id,String name,String isDel,String pathUrl){
        String sql = "select t.id as \"id\"," +
                " t.name as \"name\"," +
                " t.create_time as \"createTime\"," +
                " t.update_time as \"updateTime\"," +
                " t.is_del as \"isDel\"," +
                " t.path_url as \"pathUrl\"" +
                " from base_exception_server_dict t where 1=1 ";
        if (!StringUtils.isEmpty(id)){
            sql+=" and t.id ='"+id+"'";
        }
        if (!StringUtils.isEmpty(name)){
            sql+=" and t.name ='"+name+"'";
        }
        if (!StringUtils.isEmpty(isDel)){
            sql+=" and t.is_del ='"+isDel+"'";
        }
        if (!StringUtils.isEmpty(pathUrl)){
            sql+=" and t.path_url ='"+pathUrl+"'";
        }
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return  list;
    }
}

+ 0 - 3
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/BaseLoginLogService.java

@ -3,11 +3,9 @@ package com.yihu.jw.gateway.methlog;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
@ -19,7 +17,6 @@ public class BaseLoginLogService {
    private BaseLoginLogDao baseLoginLogDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    /**
     * 根据openid 获取最新的一条数据
     * @param openid

+ 14 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/dao/BaseExceptionDictDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.gateway.methlog.dao;
import com.yihu.jw.entity.base.dict.BaseExceptionDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import java.util.Map;
public interface BaseExceptionDictDao  extends PagingAndSortingRepository<BaseExceptionDictDO, String>, JpaSpecificationExecutor<BaseExceptionDictDO> {
    @Query("from BaseExceptionDictDO  t where t.isDel='1' and t.code=?1")
    List<Map<String,Object>> findByCode(String code);
}

+ 8 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/dao/BaseExceptionLogDao.java

@ -0,0 +1,8 @@
package com.yihu.jw.gateway.methlog.dao;
import com.yihu.jw.entity.base.dict.BaseExceptionLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseExceptionLogDao extends PagingAndSortingRepository<BaseExceptionLogDO, String>, JpaSpecificationExecutor<BaseExceptionLogDO> {
}

+ 11 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/dao/BaseExceptionServerDictDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.gateway.methlog.dao;
import com.yihu.jw.entity.base.dict.BaseExceptionServerDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseExceptionServerDictDao extends PagingAndSortingRepository<BaseExceptionServerDictDO, String>, JpaSpecificationExecutor<BaseExceptionServerDictDO> {
    @Query("from BaseExceptionServerDictDO t where t.isDel='1' and t.path=?1")
    BaseExceptionServerDictDO findServiceByPath(String path);
}

+ 38 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/security/BeanUtil.java

@ -0,0 +1,38 @@
package com.yihu.jw.gateway.security;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class BeanUtil implements ApplicationContextAware {
    private static ApplicationContext applicationContext;
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        if (BeanUtil.applicationContext == null) {
            BeanUtil.applicationContext = applicationContext;
        }
    }
    // 获取applicationContext
    public static ApplicationContext getApplicationContext() {
        return applicationContext;
    }
    // 通过name获取 Bean.
    public static Object getBean(String name) {
        return getApplicationContext().getBean(name);
    }
    // 通过class获取Bean.
    public static <T> T getBean(Class<T> clazz) {
        return getApplicationContext().getBean(clazz);
    }
    // 通过name,以及Clazz返回指定的Bean
    public static <T> T getBean(String name, Class<T> clazz) {
        return getApplicationContext().getBean(name, clazz);
    }
}

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

@ -39,7 +39,7 @@ public class RemindDoctorService {
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private EnterpriseService enterpriseService;
    @Value("${wechat.id}")
    @Value("${wechat.ids}")
    private String wechatId;
    @Autowired
    private PrescriptionService prescriptionService;

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

@ -134,9 +134,11 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "sex",required = false) String sex,
			@ApiParam(name = "keyWord", value = "姓名关键字")
			@RequestParam(value = "keyWord",required = false) String keyWord,
			@ApiParam(name = "patient", value = "患者id")
			@RequestParam(value = "patient",required = false) String patient,
			@ApiParam(name = "ageGroup", value = "年龄段")
			@RequestParam(value = "ageGroup",required = false) String ageGroup){
		return success("请求成功",prescriptionService.findWaitingRoomOutpatientByDoctor(doctor,type,query_status,dept,sex,keyWord,ageGroup));
		return success("请求成功",prescriptionService.findWaitingRoomOutpatientByDoctor(doctor,type,query_status,dept,sex,keyWord,ageGroup,patient));
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.findWaitingRoomPatient)
@ -713,6 +715,8 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "doctor",required = false) String doctor,
			@ApiParam(name = "title", value = "咨询标题关键字")
			@RequestParam(value = "title",required = false) String title,
			@ApiParam(name = "patient", value = "患者id")
			@RequestParam(value = "patient",required = false) String patient,
			@ApiParam(name = "id", value = "咨询ID")
			@RequestParam(value = "id",required = false) String id,
			@ApiParam(name = "type", value = "咨询类型")
@ -728,7 +732,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "pagesize", value = "分页大小")
			@RequestParam(value = "pagesize",required = false) int pagesize
	)throws Exception{
		List<Map<String,Object>>  data = imService.findConsultRecordByDoctorNew(doctor, id,type,status, page,pagesize, title,start_time,end_time);
		List<Map<String,Object>>  data = imService.findConsultRecordByDoctorNew(doctor, id,type,status, page,pagesize, title,start_time,end_time,patient);
		if (data != null) {
			for(Map<String,Object> consult :data){

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

@ -2102,13 +2102,19 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                  @RequestParam(value = "status[]", required = false)String status,
                                                  @ApiParam(name = "isSelectDrug", value = "1查询处方药品1是0查询检查")
                                                      @RequestParam(value = "isSelectDrug", required = false)String isSelectDrug,
                                                  @ApiParam(name = "patient", value = "患者id")
                                                      @RequestParam(value = "patient", required = false)String patient,
                                                  @ApiParam(name = "page", value = "第几页")
                                                  @RequestParam(value = "page",required = false,defaultValue = "1") Integer page,
                                                  @ApiParam(name = "size", value = "页面大小")
                                                  @RequestParam(value = "size",required = false,defaultValue = "10") Integer size)throws Exception {
        try {
            String patient = getUID();
            return prescriptionService.findPatientAllPrescription(keyName,status,page,size,patient,isSelectDrug);
            boolean consumerflag = false ;
            if (!StringUtils.isNoneBlank(patient)){
                patient=getUID();
                consumerflag=true;
            }
            return prescriptionService.findPatientAllPrescription(keyName,status,page,size,patient,isSelectDrug,consumerflag);
        } catch (Exception e) {
            return PageEnvelop.getError(e.getMessage(),-1);
        }
@ -2404,14 +2410,16 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "startTime",defaultValue = "",required = false) String startTime,
            @ApiParam(name = "endTime", value = "结束时间")
            @RequestParam(value = "endTime",defaultValue = "",required = false) String endTime,
            @ApiParam(name = "checkStatus", value = "处方状态")
            @ApiParam(name = "checkStatus", value = "处方审核状态")
            @RequestParam(value = "checkStatus",defaultValue = "",required = false) String checkStatus,
            @ApiParam(name = "status", value = "处方状态")
            @RequestParam(value = "status",defaultValue = "",required = false) String status,
            @ApiParam(name = "page", value = "页数")
            @RequestParam(value = "page",defaultValue = "",required = false) Integer page,
            @ApiParam(name = "pageSize",value = "页大小")
            @RequestParam(value = "pageSize",defaultValue = "",required = false) Integer pageSize) throws Exception {
        return prescriptionService.prescriptionManage(keyWord,doctorId,startTime,endTime,checkStatus,page,pageSize);
        return prescriptionService.prescriptionManage(keyWord,doctorId,startTime,endTime,checkStatus,status,page,pageSize);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.disablePrescription)
    @ApiOperation(value = "作废处方")