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
99b1a2d5
Commit
99b1a2d5
authored
Mar 10, 2025
by
韩桐桐
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/develop_tzs_register_test' into develop_tzs_register
parents
1603d4f0
76714de6
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
39 deletions
+79
-39
JgReformNoticeDto.java
...eejoin/amos/boot/module/jg/api/dto/JgReformNoticeDto.java
+0
-3
IdxBizJgProjectContraptionController.java
.../biz/controller/IdxBizJgProjectContraptionController.java
+4
-1
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+1
-1
JgReformNoticeServiceImpl.java
...module/jg/biz/service/impl/JgReformNoticeServiceImpl.java
+73
-33
MonthCylinderBusinessStatisticsJob.java
...statistcs/biz/job/MonthCylinderBusinessStatisticsJob.java
+1
-1
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/dto/JgReformNoticeDto.java
View file @
99b1a2d5
...
...
@@ -181,9 +181,6 @@ public class JgReformNoticeDto extends BaseDto {
@ApiModelProperty
(
value
=
"告知设备列表"
)
private
List
<
Map
<
String
,
Object
>>
deviceList
;
@ApiModelProperty
(
value
=
"管道列表"
)
private
List
<
Map
<
String
,
Object
>>
pipelineList
;
@ApiModelProperty
(
value
=
"删除的管道列表"
)
private
List
<
Map
<
String
,
Object
>>
delPipelineList
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/IdxBizJgProjectContraptionController.java
View file @
99b1a2d5
...
...
@@ -140,7 +140,10 @@ public class IdxBizJgProjectContraptionController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个管道工程装置表"
,
notes
=
"根据sequenceNbr查询单个管道工程装置表"
)
// 传record的原因是前端组件内部写死了,此处是工程装置表seq
public
ResponseModel
<
Object
>
detailsNotFormId
(
@RequestParam
(
"record"
)
String
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
idxBizJgProjectContraptionServiceImpl
.
details
(
sequenceNbr
).
get
(
EQUIP_INFO_FORM_ID
));
Map
<
String
,
Object
>
objectMap
=
idxBizJgProjectContraptionServiceImpl
.
details
(
sequenceNbr
).
get
(
EQUIP_INFO_FORM_ID
);
Object
pipelineListObj
=
objectMap
.
remove
(
"pipelineList"
);
objectMap
.
put
(
"deviceList"
,
pipelineListObj
);
return
ResponseHelper
.
buildResponse
(
objectMap
);
}
/**
...
...
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 @
99b1a2d5
...
...
@@ -814,7 +814,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
List
<
Object
>
factoryNumList
=
deviceList
.
stream
().
limit
(
3
).
map
(
item
->
item
.
get
(
"pipelineNumber"
)).
collect
(
Collectors
.
toList
());
placeholders
.
put
(
"equipTypeList"
,
equipTypeList
);
placeholders
.
put
(
"produceCodeList"
,
factoryNumList
);
placeholders
.
put
(
"productName"
,
historyJson
.
get
(
"projectContraption"
));
placeholders
.
put
(
"productName"
,
Optional
.
ofNullable
(
historyJson
.
get
(
"projectContraption"
)).
orElse
(
historyJson
.
get
(
"PROJECT_CONTRAPTION"
)
));
}
else
{
placeholders
.
put
(
"equipType"
,
getValue
.
apply
(
"equType"
));
placeholders
.
put
(
"produceCode"
,
getValue
.
apply
(
"factoryNum"
));
...
...
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/JgReformNoticeServiceImpl.java
View file @
99b1a2d5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
...
...
@@ -89,7 +91,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"renovationNoticeNew"
;
private
static
final
String
TABLE_PAGE_ID
=
"reformNoticeAdd"
;
public
static
final
String
PIPELINE_LIST
=
"pipelin
eList"
;
public
static
final
String
DEVICE_LIST
=
"devic
eList"
;
public
static
final
String
PIPE_LENGTH
=
"pipeLength"
;
public
static
final
String
RECORD
=
"record"
;
public
static
final
String
SEQUENCE_NBR
=
"SEQUENCE_NBR"
;
...
...
@@ -101,7 +103,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
public
static
final
String
PRODUCT_PHOTO
=
"PRODUCT_PHOTO"
;
public
static
final
String
PRODUCT_QUALIFICATION_CERTIFICATE
=
"PRODUCT_QUALIFICATION_CERTIFICATE"
;
public
static
final
String
OTHER_ACCESSORIES
=
"OTHER_ACCESSORIES"
;
public
static
final
String
DEL_
PIPELINE_LIST
=
"delPipelin
eList"
;
public
static
final
String
DEL_
DEVICE_LIST
=
"delDevic
eList"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"6610"
,
"6614"
,
"6615"
,
"6617"
,
"6616"
);
// 西安行政区划code
private
static
final
String
XIAN
=
"610100"
;
...
...
@@ -176,7 +178,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
List
<
String
>
ids
=
noticeEqs
.
stream
().
map
(
JgReformNoticeEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
Iterable
<
ESEquipmentCategoryDto
>
equips
=
esEquipmentCategory
.
findAllById
(
ids
);
List
<
Map
<
String
,
Object
>>
equipListMaps
=
getEquipListMaps
(
equips
);
reformNoticeMap
.
put
(
"deviceList"
,
equipListMaps
);
reformNoticeMap
.
put
(
DEVICE_LIST
,
equipListMaps
);
reformNoticeMap
.
put
(
"EQU_LIST_CODE"
,
notice
.
getEquListCode
());
reformNoticeMap
.
put
(
"EQU_CATEGORY_CODE"
,
notice
.
getEquCategoryCode
());
reformNoticeMap
.
put
(
"QUERY_TYPE"
,
"GZ_GZ"
);
...
...
@@ -222,8 +224,10 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 字段转换
this
.
convertField
(
noticeDto
);
JgReformNotice
notice
=
this
.
getById
(
noticeDto
.
getSequenceNbr
());
List
<
Map
<
String
,
Object
>>
deviceList
=
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
notice
.
getEquListCode
())
?
noticeDto
.
getDeviceList
()
:
noticeDto
.
getPipelineList
();
List
<
String
>
records
=
deviceList
.
stream
().
map
(
equ
->
String
.
valueOf
(
equ
.
get
(
RECORD
))).
collect
(
Collectors
.
toList
());
// 业务单据中的设备主键 管道的为record 其他设备为SEQUENCE_NBR
String
equSeq
=
!
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
notice
.
getEquListCode
())
?
SEQUENCE_NBR
:
RECORD
;
List
<
Map
<
String
,
Object
>>
deviceList
=
noticeDto
.
getDeviceList
();
List
<
String
>
records
=
deviceList
.
stream
().
filter
(
item
->
!
Objects
.
isNull
(
item
.
get
(
RECORD
))).
map
(
equ
->
String
.
valueOf
(
equ
.
get
(
RECORD
))).
collect
(
Collectors
.
toList
());
this
.
checkRepeatUsed
(
submitType
,
records
,
notice
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
// 发起流程
...
...
@@ -255,8 +259,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 压力管道情况处理
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
notice
.
getEquListCode
()))
{
oldPipJsonData
=
this
.
getNowPipJsonData
(
noticeDto
.
getProjectContraptionId
());
notice
.
setPipeLengthChanged
(
this
.
calculatePipeLengthChange
(
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
oldPipJsonData
.
get
(
PIPELIN
E_LIST
))),
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
noticeDto
.
get
Pipelin
eList
()))));
notice
.
setPipeLengthChanged
(
this
.
calculatePipeLengthChange
(
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
oldPipJsonData
.
get
(
DEVIC
E_LIST
))),
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
noticeDto
.
get
Devic
eList
()))));
}
jgReformNoticeMapper
.
updateById
(
notice
);
// 删除暂存
...
...
@@ -291,11 +295,17 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
notice
.
setNextTaskId
(
workflowResultDto
.
getNextTaskId
());
notice
.
setNextExecuteUserIds
(
workflowResultDto
.
getNextExecutorUserIds
());
notice
.
setCreateDate
(
new
Date
());
updateById
(
notice
);
// 上个代办改为已办
TaskV2Model
taskV2Model
=
this
.
updateLastTodo
(
notice
,
FlowStatusEnum
.
TO_BE_PROCESSED
);
// 创建新的代办
this
.
createNewTodo
(
notice
,
workflowResultDto
,
taskV2Model
,
FlowStatusEnum
.
TO_BE_PROCESSED
);
// 压力管道情况处理
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
notice
.
getEquListCode
()))
{
oldPipJsonData
=
this
.
getNowPipJsonData
(
noticeDto
.
getProjectContraptionId
());
notice
.
setPipeLengthChanged
(
this
.
calculatePipeLengthChange
(
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
oldPipJsonData
.
get
(
DEVICE_LIST
))),
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
noticeDto
.
getDeviceList
()))));
}
this
.
updateById
(
notice
);
}
commonService
.
saveExecuteFlowData2Redis
(
notice
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
notice
));
}
else
{
...
...
@@ -309,9 +319,10 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// eq关系表
List
<
JgReformNoticeEq
>
noticeEqs
=
new
ArrayList
<>();
// 更新设备关系表
deviceList
.
forEach
(
obj
->
{
deviceList
.
stream
().
filter
(
obj
->
!
Objects
.
isNull
(
obj
.
get
(
equSeq
)))
.
forEach
(
obj
->
{
JgReformNoticeEq
jgRelationEquip
=
new
JgReformNoticeEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
SEQUENCE_NBR
)));
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
equSeq
)));
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
notice
.
getSequenceNbr
()));
noticeEqs
.
add
(
jgRelationEquip
);
});
...
...
@@ -352,8 +363,10 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
String
noticeStatusDesc
=
FlowStatusEnum
.
getNameByType
(
Long
.
valueOf
((
String
)
notice
.
get
(
"noticeStatus"
)));
notice
.
put
(
"noticeStatusDesc"
,
noticeStatusDesc
);
});
// 添加作废标识:不在流程中即可作废
// 压力管道添加作废标识:不在流程中即可作废
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
notice
.
get
(
"equListCode"
))
&&
!
ValidationUtil
.
isEmpty
(
notice
.
get
(
"projectContraptionId"
)))
{
notice
.
put
(
"canVoided"
,
idxBizJgProjectContraptionMapper
.
countContraptionInUseTimesForDeleteByIntoManagement
(
Long
.
parseLong
(
String
.
valueOf
(
notice
.
get
(
"projectContraptionId"
))))
==
0
);
}
}).
collect
(
Collectors
.
toList
());
noticePage
.
setRecords
(
mappedRecords
);
...
...
@@ -416,8 +429,16 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
String
tempFileName
=
"改造告知单_"
+
System
.
currentTimeMillis
()
+
"_temp"
;
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
ArrayList
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
// 管道按照装置打一份告知书
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
notice
.
getEquListCode
())
&&
!
noticeEqs
.
isEmpty
())
{
Map
<
String
,
Object
>
information
=
jgReformNoticeMapper
.
queryEquipInformation
(
noticeEqs
.
get
(
0
).
getSequenceNbr
());
if
(
CollectionUtils
.
isEmpty
(
information
))
{
throw
new
IllegalArgumentException
(
"改造告知单不存在"
);
}
Map
<
String
,
Object
>
stringObjectMap
=
jgInstallationNoticeService
.
fullFillTemplateObj
(
Collections
.
singletonList
(
information
),
BusinessTypeEnum
.
JG_MODIFICATION_NOTIFICATION
.
getName
().
substring
(
0
,
2
));
maps
.
add
(
stringObjectMap
);
}
else
{
for
(
JgReformNoticeEq
noticeEq
:
noticeEqs
)
{
Map
<
String
,
Object
>
information
=
jgReformNoticeMapper
.
queryEquipInformation
(
noticeEq
.
getSequenceNbr
());
if
(
CollectionUtils
.
isEmpty
(
information
))
{
throw
new
IllegalArgumentException
(
"改造告知单不存在"
);
...
...
@@ -425,6 +446,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
Map
<
String
,
Object
>
stringObjectMap
=
jgInstallationNoticeService
.
fullFillTemplateObj
(
Collections
.
singletonList
(
information
),
BusinessTypeEnum
.
JG_MODIFICATION_NOTIFICATION
.
getName
().
substring
(
0
,
2
));
maps
.
add
(
stringObjectMap
);
}
}
data
.
put
(
"equipBasicInfoList"
,
maps
);
WordTemplateUtils
.
templateToPdfDownload
(
tempFileName
,
"installation-notification-report.ftl"
,
data
,
response
);
}
...
...
@@ -445,7 +467,9 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
JSONObject
oldPipJsonData
=
new
JSONObject
();
List
<
JgReformNoticeEq
>
noticeEqs
=
new
ArrayList
<>();
// 获取告知设备列表
List
<
Map
<
String
,
Object
>>
deviceList
=
!
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equListCode
)
?
model
.
getDeviceList
()
:
model
.
getPipelineList
();
List
<
Map
<
String
,
Object
>>
deviceList
=
model
.
getDeviceList
();
// 业务单据中的设备主键 管道的为record 其他设备为SEQUENCE_NBR
String
equSeq
=
!
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equListCode
)
?
SEQUENCE_NBR
:
RECORD
;
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"请选择设备!"
);
}
...
...
@@ -511,8 +535,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 压力管道情况处理
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equListCode
))
{
oldPipJsonData
=
this
.
getNowPipJsonData
(
String
.
valueOf
(
jsonObject
.
get
(
PROJECT_CONTRAPTION_ID
)));
notice
.
setPipeLengthChanged
(
this
.
calculatePipeLengthChange
(
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
oldPipJsonData
.
get
(
PIPELIN
E_LIST
))),
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
jsonObject
.
get
(
PIPELIN
E_LIST
)))));
notice
.
setPipeLengthChanged
(
this
.
calculatePipeLengthChange
(
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
oldPipJsonData
.
get
(
DEVIC
E_LIST
))),
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
jsonObject
.
get
(
DEVIC
E_LIST
)))));
}
this
.
saveOrUpdateHisData
(
String
.
valueOf
(
sequenceNbr
),
jsonObject
,
oldPipJsonData
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
...
...
@@ -523,9 +547,9 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 插入业务单
jgReformNoticeMapper
.
insert
(
notice
);
// 更新设备关系表
deviceList
.
stream
().
filter
(
obj
->
!
Objects
.
isNull
(
obj
.
get
(
RECORD
)))
deviceList
.
stream
().
filter
(
obj
->
!
Objects
.
isNull
(
obj
.
get
(
equSeq
)))
.
map
(
obj
->
new
JgReformNoticeEq
()
.
setEquId
(
obj
.
get
(
RECORD
).
toString
())
.
setEquId
(
obj
.
get
(
equSeq
).
toString
())
.
setEquipTransferId
(
String
.
valueOf
(
sequenceNbr
)))
.
forEach
(
noticeEqs:
:
add
);
jgReformNoticeEqMapper
.
insertBatchSomeColumn
(
noticeEqs
);
...
...
@@ -562,22 +586,20 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
return
new
JSONObject
(
Optional
.
ofNullable
(
idxBizJgProjectContraptionMapper
.
getDetail
(
projectContraptionId
))
.
map
(
map
->
{
commonService
.
convertStringToJsonobject
(
map
,
IdxBizJgProjectContraptionServiceImpl
.
jsonFields
);
map
.
put
(
PIPELIN
E_LIST
,
idxBizJgProjectContraptionMapper
.
selectEquipList
((
String
)
map
.
get
(
SEQUENCE_NBR
)));
map
.
put
(
DEVIC
E_LIST
,
idxBizJgProjectContraptionMapper
.
selectEquipList
((
String
)
map
.
get
(
SEQUENCE_NBR
)));
return
map
;
})
.
orElse
(
Collections
.
emptyMap
()));
}
private
void
repeatUsedEquipCheck
(
List
<
Map
<
String
,
Object
>>
equipList
,
String
companyCode
)
{
equipList
.
forEach
(
equipMap
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
equipMap
.
get
(
RECORD
)),
companyCode
));
equipList
.
stream
().
filter
(
item
->
!
Objects
.
isNull
(
item
.
get
(
RECORD
))).
forEach
(
equipMap
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
).
equipRepeatUsedCheck
(
String
.
valueOf
(
equipMap
.
get
(
RECORD
)),
companyCode
));
}
private
void
checkRepeatUsed
(
String
submitType
,
List
<
String
>
records
,
JgReformNotice
jgReformNotice
)
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
// 流程中校验
records
.
forEach
(
record
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
records
.
stream
().
filter
(
item
->
!
Objects
.
isNull
(
item
)).
forEach
(
record
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
record
,
jgReformNotice
.
getInstallUnitCreditCode
()));
}
}
...
...
@@ -828,7 +850,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
* @param dto 改造信息
* @param op 通过或驳回
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@
Global
Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
accept
(
Map
<
String
,
Object
>
map
,
String
op
)
{
LinkedHashMap
model1
=
(
LinkedHashMap
)
map
.
get
(
"model"
);
String
opinion
=
(
String
)
map
.
get
(
"opinion"
);
...
...
@@ -893,8 +915,6 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
noticeEq
.
setInformNumber
(
deviceRegistrationCode
);
jgReformNoticeEqMapper
.
updateById
(
noticeEq
);
});
// 通过时记录或更新历史数据
this
.
saveOrUpdateHisData
(
String
.
valueOf
(
jgReformNotice
.
getSequenceNbr
()),
jsonObject
,
null
);
jgReformNotice
.
setAcceptDate
(
new
Date
());
jgReformNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
jgReformNotice
.
setPromoter
(
""
);
...
...
@@ -954,10 +974,10 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 1.更新工程装置数据
JgRegistrationHistory
registrationHistory
=
jgRegistrationHistoryMapper
.
selectOne
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>().
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
notice
.
getSequenceNbr
()));
JSONObject
newData
=
JSONObject
.
parseObject
(
registrationHistory
.
getChangeData
());
JSONArray
newPipData
=
JSONArray
.
parseArray
(
newData
.
getString
(
PIPELIN
E_LIST
));
JSONArray
delPipData
=
JSONArray
.
parseArray
(
newData
.
getString
(
DEL_
PIPELIN
E_LIST
));
JSONArray
newPipData
=
JSONArray
.
parseArray
(
newData
.
getString
(
DEVIC
E_LIST
));
JSONArray
delPipData
=
JSONArray
.
parseArray
(
newData
.
getString
(
DEL_
DEVIC
E_LIST
));
JSONObject
oldData
=
JSONObject
.
parseObject
(
registrationHistory
.
getOldData
());
JSONArray
oldPipData
=
JSONArray
.
parseArray
(
oldData
.
getString
(
PIPELIN
E_LIST
));
JSONArray
oldPipData
=
JSONArray
.
parseArray
(
oldData
.
getString
(
DEVIC
E_LIST
));
// 1.1更新工程装置中的【管道信息】增加减少或修改管道信息
List
<
JSONObject
>
toUpdatePipData
=
newPipData
.
stream
().
filter
(
item
->
!
StringUtils
.
isEmpty
(
JSON
.
parseObject
(
item
.
toString
()).
getString
(
RECORD
))).
map
(
item
->
JSON
.
parseObject
(
item
.
toString
())).
collect
(
Collectors
.
toList
());
List
<
JSONObject
>
toAddPipData
=
newPipData
.
stream
().
filter
(
item
->
StringUtils
.
isEmpty
(
JSON
.
parseObject
(
item
.
toString
()).
getString
(
RECORD
))).
map
(
item
->
JSON
.
parseObject
(
item
.
toString
())).
collect
(
Collectors
.
toList
());
...
...
@@ -1046,13 +1066,19 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfoList
=
new
ArrayList
<>(
15
);
List
<
IdxBizJgTechParamsPipeline
>
paramsPipelineList
=
new
ArrayList
<>(
15
);
List
<
ESEquipmentCategoryDto
>
esEquipmentCategoryList
=
new
ArrayList
<>(
15
);
// eq关系表
List
<
JgReformNoticeEq
>
noticeEqs
=
new
ArrayList
<>(
15
);
// 设备信息
toAddPipData
.
forEach
(
pipData
->
{
String
record
=
UUID
.
randomUUID
().
toString
();
Date
date
=
new
Date
();
// eq表
JgReformNoticeEq
jgRelationEquip
=
new
JgReformNoticeEq
();
jgRelationEquip
.
setEquId
(
record
);
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
notice
.
getSequenceNbr
()));
noticeEqs
.
add
(
jgRelationEquip
);
// 使用信息
IdxBizJgUseInfo
useInfo
=
JSON
.
parseObject
(
toJSONString
(
pipData
),
IdxBizJgUseInfo
.
class
);
// 使用信息
useInfo
.
setRecord
(
record
);
useInfo
.
setSequenceNbr
(
null
);
useInfo
.
setRecDate
(
date
);
...
...
@@ -1119,6 +1145,14 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
otherInfo
.
setInformationManageCode
(
""
);
otherInfoList
.
add
(
otherInfo
);
// 检验检测
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
JSON
.
parseObject
(
toJSONString
(
pipData
),
IdxBizJgInspectionDetectionInfo
.
class
);
inspectionDetectionInfo
.
setRecord
(
record
);
inspectionDetectionInfo
.
setRecDate
(
date
);
Optional
.
ofNullable
(
inspectionDetectionInfo
.
getNextInspectDate
()).
ifPresent
(
x
->
inspectionDetectionInfo
.
setNextInspectDate
(
DateUtil
.
parse
(
DateUtil
.
format
(
inspectionDetectionInfo
.
getNextInspectDate
(),
DatePattern
.
NORM_DATE_PATTERN
))));
inspectionDetectionInfo
.
setSequenceNbr
(
null
);
idxBizJgInspectionDetectionInfoService
.
saveOrUpdateData
(
inspectionDetectionInfo
);
// 管道技术参数
IdxBizJgTechParamsPipeline
pipelineInfo
=
JSON
.
parseObject
(
toJSONString
(
pipData
),
IdxBizJgTechParamsPipeline
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
pipelineInfo
))
{
...
...
@@ -1160,12 +1194,12 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
idxBizJgInspectionDetectionInfoService
.
saveBatch
(
inspectionDetectionInfoList
);
iIdxBizJgTechParamsPipelineService
.
saveBatch
(
paramsPipelineList
);
esEquipmentCategory
.
saveAll
(
esEquipmentCategoryList
);
jgReformNoticeEqMapper
.
insertBatchSomeColumn
(
noticeEqs
);
}
private
void
saveOrUpdateHisData
(
String
sequenceNbr
,
JSONObject
changeData
,
JSONObject
oldData
)
{
this
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_MODIFICATION_NOTIFICATION
.
getName
(),
new
JSONObject
(
changeData
),
new
JSONObject
(
oldData
),
sequenceNbr
);
this
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_MODIFICATION_NOTIFICATION
.
getName
(),
changeData
,
oldData
,
sequenceNbr
);
}
public
void
saveOrUpdateHistory
(
String
registrationClass
,
JSON
changeData
,
JSON
oldData
,
String
currentDocumentId
)
{
...
...
@@ -1287,15 +1321,21 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
}
JgRegistrationHistory
registrationHistory
=
jgRegistrationHistoryMapper
.
selectOne
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>().
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
notice
.
getSequenceNbr
()));
JSONObject
newData
=
JSONObject
.
parseObject
(
registrationHistory
.
getChangeData
());
JSONArray
alreadyDelPipData
=
JSONArray
.
parseArray
(
newData
.
getString
(
DEL_
PIPELIN
E_LIST
));
JSONArray
alreadyDelPipData
=
JSONArray
.
parseArray
(
newData
.
getString
(
DEL_
DEVIC
E_LIST
));
JSONObject
oldData
=
JSONObject
.
parseObject
(
registrationHistory
.
getOldData
());
JSONArray
oldPipData
=
JSONArray
.
parseArray
(
oldData
.
getString
(
PIPELINE_LIST
));
JSONArray
oldPipData
=
JSONArray
.
parseArray
(
oldData
.
getString
(
DEVICE_LIST
));
double
oldPipLength
=
oldPipData
.
stream
().
mapToDouble
(
item
->
JSON
.
parseObject
(
item
.
toString
()).
getDoubleValue
(
PIPE_LENGTH
)).
sum
();
List
<
String
>
oldPipDataRecords
=
oldPipData
.
stream
().
map
(
item
->
JSON
.
parseObject
(
item
.
toString
()).
getString
(
RECORD
)).
collect
(
Collectors
.
toList
());
List
<
String
>
nowPipDataRecords
=
idxBizJgProjectContraptionMapper
.
selectEquipList
(
notice
.
getProjectContraptionId
()).
stream
().
map
(
item
->
String
.
valueOf
(
item
.
get
(
"record"
))).
collect
(
Collectors
.
toList
());
List
<
JSONObject
>
toAddPipData
=
alreadyDelPipData
.
stream
().
map
(
item
->
JSON
.
parseObject
(
item
.
toString
())).
collect
(
Collectors
.
toList
());
List
<
String
>
toDeletePipRecords
=
nowPipDataRecords
.
stream
().
filter
(
item
->
!
oldPipDataRecords
.
contains
(
item
)).
collect
(
Collectors
.
toList
());
this
.
addPipDataWithFlowPass
(
toAddPipData
,
notice
);
this
.
delPipDataWithFlowPass
(
toDeletePipRecords
);
LambdaUpdateWrapper
<
IdxBizJgProjectContraption
>
updateWrapper
=
new
LambdaUpdateWrapper
<
IdxBizJgProjectContraption
>()
.
eq
(
IdxBizJgProjectContraption:
:
getSequenceNbr
,
notice
.
getProjectContraptionId
())
.
set
(
IdxBizJgProjectContraption:
:
getPipelineLength
,
oldPipLength
)
.
set
(
IdxBizJgProjectContraption:
:
getPipeLengthChanged
,
0
);
idxBizJgProjectContraptionMapper
.
update
(
null
,
updateWrapper
);
}
private
void
finishedTask
(
JgReformNotice
reformNotice
)
{
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/job/MonthCylinderBusinessStatisticsJob.java
View file @
99b1a2d5
...
...
@@ -32,7 +32,7 @@ public class MonthCylinderBusinessStatisticsJob {
this
.
businessStatisticsMapper
=
businessStatisticsMapper
;
}
@Scheduled
(
cron
=
"0
*/5 *
* * ?"
)
@Scheduled
(
cron
=
"0
0 2
* * ?"
)
@SchedulerLock
(
name
=
"cylinderBusinessStatisticsJob"
,
lockAtMostFor
=
"PT1H"
)
public
void
cylinderBusinessStatisticsJob
()
{
List
<
Map
<
String
,
Object
>>
useRegisterCountList
=
useRegistrationMapper
.
getUseRegisterCountTotal
();
...
...
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