中扬CRM客户关系管理系统
#
luxiaotao1123
2022-11-17 ae74afaa41ea017f94d6c9d7fbf3d15aaaaf59b2
src/main/java/com/zy/crm/common/web/BaseController.java
@@ -7,6 +7,8 @@
import com.core.common.Cools;
import com.core.controller.AbstractBaseController;
import com.core.exception.CoolException;
import com.zy.crm.system.entity.Dept;
import com.zy.crm.system.service.DeptService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import com.zy.crm.manager.entity.Node;
@@ -38,6 +40,8 @@
    private TagService tagService;
    @Autowired
    private NodeService nodeService;
    @Autowired
    private DeptService deptService;
    @Autowired
    private UserLoginService userLoginService;
@@ -79,6 +83,11 @@
        }
        return user;
    }
    protected Long getDeptId() {
        return getUser().getDeptId();
    }
    protected String getComment(Class<?> cls, String fieldName){
        Field[] fields = Cools.getAllFields(cls);
        for (Field field : fields){
@@ -99,6 +108,14 @@
            throw new CoolException("库区数据错误");
        }
        return node;
    }
    protected Dept getOriginDept(){
        Dept dept = deptService.getTop(getHostId());
        if (dept == null) {
            throw new CoolException("部门数据错误");
        }
        return dept;
    }
    protected <T> void hostEq(EntityWrapper<T> wrapper){
@@ -170,6 +187,9 @@
            }
            String column = null;
            if (field.isAnnotationPresent(TableField.class)) {
                if (!field.getAnnotation(TableField.class).exist()) {
                    continue;
                }
                column = field.getAnnotation(TableField.class).value();
            }
            if (Cools.isEmpty(column)) {