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
5accba1e
Commit
5accba1e
authored
Jul 28, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
证照申请保存二维码
parent
cc61569b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
158 additions
and
41 deletions
+158
-41
one-certificate-manager/src/main/java/com/mortals/xhx/common/utils/ReadExcelPictureUtil.java
...va/com/mortals/xhx/common/utils/ReadExcelPictureUtil.java
+2
-2
one-certificate-manager/src/main/java/com/mortals/xhx/module/certificate/service/impl/CertificateCatalogServiceImpl.java
...rtificate/service/impl/CertificateCatalogServiceImpl.java
+141
-39
one-certificate-manager/src/main/java/com/mortals/xhx/module/child/service/impl/ChildLicenseServiceImpl.java
...hx/module/child/service/impl/ChildLicenseServiceImpl.java
+1
-0
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
+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
+12
-0
No files found.
one-certificate-manager/src/main/java/com/mortals/xhx/common/utils/ReadExcelPictureUtil.java
View file @
5accba1e
...
@@ -59,7 +59,7 @@ public class ReadExcelPictureUtil {
...
@@ -59,7 +59,7 @@ public class ReadExcelPictureUtil {
File
picDirF
=
null
;
File
picDirF
=
null
;
String
imageName
=
new
Date
().
getTime
()
+
".png"
;
String
imageName
=
new
Date
().
getTime
()
+
".png"
;
String
imagePath
=
"/file/
uploadfile
/"
+
imageName
;
String
imagePath
=
"/file/
fileupload
/"
+
imageName
;
String
filePath
=
root
+
imagePath
;
String
filePath
=
root
+
imagePath
;
FileOutputStream
fout
;
FileOutputStream
fout
;
...
@@ -101,7 +101,7 @@ public class ReadExcelPictureUtil {
...
@@ -101,7 +101,7 @@ public class ReadExcelPictureUtil {
String
point
=
hSSFClientAnchor
.
getRow1
()
+
","
+
hSSFClientAnchor
.
getCol1
();
String
point
=
hSSFClientAnchor
.
getRow1
()
+
","
+
hSSFClientAnchor
.
getCol1
();
String
imageName
=
new
Date
().
getTime
()
+
".png"
;
String
imageName
=
new
Date
().
getTime
()
+
".png"
;
String
imagePath
=
"/file/
uploadfile
/"
+
imageName
;
String
imagePath
=
"/file/
fileupload
/"
+
imageName
;
String
filePath
=
"D:/mortals/app/data/cpm"
+
imagePath
;
String
filePath
=
"D:/mortals/app/data/cpm"
+
imagePath
;
FileOutputStream
fout
;
FileOutputStream
fout
;
...
...
one-certificate-manager/src/main/java/com/mortals/xhx/module/certificate/service/impl/CertificateCatalogServiceImpl.java
View file @
5accba1e
package
com.mortals.xhx.module.certificate.service.impl
;
package
com.mortals.xhx.module.certificate.service.impl
;
import
cn.hutool.core.text.StrSplitter
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.deepoove.poi.XWPFTemplate
;
import
com.deepoove.poi.config.Configure
;
import
com.deepoove.poi.config.ConfigureBuilder
;
import
com.deepoove.poi.template.MetaTemplate
;
import
com.deepoove.poi.util.RegexUtils
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.common.code.ClassifyType
;
import
com.mortals.xhx.common.code.ClassifyType
;
import
com.mortals.xhx.common.code.ComponentEnum
;
import
com.mortals.xhx.common.code.StatusEnum
;
import
com.mortals.xhx.common.formdesign.*
;
import
com.mortals.xhx.common.pdu.gen.component.ComponentCons
;
import
com.mortals.xhx.common.utils.ExcelUtil
;
import
com.mortals.xhx.common.utils.StringUtils
;
import
com.mortals.xhx.common.utils.StringUtils
;
import
com.mortals.xhx.module.certificate.dao.CertificateCatalogDao
;
import
com.mortals.xhx.module.certificate.dao.CertificateCatalogDao
;
import
com.mortals.xhx.module.certificate.model.CertificateCatalogEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateCatalogEntity
;
...
@@ -20,10 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -20,10 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Arrays
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -40,7 +50,7 @@ public class CertificateCatalogServiceImpl extends AbstractCRUDServiceImpl<Certi
...
@@ -40,7 +50,7 @@ public class CertificateCatalogServiceImpl extends AbstractCRUDServiceImpl<Certi
@Value
(
"${upload.path}"
)
@Value
(
"${upload.path}"
)
private
String
filePath
;
private
String
filePath
;
@Value
(
"${upload.url:http://192.168.0.98:17216/cpm/file/commonupload?prePath=/file/
uploadfile
}"
)
@Value
(
"${upload.url:http://192.168.0.98:17216/cpm/file/commonupload?prePath=/file/
fileupload
}"
)
private
String
uploadUrl
;
private
String
uploadUrl
;
@Value
(
"${qrcode.url:http://rhpt.scjg.chengdu.gov.cn:8091/adap/spjy/process/generateQrCode.do?dto.applyId=}"
)
@Value
(
"${qrcode.url:http://rhpt.scjg.chengdu.gov.cn:8091/adap/spjy/process/generateQrCode.do?dto.applyId=}"
)
...
@@ -52,9 +62,8 @@ public class CertificateCatalogServiceImpl extends AbstractCRUDServiceImpl<Certi
...
@@ -52,9 +62,8 @@ public class CertificateCatalogServiceImpl extends AbstractCRUDServiceImpl<Certi
@Autowired
@Autowired
private
CertificateChildService
certificateChildService
;
private
CertificateChildService
certificateChildService
;
@Override
@Override
protected
void
saveBefore
(
CertificateCatalogEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
validData
(
CertificateCatalogEntity
entity
,
Context
context
)
throws
AppException
{
if
(
StringUtils
.
isEmpty
(
entity
.
getCatalogName
()))
{
if
(
StringUtils
.
isEmpty
(
entity
.
getCatalogName
()))
{
throw
new
AppException
(
"目录名称不能为空"
);
throw
new
AppException
(
"目录名称不能为空"
);
}
}
...
@@ -70,27 +79,29 @@ public class CertificateCatalogServiceImpl extends AbstractCRUDServiceImpl<Certi
...
@@ -70,27 +79,29 @@ public class CertificateCatalogServiceImpl extends AbstractCRUDServiceImpl<Certi
if
(
entity
.
getIndustryId
()
==
null
)
{
if
(
entity
.
getIndustryId
()
==
null
)
{
throw
new
AppException
(
"所属行业不能为空"
);
throw
new
AppException
(
"所属行业不能为空"
);
}
}
}
@Override
protected
void
saveBefore
(
CertificateCatalogEntity
entity
,
Context
context
)
throws
AppException
{
validData
(
entity
,
context
);
entity
.
setStatus
(
StatusEnum
.
ENABLE
.
getValue
());
if
(
StringUtils
.
isNotEmpty
(
entity
.
getTemplateFileUrl
())){
//entity.setFormContent(parseDocxToJson(entity.getTemplateUrl()));
parseDocxToJson
(
entity
,
false
);
}
}
}
@Override
@Override
protected
void
updateBefore
(
CertificateCatalogEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
updateBefore
(
CertificateCatalogEntity
entity
,
Context
context
)
throws
AppException
{
if
(
StringUtils
.
isEmpty
(
entity
.
getCatalogName
()))
{
validData
(
entity
,
context
);
throw
new
AppException
(
"目录名称不能为空"
);
CertificateCatalogEntity
old
=
this
.
get
(
entity
.
getId
());
}
if
(!
old
.
getTemplateFileUrl
().
equals
(
entity
.
getTemplateFileUrl
()))
{
if
(
StringUtils
.
isEmpty
(
entity
.
getCatalogCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
entity
.
getTemplateFileUrl
()))
{
throw
new
AppException
(
"目录编码不能为空"
);
//entity.setFormContent(parseDocxToJson(entity.getTemplateUrl()));
}
parseDocxToJson
(
entity
,
false
);
if
(
entity
.
getHolderType
()
==
null
)
{
}
throw
new
AppException
(
"持有者类型不能为空"
);
}
if
(
entity
.
getClassifyId
()
==
null
)
{
throw
new
AppException
(
"目录分类不能为空"
);
}
if
(
entity
.
getIndustryId
()
==
null
)
{
throw
new
AppException
(
"所属行业不能为空"
);
}
}
}
}
...
@@ -168,27 +179,118 @@ public class CertificateCatalogServiceImpl extends AbstractCRUDServiceImpl<Certi
...
@@ -168,27 +179,118 @@ public class CertificateCatalogServiceImpl extends AbstractCRUDServiceImpl<Certi
super
.
removeAfter
(
ids
,
context
,
result
);
super
.
removeAfter
(
ids
,
context
,
result
);
}
}
private
void
parseDocxToJson
(
CertificateCatalogEntity
entity
,
boolean
onlyExcel
)
{
String
rootPath
=
this
.
filePath
.
endsWith
(
"/"
)
?
this
.
filePath
:
this
.
filePath
+
"/"
;
String
filepath
=
rootPath
+
entity
.
getTemplateFileUrl
();
ConfigureBuilder
builder
=
Configure
.
builder
();
builder
.
setValidErrorHandler
(
new
Configure
.
DiscardHandler
());
builder
.
useDefaultEL
(
false
);
builder
.
buildGrammerRegex
(
RegexUtils
.
createGeneral
(
"{{"
,
"}}"
));
//builder.buildGramer("[","]");
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
filepath
,
builder
.
build
());
FormDesignRoot
root
=
new
FormDesignRoot
();
FormDesignConfig
config
=
new
FormDesignConfig
();
config
.
initAttribute
();
root
.
setConfig
(
config
);
List
<
ListItem
>
collect
=
new
ArrayList
<>();
HashSet
<
String
>
hs
=
new
HashSet
<>();
//去除重复标签
List
<
String
>
excelList
=
new
ArrayList
<>();
//Excel模板
// excelList.add("证照目录ID");
// excelList.add("证照编号");
// excelList.add("证照名称");
// excelList.add("颁发时间");
// excelList.add("取件人姓名");
// excelList.add("取件人证件号码");
// excelList.add("持有者名称");
// excelList.add("持有者证件号码");
// excelList.add("企业名称");
for
(
MetaTemplate
item
:
template
.
getElementTemplates
())
{
if
(
hs
.
contains
(
item
.
variable
())){
continue
;
}
else
{
hs
.
add
(
item
.
variable
());
}
//识别简单输入
String
val
=
StrUtil
.
strip
(
item
.
variable
(),
"{{"
,
"}}"
);
excelList
.
add
(
val
);
List
<
String
>
keys
=
StrSplitter
.
split
(
val
,
"_"
,
true
,
true
);
//切分分隔符后动态 创建组件 i_1_姓名(第一个代表类型,第二个如果是多个累加,第三个显示label)
if
(
keys
.
size
()
>
2
)
{
String
label
=
keys
.
get
(
2
);
String
type
=
keys
.
get
(
0
);
ComponentCons
cons
=
new
ComponentCons
();
cons
.
setLabel
(
label
);
cons
.
setVal
(
val
);
cons
.
setEl
(
item
.
variable
());
cons
.
setUploadFileUrl
(
uploadUrl
);
if
(
type
.
equalsIgnoreCase
(
ComponentEnum
.
DYNAMIC_TABLE
.
getValue
()))
{
HashSet
<
String
>
dhs
=
new
HashSet
<>();
//去除重复标签
List
<
TableColItem
>
colList
=
new
ArrayList
<>();
//表格 结构化绑定数据
ConfigureBuilder
builderTable
=
Configure
.
builder
();
builderTable
.
setValidErrorHandler
(
new
Configure
.
DiscardHandler
());
builderTable
.
useDefaultEL
(
false
);
builderTable
.
buildGramer
(
"["
,
"]"
);
XWPFTemplate
templateTable
=
XWPFTemplate
.
compile
(
filepath
,
builderTable
.
build
());
public
static
void
main
(
String
[]
args
)
{
for
(
MetaTemplate
col
:
templateTable
.
getElementTemplates
())
{
// String excelFilePath = "D:/mortals/app/data/cpm/" + "excel/test1.xls";
if
(
dhs
.
contains
(
col
.
variable
())){
// List<String> excelList = new ArrayList<>();
continue
;
// excelList.add("i_1_姓名");
}
else
{
// excelList.add("i_2_性别");
dhs
.
add
(
col
.
variable
());
// excelList.add("i_3_年龄");
}
// excelList.add("i_4_证件编号");
String
colVal
=
StrUtil
.
strip
(
col
.
variable
(),
"["
,
"]"
);
// excelList.add("i_5_证件名称");
if
(!
StrUtil
.
startWith
(
colVal
,
label
))
{
//
continue
;
// ExcelUtil.createCatalogTemplate(excelFilePath,excelList);
}
List
<
String
>
colKeys
=
StrSplitter
.
split
(
colVal
,
"_"
,
true
,
true
);
//提取当前table中的列元素
if
(
colKeys
.
size
()
>
3
)
{
String
colLabel
=
colKeys
.
get
(
3
);
String
colType
=
colKeys
.
get
(
1
);
TableColItem
tableColItem
=
new
TableColItem
();
tableColItem
.
setLabel
(
colLabel
);
tableColItem
.
setColType
(
colType
);
tableColItem
.
setVal
(
colVal
);
colList
.
add
(
tableColItem
);
//System.out.println("列元素" + col.variable());
}
}
cons
.
setColList
(
colList
);
DesignComponent
designComponent
=
DesignComponent
.
createType
(
type
);
ListItem
listItem
=
designComponent
.
buildDefaultComponent
(
cons
);
collect
.
add
(
listItem
);
continue
;
}
DesignComponent
designComponent
=
DesignComponent
.
createType
(
type
);
ListItem
listItem
=
designComponent
.
buildDefaultComponent
(
cons
);
if
(
type
.
equals
(
ComponentEnum
.
QRCODE
.
getValue
())){
listItem
.
setValue
(
qrcode
);
}
collect
.
add
(
listItem
);
}
}
root
.
setList
(
collect
);
String
fileName
=
"file/fileupload/excel/"
+
entity
.
getCatalogName
()+
"_批量导入模板.xls"
;
String
excelFilePath
=
rootPath
+
fileName
;
ExcelUtil
.
createCatalogTemplate
(
excelFilePath
,
excelList
);
entity
.
setExcelFile
(
fileName
);
if
(!
onlyExcel
)
{
entity
.
setFormContent
(
JSON
.
toJSONString
(
root
));
}
}
}
@Override
@Override
public
void
generateExcel
(
Long
id
,
Context
context
)
{
public
void
generateExcel
(
Long
id
,
Context
context
)
{
//
CertificateCatalogEntity entity = dao.get(id);
CertificateCatalogEntity
entity
=
dao
.
get
(
id
);
//
parseDocxToJson(entity,true);
parseDocxToJson
(
entity
,
true
);
//
CertificateCatalogEntity updata = new CertificateCatalogEntity();
CertificateCatalogEntity
updata
=
new
CertificateCatalogEntity
();
//
updata.setId(entity.getId());
updata
.
setId
(
entity
.
getId
());
//
updata.setExcelFile(entity.getExcelFile());
updata
.
setExcelFile
(
entity
.
getExcelFile
());
//
updata.setUpdateTime(new Date());
updata
.
setUpdateTime
(
new
Date
());
//
dao.update(updata);
dao
.
update
(
updata
);
}
}
}
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/child/service/impl/ChildLicenseServiceImpl.java
View file @
5accba1e
...
@@ -70,6 +70,7 @@ public class ChildLicenseServiceImpl extends AbstractCRUDServiceImpl<ChildLicens
...
@@ -70,6 +70,7 @@ public class ChildLicenseServiceImpl extends AbstractCRUDServiceImpl<ChildLicens
entity
.
setBusinessPlace
(
applyLogEntity
.
getBusinessPlace
());
entity
.
setBusinessPlace
(
applyLogEntity
.
getBusinessPlace
());
entity
.
setLicensedItems
(
applyLogEntity
.
getLicenseProject
());
entity
.
setLicensedItems
(
applyLogEntity
.
getLicenseProject
());
entity
.
setFormStyleContent
(
item
.
getTemplateContent
());
entity
.
setFormStyleContent
(
item
.
getTemplateContent
());
entity
.
setFormContent
(
item
.
getFormContent
());
entity
.
setProcessStatus
(
ProcessStatusEnum
.
未处理
.
getValue
());
entity
.
setProcessStatus
(
ProcessStatusEnum
.
未处理
.
getValue
());
entity
.
setCreateTime
(
applyLogEntity
.
getCreateTime
());
entity
.
setCreateTime
(
applyLogEntity
.
getCreateTime
());
entity
.
setCreateUserId
(
applyLogEntity
.
getCreateUserId
());
entity
.
setCreateUserId
(
applyLogEntity
.
getCreateUserId
());
...
...
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java
View file @
5accba1e
...
@@ -25,4 +25,6 @@ public class ApplyLogVo extends BaseEntityLong {
...
@@ -25,4 +25,6 @@ public class ApplyLogVo extends BaseEntityLong {
/** 子证信息 */
/** 子证信息 */
List
<
ChildLicenseEntity
>
childLicense
;
List
<
ChildLicenseEntity
>
childLicense
;
private
String
processStatus
;
}
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java
View file @
5accba1e
...
@@ -128,6 +128,18 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
...
@@ -128,6 +128,18 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
return
query
;
return
query
;
}
}
@Override
protected
void
findAfter
(
ApplyLogEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
ApplyLogEntity
>
list
)
throws
AppException
{
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
for
(
ApplyLogEntity
entity:
list
){
List
<
ChildLicenseEntity
>
childLicenseList
=
childLicenseService
.
find
(
new
ChildLicenseQuery
().
applyId
(
entity
.
getId
()));
Map
<
Integer
,
List
<
ChildLicenseEntity
>>
group
=
childLicenseList
.
stream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getProcessStatus
()));
int
pCount
=
group
.
get
(
1
).
size
();
entity
.
setProcessStatus
(
pCount
+
"/"
+
childLicenseList
.
size
());
}
}
}
@Override
@Override
protected
void
validData
(
ApplyLogEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
validData
(
ApplyLogEntity
entity
,
Context
context
)
throws
AppException
{
if
(
StringUtils
.
isEmpty
(
entity
.
getCertificateCode
())){
if
(
StringUtils
.
isEmpty
(
entity
.
getCertificateCode
())){
...
...
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