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
5955715d
Commit
5955715d
authored
Dec 11, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):1,安装告知压力管道刷入调整后新结构的数据;
2,查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备接口
parent
7514da46
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
183 additions
and
54 deletions
+183
-54
JgInstallationNoticeMapper.java
...boot/module/jg/api/mapper/JgInstallationNoticeMapper.java
+4
-0
IJgInstallationNoticeService.java
...t/module/jg/api/service/IJgInstallationNoticeService.java
+2
-0
JgInstallationNoticeMapper.xml
.../src/main/resources/mapper/JgInstallationNoticeMapper.xml
+103
-0
JgInstallationNoticeController.java
...ule/jg/biz/controller/JgInstallationNoticeController.java
+8
-0
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+63
-52
EquipTechParamPipeline.java
...os/boot/module/ymt/api/entity/EquipTechParamPipeline.java
+3
-2
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/mapper/JgInstallationNoticeMapper.java
View file @
5955715d
...
...
@@ -44,4 +44,8 @@ public interface JgInstallationNoticeMapper extends CustomBaseMapper<JgInstallat
List
<
CompanyEquipCountDto
>
queryForFlowingEquipList
();
List
<
InstallationVo
>
queryInstallationInIds
(
@Param
(
"ids"
)
List
<
String
>
ids
);
List
<
Map
<
String
,
Object
>>
getDeviceListByProjectContraption
(
@Param
(
"projectContraption"
)
String
projectContraption
);
Map
<
String
,
Object
>
getPipelineEquInfoByRecord
(
@Param
(
"record"
)
String
record
);
}
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 @
5955715d
...
...
@@ -86,4 +86,6 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot
JgInstallationNotice
cancelApplication
(
Long
sequenceNbr
,
String
cancelReason
);
Boolean
historyDataRepair
();
Object
getDeviceListByProjectContraption
(
String
projectContraption
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgInstallationNoticeMapper.xml
View file @
5955715d
...
...
@@ -200,4 +200,107 @@
isn.create_date DESC, isn.apply_no DESC
</select>
<sql
id=
"page-list-pipeline"
>
SELECT ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
to_char(ui."USE_DATE", 'YYYY-MM') useDate,
(SELECT DESIGN_UNIT_NAME from idx_biz_jg_design_info where "RECORD" = ui."RECORD") designUnitName,
(SELECT USC_UNIT_NAME
from idx_biz_jg_construction_info
where "RECORD" = ui."RECORD"
ORDER BY USC_DATE DESC
limit 1) uscUnitName,
to_char((SELECT USC_DATE
from idx_biz_jg_construction_info
where "RECORD" = ui."RECORD"
ORDER BY USC_DATE DESC
limit 1), 'YYYY-MM') uscDate,
ui."RECORD" record,
ri."EQU_CODE" equCode,
ri."EQU_LIST" equList,
(select name from tz_equipment_category where code = ri."EQU_LIST") equListName,
ri."EQU_CATEGORY" equCategory,
(select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName,
ri."EQU_DEFINE" equDefine,
(select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName,
ri."PRODUCT_NAME" productName,
ri."BRAND_NAME" brandName,
ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
pp."DEVICE_NAME" deviceName,
(select name from cb_data_dictionary where code = pp."DEVICE_LEVEL" and type = 'GBI') deviceLevel,
pp."PIPE_NAME" pipeName,
pp."PIPELINE_NUMBER" pipelineNumber,
pp."NOMINAL_DIAMETER" nominalDiameter,
pp."WALL_THICKNESS" wallThickness,
pp."PIPE_LENGTH" pipeLength,
pp."PRESSURE" pressure,
pp."TEMPERATURE" temperature,
pp."MEDIUM" medium,
pp."REMARKS" remarks,
(select INSPECT_ORG_NAME
from idx_biz_jg_inspection_detection_info
where "RECORD" = ui."RECORD"
ORDER BY REC_DATE DESC
limit 1) inspectOrgName,
(select name
from cb_data_dictionary
where type = 'JYJL'
and code = (select INSPECT_CONCLUSION
from idx_biz_jg_inspection_detection_info
where "RECORD" = ui."RECORD"
ORDER BY REC_DATE DESC
limit 1)) inspectConclusion,
to_char((select NEXT_INSPECT_DATE
from idx_biz_jg_inspection_detection_info
where "RECORD" = ui."RECORD"
ORDER BY REC_DATE DESC
limit 1), 'YYYY-MM-DD') nextInspectDate
FROM idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD"
LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD"
</sql>
<select
id=
"getDeviceListByProjectContraption"
resultType=
"java.util.Map"
>
<include
refid=
"page-list-pipeline"
/>
<where>
ri."EQU_CATEGORY" = '8300'
and ui."DATA_SOURCE" like 'jg%' and ui."DATA_SOURCE" not like 'jg_his%'
<if
test=
"projectContraption != null and projectContraption != ''"
>
and ui."PROJECT_CONTRAPTION" = #{projectContraption}
</if>
-- 排除 已经做过安装告知的
AND NOT EXISTS (
SELECT 1
FROM
tzs_jg_installation_notice n,
tzs_jg_installation_notice_eq ne
WHERE
n.sequence_nbr = ne.equip_transfer_id
AND ne.equ_id = ui."RECORD"
AND (
n.notice_status = '6621'
OR n.notice_status = '6612'
OR n.notice_status = '6614'
OR n.notice_status = '6615'
OR n.notice_status = '6616'
OR n.notice_status = '6618'
)
AND n.is_delete = 0
)
</where>
</select>
<select
id=
"getPipelineEquInfoByRecord"
resultType=
"java.util.Map"
>
<include
refid=
"page-list-pipeline"
/>
<where>
<if
test=
"record != null and record != ''"
>
and ui."RECORD" = #{record}
</if>
</where>
</select>
</mapper>
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 @
5955715d
...
...
@@ -169,4 +169,12 @@ public class JgInstallationNoticeController extends BaseController {
public
ResponseModel
<
Boolean
>
historyDataRepair
()
{
return
ResponseHelper
.
buildResponse
(
iJgInstallationNoticeService
.
historyDataRepair
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备"
,
notes
=
"查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备"
)
@GetMapping
(
value
=
"/getDeviceListByProjectContraption"
)
public
ResponseModel
<
Object
>
getDeviceListByProjectContraption
(
@RequestParam
(
"projectContraption"
)
String
projectContraption
)
{
return
ResponseHelper
.
buildResponse
(
iJgInstallationNoticeService
.
getDeviceListByProjectContraption
(
projectContraption
));
}
}
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 @
5955715d
...
...
@@ -7,8 +7,9 @@ import com.alibaba.fastjson.JSONObject;
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.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
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
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
...
...
@@ -19,6 +20,7 @@ import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
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.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
...
...
@@ -28,7 +30,6 @@ import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.InstallationVo
;
...
...
@@ -51,7 +52,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquCodeTypeEnum;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
...
...
@@ -69,7 +69,6 @@ import org.redisson.api.RedissonClient;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -178,7 +177,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private
JgRegistrationHistoryServiceImpl
jgRegistrationHistoryService
;
@Autowired
private
EquipTechParamPipelineMapper
equipTechParamPipeline
Mapper
;
private
ObjectMapper
object
Mapper
;
@Autowired
EventPublisher
eventPublisher
;
...
...
@@ -1708,60 +1707,72 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
useInfoService
.
update
(
updateWrapper
);
}
@Transactional
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
historyDataRepair
()
{
List
<
JgInstallationNotice
>
list
=
this
.
lambdaQuery
().
list
();
ArrayList
<
JgInstallationNoticeEq
>
jgInstallationNoticeEqs
=
new
ArrayList
<>();
ArrayList
<
JgRegistrationHistory
>
jgRegistrationHistories
=
new
ArrayList
<>();
list
.
forEach
(
item
->
{
// 设备信息
List
<
JgInstallationNoticeEq
>
equList
=
jgInstallationNoticeEqService
.
lambdaQuery
().
eq
(
JgInstallationNoticeEq:
:
getEquipTransferId
,
item
.
getSequenceNbr
()).
list
();
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
lambdaQuery
()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
item
.
getSequenceNbr
())
.
eq
(
JgRegistrationHistory:
:
getIsDelete
,
false
)
.
one
();
if
(!
ObjectUtils
.
isEmpty
(
jgRegistrationHistory
)
&&
!
ObjectUtils
.
isEmpty
(
jgRegistrationHistory
.
getChangeData
()))
{
List
<
String
>
ids
=
equList
.
stream
().
map
(
JgInstallationNoticeEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
Iterable
<
ESEquipmentCategoryDto
>
equips
=
esEquipmentCategory
.
findAllById
(
ids
);
List
<
Map
<
String
,
Object
>>
equipListMaps
=
getEquipListMaps
(
equips
);
JSONObject
object
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
object
.
put
(
"deviceList"
,
equipListMaps
);
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
object
));
jgRegistrationHistories
.
add
(
jgRegistrationHistory
);
}
equList
.
forEach
(
equ
->
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getInformNumber
()))
{
equ
.
setInformNumber
(
item
.
getInformNumber
());
}
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoService
.
lambdaQuery
().
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
equ
.
getEquId
()).
one
();
if
(!
ObjectUtils
.
isEmpty
(
registerInfo
)
&&
!
ObjectUtils
.
isEmpty
(
registerInfo
.
getEquList
())
&&
!
ObjectUtils
.
isEmpty
(
registerInfo
.
getEquCategory
()))
{
equ
.
setEquListCode
(
registerInfo
.
getEquList
());
equ
.
setEquCategoryCode
(
registerInfo
.
getEquCategory
());
if
(
ObjectUtils
.
isEmpty
(
item
.
getEquListCode
())
||
ObjectUtils
.
isEmpty
(
item
.
getEquCategoryCode
()))
{
item
.
setEquListCode
(
registerInfo
.
getEquList
());
item
.
setEquCategoryCode
(
registerInfo
.
getEquCategory
());
if
(
"8300"
.
equals
(
item
.
getEquCategoryCode
()))
{
LambdaQueryWrapper
<
EquipTechParamPipeline
>
lambda
=
new
QueryWrapper
<
EquipTechParamPipeline
>().
lambda
();
lambda
.
eq
(
EquipTechParamPipeline:
:
getRecord
,
equ
.
getEquId
());
EquipTechParamPipeline
equipTechParamPipeline
=
equipTechParamPipelineMapper
.
selectOne
(
lambda
);
if
(!
ObjectUtils
.
isEmpty
(
equipTechParamPipeline
)
&&
!
ObjectUtils
.
isEmpty
(
equipTechParamPipeline
.
getDeviceName
()))
{
item
.
setProjectContraption
(
equipTechParamPipeline
.
getDeviceName
());
}
}
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
());
}
}
jgInstallationNoticeEqs
.
add
(
equ
);
});
});
// 修改历史表数据
return
history
;
})
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
// 批量更新历史表数据
jgRegistrationHistoryService
.
updateBatchById
(
jgRegistrationHistories
);
this
.
updateBatchById
(
list
);
jgInstallationNoticeEqService
.
updateBatchById
(
jgInstallationNoticeEqs
);
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
)
);
}
/**
* 查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备
*
* @param projectContraption 工程装置名称
* @return 设备列表
*/
@Override
public
Object
getDeviceListByProjectContraption
(
String
projectContraption
)
{
List
<
Map
<
String
,
Object
>>
deviceList
=
this
.
baseMapper
.
getDeviceListByProjectContraption
(
projectContraption
);
return
new
JSONObject
().
fluentPut
(
"deviceList"
,
deviceList
);
}
@Override
public
boolean
beforeCheck
(
JgInstallationNotice
notice
)
{
return
notice
.
getInstanceId
()
!=
null
&&
!
notice
.
getNoticeStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()))
&&!
notice
.
getNoticeStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_DISCARD
.
getCode
()));
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/EquipTechParamPipeline.java
View file @
5955715d
...
...
@@ -34,10 +34,11 @@ public class EquipTechParamPipeline extends AbstractEquipBaseEntity {
@TableField
(
value
=
"\"STATUS\""
)
private
String
status
;
/**
* * 工程(装置)名称
* * 工程(装置)名称
--废弃,以use_info表为准
*/
@Deprecated
@TableField
(
value
=
"\"DEVICE_NAME\""
)
private
String
deviceName
;
/**
...
...
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