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
1507007e
Commit
1507007e
authored
Jun 02, 2020
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
清機數據調整
parent
d387c37a
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
313 additions
and
81 deletions
+313
-81
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/HttpsConstans.java
+61
-9
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/bean/view/SectionTextItem3.java
+9
-0
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/SwitchServerActivity.java
+88
-16
login-module/src/main/res/layout/activity_switch_server.xml
+28
-0
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/bean/SettlementReport.java
+18
-0
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/SettlementReportPresenter.java
+2
-2
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/SettlementActivity.java
+2
-2
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/SettlementReportActivity.java
+34
-19
main-module/src/main/res/layout/item_settlement_report5.xml
+2
-3
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/OrderDetailItem.java
+10
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
+41
-28
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderDetailActivity.java
+16
-0
table-module/src/main/res/layout/table_activity_order_content.xml
+1
-1
table-module/src/main/res/layout/table_activity_order_pay.xml
+1
-1
No files found.
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/HttpsConstans.java
View file @
1507007e
...
@@ -4,6 +4,7 @@ import android.content.Context;
...
@@ -4,6 +4,7 @@ import android.content.Context;
import
android.util.Log
;
import
android.util.Log
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.zhy.autolayout.utils.L
;
/**
/**
* Created by Wyh on 2019/12/21.
* Created by Wyh on 2019/12/21.
...
@@ -42,6 +43,7 @@ public class HttpsConstans {
...
@@ -42,6 +43,7 @@ public class HttpsConstans {
public
static
String
ROOT_SERVER_YOU_CHANG_HK
=
"http://192.168.1.142:9012/api/"
;
//友常本地
public
static
String
ROOT_SERVER_YOU_CHANG_HK
=
"http://192.168.1.142:9012/api/"
;
//友常本地
public
static
String
ROOT_SERVER_SHI_WEI_HK
=
"http://192.168.1.154:9012/api/"
;
//世維本地
public
static
String
ROOT_SERVER_SHI_WEI_HK
=
"http://192.168.1.154:9012/api/"
;
//世維本地
public
static
String
ROOT_SERVER_SHI_SHU_HK
=
"http://192.168.1.154:9012/api/"
;
//石书本地
//------------------------------------------外賣接單---------------------------------------------------------------------------
//------------------------------------------外賣接單---------------------------------------------------------------------------
public
static
final
String
ROOT_SZ_URL
=
"http://192.168.1.74:6060"
;
//友常本地
public
static
final
String
ROOT_SZ_URL
=
"http://192.168.1.74:6060"
;
//友常本地
...
@@ -64,8 +66,14 @@ public class HttpsConstans {
...
@@ -64,8 +66,14 @@ public class HttpsConstans {
/**
/**
* 修改這個值控制是否是正式
* 修改這個值控制是否是正式
* 1=正式
* 2=香港
* 3=友常
* 4=世维
* 5=石书
*/
*/
public
static
boolean
isFormal
=
true
;
public
static
int
isFormal
=
2
;
//沽清控制地址
//沽清控制地址
public
static
String
_SERVER_ADDRESS
;
// = (isFormal ? HTTP_ADDRESS_URL_FORMAL : "http://a.ricepon.com:61177") + "/member-web/api/";
public
static
String
_SERVER_ADDRESS
;
// = (isFormal ? HTTP_ADDRESS_URL_FORMAL : "http://a.ricepon.com:61177") + "/member-web/api/";
...
@@ -74,7 +82,7 @@ public class HttpsConstans {
...
@@ -74,7 +82,7 @@ public class HttpsConstans {
public
static
String
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
;
// = isFormal ? HTTP_ADDRESS_URL_FORMAL : REPORT_TEST_ADDRESS;
public
static
String
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
;
// = isFormal ? HTTP_ADDRESS_URL_FORMAL : REPORT_TEST_ADDRESS;
//默認url,配置這個值修改環境
//默認url,配置這個值修改環境
public
static
String
ROOT_SERVER_ADDRESS_FORMAL
=
(
isFormal
?
HTTP_ADDRESS_URL_FORMAL
:
HTTP_ADDRESS_URL_HK
)
+
PATH
;
public
static
String
ROOT_SERVER_ADDRESS_FORMAL
=
(
isFormal
==
1
?
HTTP_ADDRESS_URL_FORMAL
:
HTTP_ADDRESS_URL_HK
)
+
PATH
;
//修改這個值,配置外賣接單環境
//修改這個值,配置外賣接單環境
public
static
String
ROOT_URL
;
// = isFormal ? ROOT_FORMAL_URL : ROOT_HK_TEST_URL;//正式:ROOT_FORMAL_URL 測試:ROOT_HK_TEST_URL
public
static
String
ROOT_URL
;
// = isFormal ? ROOT_FORMAL_URL : ROOT_HK_TEST_URL;//正式:ROOT_FORMAL_URL 測試:ROOT_HK_TEST_URL
...
@@ -86,14 +94,58 @@ public class HttpsConstans {
...
@@ -86,14 +94,58 @@ public class HttpsConstans {
public
static
String
WECHAR_REPORT_SERVER_ADDRESS
;
// = (isFormal ? WECHAR_REPORT_FORMAL_ADDRESS : WECHAR_REPORT_TEST_ADDRESS) + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
public
static
String
WECHAR_REPORT_SERVER_ADDRESS
;
// = (isFormal ? WECHAR_REPORT_FORMAL_ADDRESS : WECHAR_REPORT_TEST_ADDRESS) + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
public
static
void
init
(
Context
context
)
{
public
static
void
init
(
Context
context
)
{
isFormal
=
(
boolean
)
SPUtils
.
get
(
context
,
"isFormal"
,
true
);
isFormal
=
(
int
)
SPUtils
.
get
(
context
,
"isFormal"
,
2
);
Log
.
e
(
"eee"
,
"是否正式"
+
isFormal
);
Log
.
e
(
"eee"
,
"是否正式"
+
isFormal
);
_SERVER_ADDRESS
=
(
isFormal
?
HTTP_ADDRESS_URL_FORMAL
:
"http://a.ricepon.com:61177"
)
+
"/member-web/api/"
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
isFormal
?
HTTP_ADDRESS_URL_FORMAL
:
REPORT_TEST_ADDRESS
;
// _SERVER_ADDRESS = (isFormal == 1 ? HTTP_ADDRESS_URL_FORMAL : "http://a.ricepon.com:61177") + "/member-web/api/";
ROOT_SERVER_ADDRESS_FORMAL
=
(
isFormal
?
HTTP_ADDRESS_URL_FORMAL
:
HTTP_ADDRESS_URL_HK
)
+
PATH
;
// ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = isFormal ==1 ? HTTP_ADDRESS_URL_FORMAL : REPORT_TEST_ADDRESS;
ROOT_URL
=
isFormal
?
ROOT_FORMAL_URL
:
ROOT_HK_TEST_URL
;
//正式:ROOT_FORMAL_URL 測試:ROOT_HK_TEST_URL
// ROOT_SERVER_ADDRESS_FORMAL = (isFormal == 1 ? HTTP_ADDRESS_URL_FORMAL : HTTP_ADDRESS_URL_HK) + PATH;
REPORT_SERVER_ADDRESS
=
(
isFormal
?
REPORT_FORMAL_ADDRESS
:
REPORT_TEST_ADDRESS
)
+
REPORT_PATH
;
//測試:REPORT_FORMAL_ADDRESS 正式:REPORT_TEST_ADDRESS
// ROOT_URL = isFormal ==1 ? ROOT_FORMAL_URL : ROOT_HK_TEST_URL;//正式:ROOT_FORMAL_URL 測試:ROOT_HK_TEST_URL
WECHAR_REPORT_SERVER_ADDRESS
=
(
isFormal
?
WECHAR_REPORT_FORMAL_ADDRESS
:
WECHAR_REPORT_TEST_ADDRESS
)
+
WECHAR_REPORT_PATH
;
//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
// REPORT_SERVER_ADDRESS = (isFormal ==1 ? REPORT_FORMAL_ADDRESS : REPORT_TEST_ADDRESS) + REPORT_PATH;//測試:REPORT_FORMAL_ADDRESS 正式:REPORT_TEST_ADDRESS
// WECHAR_REPORT_SERVER_ADDRESS = (isFormal == 1 ? WECHAR_REPORT_FORMAL_ADDRESS : WECHAR_REPORT_TEST_ADDRESS) + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
switch
(
isFormal
){
case
1
:
_SERVER_ADDRESS
=
HTTP_ADDRESS_URL_FORMAL
+
"/member-web/api/"
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_FORMAL
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_FORMAL
+
PATH
;
ROOT_URL
=
ROOT_FORMAL_URL
;
REPORT_SERVER_ADDRESS
=
REPORT_FORMAL_ADDRESS
+
REPORT_PATH
;
WECHAR_REPORT_SERVER_ADDRESS
=
WECHAR_REPORT_FORMAL_ADDRESS
+
WECHAR_REPORT_PATH
;
//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break
;
case
2
:
_SERVER_ADDRESS
=
"http://a.ricepon.com:61177"
+
"/member-web/api/"
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
REPORT_TEST_ADDRESS
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_HK
+
PATH
;
ROOT_URL
=
ROOT_HK_TEST_URL
;
REPORT_SERVER_ADDRESS
=
REPORT_TEST_ADDRESS
+
REPORT_PATH
;
WECHAR_REPORT_SERVER_ADDRESS
=
WECHAR_REPORT_TEST_ADDRESS
+
WECHAR_REPORT_PATH
;
//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break
;
case
3
:
_SERVER_ADDRESS
=
ROOT_SERVER_YOU_CHANG_HK
+
"/member-web/api/"
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
REPORT_TEST_ADDRESS
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_HK
+
PATH
;
ROOT_URL
=
ROOT_SZ_URL
;
REPORT_SERVER_ADDRESS
=
REPORT_TEST_ADDRESS
+
REPORT_PATH
;
WECHAR_REPORT_SERVER_ADDRESS
=
WECHAR_REPORT_TEST_ADDRESS
+
WECHAR_REPORT_PATH
;
//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break
;
case
4
:
_SERVER_ADDRESS
=
ROOT_SERVER_SHI_WEI_HK
+
"/member-web/api/"
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
REPORT_TEST_ADDRESS
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_HK
+
PATH
;
ROOT_URL
=
ROOT_SZ_URL
;
REPORT_SERVER_ADDRESS
=
REPORT_TEST_ADDRESS
+
REPORT_PATH
;
WECHAR_REPORT_SERVER_ADDRESS
=
WECHAR_REPORT_TEST_ADDRESS
+
WECHAR_REPORT_PATH
;
//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break
;
case
5
:
_SERVER_ADDRESS
=
ROOT_SERVER_SHI_SHU_HK
+
"/member-web/api/"
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
REPORT_TEST_ADDRESS
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_HK
+
PATH
;
ROOT_URL
=
ROOT_SZ_URL
;
REPORT_SERVER_ADDRESS
=
REPORT_TEST_ADDRESS
+
REPORT_PATH
;
WECHAR_REPORT_SERVER_ADDRESS
=
WECHAR_REPORT_TEST_ADDRESS
+
WECHAR_REPORT_PATH
;
//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break
;
}
}
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/bean/view/SectionTextItem3.java
View file @
1507007e
...
@@ -146,4 +146,13 @@ public class SectionTextItem3 {
...
@@ -146,4 +146,13 @@ public class SectionTextItem3 {
return
sectionTextItem3
;
return
sectionTextItem3
;
}
}
public
static
SectionTextItem3
serviceAmountTransSectionTextItem3
(
double
amuout
)
{
SectionTextItem3
sectionTextItem3
=
new
SectionTextItem3
();
sectionTextItem3
.
setLeftText
(
"服务费"
);
sectionTextItem3
.
setCenterText
(
String
.
valueOf
(
0
));
sectionTextItem3
.
setRightText
(
String
.
valueOf
(
amuout
));
sectionTextItem3
.
setLeftTextStyle
(
R
.
style
.
order_paymethod_text_style
);
sectionTextItem3
.
setRightTextStyle
(
R
.
style
.
order_paymethod_text_style
);
return
sectionTextItem3
;
}
}
}
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/SwitchServerActivity.java
View file @
1507007e
...
@@ -4,11 +4,13 @@ import android.content.Intent;
...
@@ -4,11 +4,13 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.RadioButton
;
import
android.widget.RadioButton
;
import
android.widget.RadioGroup
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
com.billy.cc.core.component.CC
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.constans.HttpsConstans
;
import
com.gingersoft.gsa.cloud.constans.HttpsConstans
;
...
@@ -40,15 +42,25 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
...
@@ -40,15 +42,25 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
*/
*/
public
class
SwitchServerActivity
extends
BaseActivity
<
SwitchServerPresenter
>
implements
SwitchServerContract
.
View
{
public
class
SwitchServerActivity
extends
BaseActivity
<
SwitchServerPresenter
>
implements
SwitchServerContract
.
View
{
@BindView
(
R2
.
id
.
radioGroup
)
RadioGroup
radioGroup
;
@BindView
(
R2
.
id
.
rb_server_hk
)
@BindView
(
R2
.
id
.
rb_server_hk
)
RadioButton
rbHK
;
RadioButton
rbHK
;
@BindView
(
R2
.
id
.
rb_server_formal
)
@BindView
(
R2
.
id
.
rb_server_formal
)
RadioButton
rbFormal
;
RadioButton
rbFormal
;
@BindView
(
R2
.
id
.
rb_youchang
)
RadioButton
rb_youchang
;
@BindView
(
R2
.
id
.
rb_shiwei
)
RadioButton
rb_shiwei
;
@BindView
(
R2
.
id
.
rb_shishu
)
RadioButton
rb_shishu
;
@BindView
(
R2
.
id
.
btn_switch_server
)
@BindView
(
R2
.
id
.
btn_switch_server
)
Button
switchServer
;
Button
switchServer
;
@BindView
(
R2
.
id
.
tv_now_server
)
@BindView
(
R2
.
id
.
tv_now_server
)
TextView
tvNowServer
;
TextView
tvNowServer
;
private
int
[]
rbIds
=
new
int
[]{
R
.
id
.
rb_server_hk
,
R
.
id
.
rb_server_formal
,
R
.
id
.
rb_youchang
,
R
.
id
.
rb_shiwei
,
R
.
id
.
rb_shishu
};
@Override
@Override
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
DaggerSwitchServerComponent
//如找不到该类,请编译一下项目
DaggerSwitchServerComponent
//如找不到该类,请编译一下项目
...
@@ -68,32 +80,92 @@ public class SwitchServerActivity extends BaseActivity<SwitchServerPresenter> im
...
@@ -68,32 +80,92 @@ public class SwitchServerActivity extends BaseActivity<SwitchServerPresenter> im
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
String
nowServer
=
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
;
String
nowServer
=
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
;
tvNowServer
.
setText
(
"當前服務器:"
+
nowServer
);
tvNowServer
.
setText
(
"當前服務器:"
+
nowServer
);
if
(
HttpsConstans
.
isFormal
)
{
rbFormal
.
setChecked
(
true
);
setChecked
((
Integer
)
SPUtils
.
get
(
this
,
"isFormal"
,
2
));
}
else
{
// if (HttpsConstans.isFormal) {
rbHK
.
setChecked
(
true
);
// rbFormal.setChecked(true);
}
// } else {
// rbHK.setChecked(true);
// }
rbHK
.
setText
(
"測試服務器"
);
rbHK
.
setText
(
"測試服務器"
);
rbFormal
.
setText
(
"正式服務器"
);
rbFormal
.
setText
(
"正式服務器"
);
switchServer
.
setOnClickListener
(
v
->
{
radioGroup
.
setOnCheckedChangeListener
(
new
RadioGroup
.
OnCheckedChangeListener
()
{
if
(
rbHK
.
isChecked
())
{
@Override
SPUtils
.
put
(
this
,
"isFormal"
,
false
);
public
void
onCheckedChanged
(
RadioGroup
group
,
int
checkedId
)
{
}
else
{
for
(
int
i
=
0
;
i
<
rbIds
.
length
;
i
++)
{
SPUtils
.
put
(
this
,
"isFormal"
,
true
);
if
(
rbIds
[
i
]
==
checkedId
)
{
setChecked
(
i
+
1
);
break
;
}
}
}
}
});
switchServer
.
setOnClickListener
(
v
->
{
// if (rbHK.isChecked()) {
// SPUtils.put(this, "isFormal", false);
// } else {
// SPUtils.put(this, "isFormal", true);
// }
GsaCloudApplication
.
initDomainUrl
();
GsaCloudApplication
.
initDomainUrl
();
GsaCloudApplication
.
isLogin
=
false
;
CC
.
obtainBuilder
(
"User.Component.Login"
)
.
setActionName
(
"showActivityA"
)
.
build
()
.
call
();
finish
();
finish
();
try
{
//
try {
Thread
.
sleep
(
2000
);
//
Thread.sleep(2000);
System
.
exit
(
0
);
//
System.exit(0);
}
catch
(
InterruptedException
e
)
{
//
} catch (InterruptedException e) {
e
.
printStackTrace
();
//
e.printStackTrace();
}
//
}
});
});
}
}
private
void
setChecked
(
int
i
)
{
switch
(
i
)
{
case
1
:
rbHK
.
setChecked
(
false
);
rbFormal
.
setChecked
(
true
);
rb_youchang
.
setChecked
(
false
);
rb_shiwei
.
setChecked
(
false
);
rb_shishu
.
setChecked
(
false
);
break
;
case
2
:
rbHK
.
setChecked
(
true
);
rbFormal
.
setChecked
(
false
);
rb_youchang
.
setChecked
(
false
);
rb_shiwei
.
setChecked
(
false
);
rb_shishu
.
setChecked
(
false
);
break
;
case
3
:
rbHK
.
setChecked
(
false
);
rbFormal
.
setChecked
(
false
);
rb_youchang
.
setChecked
(
true
);
rb_shiwei
.
setChecked
(
false
);
rb_shishu
.
setChecked
(
false
);
break
;
case
4
:
rbHK
.
setChecked
(
false
);
rbFormal
.
setChecked
(
false
);
rb_youchang
.
setChecked
(
false
);
rb_shiwei
.
setChecked
(
true
);
rb_shishu
.
setChecked
(
false
);
break
;
case
5
:
rbHK
.
setChecked
(
false
);
rbFormal
.
setChecked
(
false
);
rb_youchang
.
setChecked
(
false
);
rb_shiwei
.
setChecked
(
false
);
rb_shishu
.
setChecked
(
true
);
break
;
}
SPUtils
.
put
(
this
,
"isFormal"
,
i
);
}
@Override
@Override
public
void
initIntent
()
{
public
void
initIntent
()
{
...
...
login-module/src/main/res/layout/activity_switch_server.xml
View file @
1507007e
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<RadioGroup
<RadioGroup
android:id=
"@+id/radioGroup"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
...
@@ -26,6 +27,33 @@
...
@@ -26,6 +27,33 @@
android:text=
"正式環境"
android:text=
"正式環境"
android:textColor=
"@color/theme_333_color"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/sp_16"
/>
android:textSize=
"@dimen/sp_16"
/>
<RadioButton
android:id=
"@+id/rb_youchang"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:padding=
"@dimen/dp_10"
android:text=
"友常"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/sp_16"
/>
<RadioButton
android:id=
"@+id/rb_shiwei"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:padding=
"@dimen/dp_10"
android:text=
"世维"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/sp_16"
/>
<RadioButton
android:id=
"@+id/rb_shishu"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:padding=
"@dimen/dp_10"
android:text=
"石书"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/sp_16"
/>
</RadioGroup>
</RadioGroup>
<TextView
<TextView
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/bean/SettlementReport.java
View file @
1507007e
...
@@ -61,6 +61,24 @@ public class SettlementReport {
...
@@ -61,6 +61,24 @@ public class SettlementReport {
private
RestaurantOperationBean
restaurantOperation
;
private
RestaurantOperationBean
restaurantOperation
;
private
List
<
AnalysisBean
>
analysis
;
private
List
<
AnalysisBean
>
analysis
;
private
List
<
CashBean
>
cash
;
private
List
<
CashBean
>
cash
;
private
String
currentTime
;
private
String
startTime
;
public
String
getCurrentTime
()
{
return
currentTime
;
}
public
void
setCurrentTime
(
String
currentTime
)
{
this
.
currentTime
=
currentTime
;
}
public
String
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
String
startTime
)
{
this
.
startTime
=
startTime
;
}
public
String
getYesterdayTime
()
{
public
String
getYesterdayTime
()
{
return
yesterdayTime
;
return
yesterdayTime
;
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/SettlementReportPresenter.java
View file @
1507007e
...
@@ -152,10 +152,10 @@ public class SettlementReportPresenter extends BasePresenter<SettlementReportCon
...
@@ -152,10 +152,10 @@ public class SettlementReportPresenter extends BasePresenter<SettlementReportCon
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
(
mApplication
);
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
(
mApplication
);
mModel
.
getSettlementReport
(
restaurantId
)
mModel
.
getSettlementReport
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
null
))
//
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
//
.doAfterTerminate(() -> mRootView.hideLoading())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
SettlementReport
>(
mErrorHandler
)
{
.
subscribe
(
new
ErrorHandleSubscriber
<
SettlementReport
>(
mErrorHandler
)
{
//{"success":false,"errCode":"data_002","errMsg":"沒有查詢到數據","sysTime":1583573772290}
//{"success":false,"errCode":"data_002","errMsg":"沒有查詢到數據","sysTime":1583573772290}
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/SettlementActivity.java
View file @
1507007e
...
@@ -71,7 +71,7 @@ public class SettlementActivity extends BaseActivity<SettlementPresenter> implem
...
@@ -71,7 +71,7 @@ public class SettlementActivity extends BaseActivity<SettlementPresenter> implem
@Override
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
tv_settlement_time
.
setVisibility
(
View
.
GONE
);
//
tv_settlement_time.setVisibility(View.GONE);
mPresenter
.
getSettlementReport
();
mPresenter
.
getSettlementReport
();
}
}
...
@@ -158,7 +158,7 @@ public class SettlementActivity extends BaseActivity<SettlementPresenter> implem
...
@@ -158,7 +158,7 @@ public class SettlementActivity extends BaseActivity<SettlementPresenter> implem
this
.
mSettlementReportBean
=
datasBean
;
this
.
mSettlementReportBean
=
datasBean
;
if
(
mSettlementReportBean
.
getRestaurantOperation
()
!=
null
)
{
if
(
mSettlementReportBean
.
getRestaurantOperation
()
!=
null
)
{
String
lastSettlementText
=
LanguageUtils
.
get_language_system
(
this
,
""
,
"上次清機時間:"
);
String
lastSettlementText
=
LanguageUtils
.
get_language_system
(
this
,
""
,
"上次清機時間:"
);
setLastTime
(
lastSettlementText
+
TimeUtils
.
getStringByFormat
(
mSettlementReportBean
.
getRestaurantOperation
().
get
Open
Time
(),
TimeUtils
.
dateFormatYMDHMS
)
);
setLastTime
(
lastSettlementText
+
TimeUtils
.
getStringByFormat
(
mSettlementReportBean
.
getRestaurantOperation
().
get
Create
Time
(),
TimeUtils
.
dateFormatYMDHMS
)
);
}
}
}
}
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/SettlementReportActivity.java
View file @
1507007e
package
com
.
gingersoft
.
gsa
.
cloud
.
main
.
mvp
.
ui
.
activity
;
package
com
.
gingersoft
.
gsa
.
cloud
.
main
.
mvp
.
ui
.
activity
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.view.View
;
...
@@ -116,7 +117,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
...
@@ -116,7 +117,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
@Override
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
tv_last_time
.
setVisibility
(
View
.
GONE
);
//
tv_last_time.setVisibility(View.GONE);
}
}
...
@@ -281,11 +282,12 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
...
@@ -281,11 +282,12 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
SettlementReport
.
DataBean
.
RestaurantOperationBean
restaurantOperationBean
=
datasBean
.
getRestaurantOperation
();
SettlementReport
.
DataBean
.
RestaurantOperationBean
restaurantOperationBean
=
datasBean
.
getRestaurantOperation
();
if
(
restaurantOperationBean
!=
null
)
{
if
(
restaurantOperationBean
!=
null
)
{
tv_business_area_title
.
setText
(
dailyBusinessReportText
);
tv_business_area_title
.
setText
(
dailyBusinessReportText
);
tv_last_time
.
setText
(
lastSettlementText
+
TimeUtils
.
getStringByFormat
(
restaurantOperationBean
.
getOpenTime
(),
TimeUtils
.
dateFormatYMDHMS
));
tv_last_time
.
setText
(
lastSettlementText
+
TimeUtils
.
getStringByFormat
(
restaurantOperationBean
.
getCreateTime
(),
TimeUtils
.
dateFormatYMDHMS
));
tv_start_time
.
setText
(
byBusinessDateText
+
TimeUtils
.
getStringByFormat
(
restaurantOperationBean
.
getOpenTime
(),
TimeUtils
.
dateFormatYMDHMS
));
tv_end_time
.
setText
(
toBusinessDateText
+
TimeUtils
.
getStringByFormat
(
restaurantOperationBean
.
getOperationTime
(),
TimeUtils
.
dateFormatYMDHMS
));
}
}
tv_start_time
.
setText
(
byBusinessDateText
+
datasBean
.
getStartTime
());
tv_end_time
.
setText
(
toBusinessDateText
+
datasBean
.
getCurrentTime
());
SettlementReport
.
DataBean
.
VoBean
voBean
=
datasBean
.
getVo
();
SettlementReport
.
DataBean
.
VoBean
voBean
=
datasBean
.
getVo
();
if
(
voBean
!=
null
)
{
if
(
voBean
!=
null
)
{
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
projectTotalSalesText
,
null
,
null
,
null
,
cashStr
+
df
.
format
(
voBean
.
getTotamount
())));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
projectTotalSalesText
,
null
,
null
,
null
,
cashStr
+
df
.
format
(
voBean
.
getTotamount
())));
...
@@ -353,7 +355,9 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
...
@@ -353,7 +355,9 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
/** 帳單統計*/
/** 帳單統計*/
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"=============================================================="
,
null
,
null
,
null
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"=============================================================="
,
null
,
null
,
null
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
null
,
null
,
"帳單統計"
,
null
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
null
,
null
,
"帳單統計"
,
null
,
null
));
// settlementReportItem5s.add(new SectionTextItem5("類別", "帳單", "金額", "平均", "金額%"));
if
(!
GsaCloudApplication
.
mV2
.
contains
(
Build
.
MODEL
)
&&
!
GsaCloudApplication
.
mN5
.
contains
(
Build
.
MODEL
))
{
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"類別"
,
"帳單"
,
"金額"
,
"平均"
,
"金額%"
));
}
//總計
//總計
//平均數
//平均數
String
averagePrice2
=
"0.00"
;
String
averagePrice2
=
"0.00"
;
...
@@ -378,11 +382,14 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
...
@@ -378,11 +382,14 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
canteenNum
=
num
+
""
;
canteenNum
=
num
+
""
;
canteenTotamout
=
cashStr
+
df
.
format
(
amount
);
canteenTotamout
=
cashStr
+
df
.
format
(
amount
);
if
(
voBean
.
getNum
()
!=
0
)
{
if
(
voBean
.
getNum
()
!=
0
)
{
double
number
=
amount
/
num
;
double
number
=
MoneyUtil
.
divide
(
amount
,
num
,
2
)
;
canteenAveragePrice
=
cashStr
+
df
.
format
(
Double
.
isNaN
(
number
)
?
0
:
number
);
canteenAveragePrice
=
cashStr
+
df
.
format
(
number
);
}
}
if
(
amount
>
0
)
{
if
(
amount
>
0
)
{
canteenPercentage
=
(
int
)
(
MoneyUtil
.
divide
(
amount
,
amount
,
2
)
*
100
)
+
""
;
canteenPercentage
=
(
int
)
(
MoneyUtil
.
divide
(
amount
,
voBean
.
getTotamount
(),
2
)
*
100
)
+
""
;
}
if
(!
GsaCloudApplication
.
mV2
.
contains
(
Build
.
MODEL
)
&&
!
GsaCloudApplication
.
mN5
.
contains
(
Build
.
MODEL
))
{
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
canteenText
,
canteenNum
,
canteenTotamout
,
canteenAveragePrice
,
canteenPercentage
));
}
}
}
else
{
}
else
{
takewayText
=
""
;
takewayText
=
""
;
...
@@ -399,11 +406,14 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
...
@@ -399,11 +406,14 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
takewayNum
=
num
+
""
;
takewayNum
=
num
+
""
;
takewayTotamout
=
cashStr
+
df
.
format
(
amount
);
takewayTotamout
=
cashStr
+
df
.
format
(
amount
);
if
(
voBean
.
getNum
()
!=
0
)
{
if
(
voBean
.
getNum
()
!=
0
)
{
double
number
=
amount
/
num
;
double
number
=
MoneyUtil
.
divide
(
amount
,
num
,
2
)
;
takewayAveragePrice
=
cashStr
+
df
.
format
(
Double
.
isNaN
(
number
)
?
0
:
number
);
takewayAveragePrice
=
cashStr
+
df
.
format
(
number
);
}
}
if
(
amount
>
0
)
{
if
(
amount
>
0
)
{
takewayPercentage
=
(
int
)
(
MoneyUtil
.
divide
(
amount
,
amount
,
2
)
*
100
)
+
""
;
takewayPercentage
=
(
int
)
(
MoneyUtil
.
divide
(
amount
,
voBean
.
getTotamount
(),
2
)
*
100
)
+
""
;
}
if
(!
GsaCloudApplication
.
mV2
.
contains
(
Build
.
MODEL
)
&&
!
GsaCloudApplication
.
mN5
.
contains
(
Build
.
MODEL
))
{
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
takewayText
,
takewayNum
,
takewayTotamout
,
takewayAveragePrice
,
takewayPercentage
));
}
}
}
else
{
}
else
{
takewayText
=
""
;
takewayText
=
""
;
...
@@ -419,20 +429,25 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
...
@@ -419,20 +429,25 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
selfFetchingNum
=
num
+
""
;
selfFetchingNum
=
num
+
""
;
selfFetchingTotamout
=
cashStr
+
df
.
format
(
amount
);
selfFetchingTotamout
=
cashStr
+
df
.
format
(
amount
);
if
(
voBean
.
getNum
()
!=
0
)
{
if
(
voBean
.
getNum
()
!=
0
)
{
double
number
=
amount
/
num
;
double
number
=
MoneyUtil
.
divide
(
amount
,
num
,
2
)
;
selfFetchingAveragePrice
=
cashStr
+
df
.
format
(
Double
.
isNaN
(
number
)
?
0
:
number
);
selfFetchingAveragePrice
=
cashStr
+
df
.
format
(
number
);
}
}
if
(
amount
>
0
)
{
if
(
amount
>
0
)
{
selfFetchingPercentage
=
(
int
)
(
MoneyUtil
.
divide
(
amount
,
amount
,
2
)
*
100
)
+
""
;
selfFetchingPercentage
=
(
int
)
(
MoneyUtil
.
divide
(
amount
,
voBean
.
getTotamount
(),
2
)
*
100
)
+
""
;
}
if
(!
GsaCloudApplication
.
mV2
.
contains
(
Build
.
MODEL
)
&&
!
GsaCloudApplication
.
mN5
.
contains
(
Build
.
MODEL
))
{
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
selfFetchingText
,
selfFetchingNum
,
selfFetchingTotamout
,
selfFetchingAveragePrice
,
selfFetchingPercentage
));
}
}
}
else
{
}
else
{
selfFetchingText
=
""
;
selfFetchingText
=
""
;
}
}
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"類別"
,
canteenText
,
takewayText
,
selfFetchingText
,
null
));
if
(
GsaCloudApplication
.
mV2
.
contains
(
Build
.
MODEL
)
||
GsaCloudApplication
.
mN5
.
contains
(
Build
.
MODEL
))
{
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"賬單"
,
canteenNum
,
takewayNum
,
selfFetchingNum
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"類別"
,
canteenText
,
takewayText
,
selfFetchingText
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"金額"
,
canteenTotamout
,
takewayTotamout
,
selfFetchingTotamout
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"賬單"
,
canteenNum
,
takewayNum
,
selfFetchingNum
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"平均"
,
canteenAveragePrice
,
takewayAveragePrice
,
selfFetchingAveragePrice
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"金額"
,
canteenTotamout
,
takewayTotamout
,
selfFetchingTotamout
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"金額%"
,
canteenPercentage
,
takewayPercentage
,
selfFetchingPercentage
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"平均"
,
canteenAveragePrice
,
takewayAveragePrice
,
selfFetchingAveragePrice
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"金額%"
,
canteenPercentage
,
takewayPercentage
,
selfFetchingPercentage
,
null
));
}
}
}
if
(
analysisBeanMap
!=
null
&&
analysisBeanMap
.
size
()
>
0
)
{
if
(
analysisBeanMap
!=
null
&&
analysisBeanMap
.
size
()
>
0
)
{
...
...
main-module/src/main/res/layout/item_settlement_report5.xml
View file @
1507007e
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<
com.gingersoft.gsa.cloud.ui.view.AutoFit
TextView
<TextView
android:id=
"@+id/tv_item1"
android:id=
"@+id/tv_item1"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
@@ -41,9 +41,8 @@
...
@@ -41,9 +41,8 @@
<TextView
<TextView
android:id=
"@+id/tv_item4"
android:id=
"@+id/tv_item4"
android:layout_width=
"
0dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.5"
android:gravity=
"center"
android:gravity=
"center"
android:maxLines=
"1"
android:maxLines=
"1"
android:text=
"item4"
android:text=
"item4"
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/OrderDetailItem.java
View file @
1507007e
...
@@ -56,6 +56,8 @@ public class OrderDetailItem implements Serializable {
...
@@ -56,6 +56,8 @@ public class OrderDetailItem implements Serializable {
private
double
amount
;
private
double
amount
;
/**賬單小數*/
/**賬單小數*/
private
Double
rounding
;
private
Double
rounding
;
/**服务费*/
private
Double
serviceAmount
;
private
String
payName
;
private
String
payName
;
private
String
orderPayType
;
private
String
orderPayType
;
private
double
tipsPrice
;
private
double
tipsPrice
;
...
@@ -136,6 +138,14 @@ public class OrderDetailItem implements Serializable {
...
@@ -136,6 +138,14 @@ public class OrderDetailItem implements Serializable {
this
.
rounding
=
rounding
;
this
.
rounding
=
rounding
;
}
}
public
Double
getServiceAmount
()
{
return
serviceAmount
;
}
public
void
setServiceAmount
(
Double
serviceAmount
)
{
this
.
serviceAmount
=
serviceAmount
;
}
public
double
getTipsPrice
()
{
public
double
getTipsPrice
()
{
return
tipsPrice
;
return
tipsPrice
;
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
View file @
1507007e
...
@@ -131,20 +131,20 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -131,20 +131,20 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
initOrderAdapter
();
initOrderAdapter
();
initItemClickListener
();
initItemClickListener
();
removeOrderMoney
();
remove
Bill
OrderMoney
();
addTableServiceAmount
();
addTableServiceAmount
();
addSentOrder
Money
();
addSentOrder
Discount
();
addOrderRounding
();
addOrderRounding
();
//設置賬單總金額
//設置賬單總金額
myOrderManage
.
setTotalAmount
(
getTotalAmount
());
myOrderManage
.
setTotalAmount
(
getTotalAmount
());
}
}
private
void
removeOrderMoney
()
{
private
void
remove
Bill
OrderMoney
()
{
for
(
int
i
=
mOrderMoneyList
.
size
()
-
1
;
i
>=
0
;
i
--)
{
for
(
int
i
=
mOrderMoneyList
.
size
()
-
1
;
i
>=
0
;
i
--)
{
BillOrderMoney
billOrderMoney
=
mOrderMoneyList
.
get
(
i
);
BillOrderMoney
billOrderMoney
=
mOrderMoneyList
.
get
(
i
);
if
(
billOrderMoney
.
getType
()
==
BillOrderMoney
.
DISCOUNT_TYPE
&&
billOrderMoney
.
getStatus
()
==
0
)
{
if
(
(
billOrderMoney
.
getType
()
==
BillOrderMoney
.
DISCOUNT_TYPE
&&
billOrderMoney
.
getStatus
()
==
0
)
)
{
//未送單折扣
這裡
不刪除
//未送單折扣不刪除
}
else
{
}
else
{
mOrderMoneyList
.
remove
(
i
);
mOrderMoneyList
.
remove
(
i
);
}
}
...
@@ -296,9 +296,9 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -296,9 +296,9 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
}
}
/**
/**
* 添加已送單折扣
,服務費
* 添加已送單折扣
*/
*/
private
void
addSentOrder
Money
()
{
private
void
addSentOrder
Discount
()
{
OrderBean
orderBean
=
myOrderManage
.
getOrderBean
();
OrderBean
orderBean
=
myOrderManage
.
getOrderBean
();
if
(
orderBean
!=
null
)
{
if
(
orderBean
!=
null
)
{
//折扣
//折扣
...
@@ -323,26 +323,21 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -323,26 +323,21 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
*/
*/
private
void
addTableServiceAmount
()
{
private
void
addTableServiceAmount
()
{
TableBean
.
DataBean
dataBean
=
OpenTableManage
.
getDefault
().
getTableBean
();
TableBean
.
DataBean
dataBean
=
OpenTableManage
.
getDefault
().
getTableBean
();
double
serviceAmount
=
getTotalAmountFilterByType
(
BillOrderMoney
.
DISCOUNT_TYPE
,
BillOrderMoney
.
ROUNDING_TYPE
)
*
dataBean
.
getServiceCharge
()
/
100
;
double
serviceAmount
=
getTotalAmountFilterByType
(
BillOrderMoney
.
SERVERCHARGE_TYPE
,
BillOrderMoney
.
DISCOUNT_TYPE
,
BillOrderMoney
.
ROUNDING_TYPE
)
*
dataBean
.
getServiceCharge
()
/
100
;
if
(
serviceAmount
>
0
)
{
if
(
serviceAmount
>
0
)
{
BillOrderMoney
orderMoney
=
new
BillOrderMoney
();
BillOrderMoney
orderMoney
=
new
BillOrderMoney
();
orderMoney
.
setMoney
(
serviceAmount
);
orderMoney
.
setMoney
(
serviceAmount
);
orderMoney
.
setTitle
(
dataBean
.
getServiceCharge
()+
"%"
+
serviceChargeStr
);
orderMoney
.
setTitle
(
dataBean
.
getServiceCharge
()
+
"%"
+
serviceChargeStr
);
orderMoney
.
setStatus
(
1
);
orderMoney
.
setStatus
(
1
);
orderMoney
.
setType
(
BillOrderMoney
.
SERVERCHARGE_TYPE
);
orderMoney
.
setType
(
BillOrderMoney
.
SERVERCHARGE_TYPE
);
orderMoney
.
setTextColor
(
ArmsUtils
.
getColor
(
IActivity
,
R
.
color
.
theme_black
));
orderMoney
.
setTextColor
(
ArmsUtils
.
getColor
(
IActivity
,
R
.
color
.
theme_black
));
mOrderMoneyList
.
add
(
orderMoney
);
BillOrderMoney
discountBill
=
getBillOrderItemByType
(
BillOrderMoney
.
DISCOUNT_TYPE
);
mOrderMoneyAdapter
.
notifyDataSetChanged
();
if
(
discountBill
!=
null
)
{
}
mOrderMoneyList
.
add
(
0
,
orderMoney
);
}
}
else
{
mOrderMoneyList
.
add
(
orderMoney
);
private
void
removeTableServiceAmount
()
{
for
(
BillOrderMoney
item
:
mOrderMoneyList
)
{
if
(
item
.
getType
()
==
BillOrderMoney
.
SERVERCHARGE_TYPE
)
{
mOrderMoneyList
.
remove
(
item
);
mOrderMoneyAdapter
.
notifyDataSetChanged
();
break
;
}
}
mOrderMoneyAdapter
.
notifyDataSetChanged
();
}
}
}
}
...
@@ -350,8 +345,15 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -350,8 +345,15 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
* 更新账单折扣
* 更新账单折扣
*/
*/
private
void
updateTableServiceAmount
()
{
private
void
updateTableServiceAmount
()
{
removeTableServiceAmount
();
BillOrderMoney
billOrderMoney
=
getBillOrderItemByType
(
BillOrderMoney
.
SERVERCHARGE_TYPE
);
addTableServiceAmount
();
if
(
billOrderMoney
!=
null
)
{
TableBean
.
DataBean
dataBean
=
OpenTableManage
.
getDefault
().
getTableBean
();
double
serviceAmount
=
getTotalAmountFilterByType
(
BillOrderMoney
.
SERVERCHARGE_TYPE
,
BillOrderMoney
.
DISCOUNT_TYPE
,
BillOrderMoney
.
ROUNDING_TYPE
)
*
dataBean
.
getServiceCharge
()
/
100
;
if
(
serviceAmount
>
0
)
{
billOrderMoney
.
setMoney
(
serviceAmount
);
mOrderMoneyAdapter
.
notifyDataSetChanged
();
}
}
}
}
/**
/**
...
@@ -380,6 +382,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -380,6 +382,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
}
}
orderMoney
.
setStatus
(
status
);
orderMoney
.
setStatus
(
status
);
orderMoney
.
setDiscount
(
discount
);
orderMoney
.
setDiscount
(
discount
);
mOrderMoneyList
.
add
(
orderMoney
);
mOrderMoneyList
.
add
(
orderMoney
);
mOrderMoneyAdapter
.
notifyDataSetChanged
();
mOrderMoneyAdapter
.
notifyDataSetChanged
();
//更新總金額
//更新總金額
...
@@ -391,6 +394,15 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -391,6 +394,15 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
}
}
}
}
private
BillOrderMoney
getBillOrderItemByType
(
int
type
)
{
for
(
BillOrderMoney
orderMoney
:
mOrderMoneyList
)
{
if
(
orderMoney
.
getType
()
==
type
)
{
return
orderMoney
;
}
}
return
null
;
}
/**
/**
* 更新折扣金額
* 更新折扣金額
*/
*/
...
@@ -526,15 +538,15 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -526,15 +538,15 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
}
}
/**
/**
* 獲取總金額
:已排除賬單小數
* 獲取總金額
*
*
* @return
* @return
*/
*/
public
double
getTotalAmountFilterByType
(
int
...
filterTypes
)
{
public
double
getTotalAmountFilterByType
(
int
...
filterTypes
)
{
double
foodTotal
=
getFoodTotal
();
double
foodTotal
=
getFoodTotal
();
for
(
BillOrderMoney
item
:
mOrderMoneyList
)
{
for
(
BillOrderMoney
item
:
mOrderMoneyList
)
{
// if (item.getType() != BillOrderMoney.ROUNDING_TYPE) {
// if (item.getType() != BillOrderMoney.ROUNDING_TYPE) {
if
(!
filterType
(
item
.
getType
(),
filterTypes
))
{
if
(!
filterType
(
item
.
getType
(),
filterTypes
))
{
foodTotal
=
MoneyUtil
.
sum
(
foodTotal
,
item
.
getMoney
());
foodTotal
=
MoneyUtil
.
sum
(
foodTotal
,
item
.
getMoney
());
if
(
0
>
foodTotal
)
{
if
(
0
>
foodTotal
)
{
//折扣金額不能超出總額
//折扣金額不能超出總額
...
@@ -545,14 +557,15 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -545,14 +557,15 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
return
MoneyUtil
.
get_ItemDecimals_money
(
foodTotal
);
return
MoneyUtil
.
get_ItemDecimals_money
(
foodTotal
);
}
}
private
boolean
filterType
(
int
curType
,
int
...
filterTypes
)
{
private
boolean
filterType
(
int
curType
,
int
...
filterTypes
)
{
for
(
int
type:
filterTypes
)
{
for
(
int
type
:
filterTypes
)
{
if
(
curType
==
type
)
{
if
(
curType
==
type
)
{
return
true
;
return
true
;
}
}
}
}
return
false
;
return
false
;
}
}
/**
/**
* 獲取總金額:已減去折扣,服務費
* 獲取總金額:已減去折扣,服務費
*
*
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderDetailActivity.java
View file @
1507007e
...
@@ -194,6 +194,10 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
...
@@ -194,6 +194,10 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
if
(
mOrderCenterMoneyList
.
size
()
>
0
)
{
if
(
mOrderCenterMoneyList
.
size
()
>
0
)
{
mOrderCenterMoneyList
.
clear
();
mOrderCenterMoneyList
.
clear
();
}
}
SectionTextItem3
serviceAmountSection
=
getOrderServiceAmountSection
(
orderDetailItem
);
if
(
serviceAmountSection
!=
null
)
{
mOrderCenterMoneyList
.
add
(
serviceAmountSection
);
}
List
<
SectionTextItem3
>
discountSections
=
getOrderDiscountSections
(
orderDetailItem
,
totalMoney
);
List
<
SectionTextItem3
>
discountSections
=
getOrderDiscountSections
(
orderDetailItem
,
totalMoney
);
if
(
discountSections
!=
null
)
{
if
(
discountSections
!=
null
)
{
mOrderCenterMoneyList
.
addAll
(
discountSections
);
mOrderCenterMoneyList
.
addAll
(
discountSections
);
...
@@ -301,6 +305,18 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
...
@@ -301,6 +305,18 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
}
}
/**
/**
* 获取服务费
* @param orderDetailItem
* @return
*/
private
SectionTextItem3
getOrderServiceAmountSection
(
OrderDetailItem
orderDetailItem
)
{
if
(
orderDetailItem
.
getServiceAmount
()
!=
null
&&
orderDetailItem
.
getServiceAmount
()
!=
0
)
{
return
SectionTextItem3
.
serviceAmountTransSectionTextItem3
(
orderDetailItem
.
getServiceAmount
());
}
return
null
;
}
/**
* 返回合計金額
* 返回合計金額
*
*
* @return
* @return
...
...
table-module/src/main/res/layout/table_activity_order_content.xml
View file @
1507007e
...
@@ -199,7 +199,7 @@
...
@@ -199,7 +199,7 @@
android:textStyle=
"bold"
android:textStyle=
"bold"
android:layout_gravity=
"right"
android:layout_gravity=
"right"
android:textColor=
"@color/theme_white_color"
android:textColor=
"@color/theme_white_color"
android:paddingRight=
"@dimen/dp_
10
"
android:paddingRight=
"@dimen/dp_
8
"
android:gravity=
"right|center_vertical"
/>
android:gravity=
"right|center_vertical"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
table-module/src/main/res/layout/table_activity_order_pay.xml
View file @
1507007e
...
@@ -169,7 +169,7 @@
...
@@ -169,7 +169,7 @@
android:textStyle=
"bold"
android:textStyle=
"bold"
android:layout_gravity=
"right"
android:layout_gravity=
"right"
android:textColor=
"@color/theme_white_color"
android:textColor=
"@color/theme_white_color"
android:paddingRight=
"@dimen/dp_
10
"
android:paddingRight=
"@dimen/dp_
8
"
android:gravity=
"right|center_vertical"
/>
android:gravity=
"right|center_vertical"
/>
</LinearLayout>
</LinearLayout>
...
...
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