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
5b0327e5
Commit
5b0327e5
authored
Dec 17, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、供應鏈的食品列表,採購單列表,分類頁面功能,購物車
Signed-off-by: Wyh <1239658231>
parent
c1f2f178
Show whitespace changes
Inline
Side-by-side
Showing
91 changed files
with
3910 additions
and
415 deletions
+3910
-415
base-module/src/main/java/com/gingersoft/gsa/cloud/common/bean/BaseResult.java
+0
-32
base-module/src/main/java/com/gingersoft/gsa/cloud/common/service/GetInfoUpdateService.kt
+4
-4
base-module/src/main/java/com/gingersoft/gsa/cloud/common/ui/utils/AppDialog.java
+15
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/common/utils/okhttpUtils/OkHttp3Utils.java
+8
-9
base-module/src/main/java/com/gingersoft/gsa/cloud/common/utils/time/TimePickerUtils.java
+7
-22
base-module/src/main/java/com/gingersoft/gsa/cloud/common/utils/view/BitmapUtil.java
+149
-2
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/adapter/BaseCategoryAdapter.java
+12
-4
base-module/src/main/res/drawable-xhdpi/ic_red_circular_delete.png
+0
-0
base-module/src/main/res/drawable/shape_dotted.xml
+12
-0
base-module/src/main/res/layout/include_horizontal_color_eee_dotted_line.xml
+6
-0
base-module/src/main/res/layout/item_category.xml
+21
-5
base-module/src/main/res/values/colors.xml
+4
-0
base-module/src/main/res/values/styles.xml
+1
-1
supply-chain-module/src/main/java/com/gingersoft/supply_chain/di/component/SendMsgComponent.java
+42
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/di/component/StorageListComponent.java
+42
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/di/module/SendMsgModule.java
+31
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/di/module/StorageListModule.java
+31
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/FoodByCategoryResultBean.java
+21
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/FoodCategoryResultBean.java
+1
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/FoodInfoBean.java
+41
-41
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/OrderBean.java
+9
-3
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/OrderCategoryBean.java
+29
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/PurchaseFoodListVosBean.java
+21
-1
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/SupplierInfoBean.java
+0
-3
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/content/Constant.java
+8
-2
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/content/SupplyShoppingCart.java
+10
-1
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/CategoryContract.java
+4
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/FoodIngredientsContract.java
+20
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/NewFoodIngredientsContract.java
+2
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/PurchaseListContract.java
+6
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/SendMsgContract.java
+29
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/StorageListContract.java
+29
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/model/CategoryModel.java
+6
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/model/FoodIngredientsModel.java
+14
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/model/PurchaseListModel.java
+8
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/model/SendMsgModel.java
+47
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/model/StorageListModel.java
+47
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/CategoryPresenter.java
+45
-7
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/FoodIngredientsPresenter.java
+84
-5
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/NewFoodIngredientsPresenter.java
+34
-14
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/PurchaseListPresenter.java
+30
-1
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/SendMsgPresenter.java
+52
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/StorageListPresenter.java
+59
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/server/SupplierServer.java
+36
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/FoodListAdapter.java
+20
-11
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/OrderCategoryAdapter.java
+158
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/PurchaseOrderAdapter.java
+3
-4
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/PurchasePageAdapter.java
+2
-2
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/SecondCategoryAdapter.java
+13
-1
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/ShoppingCartAdapter.java
+42
-3
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/StorageAdapter.java
+42
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/BaseSupplyChainFragment.java
+9
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/CategoryFragment.java
+78
-4
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/CategorySelectFragment.java
+1
-5
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/FoodIngredientsFragment.java
+164
-27
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/FunctionListFragment.java
+8
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/MeasurementUnitFragment.java
+1
-14
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/NewFoodIngredientsFragment.java
+34
-16
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/NewSupplierFragment.java
+2
-2
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/OrderContentFragment.java
+16
-5
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/PackageSpecificationFragment.java
+1
-2
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/PurchaseListFragment.java
+37
-9
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/SendMsgFragment.java
+64
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/StorageListFragment.java
+158
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/SupplierListFragment.java
+7
-7
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/DashedView.java
+115
-0
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/ScreenView.java
+37
-6
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/SeekBarPressure.java
+521
-0
supply-chain-module/src/main/res/drawable-xxhdpi/ic_seekbar_btn.png
+0
-0
supply-chain-module/src/main/res/drawable/shape_category_dotted.xml
+15
-0
supply-chain-module/src/main/res/drawable/shape_gray_circular.xml
+8
-0
supply-chain-module/src/main/res/drawable/shape_seekbar_bg.xml
+10
-0
supply-chain-module/src/main/res/layout/fragment_food_ingredients.xml
+15
-2
supply-chain-module/src/main/res/layout/fragment_order_content.xml
+1
-1
supply-chain-module/src/main/res/layout/fragment_purchase_list.xml
+6
-0
supply-chain-module/src/main/res/layout/fragment_send_msg.xml
+331
-0
supply-chain-module/src/main/res/layout/fragment_supplier_list.xml
+18
-11
supply-chain-module/src/main/res/layout/item_food_ingredient.xml
+49
-101
supply-chain-module/src/main/res/layout/item_order_category.xml
+86
-0
supply-chain-module/src/main/res/layout/item_order_second_category.xml
+81
-0
supply-chain-module/src/main/res/layout/item_order_third_category.xml
+55
-0
supply-chain-module/src/main/res/layout/item_purchase_order.xml
+5
-4
supply-chain-module/src/main/res/layout/item_second_category.xml
+9
-1
supply-chain-module/src/main/res/layout/item_shopping_cart_food.xml
+231
-0
supply-chain-module/src/main/res/layout/item_storage.xml
+215
-0
supply-chain-module/src/main/res/layout/item_supplier.xml
+20
-9
supply-chain-module/src/main/res/layout/layout_shopping_cart.xml
+3
-2
supply-chain-module/src/main/res/layout/pop_purchase_order_screen.xml
+105
-8
supply-chain-module/src/main/res/layout/supply_chain_top_bar.xml
+11
-0
supply-chain-module/src/main/res/values/attrs.xml
+19
-0
supply-chain-module/src/main/res/values/colors.xml
+7
-0
No files found.
base-module/src/main/java/com/gingersoft/gsa/cloud/common/bean/BaseResult.java
View file @
5b0327e5
...
...
@@ -27,36 +27,4 @@ public class BaseResult {
public
void
setSuccess
(
boolean
success
)
{
this
.
success
=
success
;
}
public
long
getSysTime
()
{
return
sysTime
;
}
public
void
setSysTime
(
long
sysTime
)
{
this
.
sysTime
=
sysTime
;
}
public
String
getErrCode
()
{
return
errCode
;
}
public
void
setErrCode
(
String
errCode
)
{
this
.
errCode
=
errCode
;
}
public
String
getErrMsg
()
{
return
errMsg
;
}
public
void
setErrMsg
(
String
errMsg
)
{
this
.
errMsg
=
errMsg
;
}
public
Object
getData
()
{
return
data
;
}
public
void
setData
(
Object
data
)
{
this
.
data
=
data
;
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/common/service/GetInfoUpdateService.kt
View file @
5b0327e5
...
...
@@ -18,14 +18,14 @@ import android.util.Log
import
android.widget.RemoteViews
import
androidx.annotation.RequiresApi
import
androidx.core.app.NotificationCompat
import
com.gingersoft.gsa.cloud.common.R
import
com.gingersoft.gsa.cloud.common.constans.AppConstans
import
com.gingersoft.gsa.cloud.common.constans.HttpsConstans
import
com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
import
com.gingersoft.gsa.cloud.common.R
import
com.gingersoft.gsa.cloud.common.utils.SoundPoolUtils
import
com.gingersoft.gsa.cloud.common.utils.okhttpUtils.OkHttp3Utils
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
import
com.gingersoft.gsa.cloud.common.constans.AppConstans
import
com.gingersoft.gsa.cloud.common.constans.HttpsConstans
import
com.google.gson.Gson
import
io.reactivex.Observable
import
io.reactivex.Observer
...
...
@@ -247,7 +247,7 @@ class GetInfoUpdateService : Service() {
override
fun
onClosing
(
webSocket
:
WebSocket
,
code
:
Int
,
reason
:
String
)
{
super
.
onClosing
(
webSocket
,
code
,
reason
)
//連接斷開,
Log
.
e
(
TAG
,
"onClosing"
)
Log
.
e
(
TAG
,
"onClosing
$reason
"
)
putTimeLog
(
"onClosing關閉連接"
)
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/common/ui/utils/AppDialog.java
View file @
5b0327e5
...
...
@@ -17,11 +17,24 @@ import com.jess.arms.utils.ArmsUtils;
import
java.util.List
;
public
class
AppDialog
{
private
static
AppDialog
appDialog
;
public
static
AppDialog
getInstance
()
{
if
(
appDialog
==
null
)
{
appDialog
=
new
AppDialog
();
}
return
appDialog
;
}
public
void
showWaringDialog
(
Context
context
,
String
title
,
DialogOnClickListenter
sureOnclickListenter
)
{
showWaringDialog
(
context
,
title
,
null
,
null
,
sureOnclickListenter
,
null
);
}
public
void
showWaringDialog
(
Context
context
,
String
title
,
DialogOnClickListenter
sureOnclickListenter
,
DialogOnClickListenter
cancelOnclickListenter
)
{
showWaringDialog
(
context
,
title
,
null
,
null
,
sureOnclickListenter
,
cancelOnclickListenter
);
}
private
void
showWaringDialog
(
Context
context
,
String
title
,
String
confimText
,
String
cancelText
,
DialogOnClickListenter
sureOnclickListenter
,
DialogOnClickListenter
cancelOnclickListenter
)
{
new
DialogUtils
(
context
,
R
.
layout
.
other_order_pause_orders
)
{
@Override
...
...
@@ -63,7 +76,7 @@ public class AppDialog {
RadioListAdapter
radioListAdapter
=
new
RadioListAdapter
(
list
);
radioListAdapter
.
setSelectIndex
(
defaultCheck
);
showSelectDialog
(
context
,
title
,
1
,
radioListAdapter
,
(
view
,
dialog
)
->
{
if
(
onDialogSelectListener
!=
null
)
{
if
(
onDialogSelectListener
!=
null
)
{
onDialogSelectListener
.
onclick
(
view
,
dialog
,
radioListAdapter
.
getSelectIndex
());
}
});
...
...
@@ -72,6 +85,7 @@ public class AppDialog {
public
interface
DialogOnClickListenter
{
void
onclick
(
View
view
,
Dialog
dialog
);
}
public
interface
onDialogSelectListener
{
void
onclick
(
View
view
,
Dialog
dialog
,
int
position
);
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/common/utils/okhttpUtils/OkHttp3Utils.java
View file @
5b0327e5
...
...
@@ -223,15 +223,14 @@ public class OkHttp3Utils {
* 版本,時間,RP_HD001,Gingersoft,GS1,26ErrorMsg:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
*/
public
static
void
noticePersonnel
(
String
errCode
,
String
pushContent
)
{
String
restaurantInfo
=
"版本號:"
+
DeviceUtils
.
getVersionName
(
GsaCloudApplication
.
getAppContext
())
+
"|"
+
DeviceUtils
.
getVersionCode
(
GsaCloudApplication
.
getAppContext
())
+
"時間:"
+
TimeUtils
.
getCurrentDate
(
TimeUtils
.
DEFAULT_DATE_FORMAT
)
+
"報錯CODE:"
+
errCode
+
"品牌名:"
+
ResturantInfoManager
.
newInstance
().
getBrandName
()
+
"餐廳名:"
+
ResturantInfoManager
.
newInstance
().
getRestaurantName
()
+
"餐廳ID:"
+
ResturantInfoManager
.
newInstance
().
getRestaurantId
()
+
"登陸人員:"
+
UserContext
.
newInstance
().
getMemberName
()
+
"|"
+
UserContext
.
newInstance
().
getMemberId
()
+
"報錯原因:"
+
pushContent
;
String
restaurantInfo
=
DeviceUtils
.
getVersionName
(
GsaCloudApplication
.
getAppContext
())
+
"|"
+
DeviceUtils
.
getVersionCode
(
GsaCloudApplication
.
getAppContext
())
+
"--"
+
TimeUtils
.
getCurrentDate
(
TimeUtils
.
DEFAULT_DATE_FORMAT
)
+
"--CODE:"
+
errCode
+
"--餐廳:"
+
ResturantInfoManager
.
newInstance
().
getBrandName
()
+
"--"
+
ResturantInfoManager
.
newInstance
().
getRestaurantName
()
+
"--ID:"
+
ResturantInfoManager
.
newInstance
().
getRestaurantId
()
+
"--用戶:"
+
UserContext
.
newInstance
().
getMemberName
()
+
"|"
+
UserContext
.
newInstance
().
getMemberId
()
+
"--原因:"
+
pushContent
;
RequestBody
requestBody
=
new
FormBody
.
Builder
()
.
add
(
"code"
,
errCode
)
//錯誤碼
.
add
(
"shopId"
,
ResturantInfoManager
.
newInstance
().
getGsPosShopId
())
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/common/utils/time/TimePickerUtils.java
View file @
5b0327e5
...
...
@@ -100,27 +100,7 @@ public class TimePickerUtils {
}
public
static
TimePickerView
showDatePicker
(
Context
mContext
,
OnTimeSelectListener
onTimeSelectListener
)
{
//獲取今年第一天的日期
//打開時間選擇器
TimePickerView
pvTime
=
new
TimePickerBuilder
(
mContext
,
onTimeSelectListener
)
.
setType
(
new
boolean
[]{
true
,
true
,
true
,
false
,
false
,
false
})
//默认全部显示
.
setCancelText
(
"取消"
)
//取消按钮文字
.
setSubmitText
(
"確認"
)
//确认按钮文字
.
setContentTextSize
(
20
)
//滚轮文字大小
.
setTitleSize
(
20
)
//标题文字大小
.
setOutSideCancelable
(
true
)
//点击屏幕,点在控件外部范围时,是否取消显示
.
isCyclic
(
false
)
//是否循环滚动
.
setTextColorCenter
(
Color
.
BLACK
)
//设置选中项的颜色
.
setTitleColor
(
Color
.
BLACK
)
//标题文字颜色
.
setSubmitColor
(
Color
.
BLUE
)
//确定按钮文字颜色
.
setCancelColor
(
Color
.
BLUE
)
//取消按钮文字颜色
.
setLabel
(
""
,
""
,
""
,
""
,
""
,
""
)
.
isCenterLabel
(
false
)
//是否只显示中间选中项的label文字,false则每项item全部都带有label。
.
build
();
//設置默認選中時間
pvTime
.
setDate
(
Calendar
.
getInstance
());
//注:根据需求来决定是否使用该方法(一般是精确到秒的情况),此项可以在弹出选择器的时候重新设置当前时间,避免在初始化之后由于时间已经设定,导致选中时间与当前时间不匹配的问题。
pvTime
.
show
();
return
pvTime
;
return
showDatePicker
(
mContext
,
null
,
onTimeSelectListener
);
}
public
static
TimePickerView
showDatePicker
(
Context
mContext
,
View
view
,
OnTimeSelectListener
onTimeSelectListener
)
{
...
...
@@ -142,8 +122,13 @@ public class TimePickerUtils {
.
isCenterLabel
(
false
)
//是否只显示中间选中项的label文字,false则每项item全部都带有label。
.
build
();
//設置默認選中時間
pvTime
.
setDate
(
Calendar
.
getInstance
());
//注:根据需求来决定是否使用该方法(一般是精确到秒的情况),此项可以在弹出选择器的时候重新设置当前时间,避免在初始化之后由于时间已经设定,导致选中时间与当前时间不匹配的问题。
//注:根据需求来决定是否使用该方法(一般是精确到秒的情况),此项可以在弹出选择器的时候重新设置当前时间,避免在初始化之后由于时间已经设定,导致选中时间与当前时间不匹配的问题。
pvTime
.
setDate
(
Calendar
.
getInstance
());
if
(
view
==
null
)
{
pvTime
.
show
();
}
else
{
pvTime
.
show
(
view
);
}
return
pvTime
;
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/common/utils/view/BitmapUtil.java
View file @
5b0327e5
...
...
@@ -4,6 +4,12 @@ import android.content.ContentResolver;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.graphics.Canvas
;
import
android.graphics.Matrix
;
import
android.graphics.Paint
;
import
android.graphics.PorterDuff
;
import
android.graphics.PorterDuffXfermode
;
import
android.media.ExifInterface
;
import
android.net.Uri
;
import
android.util.Log
;
...
...
@@ -14,6 +20,8 @@ import com.google.zxing.WriterException;
import
com.google.zxing.common.BitMatrix
;
import
com.google.zxing.qrcode.decoder.ErrorCorrectionLevel
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.HashMap
;
...
...
@@ -27,6 +35,7 @@ public class BitmapUtil {
/**
* 生成条码bitmap
*
* @param content
* @param format
* @param width
...
...
@@ -34,10 +43,10 @@ public class BitmapUtil {
* @return
*/
public
static
Bitmap
generateBitmap
(
String
content
,
int
format
,
int
width
,
int
height
)
{
if
(
content
==
null
||
content
.
equals
(
""
))
if
(
content
==
null
||
content
.
equals
(
""
))
return
null
;
BarcodeFormat
barcodeFormat
;
switch
(
format
){
switch
(
format
)
{
case
0
:
barcodeFormat
=
BarcodeFormat
.
UPC_A
;
break
;
...
...
@@ -194,4 +203,142 @@ public class BitmapUtil {
}
return
bitmap
;
}
private
static
String
PHOTO_FILE_NAME
=
"PMSManagerPhoto"
;
/**
* 获取图片的旋转角度
*
* @param filePath
* @return
*/
public
static
int
getRotateAngle
(
String
filePath
)
{
int
rotate_angle
=
0
;
try
{
ExifInterface
exifInterface
=
new
ExifInterface
(
filePath
);
int
orientation
=
exifInterface
.
getAttributeInt
(
ExifInterface
.
TAG_ORIENTATION
,
ExifInterface
.
ORIENTATION_NORMAL
);
switch
(
orientation
)
{
case
ExifInterface
.
ORIENTATION_ROTATE_90
:
rotate_angle
=
90
;
break
;
case
ExifInterface
.
ORIENTATION_ROTATE_180
:
rotate_angle
=
180
;
break
;
case
ExifInterface
.
ORIENTATION_ROTATE_270
:
rotate_angle
=
270
;
break
;
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
rotate_angle
;
}
/**
* 旋转图片角度
*
* @param angle
* @param bitmap
* @return
*/
public
static
Bitmap
setRotateAngle
(
int
angle
,
Bitmap
bitmap
)
{
if
(
bitmap
!=
null
)
{
Matrix
m
=
new
Matrix
();
m
.
postRotate
(
angle
);
bitmap
=
Bitmap
.
createBitmap
(
bitmap
,
0
,
0
,
bitmap
.
getWidth
(),
bitmap
.
getHeight
(),
m
,
true
);
return
bitmap
;
}
return
bitmap
;
}
/**
* 转换为圆形状的bitmap
* @param source
* @return
*/
public
static
Bitmap
createCircleImage
(
Bitmap
source
)
{
int
length
=
source
.
getWidth
()
<
source
.
getHeight
()
?
source
.
getWidth
()
:
source
.
getHeight
();
Paint
paint
=
new
Paint
();
paint
.
setAntiAlias
(
true
);
Bitmap
target
=
Bitmap
.
createBitmap
(
length
,
length
,
Bitmap
.
Config
.
ARGB_8888
);
Canvas
canvas
=
new
Canvas
(
target
);
canvas
.
drawCircle
(
length
/
2
,
length
/
2
,
length
/
2
,
paint
);
paint
.
setXfermode
(
new
PorterDuffXfermode
(
PorterDuff
.
Mode
.
SRC_IN
));
canvas
.
drawBitmap
(
source
,
0
,
0
,
paint
);
return
target
;
}
/**
* 图片压缩-质量压缩
*
* @param filePath 源图片路径
* @return 压缩后的路径
*/
public
static
String
compressImage
(
String
filePath
)
{
//原文件
File
oldFile
=
new
File
(
filePath
);
//压缩文件路径 照片路径/
String
targetPath
=
oldFile
.
getPath
();
//压缩比例0-100
int
quality
=
50
;
//获取一定尺寸的图片
Bitmap
bm
=
getSmallBitmap
(
filePath
);
//获取相片拍摄角度
int
degree
=
getRotateAngle
(
filePath
);
//旋转照片角度,防止横着显示
if
(
degree
!=
0
)
{
bm
=
setRotateAngle
(
degree
,
bm
);
}
File
outputFile
=
new
File
(
targetPath
);
try
{
if
(!
outputFile
.
exists
())
{
File
parentFile
=
outputFile
.
getParentFile
();
if
(
parentFile
!=
null
)
{
boolean
mkdirs
=
parentFile
.
mkdirs
();
}
}
else
{
boolean
delete
=
outputFile
.
delete
();
}
FileOutputStream
out
=
new
FileOutputStream
(
outputFile
);
bm
.
compress
(
Bitmap
.
CompressFormat
.
JPEG
,
quality
,
out
);
out
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
filePath
;
}
return
outputFile
.
getPath
();
}
/**
* 根据路径获得图片信息并按比例压缩,返回bitmap
*/
public
static
Bitmap
getSmallBitmap
(
String
filePath
)
{
final
BitmapFactory
.
Options
options
=
new
BitmapFactory
.
Options
();
//只解析图片边沿,获取宽高
options
.
inJustDecodeBounds
=
true
;
BitmapFactory
.
decodeFile
(
filePath
,
options
);
// 计算缩放比
options
.
inSampleSize
=
calculateInSampleSize
(
options
,
480
,
800
);
// 完整解析图片返回bitmap
options
.
inJustDecodeBounds
=
false
;
return
BitmapFactory
.
decodeFile
(
filePath
,
options
);
}
public
static
int
calculateInSampleSize
(
BitmapFactory
.
Options
options
,
int
reqWidth
,
int
reqHeight
)
{
final
int
height
=
options
.
outHeight
;
final
int
width
=
options
.
outWidth
;
int
inSampleSize
=
1
;
if
(
height
>
reqHeight
||
width
>
reqWidth
)
{
final
int
heightRatio
=
Math
.
round
((
float
)
height
/
(
float
)
reqHeight
);
final
int
widthRatio
=
Math
.
round
((
float
)
width
/
(
float
)
reqWidth
);
inSampleSize
=
Math
.
min
(
heightRatio
,
widthRatio
);
}
return
inSampleSize
;
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/adapter/BaseCategoryAdapter.java
View file @
5b0327e5
...
...
@@ -2,9 +2,9 @@ package com.gingersoft.gsa.cloud.ui.adapter;
import
android.content.Context
;
import
android.graphics.drawable.Drawable
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
androidx.cardview.widget.CardView
;
import
androidx.core.content.ContextCompat
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
...
...
@@ -32,9 +32,11 @@ public class BaseCategoryAdapter extends BaseQuickAdapter<CategoryBean, BaseView
private
int
selectColor
=
-
1
;
private
int
unSelectColor
=
-
1
;
private
boolean
showDelete
=
false
;
public
BaseCategoryAdapter
(
@Nullable
List
<
CategoryBean
>
data
,
Context
context
)
{
super
(
R
.
layout
.
item_category
,
data
);
addChildClickViewIds
(
R
.
id
.
iv_category_delete
);
selectedBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
shape_left_radio_shadow
);
unSelectedBg
=
ContextCompat
.
getDrawable
(
context
,
R
.
color
.
trans
);
}
...
...
@@ -43,13 +45,13 @@ public class BaseCategoryAdapter extends BaseQuickAdapter<CategoryBean, BaseView
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
CategoryBean
categoryBean
)
{
TextView
tvCategoryName
=
viewHolder
.
getView
(
R
.
id
.
tv_category_name
);
tvCategoryName
.
setText
(
categoryBean
.
getCategoryName
());
LinearLayout
view
=
viewHolder
.
getView
(
R
.
id
.
layout_category
);
CardView
view
=
viewHolder
.
getView
(
R
.
id
.
layout_category
);
if
(
viewHolder
.
getAdapterPosition
()
==
selectedIndex
)
{
if
(
selectedBg
!=
null
)
{
view
.
setBackground
(
selectedBg
);
}
if
(
selectColor
!=
-
1
)
{
viewHolder
.
setTextColor
(
R
.
id
.
tv_category_name
,
selectColor
);
tvCategoryName
.
setTextColor
(
selectColor
);
}
tvCategoryName
.
setSelected
(
true
);
}
else
{
...
...
@@ -58,9 +60,15 @@ public class BaseCategoryAdapter extends BaseQuickAdapter<CategoryBean, BaseView
view
.
setBackground
(
unSelectedBg
);
}
if
(
unSelectColor
!=
-
1
)
{
viewHolder
.
setTextColor
(
R
.
id
.
tv_category_name
,
unSelectColor
);
tvCategoryName
.
setTextColor
(
unSelectColor
);
}
}
viewHolder
.
setGone
(
R
.
id
.
iv_category_delete
,
!
showDelete
);
}
public
void
setShowDelete
(
boolean
showDelete
)
{
this
.
showDelete
=
showDelete
;
notifyDataSetChanged
();
}
public
BaseCategoryAdapter
setSelectedBg
(
Drawable
selectedBg
)
{
...
...
base-module/src/main/res/drawable-xhdpi/ic_red_circular_delete.png
0 → 100644
View file @
5b0327e5
1.03 KB
base-module/src/main/res/drawable/shape_dotted.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"line"
>
<stroke
android:width=
"@dimen/dp_1"
android:color=
"@color/dotted_color"
android:dashWidth=
"@dimen/dp_8"
android:dashGap=
"@dimen/dp_8"
/>
</shape>
\ No newline at end of file
base-module/src/main/res/layout/include_horizontal_color_eee_dotted_line.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<View
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/horizontal_dotted"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_1"
android:background=
"@drawable/shape_dotted"
/>
base-module/src/main/res/layout/item_category.xml
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
androidx.cardview.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/layout_category"
...
...
@@ -9,14 +9,19 @@
android:layout_marginTop=
"@dimen/dp_15"
android:elevation=
"@dimen/dp_5"
android:orientation=
"horizontal"
android:paddingTop=
"@dimen/dp_10"
android:paddingBottom=
"@dimen/dp_10"
app:cardElevation=
"@dimen/dp_10"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:paddingTop=
"@dimen/dp_10"
android:paddingBottom=
"@dimen/dp_10"
>
<TextView
android:id=
"@+id/tv_category_name"
android:layout_width=
"match_parent"
android:layout_height=
"match_par
ent"
android:layout_height=
"wrap_cont
ent"
android:button=
"@null"
android:ellipsize=
"marquee"
android:gravity=
"center_vertical"
...
...
@@ -27,4 +32,14 @@
android:textSize=
"@dimen/dp_14"
android:textStyle=
"bold"
tools:text=
"果蔬類"
/>
</LinearLayout>
</LinearLayout>
<com.qmuiteam.qmui.alpha.QMUIAlphaImageButton
android:id=
"@+id/iv_category_delete"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:paddingLeft=
"@dimen/dp_5"
android:paddingRight=
"@dimen/dp_5"
android:layout_gravity=
"right|center_vertical"
android:src=
"@drawable/ic_red_circular_delete"
/>
</androidx.cardview.widget.CardView>
\ No newline at end of file
base-module/src/main/res/values/colors.xml
View file @
5b0327e5
...
...
@@ -473,6 +473,7 @@
<color
name=
"color_bf"
>
#BFBFBF
</color>
<color
name=
"color_da"
>
#DADADA
</color>
<color
name=
"color_68"
>
#686868
</color>
<color
name=
"color_42"
>
#424242
</color>
<color
name=
"color_222"
>
#222222
</color>
<color
name=
"tran_twenty_send_order_btn_bg_color"
>
#331196DB
</color>
<color
name=
"tran_fifty_order_state0_color"
>
#7F009788
</color>
...
...
@@ -527,4 +528,6 @@
<color
name=
"purchase_total_price_text_color"
>
#EC2D2D
</color>
<color
name=
"purchase_buy_again_color"
>
#6EC581
</color>
<color
name=
"dotted_color"
>
#9FA0A2
</color>
</resources>
\ No newline at end of file
base-module/src/main/res/values/styles.xml
View file @
5b0327e5
...
...
@@ -452,7 +452,7 @@
<style
name=
"Save_Btn_Style"
>
<item
name=
"android:layout_width"
>
match_parent
</item>
<item
name=
"android:layout_height"
>
wrap_content
</item>
<item
name=
"android:background"
>
@drawable/shape_app_btn
_small_radius
</item>
<item
name=
"android:background"
>
@drawable/shape_app_btn
</item>
<item
name=
"android:gravity"
>
center
</item>
<item
name=
"android:textColor"
>
@color/white
</item>
<item
name=
"android:textSize"
>
@dimen/dp_16
</item>
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/di/component/SendMsgComponent.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
di
.
component
;
import
dagger.BindsInstance
;
import
dagger.Component
;
import
com.jess.arms.di.component.AppComponent
;
import
com.gingersoft.supply_chain.di.module.SendMsgModule
;
import
com.gingersoft.supply_chain.mvp.contract.SendMsgContract
;
import
com.jess.arms.di.scope.FragmentScope
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.SendMsgFragment
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/08/2020 09:17
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component
(
modules
=
SendMsgModule
.
class
,
dependencies
=
AppComponent
.
class
)
public
interface
SendMsgComponent
{
void
inject
(
SendMsgFragment
fragment
);
@Component
.
Builder
interface
Builder
{
@BindsInstance
SendMsgComponent
.
Builder
view
(
SendMsgContract
.
View
view
);
SendMsgComponent
.
Builder
appComponent
(
AppComponent
appComponent
);
SendMsgComponent
build
();
}
}
\ No newline at end of file
supply-chain-module/src/main/java/com/gingersoft/supply_chain/di/component/StorageListComponent.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
di
.
component
;
import
dagger.BindsInstance
;
import
dagger.Component
;
import
com.jess.arms.di.component.AppComponent
;
import
com.gingersoft.supply_chain.di.module.StorageListModule
;
import
com.gingersoft.supply_chain.mvp.contract.StorageListContract
;
import
com.jess.arms.di.scope.FragmentScope
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.StorageListFragment
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/10/2020 18:09
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component
(
modules
=
StorageListModule
.
class
,
dependencies
=
AppComponent
.
class
)
public
interface
StorageListComponent
{
void
inject
(
StorageListFragment
fragment
);
@Component
.
Builder
interface
Builder
{
@BindsInstance
StorageListComponent
.
Builder
view
(
StorageListContract
.
View
view
);
StorageListComponent
.
Builder
appComponent
(
AppComponent
appComponent
);
StorageListComponent
build
();
}
}
\ No newline at end of file
supply-chain-module/src/main/java/com/gingersoft/supply_chain/di/module/SendMsgModule.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
di
.
module
;
import
com.jess.arms.di.scope.FragmentScope
;
import
dagger.Binds
;
import
dagger.Module
;
import
dagger.Provides
;
import
com.gingersoft.supply_chain.mvp.contract.SendMsgContract
;
import
com.gingersoft.supply_chain.mvp.model.SendMsgModel
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/08/2020 09:17
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public
abstract
class
SendMsgModule
{
@Binds
abstract
SendMsgContract
.
Model
bindSendMsgModel
(
SendMsgModel
model
);
}
\ No newline at end of file
supply-chain-module/src/main/java/com/gingersoft/supply_chain/di/module/StorageListModule.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
di
.
module
;
import
com.jess.arms.di.scope.FragmentScope
;
import
dagger.Binds
;
import
dagger.Module
;
import
dagger.Provides
;
import
com.gingersoft.supply_chain.mvp.contract.StorageListContract
;
import
com.gingersoft.supply_chain.mvp.model.StorageListModel
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/10/2020 18:09
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public
abstract
class
StorageListModule
{
@Binds
abstract
StorageListContract
.
Model
bindStorageListModel
(
StorageListModel
model
);
}
\ No newline at end of file
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/FoodByCategoryResultBean.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
;
import
java.util.List
;
import
lombok.Data
;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/9
* Time: 18:33
* Use: 根據分類獲取食材信息的接口返回數據
*/
@Data
public
class
FoodByCategoryResultBean
{
private
boolean
success
;
private
long
sysTime
;
private
String
errMsg
;
private
List
<
PurchaseFoodListVosBean
>
data
;
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/FoodCategoryResultBean.java
View file @
5b0327e5
...
...
@@ -52,6 +52,7 @@ public class FoodCategoryResultBean {
private
String
remarks
;
private
long
createTime
;
private
long
updateTime
;
private
int
deletes
;
/**
* 子類
*/
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/FoodInfoBean.java
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
;
import
java.util.List
;
import
lombok.Data
;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/1
* Time: 18:14
* Use:
* implements Commodity
*/
@Data
public
class
FoodInfoBean
{
private
int
brandId
;
private
int
restaurantId
;
private
String
foodNo
;
private
String
name
;
private
String
images
;
//供應商名稱
private
String
supplierName
;
private
String
foodCategoryName
;
private
Double
unitPrice
;
//是否需要審核
private
boolean
reviews
;
private
String
remarks
;
private
InventoryAlarm
inventoryAlarm
;
@Data
public
static
class
InventoryAlarm
{
//庫存預警,單位id
private
int
foodUnitId
;
//最低庫存
private
int
minimumInventory
;
}
//包裝規格
private
List
<
FoodPackingSpecificationBean
>
foodPackingSpecifications
;
}
//
package com.gingersoft.supply_chain.mvp.bean;
//
//
import java.util.List;
//
//
import lombok.Data;
//
/
//
**
//
* @author 宇航.
//
* User: admin
//
* Date: 2020/12/1
//
* Time: 18:14
//
* Use:
//
* implements Commodity
//
*/
//
@Data
//
public class FoodInfoBean {
//
private int brandId;
//
private int restaurantId;
//
private String foodNo;
//
private String name;
//
private String images;
//
//供應商名稱
//
private String supplierName;
//
private String foodCategoryName;
//
private Double unitPrice;
//
//是否需要審核
//
private boolean reviews;
//
private String remarks;
//
private InventoryAlarm inventoryAlarm;
//
@Data
//
public static class InventoryAlarm {
//
//庫存預警,單位id
//
private int foodUnitId;
//
//最低庫存
//
private int minimumInventory;
//
}
//
//包裝規格
//
private List<FoodPackingSpecificationBean> foodPackingSpecifications;
//
//
//
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/OrderBean.java
View file @
5b0327e5
...
...
@@ -13,9 +13,15 @@ import lombok.Data;
public
class
OrderBean
{
private
int
id
;
private
int
uid
;
private
int
orderNo
;
private
int
foodCount
;
private
String
orderNo
;
//訂單內的食品
private
String
name
;
private
int
purchaseFoodCount
;
private
double
totalAmount
;
private
int
status
;
private
int
createTime
;
private
boolean
visibleState
;
private
String
remarks
;
private
long
updateTime
;
private
long
createTime
;
private
int
deletes
;
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/OrderCategoryBean.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
;
import
java.util.List
;
import
lombok.Data
;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/8
* Time: 16:24
* Use: 下單頁面的分類
*/
@Data
public
class
OrderCategoryBean
{
private
boolean
success
;
private
long
sysTime
;
private
String
errMsg
;
private
List
<
FoodCategoryTrees
>
data
;
@Data
public
static
class
FoodCategoryTrees
{
private
int
id
;
private
String
name
;
private
int
parentId
;
private
List
<
FoodCategoryTrees
>
foodCategoryTrees
;
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/PurchaseFoodListVosBean.java
View file @
5b0327e5
...
...
@@ -2,6 +2,9 @@ package com.gingersoft.supply_chain.mvp.bean;
import
com.gingersoft.supply_chain.mvp.content.Constant
;
import
java.io.Serializable
;
import
java.util.List
;
import
lombok.Data
;
/**
...
...
@@ -12,7 +15,8 @@ import lombok.Data;
* Use:食材信息
*/
@Data
public
class
PurchaseFoodListVosBean
{
public
class
PurchaseFoodListVosBean
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7084280906070243339L
;
private
int
id
;
private
String
supplierName
;
private
String
images
;
...
...
@@ -20,6 +24,8 @@ public class PurchaseFoodListVosBean {
private
String
name
;
private
double
unitPrice
;
private
String
foodCategoryName
;
private
String
remarks
;
private
int
quantityStarts
;
private
int
quantityEnd
;
private
int
type
;
...
...
@@ -47,6 +53,20 @@ public class PurchaseFoodListVosBean {
*
*/
private
int
deletes
;
private
int
restaurantId
;
private
int
brandId
;
private
InventoryAlarm
inventoryAlarm
;
@Data
public
static
class
InventoryAlarm
{
//庫存預警,單位id
private
int
foodUnitId
;
//最低庫存
private
int
minimumInventory
;
}
//包裝規格
private
List
<
FoodPackingSpecificationBean
>
foodPackingSpecifications
;
public
boolean
isChecked
()
{
return
isChecked
;
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/bean/SupplierInfoBean.java
View file @
5b0327e5
...
...
@@ -32,9 +32,6 @@ public class SupplierInfoBean implements Serializable {
private
long
updateTime
;
private
int
deletes
;
public
static
final
int
DELETE
=
1
;
public
static
final
int
NORMAL
=
0
;
private
List
<
SupplierContacts
>
supplierContacts
;
public
SupplierInfoBean
(
String
supplierName
,
String
address
,
String
contactInformation
,
String
contacts
,
String
createDate
)
{
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/content/Constant.java
View file @
5b0327e5
...
...
@@ -16,9 +16,15 @@ public class Constant {
public
static
final
int
DELETE
=
1
;
public
static
final
int
NORMAL
=
0
;
public
static
void
mapAddInfo
(
Map
<
String
,
Object
>
map
){
map
.
put
(
"restaurantId"
,
ResturantInfoManager
.
newInstance
().
getRestaurantId
());
public
static
void
addBrandId
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"brandId"
,
ResturantInfoManager
.
newInstance
().
getBrandId
());
}
public
static
void
addRestaurantId
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"restaurantId"
,
ResturantInfoManager
.
newInstance
().
getRestaurantId
());
}
public
static
void
addPageSize
(
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"pageSize"
,
10
);
}
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/content/SupplyShoppingCart.java
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
content
;
import
android.util.Log
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodListVosBean
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Observable
;
/**
* @author 宇航.
...
...
@@ -12,7 +15,7 @@ import java.util.List;
* Time: 11:21
* Use: 供應鏈購物車,需要緩存用戶選中的食品
*/
public
class
SupplyShoppingCart
{
public
class
SupplyShoppingCart
extends
Observable
{
/**
* key為食品id
* value為食品信息
...
...
@@ -21,6 +24,8 @@ public class SupplyShoppingCart {
private
static
SupplyShoppingCart
shoppingCart
;
private
int
goodsNumber
=
0
;
public
static
SupplyShoppingCart
getInstance
()
{
if
(
shoppingCart
==
null
)
{
shoppingCart
=
new
SupplyShoppingCart
();
...
...
@@ -32,6 +37,10 @@ public class SupplyShoppingCart {
if
(
cartFoods
==
null
)
{
cartFoods
=
new
ArrayList
<>();
}
if
(
cartFoods
.
size
()
!=
goodsNumber
)
{
notifyObservers
(
cartFoods
.
size
());
goodsNumber
=
cartFoods
.
size
();
}
return
cartFoods
;
}
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/CategoryContract.java
View file @
5b0327e5
...
...
@@ -28,6 +28,8 @@ public interface CategoryContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
void
loadCategoryInfo
(
List
<
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
>
list
,
int
hierarchy
);
void
refreshInfo
(
int
hierarchy
,
int
position
);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...
...
@@ -35,5 +37,7 @@ public interface CategoryContract {
Observable
<
FoodCategoryResultBean
>
getFoodCategoryList
(
Map
<
String
,
Object
>
map
);
Observable
<
BaseResult
>
createFoodCategory
(
RequestBody
requestBody
);
Observable
<
BaseResult
>
updateFoodCategory
(
RequestBody
requestBody
);
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/FoodIngredientsContract.java
View file @
5b0327e5
...
...
@@ -2,7 +2,9 @@ package com.gingersoft.supply_chain.mvp.contract;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.ui.bean.view.CategoryBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodByCategoryResultBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodListInfoBean
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodListVosBean
;
import
com.jess.arms.mvp.IModel
;
import
com.jess.arms.mvp.IView
;
...
...
@@ -33,7 +35,21 @@ public interface FoodIngredientsContract {
void
loadRightFoodIngredients
(
List
<
PurchaseFoodListVosBean
>
purchaseFoodListVOS
);
/**
* 刪除食品成功回調
*
* @param position
*/
void
onDeleteFoodSuccess
(
int
position
);
/**
* 加載左側分類
*
* @param foodCategoryTrees 所有分類層級信息
*/
void
loadCategory
(
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
);
void
loadFail
();
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...
...
@@ -43,5 +59,9 @@ public interface FoodIngredientsContract {
Observable
<
BaseResult
>
getFoodBySupplierId
(
Map
<
String
,
Object
>
map
);
Observable
<
BaseResult
>
updateFood
(
RequestBody
requestBody
);
Observable
<
OrderCategoryBean
>
getCategoryTrees
(
Map
<
String
,
Object
>
map
);
Observable
<
FoodByCategoryResultBean
>
getFoodByCategory
(
Map
<
String
,
Object
>
map
);
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/NewFoodIngredientsContract.java
View file @
5b0327e5
...
...
@@ -29,6 +29,8 @@ public interface NewFoodIngredientsContract {
void
refreshAdapterByPosition
(
int
position
);
void
uploadPicSuccess
(
List
<
String
>
picUrl
);
void
saveFoodInfoSuccess
();
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/PurchaseListContract.java
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
contract
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.supply_chain.mvp.bean.OrderBean
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseOrderResultBean
;
import
com.jess.arms.mvp.IModel
;
...
...
@@ -9,6 +10,7 @@ import java.util.List;
import
java.util.Map
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
/**
...
...
@@ -27,10 +29,14 @@ public interface PurchaseListContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
void
loadOrderList
(
List
<
OrderBean
>
list
);
void
deleteOrder
(
int
position
);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
Observable
<
PurchaseOrderResultBean
>
getOrderList
(
Map
<
String
,
Object
>
map
);
Observable
<
BaseResult
>
updateOrder
(
RequestBody
requestBody
);
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/SendMsgContract.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
contract
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IModel
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/08/2020 09:17
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public
interface
SendMsgContract
{
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/contract/StorageListContract.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
contract
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IModel
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/10/2020 18:09
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public
interface
StorageListContract
{
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/model/CategoryModel.java
View file @
5b0327e5
...
...
@@ -60,4 +60,9 @@ public class CategoryModel extends BaseModel implements CategoryContract.Model {
public
Observable
<
BaseResult
>
createFoodCategory
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
addFoodCategory
(
requestBody
);
}
@Override
public
Observable
<
BaseResult
>
updateFoodCategory
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
updateFoodCategory
(
requestBody
);
}
}
\ No newline at end of file
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/model/FoodIngredientsModel.java
View file @
5b0327e5
...
...
@@ -3,7 +3,9 @@ package com.gingersoft.supply_chain.mvp.model;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.supply_chain.mvp.bean.FoodByCategoryResultBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodListInfoBean
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
com.gingersoft.supply_chain.mvp.contract.FoodIngredientsContract
;
import
com.gingersoft.supply_chain.mvp.server.SupplierServer
;
import
com.google.gson.Gson
;
...
...
@@ -65,4 +67,15 @@ public class FoodIngredientsModel extends BaseModel implements FoodIngredientsCo
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
updateFood
(
requestBody
);
}
@Override
public
Observable
<
OrderCategoryBean
>
getCategoryTrees
(
Map
<
String
,
Object
>
map
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
getCategoryTrees
(
map
);
}
@Override
public
Observable
<
FoodByCategoryResultBean
>
getFoodByCategory
(
Map
<
String
,
Object
>
map
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
getFoodByCategory
(
map
);
}
}
\ No newline at end of file
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/model/PurchaseListModel.java
View file @
5b0327e5
...
...
@@ -2,6 +2,7 @@ package com.gingersoft.supply_chain.mvp.model;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseOrderResultBean
;
import
com.gingersoft.supply_chain.mvp.contract.PurchaseListContract
;
import
com.gingersoft.supply_chain.mvp.server.SupplierServer
;
...
...
@@ -15,6 +16,7 @@ import java.util.Map;
import
javax.inject.Inject
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
/**
...
...
@@ -52,4 +54,9 @@ public class PurchaseListModel extends BaseModel implements PurchaseListContract
public
Observable
<
PurchaseOrderResultBean
>
getOrderList
(
Map
<
String
,
Object
>
map
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
getOrderList
(
map
);
}
@Override
public
Observable
<
BaseResult
>
updateOrder
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
SupplierServer
.
class
).
updateOrder
(
requestBody
);
}
}
\ No newline at end of file
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/model/SendMsgModel.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
model
;
import
android.app.Application
;
import
com.google.gson.Gson
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
com.jess.arms.di.scope.FragmentScope
;
import
javax.inject.Inject
;
import
com.gingersoft.supply_chain.mvp.contract.SendMsgContract
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/08/2020 09:17
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
public
class
SendMsgModel
extends
BaseModel
implements
SendMsgContract
.
Model
{
@Inject
Gson
mGson
;
@Inject
Application
mApplication
;
@Inject
public
SendMsgModel
(
IRepositoryManager
repositoryManager
)
{
super
(
repositoryManager
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
}
\ No newline at end of file
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/model/StorageListModel.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
model
;
import
android.app.Application
;
import
com.google.gson.Gson
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
com.jess.arms.di.scope.FragmentScope
;
import
javax.inject.Inject
;
import
com.gingersoft.supply_chain.mvp.contract.StorageListContract
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/10/2020 18:09
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
public
class
StorageListModel
extends
BaseModel
implements
StorageListContract
.
Model
{
@Inject
Gson
mGson
;
@Inject
Application
mApplication
;
@Inject
public
StorageListModel
(
IRepositoryManager
repositoryManager
)
{
super
(
repositoryManager
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
}
\ No newline at end of file
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/CategoryPresenter.java
View file @
5b0327e5
...
...
@@ -2,12 +2,12 @@ package com.gingersoft.supply_chain.mvp.presenter;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager
;
import
com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.supply_chain.mvp.bean.FoodCategoryResultBean
;
import
com.gingersoft.supply_chain.mvp.content.Constant
;
import
com.gingersoft.supply_chain.mvp.contract.CategoryContract
;
import
com.jess.arms.di.scope.FragmentScope
;
import
com.jess.arms.http.imageloader.ImageLoader
;
...
...
@@ -164,12 +164,7 @@ public class CategoryPresenter extends BasePresenter<CategoryContract.Model, Cat
}
public
void
addCategory
(
int
parentId
,
String
categoryName
,
int
hierarchy
)
{
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
foodCategoryBean
=
new
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
();
foodCategoryBean
.
setBrandId
(
ResturantInfoManager
.
newInstance
().
getBrandId
());
foodCategoryBean
.
setRestaurantId
(
ResturantInfoManager
.
newInstance
().
getRestaurantId
());
foodCategoryBean
.
setName
(
categoryName
);
foodCategoryBean
.
setParentId
(
parentId
);
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
foodCategoryBean
=
toFoodCategoryBean
(
parentId
,
categoryName
,
0
);
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
foodCategoryBean
));
mModel
.
createFoodCategory
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -194,4 +189,47 @@ public class CategoryPresenter extends BasePresenter<CategoryContract.Model, Cat
}
});
}
public
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
toFoodCategoryBean
(
int
parentId
,
String
categoryName
,
int
id
)
{
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
foodCategoryBean
=
new
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
();
foodCategoryBean
.
setBrandId
(
ResturantInfoManager
.
newInstance
().
getBrandId
());
foodCategoryBean
.
setRestaurantId
(
ResturantInfoManager
.
newInstance
().
getRestaurantId
());
foodCategoryBean
.
setName
(
categoryName
);
foodCategoryBean
.
setParentId
(
parentId
);
foodCategoryBean
.
setId
(
id
);
return
foodCategoryBean
;
}
public
void
deleteFoodCategory
(
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
foodCategoryBean
,
int
hierarchy
,
int
position
)
{
foodCategoryBean
.
setDeletes
(
Constant
.
DELETE
);
updateFoodCategory
(
foodCategoryBean
,
hierarchy
,
position
);
}
/**
* @param foodCategoryBean
* @param hierarchy 修改的是第幾級分類
* @param position 分類的位置
*/
public
void
updateFoodCategory
(
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
foodCategoryBean
,
int
hierarchy
,
int
position
)
{
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
foodCategoryBean
));
mModel
.
updateFoodCategory
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
"修改中..."
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
.
isSuccess
())
{
mRootView
.
refreshInfo
(
hierarchy
,
position
);
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
info
.
getErrMsg
()))
{
mRootView
.
showMessage
(
info
.
getErrMsg
());
}
else
{
mRootView
.
showMessage
(
"修改失敗"
);
}
}
});
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/FoodIngredientsPresenter.java
View file @
5b0327e5
...
...
@@ -7,7 +7,9 @@ import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.ui.bean.view.CategoryBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodByCategoryResultBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodListInfoBean
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodListVosBean
;
import
com.gingersoft.supply_chain.mvp.content.Constant
;
import
com.gingersoft.supply_chain.mvp.content.SupplyShoppingCart
;
...
...
@@ -62,6 +64,10 @@ public class FoodIngredientsPresenter extends BasePresenter<FoodIngredientsContr
* 如果通過在map中有食品,就不用再次調用接口
*/
private
Map
<
Integer
,
List
<
PurchaseFoodListVosBean
>>
supplierFoodsMap
;
/**
* 分類數據,之後通過分類獲取對應下面的食品
*/
private
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
;
@Inject
public
FoodIngredientsPresenter
(
FoodIngredientsContract
.
Model
model
,
FoodIngredientsContract
.
View
rootView
)
{
...
...
@@ -105,7 +111,7 @@ public class FoodIngredientsPresenter extends BasePresenter<FoodIngredientsContr
if
(
info
.
isSuccess
()
&&
info
.
getData
()
!=
null
)
{
List
<
CategoryBean
>
categoryBeans
=
new
ArrayList
<>();
if
(
supplierFoodsMap
==
null
)
{
supplierFoodsMap
=
new
HashMap
<>();
supplierFoodsMap
=
new
HashMap
<>(
5
);
}
for
(
FoodListInfoBean
.
DataBean
datum
:
info
.
getData
())
{
//將供應商信息轉為左側用來顯示的數據類型
...
...
@@ -214,20 +220,29 @@ public class FoodIngredientsPresenter extends BasePresenter<FoodIngredientsContr
cartFoods
.
addAll
(
integerMap
.
values
());
}
public
void
deleteFood
(
PurchaseFoodListVosBean
purchaseFoodListVosBean
,
int
position
){
/**
* 刪除食品
*
* @param purchaseFoodListVosBean
* @param position
*/
public
void
deleteFood
(
PurchaseFoodListVosBean
purchaseFoodListVosBean
,
int
position
)
{
purchaseFoodListVosBean
.
setDeletes
(
Constant
.
DELETE
);
purchaseFoodListVosBean
.
setRestaurantId
(
ResturantInfoManager
.
newInstance
().
getRestaurantId
());
purchaseFoodListVosBean
.
setBrandId
(
ResturantInfoManager
.
newInstance
().
getBrandId
());
mModel
.
updateFood
(
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
JsonUtils
.
toJson
(
purchaseFoodListVosBean
)))
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
"刪除中..."
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()->
mRootView
.
hideLoading
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
BaseResult
baseResult
)
{
if
(
baseResult
.
isSuccess
())
{
if
(
baseResult
.
isSuccess
())
{
mRootView
.
onDeleteFoodSuccess
(
position
);
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
baseResult
.
getErrMsg
()))
{
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
baseResult
.
getErrMsg
()))
{
mRootView
.
showMessage
(
baseResult
.
getErrMsg
());
}
else
{
mRootView
.
showMessage
(
"刪除失敗"
);
...
...
@@ -235,4 +250,68 @@ public class FoodIngredientsPresenter extends BasePresenter<FoodIngredientsContr
}
});
}
/**
* 獲取分類的結構
*/
public
void
getCategoryTrees
()
{
if
(
foodCategoryTrees
!=
null
)
{
mRootView
.
loadCategory
(
foodCategoryTrees
);
return
;
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
2
);
Constant
.
addBrandId
(
map
);
Constant
.
addRestaurantId
(
map
);
mModel
.
getCategoryTrees
(
map
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
"獲取中..."
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
OrderCategoryBean
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
OrderCategoryBean
orderCategoryBean
)
{
if
(
orderCategoryBean
.
isSuccess
())
{
foodCategoryTrees
=
new
ArrayList
<>();
foodCategoryTrees
.
addAll
(
orderCategoryBean
.
getData
());
mRootView
.
loadCategory
(
orderCategoryBean
.
getData
());
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
orderCategoryBean
.
getErrMsg
()))
{
mRootView
.
showMessage
(
orderCategoryBean
.
getErrMsg
());
}
else
{
mRootView
.
showMessage
(
"獲取失敗,請稍候重試"
);
}
}
});
}
public
void
getFoodByCategory
(
int
categoryId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
5
);
map
.
put
(
"pageSize"
,
1000
);
map
.
put
(
"pageIndex"
,
0
);
Constant
.
addBrandId
(
map
);
Constant
.
addRestaurantId
(
map
);
map
.
put
(
"parentId"
,
categoryId
);
mModel
.
getFoodByCategory
(
map
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
"獲取中..."
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
FoodByCategoryResultBean
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
FoodByCategoryResultBean
info
)
{
if
(
info
.
isSuccess
())
{
mRootView
.
loadRightFoodIngredients
(
info
.
getData
());
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
info
.
getErrMsg
()))
{
mRootView
.
showMessage
(
info
.
getErrMsg
());
mRootView
.
loadFail
();
}
else
{
mRootView
.
loadFail
();
}
}
});
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/NewFoodIngredientsPresenter.java
View file @
5b0327e5
...
...
@@ -11,10 +11,11 @@ import com.gingersoft.gsa.cloud.common.ui.bean.InfoMultiBean;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.common.utils.view.BitmapUtil
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionCheckItem
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.mvp.bean.FoodInfoBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodPackingSpecificationBean
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodListVosBean
;
import
com.gingersoft.supply_chain.mvp.bean.SupplierInfoBean
;
import
com.gingersoft.supply_chain.mvp.contract.NewFoodIngredientsContract
;
import
com.gingersoft.supply_chain.mvp.ui.fragment.CategorySelectFragment
;
...
...
@@ -28,6 +29,7 @@ import com.jess.arms.utils.RxLifecycleUtils;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
javax.inject.Inject
;
...
...
@@ -98,7 +100,7 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
this
.
mApplication
=
null
;
}
public
List
<
InfoMultiBean
>
getFragmentInfo
()
{
public
List
<
InfoMultiBean
>
getFragmentInfo
(
PurchaseFoodListVosBean
purchaseFoodListVosBean
)
{
List
<
InfoMultiBean
>
infoMultiBeans
=
new
ArrayList
<>();
infoMultiBeans
.
add
(
new
InfoMultiBean
(
InfoMultiBean
.
ITEM_TYPE_LINE
));
infoMultiBeans
.
add
(
new
InfoMultiBean
(
InfoMultiBean
.
ITEM_TYPE_TITLE
,
"商品圖片"
));
...
...
@@ -118,9 +120,31 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
infoMultiBeans
.
add
(
new
InfoMultiBean
(
InfoMultiBean
.
ITEM_TYPE_LINE
));
infoMultiBeans
.
add
(
new
InfoMultiBean
(
InfoMultiBean
.
ITEM_TYPE_TITLE
,
"備註"
));
infoMultiBeans
.
add
(
new
MultiInputBean
(
InfoMultiBean
.
ITEM_MULTIPLE_INPUT_REMARK
,
""
,
false
,
"請輸入備註"
));
if
(
purchaseFoodListVosBean
!=
null
)
{
infoMultiBeans
.
get
(
supplierIndex
).
setShowValue
(
purchaseFoodListVosBean
.
getSupplierName
());
infoMultiBeans
.
get
(
foodNameIndex
).
setShowValue
(
purchaseFoodListVosBean
.
getName
());
infoMultiBeans
.
get
(
packageSpecificationIndex
).
setShowValue
(
purchaseFoodListVosBean
.
getUnitContent
());
infoMultiBeans
.
get
(
foodNoIndex
).
setShowValue
(
purchaseFoodListVosBean
.
getFoodNo
());
infoMultiBeans
.
get
(
foodIngredientCategoryIndex
).
setShowValue
(
"選擇分類"
);
infoMultiBeans
.
get
(
foodIngredientPriceIndex
).
setShowValue
(
purchaseFoodListVosBean
.
getUnitPrice
()
+
""
);
infoMultiBeans
.
get
(
inventoryAlarmUnitIndex
).
setShowValue
(
"收貨單位"
);
infoMultiBeans
.
get
(
mixInventoryIndex
).
setShowValue
(
"1"
);
infoMultiBeans
.
get
(
remarkIndex
).
setShowValue
(
"備註"
);
setPicUrl
(
infoMultiBeans
,
Collections
.
singletonList
(
purchaseFoodListVosBean
.
getImages
()));
}
return
infoMultiBeans
;
}
public
void
setPicUrl
(
List
<
InfoMultiBean
>
data
,
List
<
String
>
picUrls
)
{
InfoMultiBean
infoMultiBean
=
data
.
get
(
picIndex
);
if
(
infoMultiBean
instanceof
UploadPicMultiBean
)
{
UploadPicMultiBean
uploadPicMultiBean
=
(
UploadPicMultiBean
)
infoMultiBean
;
uploadPicMultiBean
.
setPicUrl
(
picUrls
);
mRootView
.
refreshAdapterByPosition
(
picIndex
);
}
}
/**
* 設置供應商信息
*
...
...
@@ -162,11 +186,7 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
}
public
void
uploadPic
(
String
filePath
)
{
File
file
=
new
File
(
filePath
);
if
(
file
.
length
()
>
100
*
1024
)
{
mRootView
.
showMessage
(
"請選擇100k以內大小的圖片"
);
return
;
}
File
file
=
new
File
(
BitmapUtil
.
compressImage
(
filePath
));
List
<
MultipartBody
.
Part
>
multipartBodies
=
new
ArrayList
<>();
multipartBodies
.
add
(
MultipartBody
.
Part
.
createFormData
(
"files"
,
file
.
getName
(),
RequestBody
.
create
(
MediaType
.
parse
(
"image/png"
),
file
)));
mModel
.
upLoadPic
(
multipartBodies
)
...
...
@@ -193,10 +213,10 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
/**
* 添加食品
*
* @param
foodInfo
Bean
* @param
purchaseFoodListVos
Bean
*/
public
void
addFoodInfo
(
FoodInfoBean
foodInfo
Bean
)
{
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
foodInfo
Bean
));
public
void
addFoodInfo
(
PurchaseFoodListVosBean
purchaseFoodListVos
Bean
)
{
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
purchaseFoodListVos
Bean
));
mModel
.
addFood
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
"保存中..."
))
...
...
@@ -209,7 +229,7 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
public
void
onNext
(
BaseResult
baseResult
)
{
if
(
baseResult
.
isSuccess
())
{
mRootView
.
showMessage
(
"保存成功"
);
mRootView
.
killMyself
();
mRootView
.
saveFoodInfoSuccess
();
}
else
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
baseResult
.
getErrMsg
()))
{
mRootView
.
showMessage
(
baseResult
.
getErrMsg
());
}
else
{
...
...
@@ -236,8 +256,8 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
return
msg
;
}
public
FoodInfo
Bean
getFoodInfoByInfoMulti
(
List
<
InfoMultiBean
>
infoMultiBeans
)
{
FoodInfoBean
foodInfoBean
=
new
FoodInfo
Bean
();
public
PurchaseFoodListVos
Bean
getFoodInfoByInfoMulti
(
List
<
InfoMultiBean
>
infoMultiBeans
)
{
PurchaseFoodListVosBean
foodInfoBean
=
new
PurchaseFoodListVos
Bean
();
foodInfoBean
.
setBrandId
(
ResturantInfoManager
.
newInstance
().
getBrandId
());
foodInfoBean
.
setRestaurantId
(
ResturantInfoManager
.
newInstance
().
getRestaurantId
());
foodInfoBean
.
setFoodNo
(
infoMultiBeans
.
get
(
foodNoIndex
).
getShowValue
());
...
...
@@ -250,7 +270,7 @@ public class NewFoodIngredientsPresenter extends BasePresenter<NewFoodIngredient
foodInfoBean
.
setUnitPrice
(
Double
.
parseDouble
(
infoMultiBeans
.
get
(
foodIngredientPriceIndex
).
getShowValue
()));
// foodInfoBean.setReviews("是否需要審核");
foodInfoBean
.
setRemarks
(
infoMultiBeans
.
get
(
remarkIndex
).
getShowValue
());
FoodInfoBean
.
InventoryAlarm
inventoryAlarm
=
new
FoodInfo
Bean
.
InventoryAlarm
();
PurchaseFoodListVosBean
.
InventoryAlarm
inventoryAlarm
=
new
PurchaseFoodListVos
Bean
.
InventoryAlarm
();
// inventoryAlarm.setFoodUnitId();
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
infoMultiBeans
.
get
(
mixInventoryIndex
).
getShowValue
()))
{
inventoryAlarm
.
setMinimumInventory
(
Integer
.
parseInt
(
infoMultiBeans
.
get
(
mixInventoryIndex
).
getShowValue
()));
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/PurchaseListPresenter.java
View file @
5b0327e5
...
...
@@ -2,7 +2,10 @@ package com.gingersoft.supply_chain.mvp.presenter;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.supply_chain.mvp.bean.OrderBean
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseOrderResultBean
;
import
com.gingersoft.supply_chain.mvp.content.Constant
;
import
com.gingersoft.supply_chain.mvp.contract.PurchaseListContract
;
...
...
@@ -22,6 +25,8 @@ import io.reactivex.annotations.NonNull;
import
io.reactivex.schedulers.Schedulers
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
/**
...
...
@@ -54,7 +59,10 @@ public class PurchaseListPresenter extends BasePresenter<PurchaseListContract.Mo
public
void
getOrderList
(
String
orderNo
,
int
orderStatus
,
int
pageIndex
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
6
);
Constant
.
mapAddInfo
(
map
);
Constant
.
addRestaurantId
(
map
);
Constant
.
addBrandId
(
map
);
Constant
.
addPageSize
(
map
);
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
orderNo
))
{
map
.
put
(
"orderNo"
,
orderNo
);
}
...
...
@@ -78,4 +86,25 @@ public class PurchaseListPresenter extends BasePresenter<PurchaseListContract.Mo
}
});
}
public
void
deleteOrder
(
int
position
,
OrderBean
orderBean
){
orderBean
.
setDeletes
(
Constant
.
DELETE
);
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
orderBean
));
mModel
.
updateOrder
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
"獲取中..."
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
.
isSuccess
()){
mRootView
.
deleteOrder
(
position
);
}
}
});
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/SendMsgPresenter.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
presenter
;
import
android.app.Application
;
import
com.gingersoft.supply_chain.mvp.contract.SendMsgContract
;
import
com.jess.arms.di.scope.FragmentScope
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.mvp.BasePresenter
;
import
javax.inject.Inject
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/08/2020 09:17
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
public
class
SendMsgPresenter
extends
BasePresenter
<
SendMsgContract
.
Model
,
SendMsgContract
.
View
>
{
@Inject
RxErrorHandler
mErrorHandler
;
@Inject
Application
mApplication
;
@Inject
ImageLoader
mImageLoader
;
@Inject
AppManager
mAppManager
;
@Inject
public
SendMsgPresenter
(
SendMsgContract
.
Model
model
,
SendMsgContract
.
View
rootView
)
{
super
(
model
,
rootView
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mErrorHandler
=
null
;
this
.
mAppManager
=
null
;
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/presenter/StorageListPresenter.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
presenter
;
import
android.app.Application
;
import
com.gingersoft.supply_chain.mvp.contract.StorageListContract
;
import
com.jess.arms.di.scope.FragmentScope
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.mvp.BasePresenter
;
import
javax.inject.Inject
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/10/2020 18:09
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
public
class
StorageListPresenter
extends
BasePresenter
<
StorageListContract
.
Model
,
StorageListContract
.
View
>
{
@Inject
RxErrorHandler
mErrorHandler
;
@Inject
Application
mApplication
;
@Inject
ImageLoader
mImageLoader
;
@Inject
AppManager
mAppManager
;
@Inject
public
StorageListPresenter
(
StorageListContract
.
Model
model
,
StorageListContract
.
View
rootView
)
{
super
(
model
,
rootView
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mErrorHandler
=
null
;
this
.
mAppManager
=
null
;
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
}
/**
* 獲取入庫單列表
*/
public
void
getStorageList
(){
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/server/SupplierServer.java
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
server
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.supply_chain.mvp.bean.FoodByCategoryResultBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodCategoryResultBean
;
import
com.gingersoft.supply_chain.mvp.bean.FoodListInfoBean
;
import
com.gingersoft.supply_chain.mvp.bean.MeasurementUnitBean
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseOrderResultBean
;
import
com.gingersoft.supply_chain.mvp.bean.SupplierResultBean
;
...
...
@@ -113,6 +115,15 @@ public interface SupplierServer {
Observable
<
BaseResult
>
addFoodCategory
(
@Body
RequestBody
requestBody
);
/**
* 修改分類
* @param requestBody
* @return
*/
@Headers
({
"Domain-Name: ricepon-purchase"
})
@POST
(
"foodCategory/update"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
updateFoodCategory
(
@Body
RequestBody
requestBody
);
/**
* 上傳圖片
* @param parts
* @return
...
...
@@ -167,8 +178,24 @@ public interface SupplierServer {
@GET
(
"purchaseOrder/list"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
PurchaseOrderResultBean
>
getOrderList
(
@QueryMap
Map
<
String
,
Object
>
map
);
/**
* 修改採購單信息
* @param requestBody
* @return
*/
@Headers
({
"Domain-Name: ricepon-purchase"
})
@POST
(
"purchaseOrder/update"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
updateOrder
(
@Body
RequestBody
requestBody
);
/**
* 獲取下單頁面的分類結構
* @param map
* @return
*/
@Headers
({
"Domain-Name: ricepon-purchase"
})
@GET
(
"foodCategory/tree/get"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
OrderCategoryBean
>
getCategoryTrees
(
@QueryMap
Map
<
String
,
Object
>
map
);
/**
* 新增採購訂單
* @param requestBody
* @return
...
...
@@ -176,4 +203,13 @@ public interface SupplierServer {
@Headers
({
"Domain-Name: ricepon-purchase"
})
@POST
(
"purchaseOrder/add"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
addNewPurchaseOrder
(
@Body
RequestBody
requestBody
);
/**
* 獲取下單頁面的分類結構
* @param map
* @return
*/
@Headers
({
"Domain-Name: ricepon-purchase"
})
@GET
(
"foodCategory/subset/get"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
FoodByCategoryResultBean
>
getFoodByCategory
(
@QueryMap
Map
<
String
,
Object
>
map
);
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/FoodListAdapter.java
View file @
5b0327e5
...
...
@@ -3,6 +3,7 @@ package com.gingersoft.supply_chain.mvp.ui.adapter;
import
android.content.Context
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.view.View
;
import
android.widget.CheckBox
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
...
...
@@ -56,12 +57,22 @@ public class FoodListAdapter extends BaseQuickAdapter<PurchaseFoodListVosBean, B
integerMap
=
new
HashMap
<>(
8
);
}
public
FoodListAdapter
(
int
layoutId
,
Context
context
,
@Nullable
List
<
PurchaseFoodListVosBean
>
data
,
int
adapterType
)
{
super
(
layoutId
,
data
);
addChildClickViewIds
(
R
.
id
.
iv_supplier_edit
,
R
.
id
.
iv_supplier_delete
,
R
.
id
.
iv_order_food_delete
);
this
.
context
=
context
;
this
.
adapterType
=
adapterType
;
integerMap
=
new
HashMap
<>(
8
);
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
PurchaseFoodListVosBean
foodInfoBean
)
{
viewHolder
.
setText
(
R
.
id
.
tv_food_item_supplier_name
,
foodInfoBean
.
getSupplierName
());
ImageView
foodImg
=
viewHolder
.
getView
(
R
.
id
.
iv_food_ingredient_img
);
if
(
TextUtil
.
isNotEmptyOrNullOrUndefined
(
foodInfoBean
.
getImages
()))
{
GlideUtils
.
display
(
context
,
foodImg
,
foodInfoBean
.
getImages
());
}
else
{
foodImg
.
setVisibility
(
View
.
INVISIBLE
);
}
viewHolder
.
setText
(
R
.
id
.
tv_food_item_no
,
foodInfoBean
.
getFoodNo
());
viewHolder
.
setText
(
R
.
id
.
tv_food_item_name
,
foodInfoBean
.
getName
());
...
...
@@ -70,27 +81,21 @@ public class FoodListAdapter extends BaseQuickAdapter<PurchaseFoodListVosBean, B
if
(
adapterType
==
FOOD_INGREDIENTS
)
{
viewHolder
.
setGone
(
R
.
id
.
iv_supplier_edit
,
false
);
viewHolder
.
setGone
(
R
.
id
.
iv_supplier_delete
,
false
);
viewHolder
.
setGone
(
R
.
id
.
layout_food_supplier_info
,
false
);
viewHolder
.
setGone
(
R
.
id
.
layout_operation_food_num
,
true
);
viewHolder
.
setGone
(
R
.
id
.
cb_order_item_all_select
,
true
);
viewHolder
.
setGone
(
R
.
id
.
iv_order_food_delete
,
true
);
viewHolder
.
setGone
(
R
.
id
.
line_supplier_info
,
false
);
}
else
if
(
adapterType
==
ADD_ORDER
)
{
viewHolder
.
setGone
(
R
.
id
.
iv_supplier_edit
,
true
);
viewHolder
.
setGone
(
R
.
id
.
iv_supplier_delete
,
true
);
viewHolder
.
setGone
(
R
.
id
.
layout_operation_food_num
,
false
);
viewHolder
.
setGone
(
R
.
id
.
layout_food_supplier_info
,
false
);
viewHolder
.
setGone
(
R
.
id
.
cb_order_item_all_select
,
true
);
viewHolder
.
setGone
(
R
.
id
.
iv_order_food_delete
,
true
);
viewHolder
.
setGone
(
R
.
id
.
line_supplier_info
,
false
);
setEdit
(
viewHolder
,
foodInfoBean
);
}
else
if
(
adapterType
==
ORDER_TYPE
)
{
viewHolder
.
setGone
(
R
.
id
.
iv_supplier_edit
,
false
);
viewHolder
.
setGone
(
R
.
id
.
iv_supplier_delete
,
false
);
viewHolder
.
setGone
(
R
.
id
.
layout_operation_food_num
,
false
);
viewHolder
.
setGone
(
R
.
id
.
layout_food_supplier_info
,
true
);
viewHolder
.
setGone
(
R
.
id
.
cb_order_item_all_select
,
false
);
viewHolder
.
setGone
(
R
.
id
.
iv_order_food_delete
,
false
);
viewHolder
.
setGone
(
R
.
id
.
line_supplier_info
,
true
);
setEdit
(
viewHolder
,
foodInfoBean
);
CheckBox
checkBox
=
viewHolder
.
getView
(
R
.
id
.
cb_order_item_all_select
);
...
...
@@ -105,6 +110,7 @@ public class FoodListAdapter extends BaseQuickAdapter<PurchaseFoodListVosBean, B
private
OnCheckedChangeListener
onCheckedChangeListener
;
private
OnNumberChangeListener
onNumberChangeListener
;
private
TextWatcher
foodNumTextWatcher
;
public
interface
OnCheckedChangeListener
{
/**
...
...
@@ -123,8 +129,9 @@ public class FoodListAdapter extends BaseQuickAdapter<PurchaseFoodListVosBean, B
*
* @param foodId 食品ID
* @param number 食品數量
* @param position 操作的食品下標
*/
void
onChanged
(
int
foodId
,
int
number
);
void
onChanged
(
int
foodId
,
int
number
,
int
position
);
}
public
void
setOnCheckedChangeListener
(
OnCheckedChangeListener
onCheckedChangeListener
)
{
...
...
@@ -167,7 +174,7 @@ public class FoodListAdapter extends BaseQuickAdapter<PurchaseFoodListVosBean, B
// addNumber(editText, foodInfoBean);
// return true;
// });
editText
.
addTextChangedListener
(
new
TextWatcher
()
{
foodNumTextWatcher
=
new
TextWatcher
()
{
@Override
public
void
beforeTextChanged
(
CharSequence
s
,
int
start
,
int
count
,
int
after
)
{
...
...
@@ -186,17 +193,19 @@ public class FoodListAdapter extends BaseQuickAdapter<PurchaseFoodListVosBean, B
editText
.
setText
(
String
.
valueOf
(
0
));
editText
.
setSelection
(
editText
.
getText
().
length
());
if
(
onNumberChangeListener
!=
null
)
{
onNumberChangeListener
.
onChanged
(
purchaseFoodListVosBean
.
getId
(),
0
);
onNumberChangeListener
.
onChanged
(
purchaseFoodListVosBean
.
getId
(),
0
,
viewHolder
.
getAdapterPosition
()
);
}
}
else
{
purchaseFoodListVosBean
.
setFoodCount
(
Integer
.
parseInt
(
s
.
toString
()));
integerMap
.
put
(
purchaseFoodListVosBean
.
getId
(),
purchaseFoodListVosBean
);
if
(
onNumberChangeListener
!=
null
)
{
onNumberChangeListener
.
onChanged
(
purchaseFoodListVosBean
.
getId
(),
Integer
.
parseInt
(
s
.
toString
()));
onNumberChangeListener
.
onChanged
(
purchaseFoodListVosBean
.
getId
(),
Integer
.
parseInt
(
s
.
toString
())
,
viewHolder
.
getAdapterPosition
()
);
}
}
}
});
};
editText
.
removeTextChangedListener
(
foodNumTextWatcher
);
editText
.
addTextChangedListener
(
foodNumTextWatcher
);
}
public
void
setOnNumberChangeListener
(
OnNumberChangeListener
onNumberChangeListener
)
{
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/OrderCategoryAdapter.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.view.View
;
import
androidx.cardview.widget.CardView
;
import
androidx.core.content.ContextCompat
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
java.util.List
;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/8
* Time: 16:19
* Use:
*/
public
class
OrderCategoryAdapter
extends
BaseQuickAdapter
<
OrderCategoryBean
.
FoodCategoryTrees
,
BaseViewHolder
>
{
private
int
selectIndex
=
-
1
;
private
Context
context
;
private
int
lastSelectIndex
=
-
1
;
public
final
int
PRIMARY_CATEGORY
=
1
;
public
final
int
SECOND_CATEGORY
=
2
;
/**
* 當前顯示的是幾級分類
*/
private
int
currentLevelCategory
=
PRIMARY_CATEGORY
;
public
OrderCategoryAdapter
(
Context
context
,
@Nullable
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
data
)
{
super
(
R
.
layout
.
item_order_category
,
data
);
this
.
context
=
context
;
addChildClickViewIds
(
R
.
id
.
layout_order_category_back
);
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTrees
)
{
viewHolder
.
setText
(
R
.
id
.
tv_category_name
,
foodCategoryTrees
.
getName
());
viewHolder
.
setGone
(
R
.
id
.
order_primary_category_line
,
viewHolder
.
getAdapterPosition
()
==
selectIndex
);
RecyclerView
rvSecondCategory
=
viewHolder
.
getView
(
R
.
id
.
rv_order_second_category
);
CardView
bgLayout
=
viewHolder
.
getView
(
R
.
id
.
layout_category
);
//是否顯示返回鍵
if
(
viewHolder
.
getAdapterPosition
()
==
0
)
{
viewHolder
.
setGone
(
R
.
id
.
layout_order_category_back
,
currentLevelCategory
==
PRIMARY_CATEGORY
);
}
else
{
viewHolder
.
setGone
(
R
.
id
.
layout_order_category_back
,
true
);
}
if
(
selectIndex
==
viewHolder
.
getAdapterPosition
())
{
//選中並且有子類
if
(
foodCategoryTrees
.
getFoodCategoryTrees
()
!=
null
&&
foodCategoryTrees
.
getFoodCategoryTrees
().
size
()
>
0
)
{
viewHolder
.
setGone
(
R
.
id
.
order_primary_category_line
,
false
);
//設置子類的數據
SecondAdapter
secondAdapter
=
new
SecondAdapter
(
context
,
foodCategoryTrees
.
getFoodCategoryTrees
());
rvSecondCategory
.
setAdapter
(
secondAdapter
);
rvSecondCategory
.
setVisibility
(
View
.
VISIBLE
);
secondAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
//二級分類被點擊時,重新設置一級的數據,二級變為一級,三級變成二級
secondAdapter
.
setSelectedIndex
(
position
);
if
(
onSecondCategoryClickListener
!=
null
)
{
onSecondCategoryClickListener
.
onClick
(
getData
().
get
(
viewHolder
.
getAdapterPosition
()).
getFoodCategoryTrees
(),
position
);
}
});
}
else
{
rvSecondCategory
.
setAdapter
(
null
);
viewHolder
.
setGone
(
R
.
id
.
order_primary_category_line
,
true
);
}
viewHolder
.
setTextColor
(
R
.
id
.
tv_category_name
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
order_category_name_select_color
));
bgLayout
.
setBackground
(
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
shape_left_radio_shadow
));
}
else
{
//隱藏豎線
viewHolder
.
setGone
(
R
.
id
.
order_primary_category_line
,
true
);
viewHolder
.
setTextColor
(
R
.
id
.
tv_category_name
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
order_category_name_unselect_color
));
//沒有被選中時,去掉背景,去掉子類
bgLayout
.
setBackground
(
null
);
rvSecondCategory
.
setVisibility
(
View
.
GONE
);
rvSecondCategory
.
setAdapter
(
null
);
}
}
public
void
setSelectIndex
(
int
selectIndex
)
{
this
.
selectIndex
=
selectIndex
;
if
(
lastSelectIndex
!=
-
1
&&
lastSelectIndex
<
getData
().
size
())
{
notifyItemChanged
(
lastSelectIndex
);
}
if
(
selectIndex
!=
-
1
&&
selectIndex
<
getData
().
size
())
{
notifyItemChanged
(
selectIndex
);
}
lastSelectIndex
=
selectIndex
;
}
public
OnSecondCategoryClickListener
onSecondCategoryClickListener
;
public
interface
OnSecondCategoryClickListener
{
void
onClick
(
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
,
int
position
);
}
public
void
setOnSecondCategoryClickListener
(
OnSecondCategoryClickListener
onSecondCategoryClickListener
)
{
this
.
onSecondCategoryClickListener
=
onSecondCategoryClickListener
;
}
public
int
getSelectIndex
()
{
return
selectIndex
;
}
public
int
getCurrentLevelCategory
()
{
return
currentLevelCategory
;
}
public
void
setCurrentLevelCategory
(
int
currentLevelCategory
)
{
this
.
currentLevelCategory
=
currentLevelCategory
;
}
public
static
class
SecondAdapter
extends
BaseQuickAdapter
<
OrderCategoryBean
.
FoodCategoryTrees
,
BaseViewHolder
>
{
private
int
selectedIndex
=
-
1
;
private
int
lastSelectIndex
=
-
1
;
private
Context
context
;
public
SecondAdapter
(
Context
context
,
@Nullable
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
data
)
{
super
(
R
.
layout
.
item_order_second_category
,
data
);
this
.
context
=
context
;
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
OrderCategoryBean
.
FoodCategoryTrees
foodCategoryTrees
)
{
viewHolder
.
setText
(
R
.
id
.
tv_order_second_category_name
,
foodCategoryTrees
.
getName
());
if
(
selectedIndex
==
viewHolder
.
getAdapterPosition
())
{
viewHolder
.
setTextColor
(
R
.
id
.
tv_order_second_category_name
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
white
));
viewHolder
.
setBackgroundColor
(
R
.
id
.
layout_second_category
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
theme_color
));
}
else
{
viewHolder
.
setTextColor
(
R
.
id
.
tv_order_second_category_name
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
order_category_name_unselect_color
));
viewHolder
.
setBackgroundColor
(
R
.
id
.
layout_second_category
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
trans
));
}
viewHolder
.
setVisible
(
R
.
id
.
order_category_second_bottom_line
,
viewHolder
.
getAdapterPosition
()
!=
getData
().
size
()
-
1
);
}
public
void
setSelectedIndex
(
int
selectedIndex
)
{
this
.
selectedIndex
=
selectedIndex
;
if
(
lastSelectIndex
!=
-
1
&&
lastSelectIndex
<
getData
().
size
())
{
notifyItemChanged
(
lastSelectIndex
);
}
if
(
selectedIndex
!=
-
1
&&
selectedIndex
<
getData
().
size
())
{
notifyItemChanged
(
selectedIndex
);
}
lastSelectIndex
=
selectedIndex
;
}
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/PurchaseOrderAdapter.java
View file @
5b0327e5
...
...
@@ -22,16 +22,15 @@ public class PurchaseOrderAdapter extends BaseQuickAdapter<OrderBean, BaseViewHo
public
PurchaseOrderAdapter
(
@Nullable
List
<
OrderBean
>
data
)
{
super
(
R
.
layout
.
item_purchase_order
,
data
);
addChildClickViewIds
(
R
.
id
.
btn_purchase_send
,
R
.
id
.
btn_purchase_buy_again
,
R
.
id
.
btn_receiver_goods
);
addChildClickViewIds
(
R
.
id
.
iv_supplier_delete
,
R
.
id
.
btn_purchase_send
,
R
.
id
.
btn_purchase_buy_again
,
R
.
id
.
btn_receiver_goods
);
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
OrderBean
purchaseOrderBean
)
{
viewHolder
.
setText
(
R
.
id
.
tv_purchase_order_no
,
""
+
purchaseOrderBean
.
getOrderNo
());
viewHolder
.
setText
(
R
.
id
.
tv_purchase_order_create_time
,
TimeUtils
.
getTime
(
purchaseOrderBean
.
getCreateTime
(),
TimeUtils
.
DEFAULT_DATE_FORMAT_YMDHM
));
viewHolder
.
setText
(
R
.
id
.
tv_purchase_order_goods_num
,
purchaseOrderBean
.
getFoodCount
()
+
""
);
// viewHolder.setText(R.id.tv_purchase_order_goods, purchaseOrderBean.getFoods
());
viewHolder
.
setText
(
R
.
id
.
tv_purchase_order_goods_num
,
purchaseOrderBean
.
get
Purchase
FoodCount
()
+
""
);
viewHolder
.
setText
(
R
.
id
.
tv_purchase_order_goods
,
purchaseOrderBean
.
getName
());
viewHolder
.
setText
(
R
.
id
.
tv_purchase_order_total_price
,
purchaseOrderBean
.
getTotalAmount
()
+
""
);
// viewHolder.setText(R.id.tv_purchase_order_time_out, purchaseOrderBean.getTotal() + "");
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/PurchasePageAdapter.java
View file @
5b0327e5
...
...
@@ -31,11 +31,11 @@ import com.gingersoft.supply_chain.R;
*/
public
class
PurchasePageAdapter
extends
RecyclerView
.
Adapter
<
PurchasePageAdapter
.
ViewHolder
>
{
private
PurchaseOrder
Adapter
adapter
;
private
RecyclerView
.
Adapter
adapter
;
private
int
pageSize
;
private
AdapterView
.
OnItemClickListener
mOnItemClickListener
;
public
PurchasePageAdapter
(
PurchaseOrder
Adapter
adapter
,
int
pageSize
)
{
public
PurchasePageAdapter
(
RecyclerView
.
Adapter
adapter
,
int
pageSize
)
{
this
.
adapter
=
adapter
;
this
.
pageSize
=
pageSize
;
}
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/SecondCategoryAdapter.java
View file @
5b0327e5
...
...
@@ -29,9 +29,11 @@ public class SecondCategoryAdapter extends BaseQuickAdapter<FoodCategoryResultBe
private
int
checkedTextColor
;
private
int
unCheckedTextColor
;
private
boolean
showDelete
=
false
;
public
SecondCategoryAdapter
(
@Nullable
List
<
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
>
data
)
{
super
(
R
.
layout
.
item_second_category
,
data
);
addChildClickViewIds
(
R
.
id
.
iv_category_delete
);
}
@Override
...
...
@@ -54,6 +56,16 @@ public class SecondCategoryAdapter extends BaseQuickAdapter<FoodCategoryResultBe
tvName
.
setTextColor
(
unCheckedTextColor
);
}
}
if
(
viewHolder
.
getAdapterPosition
()
==
0
)
{
viewHolder
.
setGone
(
R
.
id
.
iv_category_delete
,
true
);
}
else
{
viewHolder
.
setGone
(
R
.
id
.
iv_category_delete
,
!
showDelete
);
}
}
public
void
setShowDelete
(
boolean
showDelete
)
{
this
.
showDelete
=
showDelete
;
notifyDataSetChanged
();
}
public
SecondCategoryAdapter
setCheckedBg
(
Drawable
checkedBg
)
{
...
...
@@ -86,7 +98,7 @@ public class SecondCategoryAdapter extends BaseQuickAdapter<FoodCategoryResultBe
return
selectIndex
;
}
public
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
getSelectData
(){
public
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
getSelectData
()
{
return
getData
().
get
(
selectIndex
);
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/ShoppingCartAdapter.java
View file @
5b0327e5
...
...
@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.common.ui.recylcler.decorator.DividerItemDecoration
;
import
com.gingersoft.gsa.cloud.common.ui.utils.AppDialog
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodListVosBean
;
...
...
@@ -48,7 +49,17 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<List<PurchaseFoodListV
TextView
tvPrice
=
viewHolder
.
getView
(
R
.
id
.
tv_order_item_total_amount
);
TextView
tvFoodTypeNumber
=
viewHolder
.
getView
(
R
.
id
.
tv_order_item_food_type_total
);
FoodListAdapter
foodListAdapter
=
new
FoodListAdapter
(
context
,
purchaseFoodListVosBeans
,
ORDER_TYPE
);
FoodListAdapter
foodListAdapter
=
new
FoodListAdapter
(
R
.
layout
.
item_shopping_cart_food
,
context
,
purchaseFoodListVosBeans
,
ORDER_TYPE
);
foodListAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
if
(
view
.
getId
()
==
R
.
id
.
iv_order_food_delete
)
{
new
AppDialog
().
showWaringDialog
(
context
,
"是否刪除食品?"
,
(
v
,
dialog
)
->
{
dialog
.
dismiss
();
if
(
onFoodDeleteListener
!=
null
)
{
onFoodDeleteListener
.
onDeleteFood
(
viewHolder
.
getAdapterPosition
(),
purchaseFoodListVosBeans
.
get
(
position
));
}
});
}
});
Map
<
Integer
,
PurchaseFoodListVosBean
>
integerMap
=
foodListAdapter
.
getIntegerMap
();
for
(
PurchaseFoodListVosBean
purchaseFoodListVosBean
:
purchaseFoodListVosBeans
)
{
integerMap
.
put
(
purchaseFoodListVosBean
.
getId
(),
purchaseFoodListVosBean
);
...
...
@@ -61,11 +72,30 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<List<PurchaseFoodListV
allSelectListener
(
foodListAdapter
,
cbAllSelect
);
//單個食品的數量修改
foodListAdapter
.
setOnNumberChangeListener
((
foodId
,
number
)
->
{
foodListAdapter
.
setOnNumberChangeListener
((
foodId
,
number
,
position
)
->
{
if
(
number
<=
0
)
{
for
(
PurchaseFoodListVosBean
purchaseFoodListVosBean
:
purchaseFoodListVosBeans
)
{
if
(
purchaseFoodListVosBean
.
getId
()
==
foodId
)
{
new
AppDialog
().
showWaringDialog
(
context
,
"數量小於1時將會刪除,是否刪除?"
,
(
view
,
dialog
)
->
{
dialog
.
dismiss
();
if
(
onFoodDeleteListener
!=
null
&&
position
<
purchaseFoodListVosBeans
.
size
())
{
onFoodDeleteListener
.
onDeleteFood
(
viewHolder
.
getAdapterPosition
(),
purchaseFoodListVosBeans
.
get
(
position
));
}
},
(
view
,
dialog
)
->
{
//取消,設置數量為1
dialog
.
dismiss
();
purchaseFoodListVosBean
.
setFoodCount
(
1
);
foodListAdapter
.
getIntegerMap
().
put
(
purchaseFoodListVosBean
.
getId
(),
purchaseFoodListVosBean
);
foodListAdapter
.
notifyItemChanged
(
position
);
});
break
;
}
}
}
else
{
//當數量發生改變時,重新計算價格。
calculateTotalPrice
(
purchaseFoodListVosBeans
,
tvPrice
,
tvFoodTypeNumber
,
cbAllSelect
);
}
});
//單個食品選中狀態切換
foodListAdapter
.
setOnCheckedChangeListener
((
isChecked
,
purchaseFoodListVosBean
)
->
{
foodCheckedChanged
(
isChecked
,
purchaseFoodListVosBean
);
...
...
@@ -83,6 +113,7 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<List<PurchaseFoodListV
}
private
OnInfoChangeListener
onInfoChangeListener
;
private
OnFoodDeleteListener
onFoodDeleteListener
;
public
interface
OnInfoChangeListener
{
/**
...
...
@@ -95,6 +126,14 @@ public class ShoppingCartAdapter extends BaseQuickAdapter<List<PurchaseFoodListV
this
.
onInfoChangeListener
=
onInfoChangeListener
;
}
public
interface
OnFoodDeleteListener
{
void
onDeleteFood
(
int
supplierIndex
,
PurchaseFoodListVosBean
foodListVosBean
);
}
public
void
setOnFoodDeleteListener
(
OnFoodDeleteListener
onFoodDeleteListener
)
{
this
.
onFoodDeleteListener
=
onFoodDeleteListener
;
}
/**
* 食品的選中狀態發生改變
*
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/adapter/StorageAdapter.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
adapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.mvp.bean.OrderBean
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
java.util.List
;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/2
* Time: 17:36
* Use: 採購訂單列表
*/
public
class
StorageAdapter
extends
BaseQuickAdapter
<
OrderBean
,
BaseViewHolder
>
{
public
StorageAdapter
(
@Nullable
List
<
OrderBean
>
data
)
{
super
(
R
.
layout
.
item_storage
,
data
);
addChildClickViewIds
(
R
.
id
.
btn_storage_buy_again
);
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
viewHolder
,
OrderBean
purchaseOrderBean
)
{
viewHolder
.
setText
(
R
.
id
.
tv_storage_supplier_name
,
"供應商名稱"
);
viewHolder
.
setText
(
R
.
id
.
tv_storage_no
,
"入庫單號"
);
viewHolder
.
setText
(
R
.
id
.
tv_storage_order_no
,
""
+
purchaseOrderBean
.
getOrderNo
());
viewHolder
.
setText
(
R
.
id
.
tv_storage_create_time
,
TimeUtils
.
getTime
(
purchaseOrderBean
.
getCreateTime
(),
TimeUtils
.
DEFAULT_DATE_FORMAT_YMDHM
));
viewHolder
.
setText
(
R
.
id
.
tv_storage_goods_num
,
purchaseOrderBean
.
getPurchaseFoodCount
()
+
""
);
// viewHolder.setText(R.id.tv_storage_order_goods, purchaseOrderBean.getFoods());
viewHolder
.
setText
(
R
.
id
.
tv_storage_order_total_price
,
purchaseOrderBean
.
getTotalAmount
()
+
""
);
// viewHolder.setText(R.id.tv_purchase_order_time_out, purchaseOrderBean.getTotal() + "");
viewHolder
.
setText
(
R
.
id
.
btn_storage_order_state
,
"入庫單狀態"
);
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/BaseSupplyChainFragment.java
View file @
5b0327e5
...
...
@@ -15,6 +15,7 @@ import com.jess.arms.base.BaseFragment;
import
com.jess.arms.mvp.IPresenter
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.kingja.loadsir.core.LoadService
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
...
...
@@ -34,6 +35,7 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
public
abstract
class
BaseSupplyChainFragment
<
P
extends
IPresenter
>
extends
BaseFragment
<
P
>
implements
BaseSupplyChainContract
.
View
{
protected
LoadService
loadService
;
/**
* 通过此方法可以使 Fragment 能够与外界做一些交互和通信, 比如说外部的 Activity 想让自己持有的某个 Fragment 对象执行一些方法,
* 建议在有多个需要与外界交互的方法时, 统一传 {@link Message}, 通过 what 字段来区分不同的方法, 在 {@link #setData(Object)}
...
...
@@ -75,6 +77,13 @@ public abstract class BaseSupplyChainFragment<P extends IPresenter> extends Base
}
protected
void
initTopBar
(
QMUITopBar
topBar
,
String
title
)
{
if
(
topBar
.
getLeftViewList
().
size
()
<=
0
)
{
topBar
.
setTitle
(
title
);
topBar
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
}
}
@Override
public
void
showLoading
(
String
message
)
{
if
(
message
!=
null
)
{
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/CategoryFragment.java
View file @
5b0327e5
...
...
@@ -16,6 +16,7 @@ import androidx.core.content.ContextCompat;
import
androidx.recyclerview.widget.GridLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.gingersoft.gsa.cloud.common.ui.utils.AppDialog
;
import
com.gingersoft.gsa.cloud.common.ui.widget.dialog.DialogUtils
;
import
com.gingersoft.gsa.cloud.common.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
;
...
...
@@ -68,6 +69,10 @@ public class CategoryFragment extends BaseSupplyChainFragment<CategoryPresenter>
CardView
cardSecondCategory
;
@BindView
(
R2
.
id
.
tv_new_third_category
)
QMUIAlphaTextView
addThirdCategory
;
/**
* 是否顯示刪除
*/
private
boolean
showDelete
=
false
;
public
static
CategoryFragment
newInstance
()
{
CategoryFragment
fragment
=
new
CategoryFragment
();
...
...
@@ -97,7 +102,21 @@ public class CategoryFragment extends BaseSupplyChainFragment<CategoryPresenter>
}
private
void
initTopBar
()
{
topbarFoodIngredients
.
addRightImageButton
(
R
.
drawable
.
ic_white_delete
,
R
.
id
.
topbar_right_delete_button
).
setOnClickListener
(
this
);
topbarFoodIngredients
.
addRightImageButton
(
R
.
drawable
.
ic_white_delete
,
R
.
id
.
topbar_right_delete_button
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
showDelete
=
!
showDelete
;
if
(
baseCategoryAdapter
!=
null
)
{
baseCategoryAdapter
.
setShowDelete
(
showDelete
);
}
if
(
secondCategoryAdapter
!=
null
)
{
secondCategoryAdapter
.
setShowDelete
(
showDelete
);
}
if
(
thirdCategoryAdapter
!=
null
)
{
thirdCategoryAdapter
.
setShowDelete
(
showDelete
);
}
}
});
topbarFoodIngredients
.
setTitle
(
"類別管理"
);
topbarFoodIngredients
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
}
...
...
@@ -180,10 +199,18 @@ public class CategoryFragment extends BaseSupplyChainFragment<CategoryPresenter>
.
setSelectColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_color
));
rvFirstCategory
.
setAdapter
(
baseCategoryAdapter
);
baseCategoryAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
if
(
baseCategoryAdapter
.
getSelectedIndex
()
!=
position
)
{
baseCategoryAdapter
.
setSelectedIndex
(
position
);
List
<
CategoryBean
>
categoryBeans
=
baseCategoryAdapter
.
getData
();
mPresenter
.
getCategoryBeansById
(
categoryBeans
.
get
(
position
).
getId
(),
mPresenter
.
secondCategoryTag
);
});
baseCategoryAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
if
(
view
.
getId
()
==
R
.
id
.
iv_category_delete
)
{
//刪除該分類
CategoryBean
categoryBean
=
baseCategoryAdapter
.
getData
().
get
(
position
);
new
AppDialog
().
showWaringDialog
(
mContext
,
"是否確認刪除該類別【"
+
categoryBean
.
getCategoryName
()
+
"】,子類將一同刪除?"
,
(
view1
,
dialog
)
->
{
mPresenter
.
deleteFoodCategory
(
mPresenter
.
toFoodCategoryBean
(
0
,
categoryBean
.
getCategoryName
(),
categoryBean
.
getId
()),
mPresenter
.
primaryCategoryTag
,
position
);
dialog
.
dismiss
();
});
}
});
}
else
{
...
...
@@ -208,12 +235,11 @@ public class CategoryFragment extends BaseSupplyChainFragment<CategoryPresenter>
.
setCheckedTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
white
))
.
setUnCheckedTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_3c
))
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
if
(
secondCategoryAdapter
.
getSelectIndex
()
!=
position
)
{
secondCategoryAdapter
.
setSelectIndex
(
position
);
List
<
FoodCategoryResultBean
.
DataBean
.
FoodCategoryBean
>
categoryBeans
=
secondCategoryAdapter
.
getData
();
mPresenter
.
getCategoryBeansById
(
categoryBeans
.
get
(
position
).
getId
(),
mPresenter
.
thirdCategoryTag
);
}
});
addOnDelete
(
secondCategoryAdapter
,
"】,子類將一同刪除?"
,
mPresenter
.
secondCategoryTag
);
rvSecondCategory
.
setLayoutManager
(
new
GridLayoutManager
(
mContext
,
3
)
{
@Override
public
boolean
canScrollHorizontally
()
{
...
...
@@ -232,11 +258,59 @@ public class CategoryFragment extends BaseSupplyChainFragment<CategoryPresenter>
thirdCategoryAdapter
.
setSelectIndex
(-
1
)
.
setUnCheckedBg
(
ContextCompat
.
getDrawable
(
mContext
,
R
.
drawable
.
shape_color_da_stoke_fifteen_corners
))
.
setUnCheckedTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_68
));
addOnDelete
(
thirdCategoryAdapter
,
"】?"
,
mPresenter
.
thirdCategoryTag
);
rvThirdCategory
.
setLayoutManager
(
new
GridLayoutManager
(
mContext
,
3
));
rvThirdCategory
.
setAdapter
(
thirdCategoryAdapter
);
}
else
{
thirdCategoryAdapter
.
setList
(
list
);
}
}
}
private
void
addOnDelete
(
SecondCategoryAdapter
categoryAdapter
,
String
s
,
int
categoryLevel
)
{
categoryAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
if
(
view
.
getId
()
==
R
.
id
.
iv_category_delete
)
{
//刪除該分類
new
AppDialog
().
showWaringDialog
(
mContext
,
"是否確認刪除該類別【"
+
categoryAdapter
.
getData
().
get
(
position
).
getName
()
+
s
,
(
view1
,
dialog
)
->
{
mPresenter
.
deleteFoodCategory
(
categoryAdapter
.
getData
().
get
(
position
),
categoryLevel
,
position
);
dialog
.
dismiss
();
});
}
});
}
@Override
public
void
refreshInfo
(
int
hierarchy
,
int
position
)
{
if
(
hierarchy
==
mPresenter
.
primaryCategoryTag
&&
baseCategoryAdapter
!=
null
)
{
baseCategoryAdapter
.
removeAt
(
position
);
if
(
baseCategoryAdapter
.
getItemCount
()
>
0
)
{
if
(
position
-
1
<
0
)
{
position
=
0
;
}
else
{
position
-=
1
;
}
baseCategoryAdapter
.
setSelectedIndex
(
position
);
baseCategoryAdapter
.
getOnItemClickListener
().
onItemClick
(
baseCategoryAdapter
,
rvFirstCategory
.
getChildAt
(
position
),
position
);
}
}
else
if
(
hierarchy
==
mPresenter
.
secondCategoryTag
&&
secondCategoryAdapter
!=
null
)
{
notifyAdapter
(
position
,
secondCategoryAdapter
);
}
else
if
(
hierarchy
==
mPresenter
.
thirdCategoryTag
&&
thirdCategoryAdapter
!=
null
)
{
notifyAdapter
(
position
,
thirdCategoryAdapter
);
}
}
private
void
notifyAdapter
(
int
position
,
SecondCategoryAdapter
categoryAdapter
)
{
categoryAdapter
.
removeAt
(
position
);
if
(
categoryAdapter
.
getItemCount
()
>
0
)
{
if
(
position
-
1
<
1
)
{
position
=
1
;
}
else
{
position
-=
1
;
}
categoryAdapter
.
setSelectIndex
(
position
);
categoryAdapter
.
getOnItemClickListener
().
onItemClick
(
categoryAdapter
,
null
,
position
);
}
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/CategorySelectFragment.java
View file @
5b0327e5
...
...
@@ -80,14 +80,10 @@ public class CategorySelectFragment extends BaseSupplyChainFragment<CategorySele
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
initTopBar
();
initTopBar
(
mTopBar
,
"選擇分類"
);
mPresenter
.
getFoodCategoryList
(
null
,
0
,
"0"
);
}
private
void
initTopBar
()
{
mTopBar
.
setTitle
(
"選擇分類"
);
mTopBar
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
}
@OnClick
({
R2
.
id
.
btn_food_ingredients_confirm
,
R2
.
id
.
btn_food_ingredients_supplier_cancel
})
@Override
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/FoodIngredientsFragment.java
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
;
import
android.app.Dialog
;
import
android.os.Bundle
;
import
android.view.LayoutInflater
;
import
android.view.View
;
...
...
@@ -14,20 +13,24 @@ import androidx.core.content.ContextCompat;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.
chad.library.adapter.base.BaseQuickAdapter
;
import
com.
chad.library.adapter.base.listener.OnItemChildClickListener
;
import
com.
gingersoft.gsa.cloud.common.ui.loadsir.EmptyCallback
;
import
com.
gingersoft.gsa.cloud.common.ui.loadsir.ErrorCallback
;
import
com.gingersoft.gsa.cloud.common.ui.utils.AppDialog
;
import
com.gingersoft.gsa.cloud.ui.adapter.BaseCategoryAdapter
;
import
com.gingersoft.gsa.cloud.ui.bean.view.CategoryBean
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.di.component.DaggerFoodIngredientsComponent
;
import
com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodListVosBean
;
import
com.gingersoft.supply_chain.mvp.content.SupplyShoppingCart
;
import
com.gingersoft.supply_chain.mvp.contract.FoodIngredientsContract
;
import
com.gingersoft.supply_chain.mvp.presenter.FoodIngredientsPresenter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.FoodListAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.OrderCategoryAdapter
;
import
com.jess.arms.di.component.AppComponent
;
import
com.kingja.loadsir.callback.Callback
;
import
com.kingja.loadsir.core.LoadSir
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaButton
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
...
...
@@ -37,6 +40,8 @@ import java.util.Map;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
.
NewFoodIngredientsFragment
.
EDIT_FOOD_RESULT_CODE
;
/**
* ================================================
...
...
@@ -64,6 +69,8 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
QMUIAlphaButton
btnConfirm
;
@BindView
(
R2
.
id
.
btn_food_ingredients_cancel
)
QMUIAlphaButton
btnCancel
;
@BindView
(
R2
.
id
.
rv_food_ingredients_second_category
)
RecyclerView
rvSecondCategory
;
/**
* 左側分類recyclerview的高度的一半,用來自動滾動到中間,避免每次計算
*/
...
...
@@ -79,7 +86,23 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
private
final
static
String
pageTypeKey
=
"pageType"
;
private
FoodListAdapter
foodListAdapter
;
/**
* true:查看的是供應商的食材
* false:查看分類下的食材
*/
private
boolean
isSupplier
=
false
;
private
final
int
EDIT_FOOD_REQUEST_CODE
=
1050
;
/**
* 分類id,查詢此分類下的食品
*/
private
int
categoryId
;
/**
* 供應商id,查詢此供應商下的食品
*/
private
int
supplierId
;
private
BaseCategoryAdapter
listSelectAdapter
;
public
static
FoodIngredientsFragment
newInstance
(
int
pageType
)
{
FoodIngredientsFragment
fragment
=
new
FoodIngredientsFragment
();
...
...
@@ -110,17 +133,27 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
if
(
arguments
!=
null
)
{
pageType
=
arguments
.
getInt
(
pageTypeKey
);
}
loadService
=
LoadSir
.
getDefault
().
register
(
rvRightFoodIngredients
,
(
Callback
.
OnReloadListener
)
v
->
{
});
initTopBar
();
//初始化購物車數據
SupplyShoppingCart
.
getInstance
().
getCartFoods
();
getFoodsBySupplierId
();
mPresenter
.
getCategoryTrees
();
}
private
void
get
FoodsBySupplierId
()
{
private
void
get
Suppliers
()
{
mPresenter
.
loadFoodIngredientsData
(-
1
);
}
private
void
getFoodsBySupplierId
(){
mPresenter
.
getFoodsBySupplierId
(
supplierId
);
}
private
void
getFoodsByCategoryId
()
{
mPresenter
.
getFoodByCategory
(
categoryId
);
}
private
void
initTopBar
()
{
if
(
pageType
==
FOOD_INGREDIENTS
)
{
topbarFoodIngredients
.
setTitle
(
"食材管理"
);
...
...
@@ -134,7 +167,7 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
btnCancel
.
setVisibility
(
View
.
VISIBLE
);
topbarFoodIngredients
.
addRightImageButton
(
R
.
drawable
.
ic_circle_new_food_ingredient
,
R
.
id
.
qmui_add_new_food_ingredients
).
setOnClickListener
(
v
->
{
//新增食材
start
(
NewFoodIngredientsFragment
.
newInstance
());
start
(
NewFoodIngredientsFragment
.
newInstance
(
null
));
});
}
topbarFoodIngredients
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
...
...
@@ -157,16 +190,24 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
int
viewId
=
v
.
getId
();
if
(
viewId
==
R
.
id
.
layout_switch_method
)
{
//切換
isSupplier
=
!
isSupplier
;
showPrimaryCategory
(
View
.
GONE
,
View
.
VISIBLE
);
if
(
isSupplier
)
{
//獲取供應商,並且會獲取到第一個供應商的食材
getSuppliers
();
}
else
{
//根據分類獲取食材
mPresenter
.
getCategoryTrees
();
}
}
else
if
(
viewId
==
R
.
id
.
btn_new_food_ingredient
)
{
//新增
start
(
NewFoodIngredientsFragment
.
newInstance
()
);
start
ForResult
(
NewFoodIngredientsFragment
.
newInstance
(
null
),
EDIT_FOOD_REQUEST_CODE
);
}
else
if
(
viewId
==
R
.
id
.
btn_food_ingredients_search
)
{
//搜索
}
else
if
(
viewId
==
R
.
id
.
btn_food_ingredients_confirm
)
{
//選擇完食品後,完成
//把選中的數據取出
,
//把選中的數據取出
if
(
foodListAdapter
!=
null
)
{
mPresenter
.
getSelectFood
(
foodListAdapter
.
getIntegerMap
());
}
...
...
@@ -177,27 +218,43 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
}
}
/**
* 加載左側供應商列表
*/
@Override
public
void
loadLeftSupplierInfo
(
List
<
CategoryBean
>
categoryBeans
)
{
rvLeftCategory
.
setHasFixedSize
(
true
);
BaseCategoryAdapter
listSelectAdapter
=
new
BaseCategoryAdapter
(
categoryBeans
,
mContext
);
if
(
listSelectAdapter
==
null
)
{
listSelectAdapter
=
new
BaseCategoryAdapter
(
categoryBeans
,
mContext
);
listSelectAdapter
.
setUnSelectColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_3c
))
.
setSelectColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_color
));
rvLeftCategory
.
setAdapter
(
listSelectAdapter
);
listSelectAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
listSelectAdapter
.
setSelectedIndex
(
position
);
moveToCenter
((
LinearLayoutManager
)
rvLeftCategory
.
getLayoutManager
(),
position
);
//獲取數據
mPresenter
.
getFoodsBySupplierId
(
categoryBeans
.
get
(
position
).
getId
());
//獲取供應商的食品
supplierId
=
categoryBeans
.
get
(
position
).
getId
();
getFoodsBySupplierId
();
});
}
else
{
listSelectAdapter
.
setNewInstance
(
categoryBeans
);
}
rvLeftCategory
.
setAdapter
(
listSelectAdapter
);
}
/**
* 加載右側食品數據
*/
@Override
public
void
loadRightFoodIngredients
(
List
<
PurchaseFoodListVosBean
>
purchaseFoodListVOS
)
{
public
void
loadRightFoodIngredients
(
List
<
PurchaseFoodListVosBean
>
purchaseFoodListVos
)
{
if
(
purchaseFoodListVos
==
null
||
purchaseFoodListVos
.
size
()
<=
0
)
{
loadService
.
showCallback
(
EmptyCallback
.
class
);
return
;
}
else
{
loadService
.
showSuccess
();
}
if
(
foodListAdapter
!=
null
)
{
foodListAdapter
.
setList
(
purchaseFoodListV
OS
);
foodListAdapter
.
setList
(
purchaseFoodListV
os
);
}
else
{
foodListAdapter
=
new
FoodListAdapter
(
mContext
,
purchaseFoodListV
OS
,
pageType
);
foodListAdapter
=
new
FoodListAdapter
(
mContext
,
purchaseFoodListV
os
,
pageType
);
Map
<
Integer
,
PurchaseFoodListVosBean
>
integerMap
=
foodListAdapter
.
getIntegerMap
();
for
(
PurchaseFoodListVosBean
purchaseFoodListVosBean
:
SupplyShoppingCart
.
getInstance
().
getCartFoods
())
{
integerMap
.
put
(
purchaseFoodListVosBean
.
getId
(),
purchaseFoodListVosBean
);
...
...
@@ -205,23 +262,18 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
LinearLayoutManager
rightLayoutManager
=
new
LinearLayoutManager
(
mContext
);
rvRightFoodIngredients
.
setLayoutManager
(
rightLayoutManager
);
rvRightFoodIngredients
.
setAdapter
(
foodListAdapter
);
foodListAdapter
.
setOnItemChildClickListener
(
new
OnItemChildClickListener
()
{
@Override
public
void
onItemChildClick
(
@NonNull
BaseQuickAdapter
adapter
,
@NonNull
View
view
,
int
position
)
{
foodListAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
if
(
view
.
getId
()
==
R
.
id
.
iv_supplier_edit
)
{
//編輯食材
startForResult
(
NewFoodIngredientsFragment
.
newInstance
(
foodListAdapter
.
getData
().
get
(
position
)),
EDIT_FOOD_REQUEST_CODE
);
}
else
if
(
view
.
getId
()
==
R
.
id
.
iv_supplier_delete
)
{
//刪除食材
PurchaseFoodListVosBean
purchaseFoodListVosBean
=
foodListAdapter
.
getData
().
get
(
position
);
new
AppDialog
().
showWaringDialog
(
mContext
,
"是否確認刪除"
+
purchaseFoodListVosBean
.
getName
(),
new
AppDialog
.
DialogOnClickListenter
()
{
@Override
public
void
onclick
(
View
view
,
Dialog
dialog
)
{
new
AppDialog
().
showWaringDialog
(
mContext
,
"是否確認刪除"
+
purchaseFoodListVosBean
.
getName
(),
(
view1
,
dialog
)
->
{
mPresenter
.
deleteFood
(
purchaseFoodListVosBean
,
position
);
}
dialog
.
dismiss
();
});
}
}
});
}
}
...
...
@@ -230,4 +282,89 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
public
void
onDeleteFoodSuccess
(
int
position
)
{
foodListAdapter
.
notifyItemChanged
(
position
);
}
private
OrderCategoryAdapter
orderCategoryAdapter
;
private
OrderCategoryAdapter
secondCategoryAdapter
;
@Override
public
void
loadCategory
(
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
)
{
initPrimaryAdapter
(
foodCategoryTrees
);
orderCategoryAdapter
.
setOnSecondCategoryClickListener
((
foodCategoryTrees1
,
position
)
->
{
//點擊二級分類時,隱藏一級,顯示二級分類數據
if
(
orderCategoryAdapter
.
getCurrentLevelCategory
()
==
orderCategoryAdapter
.
PRIMARY_CATEGORY
)
{
categoryId
=
foodCategoryTrees1
.
get
(
position
).
getId
();
getFoodsByCategoryId
();
initSecondAdapter
(
foodCategoryTrees1
,
position
);
}
});
}
@Override
public
void
loadFail
()
{
loadService
.
showCallback
(
ErrorCallback
.
class
);
}
private
void
initSecondAdapter
(
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
,
int
position
)
{
//二級分類被點擊
if
(
secondCategoryAdapter
==
null
)
{
secondCategoryAdapter
=
new
OrderCategoryAdapter
(
mContext
,
foodCategoryTrees
);
secondCategoryAdapter
.
setCurrentLevelCategory
(
orderCategoryAdapter
.
SECOND_CATEGORY
);
secondCategoryAdapter
.
setOnItemChildClickListener
((
a
,
v
,
p
)
->
{
//點擊返回,隱藏二級分類,顯示一級分類
if
(
v
.
getId
()
==
R
.
id
.
layout_order_category_back
)
{
showPrimaryCategory
(
View
.
GONE
,
View
.
VISIBLE
);
}
});
secondCategoryAdapter
.
setOnItemClickListener
((
adapter1
,
view1
,
position1
)
->
secondCategoryAdapter
.
setSelectIndex
(
position1
));
secondCategoryAdapter
.
setOnSecondCategoryClickListener
((
foodCategoryTrees1
,
position12
)
->
{
categoryId
=
foodCategoryTrees1
.
get
(
position12
).
getId
();
getFoodsByCategoryId
();
});
rvSecondCategory
.
setAdapter
(
secondCategoryAdapter
);
}
else
{
secondCategoryAdapter
.
setNewInstance
(
foodCategoryTrees
);
}
//設置選中
secondCategoryAdapter
.
setSelectIndex
(
position
);
showPrimaryCategory
(
View
.
VISIBLE
,
View
.
GONE
);
}
private
void
showPrimaryCategory
(
int
gone
,
int
visible
)
{
rvSecondCategory
.
setVisibility
(
gone
);
rvLeftCategory
.
setVisibility
(
visible
);
}
private
void
initPrimaryAdapter
(
List
<
OrderCategoryBean
.
FoodCategoryTrees
>
foodCategoryTrees
)
{
if
(
orderCategoryAdapter
==
null
)
{
orderCategoryAdapter
=
new
OrderCategoryAdapter
(
mContext
,
foodCategoryTrees
);
}
else
{
orderCategoryAdapter
.
setNewInstance
(
foodCategoryTrees
);
}
rvLeftCategory
.
setAdapter
(
orderCategoryAdapter
);
orderCategoryAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
categoryId
=
foodCategoryTrees
.
get
(
position
).
getId
();
getFoodsByCategoryId
();
orderCategoryAdapter
.
setSelectIndex
(
position
);
});
if
(
orderCategoryAdapter
.
getSelectIndex
()
!=
-
1
)
{
categoryId
=
foodCategoryTrees
.
get
(
orderCategoryAdapter
.
getSelectIndex
()).
getId
();
getFoodsByCategoryId
();
}
}
@Override
public
void
onFragmentResult
(
int
requestCode
,
int
resultCode
,
Bundle
data
)
{
super
.
onFragmentResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
EDIT_FOOD_REQUEST_CODE
&&
resultCode
==
EDIT_FOOD_RESULT_CODE
)
{
//編輯食材後,刷新
if
(
isSupplier
)
{
//根據供應商獲取食材
getFoodsBySupplierId
();
}
else
{
getFoodsByCategoryId
();
}
}
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/FunctionListFragment.java
View file @
5b0327e5
...
...
@@ -82,6 +82,11 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr
List
<
Function
>
orderManger
=
new
ArrayList
<>();
orderManger
.
add
(
new
Function
(
"採購訂單"
,
R
.
drawable
.
ic_purchase_order
));
purchaseFunctionBeans
.
add
(
new
PurchaseFunctionBean
(
"訂單管理"
,
orderManger
));
List
<
Function
>
storage
=
new
ArrayList
<>();
storage
.
add
(
new
Function
(
"入庫"
,
R
.
drawable
.
ic_purchase_order
));
purchaseFunctionBeans
.
add
(
new
PurchaseFunctionBean
(
"庫存管理"
,
storage
));
PurchaseFunctionAdapter
purchaseFunctionAdapter
=
new
PurchaseFunctionAdapter
(
mContext
,
purchaseFunctionBeans
);
purchaseFunctionAdapter
.
setFunctionClickListener
(
new
OnItemClickListener
()
{
@Override
...
...
@@ -104,6 +109,9 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr
case
"採購訂單"
:
start
(
PurchaseListFragment
.
newInstance
());
break
;
case
"入庫"
:
start
(
StorageListFragment
.
newInstance
());
break
;
default
:
break
;
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/MeasurementUnitFragment.java
View file @
5b0327e5
...
...
@@ -36,14 +36,6 @@ import butterknife.OnClick;
/**
* ================================================
* Description: 食材單位列表頁面
* <p>
* Created by MVPArmsTemplate on 11/21/2020 14:22
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public
class
MeasurementUnitFragment
extends
BaseSupplyChainFragment
<
MeasurementUnitPresenter
>
implements
MeasurementUnitContract
.
View
,
View
.
OnClickListener
{
...
...
@@ -118,7 +110,7 @@ public class MeasurementUnitFragment extends BaseSupplyChainFragment<Measurement
cancelSelect
.
setVisibility
(
isSelect
?
View
.
VISIBLE
:
View
.
GONE
);
btnNewMeasurementUnit
.
setVisibility
(
isSelect
?
View
.
GONE
:
View
.
VISIBLE
);
initTopBar
();
initTopBar
(
topbarMeasurementUnitList
,
isSelect
?
"選擇計量單位"
:
"計量單位"
);
loadInfo
(
""
);
// 重新加载逻辑
...
...
@@ -140,11 +132,6 @@ public class MeasurementUnitFragment extends BaseSupplyChainFragment<Measurement
mPresenter
.
getMeasurementUnitList
(
unitContent
,
pageIndex
);
}
private
void
initTopBar
()
{
topbarMeasurementUnitList
.
setTitle
(
isSelect
?
"選擇計量單位"
:
"計量單位"
);
topbarMeasurementUnitList
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
}
@OnClick
({
R2
.
id
.
btn_measurement_unit_search
,
R2
.
id
.
btn_new_measurement_unit
,
R2
.
id
.
btn_measurement_unit_confirm
,
R2
.
id
.
btn_measurement_unit_cancel
})
@Override
public
void
onClick
(
View
v
)
{
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/NewFoodIngredientsFragment.java
View file @
5b0327e5
...
...
@@ -14,10 +14,7 @@ import androidx.annotation.NonNull;
import
androidx.annotation.Nullable
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.listener.OnItemChildClickListener
;
import
com.gingersoft.gsa.cloud.bean.MultiSelectBean
;
import
com.gingersoft.gsa.cloud.bean.UploadPicMultiBean
;
import
com.gingersoft.gsa.cloud.common.ui.adapter.multi.InfoMultiAdapter
;
import
com.gingersoft.gsa.cloud.common.ui.bean.InfoMultiBean
;
import
com.gingersoft.gsa.cloud.common.ui.recylcler.decorator.DividerItemDecoration
;
...
...
@@ -29,6 +26,7 @@ import com.gingersoft.supply_chain.R;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.di.component.DaggerNewFoodIngredientsComponent
;
import
com.gingersoft.supply_chain.mvp.bean.FoodPackingSpecificationBean
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodListVosBean
;
import
com.gingersoft.supply_chain.mvp.bean.SupplierInfoBean
;
import
com.gingersoft.supply_chain.mvp.contract.NewFoodIngredientsContract
;
import
com.gingersoft.supply_chain.mvp.presenter.NewFoodIngredientsPresenter
;
...
...
@@ -55,7 +53,7 @@ import static com.gingersoft.supply_chain.mvp.ui.fragment.SupplierListFragment.S
/**
* ================================================
* Description: 新增食材
* Description: 新增食材
、編輯食材
*/
public
class
NewFoodIngredientsFragment
extends
BaseSupplyChainFragment
<
NewFoodIngredientsPresenter
>
implements
NewFoodIngredientsContract
.
View
,
View
.
OnClickListener
{
...
...
@@ -68,8 +66,14 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
private
InfoMultiAdapter
infoMultiAdapter
;
public
static
NewFoodIngredientsFragment
newInstance
()
{
public
final
static
String
FOOD_INFO_KEY
=
"foodInfoKey"
;
public
final
static
int
EDIT_FOOD_RESULT_CODE
=
1060
;
public
static
NewFoodIngredientsFragment
newInstance
(
PurchaseFoodListVosBean
purchaseFoodListVosBean
)
{
NewFoodIngredientsFragment
fragment
=
new
NewFoodIngredientsFragment
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putSerializable
(
FOOD_INFO_KEY
,
purchaseFoodListVosBean
);
fragment
.
setArguments
(
bundle
);
return
fragment
;
}
...
...
@@ -102,8 +106,15 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
killMyself
();
}
});
initTopBar
();
infoMultiAdapter
=
new
InfoMultiAdapter
(
mContext
,
mPresenter
.
getFragmentInfo
());
//加載佈局
Bundle
arguments
=
getArguments
();
PurchaseFoodListVosBean
purchaseFoodListVosBean
=
null
;
if
(
arguments
!=
null
)
{
purchaseFoodListVosBean
=
(
PurchaseFoodListVosBean
)
arguments
.
getSerializable
(
FOOD_INFO_KEY
);
}
infoMultiAdapter
=
new
InfoMultiAdapter
(
mContext
,
mPresenter
.
getFragmentInfo
(
purchaseFoodListVosBean
));
rvNewFoodIngredients
.
addItemDecoration
(
new
DividerItemDecoration
(
mContext
,
VERTICAL_LIST
));
infoMultiAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
List
<
InfoMultiBean
>
data
=
infoMultiAdapter
.
getData
();
...
...
@@ -115,16 +126,14 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
}
}
});
infoMultiAdapter
.
setOnItemChildClickListener
(
new
OnItemChildClickListener
()
{
@Override
public
void
onItemChildClick
(
@NonNull
BaseQuickAdapter
adapter
,
@NonNull
View
view
,
int
position
)
{
//圖片點擊事件
infoMultiAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
if
(
view
.
getId
()
==
R
.
id
.
iv_multi_upload_pic
)
{
//選擇圖片
Intent
intentToPickPic
=
new
Intent
(
Intent
.
ACTION_PICK
,
null
);
intentToPickPic
.
setDataAndType
(
MediaStore
.
Images
.
Media
.
EXTERNAL_CONTENT_URI
,
"image/*"
);
startActivityForResult
(
intentToPickPic
,
CHOOSE_PHOTO
);
}
}
});
rvNewFoodIngredients
.
setAdapter
(
infoMultiAdapter
);
}
...
...
@@ -211,18 +220,27 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
@Override
public
void
refreshAdapterByPosition
(
int
position
)
{
if
(
infoMultiAdapter
!=
null
)
{
infoMultiAdapter
.
notifyItemChanged
(
position
);
}
}
@Override
public
void
uploadPicSuccess
(
List
<
String
>
picUrl
)
{
List
<
InfoMultiBean
>
data
=
infoMultiAdapter
.
getData
();
InfoMultiBean
infoMultiBean
=
data
.
get
(
mPresenter
.
picIndex
);
if
(
infoMultiBean
instanceof
UploadPicMultiBean
)
{
UploadPicMultiBean
uploadPicMultiBean
=
(
UploadPicMultiBean
)
infoMultiBean
;
uploadPicMultiBean
.
setPicUrl
(
picUrl
);
refreshAdapterByPosition
(
mPresenter
.
picIndex
);
// List<InfoMultiBean> data = infoMultiAdapter.getData();
// InfoMultiBean infoMultiBean = data.get(mPresenter.picIndex);
// if (infoMultiBean instanceof UploadPicMultiBean) {
// UploadPicMultiBean uploadPicMultiBean = (UploadPicMultiBean) infoMultiBean;
// uploadPicMultiBean.setPicUrl(picUrl);
// refreshAdapterByPosition(mPresenter.picIndex);
// }
mPresenter
.
setPicUrl
(
infoMultiAdapter
.
getData
(),
picUrl
);
}
@Override
public
void
saveFoodInfoSuccess
()
{
setFragmentResult
(
EDIT_FOOD_RESULT_CODE
,
null
);
killMyself
();
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/NewSupplierFragment.java
View file @
5b0327e5
...
...
@@ -15,6 +15,7 @@ import com.gingersoft.supply_chain.R;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.di.component.DaggerNewSupplierComponent
;
import
com.gingersoft.supply_chain.mvp.bean.SupplierInfoBean
;
import
com.gingersoft.supply_chain.mvp.content.Constant
;
import
com.gingersoft.supply_chain.mvp.contract.NewSupplierContract
;
import
com.gingersoft.supply_chain.mvp.presenter.NewSupplierPresenter
;
import
com.jess.arms.di.component.AppComponent
;
...
...
@@ -25,7 +26,6 @@ import butterknife.BindView;
import
butterknife.OnClick
;
import
static
com
.
gingersoft
.
gsa
.
cloud
.
common
.
ui
.
recylcler
.
decorator
.
DividerItemDecoration
.
VERTICAL_LIST
;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
bean
.
SupplierInfoBean
.
DELETE
;
import
static
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
.
SupplierListFragment
.
SUPPLIER_LIST
;
...
...
@@ -105,7 +105,7 @@ public class NewSupplierFragment extends BaseSupplyChainFragment<NewSupplierPres
//刪除供應商
new
AppDialog
().
showWaringDialog
(
mContext
,
"刪除供應商"
,
(
view1
,
dialog
)
->
{
dialog
.
dismiss
();
supplierBean
.
setDeletes
(
DELETE
);
supplierBean
.
setDeletes
(
Constant
.
DELETE
);
mPresenter
.
updateSupplier
();
});
}
else
if
(
viewId
==
R
.
id
.
btn_save_supplier
)
{
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/OrderContentFragment.java
View file @
5b0327e5
...
...
@@ -17,6 +17,7 @@ import com.gingersoft.supply_chain.R;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.di.component.DaggerOrderContentComponent
;
import
com.gingersoft.supply_chain.mvp.bean.PurchaseFoodListVosBean
;
import
com.gingersoft.supply_chain.mvp.content.SupplyShoppingCart
;
import
com.gingersoft.supply_chain.mvp.contract.OrderContentContract
;
import
com.gingersoft.supply_chain.mvp.presenter.OrderContentPresenter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.ShoppingCartAdapter
;
...
...
@@ -33,13 +34,13 @@ import static com.gingersoft.supply_chain.mvp.ui.fragment.FoodIngredientsFragmen
/**
* ================================================
* Description:
訂單詳情
* Description:
購物車
* 本次下單所有食品展示頁
*/
public
class
OrderContentFragment
extends
BaseSupplyChainFragment
<
OrderContentPresenter
>
implements
OrderContentContract
.
View
,
View
.
OnClickListener
{
@BindView
(
R2
.
id
.
top
bar
)
QMUITopBar
top
b
ar
;
@BindView
(
R2
.
id
.
supply_top_
bar
)
QMUITopBar
top
B
ar
;
@BindView
(
R2
.
id
.
rv_order_content
)
RecyclerView
rvOrderContent
;
@BindView
(
R2
.
id
.
cb_order_content_all_select
)
...
...
@@ -75,8 +76,7 @@ public class OrderContentFragment extends BaseSupplyChainFragment<OrderContentPr
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
topbar
.
setTitle
(
"採購單"
);
topbar
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
initTopBar
(
topBar
,
"採購單"
);
mPresenter
.
organizeShopCartData
();
cbOrderContentAllSelect
.
setOnCheckedChangeListener
((
buttonView
,
isChecked
)
->
{
...
...
@@ -109,6 +109,8 @@ public class OrderContentFragment extends BaseSupplyChainFragment<OrderContentPr
//完成
List
<
PurchaseFoodListVosBean
>
purchaseFoodListVosBeans
=
shoppingCartAdapter
.
getPurchaseFoodListVosBeans
();
mPresenter
.
addNewPurchaseOrder
(
purchaseFoodListVosBeans
,
edOrderContentRemark
.
getText
()
+
""
);
//去到訂單確認頁面
startWithPop
(
SendMsgFragment
.
newInstance
());
}
else
if
(
viewId
==
R
.
id
.
btn_order_content_order_template
)
{
//訂單模板
...
...
@@ -121,6 +123,15 @@ public class OrderContentFragment extends BaseSupplyChainFragment<OrderContentPr
@Override
public
void
loadAdapter
(
List
<
List
<
PurchaseFoodListVosBean
>>
supplierFoods
)
{
shoppingCartAdapter
=
new
ShoppingCartAdapter
(
mContext
,
supplierFoods
);
shoppingCartAdapter
.
setOnFoodDeleteListener
((
supplierIndex
,
foodListVosBean
)
->
{
SupplyShoppingCart
.
getInstance
().
getCartFoods
().
remove
(
foodListVosBean
);
List
<
PurchaseFoodListVosBean
>
purchaseFoodListVosBeans
=
shoppingCartAdapter
.
getData
().
get
(
supplierIndex
);
purchaseFoodListVosBeans
.
remove
(
foodListVosBean
);
if
(
purchaseFoodListVosBeans
.
size
()
<=
0
)
{
shoppingCartAdapter
.
getData
().
remove
(
purchaseFoodListVosBeans
);
}
shoppingCartAdapter
.
notifyItemChanged
(
supplierIndex
);
});
rvOrderContent
.
setAdapter
(
shoppingCartAdapter
);
shoppingCartAdapter
.
setOnInfoChangeListener
(()
->
mPresenter
.
calculateTotalPrice
(
cbOrderContentAllSelect
));
}
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/PackageSpecificationFragment.java
View file @
5b0327e5
...
...
@@ -108,8 +108,7 @@ public class PackageSpecificationFragment extends BaseSupplyChainFragment<Packag
}
private
void
initTopBar
()
{
topbarNewPackageSpecification
.
setTitle
(
"包裝規格"
);
topbarNewPackageSpecification
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
initTopBar
(
topbarNewPackageSpecification
,
"包裝規格"
);
}
@OnClick
({
R2
.
id
.
btn_save_new_package_specification
})
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/PurchaseListFragment.java
View file @
5b0327e5
...
...
@@ -5,16 +5,19 @@ import android.view.LayoutInflater;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.core.content.ContextCompat
;
import
androidx.viewpager2.widget.ViewPager2
;
import
com.gingersoft.gsa.cloud.common.ui.utils.AppDialog
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.di.component.DaggerPurchaseListComponent
;
import
com.gingersoft.supply_chain.mvp.bean.OrderBean
;
import
com.gingersoft.supply_chain.mvp.content.SupplyShoppingCart
;
import
com.gingersoft.supply_chain.mvp.contract.PurchaseListContract
;
import
com.gingersoft.supply_chain.mvp.presenter.PurchaseListPresenter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.PurchaseOrderAdapter
;
...
...
@@ -24,7 +27,6 @@ import com.jess.arms.di.component.AppComponent;
import
com.qmuiteam.qmui.alpha.QMUIAlphaButton
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.qmuiteam.qmui.widget.popup.QMUIPopups
;
import
com.qmuiteam.qmui.widget.tab.QMUIBasicTabSegment
;
import
com.qmuiteam.qmui.widget.tab.QMUITabBuilder
;
import
com.qmuiteam.qmui.widget.tab.QMUITabIndicator
;
...
...
@@ -52,8 +54,11 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
ViewPager2
contentViewPager
;
@BindView
(
R2
.
id
.
btn_save
)
QMUIAlphaButton
btnNewOrder
;
@BindView
(
R2
.
id
.
screen_view
)
ScreenView
screenView
;
private
PurchaseOrderAdapter
purchaseOrderAdapter
;
public
static
PurchaseListFragment
newInstance
()
{
PurchaseListFragment
fragment
=
new
PurchaseListFragment
();
return
fragment
;
...
...
@@ -61,6 +66,7 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
private
final
int
[]
orderState
=
new
int
[]{
0
,
1
,
2
,
3
};
private
int
pageIndex
=
1
;
@Override
public
void
setupFragmentComponent
(
@NonNull
AppComponent
appComponent
)
{
DaggerPurchaseListComponent
//如找不到该类,请编译一下项目
...
...
@@ -88,10 +94,23 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
mPresenter
.
getOrderList
(
""
,
orderState
[
0
],
pageIndex
);
}
@Override
public
void
onSupportVisible
()
{
super
.
onSupportVisible
();
if
(
tvCartGoodsNum
!=
null
)
{
tvCartGoodsNum
.
setText
(
String
.
valueOf
(
SupplyShoppingCart
.
getInstance
().
getCartFoods
().
size
()));
}
}
private
TextView
tvCartGoodsNum
;
private
void
initTopBar
()
{
mTopBar
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
mTopBar
.
setTitle
(
"採購列表"
);
View
view
=
View
.
inflate
(
mContext
,
R
.
layout
.
layout_shopping_cart
,
null
);
tvCartGoodsNum
=
view
.
findViewById
(
R
.
id
.
tv_purchase_cart_size
);
tvCartGoodsNum
.
setText
(
String
.
valueOf
(
SupplyShoppingCart
.
getInstance
().
getCartFoods
().
size
()));
RelativeLayout
.
LayoutParams
layoutParams
=
new
RelativeLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
);
mTopBar
.
addRightView
(
view
,
R
.
id
.
qmui_shopping_cart
,
layoutParams
);
view
.
setOnClickListener
(
v
->
start
(
OrderContentFragment
.
newInstance
()));
...
...
@@ -103,6 +122,17 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
.
setSelectColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_color
));
purchaseOrderAdapter
=
new
PurchaseOrderAdapter
(
null
);
purchaseOrderAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
int
viewId
=
view
.
getId
();
if
(
viewId
==
R
.
id
.
iv_supplier_delete
)
{
//刪除採購單
AppDialog
.
getInstance
().
showWaringDialog
(
mContext
,
"是否刪除採購單?"
,
(
view1
,
dialog
)
->
{
List
<
OrderBean
>
data
=
purchaseOrderAdapter
.
getData
();
mPresenter
.
deleteOrder
(
position
,
data
.
get
(
position
));
dialog
.
dismiss
();
});
}
});
PurchasePageAdapter
adapter
=
new
PurchasePageAdapter
(
purchaseOrderAdapter
,
4
);
contentViewPager
.
setAdapter
(
adapter
);
mTabSegment
.
setupWithViewPager
(
contentViewPager
);
...
...
@@ -143,14 +173,7 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
int
viewId
=
v
.
getId
();
if
(
viewId
==
R
.
id
.
layout_purchase_list_screen
)
{
//篩選
QMUIPopups
.
popup
(
mContext
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
)
.
arrow
(
false
)
.
shadow
(
true
)
.
view
(
new
ScreenView
(
mContext
))
.
offsetYIfTop
(
QMUIDisplayHelper
.
dp2px
(
mContext
,
10
))
.
dismissIfOutsideTouch
(
false
)
.
dimAmount
(
0.6f
)
.
show
(
v
);
screenView
.
setVisibility
(
screenView
.
getVisibility
()
==
View
.
VISIBLE
?
View
.
GONE
:
View
.
VISIBLE
);
}
}
...
...
@@ -158,4 +181,9 @@ public class PurchaseListFragment extends BaseSupplyChainFragment<PurchaseListPr
public
void
loadOrderList
(
List
<
OrderBean
>
list
)
{
purchaseOrderAdapter
.
setList
(
list
);
}
@Override
public
void
deleteOrder
(
int
position
)
{
purchaseOrderAdapter
.
removeAt
(
position
);
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/SendMsgFragment.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
;
import
android.os.Bundle
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.LinearLayout
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.di.component.DaggerSendMsgComponent
;
import
com.gingersoft.supply_chain.mvp.contract.SendMsgContract
;
import
com.gingersoft.supply_chain.mvp.presenter.SendMsgPresenter
;
import
com.jess.arms.di.component.AppComponent
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaButton
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
butterknife.BindView
;
/**
* Description: 發送消息到供應商
*/
public
class
SendMsgFragment
extends
BaseSupplyChainFragment
<
SendMsgPresenter
>
implements
SendMsgContract
.
View
{
@BindView
(
R2
.
id
.
supply_top_bar
)
QMUITopBar
supplyTopBar
;
@BindView
(
R2
.
id
.
layout_contact_information
)
LinearLayout
layoutContactInformation
;
@BindView
(
R2
.
id
.
horizontal_dotted
)
View
horizontalDotted
;
@BindView
(
R2
.
id
.
btn_supplier_confirm
)
QMUIAlphaButton
btnSupplierConfirm
;
@BindView
(
R2
.
id
.
btn_supplier_cancel
)
QMUIAlphaButton
btnSupplierCancel
;
public
static
SendMsgFragment
newInstance
()
{
SendMsgFragment
fragment
=
new
SendMsgFragment
();
return
fragment
;
}
@Override
public
void
setupFragmentComponent
(
@NonNull
AppComponent
appComponent
)
{
DaggerSendMsgComponent
//如找不到该类,请编译一下项目
.
builder
()
.
appComponent
(
appComponent
)
.
view
(
this
)
.
build
()
.
inject
(
this
);
}
@Override
public
View
initView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
return
inflater
.
inflate
(
R
.
layout
.
fragment_send_msg
,
container
,
false
);
}
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
initTopBar
(
supplyTopBar
,
"發送"
);
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/StorageListFragment.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
fragment
;
import
android.os.Bundle
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.core.content.ContextCompat
;
import
androidx.viewpager2.widget.ViewPager2
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
import
com.gingersoft.supply_chain.di.component.DaggerStorageListComponent
;
import
com.gingersoft.supply_chain.mvp.bean.OrderBean
;
import
com.gingersoft.supply_chain.mvp.contract.StorageListContract
;
import
com.gingersoft.supply_chain.mvp.presenter.StorageListPresenter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.PurchasePageAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.adapter.StorageAdapter
;
import
com.gingersoft.supply_chain.mvp.ui.widget.ScreenView
;
import
com.jess.arms.di.component.AppComponent
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaButton
;
import
com.qmuiteam.qmui.layout.QMUILinearLayout
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.qmuiteam.qmui.widget.tab.QMUIBasicTabSegment
;
import
com.qmuiteam.qmui.widget.tab.QMUITabBuilder
;
import
com.qmuiteam.qmui.widget.tab.QMUITabIndicator
;
import
com.qmuiteam.qmui.widget.tab.QMUITabSegment
;
import
com.qmuiteam.qmui.widget.tab.QMUITabSegment2
;
import
java.util.ArrayList
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/10/2020 18:09
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public
class
StorageListFragment
extends
BaseSupplyChainFragment
<
StorageListPresenter
>
implements
StorageListContract
.
View
,
View
.
OnClickListener
{
@BindView
(
R2
.
id
.
topbar_purchase_list
)
QMUITopBar
mTopBar
;
@BindView
(
R2
.
id
.
ed_food_ingredients_search
)
EditText
edFoodIngredientsSearch
;
@BindView
(
R2
.
id
.
layout_purchase_list_screen
)
QMUILinearLayout
layoutPurchaseListScreen
;
@BindView
(
R2
.
id
.
layout_food_ingredients_search
)
LinearLayout
layoutFoodIngredientsSearch
;
@BindView
(
R2
.
id
.
screen_view
)
ScreenView
screenView
;
@BindView
(
R2
.
id
.
purchase_list_tabSegment
)
QMUITabSegment2
mTabSegment
;
@BindView
(
R2
.
id
.
contentViewPager
)
ViewPager2
contentViewPager
;
@BindView
(
R2
.
id
.
btn_save
)
QMUIAlphaButton
btnSave
;
String
[]
tabs
=
new
String
[]{
"全部"
,
"待收貨"
,
"部分收貨"
,
"全部收貨"
,
"拒收"
};
public
static
StorageListFragment
newInstance
()
{
StorageListFragment
fragment
=
new
StorageListFragment
();
return
fragment
;
}
@Override
public
void
setupFragmentComponent
(
@NonNull
AppComponent
appComponent
)
{
DaggerStorageListComponent
//如找不到该类,请编译一下项目
.
builder
()
.
appComponent
(
appComponent
)
.
view
(
this
)
.
build
()
.
inject
(
this
);
}
@Override
public
View
initView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
return
inflater
.
inflate
(
R
.
layout
.
fragment_purchase_list
,
container
,
false
);
}
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
initTopBar
();
initTabAndData
();
}
private
void
initTopBar
()
{
mTopBar
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
mTopBar
.
setTitle
(
"入庫列表"
);
btnSave
.
setVisibility
(
View
.
GONE
);
}
private
void
initTabAndData
()
{
QMUITabBuilder
builder
=
mTabSegment
.
tabBuilder
()
.
setNormalColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_86
))
.
setSelectColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_color
));
List
<
OrderBean
>
orderBeans
=
new
ArrayList
<>();
// for (int i = 0; i < 10; i++) {
// OrderBean orderBean = new OrderBean("S0001", 5, 11.11, 1, System.currentTimeMillis());
// orderBeans.add(orderBean);
// }
StorageAdapter
storageAdapter
=
new
StorageAdapter
(
orderBeans
);
PurchasePageAdapter
adapter
=
new
PurchasePageAdapter
(
storageAdapter
,
tabs
.
length
);
contentViewPager
.
setAdapter
(
adapter
);
mTabSegment
.
setupWithViewPager
(
contentViewPager
);
mTabSegment
.
setIndicator
(
new
QMUITabIndicator
(
QMUIDisplayHelper
.
dp2px
(
getContext
(),
2
),
false
,
false
));
for
(
String
tab
:
tabs
)
{
mTabSegment
.
addTab
(
builder
.
setText
(
tab
).
build
(
getContext
()));
}
mTabSegment
.
setMode
(
QMUITabSegment
.
MODE_FIXED
);
mTabSegment
.
addOnTabSelectedListener
(
new
QMUIBasicTabSegment
.
OnTabSelectedListener
()
{
@Override
public
void
onTabSelected
(
int
index
)
{
// mPresenter.getOrderList("", orderState[index], pageIndex);
}
@Override
public
void
onTabUnselected
(
int
index
)
{
}
@Override
public
void
onTabReselected
(
int
index
)
{
}
@Override
public
void
onDoubleTap
(
int
index
)
{
mTabSegment
.
clearSignCountView
(
index
);
}
});
}
@OnClick
({
R2
.
id
.
layout_purchase_list_screen
})
@Override
public
void
onClick
(
View
v
)
{
int
viewId
=
v
.
getId
();
if
(
viewId
==
R
.
id
.
layout_purchase_list_screen
)
{
screenView
.
setVisibility
(
screenView
.
getVisibility
()
==
View
.
VISIBLE
?
View
.
GONE
:
View
.
VISIBLE
);
}
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/fragment/SupplierListFragment.java
View file @
5b0327e5
...
...
@@ -23,7 +23,7 @@ import com.gingersoft.supply_chain.mvp.ui.adapter.SupplierAdapter;
import
com.jess.arms.di.component.AppComponent
;
import
com.kingja.loadsir.callback.Callback
;
import
com.kingja.loadsir.core.LoadSir
;
import
com.qmuiteam.qmui.alpha.QMUIAlpha
Button
;
import
com.qmuiteam.qmui.alpha.QMUIAlpha
TextView
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.scwang.smartrefresh.layout.SmartRefreshLayout
;
...
...
@@ -47,7 +47,7 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr
@BindView
(
R2
.
id
.
rv_supplier_list
)
RecyclerView
rvSupplierList
;
@BindView
(
R2
.
id
.
btn_new_supplier
)
QMUIAlpha
Button
btnNewSupplier
;
QMUIAlpha
TextView
btnNewSupplier
;
@BindView
(
R2
.
id
.
ed_supplier_search
)
EditText
edSupplier
;
public
final
static
int
SUPPLIER_LIST
=
101
;
...
...
@@ -58,10 +58,9 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr
* 當{@Link isSelect}為true時,顯示這兩個按鈕
*/
@BindView
(
R2
.
id
.
btn_supplier_confirm
)
QMUIAlpha
Button
btnConfirm
;
QMUIAlpha
TextView
btnConfirm
;
@BindView
(
R2
.
id
.
btn_supplier_cancel
)
QMUIAlphaButton
btnCancel
;
QMUIAlphaTextView
btnCancel
;
private
int
pageIndex
=
0
;
/**
...
...
@@ -126,10 +125,11 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr
}
private
void
initTopBar
()
{
mTopBarSupplierList
.
setTitle
(
"供應商"
);
mTopBarSupplierList
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
initTopBar
(
mTopBarSupplierList
,
"供應商"
);
if
(
mTopBarSupplierList
.
getLeftViewList
().
size
()
<=
0
)
{
mTopBarSupplierList
.
addRightImageButton
(
R
.
drawable
.
ic_screen
,
R
.
id
.
topbar_right_screen_button
).
setOnClickListener
(
this
);
}
}
@OnClick
({
R2
.
id
.
btn_new_supplier
,
R2
.
id
.
btn_supplier_search
,
R2
.
id
.
btn_supplier_confirm
,
R2
.
id
.
btn_supplier_cancel
})
@Override
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/DashedView.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
widget
;
import
android.content.Context
;
import
android.graphics.Canvas
;
import
android.graphics.DashPathEffect
;
import
android.graphics.Paint
;
import
android.graphics.Path
;
import
android.graphics.PathEffect
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
androidx.annotation.Nullable
;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/8
* Time: 17:52
* Use:
*/
public
class
DashedView
extends
View
{
private
Context
ct
;
private
Paint
mPaint
;
private
Path
mPath
;
private
PathEffect
effects
;
private
int
width
;
private
int
height
;
private
int
defaultColor
=
0xffff0000
;
public
DashedView
(
Context
context
)
{
this
(
context
,
null
);
}
public
DashedView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
-
1
);
}
public
DashedView
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
ct
=
context
;
init
();
}
@Override
protected
void
onSizeChanged
(
int
w
,
int
h
,
int
oldw
,
int
oldh
)
{
super
.
onSizeChanged
(
w
,
h
,
oldw
,
oldh
);
width
=
w
;
height
=
h
;
}
private
void
init
()
{
//初始化,并打开抗锯齿
mPaint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
mPaint
.
setStyle
(
Paint
.
Style
.
STROKE
);
mPaint
.
setColor
(
defaultColor
);
mPaint
.
setStrokeWidth
(
dip2px
(
ct
,
1
));
mPath
=
new
Path
();
//数组含义:里面最少要有2个值,值的个数必须是偶数个。偶数位(包含0),表示实线长度,奇数位表示断开的长度
effects
=
new
DashPathEffect
(
new
float
[]{
4
,
2
},
0
);
}
/**
* 设置线的必要属性
*
* @param color 十六进制颜色值
* @param lineWidth 虚线宽度,单位是dp
*/
public
void
setLineAttribute
(
int
color
,
float
lineWidth
,
float
[]
f
)
{
if
(
color
==
0
)
{
color
=
defaultColor
;
}
if
(
lineWidth
==
0
)
{
lineWidth
=
1
;
}
if
(
f
==
null
)
{
f
=
new
float
[]{
4
,
2
};
}
effects
=
new
DashPathEffect
(
f
,
0
);
mPaint
.
setStrokeWidth
(
dip2px
(
ct
,
lineWidth
));
mPaint
.
setColor
(
color
);
invalidate
();
}
@Override
protected
void
onDraw
(
Canvas
canvas
)
{
super
.
onDraw
(
canvas
);
//定义起点
mPath
.
moveTo
(
0
,
0
);
//定义终点
if
(
width
>
height
)
{
//宽度比高度大,是横线
mPath
.
lineTo
(
width
,
0
);
}
else
{
//竖线。(根据实际情况,这里不考虑宽高相等情况)
mPath
.
lineTo
(
0
,
height
);
}
mPaint
.
setPathEffect
(
effects
);
canvas
.
drawPath
(
mPath
,
mPaint
);
}
private
static
int
dip2px
(
Context
context
,
float
dpValue
)
{
final
float
scale
=
context
.
getResources
().
getDisplayMetrics
().
density
;
return
(
int
)
(
dpValue
*
scale
+
0.5f
);
}
}
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/ScreenView.java
View file @
5b0327e5
...
...
@@ -3,17 +3,23 @@ package com.gingersoft.supply_chain.mvp.ui.widget;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.EditText
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
androidx.annotation.Nullable
;
import
com.gingersoft.gsa.cloud.common.ui.view.timeselect.TimePickerView
;
import
com.gingersoft.gsa.cloud.common.utils.time.TimePickerUtils
;
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
;
import
com.gingersoft.supply_chain.R
;
import
com.gingersoft.supply_chain.R2
;
import
java.util.Calendar
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
...
...
@@ -44,6 +50,13 @@ public class ScreenView extends FrameLayout implements View.OnClickListener {
TextView
tvEndTime
;
@BindView
(
R2
.
id
.
iv_switch_time
)
ImageView
ivSwitchTime
;
@BindView
(
R2
.
id
.
layout_purchase_list_screen
)
LinearLayout
screenLayout
;
private
Calendar
startTime
=
Calendar
.
getInstance
();
private
Calendar
endTime
=
startTime
;
public
ScreenView
(
Context
context
)
{
this
(
context
,
null
);
...
...
@@ -63,19 +76,29 @@ public class ScreenView extends FrameLayout implements View.OnClickListener {
ButterKnife
.
bind
(
this
,
view
);
tvStartTime
.
setText
(
TimeUtils
.
getCurrentDate
(
TimeUtils
.
DATE_FORMAT_DATE
));
tvEndTime
.
setText
(
TimeUtils
.
getCurrentDate
(
TimeUtils
.
DATE_FORMAT_DATE
));
this
.
addView
(
view
);
}
@OnClick
({
R2
.
id
.
btn_screen_purchase_order_confirm
,
R2
.
id
.
btn_screen_purchase_order_cancel
,
R2
.
id
.
iv_screen_purchase_order_switch_num
,
R2
.
id
.
iv_screen_purchase_order_switch_supplier_name
,
R2
.
id
.
iv_switch_food_name
,
R2
.
id
.
tv_screen_purchase_order_start_time
,
R2
.
id
.
tv_screen_purchase_order_end_time
,
R2
.
id
.
iv_switch_time
})
public
ScreenView
setLayoutMarginTop
(
int
marginTop
)
{
FrameLayout
.
LayoutParams
params
=
new
FrameLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
params
.
topMargin
=
marginTop
;
screenLayout
.
setLayoutParams
(
params
);
return
this
;
}
@OnClick
({
R2
.
id
.
layout_screen_view
,
R2
.
id
.
btn_screen_purchase_order_confirm
,
R2
.
id
.
btn_screen_purchase_order_cancel
,
R2
.
id
.
iv_screen_purchase_order_switch_num
,
R2
.
id
.
iv_screen_purchase_order_switch_supplier_name
,
R2
.
id
.
iv_switch_food_name
,
R2
.
id
.
tv_screen_purchase_order_start_time
,
R2
.
id
.
tv_screen_purchase_order_end_time
,
R2
.
id
.
iv_switch_time
})
@Override
public
void
onClick
(
View
v
)
{
int
viewId
=
v
.
getId
();
if
(
viewId
==
R
.
id
.
btn_screen_purchase_order_confirm
)
{
if
(
viewId
==
R
.
id
.
layout_screen_view
)
{
this
.
setVisibility
(
GONE
);
}
else
if
(
viewId
==
R
.
id
.
btn_screen_purchase_order_confirm
)
{
//確認
this
.
setVisibility
(
GONE
);
}
else
if
(
viewId
==
R
.
id
.
btn_screen_purchase_order_cancel
)
{
//取消
this
.
setVisibility
(
GONE
);
}
else
if
(
viewId
==
R
.
id
.
iv_screen_purchase_order_switch_num
)
{
//切換訂單編號排序
...
...
@@ -87,10 +110,18 @@ public class ScreenView extends FrameLayout implements View.OnClickListener {
}
else
if
(
viewId
==
R
.
id
.
tv_screen_purchase_order_start_time
)
{
//選擇開始時間
TimePickerView
timePickerView
=
TimePickerUtils
.
showDatePicker
(
getContext
(),
(
date
,
v1
)
->
{
startTime
.
setTime
(
date
);
tvStartTime
.
setText
(
TimeUtils
.
DATE_FORMAT_DATE
.
format
(
date
));
});
timePickerView
.
setDate
(
startTime
);
}
else
if
(
viewId
==
R
.
id
.
tv_screen_purchase_order_end_time
)
{
//選擇結束時間
TimePickerView
timePickerView
=
TimePickerUtils
.
showDatePicker
(
getContext
(),
(
date
,
v1
)
->
{
endTime
.
setTime
(
date
);
tvEndTime
.
setText
(
TimeUtils
.
DATE_FORMAT_DATE
.
format
(
date
));
});
timePickerView
.
setDate
(
endTime
);
}
else
if
(
viewId
==
R
.
id
.
iv_switch_time
)
{
//切換時間的排序
...
...
supply-chain-module/src/main/java/com/gingersoft/supply_chain/mvp/ui/widget/SeekBarPressure.java
0 → 100644
View file @
5b0327e5
package
com
.
gingersoft
.
supply_chain
.
mvp
.
ui
.
widget
;
import
android.animation.Animator
;
import
android.animation.ObjectAnimator
;
import
android.animation.ValueAnimator
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.graphics.Canvas
;
import
android.graphics.Color
;
import
android.graphics.Paint
;
import
android.graphics.Rect
;
import
android.graphics.RectF
;
import
android.util.AttributeSet
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
androidx.core.content.ContextCompat
;
import
com.gingersoft.supply_chain.R
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/11
* Time: 12:11
* Use:
*/
public
class
SeekBarPressure
extends
View
implements
ValueAnimator
.
AnimatorUpdateListener
,
Animator
.
AnimatorListener
{
/**
* SeekBar最小值
*/
int
minValue
;
/**
* SeekBar共包含多少个坐标点
*/
int
pointCount
;
/**
* 每个分段代表的数值
*/
private
int
perValue
;
/**
* 分段的端点坐标记录数组,长度等于pointCount
*/
Point
[]
mPoints
;
/**
* SeekBar长宽比
*/
float
mLWRatio
=
1
f
/
10
f
;
CircleIndicator
mLeftCI
;
//左侧滑动指示器
CircleIndicator
mRightCI
;
//右侧滑动指示器
int
mR
;
//滑动指示器半径
int
mPadding
=
8
;
//指定的Padding
Paint
linePaint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
Paint
indicatorPaint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
Paint
strokePaint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
Paint
innerCircle
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
int
LINE_WIDTH
=
2
;
//线宽
/**
* 滑动指示器颜色
*/
private
int
indicatorColor
;
/**
* 2个滑动器之间的线颜色
*/
private
int
indicatorLineColor
;
/**
* 背景线颜色
*/
private
int
backLineColor
;
/**
* 圆形区域
*/
private
RectF
mRectF
;
/**
* 当前SeekBar是否有滑动指示器处于被滑动状态
*/
boolean
isSelected
=
false
;
/**
* 属性动画是否正在执行
*/
boolean
isPlaying
;
/**
* 与滑动指示器最近的mPoints index值
*/
private
int
mCloseIndex
;
/**
* 动画时长
*/
private
final
long
ANIM_DURATION
=
200
;
public
SeekBarPressure
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
//无视padding属性 使用内部定义的mPadding
setPadding
(
0
,
0
,
0
,
0
);
init
(
context
,
attrs
);
}
private
void
init
(
Context
context
,
AttributeSet
attrs
)
{
//获取自定义属性
TypedArray
a
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
SeekBarPressure
);
perValue
=
a
.
getInt
(
R
.
styleable
.
SeekBarPressure_per_value
,
0
);
minValue
=
a
.
getInt
(
R
.
styleable
.
SeekBarPressure_min
,
0
);
pointCount
=
a
.
getInt
(
R
.
styleable
.
SeekBarPressure_point_count
,
0
);
backLineColor
=
a
.
getColor
(
R
.
styleable
.
SeekBarPressure_back_line_color
,
Color
.
LTGRAY
);
indicatorLineColor
=
a
.
getInt
(
R
.
styleable
.
SeekBarPressure_indicator_line_color
,
Color
.
GREEN
);
indicatorColor
=
a
.
getInt
(
R
.
styleable
.
SeekBarPressure_indicator
,
Color
.
GRAY
);
a
.
recycle
();
//初始化SeekBar内部坐标对象
mPoints
=
new
Point
[
pointCount
];
for
(
int
i
=
0
;
i
<
mPoints
.
length
;
i
++)
{
mPoints
[
i
]
=
new
Point
(
minValue
+
i
*
perValue
);
}
//初始化2个滑动指示器 默认左边的位于mPoints数组第一个,右边位于mPoints数组最后一个
mLeftCI
=
new
CircleIndicator
();
mLeftCI
.
setPoint
(
mPoints
[
0
]);
mRightCI
=
new
CircleIndicator
();
mRightCI
.
setPoint
(
mPoints
[
mPoints
.
length
-
1
]);
//初始化Paint
linePaint
.
setStyle
(
Paint
.
Style
.
STROKE
);
linePaint
.
setStrokeCap
(
Paint
.
Cap
.
ROUND
);
linePaint
.
setStrokeWidth
(
QMUIDisplayHelper
.
dpToPx
(
LINE_WIDTH
));
//初始化滑动指示器Paint
indicatorPaint
.
setStyle
(
Paint
.
Style
.
FILL
);
indicatorPaint
.
setColor
(
indicatorColor
);
//设置阴影 注意:当前view需要添加 android:layerType="software"
indicatorPaint
.
setShadowLayer
(
10
,
2
,
2
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
alpha_20_black
));
// strokePaint.setStyle(Paint.Style.STROKE);
// strokePaint.setColor(Color.parseColor("#000000"));
innerCircle
.
setStyle
(
Paint
.
Style
.
FILL
);
innerCircle
.
setColor
(
Color
.
parseColor
(
"#1196DB"
));
//初始化圆形区域
mRectF
=
new
RectF
();
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
int
size
=
MeasureSpec
.
getSize
(
widthMeasureSpec
);
int
heightSize
=
(
int
)
(
size
*
mLWRatio
);
int
spec
=
MeasureSpec
.
makeMeasureSpec
(
heightSize
,
MeasureSpec
.
EXACTLY
);
//设置View的长宽比
setMeasuredDimension
(
widthMeasureSpec
,
spec
);
}
@Override
protected
void
onSizeChanged
(
int
w
,
int
h
,
int
oldw
,
int
oldh
)
{
super
.
onSizeChanged
(
w
,
h
,
oldw
,
oldh
);
//CircleIndicator半径
mR
=
h
/
2
-
mPadding
;
//指定滑动指示器半径
mLeftCI
.
setR
(
mR
);
mRightCI
.
setR
(
mR
);
//分段点坐标 mPoints数组 均分SeekBar宽度
int
y
=
h
/
2
;
int
perWidth
=
(
w
-
2
*
mPadding
-
2
*
mR
)
/
(
mPoints
.
length
-
1
);
for
(
int
i
=
0
;
i
<
mPoints
.
length
;
i
++)
{
mPoints
[
i
].
setX
(
mPadding
+
mR
+
i
*
perWidth
);
mPoints
[
i
].
setY
(
y
);
}
//更新一下 滑动指示器当前的坐标
mLeftCI
.
setPoint
(
mLeftCI
.
getPoint
());
mRightCI
.
setPoint
(
mRightCI
.
getPoint
());
//回调当前Activity 告知2个滑动指示器的属性
callBack
();
}
@Override
protected
void
onDraw
(
Canvas
canvas
)
{
super
.
onDraw
(
canvas
);
canvas
.
drawColor
(
Color
.
WHITE
);
if
(
mPoints
.
length
>=
2
)
{
//画背景线
linePaint
.
setColor
(
backLineColor
);
canvas
.
drawLine
(
mPoints
[
0
].
getX
(),
mPoints
[
0
].
getY
()
,
mPoints
[
mPoints
.
length
-
1
].
getX
(),
mPoints
[
mPoints
.
length
-
1
].
getY
(),
linePaint
);
//画区间线
linePaint
.
setColor
(
indicatorLineColor
);
canvas
.
drawLine
(
mLeftCI
.
getCurX
(),
mLeftCI
.
getCurY
(),
mRightCI
.
getCurX
(),
mRightCI
.
getCurY
(),
linePaint
);
//画左边的Indicator
mRectF
.
set
(
mLeftCI
.
getCurX
()
-
mR
,
mLeftCI
.
getCurY
()
-
mR
,
mLeftCI
.
getCurX
()
+
mR
,
mLeftCI
.
getCurY
()
+
mR
);
canvas
.
drawOval
(
mRectF
,
indicatorPaint
);
//畫左側indicator中間的圓
mRectF
.
set
((
mRectF
.
left
+
mR
)
-
mR
/
3
,
(
mRectF
.
top
+
mR
)
-
mR
/
3
,
(
mRectF
.
right
-
mR
)
+
mR
/
3
,
(
mRectF
.
top
+
mR
)
+
mR
/
3
);
canvas
.
drawOval
(
mRectF
,
innerCircle
);
//画右边的Indicator
mRectF
.
set
(
mRightCI
.
getCurX
()
-
mR
,
mRightCI
.
getCurY
()
-
mR
,
mRightCI
.
getCurX
()
+
mR
,
mRightCI
.
getCurY
()
+
mR
);
canvas
.
drawOval
(
mRectF
,
indicatorPaint
);
//畫右側indicator中間的圓
mRectF
.
set
((
mRectF
.
left
+
mR
)
-
mR
/
3
,
(
mRectF
.
top
+
mR
)
-
mR
/
3
,
(
mRectF
.
right
-
mR
)
+
mR
/
3
,
(
mRectF
.
top
+
mR
)
+
mR
/
3
);
canvas
.
drawOval
(
mRectF
,
innerCircle
);
}
}
@Override
public
boolean
onTouchEvent
(
MotionEvent
event
)
{
//如果当前正在执行动画 则忽略用户点击
if
(
isPlaying
)
{
return
true
;
}
float
x
=
event
.
getX
();
float
y
=
event
.
getY
();
switch
(
event
.
getAction
())
{
case
MotionEvent
.
ACTION_DOWN
:
//检查当前按下的坐标是否命中滑动指示器
isSelected
=
checkPoint
(
x
,
y
);
break
;
case
MotionEvent
.
ACTION_MOVE
:
//在命中的情况下,滑动指示器会在有限范围内滑动
move
(
x
);
break
;
case
MotionEvent
.
ACTION_UP
:
//当Up时,检查是否需要开启属性动画
reset
();
break
;
}
//如果已经有滑动指示器呗滑动了,就需要刷新当前View了
if
(
isSelected
)
{
invalidate
();
}
return
true
;
}
private
void
reset
()
{
//重置滑动状态
isSelected
=
false
;
//执行动画
if
(
mLeftCI
.
isTouch
())
{
mCloseIndex
=
getCloseIndex
(
mLeftCI
);
statAnim
(
mLeftCI
,
mCloseIndex
);
}
if
(
mRightCI
.
isTouch
())
{
mCloseIndex
=
getCloseIndex
(
mRightCI
);
statAnim
(
mRightCI
,
mCloseIndex
);
}
mLeftCI
.
setIsTouch
(
false
);
mRightCI
.
setIsTouch
(
false
);
}
/**
* 加载动画
*/
private
void
statAnim
(
CircleIndicator
rightCI
,
int
closeIndex
)
{
ObjectAnimator
animator
=
ObjectAnimator
.
ofInt
(
rightCI
,
"curX"
,
rightCI
.
getCurX
(),
mPoints
[
closeIndex
].
getX
());
animator
.
addUpdateListener
(
this
);
animator
.
addListener
(
this
);
animator
.
setDuration
(
ANIM_DURATION
);
animator
.
start
();
}
/**
* 获取距离 该Indicator最近的 坐标点
*
* @param indicator
* @return
*/
private
int
getCloseIndex
(
CircleIndicator
indicator
)
{
int
curX
=
indicator
.
getCurX
();
int
distance
=
Integer
.
MAX_VALUE
;
int
index
=
0
;
//循环找出距离当前indicator 最近的坐标对象
for
(
int
i
=
0
;
i
<
mPoints
.
length
;
i
++)
{
int
abs
=
Math
.
abs
(
curX
-
mPoints
[
i
].
getX
());
if
(
abs
<=
distance
)
{
distance
=
abs
;
index
=
i
;
}
}
if
(
indicator
.
equals
(
mLeftCI
))
{
//如果是左边的Indicator,那么最大的index不能超过 右边的Indicator所属的坐标index
if
(
mPoints
[
index
].
getX
()
>=
mRightCI
.
getCurX
())
{
index
--;
}
return
index
;
}
if
(
indicator
.
equals
(
mRightCI
))
{
//同理
if
(
mPoints
[
index
].
getX
()
<=
mLeftCI
.
getCurX
())
{
index
++;
}
return
index
;
}
return
index
;
}
private
void
move
(
float
x
)
{
if
(
mLeftCI
.
isTouch
())
{
//如果左边的Indicator呗拖拽,其x坐标应该在 第一个坐标 和右边的Indicator 之间
//即限定 indicator可移动的范围
if
(
x
>=
mPoints
[
0
].
getX
()
&&
x
<
mRightCI
.
getCurX
())
{
mLeftCI
.
setCurX
((
int
)
x
);
}
return
;
}
//同理
if
(
mRightCI
.
isTouch
())
{
if
(
x
<=
mPoints
[
mPoints
.
length
-
1
].
getX
()
&&
x
>
mLeftCI
.
getCurX
())
{
mRightCI
.
setCurX
((
int
)
x
);
}
}
}
/**
* 检查 Down的x y是否命中 CircleIndicator,如果命中更新属性
*
* @param x
* @param y
* @return true 命中, false 为命中
*/
private
boolean
checkPoint
(
float
x
,
float
y
)
{
boolean
containsL
=
mLeftCI
.
getRect
().
contains
((
int
)
x
,
(
int
)
y
);
if
(
containsL
)
{
mLeftCI
.
setIsTouch
(
true
);
return
true
;
}
boolean
containsR
=
mRightCI
.
getRect
().
contains
((
int
)
x
,
(
int
)
y
);
if
(
containsR
)
{
mRightCI
.
setIsTouch
(
true
);
return
true
;
}
return
false
;
}
/**
* 设置2个Indicator的位置
*
* @param left
* @param right
*/
public
void
setPos
(
int
left
,
int
right
)
{
if
(
right
>
left
&&
right
>=
0
&&
left
>=
0
&&
right
<=
pointCount
)
{
mLeftCI
.
setPoint
(
mPoints
[
left
]);
mRightCI
.
setPoint
(
mPoints
[
right
]);
callBack
();
invalidate
();
}
}
//addUpdateListener动画回调部分
@Override
public
void
onAnimationUpdate
(
ValueAnimator
animation
)
{
//每次修改完成属性 就应该刷新当前View
invalidate
();
}
//addListener动画回调部分
@Override
public
void
onAnimationStart
(
Animator
animation
)
{
//动画执行开始
isPlaying
=
true
;
}
@Override
public
void
onAnimationEnd
(
Animator
animation
)
{
CircleIndicator
indicator
=
(
CircleIndicator
)
((
ObjectAnimator
)
animation
).
getTarget
();
//更新被移动Indicator 坐标属性
indicator
.
setPoint
(
mPoints
[
mCloseIndex
]);
//动画执行结束
isPlaying
=
false
;
//回调Activity告知 滑动指示器信息
callBack
();
}
@Override
public
void
onAnimationCancel
(
Animator
animation
)
{
}
@Override
public
void
onAnimationRepeat
(
Animator
animation
)
{
}
/**
* SeekBar被拖拽的滑动指示器
*/
public
class
CircleIndicator
{
int
curX
;
//indicator x坐标
int
curY
;
//indicator y坐标
int
mR
;
//indicator 半径
/**
* 当前滑动指示器附着的坐标点
*/
Point
mPoint
;
/**
* 是否被触摸
*/
boolean
isTouch
;
/**
* Indicator 所包含的矩形区域
*/
Rect
mRect
=
new
Rect
();
/**
* 获取当前Indicator所在的矩形区域
*
* @return Rect
*/
public
Rect
getRect
()
{
mRect
.
set
(
curX
-
mR
,
curY
-
mR
,
curX
+
mR
,
curY
+
mR
);
return
mRect
;
}
public
boolean
isTouch
()
{
return
isTouch
;
}
public
void
setIsTouch
(
boolean
isTouch
)
{
this
.
isTouch
=
isTouch
;
}
public
Point
getPoint
()
{
return
mPoint
;
}
public
void
setPoint
(
Point
point
)
{
mPoint
=
point
;
curX
=
point
.
getX
();
curY
=
point
.
getY
();
invalidate
();
}
public
void
setPosition
(
Point
point
)
{
curX
=
point
.
getX
();
curY
=
point
.
getY
();
}
public
int
getR
()
{
return
mR
;
}
public
void
setR
(
int
r
)
{
mR
=
r
;
}
public
int
getCurX
()
{
return
curX
;
}
public
void
setCurX
(
int
curX
)
{
this
.
curX
=
curX
;
}
public
int
getCurY
()
{
return
curY
;
}
public
void
setCurY
(
int
curY
)
{
this
.
curY
=
curY
;
}
}
/**
* SeekBar内部的 坐标类
*/
public
class
Point
{
/**
* 当前坐标点所代表的数值
*/
int
mark
;
int
x
;
//x坐标
int
y
;
//y坐标
public
Point
(
int
mark
)
{
this
.
mark
=
mark
;
}
public
int
getMark
()
{
return
mark
;
}
public
void
setMark
(
int
mark
)
{
this
.
mark
=
mark
;
}
public
int
getX
()
{
return
x
;
}
public
void
setX
(
int
x
)
{
this
.
x
=
x
;
}
public
int
getY
()
{
return
y
;
}
public
void
setY
(
int
y
)
{
this
.
y
=
y
;
}
}
public
interface
OnSeekFinishListener
{
void
seekPos
(
CircleIndicator
left
,
CircleIndicator
right
);
}
OnSeekFinishListener
mListener
;
public
void
setListener
(
OnSeekFinishListener
listener
)
{
mListener
=
listener
;
}
private
void
callBack
()
{
if
(
mListener
!=
null
)
{
mListener
.
seekPos
(
mLeftCI
,
mRightCI
);
}
}
}
\ No newline at end of file
supply-chain-module/src/main/res/drawable-xxhdpi/ic_seekbar_btn.png
0 → 100644
View file @
5b0327e5
1.95 KB
supply-chain-module/src/main/res/drawable/shape_category_dotted.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<rotate
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:fromDegrees=
"90"
android:toDegrees=
"90"
>
<shape
android:shape=
"line"
>
<stroke
android:width=
"@dimen/dp_1"
android:color=
"@color/order_category_grading_line_color"
android:dashWidth=
"@dimen/dp_2"
android:dashGap=
"@dimen/dp_1"
/>
</shape>
</rotate>
\ No newline at end of file
supply-chain-module/src/main/res/drawable/shape_gray_circular.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"oval"
>
<solid
android:color=
"@color/color_f0"
/>
</shape>
\ No newline at end of file
supply-chain-module/src/main/res/drawable/shape_seekbar_bg.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<size
android:height=
"@dimen/dp_2"
/>
<solid
android:color=
"@color/color_ea"
/>
</shape>
\ No newline at end of file
supply-chain-module/src/main/res/layout/fragment_food_ingredients.xml
View file @
5b0327e5
...
...
@@ -98,11 +98,24 @@
android:textSize=
"@dimen/dp_14"
/>
</com.qmuiteam.qmui.alpha.QMUIAlphaLinearLayout>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_food_ingredients_category"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
<!-- 二級分類單獨裝-->
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_food_ingredients_second_category"
android:layout_width=
"match_parent"
android:visibility=
"gone"
android:layout_height=
"match_parent"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
</FrameLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
...
...
@@ -131,9 +144,9 @@
android:background=
"@drawable/shape_app_btn"
android:gravity=
"center"
android:text=
"+新增食材"
android:visibility=
"gone"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_16"
/>
android:textSize=
"@dimen/dp_16"
android:visibility=
"gone"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/btn_food_ingredients_confirm"
...
...
supply-chain-module/src/main/res/layout/fragment_order_content.xml
View file @
5b0327e5
...
...
@@ -7,7 +7,7 @@
android:background=
"@color/supply_chain_bg_color"
android:orientation=
"vertical"
>
<include
layout=
"@layout/
include_top
bar"
/>
<include
layout=
"@layout/
supply_chain_top_
bar"
/>
<LinearLayout
android:layout_width=
"match_parent"
...
...
supply-chain-module/src/main/res/layout/fragment_purchase_list.xml
View file @
5b0327e5
...
...
@@ -78,6 +78,12 @@
</com.qmuiteam.qmui.layout.QMUILinearLayout>
</LinearLayout>
<com.gingersoft.supply_chain.mvp.ui.widget.ScreenView
android:id=
"@+id/screen_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:visibility=
"gone"
/>
<com.qmuiteam.qmui.widget.tab.QMUITabSegment2
android:id=
"@+id/purchase_list_tabSegment"
android:layout_width=
"match_parent"
...
...
supply-chain-module/src/main/res/layout/fragment_send_msg.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_f0"
android:orientation=
"vertical"
>
<include
layout=
"@layout/supply_chain_top_bar"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:id=
"@+id/layout_contact_information"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_8"
android:layout_marginRight=
"@dimen/dp_20"
android:background=
"@drawable/shape_dialog_bg"
android:orientation=
"vertical"
android:paddingTop=
"@dimen/dp_18"
android:paddingBottom=
"@dimen/dp_25"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_12"
android:text=
"請選擇發送方式:"
android:textColor=
"#ff1c1b1b"
android:textSize=
"@dimen/dp_18"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_12"
android:layout_marginRight=
"@dimen/dp_12"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_14"
android:layout_marginBottom=
"@dimen/dp_14"
android:layout_weight=
"1"
android:text=
"Email"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<CheckBox
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:button=
"@drawable/selector_checkbox"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_eee_dividing_line"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_12"
android:layout_marginRight=
"@dimen/dp_12"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_14"
android:layout_marginBottom=
"@dimen/dp_14"
android:layout_weight=
"1"
android:text=
"SMS"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<CheckBox
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:button=
"@drawable/selector_checkbox"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_eee_dividing_line"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_12"
android:layout_marginRight=
"@dimen/dp_12"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_14"
android:layout_marginBottom=
"@dimen/dp_14"
android:layout_weight=
"1"
android:text=
"Efax"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<CheckBox
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:button=
"@drawable/selector_checkbox"
/>
</LinearLayout>
<View
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_5"
android:background=
"@color/color_aaa"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_12"
android:layout_marginRight=
"@dimen/dp_12"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_14"
android:layout_marginBottom=
"@dimen/dp_14"
android:layout_weight=
"1"
android:text=
"WhatsApp"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<CheckBox
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:button=
"@drawable/selector_checkbox"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_eee_dividing_line"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_12"
android:layout_marginRight=
"@dimen/dp_12"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_14"
android:layout_marginBottom=
"@dimen/dp_14"
android:layout_weight=
"1"
android:text=
"WeChat"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<CheckBox
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:button=
"@drawable/selector_checkbox"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_eee_dividing_line"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_12"
android:layout_marginRight=
"@dimen/dp_12"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_14"
android:layout_marginBottom=
"@dimen/dp_14"
android:layout_weight=
"1"
android:text=
"Line"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<CheckBox
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:button=
"@drawable/selector_checkbox"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_eee_dividing_line"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_12"
android:layout_marginRight=
"@dimen/dp_12"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_14"
android:layout_marginBottom=
"@dimen/dp_14"
android:layout_weight=
"1"
android:text=
"Kakao Talk"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<CheckBox
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:button=
"@drawable/selector_checkbox"
/>
</LinearLayout>
</LinearLayout>
<View
android:id=
"@+id/horizontal_dotted"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/dp_2"
android:background=
"@drawable/shape_dotted"
android:layerType=
"software"
app:layout_constraintLeft_toLeftOf=
"@id/layout_contact_information"
app:layout_constraintRight_toRightOf=
"@id/layout_contact_information"
app:layout_constraintTop_toBottomOf=
"@id/layout_contact_information"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
android:layout_marginRight=
"@dimen/dp_20"
android:layout_marginBottom=
"@dimen/dp_20"
android:background=
"@color/white"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:paddingLeft=
"@dimen/dp_15"
android:paddingTop=
"@dimen/dp_15"
android:paddingRight=
"@dimen/dp_15"
android:paddingBottom=
"@dimen/dp_25"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/horizontal_dotted"
>
<ImageView
android:layout_width=
"@dimen/dp_115"
android:layout_height=
"@dimen/dp_115"
android:scaleType=
"fitXY"
android:src=
"@drawable/img_search_keyboard_bg"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:text=
"是否生成二維碼發送至供應商?"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_18"
android:orientation=
"horizontal"
>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/btn_supplier_confirm"
style=
"@style/Save_Btn_Style"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"確定"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/btn_supplier_cancel"
style=
"@style/Save_Btn_Style"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
android:layout_weight=
"1"
android:background=
"@drawable/shape_black_border_small_radius"
android:text=
"取消"
android:textColor=
"@color/color_3c"
/>
</LinearLayout>
</LinearLayout>
<View
android:id=
"@+id/reference_line_left"
android:layout_width=
"@dimen/dp_1"
android:layout_height=
"match_parent"
app:layout_constraintLeft_toLeftOf=
"@id/layout_contact_information"
/>
<View
android:id=
"@+id/reference_line_right"
android:layout_width=
"@dimen/dp_1"
android:layout_height=
"match_parent"
app:layout_constraintLeft_toRightOf=
"@id/layout_contact_information"
/>
<View
android:layout_width=
"@dimen/dp_20"
android:layout_height=
"@dimen/dp_20"
android:background=
"@drawable/shape_gray_circular"
app:layout_constraintBottom_toBottomOf=
"@id/horizontal_dotted"
app:layout_constraintLeft_toLeftOf=
"@id/reference_line_left"
app:layout_constraintRight_toRightOf=
"@id/reference_line_left"
app:layout_constraintTop_toTopOf=
"@id/horizontal_dotted"
/>
<View
android:layout_width=
"@dimen/dp_20"
android:layout_height=
"@dimen/dp_20"
android:background=
"@drawable/shape_gray_circular"
app:layout_constraintBottom_toBottomOf=
"@id/horizontal_dotted"
app:layout_constraintLeft_toLeftOf=
"@id/reference_line_right"
app:layout_constraintRight_toRightOf=
"@id/reference_line_right"
app:layout_constraintTop_toTopOf=
"@id/horizontal_dotted"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
supply-chain-module/src/main/res/layout/fragment_supplier_list.xml
View file @
5b0327e5
...
...
@@ -22,13 +22,13 @@
<LinearLayout
android:id=
"@+id/layout_supplier_search"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_4
0
"
android:layout_height=
"@dimen/dp_4
7
"
android:background=
"@drawable/shape_white_eight_corners_bg"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"@dimen/dp_2
0
"
android:layout_height=
"@dimen/dp_2
0
"
android:layout_width=
"@dimen/dp_2
4
"
android:layout_height=
"@dimen/dp_2
4
"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"@dimen/dp_10"
android:src=
"@drawable/ic_search"
/>
...
...
@@ -78,34 +78,41 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginBottom=
"@dimen/dp_10"
android:orientation=
"horizontal"
>
<com.qmuiteam.qmui.alpha.QMUIAlpha
Button
<com.qmuiteam.qmui.alpha.QMUIAlpha
TextView
android:id=
"@+id/btn_new_supplier"
style=
"@style/Save_Btn_Style"
android:paddingTop=
"@dimen/dp_11"
android:paddingBottom=
"@dimen/dp_11"
android:text=
"+新增供應商"
android:visibility=
"visible"
/>
<com.qmuiteam.qmui.alpha.QMUIAlpha
Button
<com.qmuiteam.qmui.alpha.QMUIAlpha
TextView
android:id=
"@+id/btn_supplier_confirm"
style=
"@style/Save_Btn_Style"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
android:layout_weight=
"1"
android:text=
"確定"
/>
android:paddingTop=
"@dimen/dp_11"
android:paddingBottom=
"@dimen/dp_11"
android:text=
"確定"
android:visibility=
"gone"
/>
<com.qmuiteam.qmui.alpha.QMUIAlpha
Button
<com.qmuiteam.qmui.alpha.QMUIAlpha
TextView
android:id=
"@+id/btn_supplier_cancel"
style=
"@style/Save_Btn_Style"
android:layout_width=
"0dp"
android:visibility=
"gone"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
android:layout_weight=
"1"
android:textColor=
"@color/color_3c"
android:background=
"@drawable/shape_black_border_small_radius"
android:text=
"取消"
/>
android:paddingTop=
"@dimen/dp_11"
android:paddingBottom=
"@dimen/dp_11"
android:text=
"取消"
android:textColor=
"@color/color_3c"
android:visibility=
"gone"
/>
</LinearLayout>
</RelativeLayout>
...
...
supply-chain-module/src/main/res/layout/item_food_ingredient.xml
View file @
5b0327e5
...
...
@@ -7,53 +7,10 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_1
0
"
android:background=
"@
drawable/shape_white_eight_corners_bg
"
android:layout_marginTop=
"@dimen/dp_1"
android:background=
"@
color/white
"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/layout_food_supplier_info"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_40"
android:layout_marginLeft=
"@dimen/dp_8"
android:layout_marginRight=
"@dimen/dp_8"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"供應商:"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_17"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_food_item_supplier_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"海鮮天地"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_17"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/iv_supplier_edit"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:padding=
"@dimen/dp_10"
android:src=
"@drawable/ic_blue_edit"
/>
<ImageView
android:id=
"@+id/iv_supplier_delete"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:padding=
"@dimen/dp_10"
android:src=
"@drawable/ic_red_delete"
/>
</LinearLayout>
<include
android:id=
"@+id/line_supplier_info"
layout=
"@layout/include_horizontal_color_eee_dividing_line"
/>
...
...
@@ -62,6 +19,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_8"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<CheckBox
...
...
@@ -74,26 +32,11 @@
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_14"
/>
<LinearLayout
android:layout_width=
"@dimen/dp_84"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_5"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/iv_food_ingredient_img"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_84"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_4"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_12"
tools:text=
"15/30"
/>
</LinearLayout>
android:layout_width=
"@dimen/dp_84"
android:layout_height=
"@dimen/dp_84"
android:layout_marginLeft=
"@dimen/dp_5"
/>
<LinearLayout
android:layout_width=
"match_parent"
...
...
@@ -107,45 +50,31 @@
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"編號:"
/>
<TextView
android:id=
"@+id/tv_food_item_no"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textSize=
"@dimen/dp_12"
tools:text=
"SP001"
/>
<ImageView
android:id=
"@+id/iv_order_food_delete"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:src=
"@drawable/ic_red_delete"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyl
e"
android:id=
"@+id/tv_food_item_supplier_nam
e"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"品名:"
/>
android:text=
"海鮮天地"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_17"
android:textStyle=
"bold"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_food_item_name"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textStyle=
"bold"
tools:text=
"巴西肥牛"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
...
...
@@ -154,44 +83,61 @@
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_food_item_unit"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:text=
"單位:"
/>
android:layout_weight=
"1"
android:textSize=
"@dimen/dp_12"
tools:text=
"3KG/盒"
/>
<TextView
android:id=
"@+id/tv_food_item_unit"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"3KG/盒"
/>
android:text=
"15/30"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_12"
android:textStyle=
"bold"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"價格:"
/>
<TextView
android:id=
"@+id/tv_food_item_price"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"
match_parent
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textColor=
"@color/required_color"
android:textStyle=
"bold"
tools:text=
"$100.00"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/iv_supplier_edit"
android:layout_width=
"@dimen/dp_26"
android:layout_height=
"@dimen/dp_26"
android:padding=
"@dimen/dp_5"
android:src=
"@drawable/ic_blue_edit"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/iv_supplier_delete"
android:layout_width=
"@dimen/dp_26"
android:layout_height=
"@dimen/dp_26"
android:padding=
"@dimen/dp_5"
android:src=
"@drawable/ic_red_delete"
android:visibility=
"gone"
/>
<LinearLayout
android:id=
"@+id/layout_operation_food_num"
android:layout_width=
"match_parent"
android:divider=
"@color/color_3c"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
...
...
@@ -224,6 +170,7 @@
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
supply-chain-module/src/main/res/layout/item_order_category.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/layout_order_category_back"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_15"
android:elevation=
"@dimen/dp_5"
android:orientation=
"horizontal"
android:paddingTop=
"@dimen/dp_10"
android:paddingBottom=
"@dimen/dp_10"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:ellipsize=
"marquee"
android:gravity=
"center_vertical"
android:paddingLeft=
"@dimen/dp_5"
android:paddingRight=
"@dimen/dp_2"
android:singleLine=
"true"
android:textColor=
"@color/theme_color"
android:textSize=
"@dimen/dp_16"
android:textStyle=
"bold"
android:text=
"返回"
/>
</LinearLayout>
<androidx.cardview.widget.CardView
android:id=
"@+id/layout_category"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:cardElevation=
"@dimen/dp_10"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:elevation=
"@dimen/dp_5"
android:orientation=
"horizontal"
android:paddingLeft=
"@dimen/dp_5"
android:paddingTop=
"@dimen/dp_10"
>
<TextView
android:id=
"@+id/tv_category_name"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:button=
"@null"
android:ellipsize=
"marquee"
android:gravity=
"center_vertical"
android:paddingLeft=
"@dimen/dp_5"
android:paddingRight=
"@dimen/dp_2"
android:paddingBottom=
"@dimen/dp_10"
android:singleLine=
"true"
android:textColor=
"@color/s_btn_blue_3c_text"
android:textSize=
"@dimen/dp_14"
android:textStyle=
"bold"
tools:text=
"果蔬類"
/>
<View
android:id=
"@+id/order_primary_category_line"
android:layout_width=
"@dimen/dp_2"
android:layout_height=
"0dp"
android:background=
"#084279"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_category_name"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_order_second_category"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
supply-chain-module/src/main/res/layout/item_order_second_category.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/layout_second_category"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<RelativeLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"@dimen/dp_5"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<View
android:id=
"@+id/order_category_second_top_line"
android:layout_width=
"@dimen/dp_2"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:background=
"@color/order_category_grading_line_color"
/>
<View
android:id=
"@+id/order_category_second_bottom_line"
android:layout_width=
"@dimen/dp_2"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:background=
"@color/order_category_grading_line_color"
/>
</LinearLayout>
<View
android:id=
"@+id/tv_order_second_category_horizontal_line"
android:layout_width=
"@dimen/dp_10"
android:layout_height=
"@dimen/dp_2"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center_vertical"
android:background=
"@color/order_category_grading_line_color"
/>
</RelativeLayout>
<TextView
android:id=
"@+id/tv_order_second_category_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:button=
"@null"
android:ellipsize=
"marquee"
android:gravity=
"center_vertical"
android:paddingLeft=
"@dimen/dp_5"
android:paddingTop=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_2"
android:paddingBottom=
"@dimen/dp_10"
android:singleLine=
"true"
android:textColor=
"@color/s_btn_blue_3c_text"
android:textSize=
"@dimen/dp_14"
android:textStyle=
"bold"
tools:text=
"果蔬類"
/>
<!-- <com.gingersoft.supply_chain.mvp.ui.widget.DashedView-->
<!-- android:id="@+id/order_category_second_dashed"-->
<!-- android:layout_width="@dimen/dp_10"-->
<!-- android:layout_height="0dp"-->
<!-- android:visibility="gone"-->
<!-- android:padding="@dimen/dp_0"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="@id/tv_order_second_category_horizontal_line" />-->
<!-- <androidx.recyclerview.widget.RecyclerView-->
<!-- android:id="@+id/rv_order_third_category"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginLeft="@dimen/dp_5"-->
<!-- android:background="@color/white"-->
<!-- app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />-->
</LinearLayout>
\ No newline at end of file
supply-chain-module/src/main/res/layout/item_order_third_category.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_5"
android:elevation=
"@dimen/dp_5"
android:orientation=
"horizontal"
app:cardElevation=
"@dimen/dp_10"
>
<TextView
android:id=
"@+id/tv_order_third_category_name"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:button=
"@null"
android:ellipsize=
"marquee"
android:gravity=
"center_vertical"
android:paddingLeft=
"@dimen/dp_5"
android:paddingTop=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_2"
android:paddingBottom=
"@dimen/dp_10"
android:singleLine=
"true"
android:textColor=
"@color/s_btn_blue_3c_text"
android:textSize=
"@dimen/dp_14"
android:textStyle=
"bold"
app:layout_constraintLeft_toRightOf=
"@id/tv_order_third_category_horizontal_line"
tools:text=
"果蔬類"
/>
<com.gingersoft.supply_chain.mvp.ui.widget.DashedView
android:id=
"@+id/tv_order_third_category_horizontal_line"
android:layout_width=
"@dimen/dp_10"
android:layout_height=
"@dimen/dp_2"
app:layout_constraintBottom_toBottomOf=
"@id/tv_order_third_category_name"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_order_third_category_name"
/>
<com.gingersoft.supply_chain.mvp.ui.widget.DashedView
android:id=
"@+id/order_category_third_top_line"
android:layout_width=
"@dimen/dp_2"
android:layout_height=
"0dp"
app:layout_constraintBottom_toBottomOf=
"@id/tv_order_third_category_horizontal_line"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<com.gingersoft.supply_chain.mvp.ui.widget.DashedView
android:id=
"@+id/order_category_third_bottom_line"
android:layout_width=
"@dimen/dp_2"
android:layout_height=
"0dp"
android:padding=
"@dimen/dp_0"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_order_third_category_horizontal_line"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
supply-chain-module/src/main/res/layout/item_purchase_order.xml
View file @
5b0327e5
...
...
@@ -22,20 +22,21 @@
<TextView
android:id=
"@+id/tv_purchase_order_no"
android:layout_width=
"0dp"
android:layout_width=
"
34
0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
tools:text=
"訂單編號"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_17"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
tools:text=
"訂單編號"
/>
<ImageView
android:id=
"@+id/iv_supplier_edit"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:padding=
"@dimen/dp_10"
android:src=
"@drawable/ic_blue_edit"
/>
android:src=
"@drawable/ic_blue_edit"
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/iv_supplier_delete"
...
...
supply-chain-module/src/main/res/layout/item_second_category.xml
View file @
5b0327e5
...
...
@@ -4,6 +4,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/tv_second_category_title"
style=
"@style/Second_Category_Style"
...
...
@@ -11,11 +12,17 @@
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_3"
android:layout_marginTop=
"@dimen/dp_8"
android:layout_marginRight=
"@dimen/dp_
3
"
android:layout_marginRight=
"@dimen/dp_
4
"
android:background=
"@drawable/s_app_color_to_bf"
android:gravity=
"center"
android:textColor=
"@color/s_3c_to_white"
android:textSize=
"@dimen/dp_14"
tools:text=
"瓜果類"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaImageButton
android:id=
"@+id/iv_category_delete"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:src=
"@drawable/ic_red_circular_delete"
/>
</FrameLayout>
\ No newline at end of file
supply-chain-module/src/main/res/layout/item_shopping_cart_food.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:background=
"@drawable/shape_white_eight_corners_bg"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/layout_food_supplier_info"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_40"
android:layout_marginLeft=
"@dimen/dp_8"
android:visibility=
"gone"
android:layout_marginRight=
"@dimen/dp_8"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"供應商:"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_17"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_food_item_supplier_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"海鮮天地"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_17"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/iv_supplier_edit"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:padding=
"@dimen/dp_10"
android:src=
"@drawable/ic_blue_edit"
/>
<ImageView
android:id=
"@+id/iv_supplier_delete"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:padding=
"@dimen/dp_10"
android:src=
"@drawable/ic_red_delete"
/>
</LinearLayout>
<include
android:id=
"@+id/line_supplier_info"
layout=
"@layout/include_horizontal_color_eee_dividing_line"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_8"
android:orientation=
"horizontal"
>
<CheckBox
android:id=
"@+id/cb_order_item_all_select"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"@dimen/dp_15"
android:button=
"@drawable/selector_checkbox"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_14"
/>
<LinearLayout
android:layout_width=
"@dimen/dp_84"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_5"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/iv_food_ingredient_img"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_84"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_4"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_12"
tools:text=
"15/30"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_8"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"編號:"
/>
<TextView
android:id=
"@+id/tv_food_item_no"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
tools:text=
"SP001"
/>
<ImageView
android:id=
"@+id/iv_order_food_delete"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:src=
"@drawable/ic_red_delete"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"品名:"
/>
<TextView
android:id=
"@+id/tv_food_item_name"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:text=
"巴西肥牛"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"單位:"
/>
<TextView
android:id=
"@+id/tv_food_item_unit"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:text=
"3KG/盒"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"價格:"
/>
<TextView
android:id=
"@+id/tv_food_item_price"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:text=
"$100.00"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/layout_operation_food_num"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<com.qmuiteam.qmui.layout.QMUIButton
android:id=
"@+id/btn_food_operation_sub"
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:background=
"@drawable/ic_circle_gray_sub"
/>
<EditText
android:id=
"@+id/ed_food_ingredient_number"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_marginRight=
"@dimen/dp_10"
android:background=
"@null"
android:inputType=
"number"
android:maxLength=
"4"
android:paddingLeft=
"@dimen/dp_4"
android:paddingRight=
"@dimen/dp_4"
android:text=
"0"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_22"
/>
<com.qmuiteam.qmui.layout.QMUIButton
android:id=
"@+id/btn_food_operation_add"
android:layout_width=
"@dimen/dp_24"
android:layout_height=
"@dimen/dp_24"
android:background=
"@drawable/ic_circle_theme_add"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
supply-chain-module/src/main/res/layout/item_storage.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_10"
android:background=
"@drawable/shape_white_eight_corners_bg"
android:elevation=
"@dimen/dp_2"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_40"
android:layout_marginLeft=
"@dimen/dp_8"
android:layout_marginRight=
"@dimen/dp_8"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_storage_supplier_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_17"
android:textStyle=
"bold"
tools:text=
"供應商名稱"
/>
<ImageView
android:id=
"@+id/iv_supplier_edit"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:padding=
"@dimen/dp_10"
android:src=
"@drawable/ic_blue_edit"
/>
<ImageView
android:id=
"@+id/iv_supplier_delete"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:padding=
"@dimen/dp_10"
android:src=
"@drawable/ic_red_delete"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_eee_dividing_line"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_8"
android:orientation=
"horizontal"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"入庫單號:"
/>
<TextView
android:id=
"@+id/tv_storage_no"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
tools:text=
"123456789"
/>
<TextView
android:id=
"@+id/tv_storage_create_time"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"2020-11-20 12:00"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"訂單編號:"
/>
<TextView
android:id=
"@+id/tv_storage_order_no"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:text=
"DD0002"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"商品數量:"
/>
<TextView
android:id=
"@+id/tv_storage_goods_num"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:text=
"10"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"訂單食材:"
/>
<TextView
android:id=
"@+id/tv_storage_order_goods"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:singleLine=
"true"
tools:text=
"巴西肥牛、澳洲牛排"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"總價:"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_storage_order_total_price"
style=
"@style/Food_Ingredient_Info_TextStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textColor=
"@color/purchase_total_price_text_color"
android:textSize=
"@dimen/dp_16"
android:textStyle=
"bold"
tools:text=
"$100.00"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/dp_10"
android:layout_marginBottom=
"@dimen/dp_10"
android:gravity=
"right"
android:orientation=
"horizontal"
>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/btn_storage_buy_again"
android:layout_width=
"@dimen/dp_76"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_10"
android:background=
"@drawable/shape_bug_again_btn"
android:gravity=
"center"
android:paddingTop=
"@dimen/dp_8"
android:paddingBottom=
"@dimen/dp_8"
android:text=
"再次購買"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_12"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/btn_storage_order_state"
android:layout_width=
"@dimen/dp_76"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_10"
android:background=
"@drawable/shape_to_be_received_btn"
android:gravity=
"center"
android:paddingTop=
"@dimen/dp_8"
android:paddingBottom=
"@dimen/dp_8"
android:text=
"待收貨"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_12"
/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
supply-chain-module/src/main/res/layout/item_supplier.xml
View file @
5b0327e5
...
...
@@ -8,12 +8,13 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:paddingBottom=
"@dimen/dp_10"
android:background=
"@drawable/shape_white_eight_corners_bg"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_
40
"
android:layout_height=
"@dimen/dp_
37
"
android:layout_marginLeft=
"@dimen/dp_8"
android:layout_marginRight=
"@dimen/dp_8"
android:gravity=
"center_vertical"
...
...
@@ -24,7 +25,7 @@
android:layout_height=
"wrap_content"
android:text=
"供應商:"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_1
4
"
android:textSize=
"@dimen/dp_1
7
"
android:textStyle=
"bold"
/>
<TextView
...
...
@@ -34,7 +35,7 @@
android:layout_weight=
"1"
android:text=
"海鮮天地"
android:textColor=
"@color/black"
android:textSize=
"@dimen/dp_1
4
"
android:textSize=
"@dimen/dp_1
7
"
android:textStyle=
"bold"
/>
<ImageView
...
...
@@ -54,7 +55,7 @@
<RadioButton
android:id=
"@+id/rb_supplier"
android:layout_width=
"wrap_content"
android:layout_height=
"
wrap_cont
ent"
android:layout_height=
"
match_par
ent"
android:button=
"@drawable/selector_checkbox"
/>
</LinearLayout>
...
...
@@ -63,7 +64,9 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_8"
android:layout_marginTop=
"@dimen/dp_5"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:orientation=
"horizontal"
>
<TextView
...
...
@@ -84,7 +87,9 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_8"
android:layout_marginTop=
"@dimen/dp_2"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:orientation=
"horizontal"
>
<TextView
...
...
@@ -105,7 +110,9 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_8"
android:layout_marginTop=
"@dimen/dp_2"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:orientation=
"horizontal"
>
<TextView
...
...
@@ -126,7 +133,9 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_8"
android:layout_marginTop=
"@dimen/dp_2"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:orientation=
"horizontal"
>
<TextView
...
...
@@ -148,7 +157,9 @@
android:id=
"@+id/layout_supplier_food_info"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_8"
android:layout_marginTop=
"@dimen/dp_2"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
...
...
supply-chain-module/src/main/res/layout/layout_shopping_cart.xml
View file @
5b0327e5
...
...
@@ -16,12 +16,13 @@
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_purchase_cart_size"
android:layout_width=
"@dimen/dp_12"
android:layout_height=
"@dimen/dp_12"
android:layout_gravity=
"right"
android:autoSizeMaxTextSize=
"@dimen/dp_
6
"
android:autoSizeMaxTextSize=
"@dimen/dp_
8
"
android:gravity=
"center"
android:autoSizeMinTextSize=
"@dimen/dp_
2
"
android:autoSizeMinTextSize=
"@dimen/dp_
4
"
android:background=
"@drawable/ui_shape_red_oval"
android:text=
"3"
android:textColor=
"@color/white"
...
...
supply-chain-module/src/main/res/layout/pop_purchase_order_screen.xml
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/layout_screen_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/shape_dialog_bg"
android:background=
"@color/alpha_20_black"
android:descendantFocusability=
"beforeDescendants"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/layout_purchase_list_screen"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:clickable=
"true"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:orientation=
"vertical"
android:paddingLeft=
"@dimen/dp_20"
android:paddingRight=
"@dimen/dp_20"
...
...
@@ -19,7 +32,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16"
android:layout_marginBottom=
"@dimen/dp_16"
android:text=
"採購單號\u3000
"
android:text=
"採購單號
"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
...
...
@@ -58,7 +71,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16"
android:layout_marginBottom=
"@dimen/dp_16"
android:text=
"供應商名稱
"
android:text=
"供應商名
"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
...
...
@@ -98,7 +111,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16"
android:layout_marginBottom=
"@dimen/dp_16"
android:text=
"食材名稱\u3000
"
android:text=
"食材名稱
"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
...
...
@@ -137,7 +150,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16"
android:layout_marginBottom=
"@dimen/dp_16"
android:text=
"採購日期\u3000
"
android:text=
"採購日期
"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
...
...
@@ -193,6 +206,89 @@
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_16"
android:layout_marginBottom=
"@dimen/dp_16"
android:text=
"訂單金額"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<com.gingersoft.supply_chain.mvp.ui.widget.SeekBarPressure
android:id=
"@+id/screen_price_seekbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layerType=
"software"
app:back_line_color=
"@color/color_ea"
app:indicator=
"@color/white"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_marginRight=
"@dimen/dp_10"
app:indicator_line_color=
"@color/theme_color"
app:per_value=
"2000"
app:point_count=
"6"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"不限"
android:textColor=
"@color/color_42"
android:textSize=
"@dimen/dp_12"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"1k"
android:textColor=
"@color/color_42"
android:textSize=
"@dimen/dp_12"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"3k"
android:textColor=
"@color/color_42"
android:textSize=
"@dimen/dp_12"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"5k"
android:textColor=
"@color/color_42"
android:textSize=
"@dimen/dp_12"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"1w"
android:textColor=
"@color/color_42"
android:textSize=
"@dimen/dp_12"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"2w+"
android:textColor=
"@color/color_42"
android:textSize=
"@dimen/dp_12"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -221,4 +317,6 @@
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</LinearLayout>
</FrameLayout>
supply-chain-module/src/main/res/layout/supply_chain_top_bar.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUITopBar
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/supply_top_bar"
app:qmui_topbar_title_color=
"@color/theme_white_color"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/head_height"
android:background=
"@color/theme_color"
android:fitsSystemWindows=
"true"
/>
supply-chain-module/src/main/res/values/attrs.xml
0 → 100644
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable
name=
"SeekBarPressure"
>
<!-- SeekBar 最小值-->
<attr
name=
"min"
format=
"integer"
/>
<!-- SeekBar 2点间代表的数值-->
<attr
name=
"per_value"
format=
"integer"
/>
<!-- SeekBar供有多少个点-->
<attr
name=
"point_count"
format=
"integer"
/>
<!-- 背景线颜色-->
<attr
name=
"back_line_color"
format=
"color"
/>
<!-- 区间线颜色-->
<attr
name=
"indicator_line_color"
format=
"color"
/>
<!-- 滑动指示器 reference|-->
<attr
name=
"indicator"
format=
"color"
/>
</declare-styleable>
</resources>
\ No newline at end of file
supply-chain-module/src/main/res/values/colors.xml
View file @
5b0327e5
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"order_category_grading_line_color"
>
#084279
</color>
<color
name=
"order_category_name_unselect_color"
>
@color/color_3c
</color>
<color
name=
"order_category_name_select_color"
>
@color/theme_color
</color>
</resources>
\ No newline at end of file
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