Pu Zhibing
6 天以前 4c99ee7028c3fe58a2cd4b8273b22c75c45574fc
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
@@ -11,13 +11,13 @@
import com.stylefeng.guns.core.log.LogObjectHolder;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.*;
import com.stylefeng.guns.core.util.DateUtil;
import com.stylefeng.guns.core.util.WoUtil;
import com.stylefeng.guns.modular.system.dao.DriverPunishMapper;
import com.stylefeng.guns.modular.system.dao.DriverTrainMapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.util.EmailUtil;
import com.stylefeng.guns.modular.system.util.RedisUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
@@ -82,8 +82,18 @@
    
    @Autowired
    private RedisUtil redisUtil;
    @Autowired
    private IIncomeService incomeService;
    @Autowired
    private ITUserService userService;
    @Autowired
    private IUserActivityInviteService userActivityInviteService;
    @Autowired
    private IDriverActivityRegisteredService driverActivityRegisteredService;
    @Autowired
    private ITCompanyService itCompanyService;
    @Autowired
    private ITDriverServiceService itDriverServiceService;
    /**
     * 跳转到司机审核列表首页
@@ -108,7 +118,8 @@
     */
    @RequestMapping("/tDriver_add")
    public String tDriverAdd(Model model) {
        List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2));
        List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2)
                .eq("state", 0).ne("flag", 3));
        model.addAttribute("companyList",companyList);
        Integer roleType = ShiroKit.getUser().getRoleType();
@@ -187,17 +198,17 @@
        model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.getUser().getObjectId()).getName());
        if (1 == roleType){
            List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2));
            List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).eq("state", 0).ne("flag", 3));
            model.addAttribute("companyList",companyList);
            List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",tDriver.getCompanyId()));
            List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",tDriver.getCompanyId()).eq("state", 0).ne("flag", 3));
            model.addAttribute("franchiseeList",franchiseeList);
        }else if (2 == roleType){
            List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",ShiroKit.getUser().getObjectId()));
            List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",ShiroKit.getUser().getObjectId()).eq("state", 0).ne("flag", 3));
            model.addAttribute("franchiseeList",franchiseeList);
        }
        //查询平台ID
        TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1));
        TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1).eq("state", 0).ne("flag", 3));
        //判断是平台司机还是加盟司机
        if ((SinataUtil.isEmpty(tDriver.getCompanyId()) || tDriver.getCompanyId() == 0 || tDriver.getCompanyId() == company.getId()) && (SinataUtil.isEmpty(tDriver.getFranchiseeId()) || tDriver.getFranchiseeId() == 0)){
            model.addAttribute("companyType",1);
@@ -260,7 +271,6 @@
        model.addAttribute("id", id);
        return PREFIX + "training.html";
    }
    /**
     * 保存培训数据
@@ -331,7 +341,6 @@
        return ResultUtil.success(driverTrains);
    }
    /**
     * 跳转到处罚页
     * @param id
@@ -343,7 +352,6 @@
        model.addAttribute("id", id);
        return PREFIX + "punish.html";
    }
    /**
     * 保存处罚数据
@@ -407,7 +415,6 @@
        return ResultUtil.success();
    }
    /**
     * 获取所有处罚数据
     * @param driverId
@@ -419,7 +426,6 @@
        List<DriverPunish> driverPunishes = driverPunishMapper.queryAllPunish(driverId);
        return ResultUtil.success(driverPunishes);
    }
    /**
     * 根据分公司ID获取加盟商
@@ -475,7 +481,8 @@
    public Object listYesDriver(String insertTime,
                       String companyName,
                       String phone,
                       String name,
                       String lastName,
                                String firstName,
                       Integer addType,
                       Integer authState,
                       Integer state,
@@ -488,7 +495,7 @@
            endTime = timeArray[1];
        }
        Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
        page.setRecords(tDriverService.getDriverList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,companyName,phone,name,addType,authState,state,teamId));
        page.setRecords(tDriverService.getDriverList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,companyName,phone,lastName,firstName,addType,authState,state,teamId));
        return super.packForBT(page);
    }
@@ -517,20 +524,6 @@
        return super.packForBT(page);
    }
    @Autowired
    private IIncomeService incomeService;
    @Autowired
    private ITUserService userService;
    @Autowired
    private IUserActivityInviteService userActivityInviteService;
    @Autowired
    private IDriverActivityRegisteredService driverActivityRegisteredService;
    /**
     * 审核操作  1=通过 2=不通过
@@ -736,7 +729,7 @@
        return SUCCESS_TIP;
    }
    /**
     * 添加线路
     * @param subArr
@@ -756,7 +749,6 @@
        }
    }
    /**
     * 删除司机审核列表
     */
@@ -768,7 +760,7 @@
        tDriverService.updateById(driver);
        return SUCCESS_TIP;
    }
    /**
     * 操作司机状态
     */
@@ -1791,15 +1783,6 @@
        return SUCCESS_TIP;
    }
    @Autowired
    private ITCompanyService itCompanyService;
    @Autowired
    private ITDriverServiceService itDriverServiceService;
    /**
     * 验证是否可以字符转为整数
     * @param str
@@ -1891,8 +1874,8 @@
            }else{
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("name"))){
                shellList.add(object.get("name").toString());
            if(SinataUtil.isNotEmpty(object.get("firstName"))){
                shellList.add(object.get("firstName").toString() + " " + object.get("lastName").toString());
            }else{
                shellList.add("-");
            }
@@ -1902,7 +1885,7 @@
                shellList.add("-");
            }
            if(SinataUtil.isNotEmpty(object.get("sex"))){
                shellList.add(object.get("sex").toString() == "1"?"男":"女");
                shellList.add(object.get("sex").toString().equals("1")?"男":"女");
            }else{
                shellList.add("-");
            }
@@ -1969,8 +1952,6 @@
            }
            if(SinataUtil.isNotEmpty(object.get("authState"))){
                shellList.add(object.get("authState").toString().equals("1")?"待审核":(object.get("authState").toString().equals("2")?"正常":(object.get("authState").toString().equals("3")?"冻结":(object.get("authState").toString().equals("4")?"已拒绝":""))));
                shellList.add(object.get("authState").toString());
            }else{
                shellList.add("-");
            }