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
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
29 deletions
+16
-29
.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
+11
-7
No files found.
.idea/deploymentTargetDropDown.xml
View file @
ab794788
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</deviceKey>
</deviceKey>
</Target>
</Target>
</runningDeviceTargetSelectedWithDropDown>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown
value=
"2024-05-
29T08:01:27.8433827
00Z"
/>
<timeTargetWasSelectedWithDropDown
value=
"2024-05-
30T02:36:04.1189034
00Z"
/>
</State>
</State>
</entry>
</entry>
</value>
</value>
...
...
app/src/main/java/com/example/demo/MainActivity.kt
View file @
ab794788
...
@@ -31,7 +31,7 @@ class MainActivity : Activity() {
...
@@ -31,7 +31,7 @@ class MainActivity : Activity() {
tvConnect
.
isClickable
=
false
tvConnect
.
isClickable
=
false
connect
=
GingerSoftConnect
()
connect
=
GingerSoftConnect
()
msgSender
=
connect
!!
.
connect
(
msgSender
=
connect
!!
.
connect
(
"192.168.1.1
9
"
,
"192.168.1.1
2
"
,
12581
,
12581
,
object
:
GingerSoftConnect
.
SocketStateListener
{
object
:
GingerSoftConnect
.
SocketStateListener
{
override
fun
onOpen
()
{
override
fun
onOpen
()
{
...
@@ -74,6 +74,7 @@ class MainActivity : Activity() {
...
@@ -74,6 +74,7 @@ class MainActivity : Activity() {
pax
=
10
pax
=
10
senderId
=
1965
.
toString
()
senderId
=
1965
.
toString
()
senderName
=
"Glen$count"
senderName
=
"Glen$count"
tableName
=
"餐檯$count"
sendTime
=
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
Date
())
sendTime
=
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
Date
())
sendDeviceId
=
"6464646sdfs"
sendDeviceId
=
"6464646sdfs"
sendDeviceName
=
"POS$count"
sendDeviceName
=
"POS$count"
...
@@ -86,7 +87,7 @@ class MainActivity : Activity() {
...
@@ -86,7 +87,7 @@ class MainActivity : Activity() {
foodId
=
"${1 + i}"
foodId
=
"${1 + i}"
printId
=
"1166$i"
printId
=
"1166$i"
orderId
=
1111L
+
count
orderId
=
1111L
+
count
foodName
=
"這是一個名字超級長的食品
,
"
foodName
=
"這是一個名字超級長的食品
$i
"
quantity
=
count
.
toString
()
quantity
=
count
.
toString
()
price
=
count
*
1.1
price
=
count
*
1.1
type
=
(
i
%
3
)
+
1
type
=
(
i
%
3
)
+
1
...
...
mylibrary/build.gradle.kts
View file @
ab794788
...
@@ -55,7 +55,7 @@ afterEvaluate {
...
@@ -55,7 +55,7 @@ afterEvaluate {
groupId = "com.gingersoft.connect"
groupId = "com.gingersoft.connect"
artifactId = "Connect"
artifactId = "Connect"
version = "1.5.
0
"
version = "1.5.
1
"
// 添加 POM 配置
// 添加 POM 配置
// pom {
// pom {
// name.set("GingerSoftConnect")
// name.set("GingerSoftConnect")
...
...
mylibrary/src/main/java/com/gingersoft/connect/bean/FoodInfoBean.java
View file @
ab794788
package
com
.
gingersoft
.
connect
.
bean
;
package
com
.
gingersoft
.
connect
.
bean
;
public
class
FoodInfoBean
{
public
class
FoodInfoBean
{
private
Long
id
;
/**
/**
* 食品id
* 食品id
*/
*/
...
@@ -40,14 +39,6 @@ public class FoodInfoBean {
...
@@ -40,14 +39,6 @@ public class FoodInfoBean {
*/
*/
private
boolean
isPrintRedLetter
;
private
boolean
isPrintRedLetter
;
public
Long
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getFoodId
()
{
public
String
getFoodId
()
{
return
this
.
foodId
;
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;
...
@@ -3,7 +3,6 @@ package com.gingersoft.connect.bean;
import
java.util.List
;
import
java.util.List
;
public
class
OrderInfoBean
implements
SendMsgType
{
public
class
OrderInfoBean
implements
SendMsgType
{
private
Long
id
;
/**
/**
* 訂單ID
* 訂單ID
*/
*/
...
@@ -65,14 +64,6 @@ public class OrderInfoBean implements SendMsgType {
...
@@ -65,14 +64,6 @@ public class OrderInfoBean implements SendMsgType {
*/
*/
private
List
<
FoodInfoBean
>
foodInfoBeanList
;
private
List
<
FoodInfoBean
>
foodInfoBeanList
;
public
Long
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getOrderId
()
{
public
Long
getOrderId
()
{
return
this
.
orderId
;
return
this
.
orderId
;
}
}
...
...
mylibrary/src/main/java/com/gingersoft/connect/utils/MyWebSocketClient.kt
View file @
ab794788
...
@@ -31,8 +31,10 @@ class MyWebSocketClient(
...
@@ -31,8 +31,10 @@ class MyWebSocketClient(
val
bean
=
GsonUtils
.
GsonToBean
(
message
,
SocketCallbackBean
::
class
.
java
)
val
bean
=
GsonUtils
.
GsonToBean
(
message
,
SocketCallbackBean
::
class
.
java
)
Log
.
e
(
"eeeaaa"
,
"客戶端收到消息:$message"
)
Log
.
e
(
"eeeaaa"
,
"客戶端收到消息:$message"
)
if
(
bean
!=
null
&&
map
.
containsKey
(
bean
.
msgCode
))
{
if
(
bean
!=
null
&&
map
.
containsKey
(
bean
.
msgCode
))
{
map
[
message
]
?.
callback
(
bean
.
success
,
bean
.
statusCode
,
bean
.
errorMsg
)
map
[
bean
.
msgCode
]
?.
callback
(
bean
.
success
,
bean
.
statusCode
,
bean
.
errorMsg
)
timerMap
[
message
]
?.
cancel
()
timerMap
[
bean
.
msgCode
]
?.
cancel
()
map
.
remove
(
bean
.
msgCode
)
timerMap
.
remove
(
bean
.
msgCode
)
}
}
}
}
...
@@ -55,11 +57,13 @@ class MyWebSocketClient(
...
@@ -55,11 +57,13 @@ class MyWebSocketClient(
timerMap
[
msgCode
]
=
Timer
()
timerMap
[
msgCode
]
=
Timer
()
timerMap
[
msgCode
]
?.
schedule
(
object
:
TimerTask
()
{
timerMap
[
msgCode
]
?.
schedule
(
object
:
TimerTask
()
{
override
fun
run
()
{
override
fun
run
()
{
callback
.
callback
(
if
(!
cancel
())
{
false
,
callback
.
callback
(
MessageBuilder
.
ERROR_CODE_SEND_TIMEOUT
,
false
,
"接收服務端響應超時"
MessageBuilder
.
ERROR_CODE_SEND_TIMEOUT
,
)
"接收服務端響應超時"
)
}
}
}
},
10000
)
},
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