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
5ce951f1
Commit
5ce951f1
authored
Apr 06, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量删除API提交
parent
973b1e1f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
0 deletions
+77
-0
FireFightingSystemController.java
.../equipmanage/controller/FireFightingSystemController.java
+24
-0
IEquipmentSpecificSerivce.java
...eejoin/equipmanage/service/IEquipmentSpecificSerivce.java
+6
-0
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+47
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java
View file @
5ce951f1
...
...
@@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.http.MediaType
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -199,6 +200,29 @@ public class FireFightingSystemController extends AbstractBaseController {
return
result
;
}
/**
* 装备卡片批量删除
*
* @return
*/
@DeleteMapping
(
value
=
"/delEquipmentSpecificByIds"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"装备卡片批量删除"
)
@Transactional
public
ResponseModel
delEquipmentSpecific
(
@RequestBody
List
<
Long
>
specificIds
)
{
if
(
CollectionUtils
.
isEmpty
(
specificIds
))
{
throw
new
BadRequest
(
"所选装备不能为空"
);
}
Set
<
String
>
bizOrgCodes
=
new
HashSet
<>();
specificIds
.
forEach
(
specId
->
{
EquipmentSpecific
equipmentSpecific
=
equipmentSpecificSerivce
.
getById
(
specId
);
equipmentSpecificSerivce
.
delEquipmentSpecificByIdNew
(
equipmentSpecific
);
bizOrgCodes
.
add
(
equipmentSpecific
.
getBizOrgCode
());
});
bizOrgCodes
.
forEach
(
this
::
refreshCount
);
return
CommonResponseUtil
.
success
(
Boolean
.
TRUE
);
}
private
void
refreshCount
(
String
bizOrgCode
)
{
equipmentSpecificSerivce
.
refreshStaData
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificSerivce.java
View file @
5ce951f1
...
...
@@ -75,6 +75,12 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
Boolean
delEquipmentSpecific
(
Long
id
);
/**
* 批量清除调用
* @param equipmentSpecific 装备信息
*/
Boolean
delEquipmentSpecificByIdNew
(
EquipmentSpecific
equipmentSpecific
);
/**
* 组装组态使用的卡片数据
*
* @param id
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
5ce951f1
...
...
@@ -49,6 +49,7 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.DateTimeUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.io.IOException
;
...
...
@@ -1010,6 +1011,52 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
}
}
@Override
public
Boolean
delEquipmentSpecificByIdNew
(
EquipmentSpecific
equipmentSpecific
)
{
Long
id
=
equipmentSpecific
.
getId
();
QueryWrapper
<
StockDetail
>
stockDetailQueryWrapper
=
new
QueryWrapper
<>();
stockDetailQueryWrapper
.
eq
(
"equipment_specific_id"
,
equipmentSpecific
.
getId
());
if
(
stockDetailService
.
count
(
stockDetailQueryWrapper
)
>
0
)
{
throw
new
BadRequest
(
"所选设备中存在已入库设备,无法删除,请重新选择,装备名称:"
+
equipmentSpecific
.
getName
());
}
String
code
=
this
.
getSystemCodeBySpeId
(
equipmentSpecific
.
getSystemId
());
int
res
=
this
.
baseMapper
.
deleteById
(
id
);
if
(
StringUtil
.
isNotEmpty
(
code
))
{
this
.
integrationPageSysDataRefresh
(
code
);
}
if
(
res
>
0
&&
Boolean
.
TRUE
.
equals
(
syncSwitch
))
{
//数据同步
delEquipmentSpecificSyncData
(
id
);
}
//判断装备表剩余数量,无剩余删除模板
QueryWrapper
<
EquipmentSpecific
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"equipment_detail_id"
,
equipmentSpecific
.
getEquipmentDetailId
());
List
<
String
>
sys
=
this
.
baseMapper
.
selectSystemList
(
id
);
List
<
String
>
build
=
this
.
baseMapper
.
selectBuildList
(
id
);
String
sysErrorMeg
=
""
;
String
buildErrorMeg
=
""
;
if
(!
CollectionUtils
.
isEmpty
(
sys
)
||
!
CollectionUtils
.
isEmpty
(
build
))
{
for
(
String
s
:
sys
)
{
sysErrorMeg
=
sysErrorMeg
.
equals
(
""
)
?
s
:
sysErrorMeg
+
","
+
s
;
}
for
(
String
s
:
build
)
{
buildErrorMeg
=
buildErrorMeg
.
equals
(
""
)
?
s
:
buildErrorMeg
+
","
+
s
;
}
sysErrorMeg
=
sysErrorMeg
.
equals
(
""
)
?
sysErrorMeg
:
"系统:"
+
sysErrorMeg
+
","
;
buildErrorMeg
=
buildErrorMeg
.
equals
(
""
)
?
buildErrorMeg
:
"建筑:"
+
buildErrorMeg
+
","
;
throw
new
BadRequest
(
"所选设备中有与"
+
sysErrorMeg
+
buildErrorMeg
+
"存在绑定关系,无法删除,装备名称:"
+
equipmentSpecific
.
getName
());
}
if
(
this
.
baseMapper
.
selectCount
(
wrapper
)
==
0
)
{
equipmentDetailService
.
removeById
(
equipmentSpecific
.
getEquipmentDetailId
());
}
if
(
res
>
0
)
{
// 删除设备动态表单扩展属性
return
formInstanceEquipService
.
deleteInstanceById
(
id
);
}
else
{
return
false
;
}
}
private
String
getSystemCodeBySpeId
(
String
sysIds
)
{
if
(
StringUtil
.
isNotEmpty
(
sysIds
))
{
List
<
FireFightingSystemEntity
>
sys
=
fireFightingSystemMapper
.
getFightingSysByIds
(
sysIds
.
split
(
","
));
...
...
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