zhangnaisong
2023-07-20 1b5007fd66cb2c56e7b54b793cdd3f29785f5c04
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
@@ -1,15 +1,18 @@
package com.ruoyi.sy.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.utils.httpclient.SYCarClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.bytedeco.javacv.CanvasFrame;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -139,9 +142,7 @@
    @PostMapping("/getArdSyCarNoRight")
    @ApiOperation("获取未挂接权限的三一车辆")
    public Map<String,Object> getArdSyCarNoRight(){
        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        HttpServletRequest request = attributes.getRequest();
        String userId = request.getHeader("token");
        String userId = SecurityUtils.getUserId();
        Map<String,Object> result = ardSyCarService.getArdSyCarNoRight(userId);
        if(((String)result.get("code")).equals("500")){
            return error((String) result.get("data"));
@@ -152,4 +153,19 @@
        }
    }
    /**
     * 获取全部车辆模型
     */
    @PreAuthorize("@ss.hasPermi('sy:syCar:getAllCarModel')")
    @PostMapping("/getAllCarModel")
    @ApiOperation("获取全部车辆模型")
    public Map<String,Object> getAllCarModel(){
        try{
            List<Map<String,String>> result = ardSyCarService.getAllCarModel();
            return toAjaxList(result);
        } catch(Exception e){
            return toAjaxList(new ArrayList());
        }
    }
}