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
79684bb7
Commit
79684bb7
authored
Mar 19, 2025
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补证登记相关
parent
1af789fd
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
179 additions
and
19 deletions
+179
-19
JgCertificateReplenishDto.java
...mos/boot/module/jg/api/dto/JgCertificateReplenishDto.java
+10
-0
JgCertificateReplenish.java
...mos/boot/module/jg/api/entity/JgCertificateReplenish.java
+18
-0
IJgCertificateReplenishService.java
...module/jg/api/service/IJgCertificateReplenishService.java
+11
-1
CommonController.java
.../amos/boot/module/jg/biz/controller/CommonController.java
+23
-14
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+5
-4
JgCertificateReplenishServiceImpl.java
...g/biz/service/impl/JgCertificateReplenishServiceImpl.java
+107
-0
CertificateReplenish.docx
...-jg-biz/src/main/resources/docx/CertificateReplenish.docx
+0
-0
superviseBusinessCategory.json
...iz/src/main/resources/json/superviseBusinessCategory.json
+5
-0
CertificateReplenish.ftl
...biz/src/main/resources/templates/CertificateReplenish.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/JgCertificateReplenishDto.java
View file @
79684bb7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
...
...
@@ -28,6 +29,12 @@ public class JgCertificateReplenishDto extends BaseDto {
@ApiModelProperty
(
value
=
"设备种类"
)
private
String
equList
;
@ApiModelProperty
(
value
=
"设备类别编码"
)
private
String
equCategoryCode
;
@ApiModelProperty
(
value
=
"设备类别"
)
private
String
equCategory
;
@ApiModelProperty
(
value
=
"申请编号"
)
private
String
applyNo
;
...
...
@@ -112,4 +119,7 @@ public class JgCertificateReplenishDto extends BaseDto {
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createUserName
;
@ApiModelProperty
(
"是否车用气瓶1是,0不是(特种气瓶使用)"
)
private
String
whetherVehicleCylinder
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgCertificateReplenish.java
View file @
79684bb7
...
...
@@ -40,6 +40,18 @@ public class JgCertificateReplenish extends BaseEntity {
private
String
equList
;
/**
* 设备类别编码
*/
@TableField
(
"equ_category_code"
)
private
String
equCategoryCode
;
/**
* 设备类别
*/
@TableField
(
"equ_category"
)
private
String
equCategory
;
/**
* 申请编号
*/
@TableField
(
"apply_no"
)
...
...
@@ -207,4 +219,10 @@ public class JgCertificateReplenish extends BaseEntity {
@TableField
(
"create_user_name"
)
private
String
createUserName
;
/**
* 是否车用气瓶1是,0不是(特种气瓶使用)
*/
@TableField
(
"whether_vehicle_cylinder"
)
private
String
whetherVehicleCylinder
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IJgCertificateReplenishService.java
View file @
79684bb7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Map
;
/**
* 使用登记表补证接口类
*
* @author system_generator
* @date 2025-03-19
*/
public
interface
IJgCertificateReplenishService
{}
public
interface
IJgCertificateReplenishService
{
Map
<
String
,
Object
>
getCertReplenishFormUrl
(
JSONObject
map
);
void
getCertReplenishFormStream
(
JSONObject
jsonObject
,
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/controller/CommonController.java
View file @
79684bb7
...
...
@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgCertificateReplenishService
;
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
;
...
...
@@ -29,6 +30,7 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -53,21 +55,14 @@ import java.util.stream.Collectors;
@RestController
@Api
(
tags
=
"监管公共Api"
)
@RequestMapping
(
value
=
"/common"
)
@RequiredArgsConstructor
public
class
CommonController
extends
BaseController
{
@Autowired
ICommonService
commonService
;
@Autowired
IPdfService
pdfService
;
@Autowired
JgRegistrationHistoryServiceImpl
jgRegistrationHistoryService
;
@Autowired
JgUseRegistrationMapper
jgUseRegistrationMapper
;
@Autowired
CodeUtil
codeUtil
;
private
final
ICommonService
commonService
;
private
final
IPdfService
pdfService
;
private
final
JgRegistrationHistoryServiceImpl
jgRegistrationHistoryService
;
private
final
JgUseRegistrationMapper
jgUseRegistrationMapper
;
private
final
IJgCertificateReplenishService
iJgCertificateReplenishService
;
private
final
CodeUtil
codeUtil
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/currentLoginInfo"
)
...
...
@@ -810,4 +805,18 @@ public class CommonController extends BaseController {
formData
.
put
(
"userName"
,
selectedOrgInfo
.
getUserModel
().
getRealName
());
commonService
.
getRegistrationFormStream
(
formData
,
manageType
,
response
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"补证申请表生成"
,
notes
=
"补证申请表生成"
)
@PostMapping
(
value
=
"/getCertReplenishFormUrl"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getCertReplenishFormUrl
(
@RequestBody
JSONObject
jsonObject
)
{
return
ResponseHelper
.
buildResponse
(
iJgCertificateReplenishService
.
getCertReplenishFormUrl
(
jsonObject
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"补证pdf流生成"
,
notes
=
"补证pdf流生成"
)
@PostMapping
(
value
=
"/getCertReplenishFormStream"
)
public
void
getCertReplenishFormStream
(
HttpServletResponse
response
,
@RequestBody
JSONObject
jsonObject
)
{
iJgCertificateReplenishService
.
getCertReplenishFormStream
(
jsonObject
,
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 @
79684bb7
...
...
@@ -1212,13 +1212,14 @@ public class CommonServiceImpl implements ICommonService {
* 上传文件至文件服务器
*
* @param file 文件
* @param path 路径
*/
p
rivate
String
uploadFile
(
File
file
)
{
p
ublic
String
uploadFile
(
File
file
,
String
path
)
{
Assert
.
notNull
(
file
,
"文件不能为空"
);
MultipartFile
multipartFile
=
new
ByteArrayMultipartFile
(
"file"
,
"file.pdf"
,
"application/pdf"
,
file2byte
(
file
));
// 返回路径 : upload/common/
useregistrationformfiles
/xxx.xx
FeignClientResult
<
Map
<
String
,
String
>>
result
=
Systemctl
.
fileStorageClient
.
updateCommonFileFree
(
multipartFile
,
"useRegistrationFormFiles"
);
// 返回路径 : upload/common/
${path}
/xxx.xx
FeignClientResult
<
Map
<
String
,
String
>>
result
=
Systemctl
.
fileStorageClient
.
updateCommonFileFree
(
multipartFile
,
path
);
String
urlString
=
""
;
if
(
result
!=
null
)
{
for
(
String
s
:
result
.
getResult
().
keySet
())
{
...
...
@@ -2446,7 +2447,7 @@ public class CommonServiceImpl implements ICommonService {
File
pdfFile
=
null
;
try
{
pdfFile
=
wordToPdf
(
fileName
,
wordPath
,
formData
);
return
MapBuilder
.<
String
,
Object
>
create
().
put
(
"useRegistrationFormUrl"
,
uploadFile
(
pdfFile
)).
build
();
return
MapBuilder
.<
String
,
Object
>
create
().
put
(
"useRegistrationFormUrl"
,
uploadFile
(
pdfFile
,
"useRegistrationFormFiles"
)).
build
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
finally
{
...
...
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/JgCertificateReplenishServiceImpl.java
View file @
79684bb7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgCertificateReplenish
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgCertificateReplenishMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgCertificateReplenishService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.FileExporter
;
import
lombok.RequiredArgsConstructor
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.nio.file.Files
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
/**
* 使用登记表补证服务实现类
...
...
@@ -16,7 +26,10 @@ import java.util.List;
* @date 2025-03-19
*/
@Service
@RequiredArgsConstructor
public
class
JgCertificateReplenishServiceImpl
extends
BaseService
<
JgCertificateReplenish
,
JgCertificateReplenish
,
JgCertificateReplenishMapper
>
implements
IJgCertificateReplenishService
{
private
final
CommonServiceImpl
commonService
;
/**
* 分页查询
*/
...
...
@@ -30,4 +43,97 @@ public class JgCertificateReplenishServiceImpl extends BaseService<JgCertificate
public
List
<
JgCertificateReplenish
>
queryForJgCertificateReplenishList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 补证申请表生成
*
* @param jsonObject
* @return
*/
@Override
public
Map
<
String
,
Object
>
getCertReplenishFormUrl
(
JSONObject
jsonObject
)
{
JSONObject
formData
=
this
.
writeCertReplenishFormData
(
jsonObject
);
String
wordPath
=
"CertificateReplenish.ftl"
;
String
fileName
=
"使用登记证补证申请表_"
;
File
pdfFile
=
null
;
try
{
pdfFile
=
commonService
.
wordToPdf
(
fileName
,
wordPath
,
formData
);
return
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"certReplenishFormUrl"
,
commonService
.
uploadFile
(
pdfFile
,
"certificateReplenishFiles"
))
.
build
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
assert
pdfFile
!=
null
;
Files
.
deleteIfExists
(
pdfFile
.
toPath
());
}
catch
(
Exception
e
)
{
log
.
error
(
"文件找不到,删除失败:{}"
,
e
);
}
}
}
/**
* 补证pdf流生成
*
* @param jsonObject
* @param response
*/
@Override
public
void
getCertReplenishFormStream
(
JSONObject
jsonObject
,
HttpServletResponse
response
)
{
JSONObject
formData
=
this
.
writeCertReplenishFormData
(
jsonObject
);
String
wordPath
=
"CertificateReplenish.ftl"
;
String
fileName
=
"使用登记证补证申请表_"
;
File
pdfFile
;
try
{
pdfFile
=
commonService
.
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
);
}
}
}
private
JSONObject
writeCertReplenishFormData
(
JSONObject
jsonObject
)
{
JSONObject
result
=
new
JSONObject
();
result
.
put
(
"applyNo"
,
"applyNo"
);
result
.
put
(
"useUnitName"
,
"useUnitName"
);
result
.
put
(
"useUnitAddress"
,
"useUnitAddress"
);
result
.
put
(
"applicationReason"
,
"1"
);
result
.
put
(
"lossDamageTime"
,
"2022-09-09"
);
result
.
put
(
"safetyManagerName"
,
"张三"
);
result
.
put
(
"safetyManagerPhone"
,
"13209090909"
);
JSONArray
equLists
=
new
JSONArray
();
equLists
.
fluentAdd
(
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"index"
,
"1"
)
.
put
(
"productName"
,
"产品名称"
)
.
put
(
"equCode"
,
"设备代码"
)
.
put
(
"useRegistrationCode"
,
"使用登记证编号"
)
.
put
(
"factoryNum"
,
"设备编号"
)
.
build
())
.
fluentAdd
(
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"index"
,
"2"
)
.
put
(
"productName"
,
"产品名称1"
)
.
put
(
"equCode"
,
"设备代码2"
)
.
put
(
"useRegistrationCode"
,
"使用登记证编号3"
)
.
put
(
"factoryNum"
,
"设备编号4"
)
.
build
());
result
.
put
(
"equLists"
,
equLists
);
result
.
put
(
"handler"
,
"handler"
);
result
.
put
(
"applicationDateYear"
,
"2001"
);
result
.
put
(
"applicationDateMonth"
,
"12"
);
result
.
put
(
"applicationDateDay"
,
"12"
);
return
result
;
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/docx/CertificateReplenish.docx
0 → 100644
View file @
79684bb7
File added
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/json/superviseBusinessCategory.json
View file @
79684bb7
...
...
@@ -41,6 +41,11 @@
"image"
:
"upload/tzs/common/image/使用登记.png"
},
{
"name"
:
"补证登记"
,
"code"
:
"DJ_BZ"
,
"image"
:
"upload/tzs/common/image/更名变更登记.png"
},
{
"name"
:
"改造变更登记"
,
"code"
:
"DJ_GZ"
,
"image"
:
"upload/tzs/common/image/改造变更登记.png"
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/templates/CertificateReplenish.ftl
0 → 100644
View file @
79684bb7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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