Merge remote-tracking branch 'origin/master'

This commit is contained in:
SjS 2025-04-27 10:30:01 +08:00
commit 6d3df8fc4d
5 changed files with 29 additions and 13 deletions

View File

@ -20,7 +20,7 @@ public interface AreaDashboard {
* @param query
* @return
*/
LongIntegerVO selectMaxOfDeviceCountAreaId(AreaQuery query);
List<LongIntegerVO> selectMaxOfDeviceCountAreaId(AreaQuery query);
}

View File

@ -12,7 +12,6 @@ import com.ruoyi.bst.area.mapper.AreaMapper;
import com.ruoyi.bst.area.service.AreaDashboard;
import com.ruoyi.common.domain.vo.LongIntegerVO;
import com.ruoyi.common.utils.MathUtils;
import com.ruoyi.common.utils.collection.CollectionUtils;
import com.ruoyi.dashboard.constants.StatKeys;
@Service
@ -31,11 +30,9 @@ public class AreaDashboardImpl implements AreaDashboard {
}
@Override
public LongIntegerVO selectMaxOfDeviceCountAreaId(AreaQuery query) {
PageHelper.startPage(1, 1);
public List<LongIntegerVO> selectMaxOfDeviceCountAreaId(AreaQuery query) {
PageHelper.orderBy("value desc");
List<LongIntegerVO> list = areaMapper.selectDeviceCountGroupByAreaId(query);
return CollectionUtils.firstElement(list);
return areaMapper.selectDeviceCountGroupByAreaId(query);
}
}

View File

@ -229,7 +229,12 @@ public class RealNameServiceImpl implements RealNameService
realName.setType(RealNameType.TWO_ELEMENT.getCode());
realName.setResult(isSuccess ? "认证成功" : idRes.getReason());
return this.handleNormalRealName(realName, null);
int result = this.handleNormalRealName(realName, null);
ServiceUtil.assertion(result != 1, "实名认证失败");
ServiceUtil.assertion(!isSuccess, "二要素实名认证未通过");
return result;
}
private int handleNormalRealName(RealName realName, String cacheKey) {

View File

@ -10,7 +10,6 @@ import java.util.stream.Collectors;
import javax.validation.Validator;
import com.ruoyi.bst.device.domain.Device;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -862,7 +861,7 @@ public class UserServiceImpl implements UserService
}
UserVO data = new UserVO();
data.setUserId(user.getUserId());
data.setRealName(user.getUserName());
data.setRealName(user.getRealName());
data.setRealIdCard(user.getRealIdCard());
data.setRealPhone(user.getRealPhone());
data.setIsReal(user.getIsReal());

View File

@ -1,6 +1,8 @@
package com.ruoyi.web.app;
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -15,6 +17,7 @@ import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.domain.vo.LongIntegerVO;
import com.ruoyi.common.utils.collection.CollectionUtils;
import io.swagger.annotations.ApiOperation;
@ -59,11 +62,23 @@ public class AppAreaController extends BaseController {
}
setQuery(query);
// 查询设备数量最多的运营区ID
LongIntegerVO max = areaDashboard.selectMaxOfDeviceCountAreaId(query);
if (max == null) {
// 按设备数量排序查询附近的运营区
Long areaId = query.getId();
query.setId(null);
List<LongIntegerVO> list = areaDashboard.selectMaxOfDeviceCountAreaId(query);
if (CollectionUtils.isEmptyElement(list)) {
return success();
}
}
// 如果有传运营区ID则优先找运营区
LongIntegerVO max = null;
if (areaId != null) {
max = list.stream().filter(item -> Objects.equals(item.getKey(), areaId)).findFirst().orElse(null);
}
// 若没有找到对应运营区则取设备数量最多的运营区
if (max == null) {
max = list.get(0);
}
// 查询运营区详情
return success(areaService.selectAreaById(max.getKey()));