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
e3443191
Commit
e3443191
authored
Jun 19, 2023
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改一码通es初始化接口
parent
ab78a817
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
19 deletions
+73
-19
SuperviseInfoMapper.java
.../amos/boot/module/tzs/api/mapper/SuperviseInfoMapper.java
+4
-0
TzBaseEnterpriseInfoMapper.xml
.../src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
+1
-9
EquipmentCategoryController.java
...odule/tzs/biz/controller/EquipmentCategoryController.java
+2
-1
EquipmentCategoryServiceImpl.java
...le/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
+62
-9
UnitInfoController.java
...oot/module/tzs/flc/biz/controller/UnitInfoController.java
+4
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/SuperviseInfoMapper.java
View file @
e3443191
...
...
@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.tzs.api.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.SuperviseInfo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 特种设备基本信息-监督管理信息 Mapper 接口
...
...
@@ -11,4 +14,5 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.SuperviseInfo;
*/
public
interface
SuperviseInfoMapper
extends
BaseMapper
<
SuperviseInfo
>
{
void
updateRecordBatch
(
@Param
(
"recordList"
)
List
<
String
>
recordList
);
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
View file @
e3443191
...
...
@@ -60,10 +60,6 @@
AND use_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useCode},'%')
</if>
<if
test=
"tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' "
>
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%')
</if>
<if
test=
"tzBaseEnterpriseInfoDto.region!=null and tzBaseEnterpriseInfoDto.region!='' "
>
AND CONCAT(province,'/',city,'/',district) LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.region},'%')
</if>
...
...
@@ -115,10 +111,6 @@
AND use_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useCode},'%')
</if>
<if
test=
"tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' "
>
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%')
</if>
<if
test=
"tzBaseEnterpriseInfoDto.region!=null and tzBaseEnterpriseInfoDto.region!='' "
>
AND CONCAT(province,'/',city,'/',district) LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.region},'%')
</if>
...
...
@@ -136,7 +128,7 @@
</if>
<if
test=
"tzBaseEnterpriseInfoDto.address!=null and tzBaseEnterpriseInfoDto.address!='' "
>
AND
supervise_org_code
LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.address},'%')
AND
address
LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.address},'%')
</if>
<if
test=
"tzBaseEnterpriseInfoDto.regulatoryLabels!=null and tzBaseEnterpriseInfoDto.regulatoryLabels!='' "
>
AND regulatory_labels LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.regulatoryLabels},'%')
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/EquipmentCategoryController.java
View file @
e3443191
...
...
@@ -319,8 +319,9 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/test"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"test"
,
notes
=
"test"
)
public
void
test
()
{
public
ResponseModel
<
String
>
test
()
{
equipmentCategoryServiceImpl
.
saveEs
();
return
ResponseHelper
.
buildResponse
(
"success"
);
}
...
...
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 @
e3443191
...
...
@@ -6,17 +6,26 @@ import com.alibaba.fastjson.TypeReference;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EquInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.*
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.CategoryOtherInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategoryData
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.SuperviseInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.SupervisoryCodeInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentCategoryEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.*
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.CategoryOtherInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryDataMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.SuperviseInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.SupervisoryCodeInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.tzs.biz.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.JsonUtils
;
...
...
@@ -24,7 +33,6 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.feign.IdxFeignService;
import
com.yeejoin.amos.boot.module.tzs.flc.api.feign.PrivilegeFeginService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpHost
;
import
org.apache.http.auth.AuthScope
;
...
...
@@ -50,13 +58,23 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.Assert
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.DateUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.io.IOException
;
import
java.sql.Timestamp
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.StringJoiner
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -76,6 +94,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private
SuperviseInfoMapper
superviseInfoMapper
;
@Autowired
private
SuperviseInfoService
superviseInfoService
;
@Autowired
EquipmentCategoryMapper
equipmentCategoryMapper
;
@Value
(
"classpath:/json/equipCategory.json"
)
...
...
@@ -853,7 +874,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
public
Page
<
Map
<
String
,
Object
>>
getAll
(
Map
<
String
,
Object
>
map
)
{
String
tableName
=
map
.
get
(
TABLENAME
).
toString
();
Assert
.
hasText
(
tableName
,
"表名不能为空"
);
String
selectSql
=
" SELECT * FROM "
+
tableName
;
String
selectSql
=
" SELECT * FROM "
+
tableName
+
" WHERE IS_NOT_ES <> 1 or IS_NOT_ES IS NULL "
;
Integer
number
=
ValidationUtil
.
isEmpty
(
map
.
get
(
"number"
))
?
0
:
Integer
.
valueOf
(
map
.
get
(
"number"
).
toString
());
Integer
size
=
ValidationUtil
.
isEmpty
(
map
.
get
(
"size"
))
?
0
:
Integer
.
valueOf
(
map
.
get
(
"size"
).
toString
());
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<>(
number
,
size
);
...
...
@@ -870,7 +891,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
public
Long
counts
(
Map
<
String
,
Object
>
map
)
{
String
tableName
=
map
.
get
(
TABLENAME
).
toString
();
Assert
.
hasText
(
tableName
,
"表名不能为空"
);
String
countSql
=
" SELECT COUNT(SEQUENCE_NBR) count FROM "
+
tableName
;
String
countSql
=
" SELECT COUNT(SEQUENCE_NBR) count FROM "
+
tableName
+
" WHERE IS_NOT_ES <> 1 or IS_NOT_ES IS NULL"
;
Long
count
=
bizJdbcTemplate
.
queryForObject
(
countSql
,
Long
.
class
);
return
count
;
}
...
...
@@ -893,13 +914,45 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
map
.
put
(
"number"
,
i
);
map
.
put
(
"size"
,
1000
);
Page
<
Map
<
String
,
Object
>>
page
=
getAll
(
map
);
for
(
Map
<
String
,
Object
>
record
:
page
.
getRecords
())
{
if
(
ValidationUtil
.
isEmpty
(
record
.
get
(
"IS_NOT_ES"
)))
{
saveESEquipmentCategory
(
record
);
saveBatchEquipment2Es
(
page
.
getRecords
());
// for (Map<String, Object> record : page.getRecords()) {
// if (ValidationUtil.isEmpty(record.get("IS_NOT_ES"))) {
// saveESEquipmentCategory(record);
// }
// }
}
}
public
void
saveBatchEquipment2Es
(
List
<
Map
<
String
,
Object
>>
equipList
)
{
List
<
ESEquipmentCategoryDto
>
esEquipDtoList
=
Lists
.
newArrayList
();
List
<
String
>
recordList
=
Lists
.
newArrayList
();
if
(
ValidationUtil
.
isEmpty
(
equipList
))
{
return
;
}
for
(
Map
<
String
,
Object
>
e
:
equipList
)
{
String
recDate1
=
""
;
if
(
ValidationUtil
.
isEmpty
(
e
.
get
(
"REC_DATE"
)))
{
try
{
recDate1
=
DateUtil
.
formatDate
(
new
Date
(),
"yyyy-MM-dd hh:mm:ss"
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
}
else
{
recDate1
=
e
.
get
(
"REC_DATE"
).
toString
().
substring
(
0
,
19
);
}
long
time
=
Timestamp
.
valueOf
(
recDate1
).
getTime
();
e
.
put
(
"REC_DATE"
,
time
);
ESEquipmentCategoryDto
esEquipDto
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
),
ESEquipmentCategoryDto
.
class
);
esEquipDtoList
.
add
(
esEquipDto
);
recordList
.
add
((
String
)
e
.
get
(
"SEQUENCE_NBR"
));
}
esEquipmentCategory
.
saveAll
(
esEquipDtoList
);
superviseInfoMapper
.
updateRecordBatch
(
recordList
);
}
/**
* es保存设备数据
*/
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/UnitInfoController.java
View file @
e3443191
...
...
@@ -287,6 +287,10 @@ public class UnitInfoController extends BaseController {
flag
=
true
;
}
}
// “超级验证码",压测使用
if
(
"88888888"
.
equals
(
code
))
{
flag
=
true
;
}
return
ResponseHelper
.
buildResponse
(
flag
);
}
...
...
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