| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | 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.modular.system.util.PushMinistryOfTransportUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.apache.poi.hdf.extractor.TC; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | |
| | | @RequestMapping("/tCar_add") |
| | | public String tCarAdd(Model model) { |
| | | 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(); |
| | | model.addAttribute("roleType",roleType); |
| | | if (2 == roleType){ |
| | | 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); |
| | | }else{ |
| | | model.addAttribute("franchiseeList",null); |
| | | model.addAttribute("companyList", companyList); |
| | | |
| | | 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)); |
| | | model.addAttribute("franchiseeList", franchiseeList); |
| | | } else { |
| | | model.addAttribute("franchiseeList", null); |
| | | } |
| | | //查询当前用户所属分公司/加盟商 |
| | | model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.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("brandList",brandList); |
| | |
| | | @RequestMapping("/tCar_update/{tCarId}") |
| | | public String tCarUpdate(@PathVariable Integer tCarId, Model model) { |
| | | TCar tCar = tCarService.selectById(tCarId); |
| | | model.addAttribute("item",tCar); |
| | | model.addAttribute("item", tCar); |
| | | LogObjectHolder.me().set(tCar); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.getUser().getObjectId()).getName()); |
| | | |
| | | if (1 == roleType){ |
| | | |
| | | Integer roleType = ShiroExtUtil.getUser().getRoleType(); |
| | | model.addAttribute("roleType", roleType); |
| | | 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)); |
| | | model.addAttribute("companyList",companyList); |
| | | 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",ShiroKit.getUser().getObjectId()).eq("state", 0).ne("flag", 3)); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | model.addAttribute("companyList", companyList); |
| | | 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)); |
| | | model.addAttribute("franchiseeList", franchiseeList); |
| | | } |
| | | |
| | | //查询平台ID |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tCarService.getCarList(page,ShiroKit.getUser().getRoleType(),ShiroKit.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); |
| | | } |
| | | |
| | |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | tCar.setCompanyId(oneId); |
| | | } |
| | | if (SinataUtil.isNotEmpty(twoId)){ |
| | | if (SinataUtil.isNotEmpty(twoId)) { |
| | | tCar.setFranchiseeId(twoId); |
| | | } |
| | | }else if (1 == companyType.intValue()){ |
| | | } else if (1 == companyType.intValue()) { |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | tCar.setCompanyId(company.getId()); |
| | | tCar.setFranchiseeId(0); |
| | | } |
| | | tCar.setAddType(2); |
| | | tCar.setIsPlatCar(1); |
| | | }else if (2 == roleType){ //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tCar.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } else if (2 == roleType) { //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | if (SinataUtil.isNotEmpty(franchiseeId)) { |
| | | tCar.setFranchiseeId(franchiseeId); |
| | | } |
| | | tCar.setIsPlatCar(2); |
| | | tCar.setAddType(3); |
| | | tCar.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)){ |
| | | tCar.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | } else if (3 == roleType) { //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)) { |
| | | tCar.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tCar.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setFranchiseeId(ShiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | tCar.setIsPlatCar(2); |
| | | tCar.setAddType(4); |
| | | tCar.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | tCar.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | tCar.setInsertTime(new Date()); |
| | | tCar.setState(1); |
| | |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | tCar.setCompanyId(oneId); |
| | | } |
| | | if (SinataUtil.isNotEmpty(twoId)){ |
| | | if (SinataUtil.isNotEmpty(twoId)) { |
| | | tCar.setFranchiseeId(twoId); |
| | | } |
| | | }else if (1 == companyType.intValue()){ |
| | | } else if (1 == companyType.intValue()) { |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | tCar.setCompanyId(company.getId()); |
| | | tCar.setFranchiseeId(0); |
| | | } |
| | | }else if (2 == roleType){ //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tCar.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } else if (2 == roleType) { //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { |
| | | tCar.setCompanyId(ShiroExtUtil.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | if (SinataUtil.isNotEmpty(franchiseeId)) { |
| | | tCar.setFranchiseeId(franchiseeId); |
| | | } |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)){ |
| | | } else if (3 == roleType) { //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)) { |
| | | tCar.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tCar.setFranchiseeId(ShiroKit.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 (ShiroKit.getUser().getRoleType() == 1){ |
| | | if (ShiroExtUtil.getUser().getRoleType() == 1) { |
| | | car.setAddType(2); |
| | | }else if (ShiroKit.getUser().getRoleType() == 2){ |
| | | } else if (ShiroExtUtil.getUser().getRoleType() == 2) { |
| | | car.setAddType(3); |
| | | car.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | }else if (ShiroKit.getUser().getRoleType() == 3){ |
| | | car.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); |
| | | } else if (ShiroExtUtil.getUser().getRoleType() == 3) { |
| | | car.setAddType(4); |
| | | car.setAddObjectId(ShiroKit.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(ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId()); |
| | | List<Map<String, Object>> listMap = tCarService.getCarListNoPage(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId()); |
| | | |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<>(); |