|
@@ -32,7 +32,7 @@ public class PersonScoreServiceImpl extends ServiceImpl<PersonScoreMapper, Perso
|
|
@Resource
|
|
@Resource
|
|
private ScoreMapper scoreMapper;
|
|
private ScoreMapper scoreMapper;
|
|
@Override
|
|
@Override
|
|
- public HttpRespMsg addOrUpdate(PersonScore personScore) {
|
|
|
|
|
|
+ public HttpRespMsg addOrUpdate(PersonScore personScore,double total) {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
Integer personScoreInit = 0;
|
|
Integer personScoreInit = 0;
|
|
if (personScore.getId() == null) {
|
|
if (personScore.getId() == null) {
|
|
@@ -40,13 +40,15 @@ public class PersonScoreServiceImpl extends ServiceImpl<PersonScoreMapper, Perso
|
|
personScoreMapper.insert(personScore);
|
|
personScoreMapper.insert(personScore);
|
|
Score score = new Score();
|
|
Score score = new Score();
|
|
score.setScoreId(personScore.getScoreId());
|
|
score.setScoreId(personScore.getScoreId());
|
|
- score.setPersonalScore(personScoreInit+personScore.getCan()+personScore.getDiligence()+personScore.getVirtue()+personScore.getPerformance());
|
|
|
|
|
|
+ score.setTotal(total);
|
|
|
|
+ score.setPersonalScore(personScoreInit+personScore.getCan()+personScore.getDiligence()+personScore.getVirtue()+personScore.getPerformance()+personScore.getLian());
|
|
scoreMapper.update(score,new QueryWrapper<Score>().eq("score_id",personScore.getScoreId()));
|
|
scoreMapper.update(score,new QueryWrapper<Score>().eq("score_id",personScore.getScoreId()));
|
|
}else{
|
|
}else{
|
|
personScoreMapper.updateById(personScore);
|
|
personScoreMapper.updateById(personScore);
|
|
Score score = new Score();
|
|
Score score = new Score();
|
|
score.setScoreId(personScore.getScoreId());
|
|
score.setScoreId(personScore.getScoreId());
|
|
- score.setPersonalScore(personScoreInit+personScore.getCan()+personScore.getDiligence()+personScore.getVirtue()+personScore.getPerformance());
|
|
|
|
|
|
+ score.setTotal(total);
|
|
|
|
+ score.setPersonalScore(personScoreInit+personScore.getCan()+personScore.getDiligence()+personScore.getVirtue()+personScore.getPerformance()+personScore.getLian());
|
|
scoreMapper.update(score,new QueryWrapper<Score>().eq("score_id",personScore.getScoreId()));
|
|
scoreMapper.update(score,new QueryWrapper<Score>().eq("score_id",personScore.getScoreId()));
|
|
}
|
|
}
|
|
return msg;
|
|
return msg;
|