From 950264a579736c1c51f1efe4baf0ac1476d5748c Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期一, 02 十二月 2024 11:06:46 +0800 Subject: [PATCH] bug修改 --- finance-system/src/main/java/com/finance/system/service/impl/TbQuestionServiceImpl.java | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/finance-system/src/main/java/com/finance/system/service/impl/TbQuestionServiceImpl.java b/finance-system/src/main/java/com/finance/system/service/impl/TbQuestionServiceImpl.java index a99170e..9c1e832 100644 --- a/finance-system/src/main/java/com/finance/system/service/impl/TbQuestionServiceImpl.java +++ b/finance-system/src/main/java/com/finance/system/service/impl/TbQuestionServiceImpl.java @@ -47,16 +47,19 @@ public void addQuestion(QuestionDTO dto) throws Exception { TbQuestion tbQuestion = BeanUtils.copyBean(dto, TbQuestion.class); tbQuestion.setType(dto.getType()); - tbQuestion.setQuarter(DateUtils.getNowQuarter()); + String previousQuarter = DateUtils.getPreviousQuarter(); + // previousQuarter = "2024年二季度"; + tbQuestion.setQuarter(previousQuarter); this.save(tbQuestion); asyncService.subtractScoreWithFixedRules(dto.getDeptAreaCode()); } @Override - public void editQuestion(QuestionUpdDTO dto) { + public void editQuestion(QuestionUpdDTO dto) throws Exception { TbQuestion tbQuestion = BeanUtils.copyBean(dto, TbQuestion.class); tbQuestion.setType(dto.getType()); this.updateById(tbQuestion); + asyncService.subtractScoreWithFixedRules(dto.getDeptAreaCode()); } @Override @@ -89,4 +92,15 @@ return questionVOPageDTO; } + + @Override + public void delete(Long id) { + TbQuestion question = this.getById(id); + try { + asyncService.subtractScoreWithFixedRules(question.getDeptAreaCode()); + } catch (Exception e) { + throw new RuntimeException(e); + } + this.removeById(id); + } } -- Gitblit v1.7.1