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
cdaef6c2
Commit
cdaef6c2
authored
Apr 30, 2021
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、報表時間問題 、銷售外送報表沒顯示數據問題
parent
13ff529e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
14 deletions
+19
-14
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
+7
-3
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/SalesFragment.java
+8
-5
library-common/src/main/java/com/gingersoft/gsa/cloud/common/utils/time/TimeUtils.java
+4
-6
No files found.
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
View file @
cdaef6c2
...
@@ -49,6 +49,7 @@ import com.qmuiteam.qmui.alpha.QMUIAlphaButton;
...
@@ -49,6 +49,7 @@ import com.qmuiteam.qmui.alpha.QMUIAlphaButton;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -212,9 +213,12 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
...
@@ -212,9 +213,12 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
String
[]
xData
=
new
String
[
manyDay
];
String
[]
xData
=
new
String
[
manyDay
];
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
//設置默認時間為當前的起止時間
//設置默認時間為當前的起止時間
-1天,因為要把起始時間算進去
try
{
try
{
cal
.
setTime
(
TimeUtils
.
DATE_FORMAT_DATE
.
parse
(
startTime
));
Date
parse
=
TimeUtils
.
DATE_FORMAT_DATE
.
parse
(
TimeUtils
.
getDatebyDate
(
startTime
,
-
1
));
if
(
parse
!=
null
)
{
cal
.
setTime
(
parse
);
}
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -249,7 +253,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
...
@@ -249,7 +253,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
//配置線形圖
//配置線形圖
AAChartModel
aaChartModel
=
configureColorfulGradientSplineChart
(
xData
,
chartData
,
(
int
)
(
yAxisTickInterval
/
6
));
AAChartModel
aaChartModel
=
configureColorfulGradientSplineChart
(
xData
,
chartData
,
(
int
)
(
yAxisTickInterval
/
6
));
//如果這幾天的數據都為0,設置默認最大數為18000,間隔為3000
//如果這幾天的數據都為0,設置默認最大數為18000,間隔為3000
if
(
yAxisTickInterval
==
0
)
{
if
(
yAxisTickInterval
<
1
)
{
aaChartModel
.
yAxisMax
(
18000
f
);
aaChartModel
.
yAxisMax
(
18000
f
);
aaChartModel
.
yAxisTickInterval
(
3000
);
aaChartModel
.
yAxisTickInterval
(
3000
);
}
else
{
}
else
{
...
...
component-main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/SalesFragment.java
View file @
cdaef6c2
...
@@ -3,18 +3,18 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.fragment;
...
@@ -3,18 +3,18 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.fragment;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Message
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.MotionEvent
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
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
androidx.fragment.app.Fragment
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
;
...
@@ -109,6 +109,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -109,6 +109,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
@BindView
(
R2
.
id
.
pc_report_delivery
)
@BindView
(
R2
.
id
.
pc_report_delivery
)
AAChartView
mDeliveryLineChart
;
AAChartView
mDeliveryLineChart
;
public
static
SalesFragment
newInstance
()
{
public
static
SalesFragment
newInstance
()
{
SalesFragment
fragment
=
new
SalesFragment
();
SalesFragment
fragment
=
new
SalesFragment
();
return
fragment
;
return
fragment
;
...
@@ -376,6 +377,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -376,6 +377,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
chart
.
highlightValues
(
null
);
chart
.
highlightValues
(
null
);
chart
.
invalidate
();
chart
.
invalidate
();
}
}
//查詢多少天的數據
//查詢多少天的數據
private
int
manyDay
=
7
;
private
int
manyDay
=
7
;
...
@@ -407,7 +409,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -407,7 +409,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
}
}
//y軸 數據間隔
//y軸 數據間隔
double
yAxisTickInterval
=
0
;
int
yAxisTickInterval
=
0
;
//第一條線
//第一條線
for
(
int
i
=
0
;
i
<
manyDay
;
i
++)
{
for
(
int
i
=
0
;
i
<
manyDay
;
i
++)
{
//通過今年年份+月份+日期,獲取對應的對象
//通過今年年份+月份+日期,獲取對應的對象
...
@@ -420,7 +422,8 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -420,7 +422,8 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
}
}
}
}
//配置線形圖
//配置線形圖
AAChartModel
aaChartModel
=
configureColorfulGradientSplineChart
(
xData
,
chartData
,
(
int
)
(
yAxisTickInterval
/
6
));
yAxisTickInterval
=
yAxisTickInterval
/
6
;
AAChartModel
aaChartModel
=
configureColorfulGradientSplineChart
(
xData
,
chartData
,
yAxisTickInterval
);
//如果這幾天的數據都為0,設置默認最大數為18000,間隔為3000
//如果這幾天的數據都為0,設置默認最大數為18000,間隔為3000
if
(
yAxisTickInterval
==
0
)
{
if
(
yAxisTickInterval
==
0
)
{
aaChartModel
.
yAxisMax
(
18000
f
);
aaChartModel
.
yAxisMax
(
18000
f
);
...
@@ -532,7 +535,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -532,7 +535,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
mPresenter
.
getSalesReportInfo
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
mPresenter
.
getSalesReportInfo
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
}
}
private
void
getDeliveryReport
(){
private
void
getDeliveryReport
()
{
String
startTime
=
TimeUtils
.
getDatebyDate
(
startEndTimePickerView
.
getStartTime
(),
0
);
String
startTime
=
TimeUtils
.
getDatebyDate
(
startEndTimePickerView
.
getStartTime
(),
0
);
String
endTime
=
TimeUtils
.
getDatebyDate
(
startEndTimePickerView
.
getEndTime
(),
1
);
String
endTime
=
TimeUtils
.
getDatebyDate
(
startEndTimePickerView
.
getEndTime
(),
1
);
mPresenter
.
getDeliveryOrderCurveInfo
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
mPresenter
.
getDeliveryOrderCurveInfo
(
RestaurantInfoManager
.
newInstance
().
getRestaurantId
()
+
""
,
startTime
,
endTime
);
...
...
library-common/src/main/java/com/gingersoft/gsa/cloud/common/utils/time/TimeUtils.java
View file @
cdaef6c2
...
@@ -25,10 +25,10 @@ public class TimeUtils {
...
@@ -25,10 +25,10 @@ public class TimeUtils {
/**
/**
* SimpleDateFormat.format把date转成String
* SimpleDateFormat.format把date转成String
* SimpleDateFormat.parse把String转成date。
* SimpleDateFormat.parse把String转成date。
*
*
<p>
* SimpleDateFormat.parse的时候,经常会有ParseException原因是输入的字符串格式跟SimpleDateFormat定义的格式不一致。
* SimpleDateFormat.parse的时候,经常会有ParseException原因是输入的字符串格式跟SimpleDateFormat定义的格式不一致。
* 这时候,可以先通过SimpleDateFormat.format把参数转成符合格式的字符串,然后再调用SimpleDateFormat.parse
* 这时候,可以先通过SimpleDateFormat.format把参数转成符合格式的字符串,然后再调用SimpleDateFormat.parse
*
*
<p>
* G 年代标志符
* G 年代标志符
* y 年
* y 年
* M 月
* M 月
...
@@ -90,7 +90,7 @@ public class TimeUtils {
...
@@ -90,7 +90,7 @@ public class TimeUtils {
public
static
final
SimpleDateFormat
DATE_FORMAT_DATE_HM
=
new
SimpleDateFormat
(
"HH:mm"
);
public
static
final
SimpleDateFormat
DATE_FORMAT_DATE_HM
=
new
SimpleDateFormat
(
"HH:mm"
);
public
static
final
SimpleDateFormat
DATE_FORMAT_DATE_H
=
new
SimpleDateFormat
(
"HH"
);
public
static
final
SimpleDateFormat
DATE_FORMAT_DATE_H
=
new
SimpleDateFormat
(
"HH"
);
public
static
final
SimpleDateFormat
DATE_FORMAT_HMS
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
public
static
final
SimpleDateFormat
DATE_FORMAT_HMS
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
public
static
final
SimpleDateFormat
DEFAULT_DATE_MDHM
=
new
SimpleDateFormat
(
"MM-dd HH:mm"
);
//, Locale.CHINESE
public
static
final
SimpleDateFormat
DEFAULT_DATE_MDHM
=
new
SimpleDateFormat
(
"MM-dd HH:mm"
);
//, Locale.CHINESE
public
static
final
SimpleDateFormat
DEFAULT_DATE_MD
=
new
SimpleDateFormat
(
"MM-dd"
);
public
static
final
SimpleDateFormat
DEFAULT_DATE_MD
=
new
SimpleDateFormat
(
"MM-dd"
);
...
@@ -369,6 +369,7 @@ public class TimeUtils {
...
@@ -369,6 +369,7 @@ public class TimeUtils {
}
}
return
curDateTime
;
return
curDateTime
;
}
}
//获取当前系统前后第几小时
//获取当前系统前后第几小时
public
static
String
getNextHour
(
int
i
)
{
public
static
String
getNextHour
(
int
i
)
{
String
curDateTime
=
null
;
String
curDateTime
=
null
;
...
@@ -1569,9 +1570,6 @@ public class TimeUtils {
...
@@ -1569,9 +1570,6 @@ public class TimeUtils {
* @return
* @return
*/
*/
public
static
String
getDatebyDate
(
String
date
,
int
day
)
{
public
static
String
getDatebyDate
(
String
date
,
int
day
)
{
if
(
day
==
0
)
{
return
""
;
}
try
{
try
{
Date
date1
=
TimeUtils
.
DATE_FORMAT_DATE
.
parse
(
date
);
Date
date1
=
TimeUtils
.
DATE_FORMAT_DATE
.
parse
(
date
);
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
...
...
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