This commit is contained in:
邱贞招 2024-12-17 08:49:31 +08:00
parent 45e8c906f3
commit 75123b96a4
2 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,6 @@ package com.ruoyi.web.controller.system;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.HttpStatus;
@ -30,6 +29,8 @@ import javax.annotation.Resource;
import java.util.List;
import java.util.Set;
import static com.ruoyi.common.utils.SecurityUtils.getUserId;
/**
* 登录验证
*
@ -129,9 +130,7 @@ public class SysLoginController
if(ObjectUtil.isNotNull(userId)){
user = userService.selectUserById(userId);
}else{
user = SecurityUtils.getLoginUser().getAsUser();
log.info("获取到当前登录用户:{}", JSON.toJSON(user));
user = asUserMapper.selectUserById(user.getUserId());
user = asUserMapper.selectUserById(getUserId());
}
// 根据用户角色查询所有菜单
List<EtMenu> etMenus = appMenuService.selectEtMenuListByRole(user.getSysRole());
@ -148,7 +147,7 @@ public class SysLoginController
@GetMapping("getRouters")
public AjaxResult getRouters()
{
Long userId = SecurityUtils.getUserId();
Long userId = getUserId();
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
SysDept sysDept = deptService.selectDeptById(SecurityUtils.getDeptId());
// if(!sysDept.getIsProfitSharing().equals("true")){

View File

@ -225,10 +225,11 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
LogEntry.LocationValue value = logEntry.getValue();
// 坐标转换 WGS84 GCJ02
double[] doubles = CommonUtil.coordinateConvert(value.getLon(),value.getLat());
BigDecimal lon = new BigDecimal(doubles[1]).setScale(8, RoundingMode.HALF_UP);
BigDecimal lat = new BigDecimal(doubles[0]).setScale(8, RoundingMode.HALF_UP);
BigDecimal lon = BigDecimal.valueOf(doubles[1]).setScale(8, RoundingMode.HALF_UP);
BigDecimal lat = BigDecimal.valueOf(doubles[0]).setScale(8, RoundingMode.HALF_UP);
asDevice.setLongitude(lon.toString());
asDevice.setLatitude(lat.toString());
asDevice.setLastLocationTime(new Date(logEntry.getAt()));
}
//正在进行中的订单
EtOrder order = new EtOrder();