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
dd3515bf
Commit
dd3515bf
authored
Dec 12, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(jg):用于业务变更过程中历史数据处理的控制层提交
parent
b9adc76b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
132 additions
and
111 deletions
+132
-111
IJgInstallationNoticeService.java
...t/module/jg/api/service/IJgInstallationNoticeService.java
+0
-2
DataHandlerController.java
.../boot/module/jg/biz/controller/DataHandlerController.java
+37
-0
JgInstallationNoticeController.java
...ule/jg/biz/controller/JgInstallationNoticeController.java
+2
-9
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+88
-0
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+0
-57
IdxBizJgProjectConstructionDto.java
...ot/module/ymt/api/dto/IdxBizJgProjectConstructionDto.java
+0
-2
IdxBizJgProjectInspectionDto.java
...boot/module/ymt/api/dto/IdxBizJgProjectInspectionDto.java
+4
-6
IdxBizJgProjectConstruction.java
...ot/module/ymt/api/entity/IdxBizJgProjectConstruction.java
+0
-17
IdxBizJgProjectInspection.java
...boot/module/ymt/api/entity/IdxBizJgProjectInspection.java
+1
-18
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IJgInstallationNoticeService.java
View file @
dd3515bf
...
...
@@ -85,7 +85,5 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot
*/
JgInstallationNotice
cancelApplication
(
Long
sequenceNbr
,
String
cancelReason
);
Boolean
historyDataRepair
();
Object
getDeviceListByProjectContraption
(
String
projectContraptionSeq
);
}
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
0 → 100644
View file @
dd3515bf
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.DataHandlerServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.Resource
;
/**
* 用于业务变更过程中历史数据处理的控制层
*/
@Api
(
tags
=
"用于业务变更过程中历史数据处理的控制层"
)
@RestController
@RequestMapping
(
value
=
"/dataHandler"
)
public
class
DataHandlerController
extends
BaseController
{
@Resource
private
DataHandlerServiceImpl
dataHandlerService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式"
,
notes
=
"安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式"
)
@GetMapping
(
value
=
"/installNotice/deviceListInForm"
)
public
ResponseModel
<
Boolean
>
deviceListInFormWithInstallNotice
()
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
deviceListInFormWithInstallNotice
());
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgInstallationNoticeController.java
View file @
dd3515bf
...
...
@@ -162,19 +162,12 @@ public class JgInstallationNoticeController extends BaseController {
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知历史数据修复"
,
notes
=
"安装告知历史数据修复"
)
@GetMapping
(
value
=
"/historyDataRepair"
)
public
ResponseModel
<
Boolean
>
historyDataRepair
()
{
return
ResponseHelper
.
buildResponse
(
iJgInstallationNoticeService
.
historyDataRepair
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备"
,
notes
=
"查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备"
)
@GetMapping
(
value
=
"/getDeviceListByProjectContraptionSeq"
)
public
ResponseModel
<
Object
>
getDeviceListByProjectContraption
(
@RequestParam
(
"projectContraptionSeq"
)
String
projectContraptionSeq
)
{
public
ResponseModel
<
Object
>
getDeviceListByProjectContraption
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
String
projectContraptionSeq
=
String
.
valueOf
(
params
.
get
(
"sequenceNbr"
));
return
ResponseHelper
.
buildResponse
(
iJgInstallationNoticeService
.
getDeviceListByProjectContraption
(
projectContraptionSeq
));
}
}
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
0 → 100644
View file @
dd3515bf
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
/**
* 用于业务变更过程中的历史数据处理的service层
*/
@Slf4j
@Service
public
class
DataHandlerServiceImpl
{
@Resource
private
ObjectMapper
objectMapper
;
@Autowired
private
JgRegistrationHistoryServiceImpl
registrationHistoryService
;
@Autowired
private
JgInstallationNoticeServiceImpl
installationNoticeService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
deviceListInFormWithInstallNotice
()
{
List
<
JgInstallationNotice
>
noticeList
=
installationNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>()
.
eq
(
JgInstallationNotice:
:
getEquCategoryCode
,
"8300"
));
List
<
JgRegistrationHistory
>
jgRegistrationHistories
=
noticeList
.
stream
()
.
map
(
notice
->
{
JgRegistrationHistory
history
=
getRegistrationHistory
(
String
.
valueOf
(
notice
.
getSequenceNbr
()));
if
(
history
==
null
)
return
null
;
try
{
Map
<
String
,
Object
>
hisData
=
objectMapper
.
readValue
(
history
.
getChangeData
(),
new
TypeReference
<
Map
<
String
,
Object
>>()
{
}
);
// 获取设备列表并处理每个设备信息
List
<
Map
<
String
,
Object
>>
deviceList
=
objectMapper
.
readValue
(
objectMapper
.
writeValueAsString
(
hisData
.
get
(
"deviceList"
)),
new
TypeReference
<
ArrayList
<
Map
<
String
,
Object
>>>()
{
}
);
deviceList
.
forEach
(
device
->
{
String
record
=
String
.
valueOf
(
device
.
get
(
"record"
));
Map
<
String
,
Object
>
pipelineEquInfo
=
installationNoticeService
.
getBaseMapper
().
getPipelineEquInfoByRecord
(
record
);
device
.
putAll
(
pipelineEquInfo
);
});
// 更新处理后的数据回到 history 对象
hisData
.
put
(
"deviceList"
,
deviceList
);
history
.
setChangeData
(
objectMapper
.
writeValueAsString
(
hisData
));
// 更新 changeData 字段
}
catch
(
Exception
e
)
{
log
.
error
(
"JSON 数据处理失败!"
,
e
);
throw
new
RuntimeException
(
e
.
getMessage
());
}
return
history
;
})
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
// 批量更新历史表数据
registrationHistoryService
.
updateBatchById
(
jgRegistrationHistories
);
return
Boolean
.
TRUE
;
}
// 辅助方法:根据 DocumentId 获取历史记录
private
JgRegistrationHistory
getRegistrationHistory
(
String
documentId
)
{
return
registrationHistoryService
.
getBaseMapper
().
selectOne
(
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
documentId
)
.
eq
(
JgRegistrationHistory:
:
getIsDelete
,
false
)
);
}
}
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/JgInstallationNoticeServiceImpl.java
View file @
dd3515bf
...
...
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.github.pagehelper.util.StringUtil
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
...
...
@@ -174,9 +173,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
@Autowired
private
JgRegistrationHistoryServiceImpl
jgRegistrationHistoryService
;
@Autowired
private
ObjectMapper
objectMapper
;
@Autowired
...
...
@@ -1708,59 +1704,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
historyDataRepair
()
{
List
<
JgInstallationNotice
>
noticeList
=
this
.
getBaseMapper
().
selectList
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>()
.
eq
(
JgInstallationNotice:
:
getEquCategoryCode
,
"8300"
));
List
<
JgRegistrationHistory
>
jgRegistrationHistories
=
noticeList
.
stream
()
.
map
(
notice
->
{
JgRegistrationHistory
history
=
getRegistrationHistory
(
String
.
valueOf
(
notice
.
getSequenceNbr
()));
if
(
history
==
null
)
return
null
;
try
{
Map
<
String
,
Object
>
hisData
=
objectMapper
.
readValue
(
history
.
getChangeData
(),
new
TypeReference
<
Map
<
String
,
Object
>>()
{
}
);
// 获取设备列表并处理每个设备信息
List
<
Map
<
String
,
Object
>>
deviceList
=
objectMapper
.
readValue
(
objectMapper
.
writeValueAsString
(
hisData
.
get
(
"deviceList"
)),
new
TypeReference
<
ArrayList
<
Map
<
String
,
Object
>>>()
{
}
);
deviceList
.
forEach
(
device
->
{
String
record
=
String
.
valueOf
(
device
.
get
(
"record"
));
Map
<
String
,
Object
>
pipelineEquInfo
=
this
.
baseMapper
.
getPipelineEquInfoByRecord
(
record
);
device
.
putAll
(
pipelineEquInfo
);
});
// 更新处理后的数据回到 history 对象
hisData
.
put
(
"deviceList"
,
deviceList
);
history
.
setChangeData
(
objectMapper
.
writeValueAsString
(
hisData
));
// 更新 changeData 字段
}
catch
(
Exception
e
)
{
log
.
error
(
"JSON 数据处理失败!"
,
e
);
throw
new
RuntimeException
(
e
.
getMessage
());
}
return
history
;
})
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
// 批量更新历史表数据
jgRegistrationHistoryService
.
updateBatchById
(
jgRegistrationHistories
);
return
Boolean
.
TRUE
;
}
// 辅助方法:根据 DocumentId 获取历史记录
private
JgRegistrationHistory
getRegistrationHistory
(
String
documentId
)
{
return
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
documentId
)
.
eq
(
JgRegistrationHistory:
:
getIsDelete
,
false
)
);
}
/**
* 查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备
*
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/dto/IdxBizJgProjectConstructionDto.java
View file @
dd3515bf
...
...
@@ -21,8 +21,6 @@ public class IdxBizJgProjectConstructionDto extends BaseDto {
private
static
final
long
serialVersionUID
=
1L
;
private
String
sequenceNbr
;
private
String
record
;
private
Date
recDate
;
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/dto/IdxBizJgProjectInspectionDto.java
View file @
dd3515bf
...
...
@@ -16,13 +16,11 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"IdxBizJgProjectInspectionDto"
,
description
=
"工程装置-检验检测信息表"
)
public
class
IdxBizJgProjectInspectionDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
sequenceNbr
;
@ApiModel
(
value
=
"IdxBizJgProjectInspectionDto"
,
description
=
"工程装置-检验检测信息表"
)
public
class
IdxBizJgProjectInspectionDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
record
;
private
Date
recDate
;
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgProjectConstruction.java
View file @
dd3515bf
...
...
@@ -23,11 +23,6 @@ public class IdxBizJgProjectConstruction extends TzsBaseEntity {
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*/
@TableField
(
"\"SEQUENCE_NBR\""
)
private
String
sequenceNbr
;
/**
*
...
...
@@ -38,18 +33,6 @@ public class IdxBizJgProjectConstruction extends TzsBaseEntity {
/**
*
*/
@TableField
(
"\"REC_DATE\""
)
private
Date
recDate
;
/**
*
*/
@TableField
(
"\"REC_USER_ID\""
)
private
String
recUserId
;
/**
*
*/
@TableField
(
"\"INSTANCE_ID\""
)
private
String
instanceId
;
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgProjectInspection.java
View file @
dd3515bf
...
...
@@ -26,26 +26,9 @@ public class IdxBizJgProjectInspection extends TzsBaseEntity {
/**
*
*/
@TableField
(
"\"SEQUENCE_NBR\""
)
private
String
sequenceNbr
;
/**
*
*/
@TableField
(
"\"RECORD\""
)
private
String
record
;
/**
*
*/
@TableField
(
"\"REC_DATE\""
)
private
Date
recDate
;
/**
*
*/
@TableField
(
"\"REC_USER_ID\""
)
private
String
recUserId
;
/**
*
...
...
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