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
77fa2049
Commit
77fa2049
authored
Aug 26, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):场车单位变更需求开发
parent
852b7336
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
213 additions
and
22 deletions
+213
-22
JgChangeRegistrationUnitDto.java
...s/boot/module/jg/api/dto/JgChangeRegistrationUnitDto.java
+22
-0
JgChangeRegistrationUnit.java
...s/boot/module/jg/api/entity/JgChangeRegistrationUnit.java
+42
-1
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+149
-21
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/JgChangeRegistrationUnitDto.java
View file @
77fa2049
...
@@ -195,4 +195,26 @@ public class JgChangeRegistrationUnitDto extends BaseDto {
...
@@ -195,4 +195,26 @@ public class JgChangeRegistrationUnitDto extends BaseDto {
@ApiModelProperty
(
value
=
"接收机构公司的org_code"
)
@ApiModelProperty
(
value
=
"接收机构公司的org_code"
)
private
String
receiveCompanyOrgCode
;
private
String
receiveCompanyOrgCode
;
@ApiModelProperty
(
value
=
"设备移装完整详细地址"
)
private
String
fullAddress
;
@ApiModelProperty
(
value
=
"省"
)
private
String
province
;
@ApiModelProperty
(
value
=
"市"
)
private
String
city
;
@ApiModelProperty
(
value
=
"区县"
)
private
String
county
;
@ApiModelProperty
(
value
=
"街道"
)
private
String
street
;
@ApiModelProperty
(
value
=
"详细地址"
)
private
String
address
;
@ApiModelProperty
(
value
=
"属地监管部门"
)
private
String
orgBranchCode
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgChangeRegistrationUnit.java
View file @
77fa2049
...
@@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
...
@@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.jg.api.common.BizCustomDateSerializer
;
import
com.yeejoin.amos.boot.module.jg.api.common.BizCustomDateSerializer
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -284,4 +283,46 @@ public class JgChangeRegistrationUnit extends BaseEntity {
...
@@ -284,4 +283,46 @@ public class JgChangeRegistrationUnit extends BaseEntity {
*/
*/
@TableField
(
"equ_list_code"
)
@TableField
(
"equ_list_code"
)
private
String
equListCode
;
private
String
equListCode
;
/**
* 设备移装完整详细地址
*/
@TableField
(
value
=
"full_address"
)
private
String
fullAddress
;
/**
* 省
*/
@TableField
(
value
=
"province"
)
private
String
province
;
/**
* 市
*/
@TableField
(
value
=
"city"
)
private
String
city
;
/**
* 区县
*/
@TableField
(
value
=
"county"
)
private
String
county
;
/**
* 街道
*/
@TableField
(
value
=
"street"
)
private
String
street
;
/**
* 详细地址
*/
@TableField
(
value
=
"address"
)
private
String
address
;
/**
* 属地监管部门
*/
@TableField
(
value
=
"org_branch_code"
)
private
String
orgBranchCode
;
}
}
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/JgChangeRegistrationUnitServiceImpl.java
View file @
77fa2049
...
@@ -65,6 +65,7 @@ import java.time.format.DateTimeFormatter;
...
@@ -65,6 +65,7 @@ import java.time.format.DateTimeFormatter;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgUseRegistrationServiceImpl
.
getAuditPassedDate
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgUseRegistrationServiceImpl
.
getAuditPassedDate
;
...
@@ -788,6 +789,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -788,6 +789,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgChangeRegistrationUnitDto
>
saveNotice
(
String
submitType
,
JSONObject
map
,
ReginParams
reginParams
)
{
public
List
<
JgChangeRegistrationUnitDto
>
saveNotice
(
String
submitType
,
JSONObject
map
,
ReginParams
reginParams
)
{
JgChangeRegistrationUnitDto
model
=
BeanUtil
.
toBeanIgnoreError
(
map
.
get
(
"changeRegisInfo"
),
JgChangeRegistrationUnitDto
.
class
);
JgChangeRegistrationUnitDto
model
=
BeanUtil
.
toBeanIgnoreError
(
map
.
get
(
"changeRegisInfo"
),
JgChangeRegistrationUnitDto
.
class
);
Map
<
String
,
Object
>
tableData
=
(
Map
<
String
,
Object
>)
map
.
get
(
"changeRegisInfo"
);
String
[]
taskName
=
new
String
[]{
"流程结束"
};
String
[]
taskName
=
new
String
[]{
"流程结束"
};
// 字段转换
// 字段转换
convertField
(
model
);
convertField
(
model
);
...
@@ -813,19 +815,17 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -813,19 +815,17 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
List
<
JSONObject
>
deviceList
=
registrationManageService
.
queryEquByCertificateSeqList
(
registrationIdList
);
List
<
JSONObject
>
deviceList
=
registrationManageService
.
queryEquByCertificateSeqList
(
registrationIdList
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
// 获取单位变更设备列表
// 获取单位变更设备列表
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"使用登记证下无设备"
);
throw
new
BadRequest
(
"使用登记证下无设备"
);
}
}
//场车区分区外还是区内
if
(
"5000"
.
equals
(
model
.
getEquListCode
()))
{
String
city
=
Objects
.
toString
(
tableData
.
get
(
"city"
),
""
);
String
userCity
=
Optional
.
ofNullable
(
city
).
map
(
c
->
c
.
split
(
"_"
)[
0
]).
orElseThrow
(()
->
new
BadRequest
(
"请选择地市后暂存!"
));
this
.
validateDeviceCity
(
deviceList
,
userCity
,
"0"
.
equals
(
tableData
.
get
(
"changeType"
)));
}
// 获取单位变更单号
// 获取单位变更单号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
1
);
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
1
);
...
@@ -834,6 +834,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -834,6 +834,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
log
.
error
(
"生成申请变更单位编码失败"
);
log
.
error
(
"生成申请变更单位编码失败"
);
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
nextExecutorUserIds
=
new
ArrayList
<>();
List
<
String
>
nextExecutorUserIds
=
new
ArrayList
<>();
...
@@ -891,6 +900,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -891,6 +900,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
model
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
model
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
model
.
setUseRegistCode
(
String
.
join
(
","
,
registrationNoList
));
model
.
setUseRegistCode
(
String
.
join
(
","
,
registrationNoList
));
model
.
setEquList
(
registrationList
.
get
(
0
).
get
(
"equList"
).
toString
());
model
.
setEquList
(
registrationList
.
get
(
0
).
get
(
"equList"
).
toString
());
this
.
setFullAddress
(
tableData
,
model
);
JgChangeRegistrationUnit
registrationUnit
=
new
JgChangeRegistrationUnit
();
JgChangeRegistrationUnit
registrationUnit
=
new
JgChangeRegistrationUnit
();
BeanUtils
.
copyProperties
(
model
,
registrationUnit
);
BeanUtils
.
copyProperties
(
model
,
registrationUnit
);
setNewUnitInfo
(
reginParams
,
registrationUnit
);
setNewUnitInfo
(
reginParams
,
registrationUnit
);
...
@@ -973,6 +983,60 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -973,6 +983,60 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
return
Collections
.
singletonList
(
model
);
return
Collections
.
singletonList
(
model
);
}
}
public
void
setFullAddress
(
Map
<
String
,
Object
>
tableData
,
JgChangeRegistrationUnitDto
model
)
{
tableData
.
put
(
"region"
,
tableData
.
get
(
"county"
));
String
fullAddress
=
Stream
.
of
(
"province"
,
"city"
,
"region"
,
"street"
)
.
map
(
key
->
getRegionName
(
key
,
tableData
))
.
filter
(
s
->
!
s
.
isEmpty
())
.
collect
(
Collectors
.
joining
())
+
Objects
.
toString
(
tableData
.
get
(
"changeAddress"
),
""
);
model
.
setFullAddress
(
fullAddress
);
model
.
setAddress
(
Objects
.
toString
(
tableData
.
get
(
"changeAddress"
),
""
));
}
/**
* 根据code获取市区县名字
*
* @param codeKey codeKey
* @return name
*/
private
String
getRegionName
(
String
codeKey
,
Map
<
String
,
Object
>
tableData
)
{
List
<
LinkedHashMap
<
String
,
Object
>>
regions
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
redisUtils
.
get
(
codeKey
.
toUpperCase
());
return
regions
.
stream
()
.
filter
(
item
->
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
tableData
.
get
(
codeKey
))))
.
map
(
item
->
(
String
)
item
.
get
(
"regionName"
))
.
collect
(
Collectors
.
joining
(
""
));
}
// 获取设备的地市编码
private
String
getDeviceCity
(
Map
<
String
,
Object
>
device
)
{
Object
usePlaceCodeObj
=
device
.
get
(
"USE_PLACE_CODE"
);
if
(
usePlaceCodeObj
==
null
)
{
throw
new
BadRequest
(
"没有查询到地市信息"
);
}
String
[]
parts
=
((
String
)
usePlaceCodeObj
).
split
(
"#"
);
if
(
parts
.
length
<
2
||
parts
[
1
]
==
null
||
parts
[
1
].
isEmpty
())
{
throw
new
BadRequest
(
"没有查询到地市信息"
);
}
return
parts
[
1
];
}
// 校验设备地市
private
void
validateDeviceCity
(
List
<
JSONObject
>
deviceList
,
String
userCity
,
boolean
isIntraDistrictChange
)
{
for
(
Map
<
String
,
Object
>
device
:
deviceList
)
{
String
deviceCity
=
getDeviceCity
(
device
);
if
(
isIntraDistrictChange
&&
!
userCity
.
equals
(
deviceCity
))
{
throw
new
BadRequest
(
"区内变更只能选择与设备地址中相同地市!"
);
}
if
(!
isIntraDistrictChange
&&
userCity
.
equals
(
deviceCity
))
{
throw
new
BadRequest
(
"区外变更只能选择与设备地址中不同地市!"
);
}
}
}
public
boolean
canConvertToLong
(
String
str
)
{
public
boolean
canConvertToLong
(
String
str
)
{
try
{
try
{
Long
.
parseLong
(
str
);
Long
.
parseLong
(
str
);
...
@@ -1223,7 +1287,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1223,7 +1287,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
.
stream
()
.
stream
()
.
map
(
IdxBizJgRegisterInfo:
:
getRecord
)
.
map
(
IdxBizJgRegisterInfo:
:
getRecord
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(!
records
.
isEmpty
()
&&
enterpriseInfo
!=
null
)
{
if
(!
records
.
isEmpty
()
&&
enterpriseInfo
!=
null
)
{
idxBizJgUseInfoService
.
update
(
idxBizJgUseInfoService
.
update
(
new
IdxBizJgUseInfo
()
new
IdxBizJgUseInfo
()
.
setEstateUnitCreditCode
(
enterpriseInfo
.
getUseUnitCode
())
.
setEstateUnitCreditCode
(
enterpriseInfo
.
getUseUnitCode
())
...
@@ -1234,13 +1298,13 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1234,13 +1298,13 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
);
);
}
}
//场车更新车牌号
//场车更新车牌号
if
(
"5000"
.
equals
(
dto
.
getEquListCode
())
&&
newCarNumber
!=
null
&&
!
"null"
.
equals
(
newCarNumber
)
&&
useCode
!=
null
){
if
(
"5000"
.
equals
(
dto
.
getEquListCode
())
&&
newCarNumber
!=
null
&&
!
"null"
.
equals
(
newCarNumber
)
&&
useCode
!=
null
)
{
idxBizJgRegisterInfoService
.
update
(
new
IdxBizJgRegisterInfo
().
setCarNumber
(
newCarNumber
),
idxBizJgRegisterInfoService
.
update
(
new
IdxBizJgRegisterInfo
().
setCarNumber
(
newCarNumber
),
new
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>().
in
(
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
useCode
)
new
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>().
in
(
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
useCode
)
);
);
}
}
});
});
Map
<
String
,
String
>
seqToEquId
=
new
HashMap
<>();
for
(
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
:
jgChangeRegistrationUnitEqs
)
{
for
(
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
:
jgChangeRegistrationUnitEqs
)
{
String
equipId
=
jgChangeRegistrationUnitEq
.
getEquId
();
String
equipId
=
jgChangeRegistrationUnitEq
.
getEquId
();
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
...
@@ -1249,6 +1313,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1249,6 +1313,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
if
(
ObjectUtils
.
isNotEmpty
(
useInfo
))
{
if
(
ObjectUtils
.
isNotEmpty
(
useInfo
))
{
useInfo
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
useInfo
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
useInfo
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
useInfo
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
if
(
"1"
.
equals
(
registration
.
getChangeType
()))
{
useInfo
.
setFactoryUseSiteStreet
(
registration
.
getFullAddress
());
}
useInfoMapper
.
updateById
(
useInfo
);
useInfoMapper
.
updateById
(
useInfo
);
}
}
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
registerInfoLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
registerInfoLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
...
@@ -1260,6 +1327,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1260,6 +1327,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
map1
.
put
(
"USE_UNIT_NAME"
,
registration
.
getNewUseUnitName
());
map1
.
put
(
"USE_UNIT_NAME"
,
registration
.
getNewUseUnitName
());
map1
.
put
(
"REC_DATE"
,
new
Date
());
// 更新时间,设备筛选时排在前面 bug-21476
map1
.
put
(
"REC_DATE"
,
new
Date
());
// 更新时间,设备筛选时排在前面 bug-21476
map1
.
put
(
"EQU_STATE"
,
"1"
);
map1
.
put
(
"EQU_STATE"
,
"1"
);
// 如果是变更类型=1,还需要更新证号到 ES
if
(
"1"
.
equals
(
registration
.
getChangeType
())
&&
"5000"
.
equals
(
dto
.
getEquListCode
()))
{
// 新证号生成逻辑
String
newCode
=
commonServiceImpl
.
generateRegistrationCode
(
equipId
,
registration
.
getReceiveCompanyCode
(),
false
);
map1
.
put
(
"USE_ORG_CODE"
,
newCode
);
seqToEquId
.
put
(
registerInfo
.
getUseOrgCode
(),
newCode
);
registerInfo
.
setUseOrgCode
(
newCode
);
registerInfoMapper
.
updateById
(
registerInfo
);
}
if
(
ObjectUtils
.
isNotEmpty
(
registerInfo
)
&&
ObjectUtils
.
isNotEmpty
(
registerInfo
.
getCarNumber
()))
{
if
(
ObjectUtils
.
isNotEmpty
(
registerInfo
)
&&
ObjectUtils
.
isNotEmpty
(
registerInfo
.
getCarNumber
()))
{
map1
.
put
(
"CAR_NUMBER"
,
registerInfo
.
getCarNumber
());
map1
.
put
(
"CAR_NUMBER"
,
registerInfo
.
getCarNumber
());
}
}
...
@@ -1271,22 +1347,65 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1271,22 +1347,65 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
registration
.
setNextTaskId
(
nextTaskId
);
registration
.
setNextTaskId
(
nextTaskId
);
TaskV2Model
taskV2Model
=
updateTaskModel
(
registration
,
op
);
TaskV2Model
taskV2Model
=
updateTaskModel
(
registration
,
op
);
//新增使用登记证和设备变更记录
this
.
saveRecord
(
registration
);
JSONArray
historyJson
=
JSON
.
parseArray
(
history
.
getChangeData
());
JSONArray
historyJson
=
JSON
.
parseArray
(
history
.
getChangeData
());
// 更新历史表中一二级审批车牌号
// 更新历史表中一二级审批车牌号
history
.
setChangeData
(
JSONObject
.
toJSONString
(
dto
.
getRegistrationList
()));
history
.
setChangeData
(
JSONObject
.
toJSONString
(
dto
.
getRegistrationList
()));
registrationHistoryService
.
updateById
(
history
);
registrationHistoryService
.
updateById
(
history
);
List
<
String
>
ids
=
historyJson
.
stream
().
map
(
v
->
JSON
.
parseObject
(
v
.
toString
()).
getString
(
"sequenceNbr"
)).
collect
(
Collectors
.
toList
());
List
<
String
>
ids
=
historyJson
.
stream
().
map
(
v
->
JSON
.
parseObject
(
v
.
toString
()).
getString
(
"sequenceNbr"
)).
collect
(
Collectors
.
toList
());
List
<
JgUseRegistrationManage
>
list
=
useRegistrationManageService
.
lambdaQuery
().
in
(
BaseEntity:
:
getSequenceNbr
,
ids
).
list
();
List
<
JgUseRegistrationManage
>
list
=
useRegistrationManageService
.
lambdaQuery
().
in
(
BaseEntity:
:
getSequenceNbr
,
ids
).
list
();
// 用来存放新生成的登记证
List
<
JgUseRegistrationManage
>
newList
=
new
ArrayList
<>();
for
(
JgUseRegistrationManage
registrationManage
:
list
)
{
for
(
JgUseRegistrationManage
registrationManage
:
list
)
{
//
修改使用登记证管理使用单位地址、使用单位代码、接收机构、接收机构公司代码、办理日期、使用单位地址
//
修改使用登记证管理使用单位信息
registrationManage
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
registrationManage
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
registrationManage
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
registrationManage
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
registrationManage
.
setReceiveOrgName
(
registration
.
getReceiveOrgName
());
registrationManage
.
setReceiveOrgName
(
registration
.
getReceiveOrgName
());
registrationManage
.
setReceiveCompanyCode
(
registration
.
getReceiveOrgCode
());
registrationManage
.
setReceiveCompanyCode
(
registration
.
getReceiveOrgCode
());
registrationManage
.
setAuditPassDate
(
registration
.
getAuditPassDate
());
registrationManage
.
setAuditPassDate
(
registration
.
getAuditPassDate
());
registrationManage
.
setVersion
(
registrationManage
.
getVersion
()
+
1
);
registrationManage
.
setVersion
(
registrationManage
.
getVersion
()
+
1
);
if
(
"1"
.
equals
(
registration
.
getChangeType
())
&&
"5000"
.
equals
(
dto
.
getEquListCode
()))
{
// -------------------- 旧证处理 --------------------
registrationManage
.
setCertificateStatus
(
"已注销"
);
registrationManage
.
setChangeReason
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
// -------------------- 新证处理 --------------------
JgUseRegistrationManage
newManage
=
new
JgUseRegistrationManage
();
BeanUtils
.
copyProperties
(
registrationManage
,
newManage
);
String
newCode
=
seqToEquId
.
get
(
registrationManage
.
getUseRegistrationCode
());
newManage
.
setUseRegistrationCode
(
newCode
);
registration
.
setUseRegistCode
(
newCode
);
// 新证属性重置
newManage
.
setCertificateStatus
(
"已登记"
);
newManage
.
setVersion
(
1
);
// 如果 equListCode = 5000,则设置车牌号
if
(
"5000"
.
equals
(
registrationManage
.
getEquListCode
()))
{
String
targetCode
=
registrationManage
.
getUseRegistrationCode
();
dto
.
getRegistrationList
().
stream
()
.
filter
(
item
->
targetCode
.
equals
(
item
.
get
(
"useRegistrationCode"
)))
.
map
(
item
->
String
.
valueOf
(
item
.
get
(
"newCarNumber"
)))
.
filter
(
carNumber
->
carNumber
!=
null
&&
!
"null"
.
equalsIgnoreCase
(
carNumber
.
trim
()))
.
findFirst
()
.
ifPresent
(
newManage:
:
setCarNumber
);
}
newManage
.
setChangeReason
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
// 回填新单位地址
if
(!
ObjectUtils
.
isEmpty
(
registration
.
getNewUseUnitCreditCode
()))
{
TzBaseEnterpriseInfo
useCodeResult
=
tzBaseEnterpriseInfoMapper
.
selectOne
(
new
QueryWrapper
<
TzBaseEnterpriseInfo
>()
.
eq
(
"use_unit_code"
,
registration
.
getNewUseUnitCreditCode
())
);
if
(
useCodeResult
!=
null
)
{
newManage
.
setUseUnitAddress
(
useCodeResult
.
getAddress
());
}
}
newManage
.
setSequenceNbr
(
null
);
newList
.
add
(
newManage
);
}
else
{
registrationManage
.
setCertificateStatus
(
"已登记"
);
registrationManage
.
setCertificateStatus
(
"已登记"
);
if
(
"5000"
.
equals
(
registrationManage
.
getEquListCode
()))
{
if
(
"5000"
.
equals
(
registrationManage
.
getEquListCode
()))
{
String
targetCode
=
registrationManage
.
getUseRegistrationCode
();
String
targetCode
=
registrationManage
.
getUseRegistrationCode
();
...
@@ -1298,17 +1417,26 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1298,17 +1417,26 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
.
ifPresent
(
registrationManage:
:
setCarNumber
);
.
ifPresent
(
registrationManage:
:
setCarNumber
);
}
}
registrationManage
.
setChangeReason
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
registrationManage
.
setChangeReason
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
if
(!
ObjectUtils
.
isEmpty
(
registration
.
getNewUseUnitCreditCode
()))
{
//回填新单位地址
if
(!
ObjectUtils
.
isEmpty
(
registration
.
getNewUseUnitCreditCode
()))
{
TzBaseEnterpriseInfo
useCodeResult
=
tzBaseEnterpriseInfoMapper
.
selectOne
(
new
QueryWrapper
<
TzBaseEnterpriseInfo
>().
eq
(
"use_unit_code"
,
registration
.
getNewUseUnitCreditCode
()));
TzBaseEnterpriseInfo
useCodeResult
=
tzBaseEnterpriseInfoMapper
.
selectOne
(
new
QueryWrapper
<
TzBaseEnterpriseInfo
>()
.
eq
(
"use_unit_code"
,
registration
.
getNewUseUnitCreditCode
())
);
if
(
useCodeResult
!=
null
)
{
if
(
useCodeResult
!=
null
)
{
registrationManage
.
setUseUnitAddress
(
useCodeResult
.
getAddress
());
registrationManage
.
setUseUnitAddress
(
useCodeResult
.
getAddress
());
}
}
}
}
}
}
useRegistrationManageService
.
updateBatchById
(
list
);
}
// 创建设备履历
if
(
CollUtil
.
isNotEmpty
(
newList
))
{
list
.
addAll
(
newList
);
}
useRegistrationManageService
.
saveOrUpdateBatch
(
list
);
this
.
createResume
(
registration
,
jgChangeRegistrationUnitEqs
,
taskV2Model
.
getRoutePath
());
this
.
createResume
(
registration
,
jgChangeRegistrationUnitEqs
,
taskV2Model
.
getRoutePath
());
}
}
//新增使用登记证和设备变更记录
this
.
saveRecord
(
registration
);
// 发送数据变更消息
// 发送数据变更消息
this
.
sendDataRefreshMsg
(
registration
);
this
.
sendDataRefreshMsg
(
registration
);
}
else
{
}
else
{
...
@@ -1323,7 +1451,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1323,7 +1451,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
registration
.
setNextTaskId
(
nextTaskId
);
registration
.
setNextTaskId
(
nextTaskId
);
registration
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getPass
());
registration
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getPass
());
executeOneStep
(
registration
,
taskName1
,
nextUserIds
,
op
);
executeOneStep
(
registration
,
taskName1
,
nextUserIds
,
op
);
if
(
"5000"
.
equals
(
dto
.
getEquListCode
())){
if
(
"5000"
.
equals
(
dto
.
getEquListCode
()))
{
history
.
setChangeData
(
JSONObject
.
toJSONString
(
dto
.
getRegistrationList
()));
history
.
setChangeData
(
JSONObject
.
toJSONString
(
dto
.
getRegistrationList
()));
registrationHistoryService
.
updateById
(
history
);
registrationHistoryService
.
updateById
(
history
);
}
}
...
@@ -1404,7 +1532,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1404,7 +1532,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
throw
new
BadRequest
(
"使用登记证编号:"
+
useRegistrationCode
+
"对应的工程/装置列表不存在"
);
throw
new
BadRequest
(
"使用登记证编号:"
+
useRegistrationCode
+
"对应的工程/装置列表不存在"
);
}
}
//更新产权信息
//更新产权信息
if
(
enterpriseInfo
!=
null
){
if
(
enterpriseInfo
!=
null
)
{
idxBizJgUseInfoService
.
update
(
idxBizJgUseInfoService
.
update
(
new
IdxBizJgUseInfo
().
setEstateUnitCreditCode
(
enterpriseInfo
.
getUseUnitCode
())
new
IdxBizJgUseInfo
().
setEstateUnitCreditCode
(
enterpriseInfo
.
getUseUnitCode
())
.
setEstateUnitName
(
enterpriseInfo
.
getUseUnit
()),
.
setEstateUnitName
(
enterpriseInfo
.
getUseUnit
()),
...
...
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