Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
certificate-print
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
廖旭伟
certificate-print
Commits
12cb4438
Commit
12cb4438
authored
Mar 29, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加二维码控件
parent
ebb4b7b1
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
686 additions
and
12 deletions
+686
-12
certificate-manager/pom.xml
certificate-manager/pom.xml
+6
-1
certificate-manager/src/main/java/com/mortals/xhx/common/code/ComponentEnum.java
.../main/java/com/mortals/xhx/common/code/ComponentEnum.java
+2
-1
certificate-manager/src/main/java/com/mortals/xhx/common/formdesign/DesignComponent.java
...va/com/mortals/xhx/common/formdesign/DesignComponent.java
+3
-0
certificate-manager/src/main/java/com/mortals/xhx/common/formdesign/component/DesignQrcodeComponent.java
...hx/common/formdesign/component/DesignQrcodeComponent.java
+55
-0
certificate-manager/src/main/java/com/mortals/xhx/common/utils/QrCodeUtil.java
...rc/main/java/com/mortals/xhx/common/utils/QrCodeUtil.java
+420
-0
certificate-manager/src/main/java/com/mortals/xhx/module/business/service/impl/BusinessLicenseServiceImpl.java
...ule/business/service/impl/BusinessLicenseServiceImpl.java
+175
-6
certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java
...s/xhx/module/record/service/impl/ApplyLogServiceImpl.java
+25
-4
No files found.
certificate-manager/pom.xml
View file @
12cb4438
...
...
@@ -178,7 +178,12 @@
<artifactId>
hutool-all
</artifactId>
<version>
5.7.14
</version>
</dependency>
</dependencies>
<dependency>
<groupId>
com.google.zxing
</groupId>
<artifactId>
javase
</artifactId>
<version>
3.4.1
</version>
</dependency>
</dependencies>
<build>
<resources>
...
...
certificate-manager/src/main/java/com/mortals/xhx/common/code/ComponentEnum.java
View file @
12cb4438
...
...
@@ -18,7 +18,8 @@ public enum ComponentEnum {
DATE
(
"date"
,
"日期选择栏"
),
AREA
(
"area"
,
"区域选择栏"
),
IMAGE
(
"@image"
,
"图片选择"
),
DYNAMIC_TABLE
(
"dt"
,
"动态表格"
);
DYNAMIC_TABLE
(
"dt"
,
"动态表格"
),
QRCODE
(
"@qrcode"
,
"二维码输入框"
);
private
String
value
;
private
String
desc
;
...
...
certificate-manager/src/main/java/com/mortals/xhx/common/formdesign/DesignComponent.java
View file @
12cb4438
...
...
@@ -42,6 +42,9 @@ public abstract class DesignComponent {
// else if (type.equals(ComponentEnum.AREA.getValue())) {
// return new AreaComponent(type);
// }
else
if
(
type
.
equals
(
ComponentEnum
.
QRCODE
.
getValue
()))
{
return
new
DesignQrcodeComponent
(
type
);
}
else
{
throw
new
AppException
(
String
.
format
(
"不支持当前组件类型,Type:%s"
,
type
));
}
...
...
certificate-manager/src/main/java/com/mortals/xhx/common/formdesign/component/DesignQrcodeComponent.java
0 → 100644
View file @
12cb4438
package
com.mortals.xhx.common.formdesign.component
;
import
com.google.common.collect.Lists
;
import
com.mortals.xhx.common.code.ComponentEnum
;
import
com.mortals.xhx.common.formdesign.DesignComponent
;
import
com.mortals.xhx.common.formdesign.ListItem
;
import
com.mortals.xhx.common.pdu.gen.component.ComponentCons
;
/**
* 二维码输入框
*/
public
class
DesignQrcodeComponent
extends
DesignComponent
{
public
DesignQrcodeComponent
(
String
type
)
{
super
(
type
);
}
@Override
public
ListItem
buildDefaultComponent
(
ComponentCons
cons
)
{
ListItem
columnsItem
=
new
ListItem
();
columnsItem
.
setId
(
cons
.
getVal
());
columnsItem
.
set_id
(
cons
.
getVal
());
columnsItem
.
setCompType
(
"input"
);
columnsItem
.
setCompName
(
cons
.
getLabel
());
columnsItem
.
setCompIcon
(
"input"
);
columnsItem
.
setEle
(
"el-input"
);
columnsItem
.
setViewType
(
"text"
);
columnsItem
.
setConfig
(
true
);
columnsItem
.
setShowLabel
(
true
);
columnsItem
.
setLabel
(
cons
.
getLabel
());
columnsItem
.
setLabelWidth
(
120
);
columnsItem
.
setPlaceholder
(
"请输入"
+
cons
.
getLabel
());
columnsItem
.
setRequired
(
true
);
columnsItem
.
setMaxLength
(
50
);
columnsItem
.
setGutter
(
15
);
columnsItem
.
setSpan
(
24
);
columnsItem
.
setWidth
(
"100%"
);
columnsItem
.
setClearable
(
true
);
columnsItem
.
setDisabled
(
false
);
columnsItem
.
setReadonly
(
false
);
columnsItem
.
setStatus
(
"normal"
);
columnsItem
.
setPrefixIcon
(
""
);
columnsItem
.
setRules
(
Lists
.
newArrayList
());
columnsItem
.
setRulesType
(
"default"
);
columnsItem
.
setAppend
(
""
);
columnsItem
.
setPrepend
(
""
);
columnsItem
.
setLayout
(
"colItem"
);
return
columnsItem
;
}
@Override
public
String
getType
()
{
return
ComponentEnum
.
QRCODE
.
getValue
();
}
}
certificate-manager/src/main/java/com/mortals/xhx/common/utils/QrCodeUtil.java
0 → 100644
View file @
12cb4438
This diff is collapsed.
Click to expand it.
certificate-manager/src/main/java/com/mortals/xhx/module/business/service/impl/BusinessLicenseServiceImpl.java
View file @
12cb4438
This diff is collapsed.
Click to expand it.
certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java
View file @
12cb4438
...
...
@@ -21,10 +21,7 @@ import com.mortals.xhx.base.system.upload.service.UploadService;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.utils.ExportDocUtil
;
import
com.mortals.xhx.common.utils.ImageBase64
;
import
com.mortals.xhx.common.utils.StringUtils
;
import
com.mortals.xhx.common.utils.WordUtil
;
import
com.mortals.xhx.common.utils.*
;
import
com.mortals.xhx.module.certificate.model.CertificateCatalogEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateClassifyEntity
;
import
com.mortals.xhx.module.certificate.pdu.ApplyLogPdu
;
...
...
@@ -209,6 +206,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
CertificateCatalogEntity
catalog
=
certificateCatalogService
.
get
(
applyLogEntity
.
getCatalogId
());
applyLogEntity
.
setCatalogCode
(
catalog
.
getCatalogCode
());
applyLogEntity
.
setCatalogName
(
catalog
.
getCatalogName
());
applyLogEntity
.
setFormTemplate
(
catalog
.
getFormContent
());
DocTemplateVO
docTemplate
=
new
DocTemplateVO
(
catalog
.
getTemplateUrl
(),
applyLogEntity
.
getFormContent
());
String
paths
=
preview
(
docTemplate
,
context
);
String
[]
vals
=
paths
.
split
(
";"
);
...
...
@@ -306,6 +304,25 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
if
(
entry
.
getKey
().
indexOf
(
"dt_"
)
!=
-
1
)
{
builder
.
bind
(
entry
.
getKey
(),
new
MultipleRowTableRenderPolicy
());
}
//二维码输入框处理
if
(
entry
.
getKey
().
indexOf
(
"@qrcode"
)
!=
-
1
)
{
try
{
String
filePath
=
rootPath
+
"file/qrcode/"
;
String
qrcodeName
=
new
Date
().
getTime
()
+
".png"
;
File
pathDir
=
new
File
(
filePath
);
if
(!
pathDir
.
exists
())
{
pathDir
.
mkdirs
();
}
String
imagepath
=
filePath
+
qrcodeName
;
QrCodeUtil
.
generateQrCodeFile
(
entry
.
getValue
().
toString
(),
imagepath
);
PictureRenderData
pictureRenderData
=
Pictures
.
ofStream
(
new
FileInputStream
(
imagepath
),
PictureType
.
PNG
)
.
size
(
100
,
100
).
create
();
addMap
.
put
(
StrUtil
.
removePrefixIgnoreCase
(
entry
.
getKey
(),
"@"
),
pictureRenderData
);
//entry.setValue(pictureRenderData);
}
catch
(
FileNotFoundException
e
)
{
log
.
error
(
"error"
,
e
);
}
}
});
if
(
addMap
.
size
()>
0
){
data
.
putAll
(
addMap
);
...
...
@@ -330,6 +347,10 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
//转换预览图片
String
fileName
=
RandomUtil
.
randomNumbers
(
12
)
+
".jpg"
;
String
preView
=
this
.
filePath
+
"/preview/"
+
fileName
;
File
preViewPathDir
=
new
File
(
this
.
filePath
+
"/preview/"
);
if
(!
preViewPathDir
.
exists
())
{
preViewPathDir
.
mkdirs
();
}
WordUtil
.
convertWordToJPEG
(
mergedoc
,
preView
);
log
.
info
(
"preView:"
+
"/preview/"
+
fileName
);
//下载地址拼装
...
...
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