| | |
| | | */ |
| | | @RequestMapping("/tCar_add") |
| | | public String tCarAdd(Model model) { |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2)); |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).ne("flag",3)); |
| | | model.addAttribute("companyList",companyList); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | 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>().ne("flag",3).eq("type", 3).eq("superiorId",ShiroKit.getUser().getObjectId())); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | }else{ |
| | | model.addAttribute("franchiseeList",null); |
| | |
| | | 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) |
| | | .ne("flag",3)); |
| | | model.addAttribute("companyList",companyList); |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",tCar.getCompanyId())); |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).ne("flag",3).eq("superiorId",tCar.getCompanyId())); |
| | | 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).ne("flag",3).eq("superiorId",ShiroKit.getUser().getObjectId())); |
| | | 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).ne("flag",3)); |
| | | //判断是平台司机还是加盟司机 |
| | | if ((SinataUtil.isEmpty(tCar.getCompanyId()) || tCar.getCompanyId() == 0 || tCar.getCompanyId() == company.getId()) && (SinataUtil.isEmpty(tCar.getFranchiseeId()) || tCar.getFranchiseeId() == 0)){ |
| | | model.addAttribute("companyType",1); |
| | |
| | | public Object add(TCar tCar, String serverBox,Integer roleType,Integer companyType,Integer oneId,Integer twoId,Integer franchiseeId) { |
| | | |
| | | // 判断车牌号是否存在 |
| | | if (tCarService.selectCount(new EntityWrapper<TCar>().eq("carLicensePlate", tCar.getCarLicensePlate())) > 0){ |
| | | return ResultUtil.runErr("车牌号已存在"); |
| | | if (tCarService.selectCount(new EntityWrapper<TCar>().eq("state", 1).eq("carLicensePlate", tCar.getCarLicensePlate())) > 0){ |
| | | return ResultUtil.error("车牌号已存在"); |
| | | } |
| | | |
| | | if (1 == roleType){ //平台 |
| | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TCar tCar,@RequestParam String serverBox,Integer roleType,Integer companyType,Integer oneId,Integer twoId,Integer franchiseeId,String zcModel,String kcModel) { |
| | | |
| | | int i1 = tCarService.selectCount(new EntityWrapper<TCar>().eq("carLicensePlate", tCar.getCarLicensePlate()) |
| | | .ne("id", tCar.getId()) |
| | | .eq("state", 1)); |
| | | // 判断车牌号是否存在 |
| | | if (tCarService.selectCount(new EntityWrapper<TCar>().eq("carLicensePlate", tCar.getCarLicensePlate()) |
| | | .ne("id", tCar.getId())) > 0){ |
| | | return ResultUtil.runErr("车牌号已存在"); |
| | | if ( i1> 0){ |
| | | return ResultUtil.error("车牌号已存在"); |
| | | } |
| | | |
| | | if (1 == roleType){ //平台 |
| | |
| | | shellList.add("服务模式:包车[是/否]"); |
| | | shellList.add("车辆品牌"); |
| | | shellList.add("车辆类型"); |
| | | shellList.add("车辆颜色[蓝白色/绿色]"); |
| | | shellList.add("车辆颜色[蓝白色/绿色/黄色]"); |
| | | shellList.add("车牌号"); |
| | | dataList.add(shellList); |
| | | |
| | |
| | | return new ErrorTip(500, "服务模式【包车】内容不正确"); |
| | | } |
| | | //判断车辆颜色 |
| | | if (!eleven.equals("蓝白色") && !eleven.equals("绿色") ){ |
| | | if (!eleven.equals("蓝白色") && !eleven.equals("绿色") && !eleven.equals("黄色") ){ |
| | | return new ErrorTip(500, "车辆颜色内容不正确"); |
| | | } |
| | | //判断年检到期时间格式是否正确 |