Commit 5023115152c4cb01cb59a58e51f140e6d533e2d2
1 parent
d5a9f427
积分奖励修改
Showing
1 changed file
with
14 additions
and
16 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/unitintegraltotal/UnitIntegralServiceImpl.java
| @@ -88,23 +88,21 @@ public class UnitIntegralServiceImpl implements UnitIntegralService{ | @@ -88,23 +88,21 @@ public class UnitIntegralServiceImpl implements UnitIntegralService{ | ||
| 88 | .eq(UnitIntegralTotalDO::getUnitId, unitId) | 88 | .eq(UnitIntegralTotalDO::getUnitId, unitId) |
| 89 | .eq(UnitIntegralTotalDO::getDeleted, 0); | 89 | .eq(UnitIntegralTotalDO::getDeleted, 0); |
| 90 | UnitIntegralTotalDO unitIntegralTotalDO = unitIntegralTotalMapper.selectOne(queryWrapper); | 90 | UnitIntegralTotalDO unitIntegralTotalDO = unitIntegralTotalMapper.selectOne(queryWrapper); |
| 91 | - if (unitIntegralTotalDO != null) { | ||
| 92 | - String errorMsg = String.format("初始化单位积分,单位ID:%s,已存在", unitId); | ||
| 93 | - throw exception0(BAD_REQUEST.getCode(),errorMsg); | ||
| 94 | - } | ||
| 95 | - UnitIntegralTotalDO saveDO = new UnitIntegralTotalDO(); | ||
| 96 | - saveDO.setStatDate(statDate); | ||
| 97 | - saveDO.setTotalAdd(0); // 累计增加 = 本次增加 | ||
| 98 | - saveDO.setTotalSub(0); // 初始扣减为0 | ||
| 99 | - saveDO.setTotalIntegral(0); // 初始总积分 = 本次增加 | ||
| 100 | - saveDO.setUnitType(unitType); | ||
| 101 | - saveDO.setUnitId(unitId); | ||
| 102 | - if (StringUtils.isEmpty(unitName)) { | ||
| 103 | - //数据库查询补全 | ||
| 104 | - } else { | ||
| 105 | - saveDO.setUnitName(unitName); | 91 | + if (unitIntegralTotalDO == null) { |
| 92 | + UnitIntegralTotalDO saveDO = new UnitIntegralTotalDO(); | ||
| 93 | + saveDO.setStatDate(statDate); | ||
| 94 | + saveDO.setTotalAdd(0); // 累计增加 = 本次增加 | ||
| 95 | + saveDO.setTotalSub(0); // 初始扣减为0 | ||
| 96 | + saveDO.setTotalIntegral(0); // 初始总积分 = 本次增加 | ||
| 97 | + saveDO.setUnitType(unitType); | ||
| 98 | + saveDO.setUnitId(unitId); | ||
| 99 | + if (StringUtils.isEmpty(unitName)) { | ||
| 100 | + //数据库查询补全 | ||
| 101 | + } else { | ||
| 102 | + saveDO.setUnitName(unitName); | ||
| 103 | + } | ||
| 104 | + unitIntegralTotalMapper.insert(saveDO); | ||
| 106 | } | 105 | } |
| 107 | - unitIntegralTotalMapper.insert(saveDO); | ||
| 108 | } | 106 | } |
| 109 | 107 | ||
| 110 | @Override | 108 | @Override |