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
9503842c
Commit
9503842c
authored
Mar 11, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.使用标志自测修改
parent
87e02122
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
14 deletions
+64
-14
UseFlagParamDto.java
.../yeejoin/amos/boot/module/jg/api/dto/UseFlagParamDto.java
+7
-0
CommonController.java
.../amos/boot/module/jg/biz/controller/CommonController.java
+37
-0
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+20
-14
flag1-use-equip.ftl
...e-jg-biz/src/main/resources/templates/flag1-use-equip.ftl
+0
-0
flag2-use-equip.ftl
...e-jg-biz/src/main/resources/templates/flag2-use-equip.ftl
+0
-0
flag3-use-equip.ftl
...e-jg-biz/src/main/resources/templates/flag3-use-equip.ftl
+0
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/UseFlagParamDto.java
View file @
9503842c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
lombok.Builder
;
import
lombok.Data
;
import
java.util.Date
;
...
...
@@ -95,6 +96,12 @@ public class UseFlagParamDto {
*/
private
String
cylinderNumOrVolume
;
/**
* 充装介质--车用气瓶专用
*/
private
String
fillingMedium
;
/**
* 申请编号
*/
...
...
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 @
9503842c
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IPdfService
;
...
...
@@ -21,6 +22,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -373,4 +375,39 @@ public class CommonController extends BaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/use-flag-test"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"使用标志生成测试"
,
notes
=
"使用标志生成测试"
)
public
ResponseModel
<
String
>
getUserPhone
(
HttpServletResponse
response
)
{
UseFlagParamDto
useFlagParamDto
=
buildUseFlagParam
();
commonService
.
useFlagGenerate
(
useFlagParamDto
,
response
);
return
ResponseHelper
.
buildResponse
(
"succese"
);
}
private
UseFlagParamDto
buildUseFlagParam
(){
UseFlagParamDto
useFlagParamDto
=
new
UseFlagParamDto
();
useFlagParamDto
.
setEquList
(
"设备种类名称"
);
useFlagParamDto
.
setEquListCode
(
"0000"
);
useFlagParamDto
.
setEquipCode
(
"10001101"
);
// useFlagParamDto.setEquipDefine("设备品种");
useFlagParamDto
.
setUseUnitName
(
"使用单位名称"
);
useFlagParamDto
.
setEquipCategory
(
"设备类别名称"
);
useFlagParamDto
.
setUseInnerCode
(
"单位内编号"
);
useFlagParamDto
.
setReceiveOrgName
(
"登记机关"
);
useFlagParamDto
.
setInspectionUnitName
(
"检验机构名称"
);
useFlagParamDto
.
setUseRegistrationCode
(
"11111"
);
useFlagParamDto
.
setNextInspectionDate
(
new
Date
());
useFlagParamDto
.
setMaintenanceUnitName
(
"维保单位名称"
);
useFlagParamDto
.
setEmergencyTel
(
"17792961611"
);
useFlagParamDto
.
setCarNumber
(
"车牌号"
);
useFlagParamDto
.
setFactoryNumber
(
"产品编号"
);
useFlagParamDto
.
setCylinderNumOrVolume
(
"12"
);
useFlagParamDto
.
setFillingMedium
(
"氮气"
);
useFlagParamDto
.
setApplyNo
(
"101"
);
return
useFlagParamDto
;
}
}
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 @
9503842c
...
...
@@ -353,18 +353,19 @@ public class CommonServiceImpl implements ICommonService {
@Override
public
void
useFlagGenerate
(
UseFlagParamDto
useFlagParamDto
,
HttpServletResponse
response
)
{
if
(
useFlagParamDto
==
null
)
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
Map
<
String
,
Object
>
paramMap
;
paramMap
=
Bean
.
BeantoMap
(
useFlagParamDto
);
// 设置二维码
Objects
.
requireNonNull
(
useFlagParamDto
,
"参数不能为空"
);
Map
<
String
,
Object
>
paramMap
=
Bean
.
BeantoMap
(
useFlagParamDto
);
// 二维码设置
setQrCode
(
useFlagParamDto
,
paramMap
);
// 日期设置
setNextDate
(
useFlagParamDto
,
paramMap
);
String
ftlPath
=
this
.
getFtlPathByBiz
(
useFlagParamDto
);
if
(
StringUtils
.
isEmpty
(
ftlPath
))
{
throw
new
BadRequest
(
"无法找到使用标志"
);
throw
new
BadRequest
(
"无法找到使用标志
模板!
"
);
}
File
pdfFile
=
null
;
try
{
pdfFile
=
this
.
wordToPdf
(
"特种设备使用标志_"
,
ftlPath
,
paramMap
);
...
...
@@ -373,17 +374,18 @@ public class CommonServiceImpl implements ICommonService {
FileExporter
.
exportFile
(
FileExporter
.
FileType
.
valueOf
(
"pdf"
),
docTitle
,
bytes
,
response
);
}
catch
(
Exception
e
)
{
log
.
error
(
"特种设备使用标志生成失败"
,
e
);
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
"特种设备使用标志生成失败"
,
e
);
}
finally
{
if
(
pdfFile
!=
null
)
{
pdfFile
.
delete
OnExit
();
pdfFile
.
delete
();
}
}
}
private
void
setNextDate
(
UseFlagParamDto
useFlagParamDto
,
Map
<
String
,
Object
>
paramMap
)
{
if
(
useFlagParamDto
.
getNextInspectionDate
()
!=
null
)
{
paramMap
.
put
(
"year"
,
DateUtil
.
year
(
useFlagParamDto
.
getNextInspectionDate
()));
paramMap
.
put
(
"year"
,
DateUtil
.
year
(
useFlagParamDto
.
getNextInspectionDate
())
+
""
);
paramMap
.
put
(
"month"
,
DateUtil
.
month
(
useFlagParamDto
.
getNextInspectionDate
())
+
1
);
}
}
...
...
@@ -563,12 +565,16 @@ public class CommonServiceImpl implements ICommonService {
@Override
public
List
<
Map
<
String
,
Object
>>
getUnitListByType
(
String
type
)
{
if
(
type
.
equals
(
"use"
))
{
switch
(
type
)
{
case
"use"
:
type
=
"使用单位"
;
}
else
if
(
type
.
equals
(
"maintenance"
))
{
break
;
case
"maintenance"
:
type
=
"安装改造维修单位"
;
}
else
if
(
type
.
equals
(
"inspection"
))
{
break
;
case
"inspection"
:
type
=
"检验检测机构"
;
break
;
}
return
commonMapper
.
getUnitListByType
(
type
);
}
...
...
@@ -1414,7 +1420,7 @@ public class CommonServiceImpl implements ICommonService {
String
equipType2MidDigits
;
if
(
ValidationUtil
.
isEmpty
(
equDefine
))
{
// 没有设备品种的设备取设备类别代码中间两位
equipType2MidDigits
=
equCategory
.
substring
(
1
,
3
);
equipType2MidDigits
=
equCategory
.
substring
(
1
,
3
);
}
else
{
// 设备品种代码中间两位
equipType2MidDigits
=
equDefine
.
substring
(
1
,
3
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/templates/flag1-use-equip.ftl
View file @
9503842c
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/templates/flag2-use-equip.ftl
View file @
9503842c
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/templates/flag3-use-equip.ftl
0 → 100644
View file @
9503842c
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