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
da93bfc3
Commit
da93bfc3
authored
Apr 06, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
04-06 修改打印邏輯前
parent
0fd819b0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
231 additions
and
25 deletions
+231
-25
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/OtherOrderComponent.java
+1
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/WeatherRepository.kt
+10
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/OrderDetails.kt
+107
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/CoolWeatherNetwork.kt
+3
-1
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/api/WeatherService.kt
+7
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/adapter/OtherOrdersAdapter.kt
+11
-1
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/main/PageViewModel.kt
+14
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/main/PlaceholderFragment.kt
+26
-2
other_order_mode/src/main/res/drawable/shape_dialog_bg.xml
+9
-0
other_order_mode/src/main/res/layout/layout_order_info_dialog.xml
+0
-0
other_order_mode/src/main/res/layout/layout_other_order_item.xml
+3
-1
other_order_mode/src/main/res/values/styles.xml
+20
-6
print-module/src/main/java/com/joe/print/mvp/print/PrintUtils.java
+0
-0
print-module/src/main/java/com/joe/print/mvp/ui/activity/IpPrintActivity.java
+0
-11
public-base/src/main/java/com/gingersoft/gsa/cloud/base/utils/MoneyUtil.java
+13
-0
public-base/src/main/res/layout/print_kitchen.xml
+3
-3
user-login/build.gradle
+4
-0
No files found.
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/OtherOrderComponent.java
View file @
da93bfc3
...
...
@@ -41,6 +41,7 @@ public class OtherOrderComponent implements IComponent {
break
;
case
"orderActivity"
:
CCUtil
.
navigateTo
(
cc
,
OtherOrderActivity
.
class
);
CC
.
sendCCResult
(
cc
.
getCallId
(),
CCResult
.
success
());
break
;
default
:
// cc.callAsync(new IComponentCallback() {
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/WeatherRepository.kt
View file @
da93bfc3
...
...
@@ -31,6 +31,16 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
}
suspend
fun
getOrderInfo
(
orderId
:
String
)
=
withContext
(
Dispatchers
.
IO
)
{
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"orderId"
,
orderId
)
.
build
()
val
data
=
network
.
getOrderInfo
(
requestBody
)
data
}
companion
object
{
private
lateinit
var
instance
:
WeatherRepository
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/OrderDetails.kt
0 → 100644
View file @
da93bfc3
package
com.gingersoft.gsa.other_order_mode.data.model.bean
class
OrderDetails
{
/**
* success : true
* sysTime : 1585823531720
* data : [{"Order_ID":50349,"NUMBER":1,"MEMBER_NAME":"忆逝1","PRICE":88,"discount_amount":0,"PHONE":"15728241877","ORDER_NO":"26202811401145744","Lunchbox":0,"remark":"","pid":0,"PRODUCT_NAME":[{"odsId":"1650249","PRICE":"88.0","num":"1","pid":"0","PRODUCT_NAME":"脆炸粟米蟹肉餅"}],"odsId":1650249,"addressDetail":"香港長沙灣青山道479 - 479A號麗昌工廠大廈 704 室及 802 室(接待處於 704 室蘋果迷你倉 - 荔枝角 (麗昌分店)分店","DELIVERY_CHARGE":0,"order_from":7,"sender":"","SEND_TIME":"盡快送達 18:27","PAY_AMOUNT":88,"ID":50349,"CREATE_TIME":"2020-04-02 17:57:29.0","takeFoodCode":"0","RECEIVER":"張學友 先生","TOTAL_AMOUNT":"88.0"}]
*/
private
var
success
:
Boolean
=
false
private
var
sysTime
:
Long
=
0
private
var
data
:
List
<
DataBean
>?
=
null
fun
isSuccess
():
Boolean
{
return
success
}
fun
setSuccess
(
success
:
Boolean
)
{
this
.
success
=
success
}
fun
getSysTime
():
Long
{
return
sysTime
}
fun
setSysTime
(
sysTime
:
Long
)
{
this
.
sysTime
=
sysTime
}
fun
getData
():
List
<
DataBean
>?
{
return
data
}
fun
setData
(
data
:
List
<
DataBean
>)
{
this
.
data
=
data
}
class
DataBean
{
/**
* Order_ID : 50349
* NUMBER : 1
* MEMBER_NAME : 忆逝1
* PRICE : 88.0
* discount_amount : 0.0
* PHONE : 15728241877
* ORDER_NO : 26202811401145744
* Lunchbox : 0.0
* remark :
* pid : 0
* PRODUCT_NAME : [{"odsId":"1650249","PRICE":"88.0","num":"1","pid":"0","PRODUCT_NAME":"脆炸粟米蟹肉餅"}]
* odsId : 1650249
* addressDetail : 香港長沙灣青山道479 - 479A號麗昌工廠大廈 704 室及 802 室(接待處於 704 室蘋果迷你倉 - 荔枝角 (麗昌分店)分店
* DELIVERY_CHARGE : 0.0
* order_from : 7
* sender :
* SEND_TIME : 盡快送達 18:27
* PAY_AMOUNT : 88.0
* ID : 50349
* CREATE_TIME : 2020-04-02 17:57:29.0
* takeFoodCode : 0
* RECEIVER : 張學友 先生
* TOTAL_AMOUNT : 88.0
*/
var
Order_ID
:
Int
=
0
var
NUMBER
:
Int
=
0
var
MEMBER_NAME
:
String
?
=
null
var
PRICE
:
Double
=
0
.
toDouble
()
var
discount_amount
:
Double
=
0
.
toDouble
()
var
PHONE
:
String
?
=
null
var
ORDER_NO
:
String
?
=
null
var
Lunchbox
:
Double
=
0
.
toDouble
()
var
remark
:
String
?
=
null
var
pid
:
Int
=
0
var
odsId
:
Int
=
0
var
addressDetail
:
String
?
=
null
var
DELIVERY_CHARGE
:
Double
=
0
.
toDouble
()
var
order_from
:
Int
=
0
var
sender
:
String
?
=
null
var
SEND_TIME
:
String
?
=
null
var
PAY_AMOUNT
:
Double
=
0
.
toDouble
()
var
ID
:
Int
=
0
var
CREATE_TIME
:
String
?
=
null
var
takeFoodCode
:
String
?
=
null
var
RECEIVER
:
String
?
=
null
var
TOTAL_AMOUNT
:
String
?
=
null
var
PRODUCT_NAME
:
List
<
PRODUCTNAMEBean
>?
=
null
class
PRODUCTNAMEBean
{
/**
* odsId : 1650249
* PRICE : 88.0
* num : 1
* pid : 0
* PRODUCT_NAME : 脆炸粟米蟹肉餅
*/
var
odsId
:
String
?
=
null
var
price
:
String
?
=
null
var
num
:
String
?
=
null
var
pid
:
String
?
=
null
var
producT_NAME
:
String
?
=
null
}
}
}
\ No newline at end of file
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/CoolWeatherNetwork.kt
View file @
da93bfc3
package
com.gingersoft.gsa.other_order_mode.data.network
import
android.util.Log
import
com.gingersoft.gsa.other_order_mode.data.network.api.WeatherService
import
okhttp3.RequestBody
import
retrofit2.Call
...
...
@@ -20,6 +19,9 @@ class CoolWeatherNetwork {
suspend
fun
updateRestOpenStatus
(
requestBody
:
RequestBody
)
=
service
.
updateRestOpenStatus
(
requestBody
).
await
()
suspend
fun
getOrderInfo
(
requestBody
:
RequestBody
)
=
orderService
.
getOrderDesc
(
requestBody
).
await
()
private
suspend
fun
<
T
>
Call
<
T
>.
await
():
T
{
return
suspendCoroutine
{
continuation
->
enqueue
(
object
:
Callback
<
T
>
{
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/api/WeatherService.kt
View file @
da93bfc3
package
com.gingersoft.gsa.other_order_mode.data.network.api
import
com.gingersoft.gsa.other_order_mode.data.model.bean.MessageBean
import
com.gingersoft.gsa.other_order_mode.data.model.bean.OrderDetails
import
com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList
import
okhttp3.RequestBody
import
retrofit2.Call
...
...
@@ -14,4 +15,9 @@ interface WeatherService {
@POST
(
"wx/updateRestOpenStatus"
)
fun
updateRestOpenStatus
(
@Body
requestBody
:
RequestBody
):
Call
<
MessageBean
>
@POST
(
"wechat/findOrderDetails"
)
fun
getOrderDesc
(
@Body
requestBody
:
RequestBody
):
Call
<
OrderDetails
>
}
\ No newline at end of file
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/adapter/OtherOrdersAdapter.kt
View file @
da93bfc3
...
...
@@ -20,6 +20,12 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
private
var
databeans
:
List
<
OrderList
.
DataBeanX
.
DataBean
>?
=
null
private
var
listenter
:
((
item
:
OrderList
.
DataBeanX
.
DataBean
)
->
Unit
)?
=
null
fun
setOnItemClickListenter
(
listenter
:
(
item
:
OrderList
.
DataBeanX
.
DataBean
)
->
Unit
)
{
this
.
listenter
=
listenter
}
fun
setData
(
databeans
:
List
<
OrderList
.
DataBeanX
.
DataBean
>)
{
this
.
databeans
=
databeans
notifyDataSetChanged
()
...
...
@@ -100,6 +106,10 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
}
}
holder
.
binding
.
payMethodBg
=
payMethodBg
holder
.
itemView
.
setOnClickListener
{
listenter
?.
invoke
(
data
)
}
}
override
fun
getItemCount
():
Int
{
...
...
@@ -110,7 +120,7 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
}
}
fun
getColor
(
color
:
Int
):
Int
{
private
fun
getColor
(
color
:
Int
):
Int
{
return
context
.
resources
.
getColor
(
color
)
}
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/main/PageViewModel.kt
View file @
da93bfc3
...
...
@@ -5,6 +5,7 @@ import androidx.lifecycle.MutableLiveData
import
androidx.lifecycle.ViewModel
import
androidx.lifecycle.viewModelScope
import
com.gingersoft.gsa.other_order_mode.data.WeatherRepository
import
com.gingersoft.gsa.other_order_mode.data.model.bean.OrderDetails
import
com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList
import
kotlinx.coroutines.launch
...
...
@@ -90,6 +91,19 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
})
}
/**
* 根據訂單id獲取訂單詳細信息
*/
fun
getOrderInfo
(
orderId
:
String
,
listener
:
(
OrderDetails
)
->
Unit
)
{
launch
({
repository
.
getOrderInfo
(
orderId
).
apply
{
listener
.
invoke
(
this
)
}
},
{
//出錯
})
}
private
fun
launch
(
block
:
suspend
()
->
Unit
,
error
:
suspend
(
Throwable
)
->
Unit
)
=
viewModelScope
.
launch
{
try
{
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/main/PlaceholderFragment.kt
View file @
da93bfc3
package
com.gingersoft.gsa.other_order_mode.ui.main
import
android.app.Dialog
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.databinding.DataBindingUtil
import
androidx.fragment.app.Fragment
import
androidx.lifecycle.MutableLiveData
import
androidx.lifecycle.Observer
import
androidx.lifecycle.ViewModelProvider
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.gingersoft.gsa.cloud.base.widget.DialogUtils
import
com.gingersoft.gsa.other_order_mode.R
import
com.gingersoft.gsa.other_order_mode.databinding.LayoutOrderInfoDialogBinding
import
com.gingersoft.gsa.other_order_mode.ui.adapter.OtherOrdersAdapter
import
com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import
com.jess.arms.utils.ArmsUtils
import
kotlinx.android.synthetic.main.fragment_other_order.*
/**
...
...
@@ -39,9 +44,25 @@ class PlaceholderFragment : Fragment() {
}
//初始化recyclerview
rv_other_order
.
layoutManager
=
LinearLayoutManager
(
activity
)
var
adapter
=
OtherOrdersAdapter
(
activity
!!
)
rv_other_order
.
adapter
=
adapter
val
adapter
=
OtherOrdersAdapter
(
activity
!!
)
adapter
.
setOnItemClickListenter
{
//點擊查詢食品詳情
pageViewModel
.
getOrderInfo
(
it
.
Id
.
toString
())
{
it1
->
//顯示彈窗
object
:
DialogUtils
(
activity
,
R
.
layout
.
layout_order_info_dialog
)
{
override
fun
initLayout
(
hepler
:
ViewHepler
,
dialog
:
Dialog
)
{
if
(
it1
.
getData
()
!=
null
&&
it1
.
getData
()
!!
.
isNotEmpty
())
{
val
layoutOrderInfoDialogBinding
:
LayoutOrderInfoDialogBinding
=
DataBindingUtil
.
bind
(
hepler
.
contentView
)
!!
layoutOrderInfoDialogBinding
.
data
=
it1
.
getData
()
!!
[
0
]
}
}
}.
setHeight
((
ArmsUtils
.
getScreenHeidth
(
activity
)
*
0.6
).
toInt
())
.
createDialogView
()
.
show
()
}
}
rv_other_order
.
adapter
=
adapter
while
(
pageViewModel
.
mOrderList
.
size
<=
arguments
?.
getInt
(
INDEX
)
!!
)
{
pageViewModel
.
mOrderList
.
add
(
MutableLiveData
())
...
...
@@ -63,6 +84,9 @@ class PlaceholderFragment : Fragment() {
page
++
getOrderList
(
pageViewModel
,
true
)
}
// rv_other_order
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
{
...
...
other_order_mode/src/main/res/drawable/shape_dialog_bg.xml
0 → 100644
View file @
da93bfc3
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@color/white"
/>
<corners
android:radius=
"@dimen/dp_8"
/>
</shape>
\ No newline at end of file
other_order_mode/src/main/res/layout/layout_order_info_dialog.xml
0 → 100644
View file @
da93bfc3
This diff is collapsed.
Click to expand it.
other_order_mode/src/main/res/layout/layout_other_order_item.xml
View file @
da93bfc3
...
...
@@ -186,12 +186,14 @@
<TextView
android:id=
"@+id/tv_address"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/dp_5"
android:text=
"@{data.aDDRESS_DETAIL}"
android:textColor=
"@color/color_ccc"
android:textSize=
"@dimen/sp_12"
app:layout_constraintLeft_toLeftOf=
"@id/tv_cellphone_num"
app:layout_constraintRight_toLeftOf=
"@id/tv_order_amount"
app:layout_constraintTop_toTopOf=
"@id/tv_address_text"
/>
<TextView
...
...
other_order_mode/src/main/res/values/styles.xml
View file @
da93bfc3
<resources>
<!-- Base application theme. -->
<!-- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">-->
<!-- <!– Customize your theme here. –>-->
<!-- <item name="colorPrimary">@color/colorPrimary</item>-->
<!-- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>-->
<!-- <item name="colorAccent">@color/colorAccent</item>-->
<!-- </style>-->
<!-- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">-->
<!-- <!– Customize your theme here. –>-->
<!-- <item name="colorPrimary">@color/colorPrimary</item>-->
<!-- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>-->
<!-- <item name="colorAccent">@color/colorAccent</item>-->
<!-- </style>-->
<style
name=
"AppTheme.NoActionBar"
>
<item
name=
"windowActionBar"
>
false
</item>
...
...
@@ -17,4 +17,18 @@
<style
name=
"AppTheme.PopupOverlay"
parent=
"ThemeOverlay.AppCompat.Light"
/>
<style
name=
"otherOrderInfoDialogBoldTextStyle"
>
<item
name=
"android:textSize"
>
@dimen/dp_14
</item>
<item
name=
"android:textColor"
>
@color/theme_333_color
</item>
<item
name=
"android:textStyle"
>
bold
</item>
</style>
<style
name=
"otherOrderInfoDialogTextStyle"
>
<item
name=
"android:textSize"
>
@dimen/dp_14
</item>
<item
name=
"android:textColor"
>
@color/theme_333_color
</item>
<item
name=
"android:textStyle"
>
normal
</item>
</style>
</resources>
print-module/src/main/java/com/joe/print/mvp/print/PrintUtils.java
View file @
da93bfc3
This diff is collapsed.
Click to expand it.
print-module/src/main/java/com/joe/print/mvp/ui/activity/IpPrintActivity.java
View file @
da93bfc3
...
...
@@ -76,20 +76,9 @@ public class IpPrintActivity extends Activity implements PrintSocketHolder.OnSta
initDialog
();
initIntent
();
callId
=
getIntent
().
getStringExtra
(
EXTRA_KEY_CALL_ID
);
// if (type == 3) {
//廚房單,可能會有多個IP打印
//獲得ip打印列表,
//再將食品數據根據打印位置分組。
//打印一組之後,關閉連接,切換第二台打印機ip,如此循環
//打印完成之後,返回所有打印結果。
// } else {
printOrder
(
this
);
// }
}
private
void
initDialog
()
{
try
{
View
view
=
LayoutInflater
.
from
(
mContext
).
inflate
(
R
.
layout
.
ui_dialog_loading
,
null
);
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/base/utils/MoneyUtil.java
View file @
da93bfc3
...
...
@@ -305,6 +305,19 @@ public class MoneyUtil {
}
/**
* 計算差
*
* @param v1
* @param v2
* @return
*/
// public static double sub(String v1, double v2) {
// BigDecimal b1 = new BigDecimal(Double.toString(v1));
// BigDecimal b2 = new BigDecimal(Double.toString(v2));
// return b1.subtract(b2).doubleValue();
// }
/**
* 計算除 保留兩位小數,四捨五入
*
* @param v1
...
...
public-base/src/main/res/layout/print_kitchen.xml
View file @
da93bfc3
...
...
@@ -79,8 +79,8 @@
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_10"
android:text=
"K1 廚房"
app:layout_constraintLeft_to
RightOf=
"@id/tv_order_time
"
app:layout_constraintTop_to
Top
Of=
"@id/tv_order_time"
/>
app:layout_constraintLeft_to
LeftOf=
"parent
"
app:layout_constraintTop_to
Bottom
Of=
"@id/tv_order_time"
/>
<TextView
android:id=
"@+id/tv_people_text"
...
...
@@ -89,7 +89,7 @@
android:layout_height=
"wrap_content"
android:text=
"人數:"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_
order_time_text
"
/>
app:layout_constraintTop_toBottomOf=
"@id/tv_
kitchen_location
"
/>
<TextView
android:id=
"@+id/tv_people"
...
...
user-login/build.gradle
View file @
da93bfc3
...
...
@@ -52,6 +52,9 @@ android {
lintOptions
{
abortOnError
false
}
dataBinding
{
enabled
=
true
}
//修改生成的apk名字
applicationVariants
.
all
{
variant
->
variant
.
outputs
.
all
{
...
...
@@ -78,6 +81,7 @@ dependencies {
addComponent
'download-data'
addComponent
'table-mode'
addComponent
'print-module'
addComponent
'other_order_mode'
annotationProcessor
rootProject
.
ext
.
dependencies
[
"dagger2-compiler"
]
...
...
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