Quellcode durchsuchen

打分详情添加返回个人五项分

wutt vor 5 Jahren
Ursprung
Commit
78b5766dcf

+ 3 - 0
pcbms/src/main/java/com/hssx/pcbms/service/impl/IdeaCommentServiceImpl.java

@@ -43,6 +43,9 @@ public class IdeaCommentServiceImpl extends ServiceImpl<IdeaCommentMapper, IdeaC
             User user = userMapper.selectById(ideaComment.getResponderId());
             ideaComment.setResponder(user.getName());
             ideaCommentMapper.insert(ideaComment);
+//            if(scoreId == null){
+//
+//            }
             Idea idea = new Idea();
             idea.setScore(score);
             idea.setIsEvaluated(1);

+ 5 - 1
pcbms/src/main/java/com/hssx/pcbms/service/impl/PersonScoreServiceImpl.java

@@ -34,11 +34,15 @@ public class PersonScoreServiceImpl extends ServiceImpl<PersonScoreMapper, Perso
     @Override
     public HttpRespMsg addOrUpdate(PersonScore personScore) {
         HttpRespMsg msg = new HttpRespMsg();
+        Integer personScoreInit = 0;
         if (personScore.getId() == null) {
             //添加操作
             personScoreMapper.insert(personScore);
+            Score score = new Score();
+            score.setScoreId(personScore.getScoreId());
+            score.setPersonalScore(personScoreInit+personScore.getCan()+personScore.getDiligence()+personScore.getVirtue()+personScore.getPerformance());
+            scoreMapper.update(score,new QueryWrapper<Score>().eq("score_id",personScore.getScoreId()));
         }else{
-            Integer personScoreInit = 0;
             personScoreMapper.updateById(personScore);
             Score score = new Score();
             score.setScoreId(personScore.getScoreId());