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
a9c5733e
Commit
a9c5733e
authored
Dec 26, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
94799c8b
fad3d2a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
16 deletions
+124
-16
ControllerAop.java
...a/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
+8
-14
JgChangeRegistrationUnitController.java
...jg/biz/controller/JgChangeRegistrationUnitController.java
+15
-0
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+101
-2
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
View file @
a9c5733e
...
...
@@ -145,23 +145,17 @@ public class ControllerAop {
// 验证token有效性,防止token失效
AgencyUserModel
userModel
;
try
{
// StopWatch stopWatch = new StopWatch();
// stopWatch.start("1");
String
authToken
=
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
token
);
if
(
redisUtils
.
hasKey
(
authToken
))
{
logger
.
info
(
"登录命中缓存 ,直接返回!!===========>"
);
return
;
}
// stopWatch.stop();
// logger.info("get auth token count time===========> {}", stopWatch.getTotalTimeSeconds());
// stopWatch.start("2");
// FeignClientResult<AgencyUserModel> agencyUserModel = Privilege.agencyUserClient.getme();
// userModel = agencyUserModel.getResult();
// if (userModel == null) {
// throw new Exception("无法获取用户信息");
// }
// RequestContext.setExeUserId(userModel.getUserId());
// logger.info("get me count time===========> {}", stopWatch.getTotalTimeSeconds());
FeignClientResult
<
AgencyUserModel
>
agencyUserModel
=
Privilege
.
agencyUserClient
.
getme
();
userModel
=
agencyUserModel
.
getResult
();
if
(
userModel
==
null
)
{
throw
new
Exception
(
"无法获取用户信息"
);
}
RequestContext
.
setExeUserId
(
userModel
.
getUserId
());
}
catch
(
Exception
e
)
{
// 删除失效token缓存
logger
.
info
(
"catch pattern before==========>"
+
pattern
);
...
...
@@ -169,8 +163,8 @@ public class ControllerAop {
logger
.
info
(
"catch pattern after==========>"
+
pattern
);
throw
new
RuntimeException
(
e
.
getMessage
());
}
//
saveUserRedis(userModel, token);
saveUserRedis
();
saveUserRedis
(
userModel
,
token
);
//
saveUserRedis();
}
else
{
throw
new
AuthException
(
"请求未包含认证信息."
);
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeRegistrationUnitController.java
View file @
a9c5733e
...
...
@@ -15,16 +15,22 @@ import io.swagger.annotations.Api;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.io.*
;
import
java.net.URLEncoder
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationUnitServiceImpl
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto
;
...
...
@@ -177,4 +183,13 @@ public class JgChangeRegistrationUnitController extends BaseController {
jgChangeRegistrationUnitServiceImpl
.
accept
(
jgInstallationNoticeDto
,
op
);
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/export"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出使用登记证"
,
notes
=
"导出使用登记证"
)
public
void
exportImageZip
(
HttpServletResponse
response
,
@RequestParam
(
"sequenceNbr"
)
String
sequenceNbr
)
throws
IOException
{
jgChangeRegistrationUnitServiceImpl
.
exportUseRegistrationCertificate
(
sequenceNbr
,
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/JgChangeRegistrationUnitServiceImpl.java
View file @
a9c5733e
...
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.aspose.words.SaveFormat
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ByteArrayMultipartFile
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto
;
...
...
@@ -15,11 +16,11 @@ import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import
com.yeejoin.amos.boot.module.jg.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationUnitService
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.OtherInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.UseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -42,12 +43,15 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.time.LocalDate
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -112,6 +116,16 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
@Autowired
private
JgChangeRegistrationNameEqMapper
jgChangeRegistrationNameEqMapper
;
@Autowired
private
IdxBizJgUseInfoServiceImpl
idxBizJgUseInfoService
;
@Autowired
private
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
@Autowired
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
@Autowired
ICommonService
commonService
;
...
...
@@ -672,4 +686,88 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
return
null
;
}
/**
* 导出使用登记证
*
* @param sequenceNbr
*/
public
void
exportUseRegistrationCertificate
(
String
sequenceNbr
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
exportParamsMap
=
new
HashMap
<>();
//查询移装变更详情
JgChangeRegistrationUnit
transfer
=
this
.
getById
(
sequenceNbr
);
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
transfer
.
getSequenceNbr
());
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
=
JgChangeRegistrationUnitEqMapper
.
selectOne
(
queryWrapper
);
if
(
ValidationUtil
.
isEmpty
(
transfer
)
||
ValidationUtil
.
isEmpty
(
jgChangeRegistrationUnitEq
))
{
throw
new
BadRequest
(
"使用登记证导出失败,请稍后重试!"
);
}
//是否废弃
exportParamsMap
.
put
(
"isInvalid"
,
jgChangeRegistrationUnitEq
.
getIsInvalid
());
//登记机关
exportParamsMap
.
put
(
"receiveOrgName"
,
transfer
.
getReceiveOrgName
());
//使用登记证编号
exportParamsMap
.
put
(
"useRegistrationCode"
,
transfer
.
getUseRegistCode
());
//使用单位名称
exportParamsMap
.
put
(
"useUnitName"
,
transfer
.
getUseUnitName
());
//监管码
LambdaQueryWrapper
<
OtherInfo
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
OtherInfo
tzsJgOtherInfo
=
tzsJgOtherInfoMapper
.
selectOne
(
queryWrapper1
);
exportParamsMap
.
put
(
"supervisoryCode"
,
tzsJgOtherInfo
.
getSupervisoryCode
());
//发证日期(当前时间)
LocalDate
today
=
LocalDate
.
now
();
exportParamsMap
.
put
(
"giveOutYear"
,
today
.
getYear
());
exportParamsMap
.
put
(
"giveOutMonth"
,
today
.
getMonthValue
());
exportParamsMap
.
put
(
"giveOutDay"
,
today
.
getDayOfMonth
());
//设备使用地址
//查询设备注册信息
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoService
.
getOne
(
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
eq
(
"RECORD"
,
jgChangeRegistrationUnitEq
.
getEquId
()));
if
(!
ValidationUtil
.
isEmpty
(
registerInfo
)){
//设备种类、类别、品种
String
equList
=
registerInfo
.
getEquList
();
//设备种类
String
equCategory
=
registerInfo
.
getEquCategory
();
//设备类别
String
equDefine
=
registerInfo
.
getEquDefine
();
//设备品种
List
<
EquipmentCategory
>
categoryList0
=
commonService
.
getEquipmentCategoryList
(
equList
,
null
);
List
<
EquipmentCategory
>
categoryList1
=
commonService
.
getEquipmentCategoryList
(
equCategory
,
null
);
List
<
EquipmentCategory
>
categoryList2
=
commonService
.
getEquipmentCategoryList
(
equDefine
,
null
);
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
categoryList1
))
{
exportParamsMap
.
put
(
"equList"
,
categoryList0
.
get
(
0
).
getName
());
}
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
categoryList1
))
{
exportParamsMap
.
put
(
"equCategory"
,
categoryList1
.
get
(
0
).
getName
());
}
if
(
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isNotEmpty
(
categoryList2
))
{
exportParamsMap
.
put
(
"equDefine"
,
categoryList2
.
get
(
0
).
getName
());
}
//设备代码
exportParamsMap
.
put
(
"equCode"
,
registerInfo
.
getEquCode
());
}
//单位内部编码
IdxBizJgUseInfo
useInfo
=
idxBizJgUseInfoService
.
getOneData
(
jgChangeRegistrationUnitEq
.
getEquId
());
if
(!
ValidationUtil
.
isEmpty
(
useInfo
)){
exportParamsMap
.
put
(
"useInnerCode"
,
useInfo
.
getUseInnerCode
());
String
fullAddress
=
""
;
String
province
=
useInfo
.
getProvinceName
();
String
city
=
useInfo
.
getCityName
();
String
county
=
useInfo
.
getCountyName
();
String
street
=
useInfo
.
getStreetName
();
String
address
=
useInfo
.
getAddress
();
fullAddress
=
province
+
city
+
county
+
street
+
address
;
exportParamsMap
.
put
(
"fullAddress"
,
fullAddress
);
}
IdxBizJgFactoryInfo
factoryInfo
=
idxBizJgFactoryInfoService
.
getOneData
(
jgChangeRegistrationUnitEq
.
getEquId
());
//产品编号(出厂编号)
if
(!
ValidationUtil
.
isEmpty
(
factoryInfo
)){
exportParamsMap
.
put
(
"factoryNum"
,
factoryInfo
.
getFactoryNum
());
}
//调用生成使用登记证
commonService
.
generateCertificateReport
(
exportParamsMap
,
response
);
}
}
\ No newline at end of file
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