From 3e456f3e812ead6a19e80cfbdbf86ae0263d50b9 Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期五, 12 七月 2024 22:39:45 +0800 Subject: [PATCH] 完成7.4迭代内容,通过冒烟测试 --- finance-admin/src/main/java/com/finance/web/controller/api/CurrentQuarterController.java | 52 +++++++++++++++++++++++++++++++++------------------- 1 files changed, 33 insertions(+), 19 deletions(-) diff --git a/finance-admin/src/main/java/com/finance/web/controller/api/CurrentQuarterController.java b/finance-admin/src/main/java/com/finance/web/controller/api/CurrentQuarterController.java index 1c18d5e..9ecbf1c 100644 --- a/finance-admin/src/main/java/com/finance/web/controller/api/CurrentQuarterController.java +++ b/finance-admin/src/main/java/com/finance/web/controller/api/CurrentQuarterController.java @@ -13,23 +13,28 @@ import com.finance.system.query.QuestionQuery; import com.finance.system.query.ScoreCalculateDetailQuery; import com.finance.system.query.ScoreCalculateQuery; +import com.finance.system.service.ISysUserService; import com.finance.system.service.TbBasicDataService; import com.finance.system.service.TbQuestionService; import com.finance.system.service.TbScoreService; import com.finance.system.vo.CurrentFieldsAllVO; import com.finance.system.vo.CurrentFieldsDetailVO; import com.finance.system.vo.CurrentFieldsVO; +import com.finance.system.vo.DeptVO; import com.finance.system.vo.QuestionVO; import com.finance.system.vo.ScoreCalculateDetailVO; import com.finance.system.vo.ScoreCalculateVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -50,13 +55,14 @@ private final TbBasicDataService tbBasicDataService; private final TbQuestionService tbQuestionService; private final TbScoreService tbScoreService; + private final ISysUserService sysUserService; /** * 字段统计 * * @return R<PageDTO < CurrentFieldsVO>> */ - @ApiOperation(value = "字段统计" , notes = "字段统计") + @ApiOperation(value = "字段统计", notes = "字段统计") @PostMapping("/fields-statics") public R<PageDTO<CurrentFieldsVO>> fieldsStatics( @Validated @RequestBody CurrentFieldsQuery dto) { @@ -64,7 +70,7 @@ dto.setQuarter(DateUtils.getNowQuarter()); return tbBasicDataService.fieldsStatics(dto); } catch (Exception e) { - log.error("获取字段统计相关信息异常" , e); + log.error("获取字段统计相关信息异常", e); return R.fail(); } } @@ -76,8 +82,8 @@ * @return R<CurrentFieldsDetailVO> */ @GetMapping("/fields-details") - @ApiOperation(value = "字段统计-查看详情" , notes = "字段统计") - @ApiImplicitParam(name = "id" , value = "基础数据id" , required = true, dataType = "int" , paramType = "query" , dataTypeClass = Long.class) + @ApiOperation(value = "字段统计-查看详情", notes = "字段统计") + @ApiImplicitParam(name = "id", value = "基础数据id", required = true, dataType = "int", paramType = "query", dataTypeClass = Long.class) public R<CurrentFieldsDetailVO> fieldsDetails(@RequestParam("id") Long id) { try { return tbBasicDataService.fieldsDetails(id); @@ -85,7 +91,7 @@ if (e instanceof ServiceException) { return R.fail(e.getMessage()); } - log.error("保存当前季度数据异常" , e); + log.error("保存当前季度数据异常", e); return R.fail(); } } @@ -105,7 +111,7 @@ if (e instanceof ServiceException) { return R.fail(e.getMessage()); } - log.error("保存数据异常" , e); + log.error("保存数据异常", e); return R.fail(); } return R.ok(); @@ -117,7 +123,7 @@ * @return R<CurrentFieldsAllVO> */ @GetMapping("/fields-statics-all") - @ApiOperation(value = "字段统计-查看全部" , notes = "字段统计") + @ApiOperation(value = "字段统计-查看全部", notes = "字段统计") public R<CurrentFieldsAllVO> fieldsStaticsAll() { try { return R.ok(tbBasicDataService.fieldsStaticsAll()); @@ -125,7 +131,7 @@ if (e instanceof ServiceException) { return R.fail(e.getMessage()); } - log.error("查看全部异常" , e); + log.error("查看全部异常", e); return R.fail(); } } @@ -144,7 +150,7 @@ query.setQuarter(DateUtils.getNowQuarter()); return R.ok(tbBasicDataService.scoreCalculatePage(query)); } catch (Exception e) { - log.error("获取得分计算异常" , e); + log.error("获取得分计算异常", e); return R.fail(); } } @@ -157,7 +163,7 @@ */ @PostMapping("/score-calculate-detail") @ApiOperation("得分计算-查看详情") - @ApiImplicitParam(name = "areaName" , value = "部门名称" , required = false, dataType = "string" , paramType = "query" , dataTypeClass = String.class) + @ApiImplicitParam(name = "areaName", value = "部门名称", required = false, dataType = "string", paramType = "query", dataTypeClass = String.class) public R<ScoreCalculateDetailVO> scoreCalculateDetail( @Validated @RequestBody ScoreCalculateDetailQuery query) { return R.ok(tbScoreService.scoreCalculateDetail(query)); @@ -170,7 +176,7 @@ * @return R<Void> */ @PostMapping("add-question") - @ApiOperation(value = "发现问题-添加问题" , notes = "发现问题") + @ApiOperation(value = "发现问题-添加问题", notes = "发现问题") public R<Void> addQuestion(@Validated @RequestBody QuestionDTO dto) { try { tbQuestionService.addQuestion(dto); @@ -179,7 +185,7 @@ if (e instanceof ServiceException) { return R.fail(e.getMessage()); } - log.error("添加问题异常" , e); + log.error("添加问题异常", e); return R.fail(); } } @@ -191,7 +197,7 @@ * @return R<Void> */ @PostMapping("/edit-question") - @ApiOperation(value = "发现问题-编辑问题" , notes = "发现问题") + @ApiOperation(value = "发现问题-编辑问题", notes = "发现问题") public R<Void> editQuestion(@Validated @RequestBody QuestionUpdDTO dto) { try { tbQuestionService.editQuestion(dto); @@ -200,7 +206,7 @@ if (e instanceof ServiceException) { return R.fail(e.getMessage()); } - log.error("编辑问题异常" , e); + log.error("编辑问题异常", e); return R.fail(); } } @@ -212,7 +218,7 @@ * @return R<PageDTO < QuestionVO>> */ @PostMapping("/page-question") - @ApiOperation(value = "发现问题-分页查询问题" , notes = "发现问题") + @ApiOperation(value = "发现问题-分页查询问题", notes = "发现问题") public R<PageDTO<QuestionVO>> pageQuestion(@Validated @RequestBody QuestionQuery dto) { return R.ok(tbQuestionService.pageQuestion(dto)); } @@ -224,10 +230,10 @@ * @return R<QuestionDTO> */ @GetMapping("/detail-question") - @ApiOperation(value = "发现问题-问题详情" , notes = "发现问题") - public R<QuestionDTO> detailQuestion(@RequestParam("id") Long id) { + @ApiOperation(value = "发现问题-问题详情", notes = "发现问题") + public R<QuestionVO> detailQuestion(@RequestParam("id") Long id) { TbQuestion question = tbQuestionService.getById(id); - return R.ok(BeanUtils.copyBean(question, QuestionDTO.class)); + return R.ok(BeanUtils.copyBean(question, QuestionVO.class)); } /** @@ -237,9 +243,17 @@ * @return R<Void> */ @DeleteMapping("/delete") - @ApiOperation(value = "发现问题-删除问题" , notes = "发现问题") + @ApiOperation(value = "发现问题-删除问题", notes = "发现问题") public R<Void> delete(@RequestParam("id") Long id) { tbQuestionService.removeById(id); return R.ok(); } + + @GetMapping(value = {"/dept/list/{deptName}", "/dept/list"}) + @ApiOperation(value = "发现问题-获取部门列表", notes = "发现问题") + public R<List<DeptVO>> deptList( + @ApiParam(value = "部门名称", required = false) @PathVariable(value = "deptName", required = false) String deptName) { + return R.ok(sysUserService.queryDeptListByName(deptName)); + } + } -- Gitblit v1.7.1