upd: 编码规范
This commit is contained in:
+5
-5
@@ -34,14 +34,14 @@ public class DictController {
|
|||||||
@GetMapping(value = "/download")
|
@GetMapping(value = "/download")
|
||||||
@PreAuthorize("@el.check('dict:list')")
|
@PreAuthorize("@el.check('dict:list')")
|
||||||
public void exportDict(HttpServletResponse response, QueryDictRequest criteria) throws IOException {
|
public void exportDict(HttpServletResponse response, QueryDictRequest criteria) throws IOException {
|
||||||
dictService.downloadExcel(dictService.selectDictByCriteria(criteria), response);
|
dictService.downloadDictExcel(dictService.describeDictList(criteria), response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询字典")
|
@ApiOperation("查询字典")
|
||||||
@PostMapping(value = "/queryAllDict")
|
@PostMapping(value = "/queryAllDict")
|
||||||
@PreAuthorize("@el.check('dict:list')")
|
@PreAuthorize("@el.check('dict:list')")
|
||||||
public ResponseEntity<List<Dict>> queryAllDict() {
|
public ResponseEntity<List<Dict>> queryAllDict() {
|
||||||
return new ResponseEntity<>(dictService.selectDictByCriteria(new QueryDictRequest()), HttpStatus.OK);
|
return new ResponseEntity<>(dictService.describeDictList(new QueryDictRequest()), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询字典")
|
@ApiOperation("查询字典")
|
||||||
@@ -49,14 +49,14 @@ public class DictController {
|
|||||||
@PreAuthorize("@el.check('dict:list')")
|
@PreAuthorize("@el.check('dict:list')")
|
||||||
public ResponseEntity<PageResult<Dict>> queryDict(QueryDictRequest criteria) {
|
public ResponseEntity<PageResult<Dict>> queryDict(QueryDictRequest criteria) {
|
||||||
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
|
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
|
||||||
return new ResponseEntity<>(dictService.queryDictPage(criteria, page), HttpStatus.OK);
|
return new ResponseEntity<>(dictService.describeDictPage(criteria, page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增字典")
|
@ApiOperation("新增字典")
|
||||||
@PostMapping(value = "/createDict")
|
@PostMapping(value = "/createDict")
|
||||||
@PreAuthorize("@el.check('dict:add')")
|
@PreAuthorize("@el.check('dict:add')")
|
||||||
public ResponseEntity<Object> createDict(@Validated @RequestBody CreateDictRequest resources) {
|
public ResponseEntity<Object> createDict(@Validated @RequestBody CreateDictRequest resources) {
|
||||||
dictService.saveDict(resources);
|
dictService.createDict(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ public class DictController {
|
|||||||
@PostMapping(value = "/updateDict")
|
@PostMapping(value = "/updateDict")
|
||||||
@PreAuthorize("@el.check('dict:edit')")
|
@PreAuthorize("@el.check('dict:edit')")
|
||||||
public ResponseEntity<Object> updateDict(@Validated(Dict.Update.class) @RequestBody Dict resources) {
|
public ResponseEntity<Object> updateDict(@Validated(Dict.Update.class) @RequestBody Dict resources) {
|
||||||
dictService.updateDictById(resources);
|
dictService.modifyDictById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -34,7 +34,7 @@ public class JobController {
|
|||||||
@GetMapping(value = "/download")
|
@GetMapping(value = "/download")
|
||||||
@PreAuthorize("@el.check('job:list')")
|
@PreAuthorize("@el.check('job:list')")
|
||||||
public void exportJob(HttpServletResponse response, QueryJobRequest criteria) throws IOException {
|
public void exportJob(HttpServletResponse response, QueryJobRequest criteria) throws IOException {
|
||||||
jobService.downloadExcel(jobService.selectJobByCriteria(criteria), response);
|
jobService.downloadJobExcel(jobService.describeJobList(criteria), response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询岗位")
|
@ApiOperation("查询岗位")
|
||||||
@@ -42,7 +42,7 @@ public class JobController {
|
|||||||
@PreAuthorize("@el.check('job:list','user:list')")
|
@PreAuthorize("@el.check('job:list','user:list')")
|
||||||
public ResponseEntity<PageResult<Job>> queryJob(QueryJobRequest criteria) {
|
public ResponseEntity<PageResult<Job>> queryJob(QueryJobRequest criteria) {
|
||||||
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
|
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
|
||||||
return new ResponseEntity<>(jobService.queryJobPage(criteria, page), HttpStatus.OK);
|
return new ResponseEntity<>(jobService.describeJobPage(criteria, page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增岗位")
|
@ApiOperation("新增岗位")
|
||||||
@@ -57,7 +57,7 @@ public class JobController {
|
|||||||
@PostMapping(value = "/updateJob")
|
@PostMapping(value = "/updateJob")
|
||||||
@PreAuthorize("@el.check('job:edit')")
|
@PreAuthorize("@el.check('job:edit')")
|
||||||
public ResponseEntity<Object> updateJob(@Validated(Job.Update.class) @RequestBody Job resources) {
|
public ResponseEntity<Object> updateJob(@Validated(Job.Update.class) @RequestBody Job resources) {
|
||||||
jobService.updateJobById(resources);
|
jobService.modifyJobById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -21,7 +21,7 @@ public interface DictService extends IService<Dict> {
|
|||||||
* @param page 分页参数
|
* @param page 分页参数
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
PageResult<Dict> queryDictPage(QueryDictRequest criteria, Page<Object> page);
|
PageResult<Dict> describeDictPage(QueryDictRequest criteria, Page<Object> page);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询全部数据
|
* 查询全部数据
|
||||||
@@ -29,21 +29,21 @@ public interface DictService extends IService<Dict> {
|
|||||||
* @param criteria /
|
* @param criteria /
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
List<Dict> selectDictByCriteria(QueryDictRequest criteria);
|
List<Dict> describeDictList(QueryDictRequest criteria);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建
|
* 创建
|
||||||
*
|
*
|
||||||
* @param resources /
|
* @param resources /
|
||||||
*/
|
*/
|
||||||
void saveDict(CreateDictRequest resources);
|
void createDict(CreateDictRequest resources);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
*
|
*
|
||||||
* @param resources /
|
* @param resources /
|
||||||
*/
|
*/
|
||||||
void updateDictById(Dict resources);
|
void modifyDictById(Dict resources);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
@@ -59,5 +59,5 @@ public interface DictService extends IService<Dict> {
|
|||||||
* @param response /
|
* @param response /
|
||||||
* @throws IOException /
|
* @throws IOException /
|
||||||
*/
|
*/
|
||||||
void downloadExcel(List<Dict> queryAll, HttpServletResponse response) throws IOException;
|
void downloadDictExcel(List<Dict> queryAll, HttpServletResponse response) throws IOException;
|
||||||
}
|
}
|
||||||
+5
-5
@@ -20,7 +20,7 @@ public interface JobService extends IService<Job> {
|
|||||||
* @param id /
|
* @param id /
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
Job getJobById(Long id);
|
Job describeJobById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建
|
* 创建
|
||||||
@@ -34,7 +34,7 @@ public interface JobService extends IService<Job> {
|
|||||||
*
|
*
|
||||||
* @param resources /
|
* @param resources /
|
||||||
*/
|
*/
|
||||||
void updateJobById(Job resources);
|
void modifyJobById(Job resources);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
@@ -50,7 +50,7 @@ public interface JobService extends IService<Job> {
|
|||||||
* @param page 分页参数
|
* @param page 分页参数
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
PageResult<Job> queryJobPage(QueryJobRequest criteria, Page<Object> page);
|
PageResult<Job> describeJobPage(QueryJobRequest criteria, Page<Object> page);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询全部数据
|
* 查询全部数据
|
||||||
@@ -58,7 +58,7 @@ public interface JobService extends IService<Job> {
|
|||||||
* @param criteria /
|
* @param criteria /
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
List<Job> selectJobByCriteria(QueryJobRequest criteria);
|
List<Job> describeJobList(QueryJobRequest criteria);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出数据
|
* 导出数据
|
||||||
@@ -67,7 +67,7 @@ public interface JobService extends IService<Job> {
|
|||||||
* @param response /
|
* @param response /
|
||||||
* @throws IOException /
|
* @throws IOException /
|
||||||
*/
|
*/
|
||||||
void downloadExcel(List<Job> jobs, HttpServletResponse response) throws IOException;
|
void downloadJobExcel(List<Job> jobs, HttpServletResponse response) throws IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证是否被用户关联
|
* 验证是否被用户关联
|
||||||
|
|||||||
+5
-5
@@ -36,25 +36,25 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements Di
|
|||||||
private final RedisHelper redisHelper;
|
private final RedisHelper redisHelper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<Dict> queryDictPage(QueryDictRequest criteria, Page<Object> page) {
|
public PageResult<Dict> describeDictPage(QueryDictRequest criteria, Page<Object> page) {
|
||||||
IPage<Dict> dicts = dictMapper.queryDictPageByArgs(criteria, page);
|
IPage<Dict> dicts = dictMapper.queryDictPageByArgs(criteria, page);
|
||||||
return PageUtil.toPage(dicts);
|
return PageUtil.toPage(dicts);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Dict> selectDictByCriteria(QueryDictRequest criteria) {
|
public List<Dict> describeDictList(QueryDictRequest criteria) {
|
||||||
return dictMapper.queryDictPageByArgs(criteria, PageUtil.getCount(dictMapper)).getRecords();
|
return dictMapper.queryDictPageByArgs(criteria, PageUtil.getCount(dictMapper)).getRecords();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void saveDict(CreateDictRequest resources) {
|
public void createDict(CreateDictRequest resources) {
|
||||||
save(BeanUtil.copyProperties(resources, Dict.class));
|
save(BeanUtil.copyProperties(resources, Dict.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateDictById(Dict resources) {
|
public void modifyDictById(Dict resources) {
|
||||||
// 清理缓存
|
// 清理缓存
|
||||||
delCaches(resources);
|
delCaches(resources);
|
||||||
Dict dict = getById(resources.getId());
|
Dict dict = getById(resources.getId());
|
||||||
@@ -78,7 +78,7 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements Di
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void downloadExcel(List<Dict> dicts, HttpServletResponse response) throws IOException {
|
public void downloadDictExcel(List<Dict> dicts, HttpServletResponse response) throws IOException {
|
||||||
List<Map<String, Object>> list = new ArrayList<>();
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
for (Dict dict : dicts) {
|
for (Dict dict : dicts) {
|
||||||
List<DictDetail> dictDetails = dictDetailMapper.queryDictDetailListByDictName(dict.getName());
|
List<DictDetail> dictDetails = dictDetailMapper.queryDictDetailListByDictName(dict.getName());
|
||||||
|
|||||||
+5
-5
@@ -36,17 +36,17 @@ public class JobServiceImpl extends ServiceImpl<JobMapper, Job> implements JobSe
|
|||||||
private final RedisHelper redisHelper;
|
private final RedisHelper redisHelper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<Job> queryJobPage(QueryJobRequest criteria, Page<Object> page) {
|
public PageResult<Job> describeJobPage(QueryJobRequest criteria, Page<Object> page) {
|
||||||
return PageUtil.toPage(jobMapper.queryJobPageByArgs(criteria, page));
|
return PageUtil.toPage(jobMapper.queryJobPageByArgs(criteria, page));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Job> selectJobByCriteria(QueryJobRequest criteria) {
|
public List<Job> describeJobList(QueryJobRequest criteria) {
|
||||||
return jobMapper.queryJobPageByArgs(criteria, PageUtil.getCount(jobMapper)).getRecords();
|
return jobMapper.queryJobPageByArgs(criteria, PageUtil.getCount(jobMapper)).getRecords();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Job getJobById(Long id) {
|
public Job describeJobById(Long id) {
|
||||||
String key = SystemRedisKey.JOB_ID + id;
|
String key = SystemRedisKey.JOB_ID + id;
|
||||||
Job job = redisHelper.get(key, Job.class);
|
Job job = redisHelper.get(key, Job.class);
|
||||||
if (job == null) {
|
if (job == null) {
|
||||||
@@ -68,7 +68,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper, Job> implements JobSe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateJobById(Job resources) {
|
public void modifyJobById(Job resources) {
|
||||||
Job job = getById(resources.getId());
|
Job job = getById(resources.getId());
|
||||||
Job old = jobMapper.getJobByName(resources.getName());
|
Job old = jobMapper.getJobByName(resources.getName());
|
||||||
if (old != null && !old.getId().equals(resources.getId())) {
|
if (old != null && !old.getId().equals(resources.getId())) {
|
||||||
@@ -89,7 +89,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper, Job> implements JobSe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void downloadExcel(List<Job> jobs, HttpServletResponse response) throws IOException {
|
public void downloadJobExcel(List<Job> jobs, HttpServletResponse response) throws IOException {
|
||||||
List<Map<String, Object>> list = new ArrayList<>();
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
for (Job job : jobs) {
|
for (Job job : jobs) {
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user