| | |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.WoUtil; |
| | |
| | | |
| | | @Autowired |
| | | private ITCarServiceService itCarServiceService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITServerCarmodelService itServerCarmodelService; |
| | | |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | |
| | | @Resource |
| | | private CarInsuranceMapper carInsuranceMapper; |
| | | |
| | | @Resource |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).eq("state", 0).ne("flag", 3)); |
| | | model.addAttribute("companyList", companyList); |
| | | |
| | | Integer roleType = ShiroExtUtil.getUser().getRoleType(); |
| | | Integer roleType = shiroExtUtil.getUser().getRoleType(); |
| | | model.addAttribute("roleType", roleType); |
| | | if (2 == roleType) { |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", ShiroExtUtil.getUser().getObjectId()).eq("state", 0).ne("flag", 3)); |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", shiroExtUtil.getUser().getObjectId()).eq("state", 0).ne("flag", 3)); |
| | | model.addAttribute("franchiseeList", franchiseeList); |
| | | } else { |
| | | model.addAttribute("franchiseeList", null); |
| | | } |
| | | //查询当前用户所属分公司/加盟商 |
| | | model.addAttribute("objectName", tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()).getName()); |
| | | model.addAttribute("objectName", tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()).getName()); |
| | | |
| | | //车辆品牌 |
| | | List<TCarBrand> brandList = tCarBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1)); |
| | |
| | | model.addAttribute("item", tCar); |
| | | LogObjectHolder.me().set(tCar); |
| | | |
| | | Integer roleType = ShiroExtUtil.getUser().getRoleType(); |
| | | Integer roleType = shiroExtUtil.getUser().getRoleType(); |
| | | model.addAttribute("roleType", roleType); |
| | | model.addAttribute("objectName", tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()).getName()); |
| | | model.addAttribute("objectName", tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()).getName()); |
| | | |
| | | if (1 == roleType) { |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).eq("state", 0).ne("flag", 3)); |
| | |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", tCar.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", ShiroExtUtil.getUser().getObjectId()).eq("state", 0).ne("flag", 3)); |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", shiroExtUtil.getUser().getObjectId()).eq("state", 0).ne("flag", 3)); |
| | | model.addAttribute("franchiseeList", franchiseeList); |
| | | } |
| | | |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tCarService.getCarList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, id, brandName, modelName, carColor, serverStr, carLicensePlate, driverName, companyName, franchiseeName)); |
| | | page.setRecords(tCarService.getCarList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, id, brandName, modelName, carColor, serverStr, carLicensePlate, driverName, companyName, franchiseeName)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | |
| | | tCar.setAddType(2); |
| | | tCar.setIsPlatCar(1); |
| | | } else if (2 == roleType) { //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setCompanyId(shiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)) { |
| | | tCar.setFranchiseeId(franchiseeId); |
| | | } |
| | | tCar.setIsPlatCar(2); |
| | | tCar.setAddType(3); |
| | | tCar.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | tCar.setAddObjectId(shiroExtUtil.getUser().getObjectId()); |
| | | } else if (3 == roleType) { //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); |
| | | TCompany tCompany = tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)) { |
| | | tCar.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setFranchiseeId(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setFranchiseeId(shiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | tCar.setIsPlatCar(2); |
| | | tCar.setAddType(4); |
| | | tCar.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | tCar.setAddObjectId(shiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | tCar.setInsertTime(new Date()); |
| | | tCar.setState(1); |
| | |
| | | tCar.setFranchiseeId(0); |
| | | } |
| | | } else if (2 == roleType) { //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setCompanyId(shiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)) { |
| | | tCar.setFranchiseeId(franchiseeId); |
| | | } |
| | | } else if (3 == roleType) { //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); |
| | | TCompany tCompany = tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)) { |
| | | tCar.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setFranchiseeId(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setFranchiseeId(shiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | } |
| | | |
| | |
| | | car.setCommercialInsuranceTime(DateUtil.parseDate(fifteen)); |
| | | car.setInsertTime(new Date()); |
| | | car.setState(1); |
| | | if (ShiroExtUtil.getUser().getRoleType() == 1) { |
| | | if (shiroExtUtil.getUser().getRoleType() == 1) { |
| | | car.setAddType(2); |
| | | } else if (ShiroExtUtil.getUser().getRoleType() == 2) { |
| | | } else if (shiroExtUtil.getUser().getRoleType() == 2) { |
| | | car.setAddType(3); |
| | | car.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | } else if (ShiroExtUtil.getUser().getRoleType() == 3) { |
| | | car.setAddObjectId(shiroExtUtil.getUser().getObjectId()); |
| | | } else if (shiroExtUtil.getUser().getRoleType() == 3) { |
| | | car.setAddType(4); |
| | | car.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | car.setAddObjectId(shiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | tCarService.insert(car); |
| | | |
| | |
| | | */ |
| | | @RequestMapping(value = "/outCar") |
| | | public void outCar(HttpServletRequest request, HttpServletResponse response) { |
| | | List<Map<String, Object>> listMap = tCarService.getCarListNoPage(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId()); |
| | | List<Map<String, Object>> listMap = tCarService.getCarListNoPage(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId()); |
| | | |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<>(); |