xuhy
2023-03-06 3bcf6a65dfb9813dff2986c9cc03b638742ce64e
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.base.tips.SuccessTip;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.DateUtil;
import com.stylefeng.guns.modular.system.controller.resp.TDriverCommissionResp;
import com.stylefeng.guns.modular.system.controller.resp.TDriverResp;
@@ -84,6 +85,15 @@
            wrapper.between("createTime",startTime,endTime);
        }
        wrapper.orderBy(true,"approvalStatus");
        // 判断是否为代理商或者分公司
        if(Objects.requireNonNull(ShiroKit.getUser()).getRoleType() == 2){
            // 分公司
            wrapper.eq("branchOfficeId",ShiroKit.getUser().getObjectId());
        }
        if(Objects.requireNonNull(ShiroKit.getUser()).getRoleType() == 3){
            // 代理商
            wrapper.eq("agentId",ShiroKit.getUser().getObjectId());
        }
        return wrapper;
    }
@@ -331,6 +341,15 @@
            wrapper.like("name",name);
        }
        wrapper.orderBy(true,"approvalStatus");
        // 判断是否为代理商或者分公司
        if(Objects.requireNonNull(ShiroKit.getUser()).getRoleType() == 2){
            // 分公司
            wrapper.eq("branchOfficeId",ShiroKit.getUser().getObjectId());
        }
        if(Objects.requireNonNull(ShiroKit.getUser()).getRoleType() == 3){
            // 代理商
            wrapper.eq("agentId",ShiroKit.getUser().getObjectId());
        }
        return wrapper;
    }