Commit a046d5ea by 吕明尚

开放短信通知

parent 683b9cc1
......@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import share.common.enums.UserStatusEnum;
import share.common.enums.YesNoEnum;
import share.system.domain.CouponLog;
import share.system.domain.SConsumerCoupon;
......@@ -151,7 +152,10 @@ public class QPServiceImplAspect {
couponLog.setCode(jsonObject.getString("code"));
LambdaQueryWrapper<SConsumerCoupon> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(SConsumerCoupon::getCouponCode, couponLog.getCode());
SConsumerCoupon one = sConsumerCouponService.getOne(lambdaQueryWrapper);
lambdaQueryWrapper.in(SConsumerCoupon::getUseStatus, UserStatusEnum.UNUSED.getCode(), UserStatusEnum.USED.getCode());
List<SConsumerCoupon> list = sConsumerCouponService.list(lambdaQueryWrapper);
//过滤只有已使用
SConsumerCoupon one = list.stream().filter(sConsumerCoupon -> sConsumerCoupon.getUseStatus().equals(UserStatusEnum.USED.getCode())).findFirst().orElse(null);
couponLog.setConsumerId(one.getConsumerId());
couponLog.setCouponId(one.getId());
LambdaQueryWrapper<SStore> sStoreLambdaQueryWrapper = new LambdaQueryWrapper<>();
......
......@@ -256,9 +256,9 @@ public class OrderTask {
// }
//判断时间是否在15分钟到14分钟
if (expire < FIFTEEN_MINUTES && expire > FOURTEEN_MINUTES) {
// SStore sStore = storeService.getById(byOrderNo.getStoreId());
// SRoom sRoom = roomService.getById(byOrderNo.getRoomId());
// smsService.sendSmsOrderStartRemind(byOrderNo.getConsumerPhone(), sStore, sRoom);
SStore sStore = storeService.getById(byOrderNo.getStoreId());
SRoom sRoom = roomService.getById(byOrderNo.getRoomId());
smsService.sendSmsOrderStartRemind(byOrderNo.getConsumerPhone(), sStore, sRoom);
logger.info("订单号为:" + jsonObject.getStr("orderNo") + "的订单开始预定时间到15分钟");
return;
}
......
......@@ -220,17 +220,17 @@ public class RedisTask {
DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN),
DateUtil.format(DateUtil.offsetMinute(new Date(), 1), DatePattern.NORM_DATETIME_PATTERN), "1");
logger.info("订单号为:" + sOrder.getOrderNo() + "的订单距离结束时间还有15分钟");
//从门店集合中判断门店id相同的门店对象
// SStore sStore = sStoreList.stream().filter(item -> item.getId().equals(sOrder.getStoreId())).findFirst().orElse(null);
//从房间集合中判断房间id相同的房间对象
// SRoom sRoom = sRoomList.stream().filter(item -> item.getId().equals(sOrder.getRoomId())).findFirst().orElse(null);
//通知用户
// smsService.sendSmsOrderEndRemind(sOrder.getConsumerPhone(), sStore, sRoom);
// //通知保洁人员
// sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> {
// // 循环发送短信提示门店保洁打扫卫生
// smsService.sendSmsCleanRecordsRemind15(item.getPhone(), sStore, sRoom);
// });
// 从门店集合中判断门店id相同的门店对象
SStore sStore = sStoreList.stream().filter(item -> item.getId().equals(sOrder.getStoreId())).findFirst().orElse(null);
// 从房间集合中判断房间id相同的房间对象
SRoom sRoom = sRoomList.stream().filter(item -> item.getId().equals(sOrder.getRoomId())).findFirst().orElse(null);
// 通知用户
smsService.sendSmsOrderEndRemind(sOrder.getConsumerPhone(), sStore, sRoom);
//通知保洁人员
sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> {
// 循环发送短信提示门店保洁打扫卫生
smsService.sendSmsCleanRecordsRemind15(item.getPhone(), sStore, sRoom);
});
return;
}
//判断时间是否在5分钟到4分钟
......
......@@ -147,11 +147,11 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
sCleanRecords.setStatus(0);
sCleanRecords.setCreateTime(DateUtils.getNowDate());
boolean b = 0 < baseMapper.insertSCleanRecords(sCleanRecords);
// if (b) {
// SStore store = sStoreMapper.selectSStoreById(storeId);
// SRoom room = sRoomMapper.selectSRoomById(roomId);
// sendSms(storeId, store, room);
// }
if (b) {
SStore store = sStoreMapper.selectSStoreById(storeId);
SRoom room = sRoomMapper.selectSRoomById(roomId);
sendSms(storeId, store, room);
}
return b;
}
......
......@@ -378,12 +378,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
deviceOpService.actionExecute(sOrder.getRoomId(), sOrder.getConsumerPhone(), VoiceEnum.RENEWAL_SUCCESS.getCode(),
cn.hutool.core.date.DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN),
cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMinute(new Date(), 1), DatePattern.NORM_DATETIME_PATTERN), "1");
// SRoom sRoom = roomService.getById(sOrder.getRoomId());
// //通知保洁人员
// sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> {
// // 循环发送短信提示门店保洁打扫卫生
// smsService.sendSmsCleanRecordsStopRemind(item.getPhone(), sStore, sRoom);
// });
SRoom sRoom = roomService.getById(sOrder.getRoomId());
//通知保洁人员
sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> {
// 循环发送短信提示门店保洁打扫卫生
smsService.sendSmsCleanRecordsStopRemind(item.getPhone(), sStore, sRoom);
});
}
}
Map<String, String> map = new HashMap<>();
......@@ -764,12 +764,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
deviceOpService.actionExecute(sOrder.getRoomId(), sOrder.getConsumerPhone(), VoiceEnum.RENEWAL_SUCCESS.getCode(),
cn.hutool.core.date.DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN),
cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMinute(new Date(), 1), DatePattern.NORM_DATETIME_PATTERN), "1");
// SRoom sRoom = roomService.getById(sOrder.getRoomId());
// //通知保洁人员
// sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> {
// // 循环发送短信提示门店保洁打扫卫生
// smsService.sendSmsCleanRecordsStopRemind(item.getPhone(), sStore, sRoom);
// });
SRoom sRoom = roomService.getById(sOrder.getRoomId());
//通知保洁人员
sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> {
// 循环发送短信提示门店保洁打扫卫生
smsService.sendSmsCleanRecordsStopRemind(item.getPhone(), sStore, sRoom);
});
}
sConsumptionRecordsService.insertSConsumptionRecords(sOrder);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment