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
7d83dd71
Commit
7d83dd71
authored
May 31, 2022
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改SKU状态
parent
927f090f
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
68 additions
and
21 deletions
+68
-21
app/build.gradle
+5
-0
app/src/main/AndroidManifest.xml
+5
-3
app/src/main/java/com/ihaoin/hooloo/device/HLApplication.java
+3
-0
app/src/main/java/com/ihaoin/hooloo/device/adapter/GoodsAdapter.java
+2
-1
app/src/main/java/com/ihaoin/hooloo/device/data/TrolleyGoods.java
+1
-1
app/src/main/java/com/ihaoin/hooloo/device/data/enums/OrderState.java
+3
-3
app/src/main/java/com/ihaoin/hooloo/device/data/enums/SkuState.java
+36
-0
app/src/main/java/com/ihaoin/hooloo/device/data/vo/GoodsRule.java
+3
-3
app/src/main/java/com/ihaoin/hooloo/device/data/vo/Sku.java
+1
-3
app/src/main/java/com/ihaoin/hooloo/device/util/Utils.java
+3
-2
app/src/main/java/com/ihaoin/hooloo/device/view/GoodsDetailDialog.java
+5
-4
app/src/main/java/com/ihaoin/hooloo/device/view/SettingsActivity.java
+1
-1
No files found.
app/build.gradle
View file @
7d83dd71
...
...
@@ -68,4 +68,8 @@ dependencies {
// 引入极光 SDK
implementation
project
(
':library_jiguang'
)
implementation
'com.umeng.umsdk:common:9.5.0'
// 版本号(必选)
implementation
'com.umeng.umsdk:asms:1.6.3'
// asms包依赖(必选)
implementation
'com.umeng.umsdk:apm:1.6.2'
// U-APM产品包依赖(必选)
}
\ No newline at end of file
app/src/main/AndroidManifest.xml
View file @
7d83dd71
...
...
@@ -6,6 +6,8 @@
android:versionName=
"1.0"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.GET_ACCOUNTS"
/>
<uses-permission
android:name=
"android.permission.READ_PROFILE"
/>
...
...
@@ -32,9 +34,9 @@
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.HOME"
/
>
<category
android:name=
"android.intent.category.DEFAULT"
/
>
<category
android:name=
"android.intent.category.MONKEY"
/
>
<!-- <category android:name="android.intent.category.HOME" />--
>
<!-- <category android:name="android.intent.category.DEFAULT" />--
>
<!-- <category android:name="android.intent.category.MONKEY" />--
>
</intent-filter>
</activity>
<activity
...
...
app/src/main/java/com/ihaoin/hooloo/device/HLApplication.java
View file @
7d83dd71
...
...
@@ -9,6 +9,7 @@ import com.ihaoin.hooloo.device.data.MainData;
import
com.ihaoin.hooloo.device.network.HttpUtil
;
import
com.ihaoin.hooloo.device.util.SharedPreferencesUtils
;
import
com.ihaoin.hooloo.device.util.StringUtils
;
import
com.umeng.commonsdk.UMConfigure
;
import
cn.jpush.android.api.JPushInterface
;
...
...
@@ -26,6 +27,8 @@ public class HLApplication extends Application {
@Override
public
void
onCreate
()
{
super
.
onCreate
();
UMConfigure
.
preInit
(
this
,
"6294708905844627b598aa78"
,
"device_order"
);
UMConfigure
.
init
(
this
,
"6294708905844627b598aa78"
,
"device_order"
,
0
,
null
);
AppConfig
.
MACHINE_CODE
=
SharedPreferencesUtils
.
getMachineCode
(
this
);
...
...
app/src/main/java/com/ihaoin/hooloo/device/adapter/GoodsAdapter.java
View file @
7d83dd71
...
...
@@ -16,6 +16,7 @@ import com.chad.library.adapter.base.BaseViewHolder;
import
com.ihaoin.hooloo.device.R
;
import
com.ihaoin.hooloo.device.config.Base
;
import
com.ihaoin.hooloo.device.data.ScrollBean
;
import
com.ihaoin.hooloo.device.data.enums.SkuState
;
import
com.ihaoin.hooloo.device.data.vo.Goods
;
import
com.ihaoin.hooloo.device.data.vo.Sku
;
import
com.ihaoin.hooloo.device.util.CollectionUtils
;
...
...
@@ -82,7 +83,7 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
helper
.
setText
(
R
.
id
.
txt_price
,
Utils
.
toString
(
sku
.
getPrice
()));
helper
.
setText
(
R
.
id
.
txt_discount
,
Utils
.
toString
(
sku
.
getDiscount
()));
if
(
Base
.
TRUE
.
equals
(
sku
.
getState
()))
{
if
(
SkuState
.
isSellin
(
sku
.
getState
()))
{
helper
.
setGone
(
R
.
id
.
txt_sellout
,
false
);
helper
.
setGone
(
R
.
id
.
butn_add
,
true
);
View
butnAdd
=
helper
.
getView
(
R
.
id
.
butn_add
);
...
...
app/src/main/java/com/ihaoin/hooloo/device/data/TrolleyGoods.java
View file @
7d83dd71
...
...
@@ -45,7 +45,7 @@ public class TrolleyGoods implements Serializable {
*/
private
Integer
skuId
;
/**
* 状态:
0-售罄,1-
可售
* 状态:
1-可售、2-不
可售
*/
private
Integer
state
;
/**
...
...
app/src/main/java/com/ihaoin/hooloo/device/data/enums/OrderState.java
View file @
7d83dd71
package
com
.
ihaoin
.
hooloo
.
device
.
data
.
enums
;
public
enum
OrderState
{
WAITING
(
2
,
"待制作"
),
COOKING
(
3
,
"制作中"
),
COMPLETED
(
4
,
"
可取餐
"
);
WAITING
(
2
,
"
已支付,
待制作"
),
COOKING
(
3
,
"
支付
制作中"
),
COMPLETED
(
4
,
"
制作完成未取
"
);
private
Integer
code
;
private
String
name
;
...
...
app/src/main/java/com/ihaoin/hooloo/device/data/enums/SkuState.java
0 → 100644
View file @
7d83dd71
package
com
.
ihaoin
.
hooloo
.
device
.
data
.
enums
;
public
enum
SkuState
{
SELLIN
(
1
,
"可售"
),
SELLOUT
(
2
,
"不可售"
);
private
Integer
code
;
private
String
name
;
SkuState
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
SkuState
get
(
Integer
code
)
{
for
(
SkuState
state
:
SkuState
.
values
())
{
if
(
state
.
getCode
().
equals
(
code
))
{
return
state
;
}
}
return
null
;
}
public
static
Boolean
isSellin
(
Integer
code
)
{
return
SELLIN
.
getCode
().
equals
(
code
);
}
public
Integer
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
app/src/main/java/com/ihaoin/hooloo/device/data/vo/GoodsRule.java
View file @
7d83dd71
package
com
.
ihaoin
.
hooloo
.
device
.
data
.
vo
;
import
com.ihaoin.hooloo.device.
config.Bas
e
;
import
com.ihaoin.hooloo.device.
data.enums.SkuStat
e
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
...
...
@@ -24,9 +24,9 @@ public class GoodsRule implements Serializable {
*/
private
Integer
isRecommend
;
/**
* 状态,1-可售、
0
-不可售
* 状态,1-可售、
2
-不可售
*/
private
Integer
state
=
Base
.
TRUE
;
private
Integer
state
=
SkuState
.
SELLIN
.
getCode
()
;
/**
* 价格
*/
...
...
app/src/main/java/com/ihaoin/hooloo/device/data/vo/Sku.java
View file @
7d83dd71
package
com
.
ihaoin
.
hooloo
.
device
.
data
.
vo
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
...
...
@@ -10,7 +8,7 @@ public class Sku implements Serializable {
/** sku id */
private
Integer
skuId
;
/** 状态:
0-售罄,1-
可售 */
/** 状态:
1-可售、2-不
可售 */
private
Integer
state
;
/** 默认状态:0-否,1-是 */
private
Integer
isDefault
;
...
...
app/src/main/java/com/ihaoin/hooloo/device/util/Utils.java
View file @
7d83dd71
...
...
@@ -19,6 +19,7 @@ import com.ihaoin.hooloo.device.R;
import
com.ihaoin.hooloo.device.component.TouchDelegateComposite
;
import
com.ihaoin.hooloo.device.config.Base
;
import
com.ihaoin.hooloo.device.data.TrolleyGoods
;
import
com.ihaoin.hooloo.device.data.enums.SkuState
;
import
com.ihaoin.hooloo.device.data.vo.Goods
;
import
com.ihaoin.hooloo.device.data.vo.Sku
;
import
com.ihaoin.hooloo.device.view.ConfirmOrderDialog
;
...
...
@@ -141,11 +142,11 @@ public class Utils {
if
(
CollectionUtils
.
isEmpty
(
skus
))
{
return
null
;
}
Optional
<
Sku
>
optional
=
skus
.
stream
().
filter
(
x
->
Base
.
TRUE
.
equals
(
x
.
getIsDefault
())
&&
Base
.
TRUE
.
equals
(
x
.
getState
())).
findAny
();
Optional
<
Sku
>
optional
=
skus
.
stream
().
filter
(
x
->
Base
.
TRUE
.
equals
(
x
.
getIsDefault
())
&&
SkuState
.
isSellin
(
x
.
getState
())).
findAny
();
if
(
optional
.
isPresent
())
{
return
optional
.
get
();
}
optional
=
skus
.
stream
().
filter
(
x
->
Base
.
TRUE
.
equals
(
x
.
getState
())).
findAny
();
optional
=
skus
.
stream
().
filter
(
x
->
SkuState
.
isSellin
(
x
.
getState
())).
findAny
();
if
(
optional
.
isPresent
())
{
return
optional
.
get
();
}
...
...
app/src/main/java/com/ihaoin/hooloo/device/view/GoodsDetailDialog.java
View file @
7d83dd71
...
...
@@ -24,6 +24,7 @@ import com.ihaoin.hooloo.device.HLApplication;
import
com.ihaoin.hooloo.device.R
;
import
com.ihaoin.hooloo.device.component.IntroViewPager
;
import
com.ihaoin.hooloo.device.config.Base
;
import
com.ihaoin.hooloo.device.data.enums.SkuState
;
import
com.ihaoin.hooloo.device.data.vo.Goods
;
import
com.ihaoin.hooloo.device.data.vo.GoodsRule
;
import
com.ihaoin.hooloo.device.data.vo.Sku
;
...
...
@@ -293,7 +294,7 @@ public class GoodsDetailDialog extends Dialog {
if
(
Base
.
TRUE
.
equals
(
rule
.
getIsRecommend
()))
{
ruleView
.
findViewById
(
R
.
id
.
txt_recommend
).
setVisibility
(
View
.
VISIBLE
);
}
if
(!
Base
.
TRUE
.
equals
(
rule
.
getState
()))
{
if
(!
SkuState
.
isSellin
(
rule
.
getState
()))
{
button
.
setEnabled
(
false
);
}
else
{
if
(
Base
.
TRUE
.
equals
(
rule
.
getIsDefault
()))
{
...
...
@@ -409,9 +410,9 @@ public class GoodsDetailDialog extends Dialog {
return
;
}
// 售罄SKU列表
List
<
Sku
>
sellOuts
=
map
.
get
(
Base
.
FALSE
);
List
<
Sku
>
sellOuts
=
map
.
get
(
SkuState
.
SELLOUT
.
getCode
()
);
// 未售罄SKU列表
List
<
Sku
>
sellIns
=
map
.
get
(
Base
.
TRUE
);
List
<
Sku
>
sellIns
=
map
.
get
(
SkuState
.
SELLIN
.
getCode
()
);
if
(
CollectionUtils
.
isEmpty
(
sellIns
))
{
showSelloutViews
();
return
;
...
...
@@ -485,7 +486,7 @@ public class GoodsDetailDialog extends Dialog {
if
(
CollectionUtils
.
isEmpty
(
spec
.
getRules
()))
{
return
;
}
spec
.
getRules
().
forEach
(
rule
->
rule
.
setState
(
Base
.
FALSE
));
spec
.
getRules
().
forEach
(
rule
->
rule
.
setState
(
SkuState
.
SELLOUT
.
getCode
()
));
});
}
}
app/src/main/java/com/ihaoin/hooloo/device/view/SettingsActivity.java
View file @
7d83dd71
...
...
@@ -83,7 +83,7 @@ public class SettingsActivity extends Activity {
private
void
showMachineCode
()
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
.
setTitle
(
"修改
点
机器编码"
);
builder
.
setTitle
(
"修改机器编码"
);
EditText
editText
=
new
EditText
(
getApplicationContext
());
editText
.
setText
(
SharedPreferencesUtils
.
getMachineCode
(
SettingsActivity
.
this
));
builder
.
setView
(
editText
);
...
...
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