zhangnaisong
2024-01-29 1100a88fb4ddf156efc5a7695f91caae0859df94
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
@@ -29,6 +29,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -43,7 +44,7 @@
/**
 * 三一车辆Controller
 *
 *
 * @author ard
 * @date 2023-06-26
 */
@@ -75,6 +76,9 @@
    private ArdSyCarController ardSyCarController;
    @Value("${syCar.enabled}")
    private Boolean syCarEnabled;
    @PostConstruct
    public void init(){
        ardSyCarController = this;
@@ -84,7 +88,8 @@
        config.setConfigKey("syCarPT");
        List<SysConfig> sysConfigResult = sysConfigService.selectConfigList(config);
        String syURL = "";
        if(sysConfigResult.size() == 0){
        //if(sysConfigResult.size() == 0){
        if(!syCarEnabled){//三一车辆加入开关
            return;
        }else{
            syURL = sysConfigResult.get(0).getConfigValue();
@@ -455,7 +460,7 @@
    @GetMapping("getThreeOne")
    @ApiOperation("获取三一视频地址")
    public AjaxResult getThreeOne() {
        return AjaxResult.success("获取地址成功!",sysConfigService.selectConfigByKey("threeOneVideo"));
        return AjaxResult.success("获取地址成功!",sysConfigService.getSYVideo());
    }
    @PreAuthorize("@ss.hasPermi('sy:syCar:getAlarmHPfmCountDetail')")
@@ -473,4 +478,17 @@
        return AjaxResult.success(mapDetail);
    }
    @GetMapping("/getOnlineSYCarPosition")
    @ApiOperation("单兵端查看已通过审批的在线三一车辆位置")
    public AjaxResult getOnlineSYCarPosition() {
        String soilderId = SecurityUtils.getUserId();
        try{
            Map<String,Object> result = ardSyCarService.getOnlineSYCarPosition(soilderId);
            return AjaxResult.success(result);
        }catch(Exception e){
            e.printStackTrace();
            return AjaxResult.error();
        }
    }
}