Commit 2a09370b by 吕明尚

去掉小程序消息提醒

parent 694ddcfb
......@@ -230,11 +230,11 @@ public class OrderTask {
Date expirationTime = jsonObject.getDate("expirationTime");
String orderNo = jsonObject.getStr("orderNo");
//时间到期前10分钟到9分
long expire = (expirationTime.getTime() - new Date().getTime()) / 1000;
if (expire < TEN_MINUTES && expire > NINE_MINUTES) {
SOrder byOrderNo = orderService.getByOrderNo(String.valueOf(orderNo));
wechatNewService.sendMiniSubscribeMessage(byOrderNo, MessageReminderEnum.RESERVER);
}
// long expire = (expirationTime.getTime() - new Date().getTime()) / 1000;
// if (expire < TEN_MINUTES && expire > NINE_MINUTES) {
// SOrder byOrderNo = orderService.getByOrderNo(String.valueOf(orderNo));
// wechatNewService.sendMiniSubscribeMessage(byOrderNo, MessageReminderEnum.RESERVER);
// }
if (expirationTime.getTime() < new Date().getTime()) {
sOrders.add(orderService.getByOrderNo(String.valueOf(orderNo)));
}
......@@ -264,10 +264,10 @@ public class OrderTask {
room.setUpdateTime(new Date());
}
});
logger.info("开始发送消息!!!!");
//推送订单开始预定消息
wechatNewService.sendMiniSubscribeMessage(item, MessageReminderEnum.START);
logger.info("发送消息结束!!!!");
// logger.info("开始发送消息!!!!");
// //推送订单开始预定消息
// wechatNewService.sendMiniSubscribeMessage(item, MessageReminderEnum.START);
// logger.info("发送消息结束!!!!");
logger.info("开始通电!!!!");
//到达预定时间进行通电
deviceOpService.openOrCloseDevice(item.getRoomId(), item.getConsumerPhone(), OpTypeEnum.GET_ELECTRIC.getCode(), false, ZERO);
......
......@@ -162,7 +162,7 @@ public class RedisTask {
//删除redis中的值
redisUtil.delete(o);
//推送订单结束消息
wechatNewService.sendMiniSubscribeMessage(sOrder, MessageReminderEnum.END);
// wechatNewService.sendMiniSubscribeMessage(sOrder, MessageReminderEnum.END);
deviceOpService.actionExecute(sOrder.getRoomId(), sOrder.getConsumerPhone(), VoiceEnum.SEND_CUSTOMER.getCode(),
DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN),
DateUtil.format(DateUtil.offsetMinute(new Date(), 1), DatePattern.NORM_DATETIME_PATTERN), "1");
......
......@@ -105,4 +105,6 @@ public interface ISRoomService extends IService<SRoom>
int deleteRoomDevice(Device device);
List<Map> queryRoomList();
List<SRoom> selectByStoreIds(List<Long> storeIds);
}
......@@ -898,7 +898,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
throw new BaseException("设备不存在!");
}
redisUtils.delete(ReceiptRdeisEnum.ORDER_NO.getValue() + sOrder.getOrderNo());
wechatNewService.sendMiniSubscribeMessage(sOrder, MessageReminderEnum.START);
// wechatNewService.sendMiniSubscribeMessage(sOrder, MessageReminderEnum.START);
//开门、取电
deviceOpService.openDoor(sRoomVo.getId(), sOrder.getConsumerPhone());
//语音
......
......@@ -338,6 +338,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
result = roomList.stream().map(store -> {
Map<String, Object> map = new HashMap<String, Object>() {{
put("id", store.getId());
put("storeId", store.getStoreId());
put("name", store.getName());
}};
return map;
......@@ -346,6 +347,13 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
return result;
}
@Override
public List<SRoom> selectByStoreIds(List<Long> storeIds) {
LambdaQueryWrapper<SRoom> queryWrapper = new LambdaQueryWrapper();
queryWrapper.in(SRoom::getStoreId, storeIds);
return sRoomMapper.selectList(queryWrapper);
}
private List<SRoomVo> convertDoListToVoList(List<SRoom> roomList) {
List<SRoomVo> voList = new ArrayList<>();
......
......@@ -128,6 +128,12 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
*/
@Override
public int deleteSStoreByIds(Long[] ids) {
//删除门店前判断门店下是否有房间
List<Long> storeIds = Arrays.asList(ids);
List<SRoom> sRooms = sRoomService.selectByStoreIds(storeIds);
if (CollectionUtils.isNotEmpty(sRooms)) {
throw new BaseException("当前门店下存在房间,不能删除!");
}
return baseMapper.deleteSStoreByIds(ids);
}
......
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