|
@@ -86,6 +86,7 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
.setChargingSize(deviceAlgorithmCharging.getChargingSize())
|
|
.setChargingSize(deviceAlgorithmCharging.getChargingSize())
|
|
.setChargingMoney(deviceAlgorithmCharging.getMoney())
|
|
.setChargingMoney(deviceAlgorithmCharging.getMoney())
|
|
.setType(deviceAlgorithmCharging.getType())
|
|
.setType(deviceAlgorithmCharging.getType())
|
|
|
|
+ .setName(deviceAlgorithmCharging.getName())
|
|
.setChargingType(pay.getPayType())
|
|
.setChargingType(pay.getPayType())
|
|
.setCreateTime(now)
|
|
.setCreateTime(now)
|
|
.setUpdateTime(now);
|
|
.setUpdateTime(now);
|
|
@@ -109,7 +110,7 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
JList<DeviceAlgorithmChargingHistory> infs = new JArrayList<>();
|
|
JList<DeviceAlgorithmChargingHistory> infs = new JArrayList<>();
|
|
JList<DeviceAlgorithmChargingHistory> gives = new JArrayList<>();
|
|
JList<DeviceAlgorithmChargingHistory> gives = new JArrayList<>();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
- int yyyyMM = Integer.valueOf(DataTime.getSring("yyyyMM"));
|
|
|
|
|
|
+ int yyyyMMdd = Integer.valueOf(DataTime.getSring("yyyyMMdd"));
|
|
//获取算法包月字典
|
|
//获取算法包月字典
|
|
Map<String, SysDictRedis> algorithmMoonConfigMaps = SysDictUtils.get(EnumAlgorithmPayConfig.Code.CODE.getCode());
|
|
Map<String, SysDictRedis> algorithmMoonConfigMaps = SysDictUtils.get(EnumAlgorithmPayConfig.Code.CODE.getCode());
|
|
//获取类型字典
|
|
//获取类型字典
|
|
@@ -141,20 +142,26 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
.last("limit 1");
|
|
.last("limit 1");
|
|
DeviceAlgorithmCharging deviceAlgorithmCharging = getOne(lambdaQueryWrapper);
|
|
DeviceAlgorithmCharging deviceAlgorithmCharging = getOne(lambdaQueryWrapper);
|
|
int beginTime;
|
|
int beginTime;
|
|
|
|
+ int timeout;
|
|
if (deviceAlgorithmCharging == null) {
|
|
if (deviceAlgorithmCharging == null) {
|
|
- beginTime = Integer.valueOf(DataTime.toString(deviceAlgorithmChargingHistory.getCreateTime(), "yyyyMM"));
|
|
|
|
|
|
+ beginTime = Integer.valueOf(DataTime.toString(deviceAlgorithmChargingHistory.getCreateTime(), "yyyyMMdd"));
|
|
|
|
+ String stringAround = DataTime.getStringAround(0, 1, 0, 0, 0, 0, DataTime.toString(deviceAlgorithmChargingHistory.getCreateTime()));
|
|
|
|
+ timeout = Integer.valueOf(DataTime.toString(DataTime.toLocal(stringAround), "yyyyMMdd"));
|
|
} else {
|
|
} else {
|
|
LocalDateTime localDateTime = DataTime.toLocal(deviceAlgorithmCharging.getBeginTime() + "01000000", "yyyyMMddHHmmss");
|
|
LocalDateTime localDateTime = DataTime.toLocal(deviceAlgorithmCharging.getBeginTime() + "01000000", "yyyyMMddHHmmss");
|
|
String s = DataTime.toString(localDateTime, "yyyy-MM-dd HH:mm:ss");
|
|
String s = DataTime.toString(localDateTime, "yyyy-MM-dd HH:mm:ss");
|
|
String stringAround = DataTime.getStringAround(0, 1, 0, 0, 0, 0, s);
|
|
String stringAround = DataTime.getStringAround(0, 1, 0, 0, 0, 0, s);
|
|
- beginTime = Integer.valueOf(DataTime.toString(DataTime.toLocal(stringAround), "yyyyMM"));
|
|
|
|
|
|
+ beginTime = Integer.valueOf(DataTime.toString(DataTime.toLocal(stringAround), "yyyyMMdd"));
|
|
|
|
+ String stringAround1 = DataTime.getStringAround(0, 1, 0, 0, 0, 0, stringAround);
|
|
|
|
+ timeout = Integer.valueOf(DataTime.toString(DataTime.toLocal(stringAround1), "yyyyMMdd"));
|
|
}
|
|
}
|
|
DeviceAlgorithmCharging deviceAlgorithmChargingInfo = new DeviceAlgorithmCharging()
|
|
DeviceAlgorithmCharging deviceAlgorithmChargingInfo = new DeviceAlgorithmCharging()
|
|
.setDeviceId(deviceAlgorithmChargingHistory.getDeviceId())
|
|
.setDeviceId(deviceAlgorithmChargingHistory.getDeviceId())
|
|
.setAlgorithmId(deviceAlgorithmChargingHistory.getAlgorithmId())
|
|
.setAlgorithmId(deviceAlgorithmChargingHistory.getAlgorithmId())
|
|
.setUnusedSize(moon.getSize())
|
|
.setUnusedSize(moon.getSize())
|
|
.setType(type)
|
|
.setType(type)
|
|
- .setTimeout(30)
|
|
|
|
|
|
+ .setName(deviceAlgorithmChargingHistory.getName())
|
|
|
|
+ .setTimeout(timeout)
|
|
.setBeginTime(beginTime)
|
|
.setBeginTime(beginTime)
|
|
.setCreateTime(now)
|
|
.setCreateTime(now)
|
|
.setUpdateTime(now);
|
|
.setUpdateTime(now);
|
|
@@ -171,8 +178,9 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
.setAlgorithmId(deviceAlgorithmChargingHistory.getAlgorithmId())
|
|
.setAlgorithmId(deviceAlgorithmChargingHistory.getAlgorithmId())
|
|
.setUnusedSize(inf.getSize() * deviceAlgorithmChargingHistory.getChargingSize())
|
|
.setUnusedSize(inf.getSize() * deviceAlgorithmChargingHistory.getChargingSize())
|
|
.setType(deviceAlgorithmChargingHistory.getType())
|
|
.setType(deviceAlgorithmChargingHistory.getType())
|
|
|
|
+ .setName(deviceAlgorithmChargingHistory.getName())
|
|
.setTimeout(-1)
|
|
.setTimeout(-1)
|
|
- .setBeginTime(yyyyMM)
|
|
|
|
|
|
+ .setBeginTime(yyyyMMdd)
|
|
.setCreateTime(now)
|
|
.setCreateTime(now)
|
|
.setUpdateTime(now);
|
|
.setUpdateTime(now);
|
|
save(deviceAlgorithmChargingInfo);
|
|
save(deviceAlgorithmChargingInfo);
|
|
@@ -184,8 +192,9 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
.setAlgorithmId(deviceAlgorithmChargingHistory.getAlgorithmId())
|
|
.setAlgorithmId(deviceAlgorithmChargingHistory.getAlgorithmId())
|
|
.setUnusedSize(deviceAlgorithmChargingHistory.getChargingSize())
|
|
.setUnusedSize(deviceAlgorithmChargingHistory.getChargingSize())
|
|
.setType(deviceAlgorithmChargingHistory.getType())
|
|
.setType(deviceAlgorithmChargingHistory.getType())
|
|
- .setTimeout(30)
|
|
|
|
- .setBeginTime(yyyyMM)
|
|
|
|
|
|
+ .setName(deviceAlgorithmChargingHistory.getName())
|
|
|
|
+ .setTimeout(payNotice.getTimeout())
|
|
|
|
+ .setBeginTime(yyyyMMdd)
|
|
.setCreateTime(now)
|
|
.setCreateTime(now)
|
|
.setUpdateTime(now);
|
|
.setUpdateTime(now);
|
|
save(deviceAlgorithmChargingInfo);
|
|
save(deviceAlgorithmChargingInfo);
|
|
@@ -205,19 +214,15 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
Map<Long, Integer> map = new JHashMap<>(chargings.size());
|
|
Map<Long, Integer> map = new JHashMap<>(chargings.size());
|
|
chargings.forEach(charging -> map.put(charging.getMercDeviceAlgorithmChargingId(), charging.getSize()));
|
|
chargings.forEach(charging -> map.put(charging.getMercDeviceAlgorithmChargingId(), charging.getSize()));
|
|
//查询数据
|
|
//查询数据
|
|
- JList<DeviceAlgorithmChargingDto.Charging> list = new JArrayList<>(chargings);
|
|
|
|
- LambdaQueryWrapper<DeviceAlgorithmCharging> lambdaQueryWrapper = new LambdaQueryWrapper<DeviceAlgorithmCharging>()
|
|
|
|
- .in(DeviceAlgorithmCharging::getDeviceId, list.getProperty(DeviceAlgorithmChargingDto.Charging::getDeviceId))
|
|
|
|
- .in(DeviceAlgorithmCharging::getAlgorithmId, list.getProperty(DeviceAlgorithmChargingDto.Charging::getAlgorithmId))
|
|
|
|
- .gt(DeviceAlgorithmCharging::getUnusedSize, 0)
|
|
|
|
- .and(deviceAlgorithmChargingLambdaQueryWrapper -> deviceAlgorithmChargingLambdaQueryWrapper
|
|
|
|
- .gt(DeviceAlgorithmCharging::getTimeout, 0)
|
|
|
|
- .or()
|
|
|
|
- .eq(DeviceAlgorithmCharging::getTimeout, -1)
|
|
|
|
- )
|
|
|
|
- .in(DeviceAlgorithmCharging::getBeginTime, list.getProperty(DeviceAlgorithmChargingDto.Charging::getAlgorithmDate))
|
|
|
|
- .orderByAsc(DeviceAlgorithmCharging::getBeginTime, DeviceAlgorithmCharging::getCreateTime);
|
|
|
|
- List<DeviceAlgorithmCharging> deviceAlgorithmChargingsList = list(lambdaQueryWrapper);
|
|
|
|
|
|
+ List<DeviceAlgorithmCharging> queryList = new ArrayList<>(chargings.size());
|
|
|
|
+ for (DeviceAlgorithmChargingDto.Charging charging : chargings) {
|
|
|
|
+ DeviceAlgorithmCharging deviceAlgorithmCharging = new DeviceAlgorithmCharging()
|
|
|
|
+ .setDeviceId(charging.getDeviceId())
|
|
|
|
+ .setAlgorithmId(charging.getAlgorithmId())
|
|
|
|
+ .setBeginTime(charging.getAlgorithmDate());
|
|
|
|
+ queryList.add(deviceAlgorithmCharging);
|
|
|
|
+ }
|
|
|
|
+ List<DeviceAlgorithmCharging> deviceAlgorithmChargingsList = baseMapper.chargingQuery(queryList);
|
|
if (!Emptys.check(deviceAlgorithmChargingsList)) {
|
|
if (!Emptys.check(deviceAlgorithmChargingsList)) {
|
|
return R.ok(map);
|
|
return R.ok(map);
|
|
}
|
|
}
|
|
@@ -278,6 +283,8 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
|
|
.setMakeSize(deviceAlgorithmCharging.getMakeSize() + makeSize)
|
|
.setMakeSize(deviceAlgorithmCharging.getMakeSize() + makeSize)
|
|
.setUpdateTime(now);
|
|
.setUpdateTime(now);
|
|
updateById(updateDeviceAlgorithmCharging);
|
|
updateById(updateDeviceAlgorithmCharging);
|
|
|
|
+ deviceAlgorithmCharging.setUnusedSize(updateDeviceAlgorithmCharging.getUnusedSize())
|
|
|
|
+ .setMakeSize(updateDeviceAlgorithmCharging.getMakeSize());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|