Commit 0bd62cdc by 吕明尚

修改订单管理页面

parent 16352cdc
......@@ -49,7 +49,7 @@ public class PackController extends BaseController {
/**
* 查询套餐列表
*/
@PreAuthorize("@ss.hasPermi('system:pack:list')")
// @PreAuthorize("@ss.hasPermi('system:pack:list')")
@GetMapping("/query")
public R<List<SPack>> query() {
return R.ok(packService.selectPackList(new SPack()));
......
......@@ -49,6 +49,14 @@ public class SRoomController extends BaseController
}
/**
* 查询房间列表
*/
@GetMapping("/query")
public AjaxResult query() {
return success(sRoomService.queryRoomList());
}
/**
* 导出房间列表
*/
@PreAuthorize("@ss.hasPermi('system:room:export')")
......
......@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUnit;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -236,7 +237,6 @@ public class OrderTask {
}
if (expirationTime.getTime() < new Date().getTime()) {
sOrders.add(orderService.getByOrderNo(String.valueOf(orderNo)));
redisUtil.delete(String.valueOf(o));
}
});
if (CollectionUtils.isEmpty(sOrders)) {
......@@ -264,10 +264,15 @@ public class OrderTask {
room.setUpdateTime(new Date());
}
});
logger.info("开始发送消息!!!!");
//推送订单开始预定消息
wechatNewService.sendMiniSubscribeMessage(item, MessageReminderEnum.START);
logger.info("发送消息结束!!!!");
logger.info("开始通电!!!!");
//到达预定时间进行通电
deviceOpService.openOrCloseDevice(item.getRoomId(), item.getConsumerPhone(), OpTypeEnum.GET_ELECTRIC.getCode(), false, ZERO);
logger.info("通电完成!!!!");
redisUtil.delete(ReceiptRdeisEnum.ORDER_NO.getValue() + item.getOrderNo());
}
});
Boolean execute = transactionTemplate.execute(e -> {
......
package share.system.service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.Device;
......@@ -102,4 +103,6 @@ public interface ISRoomService extends IService<SRoom>
int addRoomDevice(Long roomId, String[] devIds);
int deleteRoomDevice(Device device);
List<Map> queryRoomList();
}
......@@ -330,6 +330,22 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
return deviceMapper.clearDeviceRoomId(device);
}
@Override
public List<Map> queryRoomList() {
List<SRoom> roomList = sRoomMapper.selectSRoomList(new SRoom());
List<Map> result = new ArrayList<>();
if (CollectionUtils.isNotEmpty(roomList)) {
result = roomList.stream().map(store -> {
Map<String, Object> map = new HashMap<String, Object>() {{
put("id", store.getId());
put("name", store.getName());
}};
return map;
}).collect(Collectors.toList());
}
return result;
}
private List<SRoomVo> convertDoListToVoList(List<SRoom> roomList) {
List<SRoomVo> voList = new ArrayList<>();
......
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