Pu Zhibing
3 天以前 5dacdee9b54c78372b68140e2b068d03a620eab9
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SellingCarController.java
@@ -1,11 +1,14 @@
package com.stylefeng.guns.modular.system.controller.general;
import com.stylefeng.guns.modular.system.util.ExcelExportUtil;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.*;
import com.stylefeng.guns.core.beetl.ShiroExtUtil;
import com.stylefeng.guns.core.util.DateUtil;
import com.stylefeng.guns.core.util.SinataUtil;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.core.util.WoUtil;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.ExcelExportUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
@@ -21,6 +24,7 @@
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
@@ -44,26 +48,30 @@
    @Autowired
    private ITRegionService regionService;
    @Autowired
    private ITUserService userService;
    @Autowired
    private ITDriverService driverService;
    @Autowired
    private ITCompanyService companyService;
    @Resource
    private ShiroExtUtil shiroExtUtil;
    /**
     * 跳转到列表页
     *
     * @return
     */
    @GetMapping("/showSellingCarList")
    public String showSellingCarList(Model model){
    public String showSellingCarList(Model model) {
        List<TCarBrand> state = carBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1));
        model.addAttribute("carBrand", state);
        model.addAttribute("userType", ShiroKit.getUser().getRoleType());
        model.addAttribute("userType", shiroExtUtil.getUser().getRoleType());
        return PREFIX + "sellingCar.html";
    }
@@ -73,8 +81,8 @@
     * @return
     */
    @GetMapping("/sellingCar_add")
    public String sellingCar_add(Model model){
        model.addAttribute("push", ShiroKit.getUser().getRoleType() == 1 ? true : false);
    public String sellingCar_add(Model model) {
        model.addAttribute("push", shiroExtUtil.getUser().getRoleType() == 1 ? true : false);
        List<TCarBrand> state = carBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1));
        model.addAttribute("carBrand", state);
        List<TRegion> regions = regionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0));
@@ -91,13 +99,13 @@
     * @return
     */
    @GetMapping("/sellingCar_update")
    public String sellingCar_update(Model model, Integer id){
    public String sellingCar_update(Model model, Integer id) {
        SellingCar sellingCar = sellingCarService.selectById(id);
        model.addAttribute("item", sellingCar);
        model.addAttribute("imgs", sellingCar.getImgUrl().split(","));
        model.addAttribute("videos", sellingCar.getVideoUrl().split(","));
        model.addAttribute("describeImgs", sellingCar.getDescribeImgUrl().split(","));
        model.addAttribute("push", ShiroKit.getUser().getRoleType() == 1 ? true : false);
        model.addAttribute("push", shiroExtUtil.getUser().getRoleType() == 1 ? true : false);
        List<TCarBrand> state = carBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1));
        model.addAttribute("carBrand", state);
        List<TRegion> regions = regionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0));