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
a3352462
Commit
a3352462
authored
Jun 11, 2022
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整列表金额和详情金额逻辑一致
parent
e88d0595
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
65 additions
and
33 deletions
+65
-33
app/src/main/AndroidManifest.xml
+2
-2
app/src/main/java/com/ihaoin/hooloo/device/HLApplication.java
+3
-1
app/src/main/java/com/ihaoin/hooloo/device/component/PushMessageReceiver.java
+34
-21
app/src/main/java/com/ihaoin/hooloo/device/util/Utils.java
+1
-1
app/src/main/java/com/ihaoin/hooloo/device/view/MenuPresentation.java
+25
-8
app/src/main/res/mipmap-hdpi/ic_launcher.png
+0
-0
app/src/main/res/mipmap-hdpi/ic_launcher_round.png
+0
-0
app/src/main/res/mipmap-mdpi/ic_launcher.png
+0
-0
app/src/main/res/mipmap-mdpi/ic_launcher_round.png
+0
-0
app/src/main/res/mipmap-xhdpi/ic_launcher.png
+0
-0
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
+0
-0
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+0
-0
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
+0
-0
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+0
-0
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
+0
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
a3352462
...
@@ -19,11 +19,11 @@
...
@@ -19,11 +19,11 @@
<application
<application
android:name=
".HLApplication"
android:name=
".HLApplication"
android:allowBackup=
"true"
android:allowBackup=
"true"
android:icon=
"@mipmap/
ic
_launcher"
android:icon=
"@mipmap/
hooloo
_launcher"
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:theme=
"@style/AppTheme"
android:theme=
"@style/AppTheme"
android:usesCleartextTraffic=
"true"
android:usesCleartextTraffic=
"true"
tools:replace=
"android:allowBackup"
>
tools:replace=
"android:allowBackup
,android:icon
"
>
<activity
<activity
android:name=
".view.LauncherActivity"
android:name=
".view.LauncherActivity"
...
...
app/src/main/java/com/ihaoin/hooloo/device/HLApplication.java
View file @
a3352462
...
@@ -13,6 +13,7 @@ import com.umeng.commonsdk.UMConfigure;
...
@@ -13,6 +13,7 @@ import com.umeng.commonsdk.UMConfigure;
import
cn.jpush.android.api.JPushInterface
;
import
cn.jpush.android.api.JPushInterface
;
public
class
HLApplication
extends
Application
{
public
class
HLApplication
extends
Application
{
public
static
HLApplication
SELF
=
null
;
private
static
MainData
mainData
=
new
MainData
();
private
static
MainData
mainData
=
new
MainData
();
public
static
MainData
getMainData
()
{
public
static
MainData
getMainData
()
{
...
@@ -26,6 +27,7 @@ public class HLApplication extends Application {
...
@@ -26,6 +27,7 @@ public class HLApplication extends Application {
@Override
@Override
public
void
onCreate
()
{
public
void
onCreate
()
{
super
.
onCreate
();
super
.
onCreate
();
HLApplication
.
SELF
=
this
;
UMConfigure
.
preInit
(
this
,
AppConfig
.
UMENG_APPKEY
,
AppConfig
.
UMENG_CHANNEL
);
UMConfigure
.
preInit
(
this
,
AppConfig
.
UMENG_APPKEY
,
AppConfig
.
UMENG_CHANNEL
);
UMConfigure
.
init
(
this
,
AppConfig
.
UMENG_APPKEY
,
AppConfig
.
UMENG_CHANNEL
,
0
,
null
);
UMConfigure
.
init
(
this
,
AppConfig
.
UMENG_APPKEY
,
AppConfig
.
UMENG_CHANNEL
,
0
,
null
);
...
@@ -35,7 +37,7 @@ public class HLApplication extends Application {
...
@@ -35,7 +37,7 @@ public class HLApplication extends Application {
JPushInterface
.
init
(
this
);
JPushInterface
.
init
(
this
);
String
registrationId
=
JPushInterface
.
getRegistrationID
(
this
);
String
registrationId
=
JPushInterface
.
getRegistrationID
(
this
);
Log
.
d
(
AppConfig
.
TAG_PUSH
,
registrationId
);
Log
.
d
(
AppConfig
.
TAG_PUSH
,
"get registrationId:"
+
registrationId
);
if
(!
StringUtils
.
isEmpty
(
registrationId
))
{
if
(!
StringUtils
.
isEmpty
(
registrationId
))
{
HttpUtil
.
postRegistrationId
(
registrationId
,
null
);
HttpUtil
.
postRegistrationId
(
registrationId
,
null
);
}
}
...
...
app/src/main/java/com/ihaoin/hooloo/device/component/PushMessageReceiver.java
View file @
a3352462
...
@@ -35,7 +35,8 @@ public class PushMessageReceiver extends JPushMessageReceiver {
...
@@ -35,7 +35,8 @@ public class PushMessageReceiver extends JPushMessageReceiver {
@Override
@Override
public
void
onMessage
(
Context
context
,
CustomMessage
customMessage
)
{
public
void
onMessage
(
Context
context
,
CustomMessage
customMessage
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMessage] "
+
customMessage
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMessage] "
+
customMessage
);
this
.
showToast
(
"onMessage"
);
dispatchMsg
(
customMessage
);
dispatchMsg
(
customMessage
);
}
}
...
@@ -47,12 +48,12 @@ public class PushMessageReceiver extends JPushMessageReceiver {
...
@@ -47,12 +48,12 @@ public class PushMessageReceiver extends JPushMessageReceiver {
JSONObject
jsonObject
=
JSON
.
parseObject
(
customMessage
.
message
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
customMessage
.
message
);
String
action
=
jsonObject
.
getString
(
"action"
);
String
action
=
jsonObject
.
getString
(
"action"
);
if
(
StringUtils
.
isEmpty
(
action
))
{
if
(
StringUtils
.
isEmpty
(
action
))
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"msg action is empty"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"msg action is empty"
);
return
;
return
;
}
}
Handler
handler
=
subscribers
.
get
(
action
);
Handler
handler
=
subscribers
.
get
(
action
);
if
(
handler
==
null
)
{
if
(
handler
==
null
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
String
.
format
(
"msg action[%s] subscribers is empty"
,
action
));
Log
.
e
(
AppConfig
.
TAG_PUSH
,
String
.
format
(
"msg action[%s] subscribers is empty"
,
action
));
return
;
return
;
}
}
JSONObject
data
=
jsonObject
.
getJSONObject
(
"data"
);
JSONObject
data
=
jsonObject
.
getJSONObject
(
"data"
);
...
@@ -62,54 +63,72 @@ public class PushMessageReceiver extends JPushMessageReceiver {
...
@@ -62,54 +63,72 @@ public class PushMessageReceiver extends JPushMessageReceiver {
@Override
@Override
public
void
onNotifyMessageOpened
(
Context
context
,
NotificationMessage
message
)
{
public
void
onNotifyMessageOpened
(
Context
context
,
NotificationMessage
message
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageOpened] "
+
message
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageOpened] "
+
message
);
this
.
showToast
(
"onNotifyMessageOpened"
);
}
}
@Override
@Override
public
void
onMultiActionClicked
(
Context
context
,
Intent
intent
)
{
public
void
onMultiActionClicked
(
Context
context
,
Intent
intent
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击了通知栏按钮"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击了通知栏按钮"
);
this
.
showToast
(
"onMultiActionClicked"
);
String
nActionExtra
=
intent
.
getExtras
().
getString
(
JPushInterface
.
EXTRA_NOTIFICATION_ACTION_EXTRA
);
String
nActionExtra
=
intent
.
getExtras
().
getString
(
JPushInterface
.
EXTRA_NOTIFICATION_ACTION_EXTRA
);
//开发者根据不同 Action 携带的 extra 字段来分配不同的动作。
//开发者根据不同 Action 携带的 extra 字段来分配不同的动作。
if
(
nActionExtra
==
null
)
{
if
(
nActionExtra
==
null
)
{
Log
.
d
(
AppConfig
.
TAG_PUSH
,
"ACTION_NOTIFICATION_CLICK_ACTION nActionExtra is null"
);
Log
.
d
(
AppConfig
.
TAG_PUSH
,
"ACTION_NOTIFICATION_CLICK_ACTION nActionExtra is null"
);
return
;
return
;
}
}
if
(
nActionExtra
.
equals
(
"my_extra1"
))
{
if
(
nActionExtra
.
equals
(
"my_extra1"
))
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮一"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮一"
);
}
else
if
(
nActionExtra
.
equals
(
"my_extra2"
))
{
}
else
if
(
nActionExtra
.
equals
(
"my_extra2"
))
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮二"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮二"
);
}
else
if
(
nActionExtra
.
equals
(
"my_extra3"
))
{
}
else
if
(
nActionExtra
.
equals
(
"my_extra3"
))
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮三"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮三"
);
}
else
{
}
else
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮未定义"
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onMultiActionClicked] 用户点击通知栏按钮未定义"
);
}
}
}
}
@Override
@Override
public
void
onNotifyMessageArrived
(
Context
context
,
NotificationMessage
message
)
{
public
void
onNotifyMessageArrived
(
Context
context
,
NotificationMessage
message
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageArrived] "
+
message
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageArrived] "
+
message
);
this
.
showToast
(
"onNotifyMessageArrived"
);
}
}
@Override
@Override
public
void
onNotifyMessageDismiss
(
Context
context
,
NotificationMessage
message
)
{
public
void
onNotifyMessageDismiss
(
Context
context
,
NotificationMessage
message
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageDismiss] "
+
message
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotifyMessageDismiss] "
+
message
);
this
.
showToast
(
"onNotifyMessageDismiss"
);
}
}
@Override
@Override
public
void
onRegister
(
Context
context
,
String
registrationId
)
{
public
void
onRegister
(
Context
context
,
String
registrationId
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onRegister] "
+
registrationId
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onRegister] "
+
registrationId
);
HttpUtil
.
postRegistrationId
(
registrationId
,
null
);
HttpUtil
.
postRegistrationId
(
registrationId
,
null
);
this
.
showToast
(
"onRegister"
);
}
}
@Override
@Override
public
void
onConnected
(
Context
context
,
boolean
isConnected
)
{
public
void
onConnected
(
Context
context
,
boolean
isConnected
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onConnected] "
+
isConnected
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onConnected] "
+
isConnected
);
this
.
showToast
(
"onConnected"
);
}
}
@Override
@Override
public
void
onCommandResult
(
Context
context
,
CmdMessage
cmdMessage
)
{
public
void
onCommandResult
(
Context
context
,
CmdMessage
cmdMessage
)
{
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onCommandResult] "
+
cmdMessage
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onCommandResult] "
+
cmdMessage
);
this
.
showToast
(
"onCommandResult"
);
}
@Override
public
void
onNotificationSettingsCheck
(
Context
context
,
boolean
isOn
,
int
source
)
{
super
.
onNotificationSettingsCheck
(
context
,
isOn
,
source
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotificationSettingsCheck] isOn:"
+
isOn
+
",source:"
+
source
);
this
.
showToast
(
"onNotificationSettingsCheck"
);
}
private
void
showToast
(
String
content
)
{
// Toast.makeText(HLApplication.SELF, content, Toast.LENGTH_SHORT).show();
}
}
@Override
@Override
...
@@ -135,10 +154,4 @@ public class PushMessageReceiver extends JPushMessageReceiver {
...
@@ -135,10 +154,4 @@ public class PushMessageReceiver extends JPushMessageReceiver {
// TagAliasOperatorHelper.getInstance().onMobileNumberOperatorResult(context,jPushMessage);
// TagAliasOperatorHelper.getInstance().onMobileNumberOperatorResult(context,jPushMessage);
super
.
onMobileNumberOperatorResult
(
context
,
jPushMessage
);
super
.
onMobileNumberOperatorResult
(
context
,
jPushMessage
);
}
}
@Override
public
void
onNotificationSettingsCheck
(
Context
context
,
boolean
isOn
,
int
source
)
{
super
.
onNotificationSettingsCheck
(
context
,
isOn
,
source
);
Log
.
e
(
AppConfig
.
TAG_PUSH
,
"[onNotificationSettingsCheck] isOn:"
+
isOn
+
",source:"
+
source
);
}
}
}
app/src/main/java/com/ihaoin/hooloo/device/util/Utils.java
View file @
a3352462
...
@@ -133,7 +133,7 @@ public class Utils {
...
@@ -133,7 +133,7 @@ public class Utils {
}
}
public
static
String
toString
(
BigDecimal
num
)
{
public
static
String
toString
(
BigDecimal
num
)
{
DecimalFormat
df
=
new
DecimalFormat
(
"
#
.00"
);
DecimalFormat
df
=
new
DecimalFormat
(
"
0
.00"
);
return
df
.
format
(
num
);
return
df
.
format
(
num
);
}
}
...
...
app/src/main/java/com/ihaoin/hooloo/device/view/MenuPresentation.java
View file @
a3352462
...
@@ -104,7 +104,7 @@ public class MenuPresentation extends Presentation {
...
@@ -104,7 +104,7 @@ public class MenuPresentation extends Presentation {
Utils
.
getGlide
(
getContext
()).
load
(
mainData
.
getImages
().
getLeft
()).
into
(
imgLeft
);
Utils
.
getGlide
(
getContext
()).
load
(
mainData
.
getImages
().
getLeft
()).
into
(
imgLeft
);
}
}
if
(
mainData
.
getShopState
().
equals
(
0
))
{
if
(
mainData
.
getShopState
().
equals
(
Base
.
FALSE
))
{
Utils
.
getGlide
(
getContext
()).
load
(
getRightImage
(
ImageState
.
CLOSED
.
getCode
())).
into
(
imgRight
);
Utils
.
getGlide
(
getContext
()).
load
(
getRightImage
(
ImageState
.
CLOSED
.
getCode
())).
into
(
imgRight
);
}
else
if
(!
CollectionUtils
.
isEmpty
(
cookingOrders
))
{
}
else
if
(!
CollectionUtils
.
isEmpty
(
cookingOrders
))
{
Utils
.
getGlide
(
getContext
()).
load
(
getRightImage
(
ImageState
.
COOKING
.
getCode
())).
into
(
imgRight
);
Utils
.
getGlide
(
getContext
()).
load
(
getRightImage
(
ImageState
.
COOKING
.
getCode
())).
into
(
imgRight
);
...
@@ -236,23 +236,40 @@ public class MenuPresentation extends Presentation {
...
@@ -236,23 +236,40 @@ public class MenuPresentation extends Presentation {
return
;
return
;
}
}
// 添加新订单状态
// 添加新订单状态
pkgs
.
forEach
(
pkg
->
{
OrderPkg
pkg
=
getOrdersByState
(
pkgs
,
order
.
getState
());
if
(!
pkg
.
getState
().
equals
(
order
.
getState
()))
{
if
(
pkg
==
null
)
{
return
;
List
<
Order
>
orders
=
new
ArrayList
<>();
}
orders
.
add
(
order
);
pkg
=
new
OrderPkg
();
pkg
.
setState
(
order
.
getState
());
pkg
.
setOrders
(
orders
);
pkgs
.
add
(
pkg
);
}
else
{
List
<
Order
>
orders
=
pkg
.
getOrders
();
List
<
Order
>
orders
=
pkg
.
getOrders
();
if
(
CollectionUtils
.
isEmpty
(
orders
))
{
if
(
CollectionUtils
.
isEmpty
(
orders
))
{
orders
=
new
ArrayList
<>();
orders
=
new
ArrayList
<>();
}
}
orders
.
add
(
order
);
orders
.
add
(
order
);
pkg
.
setOrders
(
orders
);
pkg
.
setOrders
(
orders
);
}
);
}
}
}
orderDataChanged
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
finally
{
orderDataChanged
();
}
}
}
private
OrderPkg
getOrdersByState
(
List
<
OrderPkg
>
pkgs
,
Integer
state
)
{
if
(
CollectionUtils
.
isEmpty
(
pkgs
))
{
return
null
;
}
for
(
OrderPkg
pkg
:
pkgs
)
{
if
(
pkg
.
getState
().
equals
(
state
))
{
return
pkg
;
}
}
}
}
return
null
;
}
}
}
}
app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted
100644 → 0
View file @
e88d0595
2.89 KB
app/src/main/res/mipmap-hdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
e88d0595
4.79 KB
app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted
100644 → 0
View file @
e88d0595
2.01 KB
app/src/main/res/mipmap-mdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
e88d0595
2.72 KB
app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted
100644 → 0
View file @
e88d0595
4.38 KB
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
e88d0595
6.73 KB
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted
100644 → 0
View file @
e88d0595
6.24 KB
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
e88d0595
10.2 KB
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted
100644 → 0
View file @
e88d0595
8.91 KB
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
deleted
100644 → 0
View file @
e88d0595
14.8 KB
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