Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
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
TCM
tcm-system
Commits
78819d8f
Commit
78819d8f
authored
Mar 19, 2024
by
tangfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改余额为0的处理,
添加银行卡空指针问题
parent
259fffcc
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
364 additions
and
115 deletions
+364
-115
CompanyMoneyDao.java
.../java/com/pangding/web/authority/dao/CompanyMoneyDao.java
+2
-0
CompanyMoneyDaoImpl.java
.../pangding/web/authority/dao/impl/CompanyMoneyDaoImpl.java
+16
-0
CompanyMoneyService.java
...m/pangding/web/authority/service/CompanyMoneyService.java
+2
-0
AuthorityServiceImpl.java
...ding/web/authority/service/impl/AuthorityServiceImpl.java
+1
-1
CompanyMoneyServiceImpl.java
...g/web/authority/service/impl/CompanyMoneyServiceImpl.java
+5
-0
ShareCodeUtil.java
...n/java/com/pangding/web/authority/util/ShareCodeUtil.java
+2
-2
UserTask.java
src/main/java/com/pangding/web/authority/util/UserTask.java
+1
-1
V2IndexService.java
.../java/com/pangding/web/report/service/V2IndexService.java
+2
-0
V2IndexServiceImpl.java
.../pangding/web/report/service/impl/V2IndexServiceImpl.java
+154
-98
V2IndexController.java
...n/java/com/pangding/web/report/web/V2IndexController.java
+12
-4
SystemStopDao.java
src/main/java/com/pangding/web/system/dao/SystemStopDao.java
+1
-1
SystemWarnDao.java
src/main/java/com/pangding/web/system/dao/SystemWarnDao.java
+12
-0
SystemStopDaoImpl.java
...a/com/pangding/web/system/dao/impl/SystemStopDaoImpl.java
+2
-2
SystemWarnDaoImpl.java
...a/com/pangding/web/system/dao/impl/SystemWarnDaoImpl.java
+39
-0
SystemStopService.java
...va/com/pangding/web/system/service/SystemStopService.java
+1
-1
SystemWarnService.java
...va/com/pangding/web/system/service/SystemWarnService.java
+17
-0
SystemStopServiceImpl.java
...ngding/web/system/service/impl/SystemStopServiceImpl.java
+3
-3
SystemWarnServiceImpl.java
...ngding/web/system/service/impl/SystemWarnServiceImpl.java
+50
-0
SystemStopController.java
...ava/com/pangding/web/system/web/SystemStopController.java
+2
-2
SystemWarnController.java
...ava/com/pangding/web/system/web/SystemWarnController.java
+40
-0
No files found.
src/main/java/com/pangding/web/authority/dao/CompanyMoneyDao.java
View file @
78819d8f
...
...
@@ -34,4 +34,6 @@ public interface CompanyMoneyDao extends BaseDao {
Integer
updateCompanyMoney
(
CompanyMoneyVo
req
);
CompanyMoneyVo
findLastInfo
(
CompanyMoneyReqVo
req
);
List
<
CompanyMoneyVo
>
findCompanyMoneyTotalMonthList
(
CompanyMoneyReqVo
req
);
}
src/main/java/com/pangding/web/authority/dao/impl/CompanyMoneyDaoImpl.java
View file @
78819d8f
...
...
@@ -20,6 +20,8 @@ public class CompanyMoneyDaoImpl extends BaseDaoImpl implements CompanyMoneyDao
public
static
final
String
LAST_INFO
=
"LAST_INFO"
;
public
static
final
String
QUERY_TOTAL_MONTH
=
"QUERY_TOTAL_MONTH"
;
@Override
protected
void
init
()
{
...
...
@@ -31,6 +33,15 @@ public class CompanyMoneyDaoImpl extends BaseDaoImpl implements CompanyMoneyDao
.
add
(
"endDate"
,
" AND daily_date <= ?"
)
.
add
(
"companyName"
,
" AND company_name like concat('%',?,'%') "
);
table
.
add
(
QUERY_TOTAL_MONTH
,
"SELECT DATE_FORMAT(a.daily_date, '%Y-%m') AS daily_date,"
+
"IFNULL(SUM( a.in_money ),0)AS in_money, IFNULL(SUM( a.refund_money ),0)AS refund_money,"
+
"IFNULL(SUM( a.in_number ),0)AS in_number,IFNULL(SUM( a.refund_number ),0)AS refund_number "
+
"FROM pd_company_money a WHERE 1=1 {WHERE} GROUP BY DATE_FORMAT(a.daily_date,'%Y-%m') order by daily_date "
)
.
add
(
"companyId"
,
" AND company_id = ? "
)
.
add
(
"startDate"
,
" AND daily_date >= ?"
)
.
add
(
"endDate"
,
" AND daily_date <= ?"
)
.
add
(
"companyName"
,
" AND company_name like concat('%',?,'%') "
);
table
.
add
(
QUERT_REPORT
,
"SELECT SUM(init_money) as init_money,SUM(in_money) as in_money,SUM(out_money) as out_money,"
+
"SUM(refund_money) as refund_money,SUM(final_money) as final_money,SUM(in_number) as in_number,"
+
"SUM(out_number) as out_number,SUM(refund_number) as refund_number"
+
...
...
@@ -80,4 +91,9 @@ public class CompanyMoneyDaoImpl extends BaseDaoImpl implements CompanyMoneyDao
return
this
.
queryFirst
(
CompanyMoneyVo
.
class
,
LAST_INFO
,
req
);
}
@Override
public
List
<
CompanyMoneyVo
>
findCompanyMoneyTotalMonthList
(
CompanyMoneyReqVo
req
)
{
return
this
.
query
(
CompanyMoneyVo
.
class
,
QUERY_TOTAL_MONTH
,
req
);
}
}
src/main/java/com/pangding/web/authority/service/CompanyMoneyService.java
View file @
78819d8f
...
...
@@ -15,4 +15,6 @@ public interface CompanyMoneyService {
CompanyMoneyVo
findLastInfo
(
CompanyMoneyReqVo
req
);
CompanyMoneyVo
findTotal
(
CompanyMoneyReqVo
req
);
List
<
CompanyMoneyVo
>
findCompanyMoneyTotalMonthList
(
CompanyMoneyReqVo
req
);
}
src/main/java/com/pangding/web/authority/service/impl/AuthorityServiceImpl.java
View file @
78819d8f
...
...
@@ -264,7 +264,7 @@ public class AuthorityServiceImpl implements AuthorityService {
// if (!StringHelper.isEmpty(parent)) {
// resVo.setParentName(parent.getName());
// } else {
//
S
ystem.out.println("id:" + authorityVo.getPid());
//
s
ystem.out.println("id:" + authorityVo.getPid());
// }
//
// }
...
...
src/main/java/com/pangding/web/authority/service/impl/CompanyMoneyServiceImpl.java
View file @
78819d8f
...
...
@@ -67,4 +67,9 @@ public class CompanyMoneyServiceImpl implements CompanyMoneyService {
}
@Override
public
List
<
CompanyMoneyVo
>
findCompanyMoneyTotalMonthList
(
CompanyMoneyReqVo
req
)
{
return
companyMoneyDao
.
findCompanyMoneyTotalMonthList
(
req
);
}
}
src/main/java/com/pangding/web/authority/util/ShareCodeUtil.java
View file @
78819d8f
...
...
@@ -46,12 +46,12 @@ public class ShareCodeUtil {
while
((
id
/
binLen
)
>
0
)
{
int
ind
=
(
int
)
(
id
%
binLen
);
//
S
ystem.out.println(num + "-->" + ind);
//
s
ystem.out.println(num + "-->" + ind);
buf
[--
charPos
]
=
r
[
ind
];
id
/=
binLen
;
}
buf
[--
charPos
]
=
r
[(
int
)
(
id
%
binLen
)];
//
S
ystem.out.println(num + "-->" + num % binLen);
//
s
ystem.out.println(num + "-->" + num % binLen);
String
str
=
new
String
(
buf
,
charPos
,
(
32
-
charPos
));
// 不够长度的自动随机补全
if
(
str
.
length
()
<
s
)
{
...
...
src/main/java/com/pangding/web/authority/util/UserTask.java
View file @
78819d8f
...
...
@@ -85,7 +85,7 @@ public class UserTask {
for
(
int
i
=
0
;
i
<
companyResVoList
.
size
();
i
++)
{
CompanyResVo
companyResVo
=
companyResVoList
.
get
(
i
);
double
serviceCharge
=
financeService
.
getServiceCharge
(
companyResVo
);
//
S
ystem.out.println(companyResVo.getCompanyName() + "服务费" + serviceCharge );
//
s
ystem.out.println(companyResVo.getCompanyName() + "服务费" + serviceCharge );
if
(
serviceCharge
>
0
){
UpdateCompanyMoneyReqVo
updateCompanyMoneyReqVo
=
new
UpdateCompanyMoneyReqVo
();
updateCompanyMoneyReqVo
.
setCompanyId
(
companyResVo
.
getId
());
...
...
src/main/java/com/pangding/web/report/service/V2IndexService.java
View file @
78819d8f
...
...
@@ -11,4 +11,6 @@ public interface V2IndexService {
DataAnalysisBaseResVo
capitalAndOrderDay
(
DataAnalysisBaseReqVo
req
);
DataAnalysisBaseResVo
capitalAndOrderMonth
(
DataAnalysisBaseReqVo
req
);
}
src/main/java/com/pangding/web/report/service/impl/V2IndexServiceImpl.java
View file @
78819d8f
...
...
@@ -9,12 +9,10 @@ import com.pangding.web.vo.order.res.report.DataAnalysisBaseResVo;
import
com.pangding.web.vo.order.res.report.ReportDayFlowResVo
;
import
com.pangding.web.vo.system.pd.company.CompanyMoneyVo
;
import
com.pangding.web.vo.system.req.company.CompanyMoneyReqVo
;
import
com.
pangding.web.vo.system.res.company.CompanyMoneyTotalResVo
;
import
com.
yanzuoguang.util.helper.CalcHelper
;
import
com.yanzuoguang.util.helper.DateHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.MapRow
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
...
...
@@ -53,8 +51,18 @@ public class V2IndexServiceImpl implements V2IndexService {
if
(!
StringHelper
.
isEmpty
(
companyMoneyLast
))
{
// 最新一条数据为当天的数据
if
(
companyMoneyLast
.
getDailyDate
().
equals
(
DateHelper
.
getToday
()))
{
double
todayBalance
=
BigDecimal
.
valueOf
(
companyMoneyLast
.
getInitMoney
())
.
add
(
BigDecimal
.
valueOf
(
companyMoneyLast
.
getOutMoney
())).
doubleValue
();
double
initMoney
=
companyMoneyLast
.
getInitMoney
();
double
inMoney
=
companyMoneyLast
.
getInMoney
();
double
refundMoney
=
companyMoneyLast
.
getRefundMoney
();
double
outMoney
=
companyMoneyLast
.
getOutMoney
();
double
todayBalance
=
BigDecimal
.
valueOf
(
initMoney
)
.
add
(
BigDecimal
.
valueOf
(
outMoney
)).
doubleValue
();
if
(
CalcHelper
.
add
(
inMoney
,
refundMoney
)
<
0
)
{
double
balance
=
BigDecimal
.
valueOf
(
initMoney
)
.
add
(
BigDecimal
.
valueOf
(
refundMoney
)).
doubleValue
();
todayBalance
=
BigDecimal
.
valueOf
(
balance
)
.
add
(
BigDecimal
.
valueOf
(
outMoney
)).
doubleValue
();
}
result
.
setTodayBalance
(
todayBalance
);
double
todayMoney
=
BigDecimal
.
valueOf
(
companyMoneyLast
.
getInMoney
())
.
add
(
BigDecimal
.
valueOf
(
companyMoneyLast
.
getRefundMoney
())).
doubleValue
();
...
...
@@ -67,12 +75,12 @@ public class V2IndexServiceImpl implements V2IndexService {
// 查询汇总金额 提现汇总 经营汇总 交易订单 跨界汇总
if
(!
StringHelper
.
isEmpty
(
companyMoneyTotal
))
{
// 最新一条数据为当天的数据
double
balance
=
companyMoney
Last
.
getOutMoney
()
==
null
?
0
:
Math
.
abs
(
companyMoneyLast
.
getOutMoney
());
double
balance
=
companyMoney
Total
.
getOutMoney
()
==
null
?
0
:
Math
.
abs
(
companyMoneyTotal
.
getOutMoney
());
result
.
setBalance
(
balance
);
double
todayMoney
=
BigDecimal
.
valueOf
(
companyMoney
Last
.
getInMoney
())
.
add
(
BigDecimal
.
valueOf
(
companyMoney
Last
.
getRefundMoney
())).
doubleValue
();
double
todayMoney
=
BigDecimal
.
valueOf
(
companyMoney
Total
.
getInMoney
())
.
add
(
BigDecimal
.
valueOf
(
companyMoney
Total
.
getRefundMoney
())).
doubleValue
();
result
.
setPdOrderMoney
(
todayMoney
);
result
.
setOrderNum
(
companyMoney
Last
.
getInNumber
()
-
companyMoneyLast
.
getRefundNumber
());
result
.
setOrderNum
(
companyMoney
Total
.
getInNumber
()
-
companyMoneyTotal
.
getRefundNumber
());
}
return
result
;
}
...
...
@@ -82,122 +90,170 @@ public class V2IndexServiceImpl implements V2IndexService {
public
DataAnalysisBaseResVo
capitalAndOrderDay
(
DataAnalysisBaseReqVo
req
)
{
DataAnalysisBaseResVo
res
=
new
DataAnalysisBaseResVo
();
ReportDayFlowReqVo
reqVo
=
new
ReportDayFlowReqVo
();
String
monthStart
=
DateHelper
.
getDateTimeString
(
DateHelper
.
getMonthStart
(
DateHelper
.
getCurDate
())).
substring
(
0
,
10
);
String
monthEnd
=
DateHelper
.
getDateTimeString
(
DateHelper
.
getMonthEnd
(
DateHelper
.
getCurDate
())).
substring
(
0
,
10
);
reqVo
.
setQueryStartTime
(
monthStart
);
reqVo
.
setQueryEndTime
(
monthEnd
);
req
.
setQueryStartTime
(
monthStart
);
req
.
setQueryEndTime
(
monthEnd
);
// 经营流水
List
<
MapRow
>
moneyList
=
new
ArrayList
<>();
// 交易订单
List
<
MapRow
>
orderNumList
=
new
ArrayList
<>();
// 获取前三年数据 包含今年
for
(
int
i
=
2
;
i
>=
0
;
i
--)
{
MapRow
moneyMap
=
new
MapRow
();
MapRow
numMap
=
new
MapRow
();
// 获取当前月份开始时间
Date
nowDay
=
DateHelper
.
addYear
(
DateHelper
.
getCurDate
(),
-
i
);
Date
monthStartDate
=
DateHelper
.
getDateTime
(
DateHelper
.
getMonthStart
(
nowDay
));
Date
monthEndDate
=
DateHelper
.
getDateTime
(
DateHelper
.
getMonthEnd
(
nowDay
));
String
monthStart
=
DateHelper
.
getDateTimeString
(
monthStartDate
).
substring
(
0
,
10
);
String
monthEnd
=
DateHelper
.
getDateTimeString
(
monthEndDate
).
substring
(
0
,
10
);
// 得到该月有多少天
long
time1
=
DateHelper
.
betweenDay
(
DateHelper
.
getDateTime
(
monthStart
),
DateHelper
.
getDateTime
(
monthEnd
));
// 查询列表
CompanyMoneyReqVo
companyMoneyReqVo
=
new
CompanyMoneyReqVo
();
companyMoneyReqVo
.
setCompanyId
(
reqVo
.
getCompanyId
());
companyMoneyReqVo
.
setCompanyId
(
req
.
getCompanyId
());
companyMoneyReqVo
.
setStartDate
(
monthStart
);
companyMoneyReqVo
.
setEndDate
(
monthEnd
);
List
<
CompanyMoneyVo
>
companyMoneyVoList
=
companyMoneyService
.
findCompanyMoneyList
(
companyMoneyReqVo
);
req
.
setCreateDateBegin
(
monthStart
);
req
.
setCreateDateEnd
(
monthEnd
);
for
(
int
j
=
0
;
j
<=
time1
;
j
++)
{
if
(
j
>
0
)
{
monthStartDate
=
DateHelper
.
addDay
(
monthStartDate
,
1
);
monthStart
=
DateHelper
.
getDateTimeString
(
monthStartDate
).
substring
(
0
,
10
);
}
if
(
companyMoneyVoList
.
size
()
-
1
==
time1
)
{
double
money
=
BigDecimal
.
valueOf
(
companyMoneyVoList
.
get
(
j
).
getInMoney
())
.
add
(
BigDecimal
.
valueOf
(
companyMoneyVoList
.
get
(
j
).
getRefundMoney
())).
doubleValue
();
moneyMap
.
put
(
monthStart
,
money
);
int
number
=
companyMoneyVoList
.
get
(
j
).
getInNumber
()
-
companyMoneyVoList
.
get
(
j
).
getRefundNumber
();
numMap
.
put
(
monthStart
,
number
);
}
else
{
if
(
companyMoneyVoList
.
size
()
>
0
)
{
for
(
CompanyMoneyVo
companyMoneyVo
:
companyMoneyVoList
)
{
if
(
monthStart
.
equals
(
companyMoneyVo
.
getDailyDate
()))
{
double
money
=
BigDecimal
.
valueOf
(
companyMoneyVo
.
getInMoney
())
.
add
(
BigDecimal
.
valueOf
(
companyMoneyVo
.
getRefundMoney
())).
doubleValue
();
int
number
=
companyMoneyVo
.
getInNumber
()
-
companyMoneyVo
.
getRefundNumber
();
moneyMap
.
put
(
monthStart
,
money
);
numMap
.
put
(
monthStart
,
number
);
break
;
}
else
{
moneyMap
.
put
(
monthStart
,
0
);
numMap
.
put
(
monthStart
,
0
);
}
}
}
else
{
moneyMap
.
put
(
monthStart
,
0
);
numMap
.
put
(
monthStart
,
0
);
}
}
}
moneyList
.
add
(
moneyMap
);
orderNumList
.
add
(
numMap
);
}
getTotal
(
req
,
res
,
1
);
res
.
setMoneyList
(
moneyList
);
res
.
setOrderList
(
orderNumList
);
return
res
;
}
public
void
getTotal
(
DataAnalysisBaseReqVo
req
,
DataAnalysisBaseResVo
res
,
int
type
)
{
// 获取当前年 开始时间 结束时间
Date
nowDay
=
DateHelper
.
getCurDate
();
Date
startDate
=
DateHelper
.
getDateTime
(
DateHelper
.
getYearStart
(
nowDay
));
Date
endDate
=
DateHelper
.
getDateTime
(
DateHelper
.
getYearEnd
(
nowDay
));
if
(
type
==
1
)
{
// 月
startDate
=
DateHelper
.
getDateTime
(
DateHelper
.
getMonthStart
(
nowDay
));
endDate
=
DateHelper
.
getDateTime
(
DateHelper
.
getMonthEnd
(
nowDay
));
}
String
yearStart
=
DateHelper
.
getDateTimeString
(
startDate
).
substring
(
0
,
10
);
String
yearEnd
=
DateHelper
.
getDateTimeString
(
endDate
).
substring
(
0
,
10
);
CompanyMoneyReqVo
companyMoneyReqVo
=
new
CompanyMoneyReqVo
();
companyMoneyReqVo
.
setCompanyId
(
req
.
getCompanyId
());
companyMoneyReqVo
.
setStartDate
(
yearStart
);
companyMoneyReqVo
.
setEndDate
(
yearEnd
);
CompanyMoneyVo
companyMoneyTotal
=
companyMoneyService
.
findTotal
(
companyMoneyReqVo
);
if
(!
StringHelper
.
isEmpty
(
companyMoneyTotal
))
{
double
inMoney
=
StringHelper
.
isEmpty
(
companyMoneyTotal
.
getInMoney
())
?
0
:
companyMoneyTotal
.
getInMoney
();
double
refundMoney
=
StringHelper
.
isEmpty
(
companyMoneyTotal
.
getRefundMoney
())
?
0
:
companyMoneyTotal
.
getRefundMoney
();
double
money
=
BigDecimal
.
valueOf
(
inMoney
)
.
add
(
BigDecimal
.
valueOf
(
refundMoney
)).
doubleValue
();
res
.
setCapitalTotal
(
money
);
int
inNumber
=
StringHelper
.
isEmpty
(
companyMoneyTotal
.
getInNumber
())
?
0
:
companyMoneyTotal
.
getInNumber
();
int
refundNumber
=
StringHelper
.
isEmpty
(
companyMoneyTotal
.
getRefundNumber
())
?
0
:
companyMoneyTotal
.
getRefundNumber
();
int
number
=
inNumber
-
refundNumber
;
res
.
setOrderNum
(
number
);
}
}
@Override
public
DataAnalysisBaseResVo
capitalAndOrderMonth
(
DataAnalysisBaseReqVo
req
)
{
DataAnalysisBaseResVo
res
=
new
DataAnalysisBaseResVo
();
// 经营流水
List
<
MapRow
>
moneyList
=
new
ArrayList
<>();
// 交易订单
List
<
MapRow
>
orderNumList
=
new
ArrayList
<>();
// 用户订单
List
<
MapRow
>
userList
=
new
ArrayList
<>();
for
(
String
year
:
req
.
getYearList
())
{
MapRow
map1
=
new
MapRow
();
MapRow
map2
=
new
MapRow
();
Date
date2
=
DateHelper
.
getDateTime
(
req
.
getCreateDateBegin
());
Date
dateEnd1
=
DateHelper
.
getDateTime
(
req
.
getCreateDateEnd
());
long
time1
=
DateHelper
.
betweenDay
(
date2
,
dateEnd1
);
String
yearTime1
=
DateHelper
.
getDateTimeString
(
date2
).
substring
(
0
,
10
);
for
(
int
i
=
0
;
i
<=
time1
;
i
++)
{
if
(
i
>
0
)
{
date2
=
DateHelper
.
addDay
(
date2
,
1
);
yearTime1
=
DateHelper
.
getDateTimeString
(
date2
).
substring
(
0
,
10
);
}
if
(
companyMoneyVoList
.
size
()
-
1
==
time1
)
{
double
money
=
BigDecimal
.
valueOf
(
companyMoneyVoList
.
get
(
i
).
getInMoney
())
.
add
(
BigDecimal
.
valueOf
(
companyMoneyVoList
.
get
(
i
).
getRefundMoney
())).
doubleValue
();
map1
.
put
(
yearTime1
,
money
);
int
number
=
companyMoneyVoList
.
get
(
i
).
getInNumber
()
-
companyMoneyVoList
.
get
(
i
).
getRefundNumber
();
map2
.
put
(
yearTime1
,
number
);
// 获取前三年数据 包含今年
for
(
int
i
=
2
;
i
>=
0
;
i
--)
{
MapRow
moneyMap
=
new
MapRow
();
MapRow
numMap
=
new
MapRow
();
// 获取当前年 开始时间 结束时间
Date
nowDay
=
DateHelper
.
addYear
(
DateHelper
.
getCurDate
(),
-
i
);
Date
yserStartDate
=
DateHelper
.
getDateTime
(
DateHelper
.
getYearStart
(
nowDay
));
Date
yesrEndDate
=
DateHelper
.
getDateTime
(
DateHelper
.
getYearEnd
(
nowDay
));
String
yearStart
=
DateHelper
.
getDateTimeString
(
yserStartDate
).
substring
(
0
,
10
);
String
yearEnd
=
DateHelper
.
getDateTimeString
(
yesrEndDate
).
substring
(
0
,
10
);
// 得到该年有多少个月
long
time1
=
DateHelper
.
getMonthBetween
(
DateHelper
.
getDateTime
(
yearStart
),
DateHelper
.
getDateTime
(
yearEnd
))
+
1
;
CompanyMoneyReqVo
companyMoneyReqVo
=
new
CompanyMoneyReqVo
();
companyMoneyReqVo
.
setCompanyId
(
req
.
getCompanyId
());
companyMoneyReqVo
.
setStartDate
(
yearStart
);
companyMoneyReqVo
.
setEndDate
(
yearEnd
);
List
<
CompanyMoneyVo
>
companyMoneyVoList
=
companyMoneyService
.
findCompanyMoneyTotalMonthList
(
companyMoneyReqVo
);
for
(
int
j
=
0
;
j
<
time1
;
j
++)
{
String
month
=
DateHelper
.
getDateTimeString
(
DateHelper
.
addMonth
(
yserStartDate
,
+
j
)).
substring
(
0
,
7
);
if
(
companyMoneyVoList
.
size
()
==
time1
)
{
double
money
=
BigDecimal
.
valueOf
(
companyMoneyVoList
.
get
(
j
).
getInMoney
())
.
add
(
BigDecimal
.
valueOf
(
companyMoneyVoList
.
get
(
j
).
getRefundMoney
())).
doubleValue
();
moneyMap
.
put
(
month
,
money
);
int
number
=
companyMoneyVoList
.
get
(
j
).
getInNumber
()
-
companyMoneyVoList
.
get
(
j
).
getRefundNumber
();
numMap
.
put
(
month
,
number
);
}
else
{
if
(
companyMoneyVoList
.
size
()
>
0
)
{
for
(
CompanyMoneyVo
companyMoneyVo
:
companyMoneyVoList
)
{
if
(
yearTime1
.
equals
(
companyMoneyVo
.
getDailyDate
()))
{
String
dailyDate
=
companyMoneyVo
.
getDailyDate
().
substring
(
0
,
7
);
if
(
dailyDate
.
equals
(
month
))
{
double
money
=
BigDecimal
.
valueOf
(
companyMoneyVo
.
getInMoney
())
.
add
(
BigDecimal
.
valueOf
(
companyMoneyVo
.
getRefundMoney
())).
doubleValue
();
int
number
=
companyMoneyVo
.
getInNumber
()
-
companyMoneyVo
.
getRefundNumber
();
m
ap1
.
put
(
yearTime1
,
money
);
map2
.
put
(
yearTime1
,
number
);
m
oneyMap
.
put
(
month
,
money
);
numMap
.
put
(
month
,
number
);
break
;
}
else
{
m
ap1
.
put
(
yearTime1
,
0
);
map2
.
put
(
yearTime1
,
0
);
m
oneyMap
.
put
(
month
,
0
);
numMap
.
put
(
month
,
0
);
}
}
}
else
{
map1
.
put
(
yearTime1
,
0
);
map2
.
put
(
yearTime1
,
0
);
}
}
}
//
// //用户分析
// List<AnalysisBaseResVo> result2 = userAccumulateDao.loadMonthUser(req);
//
//
// MapRow map3 = new MapRow();
// Date dateStart = DateHelper.getDateTime(req.getCreateDateBegin());
// Date dateEnd = DateHelper.getDateTime(req.getCreateDateEnd());
// long time = DateHelper.betweenDay(dateStart, dateEnd);
//
// Date date1 = DateHelper.getDateTime(DateHelper.toDay(dateStart));
// String yearTime = DateHelper.getDateTimeString(date1).substring(0, 10);
//
// if (result2.size() == time+1) {
// for (int i = 0; i <= time; i++) {
// if (i > 0) {
// date1 = DateHelper.addDay(date1, 1);
// yearTime = DateHelper.getDateTimeString(date1).substring(0, 10);
// }
// map3.put(yearTime, result2.get(i).getUserNum());
// }
// } else {
// for (int i = 0; i <= time; i++) {
// if (i > 0) {
// date1 = DateHelper.addDay(date1, 1);
// yearTime = DateHelper.getDateTimeString(date1).substring(0, 10);
// }
// if (result2.size() > 0) {
// for (AnalysisBaseResVo analysis : result2) {
// if (yearTime.equals(analysis.getYears())) {
// map3.put(yearTime, analysis.getUserNum());
// break;
// } else {
// map3.put(yearTime, 0);
// }
// }
// } else {
// map3.put(yearTime, 0);
// }
// }
// }
moneyList
.
add
(
map1
);
orderNumList
.
add
(
map2
);
// userList.add(map3);
moneyMap
.
put
(
month
,
0
);
numMap
.
put
(
month
,
0
);
}
}
}
moneyList
.
add
(
moneyMap
);
orderNumList
.
add
(
numMap
);
}
getTotal
(
req
,
res
,
2
);
res
.
setMoneyList
(
moneyList
);
res
.
setOrderList
(
orderNumList
);
res
.
setUserList
(
userList
);
return
res
;
}
}
src/main/java/com/pangding/web/report/web/V2IndexController.java
View file @
78819d8f
...
...
@@ -38,14 +38,22 @@ public class V2IndexController {
*/
@RequestMapping
(
value
=
"/capitalAndOrderDay"
)
@ApiOperation
(
value
=
"资金流水和交易订单数据"
,
notes
=
"资金流水和交易订单数据"
)
public
ResponseResult
<
DataAnalysisBaseResVo
>
capitalAndOrder
Month
(
@RequestBody
DataAnalysisBaseReqVo
req
)
{
public
ResponseResult
<
DataAnalysisBaseResVo
>
capitalAndOrder
Day
(
@RequestBody
DataAnalysisBaseReqVo
req
)
{
CheckerHelper
check
=
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"companyId"
,
req
.
getCompanyId
())
.
checkException
();
if
(
"10001"
.
equals
(
req
.
getCompanyId
()))
{
req
.
setCompanyId
(
""
);
}
return
ResponseResult
.
result
(
v2IndexService
.
capitalAndOrderDay
(
req
));
}
/**
* B端首页数据分析月(实际是该月中每一天)
*/
@RequestMapping
(
value
=
"/capitalAndOrderMonth"
)
@ApiOperation
(
value
=
"资金流水和交易订单数据"
,
notes
=
"资金流水和交易订单数据"
)
public
ResponseResult
<
DataAnalysisBaseResVo
>
capitalAndOrderMonth
(
@RequestBody
DataAnalysisBaseReqVo
req
)
{
CheckerHelper
check
=
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"companyId"
,
req
.
getCompanyId
())
.
checkException
();
return
ResponseResult
.
result
(
v2IndexService
.
capitalAndOrderMonth
(
req
));
}
}
src/main/java/com/pangding/web/
V2
/dao/SystemStopDao.java
→
src/main/java/com/pangding/web/
system
/dao/SystemStopDao.java
View file @
78819d8f
package
com
.
pangding
.
web
.
V2
.
dao
;
package
com
.
pangding
.
web
.
system
.
dao
;
import
com.yanzuoguang.dao.BaseDao
;
...
...
src/main/java/com/pangding/web/system/dao/SystemWarnDao.java
0 → 100644
View file @
78819d8f
package
com
.
pangding
.
web
.
system
.
dao
;
import
com.pangding.web.vo.system.req.SystemWarnPageReqVo
;
import
com.pangding.web.vo.system.res.SystemWarnResVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
com.yanzuoguang.util.vo.PageSizeData
;
public
interface
SystemWarnDao
extends
BaseDao
{
PageSizeData
<
SystemWarnResVo
>
findListPage
(
SystemWarnPageReqVo
req
);
}
src/main/java/com/pangding/web/
V2
/dao/impl/SystemStopDaoImpl.java
→
src/main/java/com/pangding/web/
system
/dao/impl/SystemStopDaoImpl.java
View file @
78819d8f
package
com
.
pangding
.
web
.
V2
.
dao
.
impl
;
package
com
.
pangding
.
web
.
system
.
dao
.
impl
;
import
com.pangding.web.
V2
.dao.SystemStopDao
;
import
com.pangding.web.
system
.dao.SystemStopDao
;
import
com.pangding.web.vo.system.pd.SystemStopVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
...
...
src/main/java/com/pangding/web/system/dao/impl/SystemWarnDaoImpl.java
0 → 100644
View file @
78819d8f
package
com
.
pangding
.
web
.
system
.
dao
.
impl
;
import
com.pangding.web.system.dao.SystemWarnDao
;
import
com.pangding.web.vo.system.pd.SystemWarnVo
;
import
com.pangding.web.vo.system.req.SystemWarnPageReqVo
;
import
com.pangding.web.vo.system.res.SystemWarnResVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Component
;
@Component
public
class
SystemWarnDaoImpl
extends
BaseDaoImpl
implements
SystemWarnDao
{
private
final
String
QUERY_LIST
=
"QUERY_LIST"
;
@Override
protected
void
init
()
{
register
(
SystemWarnVo
.
class
);
table
.
add
(
QUERY_LIST
,
" select * from pd_system_warning where 1=1 {WHERE}"
)
.
add
(
"startDate"
,
" and create_date >= ? "
)
.
add
(
"endDate"
,
" and create_date <= ? "
)
.
add
(
"systemWarningId"
,
" and system_warning_id = ? "
)
.
add
(
"warnType"
,
" and warn_type = ? "
)
.
add
(
"warnName"
,
" and warnName LIKE concat('%', ?,'%') "
)
.
add
(
"companyName"
,
" and companyName LIKE concat('%', ?,'%') "
)
.
add
(
"merchantName"
,
" and merchantName LIKE concat('%', ?,'%') "
)
.
add
(
"productName"
,
" and productName LIKE concat('%', ?,'%') "
)
.
add
(
"channelTypeList"
,
" and channelTypeList in ( ? ) "
)
.
add
(
"warnStatusList"
,
" and warnStatusList in ( ? ) "
);
}
public
PageSizeData
<
SystemWarnResVo
>
findListPage
(
SystemWarnPageReqVo
req
){
return
this
.
queryPage
(
SystemWarnResVo
.
class
,
req
,
QUERY_LIST
,
req
);
}
}
src/main/java/com/pangding/web/
V2
/service/SystemStopService.java
→
src/main/java/com/pangding/web/
system
/service/SystemStopService.java
View file @
78819d8f
package
com
.
pangding
.
web
.
V2
.
service
;
package
com
.
pangding
.
web
.
system
.
service
;
import
com.pangding.web.vo.system.pd.SystemStopVo
;
import
com.pangding.web.vo.system.req.SystemStopReqVo
;
...
...
src/main/java/com/pangding/web/system/service/SystemWarnService.java
0 → 100644
View file @
78819d8f
package
com
.
pangding
.
web
.
system
.
service
;
import
com.pangding.web.vo.system.req.SystemWarnPageReqVo
;
import
com.pangding.web.vo.system.req.SystemWarnReqVo
;
import
com.pangding.web.vo.system.res.SystemWarnResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
public
interface
SystemWarnService
{
PageSizeData
<
SystemWarnResVo
>
findListPage
(
SystemWarnPageReqVo
req
);
SystemWarnResVo
find
(
SystemWarnReqVo
req
);
void
save
(
SystemWarnReqVo
req
);
}
src/main/java/com/pangding/web/
V2
/service/impl/SystemStopServiceImpl.java
→
src/main/java/com/pangding/web/
system
/service/impl/SystemStopServiceImpl.java
View file @
78819d8f
package
com
.
pangding
.
web
.
V2
.
service
.
impl
;
package
com
.
pangding
.
web
.
system
.
service
.
impl
;
import
com.pangding.web.
V2
.dao.SystemStopDao
;
import
com.pangding.web.
V2
.service.SystemStopService
;
import
com.pangding.web.
system
.dao.SystemStopDao
;
import
com.pangding.web.
system
.service.SystemStopService
;
import
com.pangding.web.vo.system.pd.SystemStopVo
;
import
com.pangding.web.vo.system.req.SystemStopReqVo
;
import
com.yanzuoguang.util.base.ObjectHelper
;
...
...
src/main/java/com/pangding/web/system/service/impl/SystemWarnServiceImpl.java
0 → 100644
View file @
78819d8f
package
com
.
pangding
.
web
.
system
.
service
.
impl
;
import
com.pangding.web.system.dao.SystemWarnDao
;
import
com.pangding.web.system.service.SystemWarnService
;
import
com.pangding.web.vo.system.pd.SystemWarnVo
;
import
com.pangding.web.vo.system.req.SystemWarnPageReqVo
;
import
com.pangding.web.vo.system.req.SystemWarnReqVo
;
import
com.pangding.web.vo.system.res.SystemWarnResVo
;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.stereotype.Service
;
@Service
public
class
SystemWarnServiceImpl
implements
SystemWarnService
{
private
SystemWarnDao
systemWarnDao
;
public
SystemWarnServiceImpl
(
SystemWarnDao
systemWarnDao
)
{
this
.
systemWarnDao
=
systemWarnDao
;
}
public
PageSizeData
<
SystemWarnResVo
>
findListPage
(
SystemWarnPageReqVo
req
){
return
systemWarnDao
.
findListPage
(
req
);
}
public
SystemWarnResVo
find
(
SystemWarnReqVo
req
){
return
systemWarnDao
.
load
(
req
,
SystemWarnResVo
.
class
);
}
public
void
save
(
SystemWarnReqVo
req
){
SystemWarnReqVo
sqlReq
=
new
SystemWarnReqVo
();
sqlReq
.
setCompanyName
(
req
.
getCompanyName
());
sqlReq
.
setMerchantName
(
req
.
getMerchantName
());
sqlReq
.
setProductName
(
req
.
getProductName
());
sqlReq
.
setWarnName
(
req
.
getWarnName
());
sqlReq
.
setWarnType
(
req
.
getWarnType
());
sqlReq
.
setChannelType
(
req
.
getChannelType
());
SystemWarnResVo
systemWarnResVo
=
systemWarnDao
.
load
(
sqlReq
,
SystemWarnResVo
.
class
);
if
(
StringHelper
.
isEmpty
(
systemWarnResVo
)){
SystemWarnVo
systemWarnVo
=
new
SystemWarnVo
();
ObjectHelper
.
writeWithFromClass
(
systemWarnVo
,
req
);
systemWarnDao
.
create
(
systemWarnVo
);
}
else
{
ObjectHelper
.
writeWithFromClass
(
systemWarnResVo
,
req
);
systemWarnDao
.
update
(
systemWarnResVo
);
}
}
}
src/main/java/com/pangding/web/
V2
/web/SystemStopController.java
→
src/main/java/com/pangding/web/
system
/web/SystemStopController.java
View file @
78819d8f
package
com
.
pangding
.
web
.
V2
.
web
;
package
com
.
pangding
.
web
.
system
.
web
;
import
com.pangding.web.
V2
.service.SystemStopService
;
import
com.pangding.web.
system
.service.SystemStopService
;
import
com.pangding.web.vo.system.pd.SystemStopVo
;
import
com.pangding.web.vo.system.req.SystemStopReqVo
;
import
com.yanzuoguang.util.vo.ResponseResult
;
...
...
src/main/java/com/pangding/web/system/web/SystemWarnController.java
0 → 100644
View file @
78819d8f
package
com
.
pangding
.
web
.
system
.
web
;
import
com.pangding.web.system.service.SystemWarnService
;
import
com.pangding.web.vo.system.req.SystemWarnPageReqVo
;
import
com.pangding.web.vo.system.req.SystemWarnReqVo
;
import
com.pangding.web.vo.system.res.SystemWarnResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
value
=
"/systemWarn"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@Api
(
value
=
"系统预警"
,
description
=
"系统预警"
)
public
class
SystemWarnController
{
private
SystemWarnService
systemWarnService
;
public
SystemWarnController
(
SystemWarnService
systemWarnService
)
{
this
.
systemWarnService
=
systemWarnService
;
}
@RequestMapping
(
value
=
"/findSystemWarnList"
)
@ApiOperation
(
value
=
"查询预警信息"
,
notes
=
"返回预警信息列表."
)
public
ResponseResult
<
PageSizeData
<
SystemWarnResVo
>>
findSystemWarnList
(
@RequestBody
SystemWarnPageReqVo
req
)
{
return
ResponseResult
.
result
(
systemWarnService
.
findListPage
(
req
));
}
@RequestMapping
(
value
=
"/findSystemWarn"
)
@ApiOperation
(
value
=
"查询预警信息详情"
,
notes
=
"返回预警信息详情."
)
public
ResponseResult
<
SystemWarnResVo
>
findSystemWarn
(
@RequestBody
SystemWarnReqVo
req
)
{
return
ResponseResult
.
result
(
systemWarnService
.
find
(
req
));
}
}
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