Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
cda527c8
Commit
cda527c8
authored
Nov 02, 2023
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
三个规定排查统计
parent
eae01586
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
43 deletions
+85
-43
IThreeSystemsService.java
...mos/boot/module/tcm/api/service/IThreeSystemsService.java
+0
-5
ThreeSystemsController.java
...oot/module/tcm/biz/controller/ThreeSystemsController.java
+23
-26
ThreeSystemsServiceImpl.java
.../module/tcm/biz/service/impl/ThreeSystemsServiceImpl.java
+62
-12
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/service/IThreeSystemsService.java
View file @
cda527c8
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.ThreeSystems
;
import
java.util.LinkedHashMap
;
...
...
@@ -16,8 +14,5 @@ import java.util.List;
*/
public
interface
IThreeSystemsService
{
Page
<
ThreeSystemsDto
>
getThreeProvisionsList
(
String
orgCode
,
ThreeSystemsDto
threeSystemsDto
,
Page
<
ThreeSystemsDto
>
page
);
List
<
ThreeSystems
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
,
String
planType
,
String
startDate
,
String
endDate
);
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/ThreeSystemsController.java
View file @
cda527c8
...
...
@@ -25,31 +25,28 @@ import java.util.List;
@RestController
@Api
(
tags
=
"三个规定统计"
)
@RequestMapping
(
value
=
"/threeProvisions"
)
public
class
ThreeSystemsController
extends
BaseController
{
private
static
final
String
REGULATOR_UNIT_TREE
=
"REGULATOR_UNIT_TREE"
;
@Autowired
private
IThreeSystemsService
iThreeSystemsService
;
@Autowired
private
TzsUserInfoServiceImpl
tzsUserInfoServiceImpl
;
@Autowired
RedisUtils
redisUtils
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getStatisticsMessage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"监管单位三个规定统计信息"
,
notes
=
"监管单位三个规定统计信息"
)
public
ResponseModel
<
Object
>
getStatisticsMessage
(
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
,
@RequestParam
(
"planType"
)
String
planType
,
@RequestParam
(
"startDate"
)
String
startDate
,
@RequestParam
(
"endDate"
)
String
endDate
)
{
List
<
LinkedHashMap
>
data
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
REGULATOR_UNIT_TREE
);
ArrayList
<
LinkedHashMap
>
result
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
list
=
tzsUserInfoServiceImpl
.
screenData
(
result
,
data
,
sequenceNbr
);
Page
<
ThreeSystems
>
threeSystemsPage
=
new
Page
<>();
threeSystemsPage
.
setRecords
(
iThreeSystemsService
.
getStatisticsMessage
(
list
,
planType
,
startDate
,
endDate
));
return
ResponseHelper
.
buildResponse
(
threeSystemsPage
);
}
public
class
ThreeSystemsController
<
string
>
extends
BaseController
{
private
static
final
String
REGULATOR_UNIT_TREE
=
"REGULATOR_UNIT_TREE"
;
@Autowired
RedisUtils
redisUtils
;
@Autowired
private
IThreeSystemsService
iThreeSystemsService
;
@Autowired
private
TzsUserInfoServiceImpl
tzsUserInfoServiceImpl
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getStatisticsMessage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"监管单位三个规定统计信息"
,
notes
=
"监管单位三个规定统计信息"
)
public
ResponseModel
<
Object
>
getStatisticsMessage
(
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
,
@RequestParam
(
value
=
"planType"
,
defaultValue
=
"1"
)
String
planType
,
@RequestParam
(
value
=
"startDate"
,
required
=
false
)
String
startDate
,
@RequestParam
(
value
=
"endDate"
,
required
=
false
)
String
endDate
)
{
List
<
LinkedHashMap
>
data
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
REGULATOR_UNIT_TREE
);
ArrayList
<
LinkedHashMap
>
result
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
list
=
tzsUserInfoServiceImpl
.
screenData
(
result
,
data
,
sequenceNbr
);
Page
<
ThreeSystems
>
threeSystemsPage
=
new
Page
<>();
threeSystemsPage
.
setRecords
(
iThreeSystemsService
.
getStatisticsMessage
(
list
,
planType
,
startDate
,
endDate
));
return
ResponseHelper
.
buildResponse
(
threeSystemsPage
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/ThreeSystemsServiceImpl.java
View file @
cda527c8
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.ThreeSystems
;
import
com.yeejoin.amos.boot.module.tcm.api.enums.SupervisoryEnum
;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.ThreeSystemsMapper
;
import
com.yeejoin.amos.boot.module.tcm.api.service.IThreeSystemsService
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.apache.commons.compress.utils.Lists
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
import
java.util.Date
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
/**
...
...
@@ -17,17 +27,56 @@ import java.util.List;
*/
@Service
public
class
ThreeSystemsServiceImpl
extends
BaseService
<
ThreeSystemsDto
,
ThreeSystems
,
ThreeSystemsMapper
>
implements
IThreeSystemsService
{
/**
* 分页查询
*/
public
Page
<
ThreeSystemsDto
>
queryForThreeSystemsPage
(
Page
<
ThreeSystemsDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询
示例
* 列表查询
*/
public
List
<
ThreeSystemsDto
>
queryForThreeSystemsList
()
{
return
this
.
queryForList
(
""
,
false
);
@Override
public
List
<
ThreeSystems
>
getStatisticsMessage
(
List
<
LinkedHashMap
>
list
,
String
planType
,
String
startDate
,
String
endDate
)
{
String
orgCode
=
null
;
String
nextLevel
=
null
;
SupervisoryEnum
enumByLevel
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
list
)
&&
!
ObjectUtils
.
isEmpty
(
list
.
get
(
0
)))
{
orgCode
=
String
.
valueOf
(
list
.
get
(
0
).
get
(
"orgCode"
));
enumByLevel
=
SupervisoryEnum
.
getEnumByLevel
(
String
.
valueOf
(
list
.
get
(
0
).
get
(
"level"
)));
nextLevel
=
!
ObjectUtils
.
isEmpty
(
enumByLevel
)
?
enumByLevel
.
getNextLevel
()
:
null
;
}
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"0.##"
);
if
(!
ObjectUtils
.
isEmpty
(
orgCode
))
{
if
(
"50*56"
.
equals
(
orgCode
))
{
nextLevel
=
"organization"
;
}
LambdaQueryWrapper
<
ThreeSystems
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
like
(
ThreeSystems:
:
getSupervisoryUnitOrgcode
,
orgCode
);
queryWrapper
.
eq
(
ThreeSystems:
:
getIsDelete
,
false
);
queryWrapper
.
eq
(
ThreeSystems:
:
getPlanType
,
planType
);
queryWrapper
.
between
(
ThreeSystems:
:
getCheckDate
,
ValidationUtil
.
isEmpty
(
startDate
)
?
new
Date
()
:
startDate
+
" 00:00:00"
,
ValidationUtil
.
isEmpty
(
endDate
)
?
new
Date
()
:
endDate
+
" 23:59:59"
);
queryWrapper
.
eq
(
ThreeSystems:
:
getSupervisoryUnitLevel
,
nextLevel
);
List
<
ThreeSystems
>
listByOrgCode
=
this
.
getBaseMapper
().
selectList
(
queryWrapper
);
ThreeSystems
summary
=
new
ThreeSystems
();
summary
.
setSupervisoryUnitName
(
"汇总"
);
if
(!
ValidationUtil
.
isEmpty
(
listByOrgCode
))
{
listByOrgCode
.
forEach
(
i
->
{
summary
.
setCheckNum
(
ValidationUtil
.
isEmpty
(
summary
.
getCheckNum
())
?
i
.
getCheckNum
()
:
summary
.
getCheckNum
()
+
i
.
getCheckNum
());
summary
.
setFinishCheckNum
(
ValidationUtil
.
isEmpty
(
summary
.
getFinishCheckNum
())
?
i
.
getFinishCheckNum
()
:
summary
.
getFinishCheckNum
()
+
i
.
getFinishCheckNum
());
summary
.
setRegisteredNum
(
ValidationUtil
.
isEmpty
(
summary
.
getRegisteredNum
())
?
i
.
getRegisteredNum
()
:
summary
.
getRegisteredNum
()
+
i
.
getRegisteredNum
());
});
if
(
ValidationUtil
.
isEmpty
(
summary
.
getCheckNum
())
||
ValidationUtil
.
isEmpty
(
summary
.
getRegisteredNum
()))
{
summary
.
setProportion
(
"0%"
);
}
else
{
BigDecimal
result
=
new
BigDecimal
(
summary
.
getFinishCheckNum
()).
divide
(
new
BigDecimal
(
summary
.
getCheckNum
())
,
4
,
RoundingMode
.
HALF_UP
);
summary
.
setProportion
(
decimalFormat
.
format
(
result
.
multiply
(
new
BigDecimal
(
100
)))
+
"%"
);
}
listByOrgCode
.
add
(
summary
);
return
listByOrgCode
;
}
}
return
Lists
.
newArrayList
();
}
}
\ No newline at end of file
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