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
1955d118
Commit
1955d118
authored
Jul 02, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
7.02 打印接口改目錄名,默認打印機跟賬號(還有BUG),營業報表加餐盒費和送貨費,外賣接單加上已讀
parent
5aa7a1cc
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
90 additions
and
39 deletions
+90
-39
base-module/src/main/java/com/gingersoft/gsa/cloud/base/Api.java
+1
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/PrinterDeviceBean.java
+9
-9
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/PrinterDeviceBeanDao.java
+28
-12
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/BusinessReportPresenter.java
+3
-3
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
+1
-2
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/WeatherRepository.kt
+5
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/OrderList.kt
+2
-1
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/CoolWeatherNetwork.kt
+2
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/api/WeatherService.kt
+3
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
+9
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OrderDetailsActivity.kt
+3
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/adapter/OtherOrdersAdapter.kt
+15
-3
print-module/src/main/java/com/joe/print/mvp/model/server/PrintInfoService.java
+4
-4
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterAddActivity.java
+5
-4
No files found.
base-module/src/main/java/com/gingersoft/gsa/cloud/base/Api.java
View file @
1955d118
...
...
@@ -29,7 +29,7 @@ public interface Api {
//獲取餐廳擴展表數據
String
expand_info
=
"restaurant/ext/list"
;
//獲取餐廳打印機列表
String
printerDevice_list
=
"
P
rinterDevice/list"
;
String
printerDevice_list
=
"
p
rinterDevice/list"
;
//日誌上傳
String
upload_app_log
=
"public/cloud/gsa/upload"
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/PrinterDeviceBean.java
View file @
1955d118
...
...
@@ -15,7 +15,7 @@ public class PrinterDeviceBean implements Serializable {
private
static
final
long
serialVersionUID
=
4583366043598445115L
;
private
int
id
;
private
Long
id
;
@Property
(
nameInDb
=
"_id"
)
@Id
(
autoincrement
=
true
)
...
...
@@ -24,7 +24,7 @@ public class PrinterDeviceBean implements Serializable {
private
String
name
;
private
Integer
restaurantId
;
private
String
ip
;
//ip
private
int
uid
;
private
Long
uid
;
private
Integer
port
;
//端口
// private int type;//打印機紙張類型 為1時是58mm,否則是88mm
...
...
@@ -48,7 +48,7 @@ public class PrinterDeviceBean implements Serializable {
public
PrinterDeviceBean
()
{
}
public
PrinterDeviceBean
(
String
name
,
int
id
,
Integer
restaurantId
,
String
ip
,
Integer
port
,
int
type
)
{
public
PrinterDeviceBean
(
String
name
,
Long
id
,
Integer
restaurantId
,
String
ip
,
Integer
port
,
int
type
)
{
this
.
name
=
name
;
this
.
id
=
id
;
this
.
restaurantId
=
restaurantId
;
...
...
@@ -63,8 +63,8 @@ public class PrinterDeviceBean implements Serializable {
this
.
port
=
port
;
}
@Generated
(
hash
=
815182145
)
public
PrinterDeviceBean
(
int
id
,
Long
dbid
,
String
name
,
Integer
restaurantId
,
String
ip
,
int
uid
,
Integer
port
,
Integer
status
,
int
printerModelId
,
String
paperSpecification
,
String
printerName
,
String
model
,
Long
printerDeviceId
,
Long
defaultPrinterDeviceId
)
{
@Generated
(
hash
=
1626972301
)
public
PrinterDeviceBean
(
Long
id
,
Long
dbid
,
String
name
,
Integer
restaurantId
,
String
ip
,
Long
uid
,
Integer
port
,
Integer
status
,
int
printerModelId
,
String
paperSpecification
,
String
printerName
,
String
model
,
Long
printerDeviceId
,
Long
defaultPrinterDeviceId
)
{
this
.
id
=
id
;
this
.
dbid
=
dbid
;
this
.
name
=
name
;
...
...
@@ -89,11 +89,11 @@ public class PrinterDeviceBean implements Serializable {
this
.
name
=
name
;
}
public
int
getId
()
{
public
Long
getId
()
{
return
this
.
id
;
}
public
void
setId
(
int
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
...
...
@@ -194,11 +194,11 @@ public class PrinterDeviceBean implements Serializable {
}
public
int
getUid
()
{
public
Long
getUid
()
{
return
uid
;
}
public
void
setUid
(
int
uid
)
{
public
void
setUid
(
Long
uid
)
{
this
.
uid
=
uid
;
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/PrinterDeviceBeanDao.java
View file @
1955d118
...
...
@@ -24,12 +24,12 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
* Can be used for QueryBuilder and for referencing column names.
*/
public
static
class
Properties
{
public
final
static
Property
Id
=
new
Property
(
0
,
int
.
class
,
"id"
,
false
,
"ID"
);
public
final
static
Property
Id
=
new
Property
(
0
,
Long
.
class
,
"id"
,
false
,
"ID"
);
public
final
static
Property
Dbid
=
new
Property
(
1
,
Long
.
class
,
"dbid"
,
true
,
"_id"
);
public
final
static
Property
Name
=
new
Property
(
2
,
String
.
class
,
"name"
,
false
,
"NAME"
);
public
final
static
Property
RestaurantId
=
new
Property
(
3
,
Integer
.
class
,
"restaurantId"
,
false
,
"RESTAURANT_ID"
);
public
final
static
Property
Ip
=
new
Property
(
4
,
String
.
class
,
"ip"
,
false
,
"IP"
);
public
final
static
Property
Uid
=
new
Property
(
5
,
int
.
class
,
"uid"
,
false
,
"UID"
);
public
final
static
Property
Uid
=
new
Property
(
5
,
Long
.
class
,
"uid"
,
false
,
"UID"
);
public
final
static
Property
Port
=
new
Property
(
6
,
Integer
.
class
,
"port"
,
false
,
"PORT"
);
public
final
static
Property
Status
=
new
Property
(
7
,
Integer
.
class
,
"status"
,
false
,
"STATUS"
);
public
final
static
Property
PrinterModelId
=
new
Property
(
8
,
int
.
class
,
"printerModelId"
,
false
,
"PRINTER_MODEL_ID"
);
...
...
@@ -53,12 +53,12 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
public
static
void
createTable
(
Database
db
,
boolean
ifNotExists
)
{
String
constraint
=
ifNotExists
?
"IF NOT EXISTS "
:
""
;
db
.
execSQL
(
"CREATE TABLE "
+
constraint
+
"\"PRINTER_DEVICE_BEAN\" ("
+
//
"\"ID\" INTEGER
NOT NULL
,"
+
// 0: id
"\"ID\" INTEGER,"
+
// 0: id
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,"
+
// 1: dbid
"\"NAME\" TEXT,"
+
// 2: name
"\"RESTAURANT_ID\" INTEGER,"
+
// 3: restaurantId
"\"IP\" TEXT,"
+
// 4: ip
"\"UID\" INTEGER
NOT NULL
,"
+
// 5: uid
"\"UID\" INTEGER,"
+
// 5: uid
"\"PORT\" INTEGER,"
+
// 6: port
"\"STATUS\" INTEGER,"
+
// 7: status
"\"PRINTER_MODEL_ID\" INTEGER NOT NULL ,"
+
// 8: printerModelId
...
...
@@ -78,7 +78,11 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
@Override
protected
final
void
bindValues
(
DatabaseStatement
stmt
,
PrinterDeviceBean
entity
)
{
stmt
.
clearBindings
();
stmt
.
bindLong
(
1
,
entity
.
getId
());
Long
id
=
entity
.
getId
();
if
(
id
!=
null
)
{
stmt
.
bindLong
(
1
,
id
);
}
Long
dbid
=
entity
.
getDbid
();
if
(
dbid
!=
null
)
{
...
...
@@ -99,7 +103,11 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
if
(
ip
!=
null
)
{
stmt
.
bindString
(
5
,
ip
);
}
stmt
.
bindLong
(
6
,
entity
.
getUid
());
Long
uid
=
entity
.
getUid
();
if
(
uid
!=
null
)
{
stmt
.
bindLong
(
6
,
uid
);
}
Integer
port
=
entity
.
getPort
();
if
(
port
!=
null
)
{
...
...
@@ -141,7 +149,11 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
@Override
protected
final
void
bindValues
(
SQLiteStatement
stmt
,
PrinterDeviceBean
entity
)
{
stmt
.
clearBindings
();
stmt
.
bindLong
(
1
,
entity
.
getId
());
Long
id
=
entity
.
getId
();
if
(
id
!=
null
)
{
stmt
.
bindLong
(
1
,
id
);
}
Long
dbid
=
entity
.
getDbid
();
if
(
dbid
!=
null
)
{
...
...
@@ -162,7 +174,11 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
if
(
ip
!=
null
)
{
stmt
.
bindString
(
5
,
ip
);
}
stmt
.
bindLong
(
6
,
entity
.
getUid
());
Long
uid
=
entity
.
getUid
();
if
(
uid
!=
null
)
{
stmt
.
bindLong
(
6
,
uid
);
}
Integer
port
=
entity
.
getPort
();
if
(
port
!=
null
)
{
...
...
@@ -209,12 +225,12 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
@Override
public
PrinterDeviceBean
readEntity
(
Cursor
cursor
,
int
offset
)
{
PrinterDeviceBean
entity
=
new
PrinterDeviceBean
(
//
cursor
.
getInt
(
offset
+
0
),
// id
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
),
// id
cursor
.
isNull
(
offset
+
1
)
?
null
:
cursor
.
getLong
(
offset
+
1
),
// dbid
cursor
.
isNull
(
offset
+
2
)
?
null
:
cursor
.
getString
(
offset
+
2
),
// name
cursor
.
isNull
(
offset
+
3
)
?
null
:
cursor
.
getInt
(
offset
+
3
),
// restaurantId
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
),
// ip
cursor
.
getInt
(
offset
+
5
),
// uid
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getLong
(
offset
+
5
),
// uid
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getInt
(
offset
+
6
),
// port
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getInt
(
offset
+
7
),
// status
cursor
.
getInt
(
offset
+
8
),
// printerModelId
...
...
@@ -229,12 +245,12 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
@Override
public
void
readEntity
(
Cursor
cursor
,
PrinterDeviceBean
entity
,
int
offset
)
{
entity
.
setId
(
cursor
.
getInt
(
offset
+
0
));
entity
.
setId
(
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
));
entity
.
setDbid
(
cursor
.
isNull
(
offset
+
1
)
?
null
:
cursor
.
getLong
(
offset
+
1
));
entity
.
setName
(
cursor
.
isNull
(
offset
+
2
)
?
null
:
cursor
.
getString
(
offset
+
2
));
entity
.
setRestaurantId
(
cursor
.
isNull
(
offset
+
3
)
?
null
:
cursor
.
getInt
(
offset
+
3
));
entity
.
setIp
(
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
));
entity
.
setUid
(
cursor
.
getInt
(
offset
+
5
));
entity
.
setUid
(
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getLong
(
offset
+
5
));
entity
.
setPort
(
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getInt
(
offset
+
6
));
entity
.
setStatus
(
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getInt
(
offset
+
7
));
entity
.
setPrinterModelId
(
cursor
.
getInt
(
offset
+
8
));
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/BusinessReportPresenter.java
View file @
1955d118
...
...
@@ -118,7 +118,7 @@ public class BusinessReportPresenter extends BasePresenter<BusinessReportContrac
});
}
private
String
[]
itemNames
=
new
String
[]{
"項目銷售總金額
"
,
"折扣"
,
"服務費"
,
"賬單小數"
,
"簽單"
,
"營業金額淨值"
,
"貼士"
,
"堂食總數"
,
"外賣總數"
,
"單數"
,
"平均每單"
,
"人數"
,
"平均每人
"
};
private
String
[]
itemNames
=
new
String
[]{
"項目銷售總金額
($)"
,
"折扣($)"
,
"服務費($)"
,
"賬單小數($)"
,
"簽單($)"
,
"營業金額淨值($)"
,
"貼士($)"
,
"堂食總金額數($)"
,
"外賣總金額數($)"
,
"單數"
,
"平均每單($)"
,
"人數"
,
"平均每人($)"
,
"送貨費($)"
,
"餐盒費($)
"
};
private
void
loadAdapterInfo
(
BusinessDetailsBean
.
DataBean
dataBean
)
{
//底部信息默認顯示今天的數據
...
...
@@ -152,8 +152,8 @@ public class BusinessReportPresenter extends BasePresenter<BusinessReportContrac
businessBeans
.
add
(
new
BusinessBean
(
itemNames
[
12
],
String
.
valueOf
(
averageConsumption
)));
//平均每人
}
else
{
//為空,全部顯示0
for
(
int
i
=
0
;
i
<
itemNames
.
length
;
i
++
)
{
businessBeans
.
add
(
new
BusinessBean
(
itemName
s
[
i
]
,
String
.
valueOf
(
0
)));
for
(
String
itemName
:
itemNames
)
{
businessBeans
.
add
(
new
BusinessBean
(
itemName
,
String
.
valueOf
(
0
)));
}
}
mRootView
.
loadAdapter
(
businessBeans
);
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
View file @
1955d118
...
...
@@ -82,7 +82,6 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
@BindView
(
R2
.
id
.
iv_end_time_triangle
)
TriangleView
endTimeTriangleView
;
private
BusinessInfoAdapter
businessInfoAdapter
;
//查詢多少天的數據
private
int
manyDay
=
7
;
...
...
@@ -296,7 +295,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
businessInfoAdapter
=
new
BusinessInfoAdapter
(
businessBeans
);
mBusinessDetails
.
setAdapter
(
businessInfoAdapter
);
}
else
{
businessInfoAdapter
.
setNew
Data
(
businessBeans
);
businessInfoAdapter
.
setNew
Instance
(
businessBeans
);
}
}
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/WeatherRepository.kt
View file @
1955d118
...
...
@@ -94,6 +94,11 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
network
.
gsUpdateOrderStatus
(
requestBody
)
}
suspend
fun
updateIsRead
(
orderId
:
String
)
=
withContext
(
Dispatchers
.
IO
){
network
.
updateIsRead
(
getBody
(
"id"
to
orderId
))
}
suspend
fun
thirdDelivery
(
orderId
:
String
,
thirdItem
:
ThirdItem
)
=
withContext
(
Dispatchers
.
IO
)
{
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"orderId"
,
orderId
)
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/OrderList.kt
View file @
1955d118
...
...
@@ -72,7 +72,7 @@ class OrderList {
var
orderPayType
:
Int
=
0
var
ORDER_NO
:
String
?
=
null
var
sendTime
:
String
?
=
null
var
waimaiSendTime
:
String
?
=
null
var
waimaiSendTime
:
String
?
=
null
var
Id
:
Int
=
0
var
CREATE_TIME
:
String
?
=
null
var
takeFoodCode
:
String
?
=
null
...
...
@@ -87,6 +87,7 @@ class OrderList {
var
Open_Status
:
String
?
=
null
//0=休息中, 1=營業中,2=繁忙中不可接單,3繁忙可接單
var
orderType_2
:
OrderType
?
=
null
var
orderType_7
:
OrderType
?
=
null
var
isRead
:
Int
=
0
//0未讀,1已讀
class
OrderType
{
var
typeTotalAmount
:
Double
=
0
.
toDouble
()
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/CoolWeatherNetwork.kt
View file @
1955d118
...
...
@@ -42,6 +42,8 @@ class CoolWeatherNetwork {
//第三方配送接口
suspend
fun
thirdDelivery
(
requestBody
:
RequestBody
)
=
gsposService
.
thirdDelivery
(
requestBody
).
await
()
suspend
fun
updateIsRead
(
requestBody
:
RequestBody
)
=
service
.
updateIsRead
(
requestBody
).
await
()
//修改自取訂單狀態
suspend
fun
updateSelfOrderStatus
(
requestBody
:
RequestBody
)
=
orderService
.
updateSelfOrderStatus
(
requestBody
).
await
()
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/api/WeatherService.kt
View file @
1955d118
...
...
@@ -33,6 +33,9 @@ interface WeatherService {
@POST
(
"gsa/shipAnyOrdersNew"
)
fun
thirdDelivery
(
@Body
requestBody
:
RequestBody
):
Call
<
ThirdSend
>
@POST
(
"order/updateOrderInfoIsRead"
)
fun
updateIsRead
(
@Body
requestBody
:
RequestBody
):
Call
<
String
>
@POST
(
"wechat/updateSelfOrderStatus"
)
fun
updateSelfOrderStatus
(
@Body
requestBody
:
RequestBody
):
Call
<
UpdateOrderBean
>
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
View file @
1955d118
...
...
@@ -256,6 +256,15 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
})
}
//設置為已讀
fun
updateIsRead
(
orderId
:
String
)
{
launch
({
repository
.
updateIsRead
(
orderId
)
},
{
})
}
fun
updateOrderStatusByBtn
(
btnId
:
Int
,
dataBean
:
OrderDetails
.
DataBean
,
restaurantId
:
String
,
listener
:
(
Int
,
Boolean
)
->
Unit
)
{
launch
({
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OrderDetailsActivity.kt
View file @
1955d118
...
...
@@ -59,6 +59,9 @@ class OrderDetailsActivity : BaseActivity() {
orderPayType
=
intent
.
getIntExtra
(
"orderPayType"
,
0
)
//訂單支付方式
pageViewModel
=
ViewModelProvider
(
this
,
InjectorUtil
.
getWeatherModelFactory
())[
PageViewModel
::
class
.
java
].
apply
{
//設為已讀
updateIsRead
(
orderId
)
//獲取訂單詳情
getOrderDetails
(
orderId
,
binding
)
}
initTopBar
(
qm_order_details_bar
)
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/adapter/OtherOrdersAdapter.kt
View file @
1955d118
...
...
@@ -66,16 +66,28 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
data
.
STATUS
==
0
->
{
state
=
"待確認"
bg
.
setColor
(
getColor
(
R
.
color
.
order_state0_color
))
holder
.
flBorder
.
visibility
=
View
.
VISIBLE
//顯示邊框
//執行動畫
alphaAnimator
(
holder
.
flBorder
)
if
(
data
.
isRead
==
0
)
{
holder
.
flBorder
.
visibility
=
View
.
VISIBLE
//顯示邊框
alphaAnimator
(
holder
.
flBorder
)
}
else
{
holder
.
flBorder
.
visibility
=
View
.
GONE
holder
.
flBorder
.
clearAnimation
()
}
}
data
.
STATUS
==
1
->
{
state
=
"待確認"
bg
.
setColor
(
getColor
(
R
.
color
.
order_state0_color
))
holder
.
flBorder
.
visibility
=
View
.
VISIBLE
//顯示邊框
//執行動畫
alphaAnimator
(
holder
.
flBorder
)
if
(
data
.
isRead
==
0
)
{
holder
.
flBorder
.
visibility
=
View
.
VISIBLE
//顯示邊框
alphaAnimator
(
holder
.
flBorder
)
}
else
{
holder
.
flBorder
.
visibility
=
View
.
GONE
holder
.
flBorder
.
clearAnimation
()
}
}
data
.
STATUS
==
2
->
{
state
=
"製作中"
...
...
print-module/src/main/java/com/joe/print/mvp/model/server/PrintInfoService.java
View file @
1955d118
...
...
@@ -17,18 +17,18 @@ import retrofit2.http.Query;
*/
public
interface
PrintInfoService
{
// @Headers({"Domain-Name: yc_location"})
@POST
(
"
P
rinterDevice/add"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@POST
(
"
p
rinterDevice/add"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
addPrinter
(
@Body
RequestBody
requestBody
);
// @Headers({"Domain-Name: yc_location"})
@GET
(
"
P
rinterDevice/list?"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
"
p
rinterDevice/list?"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
getPrinterList
(
@Query
(
"restaurantId"
)
int
restaurantId
);
@POST
(
"
P
rinterDevice/deletes"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@POST
(
"
p
rinterDevice/deletes"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
deletePrinterList
(
@Body
RequestBody
requestBody
);
// @Headers({"Domain-Name: yc_location"})
@POST
(
"
P
rinterDevice/update"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@POST
(
"
p
rinterDevice/update"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
updatePrinter
(
@Body
RequestBody
requestBody
);
// @Headers({"Domain-Name: yc_location"})
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterAddActivity.java
View file @
1955d118
...
...
@@ -349,8 +349,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
}
else
{
deviceBean
=
new
PrinterDeviceBean
();
}
deviceBean
.
setPrinterName
(
mEdPrintName
.
getText
().
toString
().
trim
());
deviceBean
.
setId
(
0
);
deviceBean
.
setName
(
mEdPrintName
.
getText
().
toString
().
trim
());
deviceBean
.
setRestaurantId
(
GsaCloudApplication
.
getRestaurantId
(
mContext
));
deviceBean
.
setIp
(
ipAddress
.
substring
(
0
,
ipAddress
.
lastIndexOf
(
"."
)));
...
...
@@ -361,10 +360,10 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
}
//飛單打印機
if
(
oneFailPosition
!=
-
1
)
{
deviceBean
.
setPrinterDeviceId
(
(
long
)
devicess
.
get
(
oneFailPosition
).
getId
());
deviceBean
.
setPrinterDeviceId
(
devicess
.
get
(
oneFailPosition
).
getId
());
}
if
(
twoFailPosition
!=
-
1
)
{
deviceBean
.
setDefaultPrinterDeviceId
(
(
long
)
devicess
.
get
(
twoFailPosition
).
getId
());
deviceBean
.
setDefaultPrinterDeviceId
(
devicess
.
get
(
twoFailPosition
).
getId
());
}
//是否默認
deviceBean
.
setStatus
(
mSwitchDefalute
.
isChecked
()
?
2
:
1
);
...
...
@@ -386,8 +385,10 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
if
(
isEditPrinter
&&
printerDeviceBean
!=
null
)
{
deviceBean
.
setId
(
printerDeviceBean
.
getId
());
deviceBean
.
setRestaurantId
(
null
);
deviceBean
.
setUid
((
long
)
GsaCloudApplication
.
getMemberId
(
mContext
));
mPresenter
.
updatePrinterInfo
(
deviceBean
);
}
else
{
deviceBean
.
setUid
(
null
);
mPresenter
.
addPrinter
(
deviceBean
);
}
}
else
if
(
v
.
getId
()
==
R
.
id
.
print_test
)
{
...
...
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