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
93a23727
Commit
93a23727
authored
Jul 19, 2024
by
王果
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
21052 改造变更登记校验设备是否在流程中
parent
7017d4f0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
294 additions
and
194 deletions
+294
-194
JgChangeRegistrationReformMapper.java
...odule/jg/api/mapper/JgChangeRegistrationReformMapper.java
+3
-0
JgChangeRegistrationReformMapper.xml
...ain/resources/mapper/JgChangeRegistrationReformMapper.xml
+12
-1
JgUseRegistrationMapper.xml
...api/src/main/resources/mapper/JgUseRegistrationMapper.xml
+4
-4
JgChangeRegistrationEquipUsedCheckImpl.java
.../service/impl/JgChangeRegistrationEquipUsedCheckImpl.java
+57
-0
JgChangeRegistrationReformServiceImpl.java
...z/service/impl/JgChangeRegistrationReformServiceImpl.java
+201
-173
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+17
-16
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/JgChangeRegistrationReformMapper.java
View file @
93a23727
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationReformDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationReform
;
...
...
@@ -40,4 +41,6 @@ public interface JgChangeRegistrationReformMapper extends BaseMapper<JgChangeReg
String
getEquiplistNameByEquiplist
(
String
code
);
List
<
Map
<
String
,
Object
>>
getDetailById
(
@Param
(
"id"
)
Long
id
);
List
<
CompanyEquipCountDto
>
queryForFlowingEquipList
();
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgChangeRegistrationReformMapper.xml
View file @
93a23727
...
...
@@ -204,5 +204,16 @@
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
where ur.sequence_nbr = #{id}
</select>
<select
id=
"queryForFlowingEquipList"
resultType=
"com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto"
>
select
a.use_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from
tzs_jg_change_registration_reform a,
tzs_jg_change_registration_reform_eq b
where
a.sequence_nbr = b.equip_transfer_id
and a.status not in('使用单位待提交','一级受理已驳回','使用单位已撤回','已作废','已完成')
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
View file @
93a23727
...
...
@@ -642,11 +642,11 @@
a.use_unit_credit_code as companyCode,
group_concat(b.equ_id) as records
from
tzs_jg_use_registration a,
tzs_jg_use_registration_eq b
tzs_jg_use_registration a,
tzs_jg_use_registration_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.status
<![CDATA[ <> ]]>
'使用单位待提交' and a.status
<![CDATA[ <> ]]>
'一级受理已驳回' and a.status
<![CDATA[ <> ]]>
'使用单位已撤回' and a.status
<![CDATA[ <> ]]>
'已作废')
a.sequence_nbr = b.equip_transfer_id
and a.status not in('使用单位待提交','一级受理已驳回','使用单位已撤回',
'已作废')
</select>
<select
id=
"getEquTypeByUseRegSeq"
resultType=
"java.util.Map"
>
select ur.sequence_nbr as sequenceNbr,
...
...
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/JgChangeRegistrationEquipUsedCheckImpl.java
0 → 100644
View file @
93a23727
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationReformEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationReformMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* @author Administrator
*/
@Component
@Slf4j
public
class
JgChangeRegistrationEquipUsedCheckImpl
extends
BaseEquipUsedCheckService
{
private
RedissonClient
redissonClient
;
private
String
bizType
=
"changeRegistration"
;
private
JgChangeRegistrationReformMapper
mapper
;
public
JgChangeRegistrationEquipUsedCheckImpl
(
RedissonClient
redissonClient
,
JgChangeRegistrationReformMapper
mapper
)
{
this
.
redissonClient
=
redissonClient
;
this
.
mapper
=
mapper
;
}
@Override
public
RedissonClient
getRedisClient
()
{
return
redissonClient
;
}
@Override
public
String
getApplyBizType
()
{
return
bizType
;
}
@Override
public
void
init
()
{
// 初始化已经完成或者在流程中使用登记的设备数据
List
<
CompanyEquipCountDto
>
companyEquipCountDtos
=
mapper
.
queryForFlowingEquipList
();
companyEquipCountDtos
.
forEach
(
c
->
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
this
.
getFlowingEquipRedisKey
(
c
.
getCompanyCode
(),
bizType
));
rBucket
.
set
(
Arrays
.
stream
(
c
.
getRecords
().
split
(
","
)).
collect
(
Collectors
.
toSet
()));
});
}
}
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/JgChangeRegistrationReformServiceImpl.java
View file @
93a23727
...
...
@@ -18,6 +18,9 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationReformService
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransferService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.*
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
...
...
@@ -27,7 +30,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsElevatorMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.OtherInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.service.ITzsJgRegistrationInfoService
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
...
...
@@ -52,9 +54,9 @@ import javax.servlet.http.HttpServletResponse;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgUseRegistrationServiceImpl
.
getAuditPassedDate
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
/**
* 改造变更登记服务实现类
...
...
@@ -65,7 +67,10 @@ import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistration
@Service
public
class
JgChangeRegistrationReformServiceImpl
extends
BaseService
<
JgChangeRegistrationReformDto
,
JgChangeRegistrationReform
,
JgChangeRegistrationReformMapper
>
implements
IJgChangeRegistrationReformService
{
private
final
static
String
bussinessType
=
"改造登记"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
,
"已完成"
);
private
final
static
String
BUSINESS_TYPE
=
"改造登记"
;
private
final
static
String
BUSINESS_TYPE_KEY
=
"changeRegistration"
;
@Autowired
TzsServiceFeignClient
tzsServiceFeignClient
;
@Autowired
...
...
@@ -145,156 +150,182 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
* @param roleIds 当前登陆人的角色id值
* @return
*/
public
Page
<
Map
<
String
,
Object
>>
getList
(
JgChangeRegistrationReformDto
dto
,
String
sort
,
Page
<
Map
<
String
,
Object
>>
page
,
List
<
String
>
roleIds
)
{
public
Page
<
Map
<
String
,
Object
>>
getList
(
JgChangeRegistrationReformDto
dto
,
String
sort
,
Page
<
Map
<
String
,
Object
>>
page
,
List
<
String
>
roleIds
)
{
SortVo
sortMap
=
commonServiceImpl
.
sortFieldConversion
(
sort
);
Page
<
Map
<
String
,
Object
>>
listPage
=
this
.
baseMapper
.
getListPage
(
page
,
sortMap
,
dto
,
roleIds
,
RequestContext
.
getExeUserId
());
Page
<
Map
<
String
,
Object
>>
listPage
=
this
.
baseMapper
.
getListPage
(
page
,
sortMap
,
dto
,
roleIds
,
RequestContext
.
getExeUserId
());
return
listPage
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Map
<
String
,
Object
>>
save
(
JSONObject
map
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
UseInfo
useInfo
=
new
UseInfo
();
String
equipId
=
map
.
get
(
"record"
).
toString
();
LambdaQueryWrapper
<
UseInfo
>
lambda
=
new
QueryWrapper
<
UseInfo
>().
lambda
();
lambda
.
eq
(
UseInfo:
:
getRecord
,
equipId
);
// 使用登记信息
JgChangeRegistrationReform
jgChangeRegistrationReform
=
new
JgChangeRegistrationReform
();
LambdaQueryWrapper
<
OtherInfo
>
otherLambda
=
new
QueryWrapper
<
OtherInfo
>().
lambda
();
otherLambda
.
eq
(
OtherInfo:
:
getRecord
,
equipId
);
OtherInfo
otherInfo
=
otherInfoMapper
.
selectOne
(
otherLambda
);
String
supervisoryCode
=
otherInfo
.
getSupervisoryCode
();
jgChangeRegistrationReform
.
setSupervisoryCode
(
supervisoryCode
);
jgChangeRegistrationReform
.
setUseUnitName
(
ObjectUtils
.
isEmpty
(
useInfo
.
getUseUnitName
())
?
reginParams
.
getCompany
().
getCompanyName
()
:
useInfo
.
getUseUnitName
());
jgChangeRegistrationReform
.
setUseUnitCreditCode
(
ObjectUtils
.
isEmpty
(
useInfo
.
getUseUnitCreditCode
())
?
reginParams
.
getCompany
().
getCompanyCode
()
:
useInfo
.
getUseUnitCreditCode
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
))){
jgChangeRegistrationReform
.
setOtherAccessories
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
}
private
void
rollBackForDelRedisData
()
{
FlowingEquipRedisContext
.
getContext
().
forEach
(
e
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
BUSINESS_TYPE_KEY
).
delDataForCheckWithKey
(
e
.
getData
(),
e
.
getRedisKey
()));
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"transformationQualityCertificate"
)))
{
jgChangeRegistrationReform
.
setTransformationQualityCertificate
(
JSONObject
.
toJSONString
(
map
.
get
(
"transformationQualityCertificate"
)));
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"renovationSupervisioninspectionCertificate"
)))
{
jgChangeRegistrationReform
.
setRenovationSupervisioninspectionCertificate
(
JSONObject
.
toJSONString
(
map
.
get
(
"renovationSupervisioninspectionCertificate"
)));
}
// 使用单位提交
jgChangeRegistrationReform
.
setUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"inspectUnitCreditCode"
)))
{
jgChangeRegistrationReform
.
setInspectUnitCreditCode
(
map
.
get
(
"inspectUnitCreditCode"
).
toString
());
}
else
{
jgChangeRegistrationReform
.
setInspectUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
private
void
checkForRepeatUsedEquip
(
JSONObject
map
,
String
equId
,
ReginParams
reginParams
)
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
)))
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
BUSINESS_TYPE_KEY
)
.
equipRepeatUsedCheck
(
equId
,
reginParams
.
getCompany
().
getCompanyCode
());
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"inspectOrgName"
)))
{
jgChangeRegistrationReform
.
setInspectUnitName
(
map
.
get
(
"inspectOrgName"
).
toString
());
}
else
{
jgChangeRegistrationReform
.
setInspectUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
}
private
void
clearDataForCheckEquipRepeatUsed
(
JgChangeRegistrationReform
data
)
{
// 新查询原因 useRegistration 数据状态是旧的
JgChangeRegistrationReform
dbData
=
this
.
getById
(
data
.
getSequenceNbr
());
LambdaQueryWrapper
<
JgChangeRegistrationReformEq
>
lambda
=
new
QueryWrapper
<
JgChangeRegistrationReformEq
>().
lambda
();
lambda
.
eq
(
JgChangeRegistrationReformEq:
:
getEquipTransferId
,
data
.
getSequenceNbr
());
lambda
.
select
(
JgChangeRegistrationReformEq:
:
getEquId
);
List
<
JgChangeRegistrationReformEq
>
eqList
=
jgChangeRegistrationReformEqMapper
.
selectList
(
lambda
);
// 在使用单位待提交、一级受理已驳回、使用单位已撤回后清除关联的设备,保证可以再次新提单子选择相同的设备进行提交及原有单子的提交校验数据准备
if
(
NOT_FLOWING_STATE
.
contains
(
dbData
.
getStatus
()))
{
List
<
String
>
records
=
eqList
.
stream
().
map
(
JgChangeRegistrationReformEq:
:
getEquId
).
collect
(
toList
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
BUSINESS_TYPE_KEY
)
.
delDataForCheckEquipRepeatUsed
(
records
,
data
.
getUseUnitCreditCode
());
}
if
(
map
.
containsKey
(
"receiveCompanyCode"
))
{
String
receiveCompanyCode
=
String
.
valueOf
(
map
.
getString
(
"receiveCompanyCode"
));
// jgChangeRegistrationReform.setReceiveCompanyCode(receiveCompanyCode);
String
[]
receiveCompany
=
receiveCompanyCode
.
split
(
"_"
);
if
(!
ValidationUtil
.
isEmpty
(
receiveCompany
))
{
jgChangeRegistrationReform
.
setReceiveCompanyCode
(
receiveCompanyCode
.
split
(
"_"
)[
0
]);
jgChangeRegistrationReform
.
setReceiveOrgCode
(
receiveCompanyCode
.
split
(
"_"
)[
0
]);
if
(
receiveCompany
.
length
>
1
)
{
jgChangeRegistrationReform
.
setReceiveOrgName
(
receiveCompanyCode
.
split
(
"_"
)[
1
]);
}
else
{
jgChangeRegistrationReform
.
setReceiveOrgName
(
String
.
valueOf
(
map
.
get
(
"receiveOrgName"
)));
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Map
<
String
,
Object
>>
save
(
JSONObject
map
)
{
try
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
UseInfo
useInfo
=
new
UseInfo
();
String
equipId
=
map
.
get
(
"record"
).
toString
();
LambdaQueryWrapper
<
UseInfo
>
lambda
=
new
QueryWrapper
<
UseInfo
>().
lambda
();
lambda
.
eq
(
UseInfo:
:
getRecord
,
equipId
);
// 提交时进行校验设备是否在流程中使用(并发及同时打开多个相同的页面时才会出现此种情况)
this
.
checkForRepeatUsedEquip
(
map
,
equipId
,
reginParams
);
// 使用登记信息
JgChangeRegistrationReform
jgChangeRegistrationReform
=
new
JgChangeRegistrationReform
();
LambdaQueryWrapper
<
OtherInfo
>
otherLambda
=
new
QueryWrapper
<
OtherInfo
>().
lambda
();
otherLambda
.
eq
(
OtherInfo:
:
getRecord
,
equipId
);
OtherInfo
otherInfo
=
otherInfoMapper
.
selectOne
(
otherLambda
);
String
supervisoryCode
=
otherInfo
.
getSupervisoryCode
();
jgChangeRegistrationReform
.
setSupervisoryCode
(
supervisoryCode
);
jgChangeRegistrationReform
.
setUseUnitName
(
ObjectUtils
.
isEmpty
(
useInfo
.
getUseUnitName
())
?
reginParams
.
getCompany
().
getCompanyName
()
:
useInfo
.
getUseUnitName
());
jgChangeRegistrationReform
.
setUseUnitCreditCode
(
ObjectUtils
.
isEmpty
(
useInfo
.
getUseUnitCreditCode
())
?
reginParams
.
getCompany
().
getCompanyCode
()
:
useInfo
.
getUseUnitCreditCode
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
)))
{
jgChangeRegistrationReform
.
setOtherAccessories
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
}
}
else
{
jgChangeRegistrationReform
.
setReceiveCompanyCode
(
"610000"
);
}
// 统计用
CompanyBo
companyBo
=
commonServiceImpl
.
getOneCompany
(
jgChangeRegistrationReform
.
getReceiveCompanyCode
());
jgChangeRegistrationReform
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
//使用登记编号
jgRegistrationHistory
.
setUseRegistrationCode
(
idxBizJgRegisterInfoMapper
.
getUseOrgCodeByEquip
(
equipId
));
//登记类别
jgRegistrationHistory
.
setRegistrationClass
(
bussinessType
);
//设备id
jgRegistrationHistory
.
setEquId
(
equipId
);
//修改数据
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
map
));
//保存历史数据
// IdxBizJgTechParamsElevator idxBizJgTechParamsElevator = idxBizJgTechParamsElevatorMapper.selectOne(new QueryWrapper<IdxBizJgTechParamsElevator>().eq("RECORD", equipId));
// jgRegistrationHistory.setOldData(JSONObject.toJSONString(idxBizJgTechParamsElevator));
//设备监管码
jgRegistrationHistory
.
setSupervisoryCode
(
supervisoryCode
);
//数据状态
jgChangeRegistrationReform
.
setUseRegistrationCode
(
jgRegistrationHistory
.
getUseRegistrationCode
());
String
equipListName
=
Optional
.
ofNullable
(
map
.
get
(
"equListDesc"
)).
orElse
(
"无"
).
toString
();
jgChangeRegistrationReform
.
setEquipListName
(
equipListName
);
jgChangeRegistrationReform
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgChangeRegistrationReform
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
jgChangeRegistrationReform
.
setCreateUserCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
jgRegistrationHistory
.
setStatus
(
"new"
);
if
(
map
.
containsKey
(
"type"
)
&&
"edit"
.
equals
(
String
.
valueOf
(
map
.
get
(
"type"
))))
{
jgChangeRegistrationReform
.
setSequenceNbr
(
Long
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))));
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationReform
);
jgChangeRegistrationReform
=
this
.
getBaseMapper
().
selectById
(
jgChangeRegistrationReform
.
getSequenceNbr
());
JgChangeRegistrationReformEq
jgChangeRegistrationReformEq
=
jgChangeRegistrationReformEqMapper
.
selectOne
(
new
QueryWrapper
<
JgChangeRegistrationReformEq
>().
eq
(
"equip_transfer_id"
,
jgChangeRegistrationReform
.
getSequenceNbr
()));
jgChangeRegistrationReformEq
.
setEquId
(
equipId
);
jgChangeRegistrationReformEqMapper
.
updateById
(
jgChangeRegistrationReformEq
);
jgRegistrationHistory
.
setSequenceNbr
(
jgRegistrationHistoryMapper
.
getSequenceNbrByRegistratioClassAndDocumentId
(
bussinessType
,
String
.
valueOf
(
map
.
get
(
"applyNo"
))));
jgRegistrationHistoryMapper
.
updateById
(
jgRegistrationHistory
);
}
else
{
//暂存处理
// 业务管理设备信息保存
JgChangeRegistrationReformEq
jgChangeRegistrationReformEq
=
new
JgChangeRegistrationReformEq
();
jgChangeRegistrationReformEq
.
setEquId
(
equipId
);
ResponseModel
<
List
<
String
>>
result
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
GZBG
.
getCode
(),
1
);
if
(!
result
.
getResult
().
isEmpty
())
{
jgChangeRegistrationReform
.
setApplyNo
(
result
.
getResult
().
get
(
0
));
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"transformationQualityCertificate"
)))
{
jgChangeRegistrationReform
.
setTransformationQualityCertificate
(
JSONObject
.
toJSONString
(
map
.
get
(
"transformationQualityCertificate"
)));
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"renovationSupervisioninspectionCertificate"
)))
{
jgChangeRegistrationReform
.
setRenovationSupervisioninspectionCertificate
(
JSONObject
.
toJSONString
(
map
.
get
(
"renovationSupervisioninspectionCertificate"
)));
}
// 使用单位提交
jgChangeRegistrationReform
.
setUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"inspectUnitCreditCode"
)))
{
jgChangeRegistrationReform
.
setInspectUnitCreditCode
(
map
.
get
(
"inspectUnitCreditCode"
).
toString
());
}
else
{
throw
new
BadRequest
(
"申请单编号生成失败,请稍后重试!"
);
jgChangeRegistrationReform
.
setInspectUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
()
);
}
jgChangeRegistrationReform
.
setRegDate
(
new
Date
());
jgChangeRegistrationReform
.
setStatus
(
WorkFlowStatusEnum
.
CHANGE_SUBMIT
.
getPass
());
jgChangeRegistrationReform
.
setAuditStatus
(
WorkFlowStatusEnum
.
CHANGE_SUBMIT
.
getPass
());
this
.
save
(
jgChangeRegistrationReform
);
jgChangeRegistrationReformEq
.
setEquipTransferId
(
jgChangeRegistrationReform
.
getSequenceNbr
().
toString
());
jgChangeRegistrationReformEqMapper
.
insert
(
jgChangeRegistrationReformEq
);
//当前单据id
jgRegistrationHistory
.
setCurrentDocumentId
(
jgChangeRegistrationReform
.
getApplyNo
());
jgRegistrationHistoryMapper
.
insert
(
jgRegistrationHistory
);
//暂存时生成待办数据
List
<
TaskModelDto
>
taskModelDtoList
=
Arrays
.
asList
(
getTaskModelDtoList
(
jgChangeRegistrationReform
,
null
));
commonServiceImpl
.
buildTaskModel
(
taskModelDtoList
);
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"inspectOrgName"
)))
{
jgChangeRegistrationReform
.
setInspectUnitName
(
map
.
get
(
"inspectOrgName"
).
toString
());
}
else
{
jgChangeRegistrationReform
.
setInspectUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
}
if
(
map
.
containsKey
(
"receiveCompanyCode"
))
{
String
receiveCompanyCode
=
String
.
valueOf
(
map
.
getString
(
"receiveCompanyCode"
));
String
[]
receiveCompany
=
receiveCompanyCode
.
split
(
"_"
);
if
(!
ValidationUtil
.
isEmpty
(
receiveCompany
))
{
jgChangeRegistrationReform
.
setReceiveCompanyCode
(
receiveCompanyCode
.
split
(
"_"
)[
0
]);
jgChangeRegistrationReform
.
setReceiveOrgCode
(
receiveCompanyCode
.
split
(
"_"
)[
0
]);
if
(
receiveCompany
.
length
>
1
)
{
jgChangeRegistrationReform
.
setReceiveOrgName
(
receiveCompanyCode
.
split
(
"_"
)[
1
]);
}
else
{
jgChangeRegistrationReform
.
setReceiveOrgName
(
String
.
valueOf
(
map
.
get
(
"receiveOrgName"
)));
}
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
)))
{
String
instanceId
=
""
;
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationReform
.
getSequenceNbr
())
&&
!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationReform
.
getInstanceId
()))
{
// 如果是旧流程则执行一步
flowExecute
(
jgChangeRegistrationReform
.
getSequenceNbr
(),
jgChangeRegistrationReform
.
getInstanceId
(),
"0"
,
""
,
jgChangeRegistrationReform
.
getNextTaskId
());
// updateExecuteIds(instanceId, jgChangeRegistrationReform.getSequenceNbr(), "0");
}
else
{
// 如果是新启动的流程开启自动访问
jgChangeRegistrationReform
.
setAuditStatus
(
WorkFlowStatusEnum
.
CHANGE_RECEIVE
.
getPass
());
jgChangeRegistrationReform
.
setStatus
(
WorkFlowStatusEnum
.
CHANGE_RECEIVE
.
getPass
());
ProcessTaskDTO
processTaskDTO
=
startByVariable
(
jgChangeRegistrationReform
);
updateExecuteIds
(
instanceId
,
jgChangeRegistrationReform
,
"startWorkfow"
,
processTaskDTO
);
List
<
TaskModelDto
>
taskModelDtoList
=
Arrays
.
asList
(
getTaskModelDtoList
(
jgChangeRegistrationReform
,
processTaskDTO
));
//启动之前删除暂存生成的待办
commonServiceImpl
.
deleteTasksByRelationId
(
String
.
valueOf
(
jgChangeRegistrationReform
.
getSequenceNbr
()));
//重新生成新的待办数据
jgChangeRegistrationReform
.
setReceiveCompanyCode
(
"610000"
);
}
// 统计用
CompanyBo
companyBo
=
commonServiceImpl
.
getOneCompany
(
jgChangeRegistrationReform
.
getReceiveCompanyCode
());
jgChangeRegistrationReform
.
setReceiveCompanyOrgCode
(
companyBo
.
getOrgCode
());
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
//使用登记编号
jgRegistrationHistory
.
setUseRegistrationCode
(
idxBizJgRegisterInfoMapper
.
getUseOrgCodeByEquip
(
equipId
));
//登记类别
jgRegistrationHistory
.
setRegistrationClass
(
BUSINESS_TYPE
);
//设备id
jgRegistrationHistory
.
setEquId
(
equipId
);
//修改数据
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
map
));
//设备监管码
jgRegistrationHistory
.
setSupervisoryCode
(
supervisoryCode
);
//数据状态
jgChangeRegistrationReform
.
setUseRegistrationCode
(
jgRegistrationHistory
.
getUseRegistrationCode
());
String
equipListName
=
Optional
.
ofNullable
(
map
.
get
(
"equListDesc"
)).
orElse
(
"无"
).
toString
();
jgChangeRegistrationReform
.
setEquipListName
(
equipListName
);
jgChangeRegistrationReform
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgChangeRegistrationReform
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
jgChangeRegistrationReform
.
setCreateUserCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
jgRegistrationHistory
.
setStatus
(
"new"
);
if
(
map
.
containsKey
(
"type"
)
&&
"edit"
.
equals
(
String
.
valueOf
(
map
.
get
(
"type"
))))
{
jgChangeRegistrationReform
.
setSequenceNbr
(
Long
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))));
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationReform
);
jgChangeRegistrationReform
=
this
.
getBaseMapper
().
selectById
(
jgChangeRegistrationReform
.
getSequenceNbr
());
JgChangeRegistrationReformEq
jgChangeRegistrationReformEq
=
jgChangeRegistrationReformEqMapper
.
selectOne
(
new
QueryWrapper
<
JgChangeRegistrationReformEq
>().
eq
(
"equip_transfer_id"
,
jgChangeRegistrationReform
.
getSequenceNbr
()));
jgChangeRegistrationReformEq
.
setEquId
(
equipId
);
jgChangeRegistrationReformEqMapper
.
updateById
(
jgChangeRegistrationReformEq
);
jgRegistrationHistory
.
setSequenceNbr
(
jgRegistrationHistoryMapper
.
getSequenceNbrByRegistratioClassAndDocumentId
(
BUSINESS_TYPE
,
String
.
valueOf
(
map
.
get
(
"applyNo"
))));
jgRegistrationHistoryMapper
.
updateById
(
jgRegistrationHistory
);
}
else
{
//暂存处理
// 业务管理设备信息保存
JgChangeRegistrationReformEq
jgChangeRegistrationReformEq
=
new
JgChangeRegistrationReformEq
();
jgChangeRegistrationReformEq
.
setEquId
(
equipId
);
ResponseModel
<
List
<
String
>>
result
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
GZBG
.
getCode
(),
1
);
if
(!
result
.
getResult
().
isEmpty
())
{
jgChangeRegistrationReform
.
setApplyNo
(
result
.
getResult
().
get
(
0
));
}
else
{
throw
new
BadRequest
(
"申请单编号生成失败,请稍后重试!"
);
}
jgChangeRegistrationReform
.
setRegDate
(
new
Date
());
jgChangeRegistrationReform
.
setStatus
(
WorkFlowStatusEnum
.
CHANGE_SUBMIT
.
getPass
());
jgChangeRegistrationReform
.
setAuditStatus
(
WorkFlowStatusEnum
.
CHANGE_SUBMIT
.
getPass
());
this
.
save
(
jgChangeRegistrationReform
);
jgChangeRegistrationReformEq
.
setEquipTransferId
(
jgChangeRegistrationReform
.
getSequenceNbr
().
toString
());
jgChangeRegistrationReformEqMapper
.
insert
(
jgChangeRegistrationReformEq
);
//当前单据id
jgRegistrationHistory
.
setCurrentDocumentId
(
jgChangeRegistrationReform
.
getApplyNo
());
jgRegistrationHistoryMapper
.
insert
(
jgRegistrationHistory
);
//暂存时生成待办数据
List
<
TaskModelDto
>
taskModelDtoList
=
Arrays
.
asList
(
getTaskModelDtoList
(
jgChangeRegistrationReform
,
null
));
commonServiceImpl
.
buildTaskModel
(
taskModelDtoList
);
}
// if (!ObjectUtils.isEmpty(instanceId)) {
// // 执行流程
// flowExecute(jgChangeRegistrationReform.getSequenceNbr(), instanceId, "0", "");
// updateExecuteIds(instanceId, jgChangeRegistrationReform.getSequenceNbr(), "0");
// }
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
)))
{
String
instanceId
=
""
;
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationReform
.
getSequenceNbr
())
&&
!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationReform
.
getInstanceId
()))
{
// 如果是旧流程则执行一步
flowExecute
(
jgChangeRegistrationReform
.
getSequenceNbr
(),
jgChangeRegistrationReform
.
getInstanceId
(),
"0"
,
""
,
jgChangeRegistrationReform
.
getNextTaskId
());
}
else
{
// 如果是新启动的流程开启自动访问
jgChangeRegistrationReform
.
setAuditStatus
(
WorkFlowStatusEnum
.
CHANGE_RECEIVE
.
getPass
());
jgChangeRegistrationReform
.
setStatus
(
WorkFlowStatusEnum
.
CHANGE_RECEIVE
.
getPass
());
ProcessTaskDTO
processTaskDTO
=
startByVariable
(
jgChangeRegistrationReform
);
updateExecuteIds
(
instanceId
,
jgChangeRegistrationReform
,
"startWorkfow"
,
processTaskDTO
);
List
<
TaskModelDto
>
taskModelDtoList
=
Arrays
.
asList
(
getTaskModelDtoList
(
jgChangeRegistrationReform
,
processTaskDTO
));
//启动之前删除暂存生成的待办
commonServiceImpl
.
deleteTasksByRelationId
(
String
.
valueOf
(
jgChangeRegistrationReform
.
getSequenceNbr
()));
//重新生成新的待办数据
commonServiceImpl
.
buildTaskModel
(
taskModelDtoList
);
}
}
return
this
.
getBaseMapper
().
getDetailById
(
jgChangeRegistrationReform
.
getSequenceNbr
());
}
catch
(
BadRequest
|
LocalBadRequest
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
this
.
rollBackForDelRedisData
();
throw
e
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
this
.
rollBackForDelRedisData
();
throw
new
BadRequest
(
"使用登记保存失败!"
);
}
finally
{
FlowingEquipRedisContext
.
clean
();
}
return
this
.
getBaseMapper
().
getDetailById
(
jgChangeRegistrationReform
.
getSequenceNbr
());
}
public
ProcessTaskDTO
startByVariable
(
JgChangeRegistrationReform
jgChangeRegistrationReform
)
{
...
...
@@ -386,9 +417,6 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgChangeRegistrationReform
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
jgChangeRegistrationReform
.
setStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
JgChangeRegistrationReformEq
jgChangeRegistrationReformEq
=
jgChangeRegistrationReformEqMapper
.
selectOne
(
new
QueryWrapper
<
JgChangeRegistrationReformEq
>().
eq
(
"equip_transfer_id"
,
jgChangeRegistrationReform
.
getSequenceNbr
()));
// String newUseRegistrationCertificateNumber = getCode(jgChangeRegistrationReform.getSupervisoryCode());
// String newUseRegistrationCertificateNumber = commonServiceImpl.generateRegistrationCode(jgChangeRegistrationReformEq.getEquId(), jgChangeRegistrationReform.getSupervisoryCode(), jgChangeRegistrationReform.getReceiveCompanyCode());
// jgChangeRegistrationReform.setUseRegistrationCode(newUseRegistrationCertificateNumber);
updateTechparamsByEquIdAndCurrentDoucumentId
(
jgChangeRegistrationReformEq
.
getEquId
(),
jgChangeRegistrationReform
.
getSequenceNbr
().
toString
(),
null
,
jgChangeRegistrationReform
.
getApplyNo
());
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
...
...
@@ -408,12 +436,12 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationReform
);
}
public
void
saveRecord
(
String
equipId
,
JgChangeRegistrationReform
jgChangeRegistrationReform
,
TaskV2Model
taskV2Model
){
public
void
saveRecord
(
String
equipId
,
JgChangeRegistrationReform
jgChangeRegistrationReform
,
TaskV2Model
taskV2Model
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryMapper
.
selectOne
(
new
QueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
"equ_id"
,
equipId
)
.
eq
(
"current_document_id"
,
jgChangeRegistrationReform
.
getApplyNo
())
.
eq
(
"registration_class"
,
bussinessType
));
.
eq
(
"registration_class"
,
BUSINESS_TYPE
));
JSONObject
object
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
// 更新使用登记证信息
...
...
@@ -425,10 +453,10 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgCertificateChangeRecord
.
setApplyNo
(
jgChangeRegistrationReform
.
getApplyNo
());
jgCertificateChangeRecord
.
setReceiveOrgName
(
jgChangeRegistrationReform
.
getReceiveOrgName
());
jgCertificateChangeRecord
.
setAuditPassDate
(
new
Date
());
jgCertificateChangeRecord
.
setRegType
(
bussinessType
);
jgCertificateChangeRecord
.
setRegType
(
BUSINESS_TYPE
);
jgCertificateChangeRecord
.
setRegDate
(
jgChangeRegistrationReform
.
getCreateDate
());
jgCertificateChangeRecord
.
setChangeContent
(
jgChangeRegistrationReform
.
getCreateUserName
()
+
"办理了【"
+
bussinessType
+
"】,"
+
"单号【"
+
jgChangeRegistrationReform
.
getApplyNo
()
+
"】"
+
",办理日期"
+
sdf
.
format
(
jgChangeRegistrationReform
.
getAuditPassDate
()));
jgCertificateChangeRecord
.
setChangeContent
(
jgChangeRegistrationReform
.
getCreateUserName
()
+
"办理了【"
+
BUSINESS_TYPE
+
"】,"
+
"单号【"
+
jgChangeRegistrationReform
.
getApplyNo
()
+
"】"
+
",办理日期"
+
sdf
.
format
(
jgChangeRegistrationReform
.
getAuditPassDate
()));
jgCertificateChangeRecord
.
setRecUserId
(
jgChangeRegistrationReform
.
getRecUserId
());
jgCertificateChangeRecord
.
setRecDate
(
new
Date
());
jgCertificateChangeRecord
.
setCreateDate
(
new
Date
());
...
...
@@ -471,7 +499,6 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
}
// 流程执行时,状态及权限校验
commonServiceImpl
.
checkForExecuteFlow
(
nextTaskId
,
instanceId
);
ProcessTaskDTO
processTaskDTO
;
JgChangeRegistrationReform
jgChangeRegistrationReform
=
this
.
getBaseMapper
().
selectById
(
id
);
String
taskId
=
jgChangeRegistrationReform
.
getNextTaskId
();
...
...
@@ -492,6 +519,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
processTaskDTO
=
iCmWorkflowService
.
completeOrReject
(
taskId
,
dto
,
operate
);
// 更新下一步执行人
updateExecuteIds
(
instanceId
,
jgChangeRegistrationReform
,
operate
,
processTaskDTO
);
this
.
clearDataForCheckEquipRepeatUsed
(
jgChangeRegistrationReform
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -515,7 +543,6 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
}
// 流程执行时,状态及权限校验
commonServiceImpl
.
checkForRevocationFlow
(
nextTaskId
,
instanceId
);
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
JgChangeRegistrationReform
jgChangeRegistrationReform
=
this
.
getBaseMapper
().
selectOne
(
new
QueryWrapper
<
JgChangeRegistrationReform
>().
eq
(
"instance_id"
,
instanceId
));
ProcessTaskDTO
processTaskDTO
=
iCmWorkflowService
.
rollBack
(
instanceId
);
...
...
@@ -544,13 +571,13 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
}
jsonObject
.
put
(
"model"
,
conveterTaskMessageDTO
(
jgChangeRegistrationReform
));
commonServiceImpl
.
rollbackTask
(
instanceId
,
jsonObject
);
// redis流程实时数据更新
commonServiceImpl
.
saveExecuteFlowData2Redis
(
instanceId
,
this
.
buildInstanceRuntimeData
(
jgChangeRegistrationReform
));
this
.
clearDataForCheckEquipRepeatUsed
(
jgChangeRegistrationReform
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
lock
.
isHeldByCurrentThread
())
{
if
(
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
}
}
...
...
@@ -563,7 +590,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
ids
.
forEach
(
id
->
{
JgChangeRegistrationReform
registrationReform
=
this
.
baseMapper
.
selectById
(
id
);
// 删除代办 + 流程流程
commonServiceImpl
.
deleteTaskModel
(
String
.
valueOf
(
id
),
registrationReform
.
getInstanceId
());
commonServiceImpl
.
deleteTaskModel
(
String
.
valueOf
(
id
),
registrationReform
.
getInstanceId
());
// 删除单子
this
.
baseMapper
.
deleteById
(
id
);
// 删除单子对应eq
...
...
@@ -586,13 +613,13 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
Map
<
String
,
Object
>
originalDataOther
=
new
HashMap
<>();
// if (!("已完成".equals(jgChangeRegistrationReform.getStatus()) || !"流程结束".equals(jgChangeRegistrationReform.getStatus()))) {
// 完成时显示历史数据
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryMapper
.
selectOne
(
new
QueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
"equ_id"
,
equipId
)
.
eq
(
"current_document_id"
,
jgChangeRegistrationReform
.
getApplyNo
())
.
eq
(
"registration_class"
,
bussinessType
));
originalData
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
(),
Map
.
class
);
detail
.
putAll
(
originalData
);
// 完成时显示历史数据
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryMapper
.
selectOne
(
new
QueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
"equ_id"
,
equipId
)
.
eq
(
"current_document_id"
,
jgChangeRegistrationReform
.
getApplyNo
())
.
eq
(
"registration_class"
,
BUSINESS_TYPE
));
originalData
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
(),
Map
.
class
);
detail
.
putAll
(
originalData
);
// } else {
// // 完成显示最新数据
// originalData = idxBizJgRegisterInfoService.getDetailByRecord(equipId);
...
...
@@ -644,7 +671,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryMapper
.
selectOne
(
new
QueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
"equ_id"
,
equipId
)
.
eq
(
"current_document_id"
,
applyNo
)
.
eq
(
"registration_class"
,
bussinessType
));
.
eq
(
"registration_class"
,
BUSINESS_TYPE
));
if
(!
ObjectUtils
.
isEmpty
(
jgRegistrationHistory
))
{
//当前数据
...
...
@@ -659,7 +686,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
IdxBizJgTechParamsElevator
elevator
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
techInfo
),
IdxBizJgTechParamsElevator
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
elevator
))
{
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"ELEVATOR_SEQ"
))){
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"ELEVATOR_SEQ"
)))
{
elevator
.
setSequenceNbr
(
String
.
valueOf
(
techInfo
.
get
(
"ELEVATOR_SEQ"
)));
}
iIdxBizJgTechParamsElevatorService
.
saveOrUpdateData
(
elevator
);
...
...
@@ -669,7 +696,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
else
if
(
EquipmentClassifityEnum
.
CC
.
getCode
().
equals
(
equList
))
{
IdxBizJgTechParamsVehicle
vehicle
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
techInfo
),
IdxBizJgTechParamsVehicle
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
vehicle
))
{
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"VEHICLE_SEQ"
))){
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"VEHICLE_SEQ"
)))
{
vehicle
.
setSequenceNbr
(
String
.
valueOf
(
techInfo
.
get
(
"VEHICLE_SEQ"
)));
}
iIdxBizJgTechParamsVehicleService
.
saveOrUpdateData
(
vehicle
);
...
...
@@ -686,7 +713,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
else
if
(
EquipmentClassifityEnum
.
KYSD
.
getCode
().
equals
(
equList
))
{
IdxBizJgTechParamsRopeway
ropeway
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
techInfo
),
IdxBizJgTechParamsRopeway
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
ropeway
))
{
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"ROPEWAY_SEQ"
))){
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"ROPEWAY_SEQ"
)))
{
ropeway
.
setSequenceNbr
(
String
.
valueOf
(
techInfo
.
get
(
"ROPEWAY_SEQ"
)));
}
ropeway
.
setSequenceNbr
(
String
.
valueOf
(
techInfo
.
get
(
"ROPEWAY_SEQ"
)));
...
...
@@ -703,7 +730,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
else
if
(
EquipmentClassifityEnum
.
YLSS
.
getCode
().
equals
(
equList
))
{
IdxBizJgTechParamsRides
rides
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
techInfo
),
IdxBizJgTechParamsRides
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
rides
))
{
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"RIDES_SEQ"
))){
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"RIDES_SEQ"
)))
{
rides
.
setSequenceNbr
(
String
.
valueOf
(
techInfo
.
get
(
"RIDES_SEQ"
)));
}
iIdxBizJgTechParamsRidesService
.
saveOrUpdateData
(
rides
);
...
...
@@ -713,7 +740,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
else
if
(
EquipmentClassifityEnum
.
GL
.
getCode
().
equals
(
equList
))
{
IdxBizJgTechParamsBoiler
boiler
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
techInfo
),
IdxBizJgTechParamsBoiler
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
boiler
))
{
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"BOILER_SEQ"
))){
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"BOILER_SEQ"
)))
{
boiler
.
setSequenceNbr
(
String
.
valueOf
(
techInfo
.
get
(
"BOILER_SEQ"
)));
}
iIdxBizJgTechParamsBoilerService
.
saveOrUpdateData
(
boiler
);
...
...
@@ -728,7 +755,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
else
if
(
EquipmentClassifityEnum
.
YLRQ
.
getCode
().
equals
(
equList
))
{
IdxBizJgTechParamsVessel
vessel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
techInfo
),
IdxBizJgTechParamsVessel
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
vessel
))
{
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"VESSEL_SEQ"
))){
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"VESSEL_SEQ"
)))
{
vessel
.
setSequenceNbr
(
String
.
valueOf
(
techInfo
.
get
(
"VESSEL_SEQ"
)));
}
iIdxBizJgTechParamsVesselService
.
saveOrUpdateData
(
vessel
);
...
...
@@ -749,7 +776,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
else
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equList
))
{
IdxBizJgTechParamsPipeline
pipeline
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
techInfo
),
IdxBizJgTechParamsPipeline
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
pipeline
))
{
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"PIPELINE_SEQ"
))){
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"PIPELINE_SEQ"
)))
{
pipeline
.
setSequenceNbr
(
String
.
valueOf
(
techInfo
.
get
(
"PIPELINE_SEQ"
)));
}
iIdxBizJgTechParamsPipelineService
.
saveOrUpdateData
(
pipeline
);
...
...
@@ -765,7 +792,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
else
if
(
EquipmentClassifityEnum
.
QZJX
.
getCode
().
equals
(
equList
))
{
IdxBizJgTechParamsLifting
lifting
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
techInfo
),
IdxBizJgTechParamsLifting
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
lifting
))
{
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"LIFTING_SEQ"
))){
if
(!
ObjectUtils
.
isEmpty
(
techInfo
.
get
(
"LIFTING_SEQ"
)))
{
lifting
.
setSequenceNbr
(
String
.
valueOf
(
techInfo
.
get
(
"LIFTING_SEQ"
)));
}
iIdxBizJgTechParamsLiftingService
.
saveOrUpdateData
(
lifting
);
...
...
@@ -797,7 +824,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgRegistrationHistory
.
setChangeData
(
newData
);
jgRegistrationHistory
.
setStatus
(
"history"
);
jgRegistrationHistoryMapper
.
updateById
(
jgRegistrationHistory
);
// makeEquipmentsInvalid(equipId, currentDocumentId);
// makeEquipmentsInvalid(equipId, currentDocumentId);
//更新使用注册登记证编号
// 改造变更登记使用登记证不变
//idxBizJgRegisterInfoMapper.updateUseOrgCodeByEquip(equipId, newUseRegistrationCertificateNumber);
...
...
@@ -958,7 +985,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
if
(
"0"
.
equals
(
printType
))
{
//调用生成使用登记证
commonServiceImpl
.
generateCertificateReport
(
exportParamsMap
,
response
);
}
else
{
}
else
{
//套打
commonServiceImpl
.
generatePdfPrint
(
exportParamsMap
,
response
);
}
...
...
@@ -970,7 +997,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
*/
public
String
getSummaryInfo
(
JgChangeRegistrationReform
jgChangeRegistrationReform
)
{
String
result
=
"发起【%s】的业务申请,【申请单号:%s】"
;
return
String
.
format
(
result
,
bussinessType
,
jgChangeRegistrationReform
.
getApplyNo
());
return
String
.
format
(
result
,
BUSINESS_TYPE
,
jgChangeRegistrationReform
.
getApplyNo
());
}
/**
...
...
@@ -1101,10 +1128,10 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
return
jgChangeRegistrationReform
.
getReceiveCompanyCode
();
}
public
Map
<
String
,
Object
>
getEquDetail
(
String
useRegistrationCode
){
public
Map
<
String
,
Object
>
getEquDetail
(
String
useRegistrationCode
)
{
IdxBizJgRegisterInfo
registerInfo
=
jgRegisterInfoService
.
lambdaQuery
().
eq
(
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
useRegistrationCode
).
one
();
HashMap
<
String
,
Object
>
detail
=
new
HashMap
<>();
if
(!
ObjectUtils
.
isEmpty
(
registerInfo
)){
if
(!
ObjectUtils
.
isEmpty
(
registerInfo
))
{
Map
<
String
,
Object
>
originalData
=
idxBizJgRegisterInfoService
.
getDetailByRecord
(
registerInfo
.
getRecord
());
Map
<
String
,
Object
>
originalDataOther
=
idxBizJgRegisterInfoService
.
getDetailFieldCamelCaseByRecord
(
registerInfo
.
getRecord
());
detail
.
putAll
(
originalDataOther
);
...
...
@@ -1112,11 +1139,11 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
// return jgChangeRegistrationTransferService.getDetailFieldCamelCase(registerInfo.getRecord());
//
}
return
detail
;
return
detail
;
}
public
Page
<
JgUseRegistrationManageDto
>
getUseRegistrationCodeData
(
Page
<
JgUseRegistrationManageDto
>
page
,
JgUseRegistrationManageDto
dto
){
JgUseRegistrationManageDto
dto
)
{
return
jgUseRegistrationManageService
.
queryForJgUseRegistrationManagePage
(
page
,
dto
,
null
);
}
}
\ No newline at end of file
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 @
93a23727
...
...
@@ -615,14 +615,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private
void
rollBackForDelRedisData
()
{
FlowingEquipRedisContext
.
getContext
().
forEach
(
e
->
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
delDataForCheckWithKey
(
e
.
getData
(),
e
.
getRedisKey
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
).
delDataForCheckWithKey
(
e
.
getData
(),
e
.
getRedisKey
());
});
}
private
void
checkForRepeatUsedEquip
(
JSONObject
map
,
CompanyBo
company
)
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
)))
{
// 流程中或已完成
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
equipRepeatUsedCheck
(
map
.
get
(
"equipId"
).
toString
(),
company
.
getCompanyCode
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
).
equipRepeatUsedCheck
(
map
.
get
(
"equipId"
).
toString
(),
company
.
getCompanyCode
());
}
}
...
...
@@ -630,11 +630,25 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"submit"
)))
{
equList
.
forEach
(
equip
->
{
// 流程中或已完成
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
equipRepeatUsedCheck
(
equip
.
get
(
"record"
).
toString
(),
reginParams
.
getCompany
().
getCompanyCode
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
).
equipRepeatUsedCheck
(
equip
.
get
(
"record"
).
toString
(),
reginParams
.
getCompany
().
getCompanyCode
());
});
}
}
private
void
clearDataForCheckEquipRepeatUsed
(
JgUseRegistration
data
)
{
// 新查询原因 useRegistration 数据状态是旧的
JgUseRegistration
useRegistrationDb
=
this
.
getById
(
data
.
getSequenceNbr
());
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
data
.
getSequenceNbr
());
lambda
.
select
(
JgUseRegistrationEq:
:
getEquId
);
List
<
JgUseRegistrationEq
>
eqList
=
jgRelationEquipMapper
.
selectList
(
lambda
);
// 在使用单位待提交、一级受理已驳回、使用单位已撤回后清除关联的设备,保证可以再次新提单子选择相同的设备进行提交及原有单子的提交校验数据准备
if
(
NOT_FLOWING_STATE
.
contains
(
useRegistrationDb
.
getStatus
()))
{
List
<
String
>
records
=
eqList
.
stream
().
map
(
JgUseRegistrationEq:
:
getEquId
).
collect
(
toList
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
)
.
delDataForCheckEquipRepeatUsed
(
records
,
data
.
getUseUnitCreditCode
());
}
}
/**
* 按单位办理
*
...
...
@@ -1535,19 +1549,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
private
void
clearDataForCheckEquipRepeatUsed
(
JgUseRegistration
useRegistration
)
{
// 新查询原因 useRegistration 数据状态是旧的
JgUseRegistration
useRegistrationDb
=
this
.
getById
(
useRegistration
.
getSequenceNbr
());
LambdaQueryWrapper
<
JgUseRegistrationEq
>
lambda
=
new
QueryWrapper
<
JgUseRegistrationEq
>().
lambda
();
lambda
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
useRegistration
.
getSequenceNbr
());
lambda
.
select
(
JgUseRegistrationEq:
:
getEquId
);
List
<
JgUseRegistrationEq
>
eqList
=
jgRelationEquipMapper
.
selectList
(
lambda
);
// 在使用单位待提交、一级受理已驳回、使用单位已撤回后清除关联的设备,保证可以再次新提单子选择相同的设备进行提交及原有单子的提交校验数据准备
if
(
NOT_FLOWING_STATE
.
contains
(
useRegistrationDb
.
getStatus
()))
{
List
<
String
>
records
=
eqList
.
stream
().
map
(
JgUseRegistrationEq:
:
getEquId
).
collect
(
toList
());
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"useRegister"
).
delDataForCheckEquipRepeatUsed
(
records
,
useRegistration
.
getUseUnitCreditCode
());
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteBatch
(
List
<
Long
>
ids
)
{
...
...
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