| | |
| | | package com.ruoyi.sy.controller; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import javax.annotation.PostConstruct; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.sy.param.ArdSyCarParam; |
| | | import com.ruoyi.sy.vo.ArdSyCarVo; |
| | | import com.ruoyi.sy.domain.ArdSyUser; |
| | | import com.ruoyi.sy.gps31.PositionContainer; |
| | | import com.ruoyi.sy.gps31.PushClientImplAlarm; |
| | |
| | | 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.*; |
| | |
| | | import com.ruoyi.sy.domain.ArdSyCar; |
| | | import com.ruoyi.sy.service.IArdSyCarService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | |
| | | |
| | | private ArdSyCarController ardSyCarController; |
| | | |
| | | @Value("${syCar.enabled}") |
| | | private Boolean syCarEnabled; |
| | | |
| | | @PostConstruct |
| | | public void init(){ |
| | | ardSyCarController = this; |
| | | ardSyCarController.sysConfigService = this.sysConfigService; |
| | | ardSyCarController.iArdSyUserService = this.iArdSyUserService; |
| | | |
| | | SysConfig config = new SysConfig(); |
| | | 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(); |
| | |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sy:syCar:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdSyCar ardSyCar) |
| | | @ApiOperation("查询三一车辆列表") |
| | | public AjaxResult list(ArdSyCarParam ardSyCarParam) |
| | | { |
| | | startPage(); |
| | | List<ArdSyCar> list = ardSyCarService.selectArdSyCarList(ardSyCar); |
| | | return getDataTable(list); |
| | | PageHelper.startPage(ardSyCarParam.getPageNum(),ardSyCarParam.getPageSize()); |
| | | String userId = SecurityUtils.getUserId(); |
| | | Map<String,Object> result = ardSyCarService.getArdSyCarAll(userId); |
| | | return ardSyCarService.ardSyCarList(ardSyCarParam,result); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 获取未挂接权限的三一车辆 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sy:syCar:getArdSyCarNoRight')") |
| | | // @PreAuthorize("@ss.hasPermi('sy:syCar:getArdSyCarNoRight')") |
| | | @PostMapping("/getArdSyCarNoRight") |
| | | @ApiOperation("获取未挂接权限的三一车辆") |
| | | public Map<String,Object> getArdSyCarNoRight(){ |
| | |
| | | /** |
| | | * 获取全部的三一车辆 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sy:syCar:getArdSyCarAll')") |
| | | // @PreAuthorize("@ss.hasPermi('sy:syCar:getArdSyCarAll')") |
| | | @PostMapping("/getArdSyCarAll") |
| | | @ApiOperation("获取全部的三一车辆") |
| | | public Map<String,Object> getArdSyCarAll(){ |
| | |
| | | String usersId = SecurityUtils.getUserId(); |
| | | ArdSyUser ardSyUser = iArdSyUserService.userById(usersId); |
| | | String syURL = sysConfigService.getSYURL(); |
| | | return ardSyCarService.allListByUser(ardSyUser,syURL,usersId); |
| | | //根据userId查询部门Id |
| | | SysUser sysUser = sysUserService.selectUserById(usersId); |
| | | //根据当前deptId或者当前及所属下级的所有deptId |
| | | List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId()); |
| | | return ardSyCarService.allListByUser(ardSyUser,syURL,usersId,deptList); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('sy:syCar:carList')") |
| | |
| | | } |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('sy:syCar:carListById')") |
| | | // @PreAuthorize("@ss.hasPermi('sy:syCar:carListById')") |
| | | @PostMapping("/carListById/{id}") |
| | | @ApiOperation("根据车辆ID获取车辆列表") |
| | | public Results carListById(@PathVariable String id){ |