Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
machine
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
android
machine
Commits
84575675
Commit
84575675
authored
May 13, 2022
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
e2914fbc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
app/src/main/java/com/ihaoin/hooloo/device/data/po/ConfirmOrder.java
+13
-0
app/src/main/java/com/ihaoin/hooloo/device/util/RandomUtils.java
+10
-0
app/src/main/java/com/ihaoin/hooloo/device/view/ConfirmOrderDialog.java
+7
-0
No files found.
app/src/main/java/com/ihaoin/hooloo/device/data/po/ConfirmOrder.java
View file @
84575675
...
...
@@ -12,6 +12,11 @@ public class ConfirmOrder implements Serializable {
private
String
machineCode
;
/**
* 机器编码
*/
private
String
seqNo
;
/**
* 点单屏编码
*/
private
String
screenNo
;
...
...
@@ -44,4 +49,12 @@ public class ConfirmOrder implements Serializable {
public
void
setGoods
(
List
<
ConfirmGoods
>
goods
)
{
this
.
goods
=
goods
;
}
public
String
getSeqNo
()
{
return
seqNo
;
}
public
void
setSeqNo
(
String
seqNo
)
{
this
.
seqNo
=
seqNo
;
}
}
app/src/main/java/com/ihaoin/hooloo/device/util/RandomUtils.java
View file @
84575675
...
...
@@ -14,4 +14,14 @@ public class RandomUtils {
}
return
val
;
}
public
static
Integer
nextInt
(
List
<
Integer
>
ints
)
{
Integer
val
=
new
Random
().
nextInt
();
if
(
CollectionUtils
.
isEmpty
(
ints
))
{
return
val
;
}
if
(
ints
.
contains
(
val
))
{
return
nextInt
(
ints
);
}
return
val
;
}
}
app/src/main/java/com/ihaoin/hooloo/device/view/ConfirmOrderDialog.java
View file @
84575675
...
...
@@ -32,9 +32,11 @@ import com.ihaoin.hooloo.device.data.po.ConfirmOrder;
import
com.ihaoin.hooloo.device.data.vo.Goods
;
import
com.ihaoin.hooloo.device.data.vo.Sku
;
import
com.ihaoin.hooloo.device.network.HttpUtil
;
import
com.ihaoin.hooloo.device.util.RandomUtils
;
import
com.ihaoin.hooloo.device.util.Utils
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -184,6 +186,7 @@ public class ConfirmOrderDialog extends Dialog {
ConfirmOrder
confirmOrder
=
new
ConfirmOrder
();
confirmOrder
.
setMachineCode
(
AppConfig
.
MACHINE_CODE
);
confirmOrder
.
setScreenNo
(
AppConfig
.
SCREEN_NO
);
confirmOrder
.
setSeqNo
(
genSeqNo
());
confirmOrder
.
setGoods
(
goods
);
return
JSON
.
toJSONString
(
confirmOrder
);
}
catch
(
Exception
e
)
{
...
...
@@ -192,6 +195,10 @@ public class ConfirmOrderDialog extends Dialog {
return
null
;
}
private
String
genSeqNo
()
{
return
new
Date
().
getTime
()
+
"-"
+
RandomUtils
.
nextInt
(
null
);
}
OnDismissListener
dismissListener
=
new
OnDismissListener
()
{
@Override
public
void
onDismiss
(
DialogInterface
dialog
)
{
...
...
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