Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
c13c7a25
Commit
c13c7a25
authored
Jan 18, 2021
by
田涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数字预案查询已绑定的对象ID
parent
06e6034f
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
190 additions
and
10 deletions
+190
-10
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+17
-0
PlanClassifyTreeMapper.java
.../amos/fas/business/dao/mapper/PlanClassifyTreeMapper.java
+3
-0
PlanDetailMapper.java
...eejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
+20
-1
PlanDocMapper.java
...m/yeejoin/amos/fas/business/dao/mapper/PlanDocMapper.java
+17
-0
PlanEquipmentMapper.java
...oin/amos/fas/business/dao/mapper/PlanEquipmentMapper.java
+12
-0
PlanRuleMapper.java
.../yeejoin/amos/fas/business/dao/mapper/PlanRuleMapper.java
+13
-0
IPlanDocDao.java
...yeejoin/amos/fas/business/dao/repository/IPlanDocDao.java
+2
-0
IPlanEquipmentDao.java
...n/amos/fas/business/dao/repository/IPlanEquipmentDao.java
+2
-0
IPlanRuleDao.java
...eejoin/amos/fas/business/dao/repository/IPlanRuleDao.java
+3
-0
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+57
-9
ContingencyPlanService.java
...os/fas/business/service/intfc/ContingencyPlanService.java
+23
-0
PlanDocMapper.xml
...toSysStart/src/main/resources/db/mapper/PlanDocMapper.xml
+7
-0
PlanEquipmentMapper.xml
...tart/src/main/resources/db/mapper/PlanEquipmentMapper.xml
+7
-0
PlanRuleMapper.xml
...oSysStart/src/main/resources/db/mapper/PlanRuleMapper.xml
+7
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
c13c7a25
...
...
@@ -138,4 +138,21 @@ public class ContingencyPlanController extends BaseController {
}
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
delete
(
idList
));
}
@Permission
@ApiOperation
(
value
=
"获取数字预案绑定的资源Id"
,
notes
=
"查看数字预案详情"
)
@GetMapping
(
value
=
"/bind-source/{type}"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getPlanBindSource
(
@PathVariable
(
value
=
"type"
)
String
type
)
{
switch
(
type
)
{
case
"doc"
:
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
getPlanUsedDocs
());
case
"rule"
:
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
getPlanUsedRules
());
case
"equipment"
:
return
CommonResponseUtil
.
success
(
contingencyPlanService
.
getPlanUsedEquipments
());
default
:
throw
new
YeeException
(
"无效的类型参数"
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanClassifyTreeMapper.java
View file @
c13c7a25
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
PlanClassifyTreeMapper
extends
BaseMapper
{
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
View file @
c13c7a25
...
...
@@ -16,13 +16,32 @@ import java.util.List;
@Repository
public
interface
PlanDetailMapper
{
/**
* 更新预案状态
* @param idList id
* @param status 状态
* @return
*/
int
updatePlanStatusByIdList
(
@Param
(
"idList"
)
List
<
Long
>
idList
,
@Param
(
"status"
)
Integer
status
);
/**
* 更新删除状态
* @param idList id
* @param isDelete 是否删除
* @return
*/
int
updateIsDeleteByIdList
(
@Param
(
"idList"
)
List
<
Long
>
idList
,
@Param
(
"isDelete"
)
Boolean
isDelete
);
/**
* 筛选预案获得总数
* @return
*/
Integer
filterCount
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
Long
[]
classifyId
,
@Param
(
"planRange"
)
String
[]
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
);
/**
* 筛选预案获得分页记录
* @return
*/
List
<
PlanDetailVo
>
filterList
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
Long
[]
classifyId
,
@Param
(
"planRange"
)
String
[]
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
,
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanDocMapper.java
View file @
c13c7a25
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Map
;
/**
* <h1><h1>
*
...
...
@@ -10,4 +14,17 @@ import org.springframework.stereotype.Repository;
*/
@Repository
public
interface
PlanDocMapper
{
/**
* 更新删除状态
* @param idList id
* @param isDelete 是否删除
* @return
*/
int
updateIsDeleteByPlanIdList
(
@Param
(
"planIdList"
)
List
<
Long
>
idList
,
@Param
(
"isDelete"
)
Boolean
isDelete
);
/**
* 获取预案已使用的文档id
*/
Map
<
String
,
Long
>
getUsedDocId
();
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanEquipmentMapper.java
View file @
c13c7a25
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* <h1><h1>
*
...
...
@@ -10,4 +13,13 @@ import org.springframework.stereotype.Repository;
*/
@Repository
public
interface
PlanEquipmentMapper
{
/**
* 更新删除状态
* @param idList id
* @param isDelete 是否删除
* @return
*/
int
updateIsDeleteByPlanIdList
(
@Param
(
"planIdList"
)
List
<
Long
>
idList
,
@Param
(
"isDelete"
)
Boolean
isDelete
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanRuleMapper.java
View file @
c13c7a25
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* <h1><h1>
*
...
...
@@ -10,4 +13,14 @@ import org.springframework.stereotype.Repository;
*/
@Repository
public
interface
PlanRuleMapper
{
/**
* 更新删除状态
* @param idList id
* @param isDelete 是否删除
* @return
*/
int
updateIsDeleteByPlanIdList
(
@Param
(
"planIdList"
)
List
<
Long
>
idList
,
@Param
(
"isDelete"
)
Boolean
isDelete
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanDocDao.java
View file @
c13c7a25
...
...
@@ -17,4 +17,6 @@ public interface IPlanDocDao extends BaseDao<PlanDoc, Long> {
void
deleteByPlanId
(
Long
planId
);
List
<
PlanDoc
>
getPlanDocsByPlanId
(
Long
planId
);
List
<
PlanDoc
>
findAllByIsDelete
(
Boolean
isDelete
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanEquipmentDao.java
View file @
c13c7a25
...
...
@@ -17,4 +17,6 @@ public interface IPlanEquipmentDao extends BaseDao<PlanEquipment, Long> {
void
deleteByPlanId
(
long
planId
);
List
<
PlanEquipment
>
getPlanDocsByPlanId
(
Long
planId
);
List
<
PlanEquipment
>
findAllByIsDelete
(
Boolean
isDelete
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanRuleDao.java
View file @
c13c7a25
...
...
@@ -4,6 +4,7 @@ import com.yeejoin.amos.fas.dao.entity.PlanRule;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Map
;
/**
* <h1><h1>
...
...
@@ -17,4 +18,6 @@ public interface IPlanRuleDao extends BaseDao<PlanRule, Long>{
void
deleteByPlanId
(
long
planId
);
List
<
PlanRule
>
getPlanDocsByPlanId
(
Long
planId
);
List
<
PlanRule
>
findAllByIsDelete
(
Boolean
isDelete
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
c13c7a25
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.dao.mapper.
PlanDetailMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.
*
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.service.intfc.ContingencyPlanService
;
import
com.yeejoin.amos.fas.business.util.Bean
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum
;
import
com.yeejoin.amos.fas.dao.entity.*
;
...
...
@@ -15,10 +14,9 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.*
;
/**
* @program: YeeAmosFireAutoSysRoot
...
...
@@ -35,20 +33,26 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
private
final
IPlanRuleDao
planRuleDao
;
private
final
IPlanClassifyTreeDao
classifyTreeDao
;
private
final
PlanDetailMapper
planDetailMapper
;
PlanEquipmentMapper
planEquipmentMapper
;
PlanRuleMapper
planRuleMapper
;
PlanDocMapper
planDocMapper
;
@Autowired
public
ContingencyPlanServiceImpl
(
IPlanDetailDao
planDetailDao
,
IPlanDocDao
planDocDao
,
IPlanEquipmentDao
planEquipmentDao
,
IPlanRuleDao
planRuleDao
,
IPlanClassifyTreeDao
classifyTreeDao
,
PlanDetailMapper
planDetailMapper
)
{
IPlanRuleDao
planRuleDao
,
IPlanClassifyTreeDao
classifyTreeDao
,
PlanDetailMapper
planDetailMapper
,
PlanEquipmentMapper
planEquipmentMapper
,
PlanRuleMapper
planRuleMapper
,
PlanDocMapper
planDocMapper
)
{
this
.
planDetailDao
=
planDetailDao
;
this
.
planDocDao
=
planDocDao
;
this
.
planEquipmentDao
=
planEquipmentDao
;
this
.
planRuleDao
=
planRuleDao
;
this
.
classifyTreeDao
=
classifyTreeDao
;
this
.
planDetailMapper
=
planDetailMapper
;
this
.
planEquipmentMapper
=
planEquipmentMapper
;
this
.
planRuleMapper
=
planRuleMapper
;
this
.
planDocMapper
=
planDocMapper
;
}
@Override
@Transactional
(
rollbackFor
=
{
YeeException
.
class
,
Exception
.
class
})
public
PlanDetailVo
createPlan
(
PlanDetailVo
planDetail
)
{
PlanDoc
planDoc
=
planDetail
.
getPlanDoc
();
PlanRule
planRule
=
planDetail
.
getPlanRule
();
...
...
@@ -72,10 +76,15 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
long
planId
=
planDetailDao
.
save
(
planEntity
).
getId
();
planDetail
.
setId
(
planId
);
planDoc
.
setPlanId
(
planId
);
planDoc
.
setIsDelete
(
false
);
planDocDao
.
save
(
planDoc
);
planRule
.
setPlanId
(
planId
);
planRule
.
setIsDelete
(
false
);
planRuleDao
.
save
(
planRule
);
planEquipment
.
forEach
(
equipment
->
equipment
.
setPlanId
(
planId
));
planEquipment
.
forEach
(
equipment
->
{
equipment
.
setPlanId
(
planId
);
equipment
.
setIsDelete
(
false
);
});
planEquipmentDao
.
saveAll
(
planEquipment
);
return
planDetail
;
}
...
...
@@ -113,14 +122,19 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
planDetailDao
.
saveAndFlush
(
planEntity
);
planDoc
.
setPlanId
(
planId
);
planDoc
.
setIsDelete
(
false
);
planDocDao
.
deleteByPlanId
(
planId
);
planDocDao
.
save
(
planDoc
);
planRule
.
setPlanId
(
planId
);
planDoc
.
setIsDelete
(
false
);
planRuleDao
.
deleteByPlanId
(
planId
);
planRuleDao
.
save
(
planRule
);
planEquipment
.
forEach
(
equipment
->
equipment
.
setPlanId
(
planId
));
planEquipment
.
forEach
(
equipment
->
{
equipment
.
setPlanId
(
planId
);
planDoc
.
setIsDelete
(
false
);
});
planEquipmentDao
.
deleteByPlanId
(
planId
);
planEquipmentDao
.
saveAll
(
planEquipment
);
return
planDetail
;
...
...
@@ -189,6 +203,9 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
@Override
public
Boolean
delete
(
List
<
Long
>
idList
)
{
planDetailMapper
.
updateIsDeleteByIdList
(
idList
,
true
);
planDocMapper
.
updateIsDeleteByPlanIdList
(
idList
,
true
);
planEquipmentMapper
.
updateIsDeleteByPlanIdList
(
idList
,
true
);
planRuleMapper
.
updateIsDeleteByPlanIdList
(
idList
,
true
);
return
true
;
}
...
...
@@ -209,4 +226,34 @@ public class ContingencyPlanServiceImpl implements ContingencyPlanService {
}
return
page
;
}
@Override
public
Map
<
Long
,
Long
>
getPlanUsedDocs
()
{
Map
<
Long
,
Long
>
resMap
=
new
HashMap
<>(
64
);
List
<
PlanDoc
>
usedList
=
planDocDao
.
findAllByIsDelete
(
false
);
if
(!
usedList
.
isEmpty
())
{
usedList
.
forEach
(
planDoc
->
resMap
.
put
(
planDoc
.
getId
(),
planDoc
.
getPlanId
()));
}
return
resMap
;
}
@Override
public
Map
<
Long
,
Long
>
getPlanUsedRules
()
{
Map
<
Long
,
Long
>
resMap
=
new
HashMap
<>(
64
);
List
<
PlanRule
>
usedList
=
planRuleDao
.
findAllByIsDelete
(
false
);
if
(!
usedList
.
isEmpty
())
{
usedList
.
forEach
(
planRule
->
resMap
.
put
(
planRule
.
getId
(),
planRule
.
getPlanId
()));
}
return
resMap
;
}
@Override
public
Map
<
Long
,
Long
>
getPlanUsedEquipments
()
{
Map
<
Long
,
Long
>
resMap
=
new
HashMap
<>(
64
);
List
<
PlanEquipment
>
usedList
=
planEquipmentDao
.
findAllByIsDelete
(
false
);
if
(!
usedList
.
isEmpty
())
{
usedList
.
forEach
(
planEquipment
->
resMap
.
put
(
planEquipment
.
getId
(),
planEquipment
.
getPlanId
()));
}
return
resMap
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/ContingencyPlanService.java
View file @
c13c7a25
...
...
@@ -3,9 +3,12 @@ package com.yeejoin.amos.fas.business.service.intfc;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.dao.entity.PlanDetail
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author wjk
...
...
@@ -19,6 +22,7 @@ public interface ContingencyPlanService {
* @param planDetail
* @return
*/
@Transactional
(
rollbackFor
=
{
YeeException
.
class
,
Exception
.
class
})
PlanDetailVo
createPlan
(
PlanDetailVo
planDetail
);
/**
...
...
@@ -26,6 +30,7 @@ public interface ContingencyPlanService {
* @param planDetail
* @return
*/
@Transactional
(
rollbackFor
=
{
YeeException
.
class
,
Exception
.
class
})
PlanDetailVo
editPlan
(
PlanDetailVo
planDetail
);
/**
...
...
@@ -54,6 +59,7 @@ public interface ContingencyPlanService {
* @param idList
* @return
*/
@Transactional
(
rollbackFor
=
{
YeeException
.
class
,
Exception
.
class
})
Boolean
delete
(
List
<
Long
>
idList
);
/**
...
...
@@ -69,4 +75,21 @@ public interface ContingencyPlanService {
*/
Page
<
PlanDetailVo
>
pageFilter
(
Page
page
,
String
planName
,
Long
[]
classifyId
,
String
[]
planRange
,
String
editOrgName
,
Date
implementationTimeLeft
,
Date
implementationTimeRight
);
/**
* 查询预案使用的文档ID
* @return
*/
Map
<
Long
,
Long
>
getPlanUsedDocs
();
/**
* 查询预案使用的规则ID
* @return
*/
Map
<
Long
,
Long
>
getPlanUsedRules
();
/**
* 查询预案使用的装备ID
* @return
*/
Map
<
Long
,
Long
>
getPlanUsedEquipments
();
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanDocMapper.xml
View file @
c13c7a25
...
...
@@ -2,4 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.PlanDocMapper"
>
<update
id=
"updateIsDeleteByPlanIdList"
parameterType=
"list"
>
UPDATE c_plan_doc SET is_delete = #{isDelete} WHERE plan_id IN
<foreach
collection=
"planIdList"
separator=
","
item=
"planId"
open=
"("
close=
")"
>
#{planId}
</foreach>
</update>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanEquipmentMapper.xml
View file @
c13c7a25
...
...
@@ -2,4 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.PlanEquipmentMapper"
>
<update
id=
"updateIsDeleteByPlanIdList"
parameterType=
"list"
>
UPDATE c_plan_equipment SET is_delete = #{isDelete} WHERE plan_id IN
<foreach
collection=
"planIdList"
separator=
","
item=
"planId"
open=
"("
close=
")"
>
#{planId}
</foreach>
</update>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanRuleMapper.xml
View file @
c13c7a25
...
...
@@ -2,4 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.PlanRuleMapper"
>
<update
id=
"updateIsDeleteByPlanIdList"
parameterType=
"list"
>
UPDATE c_plan_rule SET is_delete = #{isDelete} WHERE plan_id IN
<foreach
collection=
"planIdList"
separator=
","
item=
"planId"
open=
"("
close=
")"
>
#{planId}
</foreach>
</update>
</mapper>
\ 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