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
9317f90a
Commit
9317f90a
authored
Feb 14, 2025
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
使用登记表生成
parent
26b8d539
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
0 deletions
+93
-0
CommonController.java
.../amos/boot/module/jg/biz/controller/CommonController.java
+15
-0
ICommonService.java
...ejoin/amos/boot/module/jg/biz/service/ICommonService.java
+4
-0
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+74
-0
use-registration-form-set.docx
...iz/src/main/resources/docx/use-registration-form-set.docx
+0
-0
use-registration-form-unit.docx
...z/src/main/resources/docx/use-registration-form-unit.docx
+0
-0
use-registration-form-set.ftl
...rc/main/resources/templates/use-registration-form-set.ftl
+0
-0
use-registration-form-unit.ftl
...c/main/resources/templates/use-registration-form-unit.ftl
+0
-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/controller/CommonController.java
View file @
9317f90a
...
...
@@ -747,4 +747,19 @@ public class CommonController extends BaseController {
public
ResponseModel
<
List
<
EquipmentClassifyDto
>>
getEquClassifyByCode
(
@RequestParam
(
value
=
"parentCode"
,
required
=
false
)
String
parentCode
)
{
return
ResponseHelper
.
buildResponse
(
commonService
.
getEquClassifyByCode
(
parentCode
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"使用登记表生成"
,
notes
=
"使用登记表生成"
)
@PostMapping
(
value
=
"/getRegistrationFormUrl"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getRegistrationFormUrl
(
@RequestBody
JSONObject
map
)
{
return
ResponseHelper
.
buildResponse
(
commonService
.
getRegistrationFormUrl
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"pdf流生成"
,
notes
=
"pdf流生成"
)
@PostMapping
(
value
=
"/getRegistrationFormStream"
)
public
void
getRegistrationFormStream
(
@RequestBody
JSONObject
map
,
HttpServletResponse
response
)
{
commonService
.
getRegistrationFormStream
(
map
,
response
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/ICommonService.java
View file @
9317f90a
...
...
@@ -252,4 +252,8 @@ public interface ICommonService {
List
<
EquipmentCategoryDto
>
getEquDefineByParentId
(
String
parentId
);
List
<
EquipmentClassifyDto
>
getEquClassifyByCode
(
String
parentCode
);
Map
<
String
,
Object
>
getRegistrationFormUrl
(
JSONObject
map
);
void
getRegistrationFormStream
(
JSONObject
map
,
HttpServletResponse
response
);
}
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/CommonServiceImpl.java
View file @
9317f90a
...
...
@@ -6,6 +6,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONException
;
...
...
@@ -178,6 +179,9 @@ public class CommonServiceImpl implements ICommonService {
// 业务通用发起——更名变更表单key
private
static
final
String
GMBG_PAGE_ID
=
"jgRegistrationInfo"
;
private
static
final
String
SELECTED_ROLE_SEQS
=
"selectRoleSeqs"
;
private
static
final
String
VEHICLE
=
"vehicle"
;
private
static
final
String
UNIT
=
"unit"
;
private
static
final
String
SET
=
"set"
;
@Autowired
EquipmentCategoryMapper
equipmentCategoryMapper
;
@Autowired
...
...
@@ -2206,6 +2210,76 @@ public class CommonServiceImpl implements ICommonService {
}
@Override
public
Map
<
String
,
Object
>
getRegistrationFormUrl
(
JSONObject
map
){
JSONObject
formData
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
map
.
get
(
"formData"
)));
String
manageType
=
JSONObject
.
toJSONString
(
map
.
get
(
"manageType"
));
String
wordPath
;
String
fileName
;
if
(
UNIT
.
equals
(
manageType
)){
wordPath
=
"use-registration-form-unit.ftl"
;
fileName
=
"use-registration-form-unit.ftl"
;
}
else
if
(
SET
.
equals
(
manageType
)){
wordPath
=
"use-registration-form-set.ftl"
;
fileName
=
"use-registration-form-set.ftl"
;
}
else
{
wordPath
=
"use-registration-form-vehicle.ftl"
;
fileName
=
"use-registration-form-vehicle.ftl"
;
}
// word转pdf
File
pdfFile
=
null
;
try
{
pdfFile
=
wordToPdf
(
fileName
,
wordPath
,
formData
);
return
MapBuilder
.<
String
,
Object
>
create
().
put
(
"url"
,
uploadFile
(
pdfFile
)).
build
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
Files
.
deleteIfExists
(
pdfFile
.
toPath
());
}
catch
(
Exception
e
)
{
log
.
error
(
"文件找不到,删除失败:{}"
,
e
);
}
}
}
@Override
public
void
getRegistrationFormStream
(
JSONObject
map
,
HttpServletResponse
response
){
JSONObject
formData
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
map
.
get
(
"formData"
)));
String
manageType
=
JSONObject
.
toJSONString
(
map
.
get
(
"manageType"
));
String
wordPath
;
String
fileName
;
if
(
UNIT
.
equals
(
manageType
)){
wordPath
=
"use-registration-form-unit.ftl"
;
fileName
=
"台套使用登记表_"
;
}
else
if
(
SET
.
equals
(
manageType
)){
wordPath
=
"use-registration-form-set.ftl"
;
fileName
=
"单位使用登记表_"
;
}
else
{
wordPath
=
"use-registration-form-vehicle.ftl"
;
fileName
=
"车用气瓶使用登记表_"
;
}
// word转pdf
File
pdfFile
;
try
{
pdfFile
=
wordToPdf
(
fileName
,
wordPath
,
formData
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
try
{
byte
[]
bytes
=
CommonServiceImpl
.
file2byte
(
pdfFile
);
String
docTitle
=
pdfFile
.
getName
();
FileExporter
.
exportFile
(
FileExporter
.
FileType
.
valueOf
(
"pdf"
),
docTitle
,
bytes
,
response
);
}
catch
(
Exception
e
)
{
log
.
error
(
"pdf文件转换失败:{}"
,
e
);
}
finally
{
try
{
Files
.
deleteIfExists
(
pdfFile
.
toPath
());
}
catch
(
Exception
e
)
{
log
.
error
(
"文件找不到,删除失败:{}"
,
e
);
}
}
}
@Override
public
List
<
EquipmentClassifyDto
>
getEquClassifyByCode
(
String
parentCode
)
{
List
<
EquipmentClassifyDto
>
equipmentCategoryDtos
=
commonMapper
.
getEquClassifyByCode
(
parentCode
);
if
(
ValidationUtil
.
isEmpty
(
equipmentCategoryDtos
))
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/docx/use-registration-form-set.docx
View file @
9317f90a
No preview for this file type
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/docx/use-registration-form-unit.docx
View file @
9317f90a
No preview for this file type
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/templates/use-registration-form-set.ftl
View file @
9317f90a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/templates/use-registration-form-unit.ftl
View file @
9317f90a
This diff is collapsed.
Click to expand it.
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