Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
browser-backend
Commits
c36fac64
Commit
c36fac64
authored
Apr 09, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公司月报
企业认证bug
parent
34530148
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
1 deletion
+87
-1
CompanyAuthorize.java
...edgec/browserbackend/account/domain/CompanyAuthorize.java
+2
-0
CompanyMonthReport.java
...gec/browserbackend/account/domain/CompanyMonthReport.java
+20
-0
CompanyAuthorizeDto.java
...edgec/browserbackend/account/dto/CompanyAuthorizeDto.java
+2
-0
UserPrePaidBillingRepositoryCustom.java
...ccount/repository/UserPrePaidBillingRepositoryCustom.java
+4
-0
UserPrePaidBillingRepositoryCustomImpl.java
...nt/repository/UserPrePaidBillingRepositoryCustomImpl.java
+55
-1
PrepaidBillingCountTaskScheduler.java
...d/account/scheduler/PrepaidBillingCountTaskScheduler.java
+4
-0
No files found.
src/main/java/com/edgec/browserbackend/account/domain/CompanyAuthorize.java
View file @
c36fac64
...
...
@@ -34,6 +34,8 @@ public class CompanyAuthorize {
this
.
companyName
=
companyAuthorizeDto
.
getCompanyName
();
if
(
companyAuthorizeDto
.
getRegisterNumber
()
!=
null
)
this
.
registerNumber
=
companyAuthorizeDto
.
getRegisterNumber
();
if
(
companyAuthorizeDto
.
getCoporationPlace
()
!=
null
)
this
.
coporationPlace
=
companyAuthorizeDto
.
getCoporationPlace
();
this
.
writePerson
=
companyAuthorizeDto
.
getWritePerson
();
}
...
...
src/main/java/com/edgec/browserbackend/account/domain/CompanyMonthReport.java
View file @
c36fac64
...
...
@@ -15,6 +15,10 @@ public class CompanyMonthReport {
private
float
companyExpenseAmount
;
//公司支出
private
float
companyWithDrawnAmount
;
//公司提现
private
float
companyBankTransferAmount
;
//公司银行转账
public
int
getYear
()
{
return
year
;
...
...
@@ -55,4 +59,20 @@ public class CompanyMonthReport {
public
void
setCompanyIncomeAmount
(
float
companyIncomeAmount
)
{
this
.
companyIncomeAmount
=
companyIncomeAmount
;
}
public
float
getCompanyBankTransferAmount
()
{
return
companyBankTransferAmount
;
}
public
void
setCompanyBankTransferAmount
(
float
companyBankTransferAmount
)
{
this
.
companyBankTransferAmount
=
companyBankTransferAmount
;
}
public
float
getCompanyWithDrawnAmount
()
{
return
companyWithDrawnAmount
;
}
public
void
setCompanyWithDrawnAmount
(
float
companyWithDrawnAmount
)
{
this
.
companyWithDrawnAmount
=
companyWithDrawnAmount
;
}
}
src/main/java/com/edgec/browserbackend/account/dto/CompanyAuthorizeDto.java
View file @
c36fac64
...
...
@@ -33,6 +33,8 @@ public class CompanyAuthorizeDto {
this
.
companyName
=
companyAuthorize
.
getCompanyName
();
if
(
companyAuthorize
.
getRegisterNumber
()
!=
null
)
this
.
registerNumber
=
companyAuthorize
.
getRegisterNumber
();
if
(
companyAuthorize
.
getCoporationPlace
()
!=
null
)
this
.
coporationPlace
=
companyAuthorize
.
getCoporationPlace
();
this
.
writePerson
=
companyAuthorize
.
getWritePerson
();
}
...
...
src/main/java/com/edgec/browserbackend/account/repository/UserPrePaidBillingRepositoryCustom.java
View file @
c36fac64
...
...
@@ -18,6 +18,10 @@ public interface UserPrePaidBillingRepositoryCustom {
float
companyExpenseAmount
(
int
year
,
int
month
);
float
companyWithdrawAmount
(
int
year
,
int
month
);
float
companyBankTransferAmount
(
int
year
,
int
month
);
Page
<
UserPrePaidBilling
>
findByUsernameAndChargeTypes
(
Pageable
pageable
,
String
username
,
String
[]
chargeTypes
,
int
year
,
int
month
,
int
day
,
String
zoneId
);
Page
<
UserPrePaidBilling
>
findBillsByCondition
(
Pageable
pageable
,
String
username
,
BillQueryCriteriaDto
billQueryCriteriaDto
,
long
dayBeginTime
,
long
dayEndTime
);
...
...
src/main/java/com/edgec/browserbackend/account/repository/UserPrePaidBillingRepositoryCustomImpl.java
View file @
c36fac64
...
...
@@ -63,7 +63,9 @@ public class UserPrePaidBillingRepositoryCustomImpl implements UserPrePaidBillin
@Override
public
float
companyExpenseAmount
(
int
year
,
int
month
)
{
MatchOperation
matchOperation
=
Aggregation
.
match
(
where
(
"year"
).
is
(
year
).
and
(
"month"
).
is
(
month
).
and
(
"payMethod"
).
in
(
Arrays
.
asList
(
0
,
3
,
4
)));
Criteria
criteria
=
new
Criteria
();
criteria
.
where
(
"year"
).
is
(
year
).
and
(
"month"
).
is
(
month
).
orOperator
(
where
(
"payMethod"
).
is
(
3
),
where
(
"chargeType"
).
is
(
4
));
MatchOperation
matchOperation
=
Aggregation
.
match
(
criteria
);
GroupOperation
groupOperation
=
Aggregation
.
group
(
"month"
).
sum
(
"total"
).
as
(
"prepaidAmount"
);
AggregationResults
<
Map
>
totalSum
=
mongoTemplate
.
aggregate
(
Aggregation
.
newAggregation
(
matchOperation
,
groupOperation
),
...
...
@@ -114,6 +116,58 @@ public class UserPrePaidBillingRepositoryCustomImpl implements UserPrePaidBillin
}
}
@Override
public
float
companyWithdrawAmount
(
int
year
,
int
month
)
{
MatchOperation
matchOperation
=
Aggregation
.
match
(
where
(
"year"
).
is
(
year
).
and
(
"month"
).
is
(
month
).
and
(
"chargeType"
).
is
(
4
));
GroupOperation
groupOperation
=
Aggregation
.
group
(
"month"
).
sum
(
"total"
).
as
(
"prepaidAmount"
);
AggregationResults
<
Map
>
totalSum
=
mongoTemplate
.
aggregate
(
Aggregation
.
newAggregation
(
matchOperation
,
groupOperation
),
UserPrePaidBilling
.
class
,
Map
.
class
);
if
(
totalSum
.
getMappedResults
()
==
null
||
totalSum
.
getMappedResults
().
size
()
==
0
)
{
return
0
;
}
else
{
Map
map
=
totalSum
.
getMappedResults
().
get
(
0
);
if
(
map
==
null
)
{
return
0
;
}
else
{
Double
sum
=
(
Double
)
map
.
get
(
"prepaidAmount"
);
if
(
sum
==
null
)
{
return
0
;
}
else
{
return
sum
.
floatValue
();
}
}
}
}
@Override
public
float
companyBankTransferAmount
(
int
year
,
int
month
)
{
MatchOperation
matchOperation
=
Aggregation
.
match
(
where
(
"year"
).
is
(
year
).
and
(
"month"
).
is
(
month
).
and
(
"payMethod"
).
is
(
3
));
GroupOperation
groupOperation
=
Aggregation
.
group
(
"month"
).
sum
(
"total"
).
as
(
"prepaidAmount"
);
AggregationResults
<
Map
>
totalSum
=
mongoTemplate
.
aggregate
(
Aggregation
.
newAggregation
(
matchOperation
,
groupOperation
),
UserPrePaidBilling
.
class
,
Map
.
class
);
if
(
totalSum
.
getMappedResults
()
==
null
||
totalSum
.
getMappedResults
().
size
()
==
0
)
{
return
0
;
}
else
{
Map
map
=
totalSum
.
getMappedResults
().
get
(
0
);
if
(
map
==
null
)
{
return
0
;
}
else
{
Double
sum
=
(
Double
)
map
.
get
(
"prepaidAmount"
);
if
(
sum
==
null
)
{
return
0
;
}
else
{
return
sum
.
floatValue
();
}
}
}
}
@Override
public
Page
<
UserPrePaidBilling
>
findByUsernameAndChargeTypes
(
Pageable
pageable
,
String
username
,
String
[]
chargeTypes
,
int
year
,
int
month
,
int
day
,
String
zoneId
)
{
...
...
src/main/java/com/edgec/browserbackend/account/scheduler/PrepaidBillingCountTaskScheduler.java
View file @
c36fac64
...
...
@@ -39,12 +39,16 @@ public class PrepaidBillingCountTaskScheduler {
int
count
=
new
Long
(
userPrePaidBillingRepository
.
countPrepaidOrderNum
(
i
,
j
)).
intValue
();
float
companyExpenseAmount
=
userPrePaidBillingRepository
.
companyExpenseAmount
(
i
,
j
);
float
companyIncomeAmount
=
userPrePaidBillingRepository
.
companyIncomeAmount
(
i
,
j
);
float
companyWithdrawAmount
=
userPrePaidBillingRepository
.
companyWithdrawAmount
(
i
,
j
);
float
companyBankTransferAmount
=
userPrePaidBillingRepository
.
companyBankTransferAmount
(
i
,
j
);
CompanyMonthReport
companyMonthReport
=
new
CompanyMonthReport
();
companyMonthReport
.
setYear
(
i
);
companyMonthReport
.
setMonth
(
j
);
companyMonthReport
.
setBillingCount
(
count
);
companyMonthReport
.
setCompanyExpenseAmount
(
companyExpenseAmount
);
companyMonthReport
.
setCompanyIncomeAmount
(
companyIncomeAmount
);
companyMonthReport
.
setCompanyWithDrawnAmount
(
companyWithdrawAmount
);
companyMonthReport
.
setCompanyBankTransferAmount
(
companyBankTransferAmount
);
monthReportRepository
.
save
(
companyMonthReport
);
}
else
{
continue
;
...
...
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