Commit 51c6d599 by liushuangwu

PainService

1 parent 063fce5f
...@@ -23,9 +23,16 @@ public class PainService { ...@@ -23,9 +23,16 @@ public class PainService {
private final static List<PindexFloor> pindexFloors = new ArrayList<>(); private final static List<PindexFloor> pindexFloors = new ArrayList<>();
static { static {
pindexFloors.add(new PindexFloor().setStartIndex(1).setEndIndex(12).setTimeRange("15:00-16:00").setFloor(14)); pindexFloors.add(new PindexFloor().setStartIndex(1).setEndIndex(3).setTimeRange("15:00-15:15").setFloor(14));
pindexFloors.add(new PindexFloor().setStartIndex(13).setEndIndex(24).setTimeRange("16:00-17:00").setFloor(14)); pindexFloors.add(new PindexFloor().setStartIndex(4).setEndIndex(6).setTimeRange("15:15-15:30").setFloor(14));
pindexFloors.add(new PindexFloor().setStartIndex(25).setEndIndex(30).setTimeRange("17:00-17:30").setFloor(14)); pindexFloors.add(new PindexFloor().setStartIndex(7).setEndIndex(9).setTimeRange("15:30-15:45").setFloor(14));
pindexFloors.add(new PindexFloor().setStartIndex(10).setEndIndex(12).setTimeRange("15:45-16:00").setFloor(14));
pindexFloors.add(new PindexFloor().setStartIndex(13).setEndIndex(15).setTimeRange("16:00-16:15").setFloor(14));
pindexFloors.add(new PindexFloor().setStartIndex(16).setEndIndex(18).setTimeRange("16:15-16:30").setFloor(14));
pindexFloors.add(new PindexFloor().setStartIndex(19).setEndIndex(21).setTimeRange("16:30-16:45").setFloor(14));
pindexFloors.add(new PindexFloor().setStartIndex(22).setEndIndex(24).setTimeRange("16:45-17:00").setFloor(14));
pindexFloors.add(new PindexFloor().setStartIndex(25).setEndIndex(27).setTimeRange("17:00-17:15").setFloor(14));
pindexFloors.add(new PindexFloor().setStartIndex(28).setEndIndex(30).setTimeRange("17:15-17:30").setFloor(14));
} }
public void create(Pain pain) { public void create(Pain pain) {
...@@ -70,6 +77,8 @@ public class PainService { ...@@ -70,6 +77,8 @@ public class PainService {
pain.setPindex(increment); pain.setPindex(increment);
String timeRange = pindexFloors.stream().filter(it -> it.floor != null && it.floor == floor) String timeRange = pindexFloors.stream().filter(it -> it.floor != null && it.floor == floor)
.filter(it -> increment <= it.getEndIndex() && increment >= it.getStartIndex()).findFirst().get().timeRange; .filter(it -> increment <= it.getEndIndex() && increment >= it.getStartIndex()).findFirst().get().timeRange;
pain.setTimeRange(timeRange); pain.setTimeRange(timeRange);
}); });
return painList; return painList;
......
...@@ -74,7 +74,7 @@ public class MassageNoticeScheduleService { ...@@ -74,7 +74,7 @@ public class MassageNoticeScheduleService {
// * 每周四定时生成要按摩的人员名单,并发送大群和单人消息 // * 每周四定时生成要按摩的人员名单,并发送大群和单人消息
// */ // */
// @Async // @Async
@Scheduled(cron = "0 30 11 ? * THU") @Scheduled(cron = "0 0 11 ? * THU")
public void sendMsgCardToPipiChat() { public void sendMsgCardToPipiChat() {
employeeService.uprsetAllEmployee(); employeeService.uprsetAllEmployee();
chatMessageService.deleteAll(); chatMessageService.deleteAll();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!