diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml
index 37c4b9a8..9681bd28 100644
--- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml
+++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml
@@ -341,7 +341,7 @@
select te.name as name,
cp.power as power,
cp.auxiliary_power_supply as auxiliaryPowerSupply,
- cp.serial_number as serialNumber,
+ te.serial_number as serialNumber,
cp.input_voltage as inputVoltage
from xhpc_terminal as te
left join xhpc_charging_pile as cp on cp.charging_pile_id = te.charging_pile_id
diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/HxpcChargeOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/HxpcChargeOrderController.java
index 00803794..bb0dbf99 100644
--- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/HxpcChargeOrderController.java
+++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/HxpcChargeOrderController.java
@@ -73,4 +73,5 @@ public class HxpcChargeOrderController extends BaseController {
return iHxpcChargeOrderService.stopUp(userId, serialNumber,chargingOrderId);
}
+
}
diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/WebSocketController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/WebSocketController.java
index 18c95314..ab1e0736 100644
--- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/WebSocketController.java
+++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/WebSocketController.java
@@ -50,9 +50,45 @@ public class WebSocketController {
public void onOpen(@PathParam("userId") Long userId,Session session){
this.userId =userId;
this.session = session;
+ System.out.println("userId:"+userId);
+ System.out.println("session:"+session);
webSocketSet.add(this); //加入set中
addOnlineCount(); //在线数加1
System.out.println("有新连接加入!当前在线人数为" + getOnlineCount());
+ try {
+ this.session.getBasicRemote().sendText("推送消息");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ /**
+ * 给指定的人发送消息
+ * @param message
+ */
+ @OnMessage
+ public void sendToUser(String message) {
+ String sendUserno = message.split("[|]")[1];
+ String sendMessage = message.split("[|]")[0];
+ try {
+ if (webSocketSet.get(sendUserno) != null) {
+ webSocketSet.get(sendUserno).sendMessage("用户" + userno + "发来消息:" + "
" + sendMessage);
+ } else {
+ System.out.println("当前用户不在线");
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ /**
+ * 获取当前时间
+ *
+ * @return
+ */
+ private String getNowTime() {
+ Date date = new Date();
+ DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String time = format.format(date);
+ return time;
}
/**
@@ -93,6 +129,7 @@ public class WebSocketController {
" \"remainingTime\": \"45\"\n" +
" }\n" +
"}";
+ //终端编号、订单信息需要获取
ApplicationContext act = ApplicationContextRegister.getApplicationContext();
RedisService redisService = act.getBean(RedisService.class);
Object cacheObject = redisService.getCacheObject("gun:1472583698524602.seqdec");
diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java
index c0363224..15a810ed 100644
--- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java
+++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java
@@ -43,12 +43,14 @@ public class XhpcHistoryOrderController extends BaseController {
* 用户订单详情接口
* @param userId 用户id
* @param historyOrderId 历史订单id
+ * @param type 1 历史订单id 2 充电订单id (暂时没用)
+ * @param chargingOrderId 充电订单id
* @return
*/
@GetMapping("/gethistotyOrderMessage")
- public AjaxResult gethistotyOrderMessage(@RequestParam Long userId,@RequestParam Long historyOrderId)
+ public AjaxResult gethistotyOrderMessage(@RequestParam Long userId,@RequestParam Long historyOrderId,Integer type,Long chargingOrderId)
{
- return xhpcHistoryOrderService.gethistotyOrderMessage(userId,historyOrderId);
+ return xhpcHistoryOrderService.gethistotyOrderMessage(userId,historyOrderId,type,chargingOrderId);
}
diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java
index 2b658c7c..656adcd0 100644
--- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java
+++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcRealTimeOrderController.java
@@ -8,6 +8,7 @@ import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -48,10 +49,36 @@ public class XhpcRealTimeOrderController extends BaseController {
/**
* 实时订单详情
*/
- @GetMapping("/message")
- public AjaxResult message(@RequestParam Long realTimeOrderId)
+ @GetMapping("/getMessage")
+ public AjaxResult getMessage(@RequestParam Long realTimeOrderId)
{
- return null;
+ return AjaxResult.success(xhpcRealTimeOrderService.getMessage(realTimeOrderId));
+
}
+ /**
+ * 实时订单详情数据列表(PC)
+ * @param chargingOrderId
+ * @return
+ */
+ @GetMapping("/timeList")
+ public TableDataInfo timeList(@RequestParam Long chargingOrderId)
+ {
+ startPage();
+ List