| | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | 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.*; |
| | | import com.stylefeng.guns.modular.system.dao.CarInsuranceMapper; |
| | |
| | | import org.jsoup.Jsoup; |
| | | import org.jsoup.nodes.Document; |
| | | import org.jsoup.nodes.Element; |
| | | 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; |
| | | |
| | |
| | | //查询平台ID |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | //判断是平台司机还是加盟司机 |
| | | if ((SinataUtil.isEmpty(tCar.getCompanyId()) || tCar.getCompanyId() == 0 || tCar.getCompanyId() == company.getId()) && (SinataUtil.isEmpty(tCar.getFranchiseeId()) || tCar.getFranchiseeId() == 0)){ |
| | | if (tCar.getCompanyId() == 1){ |
| | | model.addAttribute("companyType",1); |
| | | }else{ |
| | | model.addAttribute("companyType",2); |
| | |
| | | tCar.setCompanyId(oneId); |
| | | } |
| | | if (SinataUtil.isNotEmpty(twoId)){ |
| | | tCar.setFranchiseeId(twoId); |
| | | tCar.setCompanyId(twoId); |
| | | } |
| | | }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); |
| | |
| | | tCar.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | tCar.setFranchiseeId(franchiseeId); |
| | | tCar.setCompanyId(franchiseeId); |
| | | } |
| | | tCar.setIsPlatCar(2); |
| | | tCar.setAddType(3); |
| | |
| | | tCar.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tCar.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | tCar.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | tCar.setIsPlatCar(2); |
| | | tCar.setAddType(4); |
| | |
| | | tCar.setCompanyId(oneId); |
| | | } |
| | | if (SinataUtil.isNotEmpty(twoId)){ |
| | | tCar.setFranchiseeId(twoId); |
| | | tCar.setCompanyId(twoId); |
| | | } |
| | | }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()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | tCar.setFranchiseeId(franchiseeId); |
| | | tCar.setCompanyId(franchiseeId); |
| | | } |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | |
| | | tCar.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tCar.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | tCar.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | } |
| | | |
| | |
| | | }else if ("加盟车辆".equals(zero)){ |
| | | car.setIsPlatCar(2); |
| | | } |
| | | car.setCompanyId(companyId); |
| | | car.setFranchiseeId(franchiseeId); |
| | | car.setCompanyId(0 == franchiseeId ? franchiseeId : companyId); |
| | | car.setCarColor(eleven); |
| | | car.setCarBrandId(carBrandId); |
| | | car.setCarModelId(carModelId); |