|
|
@@ -2,9 +2,13 @@ package com.chuanghai.student_portrait.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.chuanghai.student_portrait.entity.ColdWater;
|
|
|
+import com.chuanghai.student_portrait.entity.Dorm;
|
|
|
import com.chuanghai.student_portrait.entity.DormRx;
|
|
|
import com.chuanghai.student_portrait.entity.Electricity;
|
|
|
import com.chuanghai.student_portrait.mapper.DormRxMapper;
|
|
|
@@ -32,6 +36,9 @@ public class DormRxServiceImpl extends ServiceImpl<DormRxMapper, DormRx> impleme
|
|
|
@Autowired
|
|
|
ColdWaterServiceImpl coldWaterService;
|
|
|
|
|
|
+ private Integer page = 1;
|
|
|
+ private Integer size = 8;
|
|
|
+
|
|
|
|
|
|
//完善瑞信房间表
|
|
|
public void saveDormRx() {
|
|
|
@@ -69,8 +76,13 @@ public class DormRxServiceImpl extends ServiceImpl<DormRxMapper, DormRx> impleme
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 获取瑞信上个月的电费
|
|
|
- @Scheduled(cron = "0 0 0 1 * ? ")
|
|
|
+// @Scheduled(cron = "3 35 10 * * ? ")
|
|
|
+ @Scheduled(cron = "17 5 1 1 * ? ")
|
|
|
public void electricitie() {
|
|
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
@@ -80,7 +92,7 @@ public class DormRxServiceImpl extends ServiceImpl<DormRxMapper, DormRx> impleme
|
|
|
String endTime = end.format(dateTimeFormatter);
|
|
|
|
|
|
List<DormRx> list = this.list();
|
|
|
-
|
|
|
+ System.out.println("list.size() = " + list.size());
|
|
|
ArrayList<Electricity> electricities = new ArrayList<>();
|
|
|
for (DormRx dormRx : list) {
|
|
|
String addrId = dormRx.getAddrId();
|
|
|
@@ -122,7 +134,7 @@ public class DormRxServiceImpl extends ServiceImpl<DormRxMapper, DormRx> impleme
|
|
|
DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
|
String format = end.format(dateTimeFormatter2);
|
|
|
|
|
|
- Boolean aBoolean = electricityService.chackElectricityActiveDateTime(format);
|
|
|
+ Boolean aBoolean = electricityService.chackElectricityActiveDateTime(format,"17-101");
|
|
|
if (!aBoolean) {
|
|
|
electricityService.saveBatch(electricities);
|
|
|
}
|
|
|
@@ -133,7 +145,8 @@ public class DormRxServiceImpl extends ServiceImpl<DormRxMapper, DormRx> impleme
|
|
|
/**
|
|
|
* 瑞信上月水费
|
|
|
*/
|
|
|
- @Scheduled(cron = "0 0 1 1 * ? ")
|
|
|
+ @Scheduled(cron = "17 0 1 1 * ? ")
|
|
|
+// @Scheduled(cron = "3 40 10 * * ? ")
|
|
|
public void coldWater() {
|
|
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
@@ -143,7 +156,7 @@ public class DormRxServiceImpl extends ServiceImpl<DormRxMapper, DormRx> impleme
|
|
|
String endTime = end.format(dateTimeFormatter);
|
|
|
|
|
|
List<DormRx> list = this.list();
|
|
|
-
|
|
|
+ System.out.println("list.size() = " + list.size());
|
|
|
ArrayList<ColdWater> coldWaters = new ArrayList<>();
|
|
|
for (DormRx dormRx : list) {
|
|
|
String addrId = dormRx.getAddrId();
|
|
|
@@ -185,7 +198,7 @@ public class DormRxServiceImpl extends ServiceImpl<DormRxMapper, DormRx> impleme
|
|
|
DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
|
String format = end.format(dateTimeFormatter2);
|
|
|
|
|
|
- Boolean aBoolean = coldWaterService.chackColdWaterActiveDateTime(format);
|
|
|
+ Boolean aBoolean = coldWaterService.chackColdWaterActiveDateTime(format,"17-101");
|
|
|
if (!aBoolean) {
|
|
|
coldWaterService.saveBatch(coldWaters);
|
|
|
}
|