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
bd7c0b15
Commit
bd7c0b15
authored
Jul 22, 2024
by
王果
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
21052 车用气瓶登记校验设备是否在流程中
parent
281a0187
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
341 additions
and
231 deletions
+341
-231
JgVehicleInformationMapper.java
...boot/module/jg/api/mapper/JgVehicleInformationMapper.java
+3
-0
JgVehicleInformationMapper.xml
.../src/main/resources/mapper/JgVehicleInformationMapper.xml
+9
-1
JgVehicleInformationEquipUsedCheckImpl.java
.../service/impl/JgVehicleInformationEquipUsedCheckImpl.java
+55
-0
JgVehicleInformationServiceImpl.java
.../jg/biz/service/impl/JgVehicleInformationServiceImpl.java
+274
-230
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/JgVehicleInformationMapper.java
View file @
bd7c0b15
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
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.JgVehicleInformationDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgVehicleInformation
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
...
...
@@ -39,4 +40,6 @@ public interface JgVehicleInformationMapper extends BaseMapper<JgVehicleInformat
@Select
(
"select name from tz_equipment_category where code=#{code}"
)
String
getEquCategoryNameByCode
(
String
code
);
List
<
CompanyEquipCountDto
>
queryForFlowingEquipList
();
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgVehicleInformationMapper.xml
View file @
bd7c0b15
...
...
@@ -261,5 +261,13 @@
</foreach>
ORDER BY ui.REC_DATE DESC
</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_vehicle_information a,
tzs_jg_vehicle_information_eq b
where a.sequence_nbr = b.vehicle_id
and a.status in ('三级待受理', '二级待受理', '一级待受理')
GROUP BY a.use_unit_credit_code
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgVehicleInformationEquipUsedCheckImpl.java
0 → 100644
View file @
bd7c0b15
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.JgMaintainNoticeMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgVehicleInformationMapper
;
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
JgVehicleInformationEquipUsedCheckImpl
extends
BaseEquipUsedCheckService
{
private
RedissonClient
redissonClient
;
private
String
bizType
=
"vehicleInformation"
;
private
JgVehicleInformationMapper
mapper
;
public
JgVehicleInformationEquipUsedCheckImpl
(
RedissonClient
redissonClient
,
JgVehicleInformationMapper
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
(
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/JgVehicleInformationServiceImpl.java
View file @
bd7c0b15
...
...
@@ -27,6 +27,8 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgVehicleInformationService;
import
com.yeejoin.amos.boot.module.jg.api.vo.JgVehicleInformationVo
;
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.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.FileExporter
;
...
...
@@ -96,6 +98,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
"equipCode"
,
"equipCategory"
,
"useInnerCode"
,
"factoryNum"
,
"giveOutYear"
,
"giveOutMonth"
,
"giveOutDay"
};
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
,
"已完成"
);
@Autowired
private
RedissonClient
redissonClient
;
@Autowired
...
...
@@ -123,8 +127,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
@Autowired
private
IdxBizJgSupervisionInfoMapper
idxBizJgSupervisionInfoMapper
;
@Autowired
private
InspectionDetectionInfoMapper
inspectionDetectionInfoMapper
;
@Autowired
private
DataDictionaryServiceImpl
iDataDictionaryService
;
@Autowired
private
TzsServiceFeignClient
tzsServiceFeignClient
;
...
...
@@ -181,219 +183,258 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgVehicleInformation
>
save
(
String
submit
,
JSONObject
map
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
JgVehicleInformationDto
vehicleInfoDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
JgVehicleInformationDto
.
class
);
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"equipmentLists"
);
if
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
||
equipmentLists
.
stream
().
map
(
v
->
(
String
)
v
.
get
(
"chargingMedium"
)).
distinct
().
count
()
!=
1
)
{
throw
new
BadRequest
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
?
"请选择设备信息!"
:
"请选择相同充装介质设备!"
);
}
try
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
JgVehicleInformationDto
vehicleInfoDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
JgVehicleInformationDto
.
class
);
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfoList
=
idxBizJgInspectionDetectionInfoService
.
checkInspectionInfo
(
equipmentLists
.
stream
()
.
map
(
v
->
(
String
)
v
.
get
(
"record"
))
.
collect
(
Collectors
.
toList
())
);
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"equipmentLists"
);
if
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
||
equipmentLists
.
stream
().
map
(
v
->
(
String
)
v
.
get
(
"chargingMedium"
)).
distinct
().
count
()
!=
1
)
{
throw
new
BadRequest
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
?
"请选择设备信息!"
:
"请选择相同充装介质设备!"
);
}
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submit
))
{
this
.
repeatUsedEquipCheck
(
equipmentLists
,
reginParams
.
getCompany
().
getCompanyCode
());
}
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfoList
=
idxBizJgInspectionDetectionInfoService
.
checkInspectionInfo
(
equipmentLists
.
stream
()
.
map
(
v
->
(
String
)
v
.
get
(
"record"
))
.
collect
(
Collectors
.
toList
())
);
if
(
inspectionDetectionInfoList
.
stream
().
anyMatch
(
info
->
ObjectUtils
.
isEmpty
(
info
)
||
ObjectUtils
.
isEmpty
(
info
.
getInspectType
())
||
ObjectUtils
.
isEmpty
(
info
.
getInspectConclusion
())
||
ObjectUtils
.
isEmpty
(
info
.
getInspectOrgCode
())))
{
throw
new
BadRequest
(
"请补充设备检验检测信息后提交!"
);
}
vehicleInfoDto
.
setNextInspectionDate
(
inspectionDetectionInfoList
.
stream
()
.
map
(
IdxBizJgInspectionDetectionInfo:
:
getNextInspectDate
)
.
filter
(
Objects:
:
nonNull
)
.
min
(
Date:
:
compareTo
)
.
orElse
(
null
));
if
(
inspectionDetectionInfoList
.
stream
().
anyMatch
(
info
->
ObjectUtils
.
isEmpty
(
info
)
||
ObjectUtils
.
isEmpty
(
info
.
getInspectType
())
||
ObjectUtils
.
isEmpty
(
info
.
getInspectConclusion
())
||
ObjectUtils
.
isEmpty
(
info
.
getInspectOrgCode
())))
{
throw
new
BadRequest
(
"请补充设备检验检测信息后提交!"
);
}
vehicleInfoDto
.
setNextInspectionDate
(
inspectionDetectionInfoList
.
stream
()
.
map
(
IdxBizJgInspectionDetectionInfo:
:
getNextInspectDate
)
.
filter
(
Objects:
:
nonNull
)
.
min
(
Date:
:
compareTo
)
.
orElse
(
null
));
CompanyBo
company
=
reginParams
.
getCompany
();
vehicleInfoDto
.
setCreateDate
(
new
Date
());
vehicleInfoDto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
// 车牌号码 字段的唯一性校验
LambdaQueryWrapper
<
JgVehicleInformation
>
vehicleInfoWrapper
=
new
LambdaQueryWrapper
<
JgVehicleInformation
>()
.
eq
(
JgVehicleInformation:
:
getCarNumber
,
vehicleInfoDto
.
getCarNumber
())
.
eq
(
JgVehicleInformation:
:
getIsDelete
,
false
)
.
ne
(
JgVehicleInformation:
:
getStatus
,
"已作废"
)
.
ne
(
JgVehicleInformation:
:
getStatus
,
"使用单位待提交"
)
.
ne
(!
ValidationUtil
.
isEmpty
(
vehicleInfoDto
.
getSequenceNbr
()),
JgVehicleInformation:
:
getSequenceNbr
,
vehicleInfoDto
.
getSequenceNbr
());
Integer
count
=
this
.
baseMapper
.
selectCount
(
vehicleInfoWrapper
);
if
(
count
>
0
)
{
throw
new
LocalBadRequest
(
"车牌号码已存在,请重新输入!"
);
}
CompanyBo
company
=
reginParams
.
getCompany
();
vehicleInfoDto
.
setCreateDate
(
new
Date
());
vehicleInfoDto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
// 【A109】 车用气瓶登记业务 车辆VIN码 校验唯一性
LambdaQueryWrapper
<
JgVehicleInformation
>
informationLambdaQueryWrapper
=
new
LambdaQueryWrapper
<
JgVehicleInformation
>()
.
eq
(
JgVehicleInformation:
:
getIdentificationCode
,
vehicleInfoDto
.
getIdentificationCode
())
.
eq
(
JgVehicleInformation:
:
getIsDelete
,
false
)
.
ne
(
JgVehicleInformation:
:
getStatus
,
"已作废"
)
.
ne
(
JgVehicleInformation:
:
getStatus
,
"使用单位待提交"
)
.
ne
(!
ValidationUtil
.
isEmpty
(
vehicleInfoDto
.
getSequenceNbr
()),
JgVehicleInformation:
:
getSequenceNbr
,
vehicleInfoDto
.
getSequenceNbr
());
Integer
identificationCodeCount
=
this
.
baseMapper
.
selectCount
(
informationLambdaQueryWrapper
);
if
(
identificationCodeCount
>
0
)
{
throw
new
BadRequest
(
"车辆VIN码已存在,请重新输入!"
);
}
// 车牌号码 字段的唯一性校验
LambdaQueryWrapper
<
JgVehicleInformation
>
vehicleInfoWrapper
=
new
LambdaQueryWrapper
<
JgVehicleInformation
>()
.
eq
(
JgVehicleInformation:
:
getCarNumber
,
vehicleInfoDto
.
getCarNumber
())
.
eq
(
JgVehicleInformation:
:
getIsDelete
,
false
)
.
ne
(
JgVehicleInformation:
:
getStatus
,
"已作废"
)
.
ne
(
JgVehicleInformation:
:
getStatus
,
"使用单位待提交"
)
.
ne
(!
ValidationUtil
.
isEmpty
(
vehicleInfoDto
.
getSequenceNbr
()),
JgVehicleInformation:
:
getSequenceNbr
,
vehicleInfoDto
.
getSequenceNbr
());
Integer
count
=
this
.
baseMapper
.
selectCount
(
vehicleInfoWrapper
);
if
(
count
>
0
)
{
throw
new
LocalBadRequest
(
"车牌号码已存在,请重新输入!"
);
}
// 使用单位信息
if
(
"个人主体"
.
equals
(
company
.
getCompanyType
()))
{
vehicleInfoDto
.
setUseUnitName
(
company
.
getCompanyName
().
split
(
"_"
)[
1
]);
vehicleInfoDto
.
setUseUnitCreditCode
(
company
.
getCompanyCode
().
split
(
"_"
)[
1
]);
}
else
{
vehicleInfoDto
.
setUseUnitName
(
company
.
getCompanyName
());
vehicleInfoDto
.
setUseUnitCreditCode
(
company
.
getCompanyCode
());
}
// 【A109】 车用气瓶登记业务 车辆VIN码 校验唯一性
LambdaQueryWrapper
<
JgVehicleInformation
>
informationLambdaQueryWrapper
=
new
LambdaQueryWrapper
<
JgVehicleInformation
>()
.
eq
(
JgVehicleInformation:
:
getIdentificationCode
,
vehicleInfoDto
.
getIdentificationCode
())
.
eq
(
JgVehicleInformation:
:
getIsDelete
,
false
)
.
ne
(
JgVehicleInformation:
:
getStatus
,
"已作废"
)
.
ne
(
JgVehicleInformation:
:
getStatus
,
"使用单位待提交"
)
.
ne
(!
ValidationUtil
.
isEmpty
(
vehicleInfoDto
.
getSequenceNbr
()),
JgVehicleInformation:
:
getSequenceNbr
,
vehicleInfoDto
.
getSequenceNbr
());
Integer
identificationCodeCount
=
this
.
baseMapper
.
selectCount
(
informationLambdaQueryWrapper
);
if
(
identificationCodeCount
>
0
)
{
throw
new
BadRequest
(
"车辆VIN码已存在,请重新输入!"
);
}
// 使用单位信息
if
(
"个人主体"
.
equals
(
company
.
getCompanyType
()))
{
vehicleInfoDto
.
setUseUnitName
(
company
.
getCompanyName
().
split
(
"_"
)[
1
]);
vehicleInfoDto
.
setUseUnitCreditCode
(
company
.
getCompanyCode
().
split
(
"_"
)[
1
]);
}
else
{
vehicleInfoDto
.
setUseUnitName
(
company
.
getCompanyName
());
vehicleInfoDto
.
setUseUnitCreditCode
(
company
.
getCompanyCode
());
}
// 接收单位信息
if
(!
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getReceiveOrgCode
()))
{
String
[]
splitReceiveOrgCode
=
vehicleInfoDto
.
getReceiveOrgCode
().
split
(
"_"
);
CompanyModel
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
splitReceiveOrgCode
[
0
]).
getResult
();
vehicleInfoDto
.
setReceiveOrgCode
(
splitReceiveOrgCode
[
0
]);
vehicleInfoDto
.
setReceiveOrgName
(
splitReceiveOrgCode
[
1
]);
vehicleInfoDto
.
setReceiveCompanyCode
(
result
.
getCompanyCode
());
}
//检验机构信息
if
(!
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getInspectUnitCreditCode
()))
{
String
[]
splitInspectUnitCreditCode
=
vehicleInfoDto
.
getInspectUnitCreditCode
().
split
(
"_"
);
vehicleInfoDto
.
setInspectUnitCreditCode
(
splitInspectUnitCreditCode
[
0
]);
vehicleInfoDto
.
setInspectUnitName
(
splitInspectUnitCreditCode
[
1
]);
}
//安装单位信息
if
(!
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getInstallUnitCode
()))
{
String
[]
splitInstallUnitCode
=
vehicleInfoDto
.
getInstallUnitCode
().
split
(
"_"
);
vehicleInfoDto
.
setInstallUnitCode
(
splitInstallUnitCode
[
0
]);
vehicleInfoDto
.
setInstallUnitName
(
splitInstallUnitCode
[
1
]);
}
//属地监管部门
if
(!
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getOrgBranchCode
()))
{
String
[]
splitOrgBranchCode
=
vehicleInfoDto
.
getOrgBranchCode
().
split
(
"_"
);
vehicleInfoDto
.
setOrgBranchCode
(
splitOrgBranchCode
[
0
]);
vehicleInfoDto
.
setOrgBranchName
(
splitOrgBranchCode
[
1
]);
}
// 安全管理员
Optional
.
ofNullable
(
map
.
getString
(
"safetyManagerId"
))
.
filter
(
manager
->
manager
.
contains
(
"_"
))
.
map
(
manager
->
manager
.
split
(
"_"
))
.
ifPresent
(
data
->
{
vehicleInfoDto
.
setSafetyManagerId
(
data
[
0
]);
vehicleInfoDto
.
setSafetyManagerName
(
data
[
1
]);
});
// 产权单位信息
if
(!
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getEstateUnitName
()))
{
String
[]
data
=
String
.
valueOf
(
map
.
getString
(
"estateUnitName"
)).
split
(
"_"
);
vehicleInfoDto
.
setEstateUnitCreditCode
(
data
[
0
]);
vehicleInfoDto
.
setEstateUnitName
(
data
[
1
]);
}
// 接收单位信息
if
(!
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getReceiveOrgCode
()))
{
String
[]
splitReceiveOrgCode
=
vehicleInfoDto
.
getReceiveOrgCode
().
split
(
"_"
);
CompanyModel
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
splitReceiveOrgCode
[
0
]).
getResult
();
vehicleInfoDto
.
setReceiveOrgCode
(
splitReceiveOrgCode
[
0
]);
vehicleInfoDto
.
setReceiveOrgName
(
splitReceiveOrgCode
[
1
]);
vehicleInfoDto
.
setReceiveCompanyCode
(
result
.
getCompanyCode
());
}
//检验机构信息
if
(!
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getInspectUnitCreditCode
()))
{
String
[]
splitInspectUnitCreditCode
=
vehicleInfoDto
.
getInspectUnitCreditCode
().
split
(
"_"
);
vehicleInfoDto
.
setInspectUnitCreditCode
(
splitInspectUnitCreditCode
[
0
]);
vehicleInfoDto
.
setInspectUnitName
(
splitInspectUnitCreditCode
[
1
]);
}
//安装单位信息
if
(!
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getInstallUnitCode
()))
{
String
[]
splitInstallUnitCode
=
vehicleInfoDto
.
getInstallUnitCode
().
split
(
"_"
);
vehicleInfoDto
.
setInstallUnitCode
(
splitInstallUnitCode
[
0
]);
vehicleInfoDto
.
setInstallUnitName
(
splitInstallUnitCode
[
1
]);
}
//属地监管部门
if
(!
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getOrgBranchCode
()))
{
String
[]
splitOrgBranchCode
=
vehicleInfoDto
.
getOrgBranchCode
().
split
(
"_"
);
vehicleInfoDto
.
setOrgBranchCode
(
splitOrgBranchCode
[
0
]);
vehicleInfoDto
.
setOrgBranchName
(
splitOrgBranchCode
[
1
]);
}
// 其他附件
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
)))
{
vehicleInfoDto
.
setOtherAccessories
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
}
// 安全管理员
Optional
.
ofNullable
(
map
.
getString
(
"safetyManagerId"
))
.
filter
(
manager
->
manager
.
contains
(
"_"
))
.
map
(
manager
->
manager
.
split
(
"_"
))
.
ifPresent
(
data
->
{
vehicleInfoDto
.
setSafetyManagerId
(
data
[
0
]);
vehicleInfoDto
.
setSafetyManagerName
(
data
[
1
]);
JgVehicleInformation
vehicleInformation
=
new
JgVehicleInformation
();
BeanUtils
.
copyProperties
(
vehicleInfoDto
,
vehicleInformation
);
vehicleInformation
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
vehicleInformation
.
setRegDate
(
new
Date
());
vehicleInformation
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
vehicleInformation
.
setGasNum
(
equipmentLists
.
size
());
vehicleInformation
.
setVolume
(
String
.
valueOf
(
equipmentLists
.
stream
()
.
mapToDouble
(
x
->
Double
.
parseDouble
(
String
.
valueOf
(
x
.
get
(
"singleBottleVolume"
))))
.
sum
()));
vehicleInformation
.
setFillingMedium
(
equipmentLists
.
get
(
0
).
get
(
"chargingMedium"
)
+
""
);
boolean
hasId
=
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getSequenceNbr
());
//新增
if
(
hasId
)
{
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
)
&&
listResponseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
log
.
error
(
"车用气瓶使用登记申请单单号获取失败!"
);
throw
new
BadRequest
(
"车用气瓶使用登记申请单单号获取失败!"
);
}
String
applyNo
=
listResponseModel
.
getResult
().
get
(
0
);
vehicleInformation
.
setApplyNo
(
applyNo
);
vehicleInformation
.
setStatus
(
SUBMIT_DATA
.
equals
(
submit
)
?
WorkFlowStatusEnum
.
USE_SUBMIT
.
getPass
()
:
WorkFlowStatusEnum
.
USE_RECEIVE
.
getPass
());
this
.
save
(
vehicleInformation
);
}
else
{
// 删除以前设备关联关系
this
.
getBaseMapper
().
updateById
(
vehicleInformation
);
LambdaQueryWrapper
<
JgVehicleInformationEq
>
lambda
=
new
QueryWrapper
<
JgVehicleInformationEq
>().
lambda
();
lambda
.
eq
(
JgVehicleInformationEq:
:
getVehicleId
,
vehicleInformation
.
getSequenceNbr
());
jgVehicleInformationEqService
.
getBaseMapper
().
delete
(
lambda
);
}
// 更新关联气瓶信息
if
(!
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
List
<
JgVehicleInformationEq
>
equipList
=
new
ArrayList
<>();
equipmentLists
.
forEach
(
x
->
{
JgVehicleInformationEq
equip
=
new
JgVehicleInformationEq
();
equip
.
setEquId
(
String
.
valueOf
(
x
.
get
(
"record"
)));
equip
.
setVehicleId
(
vehicleInformation
.
getSequenceNbr
()
+
""
);
equipList
.
add
(
equip
);
jgResumeInfoService
.
createWithModel
(
JgResumeInfoDto
.
builder
()
.
applyNo
(
vehicleInformation
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
())
.
businessId
(
vehicleInformation
.
getSequenceNbr
()
+
""
)
.
equId
(
String
.
valueOf
(
x
.
get
(
"record"
)))
.
approvalUnit
(
vehicleInformation
.
getReceiveOrgName
())
.
approvalUnitCode
(
vehicleInformation
.
getReceiveOrgCode
())
.
status
(
"正常"
)
.
build
());
});
// 产权单位信息
if
(!
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getEstateUnitName
()))
{
String
[]
data
=
String
.
valueOf
(
map
.
getString
(
"estateUnitName"
)).
split
(
"_"
);
vehicleInfoDto
.
setEstateUnitCreditCode
(
data
[
0
]);
vehicleInfoDto
.
setEstateUnitName
(
data
[
1
]);
}
// 其他附件
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"otherAccessories"
)))
{
vehicleInfoDto
.
setOtherAccessories
(
JSONObject
.
toJSONString
(
map
.
get
(
"otherAccessories"
)));
}
JgVehicleInformation
vehicleInformation
=
new
JgVehicleInformation
();
BeanUtils
.
copyProperties
(
vehicleInfoDto
,
vehicleInformation
);
vehicleInformation
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
vehicleInformation
.
setRegDate
(
new
Date
());
vehicleInformation
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
vehicleInformation
.
setGasNum
(
equipmentLists
.
size
());
vehicleInformation
.
setVolume
(
String
.
valueOf
(
equipmentLists
.
stream
()
.
mapToDouble
(
x
->
Double
.
parseDouble
(
String
.
valueOf
(
x
.
get
(
"singleBottleVolume"
))))
.
sum
()));
vehicleInformation
.
setFillingMedium
(
equipmentLists
.
get
(
0
).
get
(
"chargingMedium"
)
+
""
);
boolean
hasId
=
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getSequenceNbr
());
//新增
if
(
hasId
)
{
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
)
&&
listResponseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
log
.
error
(
"车用气瓶使用登记申请单单号获取失败!"
);
throw
new
BadRequest
(
"车用气瓶使用登记申请单单号获取失败!"
);
// 保存关联设备信息
jgVehicleInformationEqService
.
saveBatch
(
equipList
);
}
String
applyNo
=
listResponseModel
.
getResult
().
get
(
0
);
vehicleInformation
.
setApplyNo
(
applyNo
);
vehicleInformation
.
setStatus
(
SUBMIT_DATA
.
equals
(
submit
)
?
WorkFlowStatusEnum
.
USE_SUBMIT
.
getPass
()
:
WorkFlowStatusEnum
.
USE_RECEIVE
.
getPass
());
this
.
save
(
vehicleInformation
);
}
else
{
// 删除以前设备关联关系
this
.
getBaseMapper
().
updateById
(
vehicleInformation
);
LambdaQueryWrapper
<
JgVehicleInformationEq
>
lambda
=
new
QueryWrapper
<
JgVehicleInformationEq
>().
lambda
();
lambda
.
eq
(
JgVehicleInformationEq:
:
getVehicleId
,
vehicleInformation
.
getSequenceNbr
());
jgVehicleInformationEqService
.
getBaseMapper
().
delete
(
lambda
);
}
// 更新关联气瓶信息
if
(!
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
List
<
JgVehicleInformationEq
>
equipList
=
new
ArrayList
<>();
equipmentLists
.
forEach
(
x
->
{
JgVehicleInformationEq
equip
=
new
JgVehicleInformationEq
();
equip
.
setEquId
(
String
.
valueOf
(
x
.
get
(
"record"
)));
equip
.
setVehicleId
(
vehicleInformation
.
getSequenceNbr
()
+
""
);
equipList
.
add
(
equip
);
jgResumeInfoService
.
createWithModel
(
JgResumeInfoDto
.
builder
()
.
applyNo
(
vehicleInformation
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
())
.
businessId
(
vehicleInformation
.
getSequenceNbr
()
+
""
)
.
equId
(
String
.
valueOf
(
x
.
get
(
"record"
)))
.
approvalUnit
(
vehicleInformation
.
getReceiveOrgName
())
.
approvalUnitCode
(
vehicleInformation
.
getReceiveOrgCode
())
.
status
(
"正常"
)
.
build
());
});
// 保存关联设备信息
jgVehicleInformationEqService
.
saveBatch
(
equipList
);
}
// 判断当前是否为提交
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submit
))
{
this
.
checkVesselCylinderIsUsed
(
vehicleInformation
.
getSequenceNbr
(),
equipmentLists
.
stream
()
.
map
(
x
->
String
.
valueOf
(
x
.
get
(
"record"
)))
.
collect
(
Collectors
.
toList
()));
List
<
String
>
roleListNext
=
new
ArrayList
<>();
List
<
String
>
roleListAll
=
new
ArrayList
<>();
// 新增提交,没有instanceId需要发起流程
if
(
StringUtils
.
isEmpty
(
vehicleInformation
.
getInstanceId
()))
{
// 启动并执行流程
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
DEFINITION_KEY
);
dto
.
setBusinessKey
(
vehicleInformation
.
getApplyNo
());
dto
.
setCompleteFirstTask
(
Boolean
.
TRUE
);
// 下一节点执行人单位(下节点接收机构code)
dto
.
setNextExecuteUserCompanyCode
(
vehicleInformation
.
getReceiveCompanyCode
());
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTasks
=
workflowService
.
startBatch
(
actWorkflowBatchDTO
);
this
.
buildRoleList
(
processTasks
,
roleListNext
,
roleListAll
);
List
<
WorkflowResultDto
>
workflowResultDtoList
=
commonService
.
buildWorkFlowInfo
(
processTasks
);
if
(!
ObjectUtils
.
isEmpty
(
workflowResultDtoList
)
&&
!
ObjectUtils
.
isEmpty
(
workflowResultDtoList
.
get
(
0
)))
{
WorkflowResultDto
workflowResultDto
=
workflowResultDtoList
.
get
(
0
);
this
.
updateData
(
vehicleInformation
.
getSequenceNbr
(),
"0"
,
workflowResultDto
,
Boolean
.
TRUE
,
String
.
valueOf
(
map
.
get
(
"equDefineCode"
)));
// 判断当前是否为提交
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submit
))
{
this
.
checkVesselCylinderIsUsed
(
vehicleInformation
.
getSequenceNbr
(),
equipmentLists
.
stream
()
.
map
(
x
->
String
.
valueOf
(
x
.
get
(
"record"
)))
.
collect
(
Collectors
.
toList
()));
List
<
String
>
roleListNext
=
new
ArrayList
<>();
List
<
String
>
roleListAll
=
new
ArrayList
<>();
// 新增提交,没有instanceId需要发起流程
if
(
StringUtils
.
isEmpty
(
vehicleInformation
.
getInstanceId
()))
{
// 启动并执行流程
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
DEFINITION_KEY
);
dto
.
setBusinessKey
(
vehicleInformation
.
getApplyNo
());
dto
.
setCompleteFirstTask
(
Boolean
.
TRUE
);
// 下一节点执行人单位(下节点接收机构code)
dto
.
setNextExecuteUserCompanyCode
(
vehicleInformation
.
getReceiveCompanyCode
());
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTasks
=
workflowService
.
startBatch
(
actWorkflowBatchDTO
);
this
.
buildRoleList
(
processTasks
,
roleListNext
,
roleListAll
);
List
<
WorkflowResultDto
>
workflowResultDtoList
=
commonService
.
buildWorkFlowInfo
(
processTasks
);
if
(!
ObjectUtils
.
isEmpty
(
workflowResultDtoList
)
&&
!
ObjectUtils
.
isEmpty
(
workflowResultDtoList
.
get
(
0
)))
{
WorkflowResultDto
workflowResultDto
=
workflowResultDtoList
.
get
(
0
);
this
.
updateData
(
vehicleInformation
.
getSequenceNbr
(),
"0"
,
workflowResultDto
,
Boolean
.
TRUE
,
String
.
valueOf
(
map
.
get
(
"equDefineCode"
)));
}
}
else
{
// 执行流程
flowExecute
(
vehicleInformation
.
getSequenceNbr
(),
vehicleInformation
.
getInstanceId
(),
"0"
,
""
,
String
.
valueOf
(
map
.
get
(
"nextTaskId"
)),
String
.
valueOf
(
map
.
get
(
"equDefineCode"
)));
}
}
else
{
// 执行流程
flowExecute
(
vehicleInformation
.
getSequenceNbr
(),
vehicleInformation
.
getInstanceId
(),
"0"
,
""
,
String
.
valueOf
(
map
.
get
(
"nextTaskId"
)),
String
.
valueOf
(
map
.
get
(
"equDefineCode"
)));
ArrayList
<
TaskModelDto
>
list
=
new
ArrayList
<>();
TaskModelDto
dto
=
new
TaskModelDto
();
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
BeanUtil
.
copyProperties
(
vehicleInformation
,
taskMessageDto
);
taskMessageDto
.
setEquipId
(
String
.
valueOf
(
map
.
get
(
"equipId"
)));
dto
.
setModel
(
taskMessageDto
);
dto
.
setTaskContent
(
"来自车用气瓶【"
+
vehicleInformation
.
getCarNumber
()
+
"】的登记业务办理,"
+
"【申请单号:"
+
vehicleInformation
.
getApplyNo
()
+
"】"
);
dto
.
setTaskCode
(
vehicleInformation
.
getApplyNo
());
dto
.
setTaskType
(
String
.
valueOf
(
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getCode
()));
dto
.
setRelationId
(
String
.
valueOf
(
vehicleInformation
.
getSequenceNbr
()));
dto
.
setNextExecuteUser
(
""
);
list
.
add
(
dto
);
commonService
.
buildTaskModel
(
list
);
}
}
else
{
ArrayList
<
TaskModelDto
>
list
=
new
ArrayList
<>();
TaskModelDto
dto
=
new
TaskModelDto
();
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
BeanUtil
.
copyProperties
(
vehicleInformation
,
taskMessageDto
);
taskMessageDto
.
setEquipId
(
String
.
valueOf
(
map
.
get
(
"equipId"
)));
dto
.
setModel
(
taskMessageDto
);
dto
.
setTaskContent
(
"来自车用气瓶【"
+
vehicleInformation
.
getCarNumber
()
+
"】的登记业务办理,"
+
"【申请单号:"
+
vehicleInformation
.
getApplyNo
()
+
"】"
);
dto
.
setTaskCode
(
vehicleInformation
.
getApplyNo
());
dto
.
setTaskType
(
String
.
valueOf
(
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getCode
()));
dto
.
setRelationId
(
String
.
valueOf
(
vehicleInformation
.
getSequenceNbr
()));
dto
.
setNextExecuteUser
(
""
);
list
.
add
(
dto
);
commonService
.
buildTaskModel
(
list
);
// 设备数据存历史数据,在流程完成时使用
commonService
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
(),
JSON
.
parseArray
(
JSON
.
toJSONString
(
equipmentLists
)),
null
,
vehicleInformation
.
getSequenceNbr
()
+
""
);
return
Collections
.
singletonList
(
vehicleInformation
);
}
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
();
}
}
private
void
repeatUsedEquipCheck
(
List
<
Map
<
String
,
Object
>>
equipList
,
String
companyCode
)
{
equipList
.
forEach
(
equipMap
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
equipMap
.
get
(
"record"
)),
companyCode
));
}
/**
* 删除 redis校验重复引用设备的数据
*/
private
void
delRepeatUseEquipData
(
JgVehicleInformation
notice
)
{
if
(
NOT_FLOWING_STATE
.
contains
(
notice
.
getStatus
()))
{
LambdaQueryWrapper
<
JgVehicleInformationEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
JgVehicleInformationEq:
:
getVehicleId
,
notice
.
getSequenceNbr
());
List
<
JgVehicleInformationEq
>
noticeEqList
=
jgVehicleInformationEqService
.
list
(
queryWrapper
);
noticeEqList
.
forEach
(
noticeEq
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
)
.
delDataForCheckEquipRepeatUsed
(
Collections
.
singletonList
(
noticeEq
.
getEquId
()),
notice
.
getUseUnitCreditCode
()));
}
// 设备数据存历史数据,在流程完成时使用
commonService
.
saveOrUpdateHistory
(
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
(),
JSON
.
parseArray
(
JSON
.
toJSONString
(
equipmentLists
)),
null
,
vehicleInformation
.
getSequenceNbr
()
+
""
);
return
Collections
.
singletonList
(
vehicleInformation
);
}
private
void
rollBackForDelRedisData
()
{
FlowingEquipRedisContext
.
getContext
().
forEach
(
e
->
{
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
DEFINITION_KEY
)
.
delDataForCheckWithKey
(
e
.
getData
(),
e
.
getRedisKey
());
});
}
/**
...
...
@@ -451,6 +492,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// redis流程实时数据更新
commonService
.
saveExecuteFlowData2Redis
(
instanceId
,
this
.
buildInstanceRuntimeData
(
vehicleInfo
));
this
.
delRepeatUseEquipData
(
vehicleInfo
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -535,7 +577,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
if
(
useCodeResult
!=
null
)
{
String
result
=
dto
.
getEstateUnitCreditCode
()
+
"_"
+
dto
.
getEstateUnitName
()
+
(
"个人主体"
.
equals
(
useCodeResult
.
getUnitType
())
?
"_"
+
dto
.
getEstateUnitCreditCode
().
substring
(
dto
.
getEstateUnitCreditCode
().
length
()
-
4
)
:
""
);
?
"_"
+
dto
.
getEstateUnitCreditCode
().
substring
(
dto
.
getEstateUnitCreditCode
().
length
()
-
4
)
:
""
);
vo
.
setEstateUnitName
(
result
);
}
vo
.
setIdCardFront
(
ObjectUtils
.
isEmpty
(
dto
.
getIdCardFront
())
?
null
:
JSON
.
parseArray
(
dto
.
getIdCardFront
()));
...
...
@@ -642,6 +684,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
WorkflowResultDto
workflowResultDto
=
resultDto
.
get
(
0
);
this
.
updateData
(
jgVehicleInformation
.
getSequenceNbr
(),
operate
,
workflowResultDto
,
Boolean
.
FALSE
,
equDefineCode
);
}
this
.
delRepeatUseEquipData
(
jgVehicleInformation
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
@@ -749,7 +792,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
jsonData
);
// 登记证记录主键
Long
changeRecordId
=
sequence
.
nextId
();
Long
changeRecordId
=
sequence
.
nextId
();
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
mapData
=
jsonArray
.
getJSONObject
(
i
);
...
...
@@ -816,10 +859,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
// 生成证书管理表记录
generateRegistrationManage
(
jgVehicleInformation
,
registerInfo
);
generateRegistrationManage
(
jgVehicleInformation
,
registerInfo
);
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
jgVehicleInformation
,
registerInfo
,
changeRecordId
,
taskV2Model
);
generateCertificateChangeRecord
(
jgVehicleInformation
,
registerInfo
,
changeRecordId
,
taskV2Model
);
}
this
.
getBaseMapper
().
updateById
(
jgVehicleInformation
);
commonService
.
saveExecuteFlowData2Redis
(
jgVehicleInformation
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgVehicleInformation
));
...
...
@@ -880,14 +923,13 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
/**
* 批量删除
*
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteBatch
(
List
<
Long
>
ids
)
{
ids
.
forEach
(
id
->
{
JgVehicleInformation
vehicleInformation
=
this
.
baseMapper
.
selectById
(
id
);
// 删除代办 + 中止流程
commonService
.
deleteTaskModel
(
String
.
valueOf
(
id
),
vehicleInformation
.
getInstanceId
());
commonService
.
deleteTaskModel
(
String
.
valueOf
(
id
),
vehicleInformation
.
getInstanceId
());
// 删除单子
this
.
deleteBySeq
(
id
);
// 删除单子对应设备
...
...
@@ -901,7 +943,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
public
Page
<
Map
<
String
,
Object
>>
getPageList
(
JgVehicleInformationDto
dto
,
String
sort
,
Page
<
Map
<
String
,
Object
>>
page
,
List
<
String
>
roleIds
)
{
SortVo
sortMap
=
commonService
.
sortFieldConversion
(
sort
);
return
this
.
baseMapper
.
getListPage
(
page
,
sortMap
,
dto
,
roleIds
);
return
this
.
baseMapper
.
getListPage
(
page
,
sortMap
,
dto
,
roleIds
);
}
private
void
updateEquipMessage
(
JgVehicleInformation
jgVehicleInformation
,
JSONObject
map
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgOtherInfo
otherInfo
)
{
...
...
@@ -1342,6 +1384,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
/**
* 作废的证变更内容
*
* @param obj JgVehicleInformation
* @return result
*/
...
...
@@ -1458,14 +1501,14 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
}
private
void
generateCertificateChangeRecord
(
JgVehicleInformation
jgVehicleInformation
,
IdxBizJgRegisterInfo
registerInfo
,
Long
changeRecordId
,
TaskV2Model
taskV2Model
)
{
private
void
generateCertificateChangeRecord
(
JgVehicleInformation
jgVehicleInformation
,
IdxBizJgRegisterInfo
registerInfo
,
Long
changeRecordId
,
TaskV2Model
taskV2Model
)
{
Map
<
String
,
String
>
equType
=
new
HashMap
<>();
equType
.
put
(
"equList"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquList
()));
equType
.
put
(
"equListCode"
,
registerInfo
.
getEquList
());
equType
.
put
(
"equCategory"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquCategory
()));
equType
.
put
(
"equCategoryCode"
,
registerInfo
.
getEquCategory
());
equType
.
put
(
"equDefine"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquDefine
()));
equType
.
put
(
"equDefineCode"
,
registerInfo
.
getEquDefine
());
equType
.
put
(
"equList"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquList
()));
equType
.
put
(
"equListCode"
,
registerInfo
.
getEquList
());
equType
.
put
(
"equCategory"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquCategory
()));
equType
.
put
(
"equCategoryCode"
,
registerInfo
.
getEquCategory
());
equType
.
put
(
"equDefine"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquDefine
()));
equType
.
put
(
"equDefineCode"
,
registerInfo
.
getEquDefine
());
JgCertificateChangeRecord
changeRecord
=
new
JgCertificateChangeRecord
();
changeRecord
.
setApplyNo
(
jgVehicleInformation
.
getApplyNo
());
changeRecord
.
setReceiveOrgName
(
jgVehicleInformation
.
getReceiveOrgName
());
...
...
@@ -1475,7 +1518,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
changeRecord
.
setChangeContent
(
this
.
buildRecordContent
(
jgVehicleInformation
));
//变更内容
changeRecord
.
setUseRegistrationCode
(
jgVehicleInformation
.
getUseRegistrationCode
());
//使用登记编号
changeRecord
.
setReceiveCompanyCode
(
jgVehicleInformation
.
getReceiveCompanyCode
());
//接收机构公司代码
changeRecord
.
setCertificateNo
(
commonService
.
generateCertificateNo
(
equType
,
new
Date
(),
jgVehicleInformation
.
getReceiveCompanyCode
()));
//登记证书唯一码
changeRecord
.
setCertificateNo
(
commonService
.
generateCertificateNo
(
equType
,
new
Date
(),
jgVehicleInformation
.
getReceiveCompanyCode
()));
//登记证书唯一码
changeRecord
.
setUseUnitCreditCode
(
jgVehicleInformation
.
getUseUnitCreditCode
());
//使用单位统一信用代码
changeRecord
.
setUseUnitName
(
jgVehicleInformation
.
getUseUnitName
());
//使用单位名称
changeRecord
.
setEquCategory
(
registerInfo
.
getEquCategory
());
//设备类别编码
...
...
@@ -1485,17 +1528,17 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
certificateChangeRecordService
.
save
(
changeRecord
);
}
private
void
generateRegistrationManage
(
JgVehicleInformation
jgVehicleInformation
,
IdxBizJgRegisterInfo
registerInfo
)
{
private
void
generateRegistrationManage
(
JgVehicleInformation
jgVehicleInformation
,
IdxBizJgRegisterInfo
registerInfo
)
{
// 使用单位信息
Map
<
String
,
Object
>
enterpriseInfo
=
commonService
.
getEnterpriseInfo
(
jgVehicleInformation
.
getUseUnitCreditCode
());
//
Map
<
String
,
String
>
equType
=
new
HashMap
<>();
equType
.
put
(
"equList"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquList
()));
equType
.
put
(
"equListCode"
,
registerInfo
.
getEquList
());
equType
.
put
(
"equCategory"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquCategory
()));
equType
.
put
(
"equCategoryCode"
,
registerInfo
.
getEquCategory
());
equType
.
put
(
"equDefine"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquDefine
()));
equType
.
put
(
"equDefineCode"
,
registerInfo
.
getEquDefine
());
equType
.
put
(
"equList"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquList
()));
equType
.
put
(
"equListCode"
,
registerInfo
.
getEquList
());
equType
.
put
(
"equCategory"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquCategory
()));
equType
.
put
(
"equCategoryCode"
,
registerInfo
.
getEquCategory
());
equType
.
put
(
"equDefine"
,
this
.
baseMapper
.
getEquCategoryNameByCode
(
registerInfo
.
getEquDefine
()));
equType
.
put
(
"equDefineCode"
,
registerInfo
.
getEquDefine
());
JgUseRegistrationManage
jgUseRegistrationManage
=
new
JgUseRegistrationManage
();
jgUseRegistrationManage
.
setUseUnitName
(
jgVehicleInformation
.
getUseUnitName
());
jgUseRegistrationManage
.
setApplyNo
(
jgVehicleInformation
.
getApplyNo
());
...
...
@@ -1523,14 +1566,14 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
jgUseRegistrationManage
.
setUseUnitCreditCode
(
jgVehicleInformation
.
getUseUnitCreditCode
());
jgUseRegistrationManage
.
setReceiveCompanyCode
(
jgVehicleInformation
.
getReceiveCompanyCode
());
jgUseRegistrationManage
.
setCarNumber
(
jgVehicleInformation
.
getCarNumber
());
jgUseRegistrationManage
.
setCertificateNo
(
commonService
.
generateCertificateNo
(
equType
,
new
Date
(),
jgVehicleInformation
.
getReceiveCompanyCode
()));
jgUseRegistrationManage
.
setCertificateNo
(
commonService
.
generateCertificateNo
(
equType
,
new
Date
(),
jgVehicleInformation
.
getReceiveCompanyCode
()));
jgUseRegistrationManageService
.
save
(
jgUseRegistrationManage
);
}
private
String
buildRecordContent
(
JgVehicleInformation
obj
)
{
//张三办理了【单位变更】 ,单号【DWBG202407050001】,办理日期2024-07-05
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy年MM月dd日"
);
return
obj
.
getRecUserName
()
+
"办理了【"
+
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
()+
"】,"
+
return
obj
.
getRecUserName
()
+
"办理了【"
+
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
()
+
"】,"
+
"单号【"
+
obj
.
getApplyNo
()
+
"】,申请日期"
+
simpleDateFormat
.
format
(
obj
.
getRecDate
());
}
...
...
@@ -1742,7 +1785,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
vehicleInformation
.
setAuditPassDate
(
new
Date
());
// 登记证记录表主键
Long
changeRecordId
=
sequence
.
nextId
();
Long
changeRecordId
=
sequence
.
nextId
();
//新增
if
(
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getSequenceNbr
()))
{
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
...
...
@@ -1761,7 +1804,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
String
.
valueOf
(
equipmentLists
.
get
(
0
).
get
(
"record"
)));
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
// 生成证书管理表记录
generateRegistrationManage
(
vehicleInformation
,
registerInfo
);
generateRegistrationManage
(
vehicleInformation
,
registerInfo
);
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
vehicleInformation
,
registerInfo
,
changeRecordId
,
null
);
}
else
{
...
...
@@ -1845,9 +1888,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
/**
* 系统类型的code 自动生成设备代码
* @param lambda lambda
* @param registerInfo 注册信息
* @param receiveCompanyCode 接收机构行政区划代码
*
* @param lambda lambda
* @param registerInfo 注册信息
* @param receiveCompanyCode 接收机构行政区划代码
*/
public
void
generateEquCode
(
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
lambda
,
IdxBizJgRegisterInfo
registerInfo
,
String
receiveCompanyCode
)
{
// 新增设备时选择无设备代码且在设备代码为空【未做安装告知(使用登记、安装告知会生成设备代码)】
...
...
@@ -1893,7 +1937,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
this
.
createCode
(
jgVehicleInformation
,
registerInfo
,
otherInfo
);
}
private
void
updateEquipEsData
(
JgVehicleInformation
jgVehicleInformation
,
IdxBizJgOtherInfo
otherInfo
,
IdxBizJgRegisterInfo
registerInfo
,
String
equId
)
{
private
void
updateEquipEsData
(
JgVehicleInformation
jgVehicleInformation
,
IdxBizJgOtherInfo
otherInfo
,
IdxBizJgRegisterInfo
registerInfo
,
String
equId
)
{
// 更新es
HashMap
<
String
,
Map
<
String
,
Object
>>
objMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
param
=
new
HashMap
<>();
...
...
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