Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
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
王宇航
supplier
Commits
dd8737f2
Commit
dd8737f2
authored
Mar 19, 2021
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、启动页 登录页状态栏颜色统一调整为黑色 2、自定义食品金额字段联调
parent
4ccca7e1
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
124 additions
and
31 deletions
+124
-31
component-login/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/LoginActivity.java
+29
-0
component-login/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
+5
-0
component-login/src/main/res/layout/user_login_activity_login.xml
+5
-0
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/SoldoutCtrlModel.java
+10
-5
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
+7
-7
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
+3
-2
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
+4
-1
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/SelectMealAdapter.java
+1
-1
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/widget/CustomFoodDialog.java
+11
-10
library-common/src/main/java/com/gingersoft/gsa/cloud/app/GsaCloudApplication.java
+1
-1
library-database/src/main/java/com/gingersoft/gsa/cloud/database/bean/Food.java
+39
-3
library-order/src/main/java/com/gingersoft/gsa/cloud/order/commodity/OrderDetail.java
+9
-1
No files found.
component-login/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/LoginActivity.java
View file @
dd8737f2
...
...
@@ -2,12 +2,15 @@ package com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.ui.activity;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.os.AsyncTask
;
import
android.os.Bundle
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.text.method.HideReturnsTransformationMethod
;
import
android.text.method.PasswordTransformationMethod
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.CheckBox
;
import
android.widget.ImageView
;
...
...
@@ -30,7 +33,11 @@ import com.google.android.material.textfield.TextInputEditText;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.StatusBarUtil
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaButton
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.util.List
;
import
java.util.Objects
;
import
javax.inject.Inject
;
...
...
@@ -91,6 +98,28 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
return
R
.
layout
.
user_login_activity_login
;
//如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
}
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
StatusBarUtil
.
setColor
(
this
,
ArmsUtils
.
getColor
(
mContext
,
R
.
color
.
trans
));
// setStatusBarDarkMode(true,this);
}
public
void
setStatusBarDarkMode
(
boolean
darkmode
,
Activity
activity
)
{
Class
<?
extends
Window
>
clazz
=
activity
.
getWindow
().
getClass
();
try
{
int
darkModeFlag
=
0
;
Class
<?>
layoutParams
=
Class
.
forName
(
"android.view.MiuiWindowManager$LayoutParams"
);
Field
field
=
layoutParams
.
getField
(
"EXTRA_FLAG_STATUS_BAR_DARK_MODE"
);
darkModeFlag
=
field
.
getInt
(
layoutParams
);
Method
extraFlagField
=
clazz
.
getMethod
(
"setExtraFlags"
,
int
.
class
,
int
.
class
);
extraFlagField
.
invoke
(
activity
.
getWindow
(),
darkmode
?
darkModeFlag
:
0
,
darkModeFlag
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
((
ImageView
)
findViewById
(
R
.
id
.
iv_top_bg
)).
setAdjustViewBounds
(
true
);
...
...
component-login/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
View file @
dd8737f2
...
...
@@ -3,9 +3,12 @@ package com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.ui.activity;
import
android.animation.AnimatorSet
;
import
android.animation.ObjectAnimator
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.animation.Animation
;
import
android.view.animation.AnimationUtils
;
import
android.view.animation.DecelerateInterpolator
;
...
...
@@ -37,6 +40,7 @@ import com.gingersoft.gsa.cloud.login.mvp.ui.adapter.GuideAdapter;
import
com.gingersoft.gsa.cloud.ui.widget.Indicator.UIndicator
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.StatusBarUtil
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.util.QMUIStatusBarHelper
;
import
java.util.ArrayList
;
...
...
@@ -84,6 +88,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
StatusBarUtil
.
setColor
(
this
,
ArmsUtils
.
getColor
(
mContext
,
R
.
color
.
trans
));
}
@Override
...
...
component-login/src/main/res/layout/user_login_activity_login.xml
View file @
dd8737f2
...
...
@@ -11,6 +11,11 @@
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_30"
android:background=
"#E7F2FF"
/>
<ImageView
android:id=
"@+id/iv_top_bg"
android:layout_width=
"match_parent"
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/SoldoutCtrlModel.java
View file @
dd8737f2
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.utils.FoodDaoUtils
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.SoldoutCtrlContract
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.MealService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.utils.MealStyleUtils
;
import
com.google.gson.Gson
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
java.util.List
;
import
javax.inject.Inject
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
...
...
@@ -51,29 +56,29 @@ public class SoldoutCtrlModel extends BaseModel implements SoldoutCtrlContract.M
public
List
<
Food
>
queryDB_FoodListByIds
(
String
[]
ids
)
{
String
sql
=
"SELECT * FROM FOOD WHERE id IN ( ?, ? );"
;
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
List
<
Food
>
foods
=
foodDaoUtils
.
queryFoodByNativeSql
(
sql
,
ids
);
return
foods
;
List
<
Food
>
foods
=
foodDaoUtils
.
queryFoodByNativeSql
(
sql
,
ids
);
return
MealStyleUtils
.
assemblyFoodsColor
(
foods
)
;
}
@Override
public
List
<
Food
>
queryDB_AllFoodList
()
{
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
List
<
Food
>
foods
=
foodDaoUtils
.
queryAllFoodByQueryBuilder
();
return
foods
;
return
MealStyleUtils
.
assemblyFoodsColor
(
foods
)
;
}
@Override
public
List
<
Food
>
queryDB_FoodGroupList
()
{
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
List
<
Food
>
foods
=
foodDaoUtils
.
queryFoodGroupByQueryBuilder
();
return
foods
;
return
MealStyleUtils
.
assemblyFoodsColor
(
foods
)
;
}
@Override
public
List
<
Food
>
queryDB_FoodList
(
long
parentId
)
{
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
List
<
Food
>
foods
=
foodDaoUtils
.
queryFoodByQueryBuilder
(
parentId
);
return
foods
;
return
MealStyleUtils
.
assemblyFoodsColor
(
foods
)
;
}
@Override
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
View file @
dd8737f2
...
...
@@ -635,7 +635,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
orderDetailsBean
.
setPrice
(
discountPrice
);
break
;
}
else
{
if
(
orderDetailsBean
.
getAblediscount
()
==
0
)
{
if
(
!
orderDetailsBean
.
canAbleDiscount
()
)
{
//此食品或细项不支持折扣 直接跳过
continue
;
}
...
...
@@ -743,19 +743,19 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
continue
;
}
if
(
orderMealItem
.
getItemType
()
==
1
)
{
if
(
orderMealItem
.
getAblediscount
()
==
1
)
{
if
(
orderMealItem
.
canAbleDiscount
()
)
{
total
=
MoneyUtil
.
sum
(
total
,
orderMealItem
.
getPrice
());
}
}
else
{
int
parentIndex
=
orderMealItem
.
getParentIndex
()
-
1
;
OrderDetail
parentFood
=
mOrderMealList
.
get
(
parentIndex
);
if
(
orderSize
>
parentIndex
&&
parentFood
.
getAblediscount
()
==
1
)
{
if
(
orderSize
>
parentIndex
&&
parentFood
.
canAbleDiscount
()
)
{
if
(
orderMealItem
.
getType
()
==
DISCOUNT_TYPE
)
{
//主食品参与折扣,折扣金额直接减掉
total
=
MoneyUtil
.
sub
(
total
,
Math
.
abs
(
orderMealItem
.
getPrice
()));
}
else
{
//主食品可參與折扣 子食品才能參與折扣
if
(
orderMealItem
.
getAblediscount
()
==
1
)
{
if
(
orderMealItem
.
canAbleDiscount
()
)
{
total
=
MoneyUtil
.
sum
(
total
,
orderMealItem
.
getPrice
());
}
}
...
...
@@ -1147,7 +1147,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
orderItem
.
setPrintSetIng
(
item
.
getPrintseting
());
orderItem
.
setAblediscount
(
item
.
getAblediscount
());
orderItem
.
setScAble
(
item
.
getScAble
());
if
(
item
.
getAblediscount
()
==
1
)
{
if
(
item
.
canAbleDiscount
()
)
{
//可參與折扣
List
<
OrderResponse
.
OrderDetailsBean
.
RestaurantDiscountVO
>
discountList
=
getRestaurantDiscountList
(
foodList
,
parentItem
);
if
(
discountList
.
size
()
>
0
)
{
...
...
@@ -1188,7 +1188,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
OrderDetail
food
=
newFoodList
.
get
(
i
);
if
(
food
.
getItemType
()
!=
1
)
{
int
parentIndex
=
food
.
getParentIndex
()
-
1
;
if
(
orderSize
>
parentIndex
&&
newFoodList
.
get
(
parentIndex
).
getAblediscount
()
==
0
)
{
if
(
orderSize
>
parentIndex
&&
!
newFoodList
.
get
(
parentIndex
).
canAbleDiscount
()
)
{
//主食品不可參與折扣 子食品也不能參與折扣
food
.
setAblediscount
(
0
);
}
...
...
@@ -1207,7 +1207,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
OrderDetail
food
=
newFoodList
.
get
(
i
);
if
(
food
.
getItemType
()
!=
1
)
{
int
parentIndex
=
food
.
getParentIndex
()
-
1
;
if
(
orderSize
>
parentIndex
&&
newFoodList
.
get
(
parentIndex
).
getAblediscount
()
==
0
)
{
if
(
orderSize
>
parentIndex
&&
!
newFoodList
.
get
(
parentIndex
).
canAbleDiscount
()
)
{
//主食品不可參與折扣 子食品也不能參與折扣
food
.
setScAble
((
byte
)
0
);
}
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
View file @
dd8737f2
...
...
@@ -330,9 +330,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
changedMealByParentId
(
datasBean
.
getId
());
}
else
{
mCurrentOrderDetailBean
=
OrderDetail
.
foodTransOrderDetails
(
datasBean
,
1
);
if
(
datasBean
.
getCustomType
()
==
null
)
{
int
customType
=
datasBean
.
ableDiscountCastCustomType
();
if
(
customType
!=
Food
.
CUSTOM_TYPE_100
)
{
//自定義食品
mRootView
.
setCustomFoodDialog
(
Food
.
CUSTOM_TYPE_100
,
mCurrentOrderDetailBean
);
mRootView
.
setCustomFoodDialog
(
customType
,
mCurrentOrderDetailBean
);
}
else
{
//加載套餐食品
loadComboData
(
mCurrentOrderDetailBean
,
false
);
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
View file @
dd8737f2
...
...
@@ -5,6 +5,7 @@ import android.content.Intent;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.PersistableBundle
;
import
android.os.SystemClock
;
import
android.text.Editable
;
import
android.text.TextUtils
;
...
...
@@ -1416,7 +1417,9 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
.
create
(
R
.
style
.
MyEditDialogTheme
)
.
setOnEditListener
((
dialog
,
name
,
money
)
->
{
dialog
.
dismiss
();
foodItem
.
setProductName
(
name
);
if
(
customType
==
Food
.
CUSTOM_TYPE_101
)
{
foodItem
.
setProductName
(
name
);
}
foodItem
.
setUnit_price
(
Double
.
parseDouble
(
money
));
foodItem
.
setPrice
(
foodItem
.
getUnit_price
());
mPresenter
.
toAddFoodItem
(
foodItem
);
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/SelectMealAdapter.java
View file @
dd8737f2
...
...
@@ -168,7 +168,7 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
private
void
setViewVisibility
(
OrderDetail
datasBean
)
{
//是否参与折扣
if
(
datasBean
.
getAblediscount
()
==
0
)
{
if
(
!
datasBean
.
canAbleDiscount
()
)
{
tv_D
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
tv_D
.
setVisibility
(
View
.
INVISIBLE
);
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/widget/CustomFoodDialog.java
View file @
dd8737f2
...
...
@@ -82,14 +82,15 @@ public class CustomFoodDialog {
llContainer
.
setLayoutParams
(
new
ConstraintLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
));
if
(
mCustomType
==
Food
.
CUSTOM_TYPE_101
)
{
vs_name
.
inflate
();
TextView
tv_name
=
customDialog
.
findViewById
(
R
.
id
.
tv_name
);
ed_name
=
customDialog
.
findViewById
(
R
.
id
.
ed_name
);
tv_name
.
setText
(
"名稱"
);
setOnFocusChangeListener
(
ed_name
);
addTextChangedListener
(
ed_name
,
btn_clear_or_return
);
}
else
if
(
mCustomType
==
Food
.
CUSTOM_TYPE_102
)
{
// if (mCustomType == Food.CUSTOM_TYPE_101) {
// vs_name.inflate();
// TextView tv_name = customDialog.findViewById(R.id.tv_name);
// ed_name = customDialog.findViewById(R.id.ed_name);
// tv_name.setText("名稱");
// setOnFocusChangeListener(ed_name);
// addTextChangedListener(ed_name, btn_clear_or_return);
// } else
if
(
mCustomType
==
Food
.
CUSTOM_TYPE_102
)
{
vs_money
.
inflate
();
TextView
tv_money
=
customDialog
.
findViewById
(
R
.
id
.
tv_money
);
ed_money
=
customDialog
.
findViewById
(
R
.
id
.
et_money
);
...
...
@@ -123,7 +124,7 @@ public class CustomFoodDialog {
String
money
=
getTvMoneyText
();
if
(
onEditListener
!=
null
)
{
onEditListener
.
onInput
(
customDialog
,
name
,
money
);
onEditListener
.
onInput
(
customDialog
,
name
,
money
);
}
});
btn_clear_or_return
.
setOnClickListener
((
view
)
->
{
...
...
@@ -211,6 +212,6 @@ public class CustomFoodDialog {
}
public
interface
OnEditListener
{
void
onInput
(
Dialog
dialog
,
String
name
,
String
money
);
void
onInput
(
Dialog
dialog
,
String
name
,
String
money
);
}
}
library-common/src/main/java/com/gingersoft/gsa/cloud/app/GsaCloudApplication.java
View file @
dd8737f2
...
...
@@ -187,7 +187,7 @@ public class GsaCloudApplication extends BaseApplication {
* 初始化滴滴開發,測試輔助工具哆啦A夢
*/
private
void
initDoraemonKit
()
{
DoraemonKit
.
install
(
getAppContext
(),
DoraemonKitConfig
.
PRODUCE_ID
);
//
DoraemonKit.install(getAppContext(), DoraemonKitConfig.PRODUCE_ID);
}
/**
...
...
library-database/src/main/java/com/gingersoft/gsa/cloud/database/bean/Food.java
View file @
dd8737f2
...
...
@@ -74,9 +74,9 @@ public class Food {
*/
private
String
plu
;
/**
* 自定義类型 #100=
自定义食品名称及金额 #101=自定义食品名称
#102=自定义食品金额
* 自定義类型 #100=
不可自定义 #101=自定义食品名称及金额
#102=自定义食品金额
*/
private
Integer
customType
;
private
Integer
customType
;
public
static
final
int
CUSTOM_TYPE_100
=
100
;
public
static
final
int
CUSTOM_TYPE_101
=
101
;
public
static
final
int
CUSTOM_TYPE_102
=
102
;
...
...
@@ -175,7 +175,18 @@ public class Food {
*/
private
long
periodId
;
/**
* 是否参与折扣#1:可折扣
* 是否参与折扣,是否自定义食品:
* 可折扣 1
* 可折扣、自定義食品名稱和金額 3
* 可折扣、自定義金額 5
* 可折扣、合併名稱及金額 7
* 可折扣、合併名稱 9
* <p>
* 不可折扣 0
* 不可折扣、自定義食品名稱和金額 2
* 不可折扣、自定義金額 4
* 不可折扣、合併名稱及金額 6
* 不可折扣、合併名稱 8
*/
private
long
ableDiscount
;
/**
...
...
@@ -1083,4 +1094,29 @@ public class Food {
this
.
colorId
=
colorId
;
}
public
boolean
isCustomPrice
()
{
if
(
ableDiscount
==
4
||
ableDiscount
==
5
)
{
return
true
;
}
return
false
;
}
public
boolean
isCustomPriceAndName
()
{
if
(
ableDiscount
==
2
||
ableDiscount
==
3
)
{
return
true
;
}
return
false
;
}
public
int
ableDiscountCastCustomType
()
{
if
(
isCustomPriceAndName
())
{
return
CUSTOM_TYPE_101
;
}
if
(
isCustomPrice
())
{
return
CUSTOM_TYPE_102
;
}
return
CUSTOM_TYPE_100
;
}
}
library-order/src/main/java/com/gingersoft/gsa/cloud/order/commodity/OrderDetail.java
View file @
dd8737f2
...
...
@@ -28,7 +28,7 @@ import lombok.Data;
* 描述:訂單實體類
*/
@Data
public
class
OrderDetail
implements
Commodity
,
Serializable
,
Cloneable
{
public
class
OrderDetail
implements
Commodity
,
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
958791295551999853L
;
/**
* 是否选择
...
...
@@ -1365,6 +1365,14 @@ public class OrderDetail implements Commodity, Serializable ,Cloneable{
}
public
boolean
canAbleDiscount
()
{
int
ad
=
(
int
)
(
ablediscount
%
2
);
if
(
ablediscount
==
1
||
ablediscount
%
2
!=
0
)
{
return
true
;
}
return
false
;
}
@NonNull
@Override
protected
OrderDetail
clone
()
throws
CloneNotSupportedException
{
...
...
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