Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RuoYi-Vue-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
融通安全管理系统
RuoYi-Vue-master
Commits
8a390378
Commit
8a390378
authored
Jul 24, 2023
by
周昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、开发pc端导出项目风险清单表excel文件接口
parent
09164130
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
398 additions
and
51 deletions
+398
-51
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/controller/RiskPlanAppController.java
...oft/censoftrongtong/controller/RiskPlanAppController.java
+46
-46
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/controller/RiskPlanController.java
...ensoft/censoftrongtong/controller/RiskPlanController.java
+15
-0
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/domain/dto/RiskInherentListExportDto.java
...censoftrongtong/domain/dto/RiskInherentListExportDto.java
+123
-0
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/mapper/RiskPlanInherentListMapper.java
...ft/censoftrongtong/mapper/RiskPlanInherentListMapper.java
+3
-4
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/service/IRiskPlanInherentListService.java
...censoftrongtong/service/IRiskPlanInherentListService.java
+7
-0
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/service/impl/RiskPlanInherentListServiceImpl.java
...ongtong/service/impl/RiskPlanInherentListServiceImpl.java
+166
-0
censoft-rongtong/src/main/resources/mapper/system/RiskPlanInherentListMapper.xml
...in/resources/mapper/system/RiskPlanInherentListMapper.xml
+37
-0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
.../main/java/com/ruoyi/framework/config/SecurityConfig.java
+1
-1
No files found.
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/controller/RiskPlanAppController.java
View file @
8a390378
package
com
.
censoft
.
censoftrongtong
.
controller
;
import
cn.hutool.core.util.StrUtil
;
import
com.censoft.censoftrongtong.domain.*
;
import
com.censoft.censoftrongtong.domain.dto.*
;
import
com.censoft.censoftrongtong.enums.RiskPlanStatusType
;
...
...
@@ -16,12 +15,13 @@ import com.ruoyi.common.utils.StringUtils;
import
com.ruoyi.system.service.ISysDeptService
;
import
com.ruoyi.system.service.ISysDictDataService
;
import
com.ruoyi.system.service.ISysUploadFileService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
...
...
@@ -161,17 +161,17 @@ public class RiskPlanAppController extends BaseController {
List
<
RiskPlanStatusType
>
statusList
=
new
ArrayList
<>();
String
state
=
""
;
if
(
"wait"
.
equals
(
status
))
{
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
CREATE_TASK
,
RiskPlanStatusType
.
WAIT_START
);
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
CREATE_TASK
,
RiskPlanStatusType
.
WAIT_START
);
state
=
"待执行"
;
}
else
if
(
"running"
.
equals
(
status
))
{
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
RUNNING
,
RiskPlanStatusType
.
WAIT_RETURN
,
RiskPlanStatusType
.
WAIT_LEADER_RETURN
);
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
RUNNING
,
RiskPlanStatusType
.
WAIT_RETURN
,
RiskPlanStatusType
.
WAIT_LEADER_RETURN
);
state
=
"执行中"
;
}
else
if
(
"finish"
.
equals
(
status
))
{
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
WAIT_LEADER_APPROVE
,
RiskPlanStatusType
.
WAIT_APPROVE
,
RiskPlanStatusType
.
PROJECT_REPORT
,
RiskPlanStatusType
.
FINISH
);
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
WAIT_LEADER_APPROVE
,
RiskPlanStatusType
.
WAIT_APPROVE
,
RiskPlanStatusType
.
PROJECT_REPORT
,
RiskPlanStatusType
.
FINISH
);
state
=
"已执行"
;
}
List
<
RiskPlanAppListDto
>
list
=
riskPlanService
.
getRiskPlanAppListDtoList
(
statusList
,
getUserId
(),
null
,
null
);
List
<
RiskPlanAppListDto
>
list
=
riskPlanService
.
getRiskPlanAppListDtoList
(
statusList
,
getUserId
(),
null
,
null
);
String
finalState
=
state
;
list
.
forEach
(
dto
->
{
dto
.
setState
(
finalState
);
...
...
@@ -190,23 +190,23 @@ public class RiskPlanAppController extends BaseController {
List
<
RiskPlanStatusType
>
statusList
=
new
ArrayList
<>();
String
state
=
""
;
if
(
"wait"
.
equals
(
status
))
{
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
CREATE_TASK
,
RiskPlanStatusType
.
WAIT_START
);
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
CREATE_TASK
,
RiskPlanStatusType
.
WAIT_START
);
state
=
"待评估"
;
}
else
if
(
"running"
.
equals
(
status
))
{
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
RUNNING
,
RiskPlanStatusType
.
WAIT_RETURN
,
RiskPlanStatusType
.
WAIT_LEADER_RETURN
);
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
RUNNING
,
RiskPlanStatusType
.
WAIT_RETURN
,
RiskPlanStatusType
.
WAIT_LEADER_RETURN
);
state
=
"执行中"
;
}
else
if
(
"finish"
.
equals
(
status
))
{
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
WAIT_LEADER_APPROVE
,
RiskPlanStatusType
.
WAIT_APPROVE
,
RiskPlanStatusType
.
PROJECT_REPORT
,
RiskPlanStatusType
.
FINISH
);
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
WAIT_LEADER_APPROVE
,
RiskPlanStatusType
.
WAIT_APPROVE
,
RiskPlanStatusType
.
PROJECT_REPORT
,
RiskPlanStatusType
.
FINISH
);
state
=
"已完成"
;
}
List
<
RiskPlanAppListDto
>
list
=
riskPlanService
.
getRiskPlanAppListDtoList
(
statusList
,
null
,
getUserId
(),
null
);
List
<
RiskPlanAppListDto
>
list
=
riskPlanService
.
getRiskPlanAppListDtoList
(
statusList
,
null
,
getUserId
(),
null
);
String
finalState
=
state
;
list
.
forEach
(
dto
->
{
Long
finishNumber
=
riskPlanUserBuildingService
.
countStatusByPlanIdAndStatus
(
dto
.
getId
(),
"finish"
);
Long
totalNumber
=
riskPlanUserBuildingService
.
countStatusByPlanIdAndStatus
(
dto
.
getId
(),
null
);
dto
.
setState
(
finalState
+
"("
+
finishNumber
+
"/"
+
totalNumber
+
")"
);
dto
.
setState
(
finalState
+
"("
+
finishNumber
+
"/"
+
totalNumber
+
")"
);
});
return
R
.
ok
(
list
);
}
...
...
@@ -233,24 +233,24 @@ public class RiskPlanAppController extends BaseController {
List
<
RiskPlanStatusType
>
statusList
=
new
ArrayList
<>();
String
state
=
""
;
if
(
"running"
.
equals
(
status
))
{
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
CREATE_TASK
,
RiskPlanStatusType
.
WAIT_START
,
RiskPlanStatusType
.
RUNNING
);
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
CREATE_TASK
,
RiskPlanStatusType
.
WAIT_START
,
RiskPlanStatusType
.
RUNNING
);
state
=
"待执行"
;
}
else
if
(
"finish"
.
equals
(
status
))
{
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
WAIT_LEADER_APPROVE
,
RiskPlanStatusType
.
WAIT_APPROVE
,
RiskPlanStatusType
.
WAIT_LEADER_RETURN
,
RiskPlanStatusType
.
PROJECT_REPORT
,
RiskPlanStatusType
.
FINISH
);
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
WAIT_LEADER_APPROVE
,
RiskPlanStatusType
.
WAIT_APPROVE
,
RiskPlanStatusType
.
WAIT_LEADER_RETURN
,
RiskPlanStatusType
.
PROJECT_REPORT
,
RiskPlanStatusType
.
FINISH
);
state
=
"已执行"
;
}
else
if
(
"return"
.
equals
(
status
))
{
statusList
=
Arrays
.
asList
(
RiskPlanStatusType
.
WAIT_RETURN
);
state
=
"已退回"
;
}
List
<
RiskPlanAppListDto
>
list
=
riskPlanService
.
getRiskPlanAppListDtoList
(
statusList
,
null
,
null
,
getUserId
());
List
<
RiskPlanAppListDto
>
list
=
riskPlanService
.
getRiskPlanAppListDtoList
(
statusList
,
null
,
null
,
getUserId
());
String
finalState
=
state
;
list
.
forEach
(
dto
->
{
Long
finishNumber
=
riskPlanUserBuildingService
.
countStatusByPlanIdAndStatus
(
dto
.
getId
(),
"finish"
);
Long
totalNumber
=
riskPlanUserBuildingService
.
countStatusByPlanIdAndStatus
(
dto
.
getId
(),
null
);
dto
.
setState
(
finalState
+
"("
+
finishNumber
+
"/"
+
totalNumber
+
")"
);
dto
.
setState
(
finalState
+
"("
+
finishNumber
+
"/"
+
totalNumber
+
")"
);
});
return
R
.
ok
(
list
);
}
...
...
@@ -262,8 +262,8 @@ public class RiskPlanAppController extends BaseController {
* @real_return {@link R<RiskPlanAppDetailsDto>}
*/
@GetMapping
(
"/details/{planId}"
)
public
R
<
RiskPlanAppDetailsDto
>
getRiskPlanAppDetailsDtoByPlanId
(
@PathVariable
(
"planId"
)
Long
planId
,
Long
buildingId
)
{
return
R
.
ok
(
riskPlanService
.
getRiskPlanAppDetailsDtoByPlanId
(
planId
,
buildingId
));
public
R
<
RiskPlanAppDetailsDto
>
getRiskPlanAppDetailsDtoByPlanId
(
@PathVariable
(
"planId"
)
Long
planId
,
Long
buildingId
)
{
return
R
.
ok
(
riskPlanService
.
getRiskPlanAppDetailsDtoByPlanId
(
planId
,
buildingId
));
}
/**
...
...
@@ -317,7 +317,7 @@ public class RiskPlanAppController extends BaseController {
/**
* 根据计划id、楼宇id、楼层id、房间id获取固有风险列表
*
* @param planId
计划id
* @param planId 计划id
* @real_return {@link R<List<RiskPlanAppInherentListDto>>}
*/
@GetMapping
(
"/inherent/list/{planId}"
)
...
...
@@ -342,7 +342,7 @@ public class RiskPlanAppController extends BaseController {
String
userId
=
getUserId
().
toString
();
//风险源照片
if
(
"null"
.
equals
(
saveDto
.
getPictureFileIds
())){
if
(
"null"
.
equals
(
saveDto
.
getPictureFileIds
()))
{
saveDto
.
setPictureFileIds
(
null
);
}
if
(
pictureFile
!=
null
)
{
...
...
@@ -351,13 +351,13 @@ public class RiskPlanAppController extends BaseController {
.
map
(
multipartFile
->
uploadFileService
.
upload
(
multipartFile
,
RuoYiConfig
.
getUploadPath
(),
userId
,
serverAddress
).
toString
())
.
collect
(
Collectors
.
joining
(
","
));
if
(
StringUtils
.
isNotEmpty
(
saveDto
.
getPictureFileIds
()))
{
//编辑信息附件存在拼接
pictureFileIds
=
saveDto
.
getPictureFileIds
()+
","
+
pictureFileIds
;
pictureFileIds
=
saveDto
.
getPictureFileIds
()
+
","
+
pictureFileIds
;
}
saveDto
.
setPictureFileIds
(
pictureFileIds
);
}
//工程技术措施附件
if
(
"null"
.
equals
(
saveDto
.
getMeasuresProjectFileIds
())){
if
(
"null"
.
equals
(
saveDto
.
getMeasuresProjectFileIds
()))
{
saveDto
.
setMeasuresProjectFileIds
(
null
);
}
if
(
measuresProjectFile
!=
null
)
{
...
...
@@ -366,13 +366,13 @@ public class RiskPlanAppController extends BaseController {
.
map
(
multipartFile
->
uploadFileService
.
upload
(
multipartFile
,
RuoYiConfig
.
getUploadPath
(),
userId
,
serverAddress
).
toString
())
.
collect
(
Collectors
.
joining
(
","
));
if
(
StringUtils
.
isNotEmpty
(
saveDto
.
getMeasuresProjectFileIds
()))
{
//编辑信息附件存在拼接
measuresProjectFileIds
=
saveDto
.
getMeasuresProjectFileIds
()+
","
+
measuresProjectFileIds
;
measuresProjectFileIds
=
saveDto
.
getMeasuresProjectFileIds
()
+
","
+
measuresProjectFileIds
;
}
saveDto
.
setMeasuresProjectFileIds
(
measuresProjectFileIds
);
}
//管理措施附件
if
(
"null"
.
equals
(
saveDto
.
getMeasuresAdministrationFileIds
())){
if
(
"null"
.
equals
(
saveDto
.
getMeasuresAdministrationFileIds
()))
{
saveDto
.
setMeasuresAdministrationFileIds
(
null
);
}
if
(
measuresAdministrationFile
!=
null
)
{
...
...
@@ -381,13 +381,13 @@ public class RiskPlanAppController extends BaseController {
.
map
(
multipartFile
->
uploadFileService
.
upload
(
multipartFile
,
RuoYiConfig
.
getUploadPath
(),
userId
,
serverAddress
).
toString
())
.
collect
(
Collectors
.
joining
(
","
));
if
(
StringUtils
.
isNotEmpty
(
saveDto
.
getMeasuresAdministrationFileIds
()))
{
//编辑信息附件存在拼接
measuresAdministrationFileIds
=
saveDto
.
getMeasuresAdministrationFileIds
()+
","
+
measuresAdministrationFileIds
;
measuresAdministrationFileIds
=
saveDto
.
getMeasuresAdministrationFileIds
()
+
","
+
measuresAdministrationFileIds
;
}
saveDto
.
setMeasuresAdministrationFileIds
(
measuresAdministrationFileIds
);
}
//应急处置措施附件
if
(
"null"
.
equals
(
saveDto
.
getMeasuresEmergencyFileIds
())){
if
(
"null"
.
equals
(
saveDto
.
getMeasuresEmergencyFileIds
()))
{
saveDto
.
setMeasuresEmergencyFileIds
(
null
);
}
if
(
measuresEmergencyFile
!=
null
)
{
...
...
@@ -396,7 +396,7 @@ public class RiskPlanAppController extends BaseController {
.
map
(
multipartFile
->
uploadFileService
.
upload
(
multipartFile
,
RuoYiConfig
.
getUploadPath
(),
userId
,
serverAddress
).
toString
())
.
collect
(
Collectors
.
joining
(
","
));
if
(
StringUtils
.
isNotEmpty
(
saveDto
.
getMeasuresEmergencyFileIds
()))
{
//编辑信息附件存在拼接
measuresEmergencyFileIds
=
saveDto
.
getMeasuresEmergencyFileIds
()+
","
+
measuresEmergencyFileIds
;
measuresEmergencyFileIds
=
saveDto
.
getMeasuresEmergencyFileIds
()
+
","
+
measuresEmergencyFileIds
;
}
saveDto
.
setMeasuresEmergencyFileIds
(
measuresEmergencyFileIds
);
}
...
...
@@ -422,7 +422,7 @@ public class RiskPlanAppController extends BaseController {
* @real_return {@link R<Boolean>}
*/
@GetMapping
(
"/inherent/delete/{inherentId}"
)
public
R
<
Boolean
>
deleteRiskPlanAppInherentByInherentId
(
@PathVariable
(
"inherentId"
)
Long
inherentId
)
{
public
R
<
Boolean
>
deleteRiskPlanAppInherentByInherentId
(
@PathVariable
(
"inherentId"
)
Long
inherentId
)
{
return
R
.
ok
(
riskPlanInherentListService
.
removeById
(
inherentId
));
}
...
...
@@ -454,7 +454,7 @@ public class RiskPlanAppController extends BaseController {
String
userId
=
getUserId
().
toString
();
//风险源照片
if
(
"null"
.
equals
(
saveDto
.
getPictureFileIds
())){
if
(
"null"
.
equals
(
saveDto
.
getPictureFileIds
()))
{
saveDto
.
setPictureFileIds
(
null
);
}
if
(
pictureFile
!=
null
)
{
...
...
@@ -463,13 +463,13 @@ public class RiskPlanAppController extends BaseController {
.
map
(
multipartFile
->
uploadFileService
.
upload
(
multipartFile
,
RuoYiConfig
.
getUploadPath
(),
userId
,
serverAddress
).
toString
())
.
collect
(
Collectors
.
joining
(
","
));
if
(
StringUtils
.
isNotEmpty
(
saveDto
.
getPictureFileIds
()))
{
//编辑信息附件存在拼接
pictureFileIds
=
saveDto
.
getPictureFileIds
()+
","
+
pictureFileIds
;
pictureFileIds
=
saveDto
.
getPictureFileIds
()
+
","
+
pictureFileIds
;
}
saveDto
.
setPictureFileIds
(
pictureFileIds
);
}
//工程技术措施附件
if
(
"null"
.
equals
(
saveDto
.
getMeasuresProjectFileIds
())){
if
(
"null"
.
equals
(
saveDto
.
getMeasuresProjectFileIds
()))
{
saveDto
.
setMeasuresProjectFileIds
(
null
);
}
if
(
measuresProjectFile
!=
null
)
{
...
...
@@ -478,13 +478,13 @@ public class RiskPlanAppController extends BaseController {
.
map
(
multipartFile
->
uploadFileService
.
upload
(
multipartFile
,
RuoYiConfig
.
getUploadPath
(),
userId
,
serverAddress
).
toString
())
.
collect
(
Collectors
.
joining
(
","
));
if
(
StringUtils
.
isNotEmpty
(
saveDto
.
getMeasuresProjectFileIds
()))
{
//编辑信息附件存在拼接
measuresProjectFileIds
=
saveDto
.
getMeasuresProjectFileIds
()+
","
+
measuresProjectFileIds
;
measuresProjectFileIds
=
saveDto
.
getMeasuresProjectFileIds
()
+
","
+
measuresProjectFileIds
;
}
saveDto
.
setMeasuresProjectFileIds
(
measuresProjectFileIds
);
}
//管理措施附件
if
(
"null"
.
equals
(
saveDto
.
getMeasuresAdministrationFileIds
())){
if
(
"null"
.
equals
(
saveDto
.
getMeasuresAdministrationFileIds
()))
{
saveDto
.
setMeasuresAdministrationFileIds
(
null
);
}
if
(
measuresAdministrationFile
!=
null
)
{
...
...
@@ -493,13 +493,13 @@ public class RiskPlanAppController extends BaseController {
.
map
(
multipartFile
->
uploadFileService
.
upload
(
multipartFile
,
RuoYiConfig
.
getUploadPath
(),
userId
,
serverAddress
).
toString
())
.
collect
(
Collectors
.
joining
(
","
));
if
(
StringUtils
.
isNotEmpty
(
saveDto
.
getMeasuresAdministrationFileIds
()))
{
//编辑信息附件存在拼接
measuresAdministrationFileIds
=
saveDto
.
getMeasuresAdministrationFileIds
()+
","
+
measuresAdministrationFileIds
;
measuresAdministrationFileIds
=
saveDto
.
getMeasuresAdministrationFileIds
()
+
","
+
measuresAdministrationFileIds
;
}
saveDto
.
setMeasuresAdministrationFileIds
(
measuresAdministrationFileIds
);
}
//应急处置措施附件
if
(
"null"
.
equals
(
saveDto
.
getMeasuresEmergencyFileIds
())){
if
(
"null"
.
equals
(
saveDto
.
getMeasuresEmergencyFileIds
()))
{
saveDto
.
setMeasuresEmergencyFileIds
(
null
);
}
if
(
measuresEmergencyFile
!=
null
)
{
...
...
@@ -508,7 +508,7 @@ public class RiskPlanAppController extends BaseController {
.
map
(
multipartFile
->
uploadFileService
.
upload
(
multipartFile
,
RuoYiConfig
.
getUploadPath
(),
userId
,
serverAddress
).
toString
())
.
collect
(
Collectors
.
joining
(
","
));
if
(
StringUtils
.
isNotEmpty
(
saveDto
.
getMeasuresEmergencyFileIds
()))
{
//编辑信息附件存在拼接
measuresEmergencyFileIds
=
saveDto
.
getMeasuresEmergencyFileIds
()+
","
+
measuresEmergencyFileIds
;
measuresEmergencyFileIds
=
saveDto
.
getMeasuresEmergencyFileIds
()
+
","
+
measuresEmergencyFileIds
;
}
saveDto
.
setMeasuresEmergencyFileIds
(
measuresEmergencyFileIds
);
}
...
...
@@ -535,20 +535,20 @@ public class RiskPlanAppController extends BaseController {
* @real_return {@link R<Boolean>}
*/
@GetMapping
(
"/existing/delete/{existingId}"
)
public
R
<
Boolean
>
deleteRiskPlanAppExistingByExistingId
(
@PathVariable
(
"existingId"
)
Long
existingId
)
{
public
R
<
Boolean
>
deleteRiskPlanAppExistingByExistingId
(
@PathVariable
(
"existingId"
)
Long
existingId
)
{
return
R
.
ok
(
riskPlanExistingListService
.
removeById
(
existingId
));
}
/**
* 风险评估-任务完成
*
* @param planId 任务id
* @param planId
任务id
* @param buildingId 楼宇id
* @real_return {@link R<Integer>}
*/
@PostMapping
(
"/submit/{planId}/{buildingId}"
)
public
R
<
Integer
>
submitByPlanIdAndBuildingId
(
@PathVariable
Long
planId
,
@PathVariable
Long
buildingId
)
{
return
R
.
ok
(
riskPlanUserBuildingService
.
submitByPlanIdAndBuildingId
(
planId
,
buildingId
,
getUserId
()));
return
R
.
ok
(
riskPlanUserBuildingService
.
submitByPlanIdAndBuildingId
(
planId
,
buildingId
,
getUserId
()));
}
...
...
@@ -561,14 +561,14 @@ public class RiskPlanAppController extends BaseController {
@GetMapping
(
"/approve/list"
)
public
R
<
List
<
RiskPlanAppListDto
>>
getRiskPlanAppListDtoListByApproveUser
(
String
status
)
{
String
result
=
null
;
if
(
"completed"
.
equals
(
status
)){
if
(
"completed"
.
equals
(
status
))
{
status
=
"completed"
;
result
=
"1"
;
}
else
if
(
"return"
.
equals
(
status
))
{
}
else
if
(
"return"
.
equals
(
status
))
{
status
=
"completed"
;
result
=
"0"
;
}
return
R
.
ok
(
riskPlanService
.
getRiskPlanAppListDtoListByApproveUser
(
getUserId
(),
status
,
result
));
return
R
.
ok
(
riskPlanService
.
getRiskPlanAppListDtoListByApproveUser
(
getUserId
(),
status
,
result
));
}
...
...
@@ -591,7 +591,7 @@ public class RiskPlanAppController extends BaseController {
*/
@PostMapping
(
"/revoke/{planId}"
)
public
R
<
Integer
>
revokeByPlanId
(
@PathVariable
(
"planId"
)
Long
planId
)
{
return
R
.
ok
(
riskPlanService
.
revokeByPlanId
(
planId
,
getUserId
()));
return
R
.
ok
(
riskPlanService
.
revokeByPlanId
(
planId
,
getUserId
()));
}
...
...
@@ -647,7 +647,7 @@ public class RiskPlanAppController extends BaseController {
public
R
<
List
<
RiskPlanAppListDto
>>
getRiskPlanAppListDtoListByCreateUserDeptId
()
{
Long
deptId
=
getLoginUser
().
getDeptId
();
List
<
RiskPlanAppListDto
>
list
=
riskPlanService
.
getRiskPlanAppListDtoListByCreateUserDeptId
(
deptId
);
list
.
forEach
(
dto
->
{
list
.
forEach
(
dto
->
{
dto
.
setState
(
RiskPlanStatusType
.
getTitleByStatus
(
dto
.
getStatus
()).
getTitle
());
});
return
R
.
ok
(
list
);
...
...
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/controller/RiskPlanController.java
View file @
8a390378
...
...
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse;
import
cn.hutool.core.convert.Convert
;
import
com.censoft.censoftrongtong.domain.RiskPlan
;
import
com.censoft.censoftrongtong.domain.dto.RiskInherentListExportDto
;
import
com.censoft.censoftrongtong.domain.dto.RiskNotificationExportWordDto
;
import
com.censoft.censoftrongtong.service.IRiskPlanInherentListService
;
import
com.censoft.censoftrongtong.service.IRiskPlanService
;
...
...
@@ -128,4 +129,18 @@ public class RiskPlanController extends BaseController
WordUtil
word
=
new
WordUtil
();
word
.
exportWord
(
request
,
response
,
dataMap
,
"风险告知卡"
);
}
/**
* 导出项目风险清单表
*/
@GetMapping
(
"/exportExcel/InherentList/{inherentId}"
)
public
void
export
(
@PathVariable
Long
inherentId
,
HttpServletResponse
response
)
{
try
{
List
<
RiskInherentListExportDto
>
dtos
=
riskPlanInherentListService
.
getPlanInherentListByPlanId
(
inherentId
);
riskPlanInherentListService
.
exportPlanInherentList
(
response
,
dtos
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/domain/dto/RiskInherentListExportDto.java
0 → 100644
View file @
8a390378
package
com
.
censoft
.
censoftrongtong
.
domain
.
dto
;
import
lombok.Data
;
/**
* 固有风险清单库对象 risk_inherent_list
*
* @author ruoyi
* @date 2023-06-26
*/
@Data
public
class
RiskInherentListExportDto
{
/**
* 项目信息-区域公司
*/
private
String
deptName
;
/**
* 项目名称
*/
private
String
projectName
;
/**
* 所属城市
*/
private
String
city
;
/**
* 项目业态
*/
private
String
businessFormat
;
/**
* 项目类型
*/
private
String
type
;
/**
* 项目风险清单-固有风险风险清单
*/
private
String
inherentName
;
/**
* 固有风险风险等级
*/
private
String
inherentLevel
;
/**
* 现有风险风险清单
*/
private
String
existingName
;
/**
* 现有风险风险等级
*/
private
String
existingLevel
;
/**
* 风险点位置
*/
private
String
presenceLocation
;
/**
* 可能导致的事故后果
*/
private
String
listType
;
/**
* 项目整体风险等级-固有风险
*/
private
String
inherentProjectLevel
;
/**
* 现有风险
*/
private
String
existingProjectLevel
;
/**
* 风险管控-应采取的管控措施
*/
private
String
inherentMeasuresAdministration
;
/**
* 已采取的管控措施
*/
private
String
existingMeasuresAdministration
;
/**
* 管控责任单位
*/
private
String
measuresDeptName
;
/**
* 管控责任人
*/
private
String
measuresUserName
;
/**
* 人员联系方式
*/
private
String
measuresUserPhone
;
/**
* 重大危险源管理-重大危险源名称
*/
private
String
hazardSourceName
;
/**
* 是否存在重大危险源
*/
private
String
majorHazardSource
;
/**
* 重大危险源描述
*/
private
String
majorHazardDescription
;
/**
* 判定依据
*/
private
String
referenceBasis
;
}
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/mapper/RiskPlanInherentListMapper.java
View file @
8a390378
...
...
@@ -2,10 +2,7 @@ package com.censoft.censoftrongtong.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.censoft.censoftrongtong.domain.RiskPlanInherentList
;
import
com.censoft.censoftrongtong.domain.dto.RiskNotificationExportWordDto
;
import
com.censoft.censoftrongtong.domain.dto.RiskPlanAppExistingListDto
;
import
com.censoft.censoftrongtong.domain.dto.RiskPlanAppInherentListDetailsDto
;
import
com.censoft.censoftrongtong.domain.dto.RiskPlanAppInherentListDto
;
import
com.censoft.censoftrongtong.domain.dto.*
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -75,4 +72,6 @@ public interface RiskPlanInherentListMapper extends BaseMapper<RiskPlanInherentL
List
<
RiskPlanAppExistingListDto
>
getExistingListByInherentId
(
@Param
(
"inherentId"
)
Long
inherentId
);
RiskNotificationExportWordDto
getRiskNotificationExportWordDto
(
@Param
(
"inherentId"
)
Long
inherentId
);
List
<
RiskInherentListExportDto
>
getPlanInherentListByPlanId
(
@Param
(
"planId"
)
Long
planId
);
}
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/service/IRiskPlanInherentListService.java
View file @
8a390378
...
...
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.censoft.censoftrongtong.domain.RiskPlanInherentList
;
import
com.censoft.censoftrongtong.domain.dto.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.List
;
/**
...
...
@@ -72,4 +75,8 @@ public interface IRiskPlanInherentListService extends IService<RiskPlanInherentL
List
<
RiskPlanAppExistingListDto
>
getExistingListByInherentId
(
Long
inherentId
);
RiskNotificationExportWordDto
getRiskNotificationExportWordDto
(
Long
inherentId
);
void
exportPlanInherentList
(
HttpServletResponse
response
,
List
<
RiskInherentListExportDto
>
dtos
)
throws
IOException
;
List
<
RiskInherentListExportDto
>
getPlanInherentListByPlanId
(
Long
planId
);
}
censoft-rongtong/src/main/java/com/censoft/censoftrongtong/service/impl/RiskPlanInherentListServiceImpl.java
View file @
8a390378
package
com
.
censoft
.
censoftrongtong
.
service
.
impl
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.ExcelWriter
;
import
cn.hutool.poi.excel.cell.CellUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.censoft.censoftrongtong.domain.RiskPlan
;
import
com.censoft.censoftrongtong.domain.RiskPlanInherentList
;
...
...
@@ -14,11 +17,18 @@ import com.censoft.censoftrongtong.service.IRiskPlanInherentListService;
import
com.censoft.censoftrongtong.service.IRiskPlanTaskService
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.system.service.ISysUploadFileService
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -228,6 +238,162 @@ public class RiskPlanInherentListServiceImpl
return
riskPlanInherentListMapper
.
getRiskNotificationExportWordDto
(
inherentId
);
}
@Override
public
void
exportPlanInherentList
(
HttpServletResponse
response
,
List
<
RiskInherentListExportDto
>
dtos
)
throws
IOException
{
ExcelWriter
writer
=
ExcelUtil
.
getWriter
();
//创建HSSFWorkbook对象(excel的文档对象)
Workbook
workbook
=
writer
.
getWorkbook
();
//合并单元格后的标题行,使用默认标题样式
//序号
writer
.
merge
(
0
,
2
,
0
,
0
,
"序号"
,
true
);
//项目信息
writer
.
merge
(
0
,
0
,
1
,
5
,
"项目信息"
,
true
);
writer
.
merge
(
1
,
2
,
1
,
1
,
"区域公司"
,
true
);
writer
.
merge
(
1
,
2
,
2
,
2
,
"项目名称"
,
true
);
writer
.
merge
(
1
,
2
,
3
,
3
,
"所属城市"
,
true
);
writer
.
merge
(
1
,
2
,
4
,
4
,
"项目业态"
,
true
);
writer
.
merge
(
1
,
2
,
5
,
5
,
"项目类型"
,
true
);
//项目风险清单
writer
.
merge
(
0
,
0
,
6
,
11
,
"项目风险清单"
,
true
);
writer
.
merge
(
1
,
1
,
6
,
7
,
"固有风险"
,
true
);
writer
.
merge
(
1
,
1
,
8
,
9
,
"现有风险"
,
true
);
Cell
cell62
=
writer
.
getOrCreateCell
(
6
,
2
);
CellUtil
.
setCellValue
(
cell62
,
"风险清单"
,
writer
.
getHeadCellStyle
());
Cell
cell72
=
writer
.
getOrCreateCell
(
7
,
2
);
CellUtil
.
setCellValue
(
cell72
,
"风险等级"
,
writer
.
getHeadCellStyle
());
Cell
cell82
=
writer
.
getOrCreateCell
(
8
,
2
);
CellUtil
.
setCellValue
(
cell82
,
"风险清单"
,
writer
.
getHeadCellStyle
());
Cell
cell92
=
writer
.
getOrCreateCell
(
9
,
2
);
CellUtil
.
setCellValue
(
cell92
,
"风险等级"
,
writer
.
getHeadCellStyle
());
writer
.
merge
(
1
,
2
,
10
,
10
,
"风险点位置"
,
true
);
writer
.
merge
(
1
,
2
,
11
,
11
,
"可能导致的事故后果"
,
true
);
//项目整体风险等级
writer
.
merge
(
0
,
0
,
12
,
13
,
"项目整体风险等级"
,
true
);
writer
.
merge
(
1
,
2
,
12
,
12
,
"固有风险"
,
true
);
writer
.
merge
(
1
,
2
,
13
,
13
,
"现状风险"
,
true
);
//风险管控
writer
.
merge
(
0
,
0
,
14
,
18
,
"风险管控"
,
true
);
writer
.
merge
(
1
,
2
,
14
,
14
,
"应采取的管控措施"
,
true
);
writer
.
merge
(
1
,
2
,
15
,
15
,
"已采取的管控措施"
,
true
);
writer
.
merge
(
1
,
1
,
16
,
18
,
"分级管控"
,
true
);
Cell
cell162
=
writer
.
getOrCreateCell
(
16
,
2
);
CellUtil
.
setCellValue
(
cell162
,
"管控责任单位"
,
writer
.
getHeadCellStyle
());
Cell
cell172
=
writer
.
getOrCreateCell
(
17
,
2
);
CellUtil
.
setCellValue
(
cell172
,
"管控责任人"
,
writer
.
getHeadCellStyle
());
Cell
cell182
=
writer
.
getOrCreateCell
(
18
,
2
);
CellUtil
.
setCellValue
(
cell182
,
"人员联系方式"
,
writer
.
getHeadCellStyle
());
//重大危险源管理
writer
.
merge
(
0
,
0
,
19
,
21
,
"重大危险源管理"
,
true
);
writer
.
merge
(
1
,
2
,
19
,
19
,
"重大危险源名称"
,
true
);
writer
.
merge
(
1
,
2
,
20
,
20
,
"是否存在重大危险源"
,
true
);
writer
.
merge
(
1
,
2
,
21
,
21
,
"重大危险源描述"
,
true
);
//判定依据
writer
.
merge
(
0
,
2
,
22
,
22
,
"判定依据"
,
true
);
//数据
for
(
int
i
=
0
;
i
<
dtos
.
size
();
i
++)
{
RiskInherentListExportDto
dto
=
dtos
.
get
(
i
);
//项目信息
{
Cell
celli0
=
writer
.
getOrCreateCell
(
0
,
i
+
3
);
CellUtil
.
setCellValue
(
celli0
,
i
+
1
,
writer
.
getCellStyle
());
Cell
celli1
=
writer
.
getOrCreateCell
(
1
,
i
+
3
);
CellUtil
.
setCellValue
(
celli1
,
dto
.
getDeptName
(),
writer
.
getCellStyle
());
Cell
celli2
=
writer
.
getOrCreateCell
(
2
,
i
+
3
);
CellUtil
.
setCellValue
(
celli2
,
dto
.
getProjectName
(),
writer
.
getCellStyle
());
Cell
celli3
=
writer
.
getOrCreateCell
(
3
,
i
+
3
);
CellUtil
.
setCellValue
(
celli3
,
dto
.
getCity
(),
writer
.
getCellStyle
());
Cell
celli4
=
writer
.
getOrCreateCell
(
4
,
i
+
3
);
CellUtil
.
setCellValue
(
celli4
,
dto
.
getBusinessFormat
(),
writer
.
getCellStyle
());
Cell
celli5
=
writer
.
getOrCreateCell
(
5
,
i
+
3
);
CellUtil
.
setCellValue
(
celli5
,
dto
.
getType
(),
writer
.
getCellStyle
());
}
//项目风险清单
{
Cell
celli6
=
writer
.
getOrCreateCell
(
6
,
i
+
3
);
CellUtil
.
setCellValue
(
celli6
,
dto
.
getInherentName
(),
writer
.
getCellStyle
());
Cell
celli7
=
writer
.
getOrCreateCell
(
7
,
i
+
3
);
CellUtil
.
setCellValue
(
celli7
,
dto
.
getInherentLevel
(),
writer
.
getCellStyle
());
Cell
celli8
=
writer
.
getOrCreateCell
(
8
,
i
+
3
);
CellUtil
.
setCellValue
(
celli8
,
dto
.
getExistingName
(),
writer
.
getCellStyle
());
Cell
celli9
=
writer
.
getOrCreateCell
(
9
,
i
+
3
);
CellUtil
.
setCellValue
(
celli9
,
dto
.
getExistingLevel
(),
writer
.
getCellStyle
());
Cell
celli10
=
writer
.
getOrCreateCell
(
10
,
i
+
3
);
CellUtil
.
setCellValue
(
celli10
,
dto
.
getPresenceLocation
(),
writer
.
getCellStyle
());
Cell
celli11
=
writer
.
getOrCreateCell
(
11
,
i
+
3
);
CellUtil
.
setCellValue
(
celli11
,
dto
.
getListType
(),
writer
.
getCellStyle
());
}
//项目整体风险等级
{
Cell
celli12
=
writer
.
getOrCreateCell
(
12
,
i
+
3
);
CellUtil
.
setCellValue
(
celli12
,
dto
.
getInherentProjectLevel
(),
writer
.
getCellStyle
());
Cell
celli13
=
writer
.
getOrCreateCell
(
13
,
i
+
3
);
CellUtil
.
setCellValue
(
celli13
,
dto
.
getExistingProjectLevel
(),
writer
.
getCellStyle
());
}
//风险管控
{
Cell
celli14
=
writer
.
getOrCreateCell
(
14
,
i
+
3
);
CellUtil
.
setCellValue
(
celli14
,
dto
.
getInherentMeasuresAdministration
(),
writer
.
getCellStyle
());
Cell
celli15
=
writer
.
getOrCreateCell
(
15
,
i
+
3
);
CellUtil
.
setCellValue
(
celli15
,
dto
.
getExistingMeasuresAdministration
(),
writer
.
getCellStyle
());
Cell
celli16
=
writer
.
getOrCreateCell
(
16
,
i
+
3
);
CellUtil
.
setCellValue
(
celli16
,
dto
.
getMeasuresDeptName
(),
writer
.
getCellStyle
());
Cell
celli17
=
writer
.
getOrCreateCell
(
17
,
i
+
3
);
CellUtil
.
setCellValue
(
celli17
,
dto
.
getMeasuresUserName
(),
writer
.
getCellStyle
());
Cell
celli18
=
writer
.
getOrCreateCell
(
18
,
i
+
3
);
CellUtil
.
setCellValue
(
celli18
,
dto
.
getMeasuresUserPhone
(),
writer
.
getCellStyle
());
}
//重大危险源管理
{
Cell
celli19
=
writer
.
getOrCreateCell
(
19
,
i
+
3
);
CellUtil
.
setCellValue
(
celli19
,
dto
.
getHazardSourceName
(),
writer
.
getCellStyle
());
Cell
celli20
=
writer
.
getOrCreateCell
(
20
,
i
+
3
);
CellUtil
.
setCellValue
(
celli20
,
dto
.
getMajorHazardSource
(),
writer
.
getCellStyle
());
Cell
celli21
=
writer
.
getOrCreateCell
(
21
,
i
+
3
);
CellUtil
.
setCellValue
(
celli21
,
dto
.
getMajorHazardDescription
(),
writer
.
getCellStyle
());
Cell
celli22
=
writer
.
getOrCreateCell
(
22
,
i
+
3
);
CellUtil
.
setCellValue
(
celli22
,
dto
.
getReferenceBasis
(),
writer
.
getCellStyle
());
}
}
String
filename
=
URLEncoder
.
encode
(
"项目风险清单表.xls"
,
"UTF-8"
);
//输出Excel文件
OutputStream
output
=
response
.
getOutputStream
();
response
.
reset
();
response
.
setHeader
(
"Content-disposition"
,
"attachment; filename="
+
filename
+
""
);
response
.
setContentType
(
"application/msexcel"
);
workbook
.
write
(
output
);
output
.
close
();
}
@Override
public
List
<
RiskInherentListExportDto
>
getPlanInherentListByPlanId
(
Long
planId
)
{
return
riskPlanInherentListMapper
.
getPlanInherentListByPlanId
(
planId
);
}
/**
* 查询固有风险清单库
...
...
censoft-rongtong/src/main/resources/mapper/system/RiskPlanInherentListMapper.xml
View file @
8a390378
...
...
@@ -389,4 +389,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
rpil.id = #{inherentId}
</select>
<select
id=
"getPlanInherentListByPlanId"
resultType=
"com.censoft.censoftrongtong.domain.dto.RiskInherentListExportDto"
>
SELECT
sd.dept_name AS deptName,
lp.`name` AS projectName,
lp.city AS city,
lp.type AS type,
rpil.`name` AS inherentName,
rpil.`level` AS inherentLevel,
rpel.`name` AS existingName,
rpel.`level` AS existingLevel,
rpil.`level` AS inherentProjectLevel,
rpel.`level` AS existingProjectLevel,
rpil.presence_location AS presenceLocation,
rpil.type AS listType,
rpil.measures_administration AS inherentMeasuresAdministration,
rpel.measures_administration AS existingMeasuresAdministration,
rpil.measures_dept_name AS measuresDeptName,
rpil.measures_user_name AS measuresUserName,
rpil.measures_user_phone AS measuresUserPhone,
rpil.hazard_source_name AS hazardSourceName,
rpil.major_hazard_source AS majorHazardSource,
rpil.major_hazard_source_description AS majorHazardDescription,
rpil.reference_basis AS referenceBasis
FROM
risk_plan rp
LEFT JOIN ledger_project lp ON lp.id = rp.project_id
LEFT JOIN sys_dept sd ON sd.dept_id = lp.dept_id
LEFT JOIN ledger_building lb ON FIND_IN_SET( lb.id, rp.building_ids )
LEFT JOIN ledger_floor lf ON lf.building_id = lb.id
LEFT JOIN ledger_room lr ON lr.floor_id = lf.id
LEFT JOIN risk_plan_inherent_list rpil ON rpil.room_id = lr.id
LEFT JOIN risk_plan_existing_list rpel ON rpel.inherent_id = rpil.id
WHERE
rp.id = #{planId}
AND rpil.id IS NOT NULL
</select>
</mapper>
\ No newline at end of file
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
View file @
8a390378
...
...
@@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.
authorizeRequests
()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.
antMatchers
(
"/login"
,
"/app-api/login"
,
"/register"
,
"/captchaImage"
).
permitAll
()
.
antMatchers
(
"/login"
,
"/app-api/login"
,
"/app-api/risk/plan/test"
,
"/register"
,
"/captchaImage"
).
permitAll
()
// 静态资源,可匿名访问
.
antMatchers
(
HttpMethod
.
GET
,
"/"
,
"/*.html"
,
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
,
"/profile/**"
).
permitAll
()
.
antMatchers
(
"/swagger-ui.html"
,
"/swagger-resources/**"
,
"/webjars/**"
,
"/*/api-docs"
,
"/druid/**"
).
permitAll
()
...
...
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