| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.system.domain.TbQuestion; |
| | | import com.ruoyi.system.dto.CurrentFieldsQueryDTO; |
| | | import com.ruoyi.system.dto.QuestionDTO; |
| | | import com.ruoyi.system.dto.QuestionQueryDTO; |
| | | import com.ruoyi.system.dto.QuestionUpdDto; |
| | | import com.ruoyi.system.query.CurrentFieldsQuery; |
| | | import com.ruoyi.system.query.QuestionQuery; |
| | | import com.ruoyi.system.query.ScoreCalculateDetailQuery; |
| | | import com.ruoyi.system.query.ScoreCalculateQuery; |
| | | import com.ruoyi.system.service.TbBasicDataService; |
| | | import com.ruoyi.system.service.TbQuestionService; |
| | | import com.ruoyi.system.vo.CurrentFieldsAllVO; |
| | | import com.ruoyi.system.vo.CurrentFieldsDetailVO; |
| | | import com.ruoyi.system.vo.CurrentFieldsVO; |
| | | import com.ruoyi.system.vo.QuestionVO; |
| | | import com.ruoyi.system.service.TbScoreService; |
| | | import com.ruoyi.system.vo.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | private final TbBasicDataService tbBasicDataService; |
| | | private final TbQuestionService tbQuestionService; |
| | | private final TbScoreService tbScoreService; |
| | | |
| | | /** |
| | | * 获取基础数据填报相关信息 |
| | | * 字段统计 |
| | | * |
| | | * @return R<BasicDataReportingVO> |
| | | * @return R<PageDTO < CurrentFieldsVO>> |
| | | */ |
| | | @ApiOperation(value = "字段统计", notes = "字段统计") |
| | | @PostMapping("/fields-statics") |
| | | public R<PageDTO<CurrentFieldsVO>> fieldsStatics(@Validated @RequestBody CurrentFieldsQueryDTO dto) { |
| | | public R<PageDTO<CurrentFieldsVO>> fieldsStatics(@Validated @RequestBody CurrentFieldsQuery dto) { |
| | | try { |
| | | dto.setQuarter(DateUtils.getNowQuarter()); |
| | | return tbBasicDataService.fieldsStatics(dto); |
| | | } catch (Exception e) { |
| | | log.error("获取字段统计相关信息异常", e); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * 字段统计查看详情 |
| | | * |
| | | * @param id 基础数据id |
| | | * @return R<CurrentFieldsDetailVO> |
| | | */ |
| | | @GetMapping("/fields-details") |
| | | @ApiOperation(value = "查看详情", notes = "字段统计") |
| | | @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 R<CurrentFieldsAllVO> |
| | | */ |
| | | @GetMapping("/fields-statics-all") |
| | | @ApiOperation(value = "查看全部", notes = "字段统计") |
| | | @ApiOperation(value = "字段统计-查看全部", notes = "字段统计") |
| | | public R<CurrentFieldsAllVO> fieldsStaticsAll() { |
| | | try { |
| | | return R.ok(tbBasicDataService.fieldsStaticsAll()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 得分计算 |
| | | * |
| | | * @param query 当前季度/历史 数据 得分计算条件查询对象 |
| | | * @return R<PageDTO < ScoreCalculateVO>> |
| | | */ |
| | | @PostMapping("/score-calculate") |
| | | @ApiOperation("得分计算") |
| | | public R<PageDTO<ScoreCalculateVO>> scoreCalculate(@Validated @RequestBody ScoreCalculateQuery query) { |
| | | try { |
| | | query.setQuarter(DateUtils.getNowQuarter()); |
| | | return R.ok(tbBasicDataService.scoreCalculatePage(query)); |
| | | } catch (Exception e) { |
| | | log.error("获取得分计算异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得分计算查看详情 |
| | | * |
| | | * @param query 得分计算详情条件查询对象 |
| | | * @return R<ScoreCalculateDetailVO> |
| | | */ |
| | | @PostMapping("/score-calculate-detail") |
| | | @ApiOperation("得分计算-查看详情") |
| | | @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)); |
| | | } |
| | | |
| | | /** |
| | | * 添加问题 |
| | | * |
| | | * @param dto 发现问题数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("add-question") |
| | | @ApiOperation(value = "添加问题", notes = "发现问题") |
| | | @ApiOperation(value = "发现问题-添加问题", notes = "发现问题") |
| | | public R<Void> addQuestion(@Validated @RequestBody QuestionDTO dto) { |
| | | try { |
| | | tbQuestionService.addQuestion(dto); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 编辑问题 |
| | | * |
| | | * @param dto 发现问题编辑数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("/edit-question") |
| | | @ApiOperation(value = "编辑问题", notes = "发现问题") |
| | | @ApiOperation(value = "发现问题-编辑问题", notes = "发现问题") |
| | | public R<Void> editQuestion(@Validated @RequestBody QuestionUpdDto dto) { |
| | | try { |
| | | tbQuestionService.editQuestion(dto); |
| | |
| | | * @return R<PageDTO < QuestionVO>> |
| | | */ |
| | | @PostMapping("/page-question") |
| | | @ApiOperation(value = "分页查询问题", notes = "发现问题") |
| | | public R<PageDTO<QuestionVO>> pageQuestion(@RequestBody QuestionQueryDTO dto) { |
| | | @ApiOperation(value = "发现问题-分页查询问题", notes = "发现问题") |
| | | public R<PageDTO<QuestionVO>> pageQuestion(@Validated @RequestBody QuestionQuery dto) { |
| | | return R.ok(tbQuestionService.pageQuestion(dto)); |
| | | } |
| | | |
| | |
| | | * @return R<QuestionDTO> |
| | | */ |
| | | @GetMapping("/detail-question") |
| | | @ApiOperation(value = "问题详情", notes = "发现问题") |
| | | @ApiOperation(value = "发现问题-问题详情", notes = "发现问题") |
| | | public R<QuestionDTO> detailQuestion(@RequestParam("id") Long id) { |
| | | TbQuestion question = tbQuestionService.getById(id); |
| | | return R.ok(BeanUtils.copyBean(question, QuestionDTO.class)); |
| | | } |
| | | |
| | | /** |
| | | * 删除问题 |
| | | * |
| | | * @param id 问题id |
| | | * @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(); |