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
52036e3e
Commit
52036e3e
authored
Oct 31, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.业务审批通过更新证时,更新证版本号及原因
parent
f784f9ac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
12 deletions
+28
-12
CertInfoRequestParam.java
...in/amos/boot/module/app/api/dto/CertInfoRequestParam.java
+1
-2
AuthException.java
...oin/amos/boot/module/app/api/exception/AuthException.java
+12
-0
AmosWeAppApplication.java
.../src/main/java/com/yeejoin/amos/AmosWeAppApplication.java
+2
-0
CertDetailServiceImpl.java
...ot/module/app/biz/service/impl/CertDetailServiceImpl.java
+13
-10
No files found.
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-api/src/main/java/com/yeejoin/amos/boot/module/app/api/dto/CertInfoRequestParam.java
View file @
52036e3e
...
...
@@ -14,9 +14,8 @@ public class CertInfoRequestParam {
private
String
certNo
;
/**
* 证类型:
使用登记证、
使用标志
* 证类型:
useCert-使用登记证、useFlag-
使用标志
*/
@NotBlank
(
message
=
"证类型不能为空!"
)
private
String
certType
;
/**
...
...
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-api/src/main/java/com/yeejoin/amos/boot/module/app/api/exception/AuthException.java
0 → 100644
View file @
52036e3e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
app
.
api
.
exception
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
static
org
.
springframework
.
http
.
HttpStatus
.
UNAVAILABLE_FOR_LEGAL_REASONS
;
public
class
AuthException
extends
BaseException
{
public
AuthException
(
String
message
)
{
super
(
message
,
AuthException
.
class
.
getSimpleName
(),
"数据不合法"
);
this
.
httpStatus
=
UNAVAILABLE_FOR_LEGAL_REASONS
.
value
();
}
}
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-biz/src/main/java/com/yeejoin/amos/AmosWeAppApplication.java
View file @
52036e3e
...
...
@@ -20,6 +20,7 @@ import org.springframework.context.annotation.ComponentScan;
import
org.springframework.core.env.Environment
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc
;
import
java.net.InetAddress
;
...
...
@@ -56,6 +57,7 @@ public class AmosWeAppApplication {
public
static
void
main
(
String
[]
args
)
throws
UnknownHostException
{
ConfigurableApplicationContext
context
=
SpringApplication
.
run
(
AmosWeAppApplication
.
class
,
args
);
GlobalExceptionHandler
.
setAlwaysOk
(
true
);
Environment
env
=
context
.
getEnvironment
();
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
String
port
=
env
.
getProperty
(
"server.port"
);
...
...
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-biz/src/main/java/com/yeejoin/amos/boot/module/app/biz/service/impl/CertDetailServiceImpl.java
View file @
52036e3e
...
...
@@ -2,13 +2,13 @@ package com.yeejoin.amos.boot.module.app.biz.service.impl;
import
com.yeejoin.amos.boot.biz.common.dto.JgUseRegistrationManageDto
;
import
com.yeejoin.amos.boot.module.app.api.dto.CertInfoRequestParam
;
import
com.yeejoin.amos.boot.module.app.api.exception.AuthException
;
import
com.yeejoin.amos.boot.module.app.api.mapper.AppCommonMapper
;
import
com.yeejoin.amos.boot.module.app.biz.strategy.SearchDetailStrategyContext
;
import
com.yeejoin.amos.boot.module.common.api.crypto.AESUtil
;
import
com.yeejoin.amos.boot.module.common.api.enums.CertificateStatusEnum
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
javax.validation.constraints.NotBlank
;
import
java.util.Map
;
...
...
@@ -25,7 +25,7 @@ public class CertDetailServiceImpl {
}
public
Map
<
String
,
Object
>
getCertInfoForWX
(
CertInfoRequestParam
requestParam
)
{
this
.
setDefault
Version
ForOld
(
requestParam
);
this
.
setDefault
Field
ForOld
(
requestParam
);
String
certOrApplyNo
=
this
.
deCodeCertNo
(
requestParam
.
getCertNo
());
String
version
=
this
.
deCodeByAES
(
requestParam
.
getVersion
());
String
certType
=
this
.
deCodeByAES
(
requestParam
.
getCertType
());
...
...
@@ -33,39 +33,42 @@ public class CertDetailServiceImpl {
return
SearchDetailStrategyContext
.
getHandler
(
this
.
getManageType
(
jgUseRegistrationManage
)).
hanlder
(
jgUseRegistrationManage
,
certType
);
}
private
void
setDefault
Version
ForOld
(
CertInfoRequestParam
requestParam
)
{
private
void
setDefault
Field
ForOld
(
CertInfoRequestParam
requestParam
)
{
if
(
StringUtils
.
isBlank
(
requestParam
.
getVersion
()))
{
requestParam
.
setVersion
(
AESUtil
.
encrypt
(
"1"
));
}
if
(
StringUtils
.
isBlank
(
requestParam
.
getCertType
()))
{
requestParam
.
setCertType
(
AESUtil
.
encrypt
(
"useCert"
));
}
}
private
JgUseRegistrationManageDto
checkParam
(
String
certOrApplyNo
,
String
version
)
{
JgUseRegistrationManageDto
jgUseRegistrationManage
=
commonMapper
.
selectOneCert
(
certOrApplyNo
);
if
(
jgUseRegistrationManage
==
null
)
{
throw
new
BadRequest
(
"无此证信息!"
);
throw
new
AuthException
(
"无此证信息!"
);
}
// 表创建字段时已经给默认值 1 正常不为null 程序健壮处理
if
(
jgUseRegistrationManage
.
getVersion
()
==
null
)
{
jgUseRegistrationManage
.
setVersion
(
1
);
}
if
(
jgUseRegistrationManage
.
getVersion
().
toString
().
equals
(
version
))
{
throw
new
BadRequest
(
this
.
buildErrorInfo
(
jgUseRegistrationManage
));
if
(
!
jgUseRegistrationManage
.
getVersion
().
toString
().
equals
(
version
))
{
throw
new
AuthException
(
this
.
buildErrorInfo
(
jgUseRegistrationManage
));
}
if
(
CertificateStatusEnum
.
YIZHUXIAO
.
getName
().
equals
(
jgUseRegistrationManage
.
getCertificateStatus
()))
{
throw
new
BadRequest
(
"此证已注销!"
);
throw
new
AuthException
(
"此证已注销!"
);
}
return
jgUseRegistrationManage
;
}
private
String
buildErrorInfo
(
JgUseRegistrationManageDto
jgUseRegistrationManage
)
{
return
"
该证发生"
+
jgUseRegistrationManage
.
getChangeReason
()
+
"导致
证注销, 请联系监管单位进行换证!"
;
return
"
由于办理"
+
jgUseRegistrationManage
.
getChangeReason
()
+
"业务导致该
证注销, 请联系监管单位进行换证!"
;
}
private
String
deCodeByAES
(
@NotBlank
(
message
=
"证类型不能为空!"
)
String
data
)
{
try
{
return
AESUtil
.
decrypt
(
data
);
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"非法的二维码!"
);
throw
new
AuthException
(
"非法的二维码!"
);
}
}
...
...
@@ -77,7 +80,7 @@ public class CertDetailServiceImpl {
try
{
return
AESUtil
.
decrypt
(
certNo
);
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"非法的二维码!"
);
throw
new
AuthException
(
"非法的二维码!"
);
}
}
...
...
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