Pu Zhibing
2025-06-06 b1f2f102034b4433201225b67a9fc78c08e532f0
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java
@@ -5,6 +5,7 @@
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;
@@ -20,12 +21,11 @@
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;
@@ -185,7 +185,7 @@
        //查询平台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);
@@ -472,12 +472,11 @@
                    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);
@@ -486,7 +485,7 @@
                tCar.setCompanyId(ShiroKit.getUser().getObjectId());
            }
            if (SinataUtil.isNotEmpty(franchiseeId)){
                tCar.setFranchiseeId(franchiseeId);
                tCar.setCompanyId(franchiseeId);
            }
            tCar.setIsPlatCar(2);
            tCar.setAddType(3);
@@ -497,7 +496,7 @@
                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);
@@ -560,19 +559,18 @@
                    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());
@@ -580,7 +578,7 @@
                tCar.setCompanyId(tCompany.getSuperiorId());
            }
            if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){
                tCar.setFranchiseeId(ShiroKit.getUser().getObjectId());
                tCar.setCompanyId(ShiroKit.getUser().getObjectId());
            }
        }
@@ -988,8 +986,7 @@
                    }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);