Преглед изворни кода

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

# Conflicts:
#	gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/PostFilter.java
wangzhinan пре 3 година
родитељ
комит
3446859aa4

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

@ -3739,7 +3739,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            rs.put("visitDeptName",doctorDO.getVisitDeptName());//出诊科室
            rs.put("visitDeptName",doctorDO.getVisitDeptName());//出诊科室
            rs.put("visitDept",doctorDO.getVisitDept());
            rs.put("visitDept",doctorDO.getVisitDept());
            rs.put("learning",doctorDO.getLearning());
            rs.put("learning",doctorDO.getLearning());
            rs.put("sex",doctorDO.getSex());
            rs.put("sex",doctorDO.getSex().toString());
            rs.put("popularity",doctorDO.getPopularity());
            rs.put("popularity",doctorDO.getPopularity());
            rs.put("qrcode",doctorDO.getQrcode());
            rs.put("qrcode",doctorDO.getQrcode());
            //号别
            //号别

+ 14 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/exception/dao/BaseExceptionDictDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.restmodel.exception.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.exceptionInfo=?1")
    BaseExceptionDictDO findByExceptionInfo(String exceptionInfo);
}

+ 8 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/exception/dao/BaseExceptionLogDao.java

@ -0,0 +1,8 @@
package com.yihu.jw.restmodel.exception.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
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/exception/dao/BaseExceptionServerDictDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.restmodel.exception.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);
}

+ 22 - 26
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java

@ -4,6 +4,8 @@ package com.yihu.jw.restmodel.web.endpoint;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.dict.BaseExceptionDictDO;
import com.yihu.jw.restmodel.exception.dao.BaseExceptionDictDao;
import com.yihu.jw.restmodel.web.*;
import com.yihu.jw.restmodel.web.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
@ -34,6 +36,8 @@ public abstract class EnvelopRestEndpoint extends Exception {
    @Autowired
    @Autowired
    protected ObjectMapper objectMapper;
    protected ObjectMapper objectMapper;
    @Autowired
    protected BaseExceptionDictDao baseExceptionDictDao;
    protected Envelop success() {
    protected Envelop success() {
        return success("success");
        return success("success");
@ -199,61 +203,53 @@ public abstract class EnvelopRestEndpoint extends Exception {
    }
    }
    protected Envelop failedException(Exception e){
    protected Envelop failedException(Exception e){
        if (e.getClass().equals(DataAccessException.class))
        {
        BaseExceptionDictDO baseExceptionDictDO =baseExceptionDictDao.findByExceptionInfo(DataAccessException.class.toString());
        if (baseExceptionDictDO!=null){
            e.printStackTrace();
            return failed(baseExceptionDictDO.getRemindContent(),Integer.parseInt(baseExceptionDictDO.getCode()));
        }
        if (e.getClass().equals(DataAccessException.class)) {
            e.printStackTrace();//数据库操作失败
            e.printStackTrace();//数据库操作失败
            return null;
            return null;
        } else if (e.getClass().toString().equals(
        } else if (e.getClass().toString().equals(
                NullPointerException.class.toString()))
        {
                NullPointerException.class.toString())) {
            e.printStackTrace();
            e.printStackTrace();
            //调用了未经初始化的对象或者是不存在的对象!
            //调用了未经初始化的对象或者是不存在的对象!
            return failed("空指针",170004);
            return failed("空指针",170004);
        } else if (e.getClass().equals(IOException.class))
        {
        } else if (e.getClass().equals(IOException.class)) {
            e.printStackTrace();
            e.printStackTrace();
            //IO异常!
            //IO异常!
            return null;
            return null;
        } else if (e.getClass().equals(ClassNotFoundException.class))
        {
        } else if (e.getClass().equals(ClassNotFoundException.class)) {
            e.printStackTrace();//指定的类不存在!
            e.printStackTrace();//指定的类不存在!
            return null;
            return null;
        } else if (e.getClass().equals(ArithmeticException.class))
        {
        } else if (e.getClass().equals(ArithmeticException.class)) {
            e.printStackTrace();//数学运算异常!
            e.printStackTrace();//数学运算异常!
            return null;
            return null;
        } else if (e.getClass().equals(ArrayIndexOutOfBoundsException.class))
        {
        } else if (e.getClass().equals(ArrayIndexOutOfBoundsException.class)) {
            e.printStackTrace();
            e.printStackTrace();
            //数组下标越界!
            //数组下标越界!
            return null;
            return null;
        } else if (e.getClass().equals(IllegalArgumentException.class))
        {
        } else if (e.getClass().equals(IllegalArgumentException.class)) {
            e.printStackTrace();
            e.printStackTrace();
            //方法的参数错误!
            //方法的参数错误!
            return null;
            return null;
        } else if (e.getClass().equals(ClassCastException.class))
        {
        } else if (e.getClass().equals(ClassCastException.class)) {
            e.printStackTrace();//类型强制转换错误!
            e.printStackTrace();//类型强制转换错误!
            return null;
            return null;
        } else if (e.getClass().equals(SecurityException.class))
        {
        } else if (e.getClass().equals(SecurityException.class)) {
            e.printStackTrace();//违背安全原则异常!
            e.printStackTrace();//违背安全原则异常!
            return null;
            return null;
        } else if (e.getClass().equals(SQLException.class))
        {
        } else if (e.getClass().equals(SQLException.class)) {
            e.printStackTrace();//操作数据库异常!
            e.printStackTrace();//操作数据库异常!
            return null;
            return null;
        } else if (e.getClass().equals(NoSuchMethodError.class))
        {
        } else if (e.getClass().equals(NoSuchMethodError.class)) {
            e.printStackTrace();//方法末找到异常!
            e.printStackTrace();//方法末找到异常!
            return null;
            return null;
        } else if (e.getClass().equals(InternalError.class))
        {
        } else if (e.getClass().equals(InternalError.class)) {
            e.printStackTrace();//Java虚拟机发生了内部错误
            e.printStackTrace();//Java虚拟机发生了内部错误
            return null;
            return null;
        } else
        {
        } else {
            e.printStackTrace();//程序内部错误,操作失败!
            e.printStackTrace();//程序内部错误,操作失败!
            return null;
            return null;
        }
        }