Commit ab794788 by 王宇航

1.5.1

1、修復接收到消息還會顯示超時的問題
2、去除OrderInfoBean和FoodInfoBean的id字段,不由用戶端賦值
parent 34d78140
......@@ -15,7 +15,7 @@
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2024-05-29T08:01:27.843382700Z" />
<timeTargetWasSelectedWithDropDown value="2024-05-30T02:36:04.118903400Z" />
</State>
</entry>
</value>
......
......@@ -31,7 +31,7 @@ class MainActivity : Activity() {
tvConnect.isClickable = false
connect = GingerSoftConnect()
msgSender = connect!!.connect(
"192.168.1.19",
"192.168.1.12",
12581,
object : GingerSoftConnect.SocketStateListener {
override fun onOpen() {
......@@ -74,6 +74,7 @@ class MainActivity : Activity() {
pax = 10
senderId = 1965.toString()
senderName = "Glen$count"
tableName = "餐檯$count"
sendTime = SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())
sendDeviceId = "6464646sdfs"
sendDeviceName = "POS$count"
......@@ -86,7 +87,7 @@ class MainActivity : Activity() {
foodId = "${1 + i}"
printId = "1166$i"
orderId = 1111L + count
foodName = "這是一個名字超級長的食品"
foodName = "這是一個名字超級長的食品$i"
quantity = count.toString()
price = count * 1.1
type = (i % 3) + 1
......
......@@ -55,7 +55,7 @@ afterEvaluate {
groupId = "com.gingersoft.connect"
artifactId = "Connect"
version = "1.5.0"
version = "1.5.1"
// 添加 POM 配置
// pom {
// name.set("GingerSoftConnect")
......
package com.gingersoft.connect.bean;
public class FoodInfoBean {
private Long id;
/**
* 食品id
*/
......@@ -40,14 +39,6 @@ public class FoodInfoBean {
*/
private boolean isPrintRedLetter;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getFoodId() {
return this.foodId;
}
......
......@@ -3,7 +3,6 @@ package com.gingersoft.connect.bean;
import java.util.List;
public class OrderInfoBean implements SendMsgType {
private Long id;
/**
* 訂單ID
*/
......@@ -65,14 +64,6 @@ public class OrderInfoBean implements SendMsgType {
*/
private List<FoodInfoBean> foodInfoBeanList;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Long getOrderId() {
return this.orderId;
}
......
......@@ -31,8 +31,10 @@ class MyWebSocketClient(
val bean = GsonUtils.GsonToBean(message, SocketCallbackBean::class.java)
Log.e("eeeaaa", "客戶端收到消息:$message")
if (bean != null && map.containsKey(bean.msgCode)) {
map[message]?.callback(bean.success, bean.statusCode, bean.errorMsg)
timerMap[message]?.cancel()
map[bean.msgCode]?.callback(bean.success, bean.statusCode, bean.errorMsg)
timerMap[bean.msgCode]?.cancel()
map.remove(bean.msgCode)
timerMap.remove(bean.msgCode)
}
}
......@@ -55,12 +57,14 @@ class MyWebSocketClient(
timerMap[msgCode] = Timer()
timerMap[msgCode]?.schedule(object : TimerTask() {
override fun run() {
if (!cancel()) {
callback.callback(
false,
MessageBuilder.ERROR_CODE_SEND_TIMEOUT,
"接收服務端響應超時"
)
}
}
}, 10000)
}
// 發送數據到服務器
......
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