Commit 94b4f0f9 by 吕明尚

更改开门问题

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