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
f985b2e1
Commit
f985b2e1
authored
Nov 10, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg): 批量删除提示修改
1.批量删除提示修改由于序号不对应,调整为产品、装置名称
parent
811c6c78
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
31 deletions
+32
-31
IdxBizJgProjectContraptionServiceImplService.java
...ce/impl/IdxBizJgProjectContraptionServiceImplService.java
+9
-9
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+11
-9
EnterpriseManageServiceImpl.java
...ule/tcm/biz/service/impl/EnterpriseManageServiceImpl.java
+12
-13
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/IdxBizJgProjectContraptionServiceImplService.java
View file @
f985b2e1
...
...
@@ -984,17 +984,17 @@ public class IdxBizJgProjectContraptionServiceImplService extends BaseEntityServ
}
private
String
getTipMsgString
(
Map
<
String
,
Long
>
projectContraptionIdUseNumMap
,
List
<
String
>
pIds
)
{
List
<
Integer
>
indexes
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
pIds
.
size
();
i
++)
{
String
projectContraptionId
=
pIds
.
get
(
i
);
if
(
projectContraptionIdUseNumMap
.
getOrDefault
(
projectContraptionId
,
0L
)
>
0
)
{
indexes
.
add
(
i
+
1
);
}
List
<
String
>
projectContraptionNames
=
new
ArrayList
<>();
List
<
String
>
projectContraptionIdInUsed
=
projectContraptionIdUseNumMap
.
entrySet
().
stream
().
filter
(
e
->
e
.
getValue
()>
0
).
map
(
Map
.
Entry
::
getKey
).
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
projectContraptionIdNameMap
=
this
.
list
(
new
LambdaQueryWrapper
<
IdxBizJgProjectContraption
>()
.
in
(
BaseEntity:
:
getSequenceNbr
,
projectContraptionIdInUsed
)
.
select
(
BaseEntity:
:
getSequenceNbr
,
IdxBizJgProjectContraption:
:
getProjectContraption
))
.
stream
().
collect
(
Collectors
.
toMap
(
p
->
String
.
valueOf
(
p
.
getSequenceNbr
()),
IdxBizJgProjectContraption:
:
getProjectContraption
));
for
(
String
projectContraptionId
:
projectContraptionIdInUsed
)
{
projectContraptionNames
.
add
(
projectContraptionIdNameMap
.
get
(
projectContraptionId
));
}
if
(
pIds
.
size
()
>
1
)
{
return
String
.
format
(
"选择的第 %s 行装置已经在业务办理中,不能删除,请先取消勾选!"
,
indexes
.
stream
()
.
map
(
String:
:
valueOf
)
.
collect
(
Collectors
.
joining
(
","
)));
return
String
.
format
(
"选择的装置:%s,已经在业务办理中,不能删除,请先取消勾选!"
,
String
.
join
(
"、"
,
projectContraptionNames
));
}
else
{
return
"装置已经在业务办理中,不能删除!"
;
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
View file @
f985b2e1
...
...
@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.*
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
...
...
@@ -49,6 +50,7 @@ import com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.EquipCreateOrEdit
import
com.yeejoin.amos.boot.module.jg.biz.service.*
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.KV
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
...
...
@@ -1261,17 +1263,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
private
String
getTipMsgString
(
Map
<
String
,
Long
>
recordUseNumMap
,
List
<
String
>
records
)
{
List
<
Integer
>
idxs
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
records
.
size
();
i
++)
{
String
record
=
records
.
get
(
i
);
if
(
recordUseNumMap
.
getOrDefault
(
record
,
0L
)
>
0
){
idxs
.
add
(
i
+
1
);
}
List
<
String
>
inUsedNames
=
new
ArrayList
<>();
List
<
String
>
recordsInUsed
=
recordUseNumMap
.
entrySet
().
stream
().
filter
(
e
->
e
.
getValue
()
>
0
).
map
(
Map
.
Entry
::
getKey
).
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
recordNameMap
=
idxBizJgRegisterInfoService
.
list
(
new
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>()
.
in
(
IdxBizJgRegisterInfo:
:
getRecord
,
recordsInUsed
)
.
select
(
TzsBaseEntity:
:
getSequenceNbr
,
IdxBizJgRegisterInfo:
:
getProductName
))
.
stream
().
collect
(
Collectors
.
toMap
(
IdxBizJgRegisterInfo:
:
getRecord
,
IdxBizJgRegisterInfo:
:
getProductName
));
for
(
String
record
:
recordsInUsed
)
{
inUsedNames
.
add
(
recordNameMap
.
get
(
record
));
}
if
(
records
.
size
()
>
1
)
{
return
String
.
format
(
"选择的第 %s 行设备已经在业务办理中,不能删除,请先取消勾选!"
,
idxs
.
stream
()
.
map
(
String:
:
valueOf
)
.
collect
(
Collectors
.
joining
(
","
)));
return
String
.
format
(
"选择的设备:%s,已经在业务办理中,不能删除,请先取消勾选!"
,
String
.
join
(
"、"
,
inUsedNames
));
}
else
{
return
"设备已经在业务办理中,不能删除!"
;
}
...
...
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/EnterpriseManageServiceImpl.java
View file @
f985b2e1
...
...
@@ -53,11 +53,10 @@ public class EnterpriseManageServiceImpl {
public
Boolean
delete
(
List
<
String
>
ids
)
{
// 校验
List
<
TzBaseEnterpriseInfo
>
enterpriseInfos
=
enterpriseInfoService
.
getBaseMapper
().
selectBatchIds
(
ids
);
List
<
String
>
useUnitCodes
=
this
.
castIds2UseUnitCodes
(
ids
,
enterpriseInfos
);
Map
<
String
,
Long
>
useUnitCodeUserNumMap
=
this
.
countUserByUnit
(
enterpriseInfos
);
this
.
checkForUse
(
useUnitCode
s
,
useUnitCodeUserNumMap
,
"人员"
);
this
.
checkForUse
(
enterpriseInfo
s
,
useUnitCodeUserNumMap
,
"人员"
);
Map
<
String
,
Long
>
useUnitCodeEquipNumMap
=
this
.
countEquipByUnit
(
enterpriseInfos
);
this
.
checkForUse
(
useUnitCode
s
,
useUnitCodeEquipNumMap
,
"设备"
);
this
.
checkForUse
(
enterpriseInfo
s
,
useUnitCodeEquipNumMap
,
"设备"
);
// 业务操作
enterpriseInfos
.
forEach
(
e
->
{
this
.
deleteEnterprise
(
e
);
...
...
@@ -185,30 +184,30 @@ public class EnterpriseManageServiceImpl {
});
}
private
void
checkForUse
(
List
<
String
>
id
s
,
Map
<
String
,
Long
>
seqUseNumMap
,
String
type
)
{
private
void
checkForUse
(
List
<
TzBaseEnterpriseInfo
>
enterpriseInfo
s
,
Map
<
String
,
Long
>
seqUseNumMap
,
String
type
)
{
if
(
seqUseNumMap
.
values
().
stream
().
reduce
(
0L
,
Long:
:
sum
)
>
0
)
{
List
<
Integer
>
indexUse
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
ids
.
size
();
i
++
)
{
if
(
seqUseNumMap
.
getOrDefault
(
ids
.
get
(
i
),
0L
)
>
0
)
{
indexUse
.
add
(
i
+
1
);
List
<
String
>
useNames
=
new
ArrayList
<>();
for
(
TzBaseEnterpriseInfo
enterpriseInfo
:
enterpriseInfos
)
{
if
(
seqUseNumMap
.
getOrDefault
(
enterpriseInfo
.
getUseUnitCode
(
),
0L
)
>
0
)
{
useNames
.
add
(
enterpriseInfo
.
getUseUnit
()
);
}
}
this
.
buildDeleteCheckFailureMsg
(
indexUse
,
type
);
this
.
buildDeleteCheckFailureMsg
(
useNames
,
type
);
}
}
private
void
buildDisableCheckFailureMsg
(
List
<
Integer
>
indexDisabled
)
{
String
msg
=
indexDisabled
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
"、"
,
"
第"
,
"行"
))
+
"已经是停用状态,不能重复操作!"
;
String
msg
=
indexDisabled
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
"、"
,
"
您选中的企业:"
,
",已经是停用状态,不能重复操作!"
))
;
throw
new
BadRequest
(
msg
);
}
private
void
buildEnableCheckFailureMsg
(
List
<
Integer
>
indexDisabled
)
{
String
msg
=
indexDisabled
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
"、"
,
"
第"
,
"行"
))
+
"已经是启用状态,不能重复操作!"
;
String
msg
=
indexDisabled
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
"、"
,
"
您选中的企业:"
,
",已经是启用状态,不能重复操作!"
))
;
throw
new
BadRequest
(
msg
);
}
private
void
buildDeleteCheckFailureMsg
(
List
<
Integer
>
indexUse
,
String
type
)
{
String
msg
=
String
.
format
(
"
%s的企业下存在%s,请先删除%s后再操作!"
,
indexUse
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
"、"
,
"第"
,
"行"
)
),
type
,
type
);
private
void
buildDeleteCheckFailureMsg
(
List
<
String
>
useNames
,
String
type
)
{
String
msg
=
String
.
format
(
"
企业:%s下存在%s,请先删除%s后再操作!"
,
String
.
join
(
"、"
,
useNames
),
type
,
type
);
throw
new
BadRequest
(
msg
);
}
...
...
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