Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
one-certificate-system
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
one-certificate-system
Commits
1c44890c
Commit
1c44890c
authored
Jul 28, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
证照申请生成二维码,保存子证信息
parent
e7c20c05
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
173 additions
and
19 deletions
+173
-19
one-certificate-manager/src/main/java/com/mortals/xhx/module/child/service/ChildLicenseService.java
...mortals/xhx/module/child/service/ChildLicenseService.java
+6
-0
one-certificate-manager/src/main/java/com/mortals/xhx/module/child/service/impl/ChildLicenseServiceImpl.java
...hx/module/child/service/impl/ChildLicenseServiceImpl.java
+61
-1
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java
...va/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java
+4
-0
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/service/ApplyLogService.java
...om/mortals/xhx/module/record/service/ApplyLogService.java
+2
-0
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java
...s/xhx/module/record/service/impl/ApplyLogServiceImpl.java
+63
-18
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/web/ApplyLogController.java
...com/mortals/xhx/module/record/web/ApplyLogController.java
+37
-0
No files found.
one-certificate-manager/src/main/java/com/mortals/xhx/module/child/service/ChildLicenseService.java
View file @
1c44890c
package
com.mortals.xhx.module.child.service
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.child.model.ChildLicenseEntity
;
import
com.mortals.xhx.module.child.dao.ChildLicenseDao
;
import
com.mortals.xhx.module.record.model.ApplyLogEntity
;
/**
* ChildLicenseService
*
...
...
@@ -13,4 +17,6 @@ import com.mortals.xhx.module.child.dao.ChildLicenseDao;
public
interface
ChildLicenseService
extends
ICRUDService
<
ChildLicenseEntity
,
Long
>{
ChildLicenseDao
getDao
();
int
createChildLicense
(
ApplyLogEntity
applyLogEntity
,
Context
context
)
throws
AppException
;
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/child/service/impl/ChildLicenseServiceImpl.java
View file @
1c44890c
package
com.mortals.xhx.module.child.service.impl
;
import
com.mortals.xhx.common.code.ProcessStatusEnum
;
import
com.mortals.xhx.module.certificate.model.CertificateChildEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateChildQuery
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentQuery
;
import
com.mortals.xhx.module.certificate.service.CertificateChildService
;
import
com.mortals.xhx.module.certificate.service.CertificateDocumentService
;
import
com.mortals.xhx.module.record.model.ApplyLogEntity
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -19,5 +35,49 @@ import lombok.extern.slf4j.Slf4j;
@Service
(
"childLicenseService"
)
@Slf4j
public
class
ChildLicenseServiceImpl
extends
AbstractCRUDServiceImpl
<
ChildLicenseDao
,
ChildLicenseEntity
,
Long
>
implements
ChildLicenseService
{
@Autowired
private
CertificateChildService
certificateChildService
;
@Autowired
private
CertificateDocumentService
certificateDocumentService
;
@Override
public
int
createChildLicense
(
ApplyLogEntity
applyLogEntity
,
Context
context
)
throws
AppException
{
int
result
=
0
;
if
(
applyLogEntity
.
getCatalogId
()!=
null
)
{
List
<
CertificateChildEntity
>
childEntityList
=
certificateChildService
.
find
(
new
CertificateChildQuery
().
catalogId
(
applyLogEntity
.
getCatalogId
()));
List
<
Long
>
documentIdList
=
childEntityList
.
stream
().
map
(
CertificateChildEntity:
:
getDocumentId
).
collect
(
Collectors
.
toList
());
List
<
CertificateDocumentEntity
>
documentEntityList
=
certificateDocumentService
.
find
(
new
CertificateDocumentQuery
().
idList
(
documentIdList
));
if
(
CollectionUtils
.
isNotEmpty
(
documentEntityList
))
{
List
<
ChildLicenseEntity
>
childLicense
=
new
ArrayList
<>();
for
(
CertificateDocumentEntity
item
:
documentEntityList
)
{
ChildLicenseEntity
entity
=
new
ChildLicenseEntity
();
entity
.
initAttrValue
();
entity
.
setSiteId
(
applyLogEntity
.
getSiteId
());
entity
.
setCatalogId
(
applyLogEntity
.
getCatalogId
());
entity
.
setCatalogName
(
applyLogEntity
.
getCatalogName
());
entity
.
setApplyId
(
applyLogEntity
.
getId
());
entity
.
setDocumentId
(
item
.
getId
());
entity
.
setDocumentName
(
item
.
getDocumentName
());
entity
.
setDeptId
(
item
.
getDeptId
());
entity
.
setDeptName
(
item
.
getDeptName
());
entity
.
setMarketEntityName
(
applyLogEntity
.
getEnterpriseName
());
entity
.
setLicenseCode
(
applyLogEntity
.
getCertificateCode
());
entity
.
setLegalPersonName
(
applyLogEntity
.
getLegalPerson
());
entity
.
setCreditCode
(
applyLogEntity
.
getSocialCode
());
entity
.
setProductLicenseTime
(
applyLogEntity
.
getIssueTime
());
entity
.
setCertQRCode
(
applyLogEntity
.
getQRCode
());
entity
.
setCertAuthority
(
applyLogEntity
.
getAuthority
());
entity
.
setBusinessPlace
(
applyLogEntity
.
getBusinessPlace
());
entity
.
setLicensedItems
(
applyLogEntity
.
getLicenseProject
());
entity
.
setFormStyleContent
(
item
.
getTemplateContent
());
entity
.
setProcessStatus
(
ProcessStatusEnum
.
未处理
.
getValue
());
entity
.
setCreateTime
(
applyLogEntity
.
getCreateTime
());
entity
.
setCreateUserId
(
applyLogEntity
.
getCreateUserId
());
childLicense
.
add
(
entity
);
}
this
.
dao
.
insertBatch
(
childLicense
);
}
}
return
result
;
}
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java
View file @
1c44890c
package
com.mortals.xhx.module.record.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.child.model.ChildLicenseEntity
;
import
com.mortals.xhx.module.record.model.ApplyLogEntity
;
import
lombok.Data
;
...
...
@@ -21,4 +22,7 @@ public class ApplyLogVo extends BaseEntityLong {
/** 操作类型名称 */
private
String
operTypeName
;
/** 子证信息 */
List
<
ChildLicenseEntity
>
childLicense
;
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/service/ApplyLogService.java
View file @
1c44890c
...
...
@@ -52,4 +52,6 @@ public interface ApplyLogService extends ICRUDService<ApplyLogEntity,Long>{
*/
String
importData
(
List
<
Map
<
Integer
,
Object
>>
dataList
,
Map
<
String
,
String
>
fileMap
,
Long
catalogId
,
Long
templateId
,
Context
context
)
throws
AppException
;
/** 社会统一信用编码查询 **/
ApplyLogEntity
getBySocialCode
(
String
socialCode
)
throws
AppException
;
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java
View file @
1c44890c
...
...
@@ -26,6 +26,9 @@ import com.mortals.xhx.module.certificate.model.*;
import
com.mortals.xhx.module.certificate.pdu.ApplyLogPdu
;
import
com.mortals.xhx.module.certificate.service.CertificateCatalogService
;
import
com.mortals.xhx.module.certificate.service.CertificateClassifyService
;
import
com.mortals.xhx.module.child.model.ChildLicenseEntity
;
import
com.mortals.xhx.module.child.model.ChildLicenseQuery
;
import
com.mortals.xhx.module.child.service.ChildLicenseService
;
import
com.mortals.xhx.module.record.dao.RecordDao
;
import
com.mortals.xhx.module.record.model.*
;
import
com.mortals.xhx.module.record.service.PrintWaitQueueService
;
...
...
@@ -63,6 +66,10 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
@Value
(
"${upload.path}"
)
private
String
filePath
;
/** 应用公网地址 */
@Value
(
"${serviceUrl:http://192.168.0.250:11011/onecert}"
)
private
String
serviceUrl
;
@Autowired
private
UploadService
uploadService
;
...
...
@@ -79,6 +86,8 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
private
UserService
userService
;
@Autowired
private
CertificateClassifyService
certificateClassifyService
;
@Autowired
private
ChildLicenseService
childLicenseService
;
@Override
protected
void
removeAfter
(
Long
[]
ids
,
Context
context
,
int
result
)
throws
AppException
{
...
...
@@ -89,6 +98,16 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
}
}
@Override
public
ApplyLogEntity
get
(
Long
key
,
Context
context
)
throws
AppException
{
ApplyLogEntity
entity
=
this
.
dao
.
get
(
key
);
if
(
entity
!=
null
){
List
<
ChildLicenseEntity
>
childs
=
childLicenseService
.
find
(
new
ChildLicenseQuery
().
applyId
(
key
).
processStatus
(
ProcessStatusEnum
.
已处理
.
getValue
()));
entity
.
setChildLicense
(
childs
);
}
return
entity
;
}
@Override
protected
ApplyLogEntity
findBefore
(
ApplyLogEntity
entity
,
PageInfo
pageInfo
,
Context
context
)
throws
AppException
{
ApplyLogQuery
query
=
new
ApplyLogQuery
();
...
...
@@ -112,35 +131,32 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
@Override
protected
void
validData
(
ApplyLogEntity
entity
,
Context
context
)
throws
AppException
{
if
(
StringUtils
.
isEmpty
(
entity
.
getCertificateCode
())){
throw
new
AppException
(
"
证照编码
不能为空"
);
throw
new
AppException
(
"
许可证编号
不能为空"
);
}
if
(
entity
.
getIssueTime
()==
null
){
throw
new
AppException
(
"
颁发
时间不能为空"
);
throw
new
AppException
(
"
制证
时间不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
get
PickerName
())){
throw
new
AppException
(
"
取件人姓名
不能为空"
);
if
(
StringUtils
.
isEmpty
(
entity
.
get
LegalPerson
())){
throw
new
AppException
(
"
法定代表人
不能为空"
);
}
if
(
entity
.
getHolderType
()==
null
){
throw
new
AppException
(
"
持有者类型
不能为空"
);
if
(
StringUtils
.
isEmpty
(
entity
.
getBusinessPlace
())
){
throw
new
AppException
(
"
经营场所
不能为空"
);
}
if
(
entity
.
getHolderIdType
()==
null
){
throw
new
AppException
(
"
持有者证件类型
不能为空"
);
if
(
StringUtils
.
isEmpty
(
entity
.
getAuthority
())
){
throw
new
AppException
(
"
制证机关
不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
get
HolderIDCardNo
())){
throw
new
AppException
(
"
持有者证件号
码不能为空"
);
if
(
StringUtils
.
isEmpty
(
entity
.
get
SocialCode
())){
throw
new
AppException
(
"
统一社会信用代
码不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
get
PrivateID
())){
throw
new
AppException
(
"
专网ID
不能为空"
);
if
(
StringUtils
.
isEmpty
(
entity
.
get
LicenseProject
())){
throw
new
AppException
(
"
许可项目
不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
getEnterpriseName
())){
throw
new
AppException
(
"
企业
名称不能为空"
);
throw
new
AppException
(
"
市场主体
名称不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
get
Holder
Name
())){
throw
new
AppException
(
"
持有者姓名
不能为空"
);
if
(
StringUtils
.
isEmpty
(
entity
.
get
Industry
Name
())){
throw
new
AppException
(
"
行业名称
不能为空"
);
}
// if(StringUtils.isEmpty(entity.getOriFormContent())){
// throw new AppException("正本表单不能为空");
// }
if
(
entity
.
getCatalogId
()==
null
){
throw
new
AppException
(
"目录ID不能为空"
);
}
...
...
@@ -162,6 +178,22 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
applyLogEntity
.
setCreateUserId
(
context
.
getUser
().
getId
());
}
applyLogEntity
.
setGenerateStatus
(
GenerateStatus
.
NOT
.
getValue
());
try
{
String
rootPath
=
this
.
filePath
.
endsWith
(
"/"
)
?
this
.
filePath
:
this
.
filePath
+
"/"
;
String
filePath
=
rootPath
+
"certificate/qrcode/"
;
String
qrcodeName
=
applyLogEntity
.
getCertificateCode
()
+
".png"
;
File
pathDir
=
new
File
(
filePath
);
if
(!
pathDir
.
exists
())
{
pathDir
.
mkdirs
();
}
String
imagepath
=
filePath
+
qrcodeName
;
String
qrCode
=
serviceUrl
+
"/apply/log/get/"
+
applyLogEntity
.
getSocialCode
();
QrCodeUtil
.
generateQrCodeFile
(
qrCode
,
imagepath
);
applyLogEntity
.
setQRCode
(
imagepath
);
//entry.setValue(pictureRenderData);
}
catch
(
Exception
e
)
{
log
.
error
(
"error"
,
e
);
}
if
(
applyLogEntity
.
getId
()!=
null
&&
applyLogEntity
.
getRecordId
()!=
null
){
applyLogEntity
.
setOperType
(
OperTypeEnum
.
UPDATE
.
getValue
());
oldId
=
applyLogEntity
.
getId
();
...
...
@@ -191,6 +223,9 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
updata
.
setUpdateTime
(
new
Date
());
dao
.
update
(
updata
);
}
//插入子证联报
childLicenseService
.
createChildLicense
(
applyLogEntity
,
context
);
return
applyLogEntity
;
}
...
...
@@ -522,4 +557,14 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
return
successMsg
.
toString
();
}
@Override
public
ApplyLogEntity
getBySocialCode
(
String
socialCode
)
throws
AppException
{
ApplyLogEntity
entity
=
this
.
selectOne
(
new
ApplyLogQuery
().
socialCode
(
socialCode
));
if
(
entity
!=
null
){
List
<
ChildLicenseEntity
>
childs
=
childLicenseService
.
find
(
new
ChildLicenseQuery
().
applyId
(
entity
.
getId
()).
processStatus
(
ProcessStatusEnum
.
已处理
.
getValue
()));
entity
.
setChildLicense
(
childs
);
}
return
entity
;
}
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/web/ApplyLogController.java
View file @
1c44890c
...
...
@@ -13,6 +13,7 @@ import com.mortals.xhx.common.utils.ReadExcelPictureUtil;
import
org.apache.poi.ss.usermodel.PictureData
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -159,4 +160,40 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
return
ret
.
toJSONString
();
}
/** 社会统一信用编码查询 */
@GetMapping
(
value
=
"get/{socialCode}"
)
@UnAuth
public
String
get
(
@PathVariable
(
value
=
"socialCode"
)
String
socialCode
)
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
if
(
StringUtils
.
isEmpty
(
socialCode
))
{
return
this
.
createFailJsonResp
(
"许可证编码不正确"
);
}
else
{
JSONObject
ret
=
new
JSONObject
();
String
busiDesc
=
"扫码查看"
+
this
.
getModuleDesc
();
Context
context
=
this
.
getContext
();
try
{
ApplyLogEntity
entity
=
this
.
service
.
getBySocialCode
(
socialCode
);
if
(
entity
==
null
)
{
throw
new
Exception
(
busiDesc
+
",不存在或已被删除"
);
}
ret
.
put
(
"data"
,
entity
);
if
(!
ObjectUtils
.
isEmpty
(
context
)
&&
!
ObjectUtils
.
isEmpty
(
context
.
getUser
()))
{
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
}
catch
(
Exception
var8
)
{
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var8
);
Object
msg
=
model
.
get
(
"message_info"
);
return
this
.
createFailJsonResp
(
msg
==
null
?
"系统异常"
:
msg
.
toString
());
}
this
.
init
(
model
,
context
);
ret
.
put
(
"code"
,
1
);
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"dict"
,
model
.
remove
(
"dict"
));
return
ret
.
toJSONString
();
}
}
}
\ No newline at end of file
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