Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dataC_api
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
高宇
dataC_api
Commits
96e4c5e9
Commit
96e4c5e9
authored
May 12, 2024
by
高宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 固定表头第一步
parent
7c49f0be
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
294 additions
and
70 deletions
+294
-70
Jnsp7xtmStatisticsRepository.java
...cisoft/bus/jnsp7xtm/dao/Jnsp7xtmStatisticsRepository.java
+2
-2
Jnsp7xtmPageRequestDto.java
.../org/rcisoft/bus/jnsp7xtm/dto/Jnsp7xtmPageRequestDto.java
+4
-0
ColTransitionEnum.java
...ava/org/rcisoft/bus/jnsp7xtm/enums/ColTransitionEnum.java
+18
-8
Jnsp7xtmServiceImpl.java
...cisoft/bus/jnsp7xtm/service/impl/Jnsp7xtmServiceImpl.java
+135
-18
Jnsp7xtmStatisticServiceImpl.java
...s/jnsp7xtm/service/impl/Jnsp7xtmStatisticServiceImpl.java
+95
-21
Jnsp7xtmRepository.xml
...sources/mapper/bus/jnsp7xtm/mapper/Jnsp7xtmRepository.xml
+27
-17
Jnsp7xtmStatisticsRepository.xml
...pper/bus/jnsp7xtm/mapper/Jnsp7xtmStatisticsRepository.xml
+13
-4
No files found.
src/main/java/org/rcisoft/bus/jnsp7xtm/dao/Jnsp7xtmStatisticsRepository.java
View file @
96e4c5e9
...
...
@@ -25,7 +25,7 @@ public interface Jnsp7xtmStatisticsRepository {
List
<
String
>
getMonths
();
// 4.获取统计总条数
List
<
Map
<
String
,
Object
>>
queryStatisticsCount
(
@Param
(
"entity"
)
Jnsp7xtmPageRequestDto
jnsp74tmPageRequestDto
,
@Param
(
"monthList"
)
String
months
,
@Param
(
"statistics"
)
String
statistics
,
@Param
(
"orderColumn"
)
String
orderColumn
);
List
<
Map
<
String
,
Object
>>
queryStatisticsCount
(
@Param
(
"entity"
)
Jnsp7xtmPageRequestDto
jnsp74tmPageRequestDto
,
@Param
(
"monthList"
)
String
months
,
@Param
(
"statistics"
)
String
statistics
,
@Param
(
"orderColumn"
)
String
orderColumn
,
@Param
(
"joinSql"
)
String
joinSql
);
/**
* @description: 5.获取统计list
...
...
@@ -38,7 +38,7 @@ public interface Jnsp7xtmStatisticsRepository {
* @param: computedColumn - 计算列
* @return:
**/
List
<
Map
<
String
,
Object
>>
queryList
(
@Param
(
"entity"
)
Jnsp7xtmPageRequestDto
jnsp74tmPageRequestDto
,
@Param
(
"monthList"
)
String
months
,
@Param
(
"pageNo"
)
int
pageNo
,
@Param
(
"pageSize"
)
int
pageSize
,
@Param
(
"isPage"
)
String
isPage
,
@Param
(
"computedColumn"
)
String
computedColumn
,
@Param
(
"statistics"
)
String
statistics
,
@Param
(
"orderColumn"
)
String
orderColumn
);
List
<
Map
<
String
,
Object
>>
queryList
(
@Param
(
"entity"
)
Jnsp7xtmPageRequestDto
jnsp74tmPageRequestDto
,
@Param
(
"monthList"
)
String
months
,
@Param
(
"pageNo"
)
int
pageNo
,
@Param
(
"pageSize"
)
int
pageSize
,
@Param
(
"isPage"
)
String
isPage
,
@Param
(
"computedColumn"
)
String
computedColumn
,
@Param
(
"statistics"
)
String
statistics
,
@Param
(
"orderColumn"
)
String
orderColumn
,
@Param
(
"joinSql"
)
String
joinSql
);
// 6 查询合计接口
List
<
Jnsp7xtmDto
>
queryTotal
(
@Param
(
"entity"
)
Jnsp7xtmPageRequestDto
jnsp74tmPageRequestDto
);
...
...
src/main/java/org/rcisoft/bus/jnsp7xtm/dto/Jnsp7xtmPageRequestDto.java
View file @
96e4c5e9
...
...
@@ -117,4 +117,8 @@ public class Jnsp7xtmPageRequestDto {
// 导出类型 1:弹出框查询 2:明细查询
private
String
type
;
private
String
joinSql
;
private
String
querySql
;
}
src/main/java/org/rcisoft/bus/jnsp7xtm/enums/ColTransitionEnum.java
View file @
96e4c5e9
package
org
.
rcisoft
.
bus
.
jnsp7xtm
.
enums
;
import
lombok.Getter
;
@Getter
public
enum
ColTransitionEnum
{
JNSP7XTM
(
"jnsp_"
,
"j7xtm."
);
JNSP7XTM
(
"jnsp_"
,
"j7xtm."
),
ColTransitionEnum
(
String
code
,
String
value
){
this
.
value
=
value
;
CUSTOMER
(
"cus_"
,
"cust."
);
private
final
String
code
;
private
final
String
value
;
ColTransitionEnum
(
String
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getValue
()
{
return
value
;
}
private
String
value
,
code
;
}
src/main/java/org/rcisoft/bus/jnsp7xtm/service/impl/Jnsp7xtmServiceImpl.java
View file @
96e4c5e9
...
...
@@ -80,11 +80,18 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
}
jnsp74tmPageRequestDto
.
setType
(
"1"
);
// 获取总值
// 获取关联表语句
List
<
String
>
joinSqlList
=
new
ArrayList
<>();
String
joinSql
=
""
;
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getOneDimensionality
()))
{
String
originalOneDime
=
""
;
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalOneDime
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replaceAll
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
}
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalOneDime
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replaceAll
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
jnsp74tmPageRequestDto
.
setOneDimensionality
(
originalOneDime
);
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
()))
{
...
...
@@ -92,6 +99,10 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalTwoDime
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replaceAll
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
}
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalTwoDime
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replaceAll
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
jnsp74tmPageRequestDto
.
setTwoDimensionality
(
originalTwoDime
);
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
()))
{
...
...
@@ -99,8 +110,17 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalthreeDime
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replaceAll
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
}
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalthreeDime
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replaceAll
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
jnsp74tmPageRequestDto
.
setThreeDimensionality
(
originalthreeDime
);
}
if
(!
joinSqlList
.
isEmpty
())
{
joinSql
=
joinSqlList
.
stream
().
distinct
().
collect
(
Collectors
.
joining
(
" "
));
}
jnsp74tmPageRequestDto
.
setJoinSql
(
joinSql
);
IPage
<
Jnsp7xtm
>
jnsp74tmIPage
=
jnsp74tmRepository
.
queryJnsp74tmByPaged
(
paginationUtility
,
jnsp74tmPageRequestDto
);
return
jnsp74tmIPage
;
}
...
...
@@ -121,11 +141,17 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
}
jnsp74tmPageRequestDto
.
setType
(
"1"
);
// 获取总值
List
<
String
>
joinSqlList
=
new
ArrayList
<>();
String
joinSql
=
""
;
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getOneDimensionality
()))
{
String
originalOneDime
=
""
;
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalOneDime
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replaceAll
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
}
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalOneDime
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replaceAll
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
jnsp74tmPageRequestDto
.
setOneDimensionality
(
originalOneDime
);
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
()))
{
...
...
@@ -133,6 +159,10 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalTwoDime
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replaceAll
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
}
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalTwoDime
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replaceAll
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
jnsp74tmPageRequestDto
.
setTwoDimensionality
(
originalTwoDime
);
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
()))
{
...
...
@@ -140,8 +170,16 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalthreeDime
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replaceAll
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
}
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalthreeDime
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replaceAll
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
jnsp74tmPageRequestDto
.
setThreeDimensionality
(
originalthreeDime
);
}
if
(!
joinSqlList
.
isEmpty
())
{
joinSql
=
joinSqlList
.
stream
().
distinct
().
collect
(
Collectors
.
joining
(
" "
));
}
jnsp74tmPageRequestDto
.
setJoinSql
(
joinSql
);
Integer
total
=
jnsp74tmRepository
.
queryAllJnsp74tm
(
jnsp74tmPageRequestDto
);
if
(
total
>
0
)
{
int
pageNumber
=
1
;
...
...
@@ -180,12 +218,17 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
}
jnsp74tmPageRequestDto
.
setType
(
"2"
);
// 获取总值
// 获取总值
List
<
String
>
joinSqlList
=
new
ArrayList
<>();
String
joinSql
=
""
;
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getOneDimensionality
()))
{
String
originalOneDime
=
""
;
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalOneDime
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replaceAll
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
}
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalOneDime
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replaceAll
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
jnsp74tmPageRequestDto
.
setOneDimensionality
(
originalOneDime
);
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
()))
{
...
...
@@ -193,6 +236,10 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalTwoDime
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replaceAll
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
}
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalTwoDime
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replaceAll
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
jnsp74tmPageRequestDto
.
setTwoDimensionality
(
originalTwoDime
);
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
()))
{
...
...
@@ -200,8 +247,16 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalthreeDime
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replaceAll
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
}
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalthreeDime
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replaceAll
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
jnsp74tmPageRequestDto
.
setThreeDimensionality
(
originalthreeDime
);
}
if
(!
joinSqlList
.
isEmpty
())
{
joinSql
=
joinSqlList
.
stream
().
distinct
().
collect
(
Collectors
.
joining
(
" "
));
}
jnsp74tmPageRequestDto
.
setJoinSql
(
joinSql
);
Integer
total
=
jnsp74tmRepository
.
queryAllJnsp74tm
(
jnsp74tmPageRequestDto
);
if
(
total
>
0
)
{
int
pageNumber
=
1
;
...
...
@@ -294,6 +349,30 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
chzsTableHeaders
.
add
(
item
);
});
Jnsp7xtmDto
emptyJnsp74xmDto
=
jnsp74tmStatisticService
.
getEmptyJnsp74xmDto
(
jnsp74tmPageRequestDto
);
// 获取关联表语句
List
<
String
>
joinSqlList
=
new
ArrayList
<>();
String
joinSql
=
""
;
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getOneDimensionality
()))
{
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getTwoDimensionalityValue
()))
{
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionalityValue
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getThreeDimensionalityValue
()))
{
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionalityValue
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
}
if
(!
joinSqlList
.
isEmpty
())
{
joinSql
=
joinSqlList
.
stream
().
distinct
().
collect
(
Collectors
.
joining
(
" "
));
}
jnsp74tmPageRequestDto
.
setJoinSql
(
joinSql
);
List
<
Jnsp7xtmDto
>
tempjnsp74TmDtoList
=
jnsp74tmStatisticsRepository
.
queryTotal
(
jnsp74tmPageRequestDto
);
if
(!
tempjnsp74TmDtoList
.
isEmpty
())
{
// 过滤出没有对应合计值年份
...
...
@@ -360,10 +439,15 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
statistics
=
statisticsOneOneDimensionality
;
orderColumn
=
orderOneOneDimensionality
;
}
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
()))
{
String
statisticsOneOneDimensionality
=
""
;
...
...
@@ -372,18 +456,28 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
statistics
=
statistics
+
","
+
statisticsOneOneDimensionality
;
orderColumn
=
orderColumn
+
","
+
orderOneOneDimensionality
;
}
}
else
{
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
statistics
=
statisticsOneOneDimensionality
;
orderColumn
=
orderOneOneDimensionality
;
}
}
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
()))
{
String
statisticsOneOneDimensionality
=
""
;
...
...
@@ -392,36 +486,48 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
statistics
=
statistics
+
","
+
statisticsOneOneDimensionality
;
orderColumn
=
orderColumn
+
","
+
orderOneOneDimensionality
;
}
}
else
{
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
statistics
=
statisticsOneOneDimensionality
;
orderColumn
=
orderOneOneDimensionality
;
}
}
List
<
Map
<
String
,
Object
>>
exportListCount
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
1
,
10
,
"2"
,
"xsjg"
,
statistics
,
orderColumn
);
List
<
Map
<
String
,
Object
>>
exportListCount
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
1
,
10
,
"2"
,
"xsjg"
,
statistics
,
orderColumn
,
joinSql
);
if
(!
exportListCount
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
exportListCount
.
size
();
i
++)
{
HashMap
<
String
,
Object
>
contentMap
=
new
HashMap
<>();
if
(
jnsp74tmPageRequestDto
.
isChzs
())
{
getMap
(
"j7xtm.chzsa+j7xtm.chzsb"
,
statistics
,
i
,
chzsTableHeaders
,
months
,
jnsp74tmPageRequestDto
,
contentMap
,
orderColumn
);
getMap
(
"j7xtm.chzsa+j7xtm.chzsb"
,
statistics
,
i
,
chzsTableHeaders
,
months
,
jnsp74tmPageRequestDto
,
contentMap
,
orderColumn
,
joinSql
);
}
if
(
jnsp74tmPageRequestDto
.
isRmb
())
{
getMap
(
"j7xtm.rmb"
,
statistics
,
i
,
rmbTableHeaders
,
months
,
jnsp74tmPageRequestDto
,
contentMap
,
orderColumn
);
getMap
(
"j7xtm.rmb"
,
statistics
,
i
,
rmbTableHeaders
,
months
,
jnsp74tmPageRequestDto
,
contentMap
,
orderColumn
,
joinSql
);
}
if
(
jnsp74tmPageRequestDto
.
isChzsa
())
{
getMap
(
"j7xtm.chzsa"
,
statistics
,
i
,
chzsaTableHeaders
,
months
,
jnsp74tmPageRequestDto
,
contentMap
,
orderColumn
);
getMap
(
"j7xtm.chzsa"
,
statistics
,
i
,
chzsaTableHeaders
,
months
,
jnsp74tmPageRequestDto
,
contentMap
,
orderColumn
,
joinSql
);
}
if
(
jnsp74tmPageRequestDto
.
isChzsb
())
{
getMap
(
"j7xtm.chzsb"
,
statistics
,
i
,
chzsbTableHeaders
,
months
,
jnsp74tmPageRequestDto
,
contentMap
,
orderColumn
);
getMap
(
"j7xtm.chzsb"
,
statistics
,
i
,
chzsbTableHeaders
,
months
,
jnsp74tmPageRequestDto
,
contentMap
,
orderColumn
,
joinSql
);
}
dataList
.
add
(
contentMap
);
...
...
@@ -447,8 +553,8 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
/**
* 获取处理好的数据
* **/
private
void
getMap
(
String
dynamicColumn
,
String
statistics
,
int
i
,
List
<
Jnsp7xtmTableHeaderDto
>
oneTable
,
String
months
,
Jnsp7xtmPageRequestDto
jnsp74tmPageRequestDto
,
HashMap
<
String
,
Object
>
contentMap
,
String
orderColumn
)
{
List
<
Map
<
String
,
Object
>>
maps
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
1
,
10
,
"2"
,
dynamicColumn
,
statistics
,
orderColumn
);
private
void
getMap
(
String
dynamicColumn
,
String
statistics
,
int
i
,
List
<
Jnsp7xtmTableHeaderDto
>
oneTable
,
String
months
,
Jnsp7xtmPageRequestDto
jnsp74tmPageRequestDto
,
HashMap
<
String
,
Object
>
contentMap
,
String
orderColumn
,
String
joinSql
)
{
List
<
Map
<
String
,
Object
>>
maps
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
1
,
10
,
"2"
,
dynamicColumn
,
statistics
,
orderColumn
,
joinSql
);
for
(
int
j
=
0
;
j
<
oneTable
.
size
();
j
++)
{
for
(
Map
.
Entry
<
String
,
Object
>
objectEntry
:
maps
.
get
(
i
).
entrySet
())
{
if
(
objectEntry
.
getKey
().
equals
(
oneTable
.
get
(
j
).
getOldKey
()))
{
...
...
@@ -471,6 +577,8 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
fixedTable
.
put
(
"jypn"
,
"jypn"
);
fixedTable
.
put
(
"jlpm"
,
"jlpm"
);
fixedTable
.
put
(
"xslj"
,
"xslj"
);
fixedTable
.
put
(
"cust_io"
,
"custIo"
);
fixedTable
.
put
(
"cust_g0"
,
"custG0"
);
List
<
Jnsp7xtmTableHeaderDto
>
list
=
new
ArrayList
<>();
// 维度一
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getOneDimensionality
()))
{
...
...
@@ -478,6 +586,9 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalOneDime
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalOneDime
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
Jnsp7xtmTableHeaderDto
oneTableHeader
=
new
Jnsp7xtmTableHeaderDto
();
oneTableHeader
.
setName
(
fixedTable
.
get
(
originalOneDime
));
oneTableHeader
.
setKey
(
originalOneDime
);
...
...
@@ -490,6 +601,9 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalTwoDime
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalTwoDime
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
Jnsp7xtmTableHeaderDto
oneTableHeader
=
new
Jnsp7xtmTableHeaderDto
();
oneTableHeader
.
setName
(
fixedTable
.
get
(
originalTwoDime
));
oneTableHeader
.
setKey
(
originalTwoDime
);
...
...
@@ -502,6 +616,9 @@ public class Jnsp7xtmServiceImpl extends ServiceImpl<Jnsp7xtmRepository, Jnsp7xt
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalThreeDime
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalThreeDime
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
Jnsp7xtmTableHeaderDto
oneTableHeader
=
new
Jnsp7xtmTableHeaderDto
();
oneTableHeader
.
setName
(
fixedTable
.
get
(
originalThreeDime
));
oneTableHeader
.
setKey
(
originalThreeDime
);
...
...
src/main/java/org/rcisoft/bus/jnsp7xtm/service/impl/Jnsp7xtmStatisticServiceImpl.java
View file @
96e4c5e9
...
...
@@ -96,16 +96,27 @@ public class Jnsp7xtmStatisticServiceImpl implements Jnsp7xtmStatisticService {
String
statistics
=
""
;
// 获取排序列
String
orderColumn
=
""
;
// 获取关联表语句
List
<
String
>
joinSqlList
=
new
ArrayList
<>();
String
joinSql
=
""
;
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getOneDimensionality
()))
{
String
statisticsOneOneDimensionality
=
""
;
String
orderOneOneDimensionality
=
""
;
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
statistics
=
statisticsOneOneDimensionality
;
orderColumn
=
orderOneOneDimensionality
;
}
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
()))
{
String
statisticsOneOneDimensionality
=
""
;
...
...
@@ -114,18 +125,30 @@ public class Jnsp7xtmStatisticServiceImpl implements Jnsp7xtmStatisticService {
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
statistics
=
statistics
+
","
+
statisticsOneOneDimensionality
;
orderColumn
=
orderColumn
+
","
+
orderOneOneDimensionality
;
}
}
else
{
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
statistics
=
statisticsOneOneDimensionality
;
orderColumn
=
orderOneOneDimensionality
;
}
}
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
()))
{
String
statisticsOneOneDimensionality
=
""
;
...
...
@@ -134,16 +157,33 @@ public class Jnsp7xtmStatisticServiceImpl implements Jnsp7xtmStatisticService {
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
statistics
=
statistics
+
","
+
statisticsOneOneDimensionality
;
orderColumn
=
orderColumn
+
","
+
orderOneOneDimensionality
;
}
}
else
{
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
ColTransitionEnum
.
JNSP7XTM
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
statisticsOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
ColTransitionEnum
.
CUSTOMER
.
getValue
());
orderOneOneDimensionality
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
statistics
=
statisticsOneOneDimensionality
;
orderColumn
=
orderOneOneDimensionality
;
}
}
if
(!
joinSqlList
.
isEmpty
())
{
joinSql
=
joinSqlList
.
stream
().
distinct
().
collect
(
Collectors
.
joining
(
" "
));
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getKhdm
()))
{
jnsp74tmPageRequestDto
.
setVagueKhdm
(
""
);
...
...
@@ -151,12 +191,11 @@ public class Jnsp7xtmStatisticServiceImpl implements Jnsp7xtmStatisticService {
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getKhm
()))
{
jnsp74tmPageRequestDto
.
setVaguekhm
(
""
);
}
List
<
Map
<
String
,
Object
>>
maps
=
jnsp74tmStatisticsRepository
.
queryStatisticsCount
(
jnsp74tmPageRequestDto
,
months
,
statistics
,
orderColumn
);
List
<
Map
<
String
,
Object
>>
maps
=
jnsp74tmStatisticsRepository
.
queryStatisticsCount
(
jnsp74tmPageRequestDto
,
months
,
statistics
,
orderColumn
,
joinSql
);
jnsp74tmPageListDto
.
setTotal
(
maps
.
size
());
// 获取list
List
<
Jnsp7xtmPageDto
>
list
=
getList
(
jnsp74tmPageRequestDto
,
months
,
monthsList
,
statistics
,
orderColumn
);
List
<
Jnsp7xtmPageDto
>
list
=
getList
(
jnsp74tmPageRequestDto
,
months
,
monthsList
,
statistics
,
orderColumn
,
joinSql
);
jnsp74tmPageListDto
.
setUserDtoList
(
list
);
return
jnsp74tmPageListDto
;
}
...
...
@@ -183,6 +222,30 @@ public class Jnsp7xtmStatisticServiceImpl implements Jnsp7xtmStatisticService {
// 设置空Jnsp74tm
Jnsp7xtmDto
jnsp74TmDto
=
getEmptyJnsp74xmDto
(
jnsp74tmPageRequestDto
);
// 根据条件查询数据每个年份对应的合计值
// 获取关联表语句
List
<
String
>
joinSqlList
=
new
ArrayList
<>();
String
joinSql
=
""
;
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getOneDimensionality
()))
{
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getTwoDimensionalityValue
()))
{
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionalityValue
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
}
if
(
StringUtils
.
isNotBlank
(
jnsp74tmPageRequestDto
.
getThreeDimensionalityValue
()))
{
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionalityValue
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
joinSqlList
.
add
(
"left join b_customer cust on cust.cust_code = j7xtm.khdm and cust.del_flag = '0'"
);
}
}
if
(!
joinSqlList
.
isEmpty
())
{
joinSql
=
joinSqlList
.
stream
().
distinct
().
collect
(
Collectors
.
joining
(
" "
));
}
jnsp74tmPageRequestDto
.
setJoinSql
(
joinSql
);
List
<
Jnsp7xtmDto
>
jnsp74TmDtoList
=
jnsp74tmStatisticsRepository
.
queryTotal
(
jnsp74tmPageRequestDto
);
if
(!
jnsp74TmDtoList
.
isEmpty
())
{
// 过滤出没有对应合计值年份
...
...
@@ -205,7 +268,7 @@ public class Jnsp7xtmStatisticServiceImpl implements Jnsp7xtmStatisticService {
// 获取统计的list
private
List
<
Jnsp7xtmPageDto
>
getList
(
Jnsp7xtmPageRequestDto
jnsp74tmPageRequestDto
,
String
months
,
List
<
String
>
monthsList
,
String
statistics
,
String
orderColumn
)
{
private
List
<
Jnsp7xtmPageDto
>
getList
(
Jnsp7xtmPageRequestDto
jnsp74tmPageRequestDto
,
String
months
,
List
<
String
>
monthsList
,
String
statistics
,
String
orderColumn
,
String
joinSql
)
{
// 初始化 listrmb 和 listxsjg 的值
List
<
Map
<
String
,
Object
>>
listrmb
=
null
;
List
<
Map
<
String
,
Object
>>
listxsjg
=
null
;
...
...
@@ -220,22 +283,22 @@ public class Jnsp7xtmStatisticServiceImpl implements Jnsp7xtmStatisticService {
Integer
pageSize
=
jnsp74tmPageRequestDto
.
getPageSize
();
boolean
[]
flag
=
new
boolean
[]{
jnsp74tmPageRequestDto
.
isXsjg
(),
jnsp74tmPageRequestDto
.
isRmb
(),
jnsp74tmPageRequestDto
.
isChzs
(),
jnsp74tmPageRequestDto
.
isChzsa
(),
jnsp74tmPageRequestDto
.
isChzsb
(),
jnsp74tmPageRequestDto
.
isZzc
(),
jnsp74tmPageRequestDto
.
isZzcg
()};
if
(
jnsp74tmPageRequestDto
.
isXsjg
())
listxsjg
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.xsjg"
,
statistics
,
orderColumn
);
listxsjg
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.xsjg"
,
statistics
,
orderColumn
,
joinSql
);
if
(
jnsp74tmPageRequestDto
.
isRmb
())
listrmb
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.rmb"
,
statistics
,
orderColumn
);
listrmb
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.rmb"
,
statistics
,
orderColumn
,
joinSql
);
if
(
jnsp74tmPageRequestDto
.
isChzs
())
listChzs
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.chzsa+j7xtm.chzsb"
,
statistics
,
orderColumn
);
listChzs
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.chzsa+j7xtm.chzsb"
,
statistics
,
orderColumn
,
joinSql
);
if
(
jnsp74tmPageRequestDto
.
isChzsa
())
listChzsA
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.chzsa"
,
statistics
,
orderColumn
);
listChzsA
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.chzsa"
,
statistics
,
orderColumn
,
joinSql
);
if
(
jnsp74tmPageRequestDto
.
isChzsb
())
listChzsB
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.chzsb"
,
statistics
,
orderColumn
);
listChzsB
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.chzsb"
,
statistics
,
orderColumn
,
joinSql
);
if
(
jnsp74tmPageRequestDto
.
isZzc
())
listzzc
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.zzc"
,
statistics
,
orderColumn
);
listzzc
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.zzc"
,
statistics
,
orderColumn
,
joinSql
);
if
(
jnsp74tmPageRequestDto
.
isZzcg
())
listzzcg
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.zzcg"
,
statistics
,
orderColumn
);
listzzcg
=
jnsp74tmStatisticsRepository
.
queryList
(
jnsp74tmPageRequestDto
,
months
,
pageNo
,
pageSize
,
"1"
,
"j7xtm.zzcg"
,
statistics
,
orderColumn
,
joinSql
);
//获取对应关系
Map
<
String
,
Jnsp7xtmPageDto
>
map
=
new
HashMap
();
//创建填充数据
...
...
@@ -325,6 +388,10 @@ public class Jnsp7xtmStatisticServiceImpl implements Jnsp7xtmStatisticService {
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalOneDime
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getOneDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
())){
originalOneDime
=
jnsp74tmPageRequestDto
.
getOneDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
if
(
listMap
.
containsKey
(
originalOneDime
))
{
key
=
key
+
listMap
.
get
(
originalOneDime
)
+
"::"
;
dimensionalityOne
=
(
String
)
listMap
.
get
(
originalOneDime
);
...
...
@@ -337,6 +404,9 @@ public class Jnsp7xtmStatisticServiceImpl implements Jnsp7xtmStatisticService {
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalTwoDime
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalTwoDime
=
jnsp74tmPageRequestDto
.
getTwoDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
if
(
listMap
.
containsKey
(
originalTwoDime
))
{
key
=
key
+
listMap
.
get
(
originalTwoDime
)
+
"::"
;
dimensionalityTwo
=
(
String
)
listMap
.
get
(
originalTwoDime
);
...
...
@@ -349,6 +419,10 @@ public class Jnsp7xtmStatisticServiceImpl implements Jnsp7xtmStatisticService {
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
()))
{
originalthreeDime
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
JNSP7XTM
.
getCode
(),
""
);
}
if
(
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
contains
(
ColTransitionEnum
.
CUSTOMER
.
getCode
()))
{
originalthreeDime
=
jnsp74tmPageRequestDto
.
getThreeDimensionality
().
replace
(
ColTransitionEnum
.
CUSTOMER
.
getCode
(),
""
);
}
if
(
listMap
.
containsKey
(
originalthreeDime
))
{
key
=
key
+
listMap
.
get
(
originalthreeDime
)
+
"::"
;
dimensionalityThree
=
(
String
)
listMap
.
get
(
originalthreeDime
);
...
...
src/main/resources/mapper/bus/jnsp7xtm/mapper/Jnsp7xtmRepository.xml
View file @
96e4c5e9
...
...
@@ -29,8 +29,12 @@
<result
column=
"L24"
property=
"ltw"
/>
</resultMap>
<select
id=
"queryJnsp74tmByPaged"
resultMap=
"BaseResultMap"
>
SELECT J7xtm.*
SELECT
J7xtm.*
FROM Jnsp7xtm J7xtm
<if
test=
"entity.joinSql != null and entity.joinSql != ''"
>
${entity.joinSql}
</if>
WHERE
1=1
<if
test=
'entity.clickOneDimensionality and entity.type == "1"'
>
...
...
@@ -115,6 +119,9 @@
count(*)
FROM
Jnsp7xtm J7xtm
<if
test=
"entity.joinSql != null and entity.joinSql != ''"
>
${entity.joinSql}
</if>
WHERE
1=1
<if
test=
'entity.clickOneDimensionality and entity.type == "1"'
>
...
...
@@ -196,6 +203,9 @@
<select
id=
"queryFindAllList"
resultType=
"org.rcisoft.bus.jnsp7xtm.entity.Jnsp7xtm"
>
SELECT J7xtm.*
FROM Jnsp7xtm J7xtm
<if
test=
"entity.joinSql != null and entity.joinSql != ''"
>
${entity.joinSql}
</if>
WHERE
1=1
<if
test=
'entity.clickOneDimensionality and entity.type == "1"'
>
...
...
src/main/resources/mapper/bus/jnsp7xtm/mapper/Jnsp7xtmStatisticsRepository.xml
View file @
96e4c5e9
...
...
@@ -99,6 +99,9 @@
j7xtm.nqy,
count(*) AS total
FROM Jnsp7xtm j7xtm
<if
test=
"joinSql != null and joinSql != ''"
>
${joinSql}
</if>
WHERE 1=1
<if
test=
"entity.nqy != null and entity.nqy!= ''"
>
and j7xtm.nqy in
...
...
@@ -186,6 +189,9 @@
j7xtm.nqy ,
SUM(${computedColumn}) AS total
FROM Jnsp7xtm j7xtm
<if
test=
"joinSql != null and joinSql !=''"
>
${joinSql}
</if>
WHERE 1=1
<if
test=
"entity.nqy != null and entity.nqy!= ''"
>
and j7xtm.nqy in
...
...
@@ -193,10 +199,10 @@
#{item}
</foreach>
</if>
<if
test=
"entity.vagueKhdm != null and entity.vagueKhdm !=
null
"
>
<if
test=
"entity.vagueKhdm != null and entity.vagueKhdm !=
''
"
>
and j7xtm.khdm like concat('%',#{entity.vagueKhdm },'%')
</if>
<if
test=
"entity.vaguekhm != null and entity.vaguekhm !=
null
"
>
<if
test=
"entity.vaguekhm != null and entity.vaguekhm !=
''
"
>
and j7xtm.khm like concat('%',#{entity.vaguekhm },'%')
</if>
<if
test=
"entity.jlpm != null and entity.jlpm != '' "
>
...
...
@@ -298,6 +304,9 @@
</if>
FROM
Jnsp7xtm J7xtm
<if
test=
"entity.joinSql != null and entity.joinSql != ''"
>
${entity.joinSql}
</if>
WHERE
1 = 1
<if
test=
"entity.nqy != null and entity.nqy!= ''"
>
...
...
@@ -306,10 +315,10 @@
#{item}
</foreach>
</if>
<if
test=
"entity.vagueKhdm != null and entity.vagueKhdm !=
null
"
>
<if
test=
"entity.vagueKhdm != null and entity.vagueKhdm !=
''
"
>
and J7xtm.khdm like concat('%',#{entity.vagueKhdm },'%')
</if>
<if
test=
"entity.vaguekhm != null and entity.vaguekhm !=
null
"
>
<if
test=
"entity.vaguekhm != null and entity.vaguekhm !=
''
"
>
and J7xtm.khm like concat('%',#{entity.vaguekhm },'%')
</if>
<if
test=
"entity.jlpm != null and entity.jlpm != '' "
>
...
...
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