Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
cms
Commits
31caad54
提交
31caad54
authored
10月 12, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
PilotCertificationServiceImpl(add)
上级
8cd99216
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
101 行增加
和
4 行删除
+101
-4
PilotCertificationDTO.java
...iuav/user/model/dto/dronepilot/PilotCertificationDTO.java
+2
-0
PilotCertificationQO.java
...c/iuav/user/model/qo/dronepilot/PilotCertificationQO.java
+3
-0
PilotCertificationController.java
...r/controller/dronepilot/PilotCertificationController.java
+5
-0
ForumAttentionDO.java
...com/mmc/iuav/user/entity/dronepilot/ForumAttentionDO.java
+37
-0
PilotCertificationServiceImpl.java
...ervice/dronepilot/impl/PilotCertificationServiceImpl.java
+46
-0
application-dev.yml
...e/cms-service-user/src/main/resources/application-dev.yml
+3
-2
application-local.yml
...cms-service-user/src/main/resources/application-local.yml
+2
-0
application-prod.yml
.../cms-service-user/src/main/resources/application-prod.yml
+3
-2
没有找到文件。
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/dto/dronepilot/PilotCertificationDTO.java
浏览文件 @
31caad54
...
@@ -104,4 +104,6 @@ public class PilotCertificationDTO {
...
@@ -104,4 +104,6 @@ public class PilotCertificationDTO {
private
String
reason
;
private
String
reason
;
@ApiModelProperty
(
value
=
"飞手头像"
,
example
=
"http://"
)
@ApiModelProperty
(
value
=
"飞手头像"
,
example
=
"http://"
)
private
String
userImg
;
private
String
userImg
;
@ApiModelProperty
(
value
=
"关注状态"
)
private
Boolean
status
;
}
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/qo/dronepilot/PilotCertificationQO.java
浏览文件 @
31caad54
...
@@ -58,5 +58,8 @@ public class PilotCertificationQO implements Serializable {
...
@@ -58,5 +58,8 @@ public class PilotCertificationQO implements Serializable {
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
@ApiModelProperty
(
value
=
""
,
hidden
=
true
)
private
Integer
tokenUserId
;
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/dronepilot/PilotCertificationController.java
浏览文件 @
31caad54
...
@@ -61,6 +61,11 @@ public class PilotCertificationController extends BaseController {
...
@@ -61,6 +61,11 @@ public class PilotCertificationController extends BaseController {
@PostMapping
(
"/appListPilot"
)
@PostMapping
(
"/appListPilot"
)
public
ResultBody
<
PilotCertificationDTO
>
pilotList
(
HttpServletRequest
request
,
public
ResultBody
<
PilotCertificationDTO
>
pilotList
(
HttpServletRequest
request
,
@Validated
(
value
=
{
Page
.
class
})
@ApiParam
(
value
=
"飞手查询"
,
required
=
true
)
@RequestBody
PilotCertificationQO
param
)
{
@Validated
(
value
=
{
Page
.
class
})
@ApiParam
(
value
=
"飞手查询"
,
required
=
true
)
@RequestBody
PilotCertificationQO
param
)
{
String
token
=
request
.
getHeader
(
"token"
);
if
(
token
!=
null
){
Integer
userAccountId
=
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
();
param
.
setTokenUserId
(
userAccountId
);
}
return
ResultBody
.
success
(
certificationService
.
pilotList
(
param
));
return
ResultBody
.
success
(
certificationService
.
pilotList
(
param
));
}
}
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/dronepilot/ForumAttentionDO.java
0 → 100644
浏览文件 @
31caad54
package
com
.
mmc
.
iuav
.
user
.
entity
.
dronepilot
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @Author small
* @Date 2023/10/12 10:23
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
ForumAttentionDO
{
private
Integer
id
;
@ApiModelProperty
(
value
=
"被关注的用户"
)
private
Integer
userAccountId
;
@ApiModelProperty
(
value
=
"关注用户"
)
private
Integer
attentionUserAccountId
;
@ApiModelProperty
(
value
=
"关注状态"
)
private
Boolean
status
;
@ApiModelProperty
(
value
=
"是否相互关注"
)
private
Boolean
mutualAttention
;
private
String
createTime
;
private
String
updateTime
;
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/dronepilot/impl/PilotCertificationServiceImpl.java
浏览文件 @
31caad54
package
com
.
mmc
.
iuav
.
user
.
service
.
dronepilot
.
impl
;
package
com
.
mmc
.
iuav
.
user
.
service
.
dronepilot
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.mmc.iuav.http.HttpsRequestUtil
;
import
com.mmc.iuav.http.HttpsRequestUtil
;
import
com.mmc.iuav.page.PageResult
;
import
com.mmc.iuav.page.PageResult
;
...
@@ -28,8 +29,11 @@ import com.mmc.iuav.user.model.vo.dronepilot.PilotCertificationVO;
...
@@ -28,8 +29,11 @@ import com.mmc.iuav.user.model.vo.dronepilot.PilotCertificationVO;
import
com.mmc.iuav.user.model.vo.userpoints.UserPointsVO
;
import
com.mmc.iuav.user.model.vo.userpoints.UserPointsVO
;
import
com.mmc.iuav.user.service.dronepilot.PilotCertificationService
;
import
com.mmc.iuav.user.service.dronepilot.PilotCertificationService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.http.*
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
...
@@ -60,6 +64,13 @@ public class PilotCertificationServiceImpl implements PilotCertificationService
...
@@ -60,6 +64,13 @@ public class PilotCertificationServiceImpl implements PilotCertificationService
@Autowired
@Autowired
private
UserPointsDetailsDao
userPointsDetailsDao
;
private
UserPointsDetailsDao
userPointsDetailsDao
;
@Autowired
private
RestTemplate
restTemplate
;
@Value
(
"${iuav.ims.uri}"
)
private
String
imsApp
;
@Override
@Override
public
ResultBody
insertPilot
(
PilotCertificationVO
certificationVO
,
LoginSuccessDTO
userLoginInfoFromRedis
)
{
public
ResultBody
insertPilot
(
PilotCertificationVO
certificationVO
,
LoginSuccessDTO
userLoginInfoFromRedis
)
{
...
@@ -135,11 +146,46 @@ public class PilotCertificationServiceImpl implements PilotCertificationService
...
@@ -135,11 +146,46 @@ public class PilotCertificationServiceImpl implements PilotCertificationService
List
<
PilotCertificationDTO
>
collect
=
pilotList
.
stream
().
map
(
PilotCertificationDO:
:
buildPilotCertificationDTO
).
collect
(
Collectors
.
toList
());
List
<
PilotCertificationDTO
>
collect
=
pilotList
.
stream
().
map
(
PilotCertificationDO:
:
buildPilotCertificationDTO
).
collect
(
Collectors
.
toList
());
collect
=
collect
.
stream
().
skip
((
pageNo
-
1
)
*
param
.
getPageSize
()).
limit
(
param
.
getPageSize
()).
collect
=
collect
.
stream
().
skip
((
pageNo
-
1
)
*
param
.
getPageSize
()).
limit
(
param
.
getPageSize
()).
collect
(
Collectors
.
toList
());
collect
(
Collectors
.
toList
());
Integer
tokenUserId
=
param
.
getTokenUserId
();
if
(
tokenUserId
!=
null
){
List
<
ForumAttentionDO
>
info
=
info
(
param
.
getTokenUserId
());
for
(
ForumAttentionDO
forumAttentionDO
:
info
)
{
for
(
PilotCertificationDTO
pilotCertificationDTO
:
collect
)
{
if
(
forumAttentionDO
.
getMutualAttention
().
equals
(
true
)){
if
(
pilotCertificationDTO
.
getUserAccountId
().
equals
(
forumAttentionDO
.
getUserAccountId
())||
pilotCertificationDTO
.
getUserAccountId
().
equals
(
forumAttentionDO
.
getAttentionUserAccountId
())){
pilotCertificationDTO
.
setStatus
(
true
);
}
}
if
(
forumAttentionDO
.
getMutualAttention
().
equals
(
false
)){
if
(
pilotCertificationDTO
.
getUserAccountId
().
equals
(
forumAttentionDO
.
getUserAccountId
())){
pilotCertificationDTO
.
setStatus
(
true
);
}
}
}
}
}
PageResult
pageResult
=
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
pilotList
.
size
(),
collect
);
PageResult
pageResult
=
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
pilotList
.
size
(),
collect
);
return
pageResult
;
return
pageResult
;
}
}
public
List
<
ForumAttentionDO
>
info
(
Integer
userAccountId
)
{
String
token
=
null
;
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
add
(
"token"
,
token
);
HttpEntity
<
String
>
entity
=
new
HttpEntity
<>(
userAccountId
.
toString
(),
headers
);
ResponseEntity
<
String
>
exchange
=
restTemplate
.
exchange
(
imsApp
+
"/release/dynamic/getPilot?userAccountId="
+
userAccountId
,
HttpMethod
.
GET
,
entity
,
String
.
class
);
Object
body
=
exchange
.
getBody
();
JSONObject
jsonObject1
=
JSONObject
.
parseObject
(
body
.
toString
());
List
<
Map
>
mapList
=
(
List
<
Map
>)
jsonObject1
.
get
(
"result"
);
List
<
ForumAttentionDO
>
forumAttentionDOS
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
mapList
),
ForumAttentionDO
.
class
);
return
forumAttentionDOS
;
}
@Override
@Override
public
PilotCertificationDTO
detailPilot
(
Integer
id
)
{
public
PilotCertificationDTO
detailPilot
(
Integer
id
)
{
PilotCertificationDO
certificationDO
=
certificationDao
.
detailPilot
(
id
);
PilotCertificationDO
certificationDO
=
certificationDao
.
detailPilot
(
id
);
...
...
csm-service/cms-service-user/src/main/resources/application-dev.yml
浏览文件 @
31caad54
...
@@ -97,5 +97,7 @@ iuav:
...
@@ -97,5 +97,7 @@ iuav:
uri
:
http://payment-svc:8088
uri
:
http://payment-svc:8088
pms
:
pms
:
uri
:
http://pms-svc:8099
uri
:
http://pms-svc:8099
ims
:
uri
:
http://ims-svc:10001
scheduling
:
scheduling
:
enabled
:
true
enabled
:
true
\ No newline at end of file
csm-service/cms-service-user/src/main/resources/application-local.yml
浏览文件 @
31caad54
...
@@ -61,3 +61,5 @@ iuav:
...
@@ -61,3 +61,5 @@ iuav:
uri
:
http://127.0.0.1:8088
uri
:
http://127.0.0.1:8088
pms
:
pms
:
uri
:
http://127.0.0.1:8099
uri
:
http://127.0.0.1:8099
ims
:
uri
:
http://localhost:10001
csm-service/cms-service-user/src/main/resources/application-prod.yml
浏览文件 @
31caad54
...
@@ -89,5 +89,7 @@ iuav:
...
@@ -89,5 +89,7 @@ iuav:
uri
:
http://payment-svc:8088
uri
:
http://payment-svc:8088
pms
:
pms
:
uri
:
http://pms-svc:8099
uri
:
http://pms-svc:8099
ims
:
uri
:
http://ims-svc:10001
scheduling
:
scheduling
:
enabled
:
true
enabled
:
true
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论