...
|
...
|
@@ -547,7 +547,16 @@ public class DepositServiceImpl implements DepositService { |
|
|
* @return
|
|
|
*/
|
|
|
public int renewStorageDeposit(String depositCode, Integer renewDay, int uid, int depositId) {
|
|
|
int result = storageDepositMapper.updateDepositEndTime(uid, depositId, renewDay * 24 * 60 * 60, DateUtil.getCurrentTimeSecond());
|
|
|
|
|
|
StorageDeposit deposit = storageDepositMapper.selectByPrimaryKey(depositId);
|
|
|
int currentTimeSecond = DateUtil.getCurrentTimeSecond();
|
|
|
int result;
|
|
|
if (deposit.getDepositEndTime() <= currentTimeSecond) { // 如果当前库存记录已经过期,则按当前时间加续约时长
|
|
|
result = storageDepositMapper.updateDepositEndTime(uid, depositId, renewDay * 24 * 60 * 60 + currentTimeSecond, currentTimeSecond);
|
|
|
} else { // 如果当前库存记录未过期,则按库存结束时间加续约时长
|
|
|
result = storageDepositMapper.updateDepositEndTime(uid, depositId, renewDay * 24 * 60 * 60 + deposit.getDepositEndTime(), currentTimeSecond);
|
|
|
}
|
|
|
|
|
|
clearDepositCache(depositCode, uid);
|
|
|
return result;
|
|
|
}
|
...
|
...
|
|