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
4441e203
Commit
4441e203
authored
Jun 20, 2023
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改一码通es初始化接口-优化
parent
40fca3f2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
SupervisionInfoMapper.xml
...s-api/src/main/resources/mapper/SupervisionInfoMapper.xml
+1
-1
AmosTzsApplication.java
...iz/src/main/java/com/yeejoin/amos/AmosTzsApplication.java
+6
-1
EquipmentCategoryServiceImpl.java
...le/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
+15
-1
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/SupervisionInfoMapper.xml
View file @
4441e203
...
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"com.yeejoin.amos.boot.module.tzs.api.mapper.SuperviseInfoMapper"
>
<update
id=
"updateRecordBatch"
>
UPDATE idx_biz_jg_
supervision
_info SET "IS_NOT_ES" = 1 WHERE "RECORD" IN
UPDATE idx_biz_jg_
use
_info SET "IS_NOT_ES" = 1 WHERE "RECORD" IN
<foreach
collection=
"recordList"
separator=
","
item=
"record"
open=
"("
close=
")"
>
#{record}
</foreach>
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/AmosTzsApplication.java
View file @
4441e203
package
com
.
yeejoin
.
amos
;
import
com.yeejoin.amos.boot.biz.common.utils.oConvertUtils
;
import
com.yeejoin.amos.boot.module.tzs.biz.listener.*
;
import
com.yeejoin.amos.boot.module.tzs.biz.listener.AmosMqttListener
;
import
com.yeejoin.amos.boot.module.tzs.biz.listener.BaseEnterpriseMqTtlListener
;
import
com.yeejoin.amos.boot.module.tzs.biz.listener.CarcylUnitInspectMqTtlListener
;
import
com.yeejoin.amos.boot.module.tzs.biz.listener.FillingRecordSyncListener
;
import
com.yeejoin.amos.boot.module.tzs.biz.listener.PrivilegeCompanyDeleteListener
;
import
com.yeejoin.amos.boot.module.tzs.biz.listener.PrivilegeCompanyUpdateAddListener
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.StartPlatformTokenService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.ICylinderInfoService
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
...
...
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 @
4441e203
...
...
@@ -801,11 +801,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
superviseInfoMapper
.
update
(
superviseInfo
,
new
QueryWrapper
<
SuperviseInfo
>().
eq
(
"RECORD"
,
id
));
ESEquipmentCategoryDto
dto
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
map
),
ESEquipmentCategoryDto
.
class
);
Optional
<
ESEquipmentCategoryDto
>
data
=
esEquipmentCategory
.
findById
(
id
);
dto
.
setREC_DATE
(
System
.
currentTimeMillis
());
if
(!
ObjectUtils
.
isEmpty
(
data
))
{
esEquipmentCategory
.
deleteById
(
id
);
}
if
(!
ObjectUtils
.
isEmpty
(
dto
))
{
dto
.
setREC_DATE
(
System
.
currentTimeMillis
());
esEquipmentCategory
.
save
(
dto
);
}
}
...
...
@@ -891,6 +891,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
List
<
Map
<
String
,
Object
>>
mapList
=
bizJdbcTemplate
.
queryForList
(
selectSql
);
page
.
setRecords
(
mapList
);
page
.
setTotal
(
mapList
.
size
());
return
page
;
}
...
...
@@ -909,6 +910,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/
public
void
saveEs
()
{
long
start
=
System
.
currentTimeMillis
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
TABLENAME
,
"idx_biz_view_jg_all"
);
Long
counts
=
counts
(
map
);
...
...
@@ -917,10 +919,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if
(
yushu
>
0
)
{
times
++;
}
long
total
=
0
;
for
(
int
i
=
1
;
i
<=
times
;
i
++)
{
map
.
put
(
"number"
,
1
);
map
.
put
(
"size"
,
1000
);
Page
<
Map
<
String
,
Object
>>
page
=
getAll
(
map
);
total
=
total
+
page
.
getTotal
();
saveBatchEquipment2Es
(
page
.
getRecords
());
// for (Map<String, Object> record : page.getRecords()) {
// if (ValidationUtil.isEmpty(record.get("IS_NOT_ES"))) {
...
...
@@ -928,6 +932,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
// }
// }
}
long
end
=
System
.
currentTimeMillis
();
log
.
info
(
"本次一码通同步设备数据:【"
+
total
+
"】条,耗时:"
+
(
end
-
start
)
+
" 毫秒"
);
}
public
void
saveBatchEquipment2Es
(
List
<
Map
<
String
,
Object
>>
equipList
)
{
...
...
@@ -955,9 +961,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
recordList
.
add
((
String
)
e
.
get
(
"SEQUENCE_NBR"
));
}
long
start
=
System
.
currentTimeMillis
();
esEquipmentCategory
.
saveAll
(
esEquipDtoList
);
long
end
=
System
.
currentTimeMillis
();
long
cost
=
end
-
start
;
System
.
out
.
println
(
"批量存入es1000条数据耗时:"
+
cost
);
long
start1
=
System
.
currentTimeMillis
();
superviseInfoMapper
.
updateRecordBatch
(
recordList
);
long
end1
=
System
.
currentTimeMillis
();
long
cost1
=
end1
-
start1
;
System
.
out
.
println
(
"批量更新1000条业务数据耗时:"
+
cost1
);
}
/**
...
...
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