style: 优化部分代码格式
This commit is contained in:
parent
7b741d5f8c
commit
2f87310bc8
@ -60,7 +60,7 @@ public class MyBatisPlusMetaObjectHandler implements MetaObjectHandler {
|
||||
|
||||
Long createUser = LoginHelper.getUserId();
|
||||
LocalDateTime createTime = LocalDateTime.now();
|
||||
if (metaObject.getOriginalObject()instanceof BaseDO baseDO) {
|
||||
if (metaObject.getOriginalObject() instanceof BaseDO baseDO) {
|
||||
// 继承了 BaseDO 的类,填充创建信息
|
||||
baseDO.setCreateUser(ObjectUtil.defaultIfNull(baseDO.getCreateUser(), createUser));
|
||||
baseDO.setCreateTime(ObjectUtil.defaultIfNull(baseDO.getCreateTime(), createTime));
|
||||
@ -89,7 +89,7 @@ public class MyBatisPlusMetaObjectHandler implements MetaObjectHandler {
|
||||
|
||||
Long updateUser = LoginHelper.getUserId();
|
||||
LocalDateTime updateTime = LocalDateTime.now();
|
||||
if (metaObject.getOriginalObject()instanceof BaseDO baseDO) {
|
||||
if (metaObject.getOriginalObject() instanceof BaseDO baseDO) {
|
||||
// 继承了 BaseDO 的类,填充修改信息
|
||||
baseDO.setUpdateUser(updateUser);
|
||||
baseDO.setUpdateTime(updateTime);
|
||||
|
@ -19,7 +19,6 @@ package top.charles7c.cnadmin.monitor.service.impl;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@ -91,8 +90,7 @@ public class DashboardServiceImpl implements DashboardService {
|
||||
List<Map<String, Object>> locationIpStatistics = logService.listDashboardGeoDistribution();
|
||||
DashboardGeoDistributionResp geoDistribution = new DashboardGeoDistributionResp();
|
||||
geoDistribution.setLocationIpStatistics(locationIpStatistics);
|
||||
geoDistribution.setLocations(
|
||||
locationIpStatistics.stream().map(m -> Convert.toStr(m.get("name"))).collect(Collectors.toList()));
|
||||
geoDistribution.setLocations(locationIpStatistics.stream().map(m -> Convert.toStr(m.get("name"))).toList());
|
||||
return geoDistribution;
|
||||
}
|
||||
|
||||
|
@ -139,10 +139,9 @@ public class LogServiceImpl implements LogService {
|
||||
public SystemLogDetailResp get(Long id) {
|
||||
LogDO logDO = logMapper.selectById(id);
|
||||
CheckUtils.throwIfNotExists(logDO, "LogDO", "ID", id);
|
||||
|
||||
SystemLogDetailResp detailVO = BeanUtil.copyProperties(logDO, SystemLogDetailResp.class);
|
||||
this.fill(detailVO);
|
||||
return detailVO;
|
||||
SystemLogDetailResp detail = BeanUtil.copyProperties(logDO, SystemLogDetailResp.class);
|
||||
this.fill(detail);
|
||||
return detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -82,7 +82,7 @@ public class DeptServiceImpl extends BaseServiceImpl<DeptMapper, DeptDO, DeptRes
|
||||
String oldName = oldDept.getName();
|
||||
DisEnableStatusEnum newStatus = req.getStatus();
|
||||
Long oldParentId = oldDept.getParentId();
|
||||
if (oldDept.getIsSystem()) {
|
||||
if (Boolean.TRUE.equals(oldDept.getIsSystem())) {
|
||||
CheckUtils.throwIfEqual(DisEnableStatusEnum.DISABLE, newStatus, "[{}] 是系统内置部门,不允许禁用", oldName);
|
||||
CheckUtils.throwIfNotEqual(req.getParentId(), oldParentId, "[{}] 是系统内置部门,不允许变更上级部门", oldName);
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, RoleDO, RoleRes
|
||||
RoleDO oldRole = super.getById(id);
|
||||
DataScopeEnum oldDataScope = oldRole.getDataScope();
|
||||
String oldCode = oldRole.getCode();
|
||||
if (oldRole.getIsSystem()) {
|
||||
if (Boolean.TRUE.equals(oldRole.getIsSystem())) {
|
||||
CheckUtils.throwIfEqual(DisEnableStatusEnum.DISABLE, req.getStatus(), "[{}] 是系统内置角色,不允许禁用",
|
||||
oldRole.getName());
|
||||
CheckUtils.throwIfNotEqual(req.getCode(), oldCode, "[{}] 是系统内置角色,不允许修改角色编码", oldRole.getName());
|
||||
@ -152,7 +152,7 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, RoleDO, RoleRes
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
return list.stream().map(r -> new LabelValueResp<>(r.getName(), r.getId())).collect(Collectors.toList());
|
||||
return list.stream().map(r -> new LabelValueResp<>(r.getName(), r.getId())).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user