Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GingerSoftLANInterconnection
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宇航
GingerSoftLANInterconnection
Commits
ab794788
Commit
ab794788
authored
May 30, 2024
by
王宇航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.5.1
1、修復接收到消息還會顯示超時的問題 2、去除OrderInfoBean和FoodInfoBean的id字段,不由用戶端賦值
parent
34d78140
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
24 deletions
+11
-24
.idea/deploymentTargetDropDown.xml
+1
-1
app/src/main/java/com/example/demo/MainActivity.kt
+3
-2
mylibrary/build.gradle.kts
+1
-1
mylibrary/src/main/java/com/gingersoft/connect/bean/FoodInfoBean.java
+0
-9
mylibrary/src/main/java/com/gingersoft/connect/bean/OrderInfoBean.java
+0
-9
mylibrary/src/main/java/com/gingersoft/connect/utils/MyWebSocketClient.kt
+6
-2
No files found.
.idea/deploymentTargetDropDown.xml
View file @
ab794788
...
...
@@ -15,7 +15,7 @@
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown
value=
"2024-05-
29T08:01:27.8433827
00Z"
/>
<timeTargetWasSelectedWithDropDown
value=
"2024-05-
30T02:36:04.1189034
00Z"
/>
</State>
</entry>
</value>
...
...
app/src/main/java/com/example/demo/MainActivity.kt
View file @
ab794788
...
...
@@ -31,7 +31,7 @@ class MainActivity : Activity() {
tvConnect
.
isClickable
=
false
connect
=
GingerSoftConnect
()
msgSender
=
connect
!!
.
connect
(
"192.168.1.1
9
"
,
"192.168.1.1
2
"
,
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
...
...
mylibrary/build.gradle.kts
View file @
ab794788
...
...
@@ -55,7 +55,7 @@ afterEvaluate {
groupId = "com.gingersoft.connect"
artifactId = "Connect"
version = "1.5.
0
"
version = "1.5.
1
"
// 添加 POM 配置
// pom {
// name.set("GingerSoftConnect")
...
...
mylibrary/src/main/java/com/gingersoft/connect/bean/FoodInfoBean.java
View file @
ab794788
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
;
}
...
...
mylibrary/src/main/java/com/gingersoft/connect/bean/OrderInfoBean.java
View file @
ab794788
...
...
@@ -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
;
}
...
...
mylibrary/src/main/java/com/gingersoft/connect/utils/MyWebSocketClient.kt
View file @
ab794788
...
...
@@ -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
)
}
// 發送數據到服務器
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment