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
c269cb3e
Commit
c269cb3e
authored
Feb 20, 2025
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):BUG 25390
parent
d3eca9d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
6 deletions
+67
-6
DataHandlerController.java
.../boot/module/jg/biz/controller/DataHandlerController.java
+24
-6
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+43
-0
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/controller/DataHandlerController.java
View file @
c269cb3e
...
@@ -5,10 +5,9 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
...
@@ -5,10 +5,9 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.DataHandlerServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.DataHandlerServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.util.StopWatch
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
...
@@ -154,8 +153,27 @@ public class DataHandlerController extends BaseController {
...
@@ -154,8 +153,27 @@ public class DataHandlerController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"使用登记、车用气瓶登记历史单据使用登记表生成"
,
notes
=
"使用登记、车用气瓶登记历史单据使用登记表生成"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"使用登记、车用气瓶登记历史单据使用登记表生成"
,
notes
=
"使用登记、车用气瓶登记历史单据使用登记表生成"
)
@GetMapping
(
value
=
"/initFormUrl"
)
@GetMapping
(
value
=
"/initFormUrl"
)
public
void
initFormUrl
()
{
public
ResponseModel
<
Boolean
>
initFormUrl
()
{
dataHandlerService
.
initFormUrl
();
dataHandlerService
.
initFormUrl
();
ResponseHelper
.
buildResponse
(
true
);
return
ResponseHelper
.
buildResponse
(
Boolean
.
TRUE
);
}
/**
* 同步设备信息到ES
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"同步设备信息到ES"
,
notes
=
"同步设备信息到ES"
)
@PostMapping
(
value
=
"/synchronizeEqData2ES"
)
public
ResponseModel
<
String
>
synchronizeEqData2ES
(
@ApiParam
(
value
=
"设备的record,多个设备使用英文逗号分割"
,
required
=
true
)
@RequestParam
(
value
=
"records"
)
String
records
,
@ApiParam
(
value
=
"是否安改维单位,默认值'false'"
,
required
=
true
,
defaultValue
=
"false"
)
@RequestParam
(
value
=
"isAgw"
,
defaultValue
=
"false"
)
Boolean
isAgw
,
@ApiParam
(
value
=
"是否纳管,默认值'true'"
,
required
=
true
,
defaultValue
=
"true"
)
@RequestParam
(
value
=
"isIntoManagement"
,
defaultValue
=
"true"
)
Boolean
isIntoManagement
)
{
StopWatch
watch
=
new
StopWatch
();
watch
.
start
();
dataHandlerService
.
synchronizeEqData2ES
(
records
,
isAgw
,
isIntoManagement
);
watch
.
stop
();
return
ResponseHelper
.
buildResponse
(
String
.
format
(
"同步成功,耗时:%s"
,
watch
.
getTotalTimeSeconds
()));
}
}
}
}
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/DataHandlerServiceImpl.java
View file @
c269cb3e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -9,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...
@@ -9,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
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.DataDictionary
;
...
@@ -18,6 +21,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
...
@@ -18,6 +21,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeEqDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeEqDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.PieLineEquipContraptionDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.PieLineEquipContraptionDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.DataHandlerMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.DataHandlerMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper
;
...
@@ -42,12 +46,14 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...
@@ -42,12 +46,14 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
import
java.sql.Timestamp
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgInstallationNoticeServiceImpl
.
CONSTRUCTION_TYPE
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgInstallationNoticeServiceImpl
.
CONSTRUCTION_TYPE
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgInstallationNoticeServiceImpl
.
CONSTRUCTION_TYPE_NAME
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgInstallationNoticeServiceImpl
.
CONSTRUCTION_TYPE_NAME
;
...
@@ -84,6 +90,8 @@ public class DataHandlerServiceImpl {
...
@@ -84,6 +90,8 @@ public class DataHandlerServiceImpl {
private
final
IdxBizJgProjectContraptionMapper
idxBizJgProjectContraptionMapper
;
private
final
IdxBizJgProjectContraptionMapper
idxBizJgProjectContraptionMapper
;
private
final
JgInstallationNoticeMapper
jgInstallationNoticeMapper
;
private
final
JgInstallationNoticeMapper
jgInstallationNoticeMapper
;
private
final
DataHandlerMapper
dataHandlerMapper
;
private
final
DataHandlerMapper
dataHandlerMapper
;
private
final
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
;
/**
/**
...
@@ -986,4 +994,39 @@ public class DataHandlerServiceImpl {
...
@@ -986,4 +994,39 @@ public class DataHandlerServiceImpl {
jgVehicleInformationService
.
initFormUrl
();
jgVehicleInformationService
.
initFormUrl
();
useRegistrationService
.
initFormUrl
();
useRegistrationService
.
initFormUrl
();
}
}
public
void
synchronizeEqData2ES
(
String
records
,
Boolean
isAgw
,
Boolean
isIntoManagement
)
{
if
(
records
==
null
||
records
.
isEmpty
())
{
return
;
}
String
[]
recordArr
=
records
.
trim
().
split
(
","
);
for
(
String
record
:
recordArr
)
{
Map
<
String
,
Object
>
map
=
categoryOtherInfoMapper
.
selectDataById
(
record
);
categoryOtherInfoMapper
.
updateEsStatus
(
record
);
ESEquipmentCategoryDto
dto
=
JSON
.
parseObject
(
toJSONString
(
map
),
ESEquipmentCategoryDto
.
class
);
Optional
<
ESEquipmentCategoryDto
>
data
=
esEquipmentCategory
.
findById
(
record
);
if
(!
ObjectUtils
.
isEmpty
(
data
))
{
esEquipmentCategory
.
deleteById
(
record
);
}
if
(!
ObjectUtils
.
isEmpty
(
dto
))
{
long
time
=
Timestamp
.
valueOf
(
map
.
get
(
"REC_DATE"
).
toString
().
substring
(
0
,
19
)).
getTime
();
dto
.
setREC_DATE
(
time
);
// 需要安装的设备 安装告知审批通过 清除设备的USC_UNIT_CREDIT_CODE安装单位信息
// 使用单位编辑 防止更新设备时将安改维单位信息更新到es中
if
(!
isAgw
)
{
dto
.
setUSC_UNIT_CREDIT_CODE
(
null
);
dto
.
setUSC_UNIT_NAME
(
null
);
}
if
(
map
.
get
(
"NEXT_INSPECT_DATE"
)
!=
null
)
{
Date
nextInspectDate
=
(
Date
)
map
.
get
(
"NEXT_INSPECT_DATE"
);
dto
.
setNEXT_INSPECT_DATE
(
DateUtil
.
parse
(
DateUtil
.
format
(
nextInspectDate
,
DatePattern
.
NORM_DATE_PATTERN
)).
getTime
());
}
dto
.
setIS_INTO_MANAGEMENT
(
isIntoManagement
);
IdxBizJgUseInfo
useInfo
=
useInfoService
.
lambdaQuery
().
eq
(
IdxBizJgUseInfo:
:
getRecord
,
record
).
one
();
dto
.
setUSE_PLACE_CODE
(
useInfo
.
getProvince
()
+
"#"
+
useInfo
.
getCity
()
+
"#"
+
useInfo
.
getCounty
()
+
"#"
+
useInfo
.
getFactoryUseSiteStreet
());
dto
.
setUSE_SITE_CODE
(
useInfo
.
getUsePlace
());
esEquipmentCategory
.
save
(
dto
);
}
}
}
}
}
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