upd: 编码规范
This commit is contained in:
+3
-3
@@ -15,9 +15,9 @@ import java.util.Set;
|
||||
@Mapper
|
||||
public interface DictDetailMapper extends BaseMapper<DictDetail> {
|
||||
|
||||
List<DictDetail> findByDictName(@Param("name") String name);
|
||||
List<DictDetail> selectByDictName(@Param("name") String name);
|
||||
|
||||
IPage<DictDetail> findAll(@Param("criteria") DictDetailQueryCriteria criteria, Page<Object> page);
|
||||
IPage<DictDetail> selectByPage(@Param("criteria") DictDetailQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
void deleteByDictBatchIds(@Param("dictIds") Set<Long> dictIds);
|
||||
void deleteBatchByDictIds(@Param("dictIds") Set<Long> dictIds);
|
||||
}
|
||||
+1
-1
@@ -34,8 +34,8 @@ import java.util.stream.Collectors;
|
||||
public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements DeptService {
|
||||
private final DeptMapper deptMapper;
|
||||
private final UserMapper userMapper;
|
||||
private final RedisUtil redisUtil;
|
||||
private final RoleMapper roleMapper;
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
public List<Dept> queryAll(DeptQueryCriteria criteria, Boolean isQuery) throws Exception {
|
||||
|
||||
+2
-3
@@ -23,14 +23,13 @@ import java.util.concurrent.TimeUnit;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DictDetailServiceImpl extends ServiceImpl<DictDetailMapper, DictDetail> implements DictDetailService {
|
||||
|
||||
private final DictMapper dictMapper;
|
||||
private final DictDetailMapper dictDetailMapper;
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
public PageResult<DictDetail> queryAll(DictDetailQueryCriteria criteria, Page<Object> page) {
|
||||
return PageUtil.toPage(dictDetailMapper.findAll(criteria, page));
|
||||
return PageUtil.toPage(dictDetailMapper.selectByPage(criteria, page));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,7 +57,7 @@ public class DictDetailServiceImpl extends ServiceImpl<DictDetailMapper, DictDet
|
||||
String key = CacheKey.DICT_NAME + name;
|
||||
List<DictDetail> dictDetails = redisUtil.getList(key, DictDetail.class);
|
||||
if (CollUtil.isEmpty(dictDetails)) {
|
||||
dictDetails = dictDetailMapper.findByDictName(name);
|
||||
dictDetails = dictDetailMapper.selectByDictName(name);
|
||||
redisUtil.set(key, dictDetails, 1, TimeUnit.DAYS);
|
||||
}
|
||||
return dictDetails;
|
||||
|
||||
+3
-5
@@ -26,11 +26,9 @@ import java.util.*;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements DictService {
|
||||
|
||||
private final DictMapper dictMapper;
|
||||
private final RedisUtil redisUtil;
|
||||
private final DictDetailMapper deleteDetail;
|
||||
private final DictDetailMapper dictDetailMapper;
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
public PageResult<Dict> queryAll(DictQueryCriteria criteria, Page<Object> page) {
|
||||
@@ -71,14 +69,14 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements Di
|
||||
// 删除字典
|
||||
dictMapper.deleteBatchIds(ids);
|
||||
// 删除字典详情
|
||||
deleteDetail.deleteByDictBatchIds(ids);
|
||||
dictDetailMapper.deleteBatchByDictIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<Dict> dicts, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (Dict dict : dicts) {
|
||||
List<DictDetail> dictDetails = dictDetailMapper.findByDictName(dict.getName());
|
||||
List<DictDetail> dictDetails = dictDetailMapper.selectByDictName(dict.getName());
|
||||
if (CollectionUtil.isNotEmpty(dictDetails)) {
|
||||
for (DictDetail dictDetail : dictDetails) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
|
||||
+1
-2
@@ -26,10 +26,9 @@ import java.util.concurrent.TimeUnit;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class JobServiceImpl extends ServiceImpl<JobMapper, Job> implements JobService {
|
||||
|
||||
private final JobMapper jobMapper;
|
||||
private final RedisUtil redisUtil;
|
||||
private final UserMapper userMapper;
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
public PageResult<Job> queryAll(JobQueryCriteria criteria, Page<Object> page) {
|
||||
|
||||
-1
@@ -36,7 +36,6 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {
|
||||
|
||||
private final MenuMapper menuMapper;
|
||||
private final RoleMenuMapper roleMenuMapper;
|
||||
private final UserMapper userMapper;
|
||||
|
||||
-1
@@ -26,7 +26,6 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MonitorServiceImpl implements MonitorService {
|
||||
|
||||
private final DecimalFormat df = new DecimalFormat("0.00");
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -39,9 +39,9 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
||||
private final RoleMapper roleMapper;
|
||||
private final RoleDeptMapper roleDeptMapper;
|
||||
private final RoleMenuMapper roleMenuMapper;
|
||||
private final RedisUtil redisUtil;
|
||||
private final UserMapper userMapper;
|
||||
private final UserCacheService userCacheService;
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
public List<Role> queryAll() {
|
||||
|
||||
+3
-4
@@ -34,11 +34,10 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
|
||||
|
||||
private final UserMapper userMapper;
|
||||
private final UserJobMapper userJobMapper;
|
||||
private final UserRoleMapper userRoleMapper;
|
||||
private final FileProperties properties;
|
||||
private final FileProperties fileProperties;
|
||||
private final RedisUtil redisUtil;
|
||||
private final UserCacheService userCacheService;
|
||||
private final OnlineUserService onlineUserService;
|
||||
@@ -207,7 +206,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> updateAvatar(MultipartFile multipartFile) {
|
||||
// 文件大小验证
|
||||
FileUtil.checkSize(properties.getAvatarMaxSize(), multipartFile.getSize());
|
||||
FileUtil.checkSize(fileProperties.getAvatarMaxSize(), multipartFile.getSize());
|
||||
// 验证文件上传的格式
|
||||
String image = "gif jpg png jpeg";
|
||||
String fileType = FileUtil.getExtensionName(multipartFile.getOriginalFilename());
|
||||
@@ -216,7 +215,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
}
|
||||
User user = userMapper.findByUsername(SecurityUtil.getCurrentUsername());
|
||||
String oldPath = user.getAvatarPath();
|
||||
File file = FileUtil.upload(multipartFile, properties.getPath().getAvatar());
|
||||
File file = FileUtil.upload(multipartFile, fileProperties.getPath().getAvatar());
|
||||
user.setAvatarPath(Objects.requireNonNull(file).getPath());
|
||||
user.setAvatarName(file.getName());
|
||||
saveOrUpdate(user);
|
||||
|
||||
+1
-1
@@ -20,10 +20,10 @@ import java.util.Collections;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class VerifyServiceImpl implements VerifyService {
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
@Value("${code.expiration}")
|
||||
private Long expiration;
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
<select id="selectByPage" resultMap="BaseResultMap">
|
||||
select
|
||||
dd.id, dd.label, dd.`value`, dd.`dict_sort`, dd.create_by, dd.update_by, dd.create_time, dd.update_time,
|
||||
d.id as dict_id, d.name
|
||||
@@ -33,7 +32,7 @@
|
||||
order by dd.dict_sort, dd.dict_id desc
|
||||
</select>
|
||||
|
||||
<select id="findByDictName" resultMap="BaseResultMap">
|
||||
<select id="selectByDictName" resultMap="BaseResultMap">
|
||||
select
|
||||
dd.id, dd.label, dd.`value`, dd.`dict_sort`, dd.create_by, dd.update_by, dd.create_time, dd.update_time,
|
||||
d.id as dict_id, d.name
|
||||
@@ -45,7 +44,7 @@
|
||||
order by dd.dict_sort
|
||||
</select>
|
||||
|
||||
<delete id="deleteByDictBatchIds">
|
||||
<delete id="deleteBatchByDictIds">
|
||||
delete from sys_dict_detail
|
||||
where dict_id in
|
||||
<foreach collection="dictIds" item="item" index="index" open="(" separator="," close=")">
|
||||
|
||||
Reference in New Issue
Block a user