|
@@ -156,6 +156,9 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
AchievementDemandCount adc = achievementDemandCountMapper.selectByUid(a.getOwnerId());
|
|
AchievementDemandCount adc = achievementDemandCountMapper.selectByUid(a.getOwnerId());
|
|
|
if (null != adc) {
|
|
if (null != adc) {
|
|
|
adc.setAchievementCount(adc.getAchievementCount() - 1);
|
|
adc.setAchievementCount(adc.getAchievementCount() - 1);
|
|
|
|
|
+ if (adc.getAchievementCount() < 0){
|
|
|
|
|
+ adc.setAchievementCount(0);
|
|
|
|
|
+ }
|
|
|
achievementDemandCountMapper.updateByPrimaryKeySelective(adc);
|
|
achievementDemandCountMapper.updateByPrimaryKeySelective(adc);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -287,7 +290,10 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
if (StringUtils.isNotBlank(a.getOwnerId())) {
|
|
if (StringUtils.isNotBlank(a.getOwnerId())) {
|
|
|
AchievementDemandCount adc = achievementDemandCountMapper.selectByUid(a.getOwnerId());
|
|
AchievementDemandCount adc = achievementDemandCountMapper.selectByUid(a.getOwnerId());
|
|
|
if (null != adc) {
|
|
if (null != adc) {
|
|
|
- adc.setAchievementCount(adc.getAchievementCount() - 1);
|
|
|
|
|
|
|
+ adc.setAchievementCount(adc.getAchievementCount() - 1);
|
|
|
|
|
+ if (adc.getAchievementCount() < 0){
|
|
|
|
|
+ adc.setAchievementCount(0);
|
|
|
|
|
+ }
|
|
|
achievementDemandCountMapper.updateByPrimaryKeySelective(adc);
|
|
achievementDemandCountMapper.updateByPrimaryKeySelective(adc);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|