Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
cms
Commits
3dbcae24
提交
3dbcae24
authored
9月 08, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
印章管理接口开发完成
上级
d23f84c1
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
379 行增加
和
150 行删除
+379
-150
SealInfoDTO.java
...ain/java/com/mmc/iuav/user/model/fdd/dto/SealInfoDTO.java
+34
-0
SealInfoVO.java
.../main/java/com/mmc/iuav/user/model/fdd/vo/SealInfoVO.java
+49
-0
SealManageController.java
...om/mmc/iuav/user/controller/fdd/SealManageController.java
+49
-47
SealManageDao.java
...rc/main/java/com/mmc/iuav/user/dao/fdd/SealManageDao.java
+18
-0
SealInfoDO.java
...rc/main/java/com/mmc/iuav/user/entity/fdd/SealInfoDO.java
+11
-64
SealManageService.java
...java/com/mmc/iuav/user/service/fdd/SealManageService.java
+11
-39
UserFddAuthService.java
...ava/com/mmc/iuav/user/service/fdd/UserFddAuthService.java
+1
-0
SealManageServiceImpl.java
...mmc/iuav/user/service/fdd/impl/SealManageServiceImpl.java
+136
-0
SealManageDao.xml
...vice-user/src/main/resources/mapper/fdd/SealManageDao.xml
+70
-0
没有找到文件。
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/fdd/dto/SealInfoDTO.java
0 → 100644
浏览文件 @
3dbcae24
package
com
.
mmc
.
iuav
.
user
.
model
.
fdd
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Author LW
* @date 2022/8/4 14:20
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public
class
SealInfoDTO
implements
Serializable
{
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"印章名称"
)
private
String
sealName
;
@ApiModelProperty
(
value
=
"印章编号"
)
private
String
signatureId
;
@ApiModelProperty
(
value
=
"印章状态: 0:默认 1:未启用"
)
private
Integer
sealStatus
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"印章图片"
)
private
String
sealUrl
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/fdd/vo/SealInfoVO.java
0 → 100644
浏览文件 @
3dbcae24
package
com
.
mmc
.
iuav
.
user
.
model
.
fdd
.
vo
;
import
com.mmc.iuav.group.Freeze
;
import
com.mmc.iuav.group.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* @Author LW
* @date 2022/8/5 17:19
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
SealInfoVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1288955644357663835L
;
@ApiModelProperty
(
value
=
"开始时间"
)
private
String
startTime
;
@ApiModelProperty
(
value
=
"结束时间"
)
private
String
endTime
;
@ApiModelProperty
(
value
=
"端口:0小程序 1后台"
)
private
Integer
port
;
@ApiModelProperty
(
value
=
"用户唯一标识"
,
hidden
=
true
)
private
String
uId
;
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
)
@NotNull
(
message
=
"页码不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
)
@NotNull
(
message
=
"每页显示数不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/fdd/SealManageController.java
浏览文件 @
3dbcae24
...
...
@@ -8,17 +8,13 @@ package com.mmc.iuav.user.controller.fdd;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.controller.BaseController
;
import
com.mmc.iuav.user.model.fdd.dto.SealInfoDTO
;
import
com.mmc.iuav.user.model.fdd.vo.SealInfoVO
;
import
com.mmc.iuav.user.model.fdd.vo.SealVO
;
import
com.mmc.iuav.user.service.fdd.SealManageService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
io.swagger.annotations.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -27,7 +23,7 @@ import javax.servlet.http.HttpServletRequest;
* @date 2022/8/3 10:22
* 概要:
*/
@Api
(
tags
=
{
"
无人机城--印章管理模块-接口"
})
@Api
(
tags
=
{
"
印章管理模块-接口"
})
@RequestMapping
(
"/seal/"
)
@RestController
public
class
SealManageController
extends
BaseController
{
...
...
@@ -42,42 +38,48 @@ public class SealManageController extends BaseController {
return
sealManageService
.
uploadSeal
(
sealVO
,
this
.
getUserLoginInfoFromRedis
(
request
));
}
// @ApiOperation(value = "当前用户印章列表")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = SealInfoDTO.class)})
// @PostMapping("/getSealInfoList")
// public ResultBody getSealInfoList(HttpServletRequest request, @RequestBody SealInfoVO param) {
// return ResultBody.success(uavAppSealManageService.getSealInfoList(this.getCurrentAccount(request).getId(), param));
// }
//
// @ApiOperation(value = "删除印章")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// @GetMapping("/removeSeal")
// public ResultBody removeSeal(@ApiParam(value = "印章编号") @RequestParam(value = "signatureId") String signatureId,
// HttpServletRequest request,
// @ApiParam(value = "小程序用户unionId") @RequestParam(value = "unionId", required = false) String unionId
// ) {
// return uavAppSealManageService.removeSeal(signatureId, unionId, this.getCurrentAccount(request).getId());
// }
//
// @ApiOperation(value = "设置默认签章")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// @GetMapping("/defaultSeal")
// public ResultBody defaultSeal(@ApiParam(value = "印章编号") @RequestParam(value = "signatureId") String signatureId, HttpServletRequest request,
// @ApiParam(value = "小程序用户unionId") @RequestParam(value = "unionId", required = false) String unionId) {
// return uavAppSealManageService.defaultSeal(signatureId, this.getCurrentAccount(request).getId(), unionId);
// }
//
// @ApiOperation(value = "替换印章图片")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// @PostMapping("/replaceSealImg")
// public ResultBody replaceSealImg(@RequestBody UavSealInfoVO param, HttpServletRequest request) throws Exception {
// return uavAppSealManageService.replaceSealImg(param, this.getCurrentAccount(request).getId());
// }
//
// @ApiOperation(value = "查看印章信息")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// @GetMapping("/getSealInfo")
// public ResultBody getSealInfo(@ApiParam(value = "印章编号") @RequestParam(value = "signatureId") String signatureId, HttpServletRequest request) {
// return uavAppSealManageService.getSealInfo(signatureId, this.getCurrentAccount(request).getId());
// }
@ApiOperation
(
value
=
"当前用户印章列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
SealInfoDTO
.
class
)})
@PostMapping
(
"/getSealInfoList"
)
public
ResultBody
getSealInfoList
(
HttpServletRequest
request
,
@RequestBody
SealInfoVO
param
)
{
return
ResultBody
.
success
(
sealManageService
.
getSealInfoList
(
param
,
this
.
getUserLoginInfoFromRedis
(
request
)));
}
@ApiOperation
(
value
=
"删除印章"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"/removeSeal"
)
public
ResultBody
removeSeal
(
@ApiParam
(
value
=
"印章编号"
)
@RequestParam
(
value
=
"signatureId"
)
String
signatureId
,
@ApiParam
(
value
=
"端口 0小程序 1后台"
)
Integer
port
,
HttpServletRequest
request
)
{
return
sealManageService
.
removeSeal
(
signatureId
,
port
,
this
.
getUserLoginInfoFromRedis
(
request
));
}
@ApiOperation
(
value
=
"设置默认签章"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"/defaultSeal"
)
public
ResultBody
defaultSeal
(
@ApiParam
(
value
=
"印章编号"
)
@RequestParam
(
value
=
"signatureId"
)
String
signatureId
,
@ApiParam
(
value
=
"端口 0小程序 1后台"
)
Integer
port
,
HttpServletRequest
request
)
{
return
sealManageService
.
defaultSeal
(
signatureId
,
port
,
this
.
getUserLoginInfoFromRedis
(
request
));
}
@ApiOperation
(
value
=
"查看印章信息"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"/getSealInfo"
)
public
ResultBody
getSealInfo
(
@ApiParam
(
value
=
"印章编号"
)
@RequestParam
(
value
=
"signatureId"
)
String
signatureId
,
@ApiParam
(
value
=
"端口 0小程序 1后台"
)
Integer
port
,
HttpServletRequest
request
)
{
return
sealManageService
.
getSealInfo
(
signatureId
,
port
,
this
.
getUserLoginInfoFromRedis
(
request
));
}
@ApiOperation
(
value
=
"编辑印章名称"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/editSealName"
)
public
ResultBody
editSealName
(
@ApiParam
(
value
=
"印章编号"
)
@RequestParam
(
value
=
"signatureId"
)
String
signatureId
,
@ApiParam
(
value
=
"端口 0小程序 1后台"
)
Integer
port
,
@ApiParam
(
value
=
"要修改的印章名称"
)
String
sealName
,
HttpServletRequest
request
)
{
return
sealManageService
.
editSealName
(
signatureId
,
port
,
this
.
getUserLoginInfoFromRedis
(
request
),
sealName
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/fdd/SealManageDao.java
浏览文件 @
3dbcae24
package
com
.
mmc
.
iuav
.
user
.
dao
.
fdd
;
import
com.mmc.iuav.user.entity.fdd.SealInfoDO
;
import
com.mmc.iuav.user.model.fdd.vo.SealInfoVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* @Author LW
* @date 2023/9/8 14:36
...
...
@@ -11,4 +14,19 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public
interface
SealManageDao
{
void
insertSealInfo
(
SealInfoDO
sealInfoDO
);
int
countSealInfo
(
SealInfoVO
param
);
List
<
SealInfoDO
>
getSealInfoList
(
SealInfoVO
param
);
void
deletedSealInfo
(
String
signatureId
);
List
<
SealInfoDO
>
getSealInfoListByUnionId
(
String
unionId
);
void
updateSealStatusById
(
List
<
Integer
>
sealIds
);
void
updateSealStatusBySignatureId
(
String
signatureId
);
void
updateSealName
(
String
unionId
,
String
signatureId
,
String
sealName
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/fdd/SealInfoDO.java
浏览文件 @
3dbcae24
package
com
.
mmc
.
iuav
.
user
.
entity
.
fdd
;
import
com.mmc.iuav.user.model.fdd.dto.SealInfoDTO
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
...
...
@@ -9,6 +14,9 @@ import java.util.Date;
* @author makejava
* @since 2023-09-08 14:30:13
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
SealInfoDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
88451609760389058L
;
...
...
@@ -38,70 +46,9 @@ public class SealInfoDO implements Serializable {
private
Date
updateTime
;
public
Integer
getId
()
{
return
id
;
public
SealInfoDTO
buildSealInfoDTO
()
{
return
SealInfoDTO
.
builder
().
id
(
this
.
id
).
sealStatus
(
this
.
sealStatus
).
sealName
(
this
.
sealName
)
.
signatureId
(
this
.
signatureId
).
createTime
(
this
.
createTime
).
sealUrl
(
this
.
sealUrl
).
build
()
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getSealName
()
{
return
sealName
;
}
public
void
setSealName
(
String
sealName
)
{
this
.
sealName
=
sealName
;
}
public
String
getSignatureId
()
{
return
signatureId
;
}
public
void
setSignatureId
(
String
signatureId
)
{
this
.
signatureId
=
signatureId
;
}
public
String
getUnionId
()
{
return
unionId
;
}
public
void
setUnionId
(
String
unionId
)
{
this
.
unionId
=
unionId
;
}
public
Integer
getSealStatus
()
{
return
sealStatus
;
}
public
void
setSealStatus
(
Integer
sealStatus
)
{
this
.
sealStatus
=
sealStatus
;
}
public
String
getSealUrl
()
{
return
sealUrl
;
}
public
void
setSealUrl
(
String
sealUrl
)
{
this
.
sealUrl
=
sealUrl
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/fdd/SealManageService.java
浏览文件 @
3dbcae24
package
com
.
mmc
.
iuav
.
user
.
service
.
fdd
;
import
com.mmc.iuav.page.PageResult
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
import
com.mmc.iuav.user.model.fdd.vo.SealInfoVO
;
import
com.mmc.iuav.user.model.fdd.vo.SealVO
;
/**
...
...
@@ -12,43 +14,13 @@ import com.mmc.iuav.user.model.fdd.vo.SealVO;
public
interface
SealManageService
{
ResultBody
uploadSeal
(
SealVO
sealVO
,
LoginSuccessDTO
loginSuccessDTO
);
// /**
// * 获取当前用户印章列表
// * @param id
// * @param param
// * @return
// */
// PageResult getSealInfoList(Integer id, SealInfoVO param);
//
// /**
// * 删除印章信息
// * @param signatureId
// * @param id
// * @return
// */
// ResultBody removeSeal(String signatureId, String unionId,Integer id);
//
// /***
// *设置默认章
// * @param signatureId
// * @param id
// * @return
// */
// ResultBody defaultSeal(String signatureId, Integer id,String unionId);
//
// /**
// * 替换印章信息
// * @param param
// * @param id
// * @return
// */
// ResultBody replaceSealImg(UavSealInfoVO param, Integer id) throws Exception;
//
// /**
// * 获取印章详情
// * @param signatureId
// * @param id
// * @return
// */
// ResultBody getSealInfo(String signatureId, Integer id);
PageResult
getSealInfoList
(
SealInfoVO
param
,
LoginSuccessDTO
loginSuccessDTO
);
ResultBody
removeSeal
(
String
signatureId
,
Integer
port
,
LoginSuccessDTO
loginSuccessDTO
);
ResultBody
defaultSeal
(
String
signatureId
,
Integer
port
,
LoginSuccessDTO
loginSuccessDTO
);
ResultBody
getSealInfo
(
String
signatureId
,
Integer
port
,
LoginSuccessDTO
loginSuccessDTO
);
ResultBody
editSealName
(
String
signatureId
,
Integer
port
,
LoginSuccessDTO
loginSuccessDTO
,
String
sealName
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/fdd/UserFddAuthService.java
浏览文件 @
3dbcae24
...
...
@@ -29,5 +29,6 @@ public interface UserFddAuthService {
ResultBody
getFileByUuid
(
String
uuid
,
String
docType
);
// List<UserFddDTO> feignGetAppUserFddInfo(List<String> unionId);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/fdd/impl/SealManageServiceImpl.java
浏览文件 @
3dbcae24
package
com
.
mmc
.
iuav
.
user
.
service
.
fdd
.
impl
;
import
com.alibaba.fastjson2.JSONArray
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.fadada.sdk.base.client.FddBaseClient
;
import
com.fadada.sdk.base.model.req.AddSignatureParams
;
import
com.fadada.sdk.extra.client.FddExtraClient
;
import
com.fadada.sdk.extra.model.req.DefaultSignatureParams
;
import
com.fadada.sdk.extra.model.req.QuerySignatureParams
;
import
com.fadada.sdk.extra.model.req.RemoveSignatureParams
;
import
com.mmc.iuav.page.PageResult
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.response.ResultEnum
;
import
com.mmc.iuav.user.constant.fdd.FddConnectConstant
;
...
...
@@ -14,12 +20,19 @@ import com.mmc.iuav.user.entity.UserAccountDO;
import
com.mmc.iuav.user.entity.fdd.SealInfoDO
;
import
com.mmc.iuav.user.entity.fdd.UserFddDO
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
import
com.mmc.iuav.user.model.fdd.dto.SealInfoDTO
;
import
com.mmc.iuav.user.model.fdd.seal.SealDetail
;
import
com.mmc.iuav.user.model.fdd.vo.SealInfoVO
;
import
com.mmc.iuav.user.model.fdd.vo.SealVO
;
import
com.mmc.iuav.user.service.fdd.SealManageService
;
import
com.mmc.iuav.user.service.fdd.UserFddAuthService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @Author LW
...
...
@@ -81,4 +94,127 @@ public class SealManageServiceImpl implements SealManageService {
return
ResultBody
.
success
();
}
}
@Override
public
PageResult
getSealInfoList
(
SealInfoVO
param
,
LoginSuccessDTO
loginSuccessDTO
)
{
if
(
param
.
getPort
().
equals
(
0
))
{
UserAccountDO
userInfo
=
userServiceDao
.
getUserAccountById
(
loginSuccessDTO
.
getUserAccountId
());
param
.
setUId
(
userFddAuthService
.
replaceUnableString
(
userInfo
.
getUnionId
()));
}
else
{
param
.
setUId
(
loginSuccessDTO
.
getUserAccountId
().
toString
());
}
int
count
=
sealManageDao
.
countSealInfo
(
param
);
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
);
}
Integer
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
// 获取印章列表信息
List
<
SealInfoDO
>
sealInfoList
=
sealManageDao
.
getSealInfoList
(
param
);
List
<
SealInfoDTO
>
list
=
sealInfoList
.
stream
().
map
(
SealInfoDO:
:
buildSealInfoDTO
).
collect
(
Collectors
.
toList
());
return
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
list
);
}
@Override
public
ResultBody
removeSeal
(
String
signatureId
,
Integer
port
,
LoginSuccessDTO
loginSuccessDTO
)
{
ResultBody
resultBody
=
checkAuthStatus
(
port
,
loginSuccessDTO
);
UserFddDO
userFddInfo
=
(
UserFddDO
)
resultBody
.
getResult
();
// 调用法大大删除印章接口
FddExtraClient
client
=
new
FddExtraClient
(
FddConnectConstant
.
APP_ID
,
FddConnectConstant
.
APP_KEY
,
FddConnectConstant
.
VERSION
,
FddConnectConstant
.
HOST
);
RemoveSignatureParams
params
=
new
RemoveSignatureParams
();
params
.
setCustomerId
(
userFddInfo
.
getCustomerId
());
params
.
setSignatureId
(
signatureId
);
String
result
=
client
.
invokeRemoveSignature
(
params
);
if
(!
JSONObject
.
parseObject
(
result
).
getString
(
FddConstant
.
CODE
).
equals
(
FddConstant
.
SUCCESS
))
{
return
ResultBody
.
error
(
JSONObject
.
parseObject
(
result
).
getString
(
FddConstant
.
MSG
));
}
sealManageDao
.
deletedSealInfo
(
signatureId
);
return
ResultBody
.
success
();
}
@Transactional
public
ResultBody
checkAuthStatus
(
Integer
port
,
LoginSuccessDTO
loginSuccessDTO
)
{
String
uid
;
if
(
port
.
equals
(
0
))
{
UserAccountDO
userInfo
=
userServiceDao
.
getUserAccountById
(
loginSuccessDTO
.
getUserAccountId
());
uid
=
userFddAuthService
.
replaceUnableString
(
userInfo
.
getUnionId
());
}
else
{
uid
=
loginSuccessDTO
.
getUserAccountId
().
toString
();
}
// 获取用户法大大的(实名/企业)认证信息
UserFddDO
userFddInfo
=
userFddAuthDao
.
getAppUserFddInfo
(
uid
);
if
(
userFddInfo
==
null
)
{
return
ResultBody
.
error
(
ResultEnum
.
BUSINESS_LICENSE_CHECK_ERROR
);
}
else
if
(!
userFddInfo
.
getPersonVerifyStatus
().
equals
(
2
)
||
!
userFddInfo
.
getEntVerifyStatus
().
equals
(
4
))
{
return
ResultBody
.
error
(
ResultEnum
.
BUSINESS_LICENSE_CHECK_NOT_PASS
);
}
return
ResultBody
.
success
(
userFddInfo
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultBody
defaultSeal
(
String
signatureId
,
Integer
port
,
LoginSuccessDTO
loginSuccessDTO
)
{
ResultBody
resultBody
=
checkAuthStatus
(
port
,
loginSuccessDTO
);
UserFddDO
userFddInfo
=
(
UserFddDO
)
resultBody
.
getResult
();
FddExtraClient
client
=
new
FddExtraClient
(
FddConnectConstant
.
APP_ID
,
FddConnectConstant
.
APP_KEY
,
FddConnectConstant
.
VERSION
,
FddConnectConstant
.
HOST
);
DefaultSignatureParams
params
=
new
DefaultSignatureParams
();
params
.
setCustomerId
(
userFddInfo
.
getCustomerId
());
params
.
setSignatureId
(
signatureId
);
String
result
=
client
.
invokeDefaultSignature
(
params
);
// 获取印章列表
List
<
SealInfoDO
>
sealInfoList
=
sealManageDao
.
getSealInfoListByUnionId
(
userFddInfo
.
getUnionId
());
// 判断是否有状态是默认的章(默认:0 非默认:1)
List
<
Integer
>
sealIds
=
sealInfoList
.
stream
()
.
filter
(
d
->
d
.
getSealStatus
()
==
1
)
.
map
(
SealInfoDO:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
sealIds
.
size
()
>
0
)
{
sealManageDao
.
updateSealStatusById
(
sealIds
);
}
sealManageDao
.
updateSealStatusBySignatureId
(
signatureId
);
if
(!
JSONObject
.
parseObject
(
result
).
getString
(
FddConstant
.
CODE
).
equals
(
FddConstant
.
SUCCESS
))
{
// 如果失败,手动回滚修改的数据
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
ResultBody
.
error
(
JSONObject
.
parseObject
(
result
).
getString
(
FddConstant
.
MSG
));
}
return
ResultBody
.
success
();
}
@Override
public
ResultBody
getSealInfo
(
String
signatureId
,
Integer
port
,
LoginSuccessDTO
loginSuccessDTO
)
{
ResultBody
resultBody
=
checkAuthStatus
(
port
,
loginSuccessDTO
);
UserFddDO
userFddInfo
=
(
UserFddDO
)
resultBody
.
getResult
();
FddExtraClient
client
=
new
FddExtraClient
(
FddConnectConstant
.
APP_ID
,
FddConnectConstant
.
APP_KEY
,
FddConnectConstant
.
VERSION
,
FddConnectConstant
.
HOST
);
QuerySignatureParams
params
=
new
QuerySignatureParams
();
params
.
setCustomerId
(
userFddInfo
.
getCustomerId
());
params
.
setSignatureId
(
signatureId
);
String
result
=
client
.
invokeQuerySignature
(
params
);
if
(!
JSONObject
.
parseObject
(
result
).
getString
(
FddConstant
.
CODE
).
equals
(
FddConstant
.
SUCCESS
))
{
return
ResultBody
.
error
(
JSONObject
.
parseObject
(
result
).
getString
(
FddConstant
.
MSG
));
}
String
dataStr
=
JSONObject
.
parseObject
(
result
).
getString
(
FddConstant
.
DATA
);
return
ResultBody
.
success
(
this
.
buildSealDetail
(
dataStr
));
}
/**
* 构建印章信息对象
*/
public
SealDetail
buildSealDetail
(
String
result
)
{
JSONObject
jsonObject
=
JSONArray
.
parseArray
(
result
).
getJSONObject
(
0
);
SealDetail
sealDetail
=
new
SealDetail
();
sealDetail
.
setSignatureImg
(
jsonObject
.
getString
(
"signature_img_base64"
));
sealDetail
.
setSignatureId
(
jsonObject
.
getString
(
"signature_id"
));
sealDetail
.
setSignatureScope
(
jsonObject
.
getInteger
(
"signature_scope"
));
sealDetail
.
setSignatureType
(
jsonObject
.
getString
(
"signature_type"
));
sealDetail
.
setSignatureSource
(
jsonObject
.
getString
(
"signature_source"
));
return
sealDetail
;
}
@Override
public
ResultBody
editSealName
(
String
signatureId
,
Integer
port
,
LoginSuccessDTO
loginSuccessDTO
,
String
sealName
)
{
ResultBody
resultBody
=
checkAuthStatus
(
port
,
loginSuccessDTO
);
UserFddDO
userFddInfo
=
(
UserFddDO
)
resultBody
.
getResult
();
sealManageDao
.
updateSealName
(
userFddInfo
.
getUnionId
(),
signatureId
,
sealName
);
return
ResultBody
.
success
();
}
}
csm-service/cms-service-user/src/main/resources/mapper/fdd/SealManageDao.xml
浏览文件 @
3dbcae24
...
...
@@ -7,4 +7,73 @@
insert into seal_info (seal_name, signature_id, seal_url, union_id, seal_status)
values (#{sealName}, #{signatureId}, #{sealUrl}, #{unionId}, #{sealStatus})
</insert>
<update
id=
"updateSealStatusById"
>
update seal_info set seal_status = 0
where id in
<foreach
collection=
"list"
separator=
","
index=
"index"
item=
"item"
open=
"("
close=
")"
>
#{item}
</foreach>
</update>
<update
id=
"updateSealStatusBySignatureId"
>
update seal_info
set seal_status = 1
where signature_id = #{signatureId}
</update>
<update
id=
"updateSealName"
>
update seal_info
set seal_name = #{sealName}
where signature_id = #{signatureId}
and union_id = #{unionId}
</update>
<delete
id=
"deletedSealInfo"
>
delete
from seal_info
where signature_id = #{signatureId}
</delete>
<select
id=
"countSealInfo"
resultType=
"java.lang.Integer"
>
SELECT
count(*)
FROM seal_info
<where>
union_id = #{uId}
<if
test=
"startTime != null and startTime != '' "
>
and create_time
>
= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
</if>
<if
test=
"endTime != null and endTime != '' "
>
and create_time
<
= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
</where>
</select>
<select
id=
"getSealInfoList"
resultType=
"com.mmc.iuav.user.entity.fdd.SealInfoDO"
>
SELECT id,
seal_name,
signature_id,
union_id,
seal_status,
seal_url,
create_time
FROM seal_info
<where>
union_id = #{uId}
<if
test=
"startTime != null and startTime != '' "
>
and create_time
>
= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
</if>
<if
test=
"endTime != null and endTime != '' "
>
and create_time
<
= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
</where>
ORDER BY seal_status desc ,create_time desc
limit #{pageNo}, #{pageSize}
</select>
<select
id=
"getSealInfoListByUnionId"
resultType=
"com.mmc.iuav.user.entity.fdd.SealInfoDO"
>
SELECT id,
seal_name,
signature_id,
union_id,
seal_status,
seal_url,
create_time
FROM seal_info
where union_id = #{uId}
</select>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论