| | |
| | | } |
| | | QueryWrapper<SystemDictData> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .in(SystemDictData::getLabel, Arrays.asList(Constants.FORCE_BACK_SITE,Constants.FORCE_BACK_LOCK)); |
| | | .in(SystemDictData::getLabel, Arrays.asList(Constants.FORCE_BACK_SITE,Constants.FORCE_BACK_LOCK,Constants.FREE_RENT_TIME)); |
| | | List<SystemDictData> systemDictData = systemDictDataMapper.selectList(wrapper); |
| | | Map<String, SystemDictData> collect = systemDictData.stream().collect(Collectors.toMap(s -> s.getLabel(), s -> s)); |
| | | |
| | |
| | | update.setStatus(Constants.MEMBER_RIDES_STATUS.BACK_CYCLING.getKey()); |
| | | update.setBackSiteId(collect.get(Constants.FORCE_BACK_SITE).getCode()); |
| | | update.setBackLockId(collect.get(Constants.FORCE_BACK_LOCK).getCode()); |
| | | Integer freeRentTime = Integer.valueOf(collect.get(Constants.FREE_RENT_TIME).getCode()); |
| | | Integer rideTime = DateUtil.betweenMin(model.getRentDate(), update.getBackDate()); |
| | | //计算骑行计费时长 |
| | | update.setDuration(DateUtil.betweenMin(model.getRentDate(), update.getBackDate())); |
| | | update.setDuration( freeRentTime > 0 ? rideTime - freeRentTime : rideTime); |
| | | memberRidesMapper.updateById(update); |
| | | //修改前 |
| | | String beforeContent = JSONObject.toJSONString(model); |