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
7b19b1ff
Commit
7b19b1ff
authored
Jun 21, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一码通删除功能补全
parent
3ff9b26a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
126 additions
and
23 deletions
+126
-23
EquipmentCategoryMapper.java
...s/boot/module/tzs/api/mapper/EquipmentCategoryMapper.java
+1
-1
SuperviseInfoMapper.java
.../amos/boot/module/tzs/api/mapper/SuperviseInfoMapper.java
+3
-3
EquipmentCategoryMapper.xml
...api/src/main/resources/mapper/EquipmentCategoryMapper.xml
+5
-2
SupervisionInfoMapper.xml
...s-api/src/main/resources/mapper/SupervisionInfoMapper.xml
+84
-7
EquipmentCategoryController.java
...odule/tzs/biz/controller/EquipmentCategoryController.java
+1
-1
EquipmentCategoryServiceImpl.java
...le/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
+32
-9
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/EquipmentCategoryMapper.java
View file @
7b19b1ff
...
@@ -36,7 +36,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
...
@@ -36,7 +36,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
Map
<
String
,
Object
>
getCategoryAndDefineByRecord
(
@Param
(
"record"
)
String
record
);
Map
<
String
,
Object
>
getCategoryAndDefineByRecord
(
@Param
(
"record"
)
String
record
);
List
<
Map
<
String
,
Object
>>
getAllUnit
(
String
unitCode
);
List
<
Map
<
String
,
Object
>>
getAllUnit
(
@Param
(
"unitCodes"
)
List
<
String
>
unitCodes
);
List
<
Map
<
String
,
Object
>>
getCategoryData
(
String
level
,
String
orgCode
,
String
companyCode
);
List
<
Map
<
String
,
Object
>>
getCategoryData
(
String
level
,
String
orgCode
,
String
companyCode
);
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/SuperviseInfoMapper.java
View file @
7b19b1ff
...
@@ -5,7 +5,6 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.SuperviseInfo;
...
@@ -5,7 +5,6 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.SuperviseInfo;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 特种设备基本信息-监督管理信息 Mapper 接口
* 特种设备基本信息-监督管理信息 Mapper 接口
...
@@ -17,7 +16,8 @@ public interface SuperviseInfoMapper extends BaseMapper<SuperviseInfo> {
...
@@ -17,7 +16,8 @@ public interface SuperviseInfoMapper extends BaseMapper<SuperviseInfo> {
void
updateRecordBatch
(
@Param
(
"recordList"
)
List
<
String
>
recordList
);
void
updateRecordBatch
(
@Param
(
"recordList"
)
List
<
String
>
recordList
);
List
<
Map
<
String
,
Object
>>
selectUnitCodeAndSuperviseCodeList
(
@Param
(
"records"
)
List
<
String
>
records
);
List
<
String
>
selectUnitCodeList
(
@Param
(
"records"
)
List
<
String
>
records
);
List
<
String
>
selectSuperviseCodeList
(
@Param
(
"records"
)
List
<
String
>
records
);
void
delete
All
(
);
void
delete
DataAll
(
@Param
(
"records"
)
List
<
String
>
records
);
}
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/EquipmentCategoryMapper.xml
View file @
7b19b1ff
...
@@ -159,8 +159,11 @@
...
@@ -159,8 +159,11 @@
USE_UNIT_CREDIT_CODE is NOT NULL
USE_UNIT_CREDIT_CODE is NOT NULL
AND USE_UNIT_CREDIT_CODE
<![CDATA[ <> ]]>
''
AND USE_UNIT_CREDIT_CODE
<![CDATA[ <> ]]>
''
AND (lengthb(USE_UNIT_CREDIT_CODE)= 15 or lengthb(USE_UNIT_CREDIT_CODE)= 18)
AND (lengthb(USE_UNIT_CREDIT_CODE)= 15 or lengthb(USE_UNIT_CREDIT_CODE)= 18)
<if
test=
"unitCode !=null and unitCode != ''"
>
<if
test=
"unitCodes !=null and unitCodes != ''"
>
and USE_UNIT_CREDIT_CODE = #{unitCode}
and USE_UNIT_CREDIT_CODE in
<foreach
collection=
"unitCodes"
separator=
","
item=
"unitCode"
open=
"("
close=
")"
>
#{unitCode}
</foreach>
</if>
</if>
GROUP BY use_code
GROUP BY use_code
ORDER BY use_code
ORDER BY use_code
...
...
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/SupervisionInfoMapper.xml
View file @
7b19b1ff
...
@@ -9,24 +9,100 @@
...
@@ -9,24 +9,100 @@
</foreach>
</foreach>
</update>
</update>
<select
id=
"selectUnitCode
AndSuperviseCodeList"
resultType=
"java.util.Map
"
>
<select
id=
"selectUnitCode
List"
resultType=
"java.lang.String
"
>
SELECT
SELECT
USE_UNIT_CREDIT_CODE unitCode,
DISTINCT ( USE_UNIT_CREDIT_CODE ) unitCode
SUPERVISORY_CODE code
FROM
FROM
idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_other_info oi ON ui."RECORD" = oi."RECORD"
idx_biz_jg_use_info ui
WHERE ui."RECORD" in
WHERE ui."RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
")"
>
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
")"
>
#{record}
#{record}
</foreach>
</foreach>
</select>
</select>
<delete
id=
"deleteAll"
>
<select
id=
"selectSuperviseCodeList"
resultType=
"java.lang.String"
>
SELECT
SUPERVISORY_CODE code
FROM
idx_biz_jg_other_info oi
WHERE oi."RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
")"
>
#{record}
</foreach>
</select>
<delete
id=
"deleteDataAll"
>
delete from idx_biz_jg_use_info where "RECORD" in
delete from idx_biz_jg_use_info where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
#{record}
</foreach>
</foreach>
delete from idx_biz_jg_other_info where "RECORD" = '102410241024';
delete from idx_biz_jg_design_info where "RECORD" in
delete from idx_biz_jg_register_info where "RECORD" = '102410241024';
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_factory_info where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_construction_info where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_register_info where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_maintenance_record_info where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_other_info where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_inspection_detection_info where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_tech_params_elevator where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_tech_params_vehicle where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_tech_params_ropeway where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_tech_params_rides where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_tech_params_boiler where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_tech_params_vessel where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_tech_params_pipeline where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_tech_params_lifting where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_main_parts where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
delete from idx_biz_jg_protection_devices where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
</delete>
</delete>
</mapper>
</mapper>
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/EquipmentCategoryController.java
View file @
7b19b1ff
...
@@ -255,7 +255,7 @@ public class EquipmentCategoryController extends BaseController {
...
@@ -255,7 +255,7 @@ public class EquipmentCategoryController extends BaseController {
*
*
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/deleteBatch"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/deleteBatch"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"批量删除一码通数据"
,
notes
=
"批量删除一码通数据"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"批量删除一码通数据"
,
notes
=
"批量删除一码通数据"
)
public
ResponseModel
<
Object
>
deleteBatch
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Object
>
deleteBatch
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
7b19b1ff
...
@@ -47,6 +47,7 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -47,6 +47,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
...
@@ -798,9 +799,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -798,9 +799,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return
getCategoryData
(
null
);
return
getCategoryData
(
null
);
}
}
private
List
<
EquipmentCategoryData
>
getCategoryData
(
String
unitCode
)
{
private
List
<
EquipmentCategoryData
>
getCategoryData
(
List
<
String
>
unitCodes
)
{
List
<
EquipmentCategoryData
>
list
=
new
ArrayList
<>();
List
<
EquipmentCategoryData
>
list
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
allUnitList
=
equipmentCategoryMapper
.
getAllUnit
(
unitCode
);
List
<
Map
<
String
,
Object
>>
allUnitList
=
equipmentCategoryMapper
.
getAllUnit
(
unitCode
s
);
for
(
Map
<
String
,
Object
>
map
:
allUnitList
)
{
for
(
Map
<
String
,
Object
>
map
:
allUnitList
)
{
EquipmentCategoryData
equipmentCategoryData
=
new
EquipmentCategoryData
();
EquipmentCategoryData
equipmentCategoryData
=
new
EquipmentCategoryData
();
equipmentCategoryData
.
setOrgBranchCode
(
map
.
get
(
"supervise_org_code"
).
toString
());
equipmentCategoryData
.
setOrgBranchCode
(
map
.
get
(
"supervise_org_code"
).
toString
());
...
@@ -855,26 +856,48 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -855,26 +856,48 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if
(
ObjectUtils
.
isEmpty
(
unitCode
)){
if
(
ObjectUtils
.
isEmpty
(
unitCode
)){
return
new
EquipmentCategoryData
();
return
new
EquipmentCategoryData
();
}
}
List
<
EquipmentCategoryData
>
equipmentCategoryData
=
getCategoryData
(
unitCode
);
List
<
String
>
unitCodeList
=
new
ArrayList
<>();
unitCodeList
.
add
(
unitCode
);
List
<
EquipmentCategoryData
>
equipmentCategoryData
=
getCategoryData
(
unitCodeList
);
return
equipmentCategoryData
.
get
(
0
);
return
equipmentCategoryData
.
get
(
0
);
}
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
String
>
deleteBatch
(
Map
<
String
,
Object
>
map
)
{
public
List
<
String
>
deleteBatch
(
Map
<
String
,
Object
>
map
)
{
Object
recordList
=
map
.
get
(
"recordList"
);
Object
recordList
=
map
.
get
(
"recordList"
);
List
<
String
>
records
=
new
ArrayList
<>();
List
<
String
>
records
=
new
ArrayList
<>();
List
<
ESEquipmentCategoryDto
>
list
=
new
ArrayList
<>();
if
(
recordList
.
toString
().
contains
(
","
)){
if
(
recordList
.
toString
().
contains
(
","
)){
for
(
String
record
:
(
List
<
String
>)
recordList
)
{
for
(
String
record
:
(
List
<
String
>)
recordList
)
{
records
.
add
(
record
);
records
.
add
(
record
);
ESEquipmentCategoryDto
esEquipmentCategoryDto
=
new
ESEquipmentCategoryDto
();
esEquipmentCategoryDto
.
setSEQUENCE_NBR
(
record
);
list
.
add
(
esEquipmentCategoryDto
);
}
}
}
else
{
}
else
{
records
.
add
(
recordList
.
toString
());
records
.
add
(
recordList
.
toString
());
}
ESEquipmentCategoryDto
esEquipmentCategoryDto
=
new
ESEquipmentCategoryDto
();
List
<
Map
<
String
,
Object
>>
codeList
=
superviseInfoMapper
.
selectUnitCodeAndSuperviseCodeList
(
records
);
esEquipmentCategoryDto
.
setSEQUENCE_NBR
(
recordList
.
toString
());
list
.
add
(
esEquipmentCategoryDto
);
superviseInfoMapper
.
deleteAll
();
}
//删除监管码表数据
return
null
;
List
<
String
>
superviseCodeList
=
superviseInfoMapper
.
selectSuperviseCodeList
(
records
);
if
(!
ObjectUtils
.
isEmpty
(
superviseCodeList
)){
supervisoryCodeInfoMapper
.
delete
(
new
QueryWrapper
<
SupervisoryCodeInfo
>().
in
(
"supervisory_code"
,
superviseCodeList
));
}
//删除涉及的19张表的数据
superviseInfoMapper
.
deleteDataAll
(
records
);
// 根据统一信用代码更新总览表
List
<
String
>
unitCodeList
=
superviseInfoMapper
.
selectUnitCodeList
(
records
);
if
(!
ObjectUtils
.
isEmpty
(
unitCodeList
)){
getCategoryData
(
unitCodeList
);
}
//删除es中的数据
esEquipmentCategory
.
deleteAll
(
list
);
return
records
;
}
}
...
...
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