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
49e20d92
Commit
49e20d92
authored
Nov 22, 2024
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):设备履历功能修改,流程占用查询修改
parent
59bfea75
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
22 deletions
+63
-22
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+23
-13
JgEquipTransferServiceImpl.java
...odule/jg/biz/service/impl/JgEquipTransferServiceImpl.java
+15
-8
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+7
-1
JgVehicleInformationServiceImpl.java
.../jg/biz/service/impl/JgVehicleInformationServiceImpl.java
+18
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
49e20d92
...
...
@@ -293,7 +293,7 @@
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and ( a.status
<![CDATA[ <> ]]>
'已作废'
OR
a.status
<![CDATA[ <> ]]>
'已完成')
and ( a.status
<![CDATA[ <> ]]>
'已作废'
AND
a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -303,7 +303,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and ( a.audit_status
<![CDATA[ <> ]]>
'已作废'
OR
a.audit_status
<![CDATA[ <> ]]>
'已完成')
and ( a.audit_status
<![CDATA[ <> ]]>
'已作废'
AND
a.audit_status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -313,7 +313,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
OR
a.audit_status
<![CDATA[ <> ]]>
'已完成')
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
AND
a.audit_status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -323,7 +323,7 @@
where
a.sequence_nbr = b.unit_change_registration_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废'
OR
a.status
<![CDATA[ <> ]]>
'已完成')
and (a.status
<![CDATA[ <> ]]>
'已作废'
AND
a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -333,7 +333,7 @@
where
a.sequence_nbr = b.enable_disable_apply_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
OR
a.audit_status
<![CDATA[ <> ]]>
'已完成')
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
AND
a.audit_status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -343,7 +343,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
or
a.notice_status
<![CDATA[ <> ]]>
'6616')
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
AND
a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
...
...
@@ -353,7 +353,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
or
a.notice_status
<![CDATA[ <> ]]>
'6616')
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
AND
a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
...
...
@@ -363,7 +363,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废'
OR
a.status
<![CDATA[ <> ]]>
'已完成')
and (a.status
<![CDATA[ <> ]]>
'已作废'
AND
a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -373,7 +373,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
or
a.notice_status
<![CDATA[ <> ]]>
'6616')
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
AND
a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
...
...
@@ -383,7 +383,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
OR
a.status
<![CDATA[ <> ]]>
'已完成')
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
AND
a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -393,7 +393,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
or
a.notice_status
<![CDATA[ <> ]]>
'6616')
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
AND
a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
...
...
@@ -403,7 +403,7 @@
where
a.sequence_nbr = b.vehicle_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废'
OR
a.status
<![CDATA[ <> ]]>
'已完成')
and (a.status
<![CDATA[ <> ]]>
'已作废'
AND
a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -413,7 +413,17 @@
where
a.sequence_nbr = b.unit_change_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废' OR a.status
<![CDATA[ <> ]]>
'已完成')
and (a.status
<![CDATA[ <> ]]>
'已作废' AND a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
from
tzs_jg_equip_transfer a,
tzs_jg_equip_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.apply_status
<![CDATA[ <> ]]>
'6617' AND a.apply_status
<![CDATA[ <> ]]>
'6616')
)
</select>
...
...
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/JgEquipTransferServiceImpl.java
View file @
49e20d92
...
...
@@ -37,6 +37,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
...
...
@@ -101,6 +102,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @param reginParams redis信息
*/
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
BaseException
.
class
})
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgEquipTransfer
>
saveTransfer
(
String
submitType
,
JSONObject
jsonObjectMap
,
ReginParams
reginParams
)
{
JgEquipTransferDto
model
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
jsonObjectMap
),
JgEquipTransferDto
.
class
);
...
...
@@ -110,6 +112,15 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
throw
new
BadRequest
(
"请选择设备!"
);
}
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
deviceList
.
forEach
(
device
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
EQUIP_TRANSFER_PROCESS_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
device
.
get
(
"SEQUENCE_NBR"
)),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
//获取申请单编号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
getCode
.
get
(
String
.
valueOf
(
jsonObjectMap
.
get
(
"businessCode"
))),
deviceList
.
size
());
this
.
handleResponseModel
(
listResponseModel
,
"告知单获取失败: "
);
...
...
@@ -154,14 +165,6 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
this
.
updateRedisBatch
(
transferList
);
// 创建历史数据
this
.
saveOrUpdateHisDataBatch
(
jgEquipTransferEqList
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
jgEquipTransferEqList
.
forEach
(
equipTransferEq
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
EQUIP_TRANSFER_PROCESS_KEY
)
.
equipRepeatUsedCheck
(
equipTransferEq
.
getEquId
(),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
return
transferList
;
}
...
...
@@ -324,6 +327,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @return 设备信息
*/
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
BaseException
.
class
})
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
JgEquipTransferDto
updateEquipTransfer
(
String
submitType
,
JgEquipTransferDto
equipTransferDto
,
String
op
,
ReginParams
reginParams
)
{
if
(
Objects
.
isNull
(
equipTransferDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
...
...
@@ -428,6 +432,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @param op 通过或驳回
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
accept
(
JgEquipTransferDto
jgEquipTransferDto
,
String
op
)
{
String
instanceId
=
jgEquipTransferDto
.
getInstanceId
();
String
nextTaskId
=
jgEquipTransferDto
.
getNextTaskId
();
...
...
@@ -538,6 +543,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @param equipTransferInfo 设备移交信息
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
cancel
(
JgEquipTransferDto
equipTransferInfo
)
{
String
instanceId
=
equipTransferInfo
.
getInstanceId
();
String
nextTaskId
=
equipTransferInfo
.
getNextTaskId
();
...
...
@@ -803,6 +809,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
deleteForBatch
(
Long
[]
ids
)
{
Collection
<
JgEquipTransfer
>
jgEquipTransfers
=
this
.
listByIds
(
Arrays
.
asList
(
ids
));
for
(
JgEquipTransfer
notice
:
jgEquipTransfers
)
{
...
...
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/JgUseRegistrationServiceImpl.java
View file @
49e20d92
...
...
@@ -2543,8 +2543,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
this
.
rollBackForEquipEsInfo
(
record
,
flag
);
// 5.历史设备处理
this
.
dealHisRegEquipData
(
jgUseRegistration
,
record
);
});
List
<
String
>
equipTransferIds
=
eqList
.
stream
()
.
map
(
JgUseRegistrationEq:
:
getEquipTransferId
)
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
if
(!
equipTransferIds
.
isEmpty
())
{
jgResumeInfoService
.
deleteBatchByBusinessId
(
equipTransferIds
);
}
}
private
void
dealHisRegEquipData
(
JgUseRegistration
jgUseRegistration
,
String
record
)
{
...
...
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/JgVehicleInformationServiceImpl.java
View file @
49e20d92
...
...
@@ -848,6 +848,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 登记证记录主键
Long
changeRecordId
=
sequence
.
nextId
();
List
<
String
>
equipIdList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
mapData
=
jsonArray
.
getJSONObject
(
i
);
// 设备ID
...
...
@@ -890,7 +891,9 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
changeRecordEq
.
setEquId
(
registerInfo
.
getRecord
());
//设备主键
changeRecordEq
.
setProductCode
(
idxBizJgFactoryInfo
.
getFactoryNum
());
//产品编号
certificateChangeRecordEqService
.
save
(
changeRecordEq
);
equipIdList
.
add
(
equId
);
}
// 更新新生成的历史数据的设备代码
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
jsonArray
));
jgRegistrationHistoryService
.
updateById
(
jgRegistrationHistory
);
...
...
@@ -917,6 +920,21 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
jgVehicleInformation
,
registerInfo
,
changeRecordId
,
taskV2Model
);
jgResumeInfoService
.
saveBatchResume
(
equipIdList
.
stream
()
.
map
(
equipId
->
JgResumeInfoDto
.
builder
()
.
applyNo
(
jgVehicleInformation
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
())
.
businessId
(
String
.
valueOf
(
jgVehicleInformation
.
getSequenceNbr
()))
.
equId
(
equipId
)
.
approvalUnit
(
jgVehicleInformation
.
getReceiveOrgName
())
.
approvalUnitCode
(
jgVehicleInformation
.
getReceiveCompanyCode
())
.
status
(
"正常"
)
.
routePath
(
taskV2Model
.
getRoutePath
())
.
build
())
.
collect
(
Collectors
.
toList
())
);
}
this
.
getBaseMapper
().
updateById
(
jgVehicleInformation
);
commonService
.
saveExecuteFlowData2Redis
(
jgVehicleInformation
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgVehicleInformation
));
...
...
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