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
86754695
Commit
86754695
authored
Aug 15, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(jyjc): 报检开发调整
1.报检规则4.0开发
parent
59b6d772
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
184 additions
and
56 deletions
+184
-56
InspectionApplicationPushDataPipeline.java
...e/jyjc/api/dto/InspectionApplicationPushDataPipeline.java
+1
-2
PipelinePushItemDto.java
...in/amos/boot/module/jyjc/api/dto/PipelinePushItemDto.java
+73
-0
PipelineResultItemDto.java
.../amos/boot/module/jyjc/api/dto/PipelineResultItemDto.java
+0
-17
JyjcInspectionResultController.java
...e/jyjc/biz/controller/JyjcInspectionResultController.java
+1
-1
InspectionApplicationPushEventListener.java
...vent/listener/InspectionApplicationPushEventListener.java
+5
-6
BatchEquipResultDataProcessor.java
.../event/listener/result/BatchEquipResultDataProcessor.java
+29
-3
SingleEquipResultDataProcessor.java
...event/listener/result/SingleEquipResultDataProcessor.java
+0
-2
JyjcInspectionApplicationServiceImpl.java
...iz/service/impl/JyjcInspectionApplicationServiceImpl.java
+5
-5
JyjcInspectionResultServiceImpl.java
...yjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
+55
-20
IdxBizJgProjectContraptionMapper.java
...dule/ymt/api/mapper/IdxBizJgProjectContraptionMapper.java
+4
-0
IdxBizJgProjectContraptionMapper.xml
...ain/resources/mapper/IdxBizJgProjectContraptionMapper.xml
+11
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/dto/InspectionApplicationPushDataPipeline.java
View file @
86754695
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
api
.
dto
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.InspectionEquipData
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -66,7 +65,7 @@ public class InspectionApplicationPushDataPipeline implements Serializable {
private
String
totalLength
;
@ApiModelProperty
(
value
=
"报检的管道"
)
private
List
<
Pipeline
Result
ItemDto
>
inspectionEquips
;
private
List
<
Pipeline
Push
ItemDto
>
inspectionEquips
;
private
String
traceId
;
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/dto/PipelinePushItemDto.java
0 → 100644
View file @
86754695
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* 压力管道汇总表数据项
*
* @author system_generator
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"压力管道汇总表数据项"
)
public
class
PipelinePushItemDto
{
@ApiModelProperty
(
value
=
"唯一标识"
)
private
String
equipId
;
@ApiModelProperty
(
value
=
"管道名称(登记单元)"
)
private
String
pipeName
;
@ApiModelProperty
(
value
=
"管道编号"
)
private
String
pipelineNumber
;
@ApiModelProperty
(
value
=
"设计单位名称"
)
private
String
designUnitName
;
@ApiModelProperty
(
value
=
"管道级别"
)
private
String
deviceLevel
;
@ApiModelProperty
(
value
=
"公称直径"
)
private
String
nominalDiameter
;
@ApiModelProperty
(
value
=
"公称壁厚"
)
private
String
wallThickness
;
@ApiModelProperty
(
value
=
"管道长度"
)
private
String
pipeLength
;
@ApiModelProperty
(
value
=
"设计压力"
)
private
String
pressure
;
@ApiModelProperty
(
value
=
"设计温度"
)
private
String
temperature
;
@ApiModelProperty
(
value
=
"设计介质"
)
private
String
medium
;
@ApiModelProperty
(
value
=
"工作压力"
)
private
String
workPressure
;
@ApiModelProperty
(
value
=
"工作温度"
)
private
String
workTemperature
;
@ApiModelProperty
(
value
=
"工作介质"
)
private
String
workMedium
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remarks
;
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/dto/PipelineResultItemDto.java
View file @
86754695
...
...
@@ -18,23 +18,6 @@ public class PipelineResultItemDto {
@ApiModelProperty
(
value
=
"唯一标识"
)
private
String
equipId
;
@ApiModelProperty
(
value
=
"管道名称(登记单元)"
)
private
String
pipeName
;
@ApiModelProperty
(
value
=
"管道编号"
)
private
String
pipelineNumber
;
@ApiModelProperty
(
value
=
"设计单位名称"
)
private
String
designUnitName
;
@ApiModelProperty
(
value
=
"管道级别"
)
private
String
deviceLevel
;
@ApiModelProperty
(
value
=
"公称直径"
)
private
String
nominalDiameter
;
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/controller/JyjcInspectionResultController.java
View file @
86754695
...
...
@@ -251,7 +251,7 @@ public class JyjcInspectionResultController extends BaseController {
* @return List<JyjcInspectionResultDataModel>
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"
报检结果接收"
,
notes
=
"
对外对接使用,支持单条及批量"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"
压力管道报检结果接收"
,
notes
=
"压力管道
对外对接使用,支持单条及批量"
)
@PostMapping
(
value
=
"/pipeline/receive"
)
public
ResponseModel
<
List
<
PipelineInspectionResultDto
>>
savePipelineResultDataBatch
(
@RequestBody
List
<
PipelineInspectionResultDto
>
resultData
){
return
ResponseHelper
.
buildResponse
(
jyjcInspectionResultServiceImpl
.
receivePipelineResultData
(
resultData
));
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/event/listener/InspectionApplicationPushEventListener.java
View file @
86754695
...
...
@@ -14,7 +14,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationManageMapper
;
import
com.yeejoin.amos.boot.module.jyjc.api.common.BizCommonConstant
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionApplicationPushDataPipeline
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.Pipeline
Result
ItemDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.Pipeline
Push
ItemDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationEquip
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationPushLog
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.EquipCategoryEnum
;
...
...
@@ -35,7 +35,6 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.event.TransactionalEventListener
;
...
...
@@ -207,12 +206,12 @@ public class InspectionApplicationPushEventListener {
return
canDealInspectionTypes
;
}
private
String
calTotalLength
(
List
<
Pipeline
Result
ItemDto
>
pipelines
)
{
private
String
calTotalLength
(
List
<
Pipeline
Push
ItemDto
>
pipelines
)
{
if
(
pipelines
==
null
||
pipelines
.
isEmpty
())
{
return
ZERO
.
toPlainString
();
}
return
pipelines
.
stream
()
.
map
(
Pipeline
Result
ItemDto:
:
getPipeLength
)
.
map
(
Pipeline
Push
ItemDto:
:
getPipeLength
)
.
filter
(
Objects:
:
nonNull
)
.
map
(
String:
:
trim
)
.
filter
(
s
->
!
s
.
isEmpty
())
...
...
@@ -257,10 +256,10 @@ public class InspectionApplicationPushEventListener {
return
jsonStr
;
}
private
List
<
Pipeline
Result
ItemDto
>
getPipelines
(
JyjcInspectionApplicationModel
applicationModel
)
{
private
List
<
Pipeline
Push
ItemDto
>
getPipelines
(
JyjcInspectionApplicationModel
applicationModel
)
{
List
<
Map
<
String
,
Object
>>
pipelines
=
inspectionApplicationService
.
getPipelines
(
applicationModel
);
return
pipelines
.
stream
().
map
(
p
->
{
Pipeline
ResultItemDto
resultItemDto
=
new
PipelineResult
ItemDto
();
Pipeline
PushItemDto
resultItemDto
=
new
PipelinePush
ItemDto
();
BeanUtil
.
copyProperties
(
p
,
resultItemDto
);
resultItemDto
.
setEquipId
(
p
.
get
(
"record"
).
toString
());
return
resultItemDto
;
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/event/listener/result/BatchEquipResultDataProcessor.java
View file @
86754695
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
event
.
listener
.
result
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -9,6 +8,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.collect.Sets
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.common.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult
;
...
...
@@ -19,15 +19,20 @@ import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.BizEmqPublisher;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionResultServiceImpl
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsPipeline
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgInspectionDetectionInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsPipelineMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
@Component
...
...
@@ -52,6 +57,8 @@ public class BatchEquipResultDataProcessor implements SupportableResultDataProce
private
final
JyjcInspectionResultServiceImpl
inspectionResultService
;
private
final
IdxBizJgProjectContraptionMapper
idxBizJgProjectContraptionMapper
;
private
static
final
Set
<
String
>
SUPPORTED_TYPES
=
Sets
.
newHashSet
(
EquipmentClassifityEnum
.
YLGD
.
getCode
());
@Override
...
...
@@ -106,13 +113,32 @@ public class BatchEquipResultDataProcessor implements SupportableResultDataProce
}
catch
(
JsonProcessingException
e
)
{
throw
new
RuntimeException
(
e
);
}
// 5.
更新单据信息的json(公共)
inspectionResultService
.
updateHisDataAfterResultUpdate
(
jyjcInspectionResult
.
getApplicationNo
()
);
// 5.
新计算管道长度
calAndWriteTotalPipelineLength
(
jyjcInspectionResult
);
// 6.发送数据刷新消息
inspectionResultService
.
sendDataRefreshMsg
(
records
);
}
}
private
void
calAndWriteTotalPipelineLength
(
JyjcInspectionResult
jyjcInspectionResult
)
{
List
<
IdxBizJgTechParamsPipeline
>
allPipeLines
=
idxBizJgProjectContraptionMapper
.
selectPipelineListByProjectContraptionId
(
jyjcInspectionResult
.
getEquipUnicode
());
Double
totalPipelineLength
=
allPipeLines
.
stream
().
map
(
IdxBizJgTechParamsPipeline:
:
getPipeLength
).
filter
(
Objects:
:
nonNull
).
map
(
this
::
parseToBigDecimal
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
)
.
setScale
(
3
,
RoundingMode
.
HALF_UP
).
doubleValue
();
LambdaUpdateWrapper
<
IdxBizJgProjectContraption
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
jyjcInspectionResult
.
getEquipUnicode
());
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getPipelineLength
,
totalPipelineLength
);
idxBizJgProjectContraptionMapper
.
update
(
null
,
updateWrapper
);
}
private
BigDecimal
parseToBigDecimal
(
String
value
)
{
try
{
return
new
BigDecimal
(
value
);
}
catch
(
NumberFormatException
e
)
{
return
BigDecimal
.
ZERO
;
}
}
private
void
updateTechParams
(
Map
<
String
,
Object
>
e
,
String
record
)
{
JyjcInspectionResultServiceImpl
.
doUpdatePipelineTechParams
(
e
,
record
,
techParamPipelineMapper
);
}
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/event/listener/result/SingleEquipResultDataProcessor.java
View file @
86754695
...
...
@@ -89,8 +89,6 @@ public class SingleEquipResultDataProcessor implements SupportableResultDataProc
useInfoMapper
.
updateByRecord
(
jyjcInspectionResult
.
getEquipUnicode
(),
jyjcInspectionResult
.
getNextInspectionDate
(),
jyjcInspectionResult
.
getInspectionType
(),
jyjcInspectionResult
.
getApplicationNo
());
// 4.es更新下次检验日期
commonService
.
updateEquipNextInspectDate
(
jyjcInspectionResult
,
jyjcInspectionResult
.
getEquipUnicode
());
// 更新单据信息的json(公共)
inspectionResultService
.
updateHisDataAfterResultUpdate
(
jyjcInspectionResult
.
getApplicationNo
());
// 发送数据刷新消息
inspectionResultService
.
sendDataRefreshMsg
(
Collections
.
singleton
(
record
));
}
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionApplicationServiceImpl.java
View file @
86754695
...
...
@@ -20,10 +20,10 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ContraptionQueryParams
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.api.enums.JYJCBusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.common.api.dto.ContraptionQueryParams
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.*
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.*
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper
;
...
...
@@ -169,7 +169,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
private
JyjcInspectionHistoryServiceImpl
inspectionHistoryService
;
@Resource
private
EquipCategoryTypeHandler
typeHandler
;
private
EquipCategoryTypeHandler
typeHandler
;
@NotNull
...
...
@@ -495,7 +495,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
}
@Override
public
Page
<
JyjcInspectionApplicationModel
>
queryForPageList
(
Page
<
JyjcInspectionApplication
>
page
,
JyjcInspectionApplicationModel
model
,
String
sort
,
String
client
)
{
public
Page
<
JyjcInspectionApplicationModel
>
queryForPageList
(
Page
<
JyjcInspectionApplication
>
page
,
JyjcInspectionApplicationModel
model
,
String
sort
,
String
client
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
SortVo
sortMap
=
commonService
.
sortFieldConversion
(
sort
);
String
companyType
=
reginParams
.
getCompany
().
getCompanyType
();
...
...
@@ -519,7 +519,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
currentInspectionUnitCode
=
companyCode
;
}
String
orgCode
=
"jgLook"
.
equals
(
client
)
?
reginParams
.
getCompany
().
getOrgCode
()
:
null
;
return
this
.
getBaseMapper
().
selectForPage
(
page
,
model
,
identity
,
currentApplicationUnitCode
,
currentInspectionUnitCode
,
currentUserId
,
sortMap
,
orgCode
);
return
this
.
getBaseMapper
().
selectForPage
(
page
,
model
,
identity
,
currentApplicationUnitCode
,
currentInspectionUnitCode
,
currentUserId
,
sortMap
,
orgCode
);
}
/**
...
...
@@ -1616,7 +1616,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
return
setPieLineInfo
(
applicationModel
,
projectContraption
,
jsonObject
,
equList
);
}
p
rivate
String
calTotalLength
(
List
<
Map
<
String
,
Object
>>
equList
)
{
p
ublic
static
String
calTotalLength
(
List
<
Map
<
String
,
Object
>>
equList
)
{
double
pipeLengthSum
=
equList
.
stream
().
map
(
r
->
r
.
get
(
"pipeLength"
)).
filter
(
Objects:
:
nonNull
).
mapToDouble
(
l
->
Double
.
parseDouble
(
String
.
valueOf
(
l
))).
sum
();
BigDecimal
pipeLengthSumBig
=
new
BigDecimal
(
String
.
valueOf
(
pipeLengthSum
)).
setScale
(
3
,
RoundingMode
.
HALF_UP
);
return
pipeLengthSumBig
.
toPlainString
();
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
View file @
86754695
...
...
@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jyjc.api.common.StringUtil
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.PipelineInspectionResultDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.PipelineResultItemDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.*
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.*
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultMapper
;
...
...
@@ -37,15 +38,19 @@ import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamS
import
com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService
;
import
com.yeejoin.amos.boot.module.jyjc.api.vo.JyjcInspectionResultVo
;
import
com.yeejoin.amos.boot.module.jyjc.biz.event.InspectionDetectionSaveToDbEvent
;
import
com.yeejoin.amos.boot.module.jyjc.biz.event.listener.result.BatchEquipResultDataProcessor
;
import
com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.BizEmqPublisher
;
import
com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.EventPublisher
;
import
com.yeejoin.amos.boot.module.jyjc.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jyjc.biz.util.JsonUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsPipeline
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgInspectionDetectionInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsPipelineMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieModel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -223,7 +228,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
}
public
JyjcInspectionResultAttachment
getReportAttachment
(
Long
resultSeq
){
public
JyjcInspectionResultAttachment
getReportAttachment
(
Long
resultSeq
)
{
return
Optional
.
ofNullable
(
attachmentService
.
getOneByUniKey
(
resultSeq
,
JYJC_SUBMIT_FILE_JYBG
)).
orElse
(
new
JyjcInspectionResultAttachment
());
}
...
...
@@ -300,8 +305,6 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
JyjcInspectionResultModel
dbResultModel
=
this
.
queryBySeq
(
model
.
getSequenceNbr
());
// 更新使用信息、检验信息、技术参数
Set
<
String
>
records
=
this
.
updateTechParamAndInspectInfo
(
dbResultModel
,
jybgFile
);
// 更新单据信息的json(公共)
this
.
updateHisDataAfterResultUpdate
(
dbResultModel
.
getApplicationNo
());
sendDataRefreshMsg
(
records
);
return
dbResultModel
;
}
...
...
@@ -413,11 +416,6 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
return
String
.
format
(
"\"%s\""
,
StrUtil
.
toUnderlineCase
(
paramType
));
}
public
void
updateHisDataAfterResultUpdate
(
String
applicationNo
)
{
JyjcInspectionApplication
application
=
inspectionApplicationService
.
getOne
(
new
LambdaQueryWrapper
<
JyjcInspectionApplication
>().
eq
(
JyjcInspectionApplication:
:
getApplicationNo
,
applicationNo
));
inspectionApplicationService
.
createHisAfterReceive
(
BeanUtil
.
copyProperties
(
application
,
JyjcInspectionApplicationModel
.
class
));
}
/**
* 列表查询 示例
*/
...
...
@@ -579,17 +577,39 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
}
private
void
fillResultParamData
(
PipelineInspectionResultDto
r
,
JyjcInspectionResult
jyjcInspectionResult
,
List
<
JyjcInspectionResultParam
>
resultParams
)
{
JyjcInspectionResultParam
resultParam
=
new
JyjcInspectionResultParam
();
resultParam
.
setResultSeq
(
jyjcInspectionResult
.
getSequenceNbr
());
resultParam
.
setParamJson
(
JSON
.
toJSONString
(
r
.
getInspectionEquips
()));
resultParam
.
setRecUserId
(
RequestContext
.
getExeUserId
());
resultParam
.
setRecDate
(
new
Date
());
resultParam
.
setRemark
(
"同步数据"
);
// 将设备种类code换成技术参数枚举
resultParam
.
setParamType
(
this
.
getTypeByEquipList
(
jyjcInspectionResult
.
getEquList
()));
resultParams
.
add
(
resultParam
);
List
<
JyjcInspectionResultParam
>
paramList
=
iJyjcInspectionResultParamService
.
getParamByResultSeq
(
jyjcInspectionResult
.
getSequenceNbr
());
if
(!
paramList
.
isEmpty
())
{
JyjcInspectionResultParam
resultParam
=
paramList
.
get
(
0
);
resultParam
.
setRecUserId
(
RequestContext
.
getExeUserId
());
resultParam
.
setRecDate
(
new
Date
());
resultParam
.
setRemark
(
"同步数据"
);
String
fullParamJsonStr
=
resultParam
.
getParamJson
();
JSONObject
paramObj
=
JSON
.
parseObject
(
fullParamJsonStr
);
try
{
List
<
Map
<
String
,
Object
>>
equips
=
objectMapper
.
readValue
(
objectMapper
.
writeValueAsString
(
paramObj
.
get
(
"equip"
)),
new
TypeReference
<
ArrayList
<
Map
<
String
,
Object
>>>()
{
}
);
Map
<
String
,
PipelineResultItemDto
>
recordResultMap
=
r
.
getInspectionEquips
().
stream
().
collect
(
Collectors
.
toMap
(
PipelineResultItemDto:
:
getEquipId
,
Function
.
identity
()));
equips
.
forEach
(
e
->
{
PipelineResultItemDto
resultItemDto
=
recordResultMap
.
get
(
e
.
get
(
"record"
).
toString
());
if
(
resultItemDto
!=
null
)
{
BeanUtil
.
copyProperties
(
resultItemDto
,
e
);
}
});
// 管道长度更新为最新的
paramObj
.
put
(
"pipelineLength"
,
JyjcInspectionApplicationServiceImpl
.
calTotalLength
(
equips
));
paramObj
.
put
(
"equip"
,
equips
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
resultParam
.
setParamJson
(
paramObj
.
toJSONString
());
resultParams
.
add
(
resultParam
);
}
}
private
String
getTypeByEquipList
(
String
equList
)
{
EquipCategoryEnum
categoryEnum
=
EquipCategoryEnum
.
of
(
Integer
.
parseInt
(
equList
));
assert
categoryEnum
!=
null
;
...
...
@@ -941,6 +961,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
return
Boolean
.
TRUE
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
PipelineInspectionResultDto
>
receivePipelineResultData
(
List
<
PipelineInspectionResultDto
>
resultData
)
{
log
.
info
(
"收到检验检测厂商推送的压力管道结果数据:{}"
,
JSONArray
.
toJSONString
(
resultData
));
// 1.数据合法性检查
...
...
@@ -975,6 +996,20 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
}
private
void
checkMustFieldIsValid2
(
List
<
PipelineInspectionResultDto
>
resultData
)
{
int
i
=
0
;
for
(
PipelineInspectionResultDto
resultDataModel
:
resultData
)
{
i
++;
if
(
StringUtils
.
isEmpty
(
resultDataModel
.
getApplicationNo
()))
{
throw
new
BadRequest
(
"第"
+
i
+
"条数据存在问题,applicationNo不能为空!"
);
}
if
(
resultDataModel
.
getInspectionEquips
()
==
null
||
resultDataModel
.
getInspectionEquips
().
isEmpty
())
{
throw
new
BadRequest
(
"第"
+
i
+
"条数据存在问题,inspectionEquips不能为空!"
);
}
boolean
isExistEmptyEquipId
=
resultDataModel
.
getInspectionEquips
().
stream
().
anyMatch
(
e
->
StringUtils
.
isEmpty
(
e
.
getEquipId
()));
if
(
isExistEmptyEquipId
)
{
throw
new
BadRequest
(
"第"
+
i
+
"条数据存在问题,inspectionEquips中存在缺少equip的数据!"
);
}
}
}
public
static
void
doUpdatePipelineTechParams
(
Map
<
String
,
Object
>
e
,
String
record
,
IdxBizJgTechParamsPipelineMapper
techParamPipelineMapper
)
{
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/IdxBizJgProjectContraptionMapper.java
View file @
86754695
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.module.common.api.dto.ContraptionQueryParams
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.ProjectWaitRefreshDataQualityScore
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsPipeline
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -112,4 +113,6 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
List
<
Map
<
String
,
Object
>>
selectPipelineList
(
@Param
(
"equIds"
)
List
<
String
>
equIds
);
void
updateDataQualityScoreBatch
(
@Param
(
"projectContraptions"
)
List
<
ProjectWaitRefreshDataQualityScore
>
projectContraptions
);
List
<
IdxBizJgTechParamsPipeline
>
selectPipelineListByProjectContraptionId
(
@Param
(
"projectContraptionId"
)
String
projectContraptionId
);
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/IdxBizJgProjectContraptionMapper.xml
View file @
86754695
...
...
@@ -624,6 +624,17 @@
GROUP BY a.project_contraption_id
) GROUP BY project_contraption_id
</select>
<select
id=
"selectPipelineListByProjectContraptionId"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsPipeline"
>
SELECT
ui."record",
pp."pipe_length"
FROM
idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD"
WHERE
ui.PROJECT_CONTRAPTION_ID = #{projectContraptionId}
</select>
<update
id=
"updateDataQualityScoreBatch"
>
<foreach
collection=
"projectContraptions"
separator=
";"
item=
"projectContraption"
open=
""
close=
""
>
UPDATE idx_biz_jg_project_contraption SET data_quality_score = #{projectContraption.dataQualityScore} WHERE sequence_nbr = #{projectContraption.projectContraptionId}
...
...
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