Commit 94b4f0f9 by 吕明尚

更改开门问题

parent bec45265
...@@ -17,6 +17,7 @@ import share.common.core.controller.BaseController; ...@@ -17,6 +17,7 @@ import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.system.domain.SConsumptionRecords; import share.system.domain.SConsumptionRecords;
import share.system.domain.vo.SConsumptionRecordsVo;
import share.system.service.ISConsumptionRecordsService; import share.system.service.ISConsumptionRecordsService;
import share.common.utils.poi.ExcelUtil; import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
...@@ -42,7 +43,7 @@ public class SConsumptionRecordsController extends BaseController ...@@ -42,7 +43,7 @@ public class SConsumptionRecordsController extends BaseController
public TableDataInfo list(SConsumptionRecords sConsumptionRecords) public TableDataInfo list(SConsumptionRecords sConsumptionRecords)
{ {
startPage(); startPage();
List<SConsumptionRecords> list = sConsumptionRecordsService.selectSConsumptionRecordsList(sConsumptionRecords); List<SConsumptionRecordsVo> list = sConsumptionRecordsService.selectSConsumptionRecordsList(sConsumptionRecords);
return getDataTable(list); return getDataTable(list);
} }
...@@ -54,8 +55,8 @@ public class SConsumptionRecordsController extends BaseController ...@@ -54,8 +55,8 @@ public class SConsumptionRecordsController extends BaseController
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, SConsumptionRecords sConsumptionRecords) public void export(HttpServletResponse response, SConsumptionRecords sConsumptionRecords)
{ {
List<SConsumptionRecords> list = sConsumptionRecordsService.selectSConsumptionRecordsList(sConsumptionRecords); List<SConsumptionRecordsVo> list = sConsumptionRecordsService.selectSConsumptionRecordsList(sConsumptionRecords);
ExcelUtil<SConsumptionRecords> util = new ExcelUtil<SConsumptionRecords>(SConsumptionRecords.class); ExcelUtil<SConsumptionRecordsVo> util = new ExcelUtil<SConsumptionRecordsVo>(SConsumptionRecordsVo.class);
util.exportExcel(response, list, "消费记录数据"); util.exportExcel(response, list, "消费记录数据");
} }
......
...@@ -19,6 +19,7 @@ import share.common.enums.BusinessType; ...@@ -19,6 +19,7 @@ import share.common.enums.BusinessType;
import share.system.domain.SConsumer; import share.system.domain.SConsumer;
import share.system.domain.SConsumptionRecords; import share.system.domain.SConsumptionRecords;
import share.system.domain.vo.FrontTokenComponent; import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.SConsumptionRecordsVo;
import share.system.service.ISConsumptionRecordsService; import share.system.service.ISConsumptionRecordsService;
import share.common.utils.poi.ExcelUtil; import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
...@@ -46,7 +47,7 @@ public class SConsumptionRecordsController extends BaseController ...@@ -46,7 +47,7 @@ public class SConsumptionRecordsController extends BaseController
SConsumer user = FrontTokenComponent.getWxSConsumerEntry(); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sConsumptionRecords.setConsumerId(user.getId()); sConsumptionRecords.setConsumerId(user.getId());
startPage(); startPage();
List<SConsumptionRecords> list = sConsumptionRecordsService.selectSConsumptionRecordsList(sConsumptionRecords); List<SConsumptionRecordsVo> list = sConsumptionRecordsService.selectSConsumptionRecordsList(sConsumptionRecords);
return getDataTable(list); return getDataTable(list);
} }
} }
...@@ -2,6 +2,7 @@ package share.system.service; ...@@ -2,6 +2,7 @@ package share.system.service;
import java.util.List; import java.util.List;
import share.system.domain.SConsumptionRecords; import share.system.domain.SConsumptionRecords;
import share.system.domain.vo.SConsumptionRecordsVo;
/** /**
* 消费记录Service接口 * 消费记录Service接口
...@@ -25,7 +26,7 @@ public interface ISConsumptionRecordsService ...@@ -25,7 +26,7 @@ public interface ISConsumptionRecordsService
* @param sConsumptionRecords 消费记录 * @param sConsumptionRecords 消费记录
* @return 消费记录集合 * @return 消费记录集合
*/ */
public List<SConsumptionRecords> selectSConsumptionRecordsList(SConsumptionRecords sConsumptionRecords); public List<SConsumptionRecordsVo> selectSConsumptionRecordsList(SConsumptionRecords sConsumptionRecords);
/** /**
* 新增消费记录 * 新增消费记录
......
...@@ -55,7 +55,7 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi ...@@ -55,7 +55,7 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi
* @return 消费记录 * @return 消费记录
*/ */
@Override @Override
public List<SConsumptionRecords> selectSConsumptionRecordsList(SConsumptionRecords sConsumptionRecords) public List<SConsumptionRecordsVo> selectSConsumptionRecordsList(SConsumptionRecords sConsumptionRecords)
{ {
List<SConsumptionRecords> sConsumptionRecordsList = sConsumptionRecordsMapper.selectSConsumptionRecordsList(sConsumptionRecords); List<SConsumptionRecords> sConsumptionRecordsList = sConsumptionRecordsMapper.selectSConsumptionRecordsList(sConsumptionRecords);
//获取消费记录的用户id集合 //获取消费记录的用户id集合
...@@ -79,7 +79,7 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi ...@@ -79,7 +79,7 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi
} }
}); });
}); });
return sConsumptionRecordsList; return sConsumptionRecordsVoList;
} }
/** /**
......
...@@ -794,7 +794,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -794,7 +794,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
sOrder.setEndDate(DateUtils.addHours(new Date(), bigDecimal.intValue())); sOrder.setEndDate(DateUtils.addHours(new Date(), bigDecimal.intValue()));
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("orderNo", sOrder.getOrderNo()); map.put("orderNo", sOrder.getOrderNo());
map.put("expirationTime", sOrder.getStartDate().toString()); map.put("expirationTime", sOrder.getEndDate().toString());
JSONObject jsonObject = new JSONObject(map); JSONObject jsonObject = new JSONObject(map);
redisUtils.set(ReceiptRdeisEnum.ORDER_NO_KEY.getValue() + sOrder.getOrderNo(), jsonObject.toString()); redisUtils.set(ReceiptRdeisEnum.ORDER_NO_KEY.getValue() + sOrder.getOrderNo(), jsonObject.toString());
baseMapper.updateById(sOrder); baseMapper.updateById(sOrder);
...@@ -807,14 +807,14 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -807,14 +807,14 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
throw new BaseException("设备不存在!"); throw new BaseException("设备不存在!");
} }
SStore sStore = storeService.getById(sOrder.getStoreId()); SStore sStore = storeService.getById(sOrder.getStoreId());
String value = "欢迎来到凑角共享棋牌" + sStore.getName(); deviceOpService.openDoor(sRoomVo.getId(), sOrder.getConsumerPhone());
mqttxService.actionExecute(device2.getDevId(), sOrder.getConsumerPhone(), VoiceEnum.OPEN.getValue(value), deviceOpService.actionExecute(sOrder.getRoomId(), sOrder.getConsumerPhone(), "1",
cn.hutool.core.date.DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN), 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"); cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMinute(new Date(), 1), DatePattern.NORM_DATETIME_PATTERN), "1");
//查询非当前用户,预约时间或使用时间为当前时间的订单,如果存在,房间不可开门 //查询非当前用户,预约时间或使用时间为当前时间的订单,如果存在,房间不可开门
} else {
deviceOpService.openDoor(sRoomVo.getId(), sOrder.getConsumerPhone());
} }
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
deviceOpService.openDoor(sRoomVo.getId(), user.getPhone());
return "开锁成功"; return "开锁成功";
} }
......
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