实名认证、运营区
This commit is contained in:
parent
4e85e7c1ab
commit
a4937551ee
|
@ -20,7 +20,7 @@ public interface AreaDashboard {
|
||||||
* @param query
|
* @param query
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
LongIntegerVO selectMaxOfDeviceCountAreaId(AreaQuery query);
|
List<LongIntegerVO> selectMaxOfDeviceCountAreaId(AreaQuery query);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import com.ruoyi.bst.area.mapper.AreaMapper;
|
||||||
import com.ruoyi.bst.area.service.AreaDashboard;
|
import com.ruoyi.bst.area.service.AreaDashboard;
|
||||||
import com.ruoyi.common.domain.vo.LongIntegerVO;
|
import com.ruoyi.common.domain.vo.LongIntegerVO;
|
||||||
import com.ruoyi.common.utils.MathUtils;
|
import com.ruoyi.common.utils.MathUtils;
|
||||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
|
||||||
import com.ruoyi.dashboard.constants.StatKeys;
|
import com.ruoyi.dashboard.constants.StatKeys;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@ -31,11 +30,9 @@ public class AreaDashboardImpl implements AreaDashboard {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LongIntegerVO selectMaxOfDeviceCountAreaId(AreaQuery query) {
|
public List<LongIntegerVO> selectMaxOfDeviceCountAreaId(AreaQuery query) {
|
||||||
PageHelper.startPage(1, 1);
|
|
||||||
PageHelper.orderBy("value desc");
|
PageHelper.orderBy("value desc");
|
||||||
List<LongIntegerVO> list = areaMapper.selectDeviceCountGroupByAreaId(query);
|
return areaMapper.selectDeviceCountGroupByAreaId(query);
|
||||||
return CollectionUtils.firstElement(list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,7 +229,12 @@ public class RealNameServiceImpl implements RealNameService
|
||||||
realName.setType(RealNameType.TWO_ELEMENT.getCode());
|
realName.setType(RealNameType.TWO_ELEMENT.getCode());
|
||||||
realName.setResult(isSuccess ? "认证成功" : idRes.getReason());
|
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) {
|
private int handleNormalRealName(RealName realName, String cacheKey) {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ruoyi.web.app;
|
package com.ruoyi.web.app;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
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.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.domain.vo.LongIntegerVO;
|
import com.ruoyi.common.domain.vo.LongIntegerVO;
|
||||||
|
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
@ -59,12 +62,24 @@ public class AppAreaController extends BaseController {
|
||||||
}
|
}
|
||||||
setQuery(query);
|
setQuery(query);
|
||||||
|
|
||||||
// 查询设备数量最多的运营区ID
|
// 按设备数量排序,查询附近的运营区
|
||||||
LongIntegerVO max = areaDashboard.selectMaxOfDeviceCountAreaId(query);
|
Long areaId = query.getId();
|
||||||
if (max == null) {
|
query.setId(null);
|
||||||
|
List<LongIntegerVO> list = areaDashboard.selectMaxOfDeviceCountAreaId(query);
|
||||||
|
if (CollectionUtils.isEmptyElement(list)) {
|
||||||
return success();
|
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()));
|
return success(areaService.selectAreaById(max.getKey()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user