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
107de559
Commit
107de559
authored
Jul 14, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):已完成的使用登记单,作废时作废其使用登记证,并增加证流水
parent
84eae96b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
1 deletion
+94
-1
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+38
-1
JgVehicleInformationServiceImpl.java
.../jg/biz/service/impl/JgVehicleInformationServiceImpl.java
+56
-0
No files found.
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 @
107de559
...
@@ -1234,6 +1234,20 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1234,6 +1234,20 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return
commonServiceImpl
.
updateTaskModel
(
params
);
return
commonServiceImpl
.
updateTaskModel
(
params
);
}
}
/**
* 作废的证变更内容
* @param obj JgUseRegistration
* @return result
*/
private
String
buildVoidRecordContent
(
JgUseRegistration
obj
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
companyType
=
reginParams
.
getCompany
().
getCompanyType
();
//监管单位 作废了【使用功能登记】 ,单号【DWBG202407050001】,作废日期2024-07-05
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
return
companyType
+
"作废了【"
+
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getName
()
+
"】,"
+
"单号【"
+
obj
.
getApplyNo
()
+
"】,申请日期"
+
simpleDateFormat
.
format
(
obj
.
getRecDate
());
}
private
String
buildRecordContent
(
JgUseRegistration
obj
,
Boolean
flag
)
{
private
String
buildRecordContent
(
JgUseRegistration
obj
,
Boolean
flag
)
{
//张三办理了【单位变更】 ,单号【DWBG202407050001】,办理日期2024-07-05
//张三办理了【单位变更】 ,单号【DWBG202407050001】,办理日期2024-07-05
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
...
@@ -2211,7 +2225,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -2211,7 +2225,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
/**
/**
* 作废使用登记证
* 作废使用登记证
& 生成使用登记证的流水
* @param jgUseRegistration
* @param jgUseRegistration
*/
*/
private
void
invalidUseRegistrationCertificate
(
JgUseRegistration
jgUseRegistration
){
private
void
invalidUseRegistrationCertificate
(
JgUseRegistration
jgUseRegistration
){
...
@@ -2226,6 +2240,29 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -2226,6 +2240,29 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper
<
JgUseRegistrationManage
>
wrapper
=
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
LambdaQueryWrapper
<
JgUseRegistrationManage
>
wrapper
=
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
jgUseRegistration
.
getUseRegistrationCode
());
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
jgUseRegistration
.
getUseRegistrationCode
());
jgUseRegistrationManageMapper
.
update
(
registrationManage
,
wrapper
);
jgUseRegistrationManageMapper
.
update
(
registrationManage
,
wrapper
);
// 生成使用登记证的作废流水
Optional
<
JgCertificateChangeRecord
>
firstRecord
=
certificateChangeRecordService
.
getBaseMapper
().
selectList
(
new
LambdaQueryWrapper
<
JgCertificateChangeRecord
>()
.
eq
(
JgCertificateChangeRecord:
:
getUseRegistrationCode
,
jgUseRegistration
.
getUseRegistrationCode
())
.
orderByAsc
(
JgCertificateChangeRecord:
:
getCreateDate
))
.
stream
()
.
findFirst
();
JgCertificateChangeRecord
changeRecord
=
new
JgCertificateChangeRecord
();
changeRecord
.
setApplyNo
(
jgUseRegistration
.
getApplyNo
());
changeRecord
.
setReceiveOrgName
(
jgUseRegistration
.
getReceiveOrgName
());
changeRecord
.
setAuditPassDate
(
new
Date
());
changeRecord
.
setRegType
(
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getName
());
changeRecord
.
setRegDate
(
jgUseRegistration
.
getCreateDate
());
changeRecord
.
setChangeContent
(
this
.
buildVoidRecordContent
(
jgUseRegistration
));
//变更内容
changeRecord
.
setUseRegistrationCode
(
jgUseRegistration
.
getUseRegistrationCode
());
//使用登记编号
changeRecord
.
setReceiveCompanyCode
(
jgUseRegistration
.
getReceiveCompanyOrgCode
());
//接收机构公司代码
changeRecord
.
setUseUnitCreditCode
(
jgUseRegistration
.
getUseUnitCreditCode
());
//使用单位统一信用代码
changeRecord
.
setUseUnitName
(
jgUseRegistration
.
getUseUnitName
());
//使用单位名称
firstRecord
.
ifPresent
(
record
->
changeRecord
.
setEquCategory
(
record
.
getEquCategory
()));
//设备类别编码
changeRecord
.
setCreateDate
(
new
Date
());
firstRecord
.
ifPresent
(
record
->
changeRecord
.
setRoutePath
(
record
.
getRoutePath
()));
certificateChangeRecordService
.
save
(
changeRecord
);
}
}
private
void
rollBackSupervisionInfo
(
String
record
)
{
private
void
rollBackSupervisionInfo
(
String
record
)
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgVehicleInformationServiceImpl.java
View file @
107de559
...
@@ -1287,6 +1287,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
...
@@ -1287,6 +1287,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
case
"已完成"
:
case
"已完成"
:
// 1.删除与设备的关系,设备可再次发起使用登记
// 1.删除与设备的关系,设备可再次发起使用登记
this
.
clearUseInfoOfEquip
(
vehicleInformation
);
this
.
clearUseInfoOfEquip
(
vehicleInformation
);
// 3.作废对应的使用登记证
this
.
invalidUseRegistrationCertificate
(
vehicleInformation
);
break
;
break
;
default
:
default
:
// 流程中
// 流程中
...
@@ -1298,6 +1300,60 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
...
@@ -1298,6 +1300,60 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
}
}
}
}
/**
* 作废使用登记证 & 生成使用登记证的流水
*/
private
void
invalidUseRegistrationCertificate
(
JgVehicleInformation
jgVehicleInformation
)
{
Integer
count
=
this
.
baseMapper
.
selectCount
(
new
LambdaQueryWrapper
<
JgVehicleInformation
>()
.
eq
(
JgVehicleInformation:
:
getUseRegistrationCode
,
jgVehicleInformation
.
getUseRegistrationCode
()));
// 一证对应多条使用登记单时,不作废证
if
(
count
>
1
)
{
return
;
}
JgUseRegistrationManage
registrationManage
=
new
JgUseRegistrationManage
();
registrationManage
.
setCertificateStatus
(
CertificateStatusEnum
.
YIZHUXIAO
.
getName
());
LambdaQueryWrapper
<
JgUseRegistrationManage
>
wrapper
=
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
jgVehicleInformation
.
getUseRegistrationCode
());
jgUseRegistrationManageService
.
update
(
registrationManage
,
wrapper
);
// 生成使用登记证的作废流水
Optional
<
JgCertificateChangeRecord
>
firstRecord
=
certificateChangeRecordService
.
getBaseMapper
().
selectList
(
new
LambdaQueryWrapper
<
JgCertificateChangeRecord
>()
.
eq
(
JgCertificateChangeRecord:
:
getUseRegistrationCode
,
jgVehicleInformation
.
getUseRegistrationCode
())
.
orderByAsc
(
JgCertificateChangeRecord:
:
getCreateDate
))
.
stream
()
.
findFirst
();
JgCertificateChangeRecord
changeRecord
=
new
JgCertificateChangeRecord
();
changeRecord
.
setApplyNo
(
jgVehicleInformation
.
getApplyNo
());
changeRecord
.
setReceiveOrgName
(
jgVehicleInformation
.
getReceiveOrgName
());
changeRecord
.
setAuditPassDate
(
new
Date
());
changeRecord
.
setRegType
(
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getName
());
changeRecord
.
setRegDate
(
jgVehicleInformation
.
getCreateDate
());
changeRecord
.
setChangeContent
(
this
.
buildVoidRecordContent
(
jgVehicleInformation
));
// 变更内容
changeRecord
.
setUseRegistrationCode
(
jgVehicleInformation
.
getUseRegistrationCode
());
// 使用登记编号
changeRecord
.
setReceiveCompanyCode
(
jgVehicleInformation
.
getReceiveCompanyCode
());
// 接收机构公司代码
changeRecord
.
setUseUnitCreditCode
(
jgVehicleInformation
.
getUseUnitCreditCode
());
// 使用单位统一信用代码
changeRecord
.
setUseUnitName
(
jgVehicleInformation
.
getUseUnitName
());
// 使用单位名称
firstRecord
.
ifPresent
(
record
->
changeRecord
.
setEquCategory
(
record
.
getEquCategory
()));
// 设备类别编码
changeRecord
.
setCreateDate
(
new
Date
());
firstRecord
.
ifPresent
(
record
->
changeRecord
.
setRoutePath
(
record
.
getRoutePath
()));
certificateChangeRecordService
.
save
(
changeRecord
);
}
/**
* 作废的证变更内容
* @param obj JgVehicleInformation
* @return result
*/
private
String
buildVoidRecordContent
(
JgVehicleInformation
obj
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
companyType
=
reginParams
.
getCompany
().
getCompanyType
();
//监管单位 作废了【使用功能登记】 ,单号【DWBG202407050001】,作废日期2024-07-05
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
return
companyType
+
"作废了【"
+
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getName
()
+
"】,"
+
"单号【"
+
obj
.
getApplyNo
()
+
"】,申请日期"
+
simpleDateFormat
.
format
(
obj
.
getRecDate
());
}
private
void
clearUseInfoOfEquip
(
JgVehicleInformation
vehicleInformation
)
{
private
void
clearUseInfoOfEquip
(
JgVehicleInformation
vehicleInformation
)
{
LambdaQueryWrapper
<
JgVehicleInformationEq
>
eqLambdaQueryWrapper
=
new
LambdaQueryWrapper
<
JgVehicleInformationEq
>().
eq
(
JgVehicleInformationEq:
:
getVehicleId
,
vehicleInformation
.
getSequenceNbr
());
LambdaQueryWrapper
<
JgVehicleInformationEq
>
eqLambdaQueryWrapper
=
new
LambdaQueryWrapper
<
JgVehicleInformationEq
>().
eq
(
JgVehicleInformationEq:
:
getVehicleId
,
vehicleInformation
.
getSequenceNbr
());
List
<
JgVehicleInformationEq
>
eqList
=
jgVehicleInformationEqMapper
.
selectList
(
eqLambdaQueryWrapper
);
List
<
JgVehicleInformationEq
>
eqList
=
jgVehicleInformationEqMapper
.
selectList
(
eqLambdaQueryWrapper
);
...
...
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