Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
2084c5e2
Commit
2084c5e2
authored
Dec 20, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单数据统计
parent
e75cff7d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
19 deletions
+27
-19
FeeTypeBo.java
...i/src/main/java/com/xxfc/platform/order/bo/FeeTypeBo.java
+1
-10
StatisticsStatusEnum.java
...latform/order/contant/enumerate/StatisticsStatusEnum.java
+8
-2
OrderRentVehicleReceivedStatistics.java
...form/order/entity/OrderRentVehicleReceivedStatistics.java
+2
-0
OrderRentVehicleReceivedStatisticsMapper.xml
...urces/mapper/OrderRentVehicleReceivedStatisticsMapper.xml
+11
-0
ServiceTest.java
xx-order/xx-order-server/src/test/java/ServiceTest.java
+5
-7
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/bo/FeeTypeBo.java
View file @
2084c5e2
package
com
.
xxfc
.
platform
.
order
.
bo
;
import
cn.hutool.json.JSONObject
;
import
com.xxfc.platform.order.contant.enumerate.AccountTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.DeductionTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.StatisticsStatusEnum
;
import
com.xxfc.platform.order.pojo.account.OrderAccountBo
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDeduction
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDetail
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.apache.commons.collections4.CollectionUtils
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Objects
;
/**
* @author libin
...
...
@@ -40,6 +30,7 @@ public class FeeTypeBo implements Serializable {
private
BigDecimal
breakRulesRegulationAmount
=
BigDecimal
.
ZERO
;
private
BigDecimal
lossSpecifiedAmount
=
BigDecimal
.
ZERO
;
private
BigDecimal
extraAmount
=
BigDecimal
.
ZERO
;
private
BigDecimal
extraNoDeductibleAmount
=
BigDecimal
.
ZERO
;
}
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/contant/enumerate/StatisticsStatusEnum.java
View file @
2084c5e2
...
...
@@ -132,12 +132,14 @@ public enum StatisticsStatusEnum {
if
(
orderAccountBo
.
getAccountType
().
equals
(
AccountTypeEnum
.
IN_ORDER_PAY
.
getCode
()))
{
//订单押金
feeTypeBo
.
setDepositAmount
(
feeTypeBo
.
getDepositAmount
().
add
(
accountDetailEntity
.
getDepositAmount
()));
//订单金额(不包含免赔和押金)
feeTypeBo
.
setTotalAmount
(
feeTypeBo
.
getTotalAmount
().
add
(
accountDetailEntity
.
getOrderAmount
()));
if
(
hasDamageSafe
)
{
BigDecimal
dameSafeAmount
=
getDameSafeAmount
(
orderAccountBo
.
getData
());
feeTypeBo
.
setNoDeductibleAmount
(
feeTypeBo
.
getNoDeductibleAmount
().
add
(
dameSafeAmount
));
feeTypeBo
.
setTotalAmount
(
feeTypeBo
.
getTotalAmount
().
subtract
(
feeTypeBo
.
getNoDeductibleAmount
()));
}
//订单金额(不包含免赔和押金)
feeTypeBo
.
setTotalAmount
(
feeTypeBo
.
getTotalAmount
().
add
(
accountDetailEntity
.
getOrderAmount
()).
subtract
(
feeTypeBo
.
getNoDeductibleAmount
()));
}
else
{
//退款订单押金
feeTypeBo
.
setDepositRefundAmount
(
feeTypeBo
.
getDepositRefundAmount
().
add
(
accountDetailEntity
.
getDepositAmount
()));
...
...
@@ -182,6 +184,10 @@ public enum StatisticsStatusEnum {
feeTypeBo
.
setExtraAmount
(
feeTypeBo
.
getExtraAmount
().
add
(
extendAmount
));
}
}
//其他费用-延迟用车不记免赔
if
(
Objects
.
equals
(
DeductionTypeEnum
.
OTHER_DELAY_SAFE
.
getCode
(),
deduction
.
getType
())){
feeTypeBo
.
setExtraNoDeductibleAmount
(
feeTypeBo
.
getExtraNoDeductibleAmount
().
add
(
deductionAmount
));
}
}
//退款订单金额(不包含免赔和押金)
feeTypeBo
.
setOrderRefundAmount
(
feeTypeBo
.
getOrderRefundAmount
().
add
(
accountDetailEntity
.
getOrderAmount
()).
subtract
(
feeTypeBo
.
getNoDeductibleRefundAmount
()));
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderRentVehicleReceivedStatistics.java
View file @
2084c5e2
...
...
@@ -45,4 +45,6 @@ public class OrderRentVehicleReceivedStatistics extends OrderReceivedStatisticsB
@ApiModelProperty
(
"不计免赔费用"
)
private
BigDecimal
noDeductibleRefundAmount
;
@Column
(
name
=
"extra_no_deductible_amount"
)
private
BigDecimal
extraNoDeductibleAmount
;
}
xx-order/xx-order-server/src/main/resources/mapper/OrderRentVehicleReceivedStatisticsMapper.xml
View file @
2084c5e2
...
...
@@ -17,6 +17,17 @@
<result
property=
"payWay"
column=
"pay_way"
/>
<result
property=
"companyId"
column=
"company_id"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"extraNoDeductibleAmount"
column=
"extral_no_deductible_amount"
/>
<result
property=
"orderRefundAmount"
column=
"order_refund_amount"
/>
<result
property=
"lateFeeAmount"
column=
"late_fee_amount"
/>
<result
property=
"extraAmount"
column=
"extra_amount"
/>
<result
property=
"companyName"
column=
"company_name"
/>
<result
property=
"noDeductibleAmount"
column=
"no_deductible_amount"
/>
<result
property=
"noDeductibleRefundAmount"
column=
"no_deductible_refund_amount"
/>
<result
property=
"lossSpecifiedAmount"
column=
"loss_specified_amount"
/>
<result
property=
"depositRefundAmount"
column=
"deposit_refund_amount"
/>
<result
property=
"depositAmount"
column=
"deposit_amount"
/>
<result
property=
"breakRulesRegulationAmount"
column=
"break_rules_regulation_amount"
/>
</resultMap>
<select
id=
"selectOrderRentVehicleReceivedStatisticsGroupByDate"
resultType=
"com.xxfc.platform.order.entity.OrderRentVehicleReceivedStatistics"
>
select `year`,`date`,IFNULL(sum(`total_amount`-`order_refund_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_rent_vehicle_received_statistics` where 1=1
...
...
xx-order/xx-order-server/src/test/java/ServiceTest.java
View file @
2084c5e2
...
...
@@ -15,8 +15,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Date
;
import
java.util.Map
;
...
...
@@ -97,7 +95,7 @@ public class ServiceTest {
@Test
public
void
testMemberStatistics
(){
Date
date
=
DateTime
.
parse
(
"2019-11-
28
"
).
toDate
();
Date
date
=
DateTime
.
parse
(
"2019-11-
15
"
).
toDate
();
Date
startDate
=
DateUtil
.
beginOfDay
(
date
).
toJdkDate
();
Date
endDate
=
DateUtil
.
endOfDay
(
date
).
toJdkDate
();
Map
<
Integer
,
String
>
companyMap
=
vehicleFeign
.
findCompanyMap
();
...
...
@@ -106,7 +104,7 @@ public class ServiceTest {
@Test
public
void
testRentVehicleStatistics
(){
Date
date
=
DateTime
.
parse
(
"2019-11-1
1
"
).
toDate
();
Date
date
=
DateTime
.
parse
(
"2019-11-1
5
"
).
toDate
();
Date
startDate
=
DateUtil
.
beginOfDay
(
date
).
toJdkDate
();
Date
endDate
=
DateUtil
.
endOfDay
(
date
).
toJdkDate
();
Map
<
Integer
,
String
>
companyMap
=
vehicleFeign
.
findCompanyMap
();
...
...
@@ -127,13 +125,13 @@ public class ServiceTest {
public
void
testOrderReceivedStatisticsJobHandler
(){
cn
.
hutool
.
core
.
date
.
DateTime
dateTime
=
DateUtil
.
parse
(
"2019-11-29"
,
"yyyy-MM-dd"
);
// cn.hutool.core.date.DateTime offset = DateUtil.offset(dateTime, DateField.DAY_OF_MONTH, 1);
// orderReceivedStatisticsJobHandler.execute("2019-10-08
");
LocalDate
startLocalDate
=
LocalDate
.
of
(
2019
,
10
,
01
);
orderReceivedStatisticsJobHandler
.
execute
(
"2019-11-15
"
);
/*
LocalDate startLocalDate = LocalDate.of(2019, 10, 01);
LocalDate endLocalDate = LocalDate.of(2019,12,19);
while (startLocalDate.isBefore(endLocalDate)){
String dateStr = startLocalDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
startLocalDate = startLocalDate.plusDays(1);
orderReceivedStatisticsJobHandler.execute(dateStr);
}
}
*/
}
}
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