Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
cms-ci-test
Commits
ba67911a
提交
ba67911a
authored
7月 18, 2023
作者:
zhenjie
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop'
上级
4ac621a7
095f7655
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
573 行增加
和
85 行删除
+573
-85
WebsiteRangeDTO.java
...ain/java/com/mmc/iuav/user/model/dto/WebsiteRangeDTO.java
+2
-0
UserRcdQO.java
...l/src/main/java/com/mmc/iuav/user/model/qo/UserRcdQO.java
+39
-0
ApplyTagEditVO.java
.../main/java/com/mmc/iuav/user/model/vo/ApplyTagEditVO.java
+2
-0
TopInviteVO.java
...src/main/java/com/mmc/iuav/user/model/vo/TopInviteVO.java
+27
-0
UserAccountVO.java
...c/main/java/com/mmc/iuav/user/model/vo/UserAccountVO.java
+4
-4
UserRcdVO.java
...l/src/main/java/com/mmc/iuav/user/model/vo/UserRcdVO.java
+33
-0
ResultEnum.java
...-util/src/main/java/com/mmc/iuav/response/ResultEnum.java
+1
-0
TokenCheckHandleInterceptor.java
...a/com/mmc/iuav/user/auth/TokenCheckHandleInterceptor.java
+5
-6
CooperationController.java
...a/com/mmc/iuav/user/controller/CooperationController.java
+7
-6
UserAccountController.java
...a/com/mmc/iuav/user/controller/UserAccountController.java
+26
-3
CooperationDao.java
...r/src/main/java/com/mmc/iuav/user/dao/CooperationDao.java
+4
-0
UserServiceDao.java
...r/src/main/java/com/mmc/iuav/user/dao/UserServiceDao.java
+39
-0
UserAccountDO.java
...src/main/java/com/mmc/iuav/user/entity/UserAccountDO.java
+30
-8
UserRcdDO.java
...ser/src/main/java/com/mmc/iuav/user/entity/UserRcdDO.java
+20
-0
WebsiteInfoDO.java
...src/main/java/com/mmc/iuav/user/entity/WebsiteInfoDO.java
+5
-0
GlobalExceptionHandler.java
.../java/com/mmc/iuav/user/error/GlobalExceptionHandler.java
+93
-0
UserAccountService.java
...in/java/com/mmc/iuav/user/service/UserAccountService.java
+25
-1
AuthServiceImpl.java
.../java/com/mmc/iuav/user/service/impl/AuthServiceImpl.java
+2
-7
CooperationServiceImpl.java
...om/mmc/iuav/user/service/impl/CooperationServiceImpl.java
+10
-2
UserAccountServiceImpl.java
...om/mmc/iuav/user/service/impl/UserAccountServiceImpl.java
+71
-17
CooperationDao.xml
...service-user/src/main/resources/mapper/CooperationDao.xml
+45
-7
UserServiceDao.xml
...service-user/src/main/resources/mapper/UserServiceDao.xml
+73
-15
not-check.yml
...service/cms-service-user/src/main/resources/not-check.yml
+1
-0
deployment.yaml
kustomization/base/deployment.yaml
+8
-8
kustomization.yaml
kustomization/overlays/dev/kustomization.yaml
+1
-1
没有找到文件。
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/dto/WebsiteRangeDTO.java
浏览文件 @
ba67911a
...
...
@@ -22,4 +22,6 @@ public class WebsiteRangeDTO implements Serializable {
private
Double
lon
;
private
Double
lat
;
private
Double
distance
;
private
String
content
;
private
Integer
score
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/qo/UserRcdQO.java
0 → 100644
浏览文件 @
ba67911a
package
com
.
mmc
.
iuav
.
user
.
model
.
qo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.domain.Page
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* @author: zj
* @Date: 2023/7/15 11:03
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
UserRcdQO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1561616165L
;
@ApiModelProperty
(
value
=
"用户id不能为空"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"用户id不能为空"
,
groups
=
Page
.
class
)
private
Integer
userAccountId
;
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"页码不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
,
example
=
"10"
)
@NotNull
(
message
=
"每页显示数不能为空"
,
groups
=
Page
.
class
)
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/ApplyTagEditVO.java
浏览文件 @
ba67911a
...
...
@@ -20,6 +20,8 @@ import java.io.Serializable;
public
class
ApplyTagEditVO
implements
Serializable
{
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"网点id"
)
private
Integer
websiteId
;
@ApiModelProperty
(
value
=
"标签id"
)
private
Integer
cooperationTagId
;
@ApiModelProperty
(
value
=
"网点名称"
)
...
...
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/TopInviteVO.java
0 → 100644
浏览文件 @
ba67911a
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
/**
* @author: zj
* @Date: 2023/7/17 10:00
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
TopInviteVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
9208361817264837853L
;
private
Integer
id
;
private
String
uid
;
private
String
phoneNum
;
private
String
userName
;
private
String
nickName
;
private
String
userImg
;
private
Integer
inviteCount
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/UserAccountVO.java
浏览文件 @
ba67911a
...
...
@@ -55,14 +55,14 @@ public class UserAccountVO implements Serializable {
private
Date
createTime
;
@ApiModelProperty
(
value
=
"企业认证状态, 0未通过,1通过"
)
private
Integer
companyAuthStatus
;
@ApiModelProperty
(
value
=
"合作标签id"
)
private
Integer
cooperationTagId
;
@ApiModelProperty
(
value
=
"企业名称"
)
private
String
companyName
;
@ApiModelProperty
(
value
=
"合作标签名称"
)
private
String
tagName
;
@ApiModelProperty
(
value
=
"是否删除"
)
private
Integer
deleted
;
@ApiModelProperty
(
value
=
"推荐伙伴个数"
)
private
Integer
inviteCount
;
@ApiModelProperty
(
value
=
"用户合作标签"
)
private
List
<
CooperationTagVO
>
cooperationTagVOS
;
@ApiModelProperty
(
value
=
"上级推荐人"
)
private
UserRcdVO
userRcdVO
;
}
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/UserRcdVO.java
0 → 100644
浏览文件 @
ba67911a
package
com
.
mmc
.
iuav
.
user
.
model
.
vo
;
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: zj
* @Date: 2023/7/17 10:56
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
UserRcdVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
445983687443393839L
;
private
Integer
id
;
@ApiModelProperty
(
value
=
"用户id(推荐接受人)"
)
private
Integer
userAccountId
;
@ApiModelProperty
(
value
=
"邀请人id"
)
private
Integer
rcdUserId
;
@ApiModelProperty
(
value
=
"邀请人昵称"
)
private
String
rcdNickname
;
@ApiModelProperty
(
value
=
"邀请人姓名"
)
private
String
rcdUserName
;
private
String
remark
;
private
Date
createTime
;
}
cms-common/cms-common-util/src/main/java/com/mmc/iuav/response/ResultEnum.java
浏览文件 @
ba67911a
...
...
@@ -6,6 +6,7 @@ package com.mmc.iuav.response;
*/
public
enum
ResultEnum
implements
BaseErrorInfoInterface
{
SUCCESS
(
"200"
,
"success"
),
BODY_NOT_MATCH
(
"400"
,
"请求的数据格式不符"
),
FAIL
(
"500"
,
"fail"
),
PARAM_ERROR
(
"400"
,
"参数错误"
),
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/auth/TokenCheckHandleInterceptor.java
浏览文件 @
ba67911a
package
com
.
mmc
.
iuav
.
user
.
auth
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.response.ResultEnum
;
import
com.mmc.iuav.user.util.PathUtil
;
...
...
@@ -34,16 +33,16 @@ public class TokenCheckHandleInterceptor implements HandlerInterceptor {
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
String
requestURI
=
request
.
getRequestURI
();
// //根据uri确认是否要拦截
if
(!
shouldFilter
(
requestURI
)){
if
(!
shouldFilter
(
requestURI
))
{
return
true
;
}
String
token
=
request
.
getHeader
(
"token"
);
if
(
StringUtils
.
isBlank
(
token
)){
if
(
StringUtils
.
isBlank
(
token
))
{
exceptionProcess
(
response
);
return
false
;
}
String
tokenJson
=
stringRedisTemplate
.
opsForValue
().
get
(
token
);
if
(
StringUtils
.
isBlank
(
tokenJson
)){
if
(
StringUtils
.
isBlank
(
tokenJson
))
{
exceptionProcess
(
response
);
return
false
;
}
...
...
@@ -80,9 +79,9 @@ public class TokenCheckHandleInterceptor implements HandlerInterceptor {
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
}
public
void
exceptionProcess
(
HttpServletResponse
response
)
throws
Exception
{
public
void
exceptionProcess
(
HttpServletResponse
response
)
throws
Exception
{
response
.
setContentType
(
"application/json;charset=utf-8"
);
PrintWriter
writer
=
response
.
getWriter
();
PrintWriter
writer
=
response
.
getWriter
();
writer
.
write
(
ResultBody
.
error
(
ResultEnum
.
LOGIN_ACCOUNT_STATUS_ERROR
).
toString
());
writer
.
close
();
}
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/CooperationController.java
浏览文件 @
ba67911a
...
...
@@ -3,6 +3,7 @@ package com.mmc.iuav.user.controller;
import
com.mmc.iuav.group.Insert
;
import
com.mmc.iuav.group.Update
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.model.dto.WebsiteRangeDTO
;
import
com.mmc.iuav.user.model.qo.ApplyQO
;
import
com.mmc.iuav.user.model.vo.*
;
import
com.mmc.iuav.user.service.CooperationService
;
...
...
@@ -71,13 +72,13 @@ public class CooperationController extends BaseController {
}
@ApiOperation
(
value
=
"服务商网点数据"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
WebsiteRangeDTO
.
class
)})
@GetMapping
(
"service/bitmap"
)
public
ResultBody
listServiceBitmapData
(
@ApiParam
(
value
=
"类型 注:按照渠道标签的id传入即可"
)
@RequestParam
Integer
type
,
@RequestParam
Integer
pageNo
,
@RequestParam
Integer
pageSize
,
@RequestParam
Double
lon
,
@RequestParam
Double
lat
)
{
public
ResultBody
<
WebsiteRangeDTO
>
listServiceBitmapData
(
@ApiParam
(
value
=
"类型 注:按照渠道标签的id传入即可"
)
@RequestParam
Integer
type
,
@RequestParam
Integer
pageNo
,
@RequestParam
Integer
pageSize
,
@RequestParam
Double
lon
,
@RequestParam
Double
lat
)
{
return
ResultBody
.
success
(
cooperationService
.
listServiceBitmapData
(
type
,
pageNo
,
pageSize
,
lon
,
lat
));
}
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/UserAccountController.java
浏览文件 @
ba67911a
...
...
@@ -5,6 +5,7 @@ import com.mmc.iuav.group.Update;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.qo.UserAccountQO
;
import
com.mmc.iuav.user.model.qo.UserRcdQO
;
import
com.mmc.iuav.user.model.vo.UserAccountVO
;
import
com.mmc.iuav.user.service.UserAccountService
;
import
io.swagger.annotations.*
;
...
...
@@ -62,12 +63,13 @@ public class UserAccountController extends BaseController {
return
userAccountService
.
feignListUserAccountIds
(
provinceCode
,
cityCode
,
districtCode
);
}
@ApiOperation
(
value
=
"授权手机号"
)
@ApiOperation
(
value
=
"授权手机号
-裂变邀请
"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
Integer
.
class
)})
@GetMapping
(
"getUserPhoneNumber"
)
public
ResultBody
getUserPhoneNumber
(
HttpServletRequest
request
,
@ApiParam
(
value
=
"授权手机号code"
,
required
=
true
)
@RequestParam
String
code
)
{
return
userAccountService
.
getUserPhoneNumber
(
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
(),
code
);
@ApiParam
(
value
=
"授权手机号code"
,
required
=
true
)
@RequestParam
String
code
,
@ApiParam
(
value
=
"邀请人id"
,
required
=
false
)
@RequestParam
(
required
=
false
)
Integer
rcdUserId
)
{
return
userAccountService
.
getUserPhoneNumber
(
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
(),
code
,
rcdUserId
);
}
@ApiOperation
(
value
=
"根据用户id查询用户信息"
,
hidden
=
true
)
...
...
@@ -112,4 +114,25 @@ public class UserAccountController extends BaseController {
return
userAccountService
.
disableAppAccount
(
userAccountId
);
}
@ApiOperation
(
value
=
"裂变-邀请人数"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"countRcd"
)
public
ResultBody
countRcd
(
@RequestParam
Integer
userAccountId
)
{
return
userAccountService
.
countRcd
(
userAccountId
);
}
@ApiOperation
(
value
=
"裂变-邀请列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"listUserRcd"
)
public
ResultBody
listUserRcd
(
@RequestBody
UserRcdQO
userRcdQO
)
{
return
userAccountService
.
listUserRcd
(
userRcdQO
);
}
@ApiOperation
(
value
=
"裂变-邀请排行榜"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"topRcd"
)
public
ResultBody
topRcd
(
@RequestParam
(
required
=
false
,
defaultValue
=
"10"
)
Integer
topNum
)
{
return
userAccountService
.
topRcd
(
topNum
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/CooperationDao.java
浏览文件 @
ba67911a
...
...
@@ -120,4 +120,8 @@ public interface CooperationDao {
int
countServiceBitmapData
(
Integer
type
);
List
<
WebsiteInfoDO
>
listServiceBitmapData
(
Integer
type
,
Double
lon
,
Double
lat
,
int
pageNo
,
Integer
pageSize
);
void
updateWebsiteInfo
(
ApplyTagEditVO
applyTagEditVO
);
WebsiteInfoDO
getWebsiteInfoByUserApplyId
(
Integer
id
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/UserServiceDao.java
浏览文件 @
ba67911a
...
...
@@ -3,6 +3,7 @@ package com.mmc.iuav.user.dao;
import
com.mmc.iuav.user.entity.UserAccountDO
;
import
com.mmc.iuav.user.entity.UserRcdDO
;
import
com.mmc.iuav.user.model.qo.UserAccountQO
;
import
com.mmc.iuav.user.model.qo.UserRcdQO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -118,4 +119,42 @@ public interface UserServiceDao {
*/
List
<
UserAccountDO
>
listAppUser
(
UserAccountQO
param
);
/**
* 添加邀请信息
*
* @param userRcd
*/
void
insertUserRcd
(
UserRcdDO
userRcd
);
/**
* 邀请人数
*
* @param userAccountId
* @return
*/
int
countRcd
(
Integer
userAccountId
);
/**
* 邀请列表
*
* @param userRcdQO
* @return
*/
List
<
UserAccountDO
>
listUserRcd
(
UserRcdQO
userRcdQO
);
/**
* 邀请排行榜
*
* @param topNum
* @return
*/
List
<
UserAccountDO
>
topRcd
(
Integer
topNum
);
/**
* 查询用户推荐个数
*
* @param uIds
* @return
*/
List
<
UserAccountDO
>
getInviteCount
(
@Param
(
"uIds"
)
List
<
Integer
>
uIds
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/UserAccountDO.java
浏览文件 @
ba67911a
...
...
@@ -2,13 +2,17 @@ package com.mmc.iuav.user.entity;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.vo.BUserAccountVO
;
import
com.mmc.iuav.user.model.vo.TopInviteVO
;
import
com.mmc.iuav.user.model.vo.UserAccountVO
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.util.CollectionUtils
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author: zj
...
...
@@ -40,10 +44,20 @@ public class UserAccountDO implements Serializable {
private
Integer
cityCode
;
private
Integer
districtCode
;
private
Integer
cooperationTagId
;
private
Integer
companyAuthStatus
;
private
String
companyName
;
private
String
tagName
;
/**
* 邀请人数
*/
private
Integer
inviteCount
;
/**
* 上级推荐人
*/
private
UserRcdDO
userRcdDO
;
/**
* 用户加盟标签
*/
private
List
<
CooperationTagDO
>
cooperationTagDOS
;
public
UserAccountDO
(
UserAccountVO
userAccountVO
)
{
this
.
id
=
userAccountVO
.
getId
();
...
...
@@ -71,16 +85,24 @@ public class UserAccountDO implements Serializable {
}
public
UserAccountVO
buildUserAccountVO
()
{
return
UserAccountVO
.
builder
().
id
(
this
.
id
).
uid
(
this
.
uid
).
phoneNum
(
this
.
phoneNum
).
userName
(
this
.
userName
).
nickName
(
this
.
nickName
)
.
userImg
(
this
.
userImg
).
userSex
(
this
.
userSex
).
email
(
this
.
email
).
source
(
this
.
source
).
accountStatus
(
this
.
accountStatus
).
remark
(
this
.
remark
).
portType
(
this
.
portType
)
.
createTime
(
this
.
createTime
).
companyAuthStatus
(
this
.
companyAuthStatus
==
null
||
this
.
companyAuthStatus
!=
1
?
0
:
1
).
cooperationTagId
(
this
.
cooperationTagId
).
companyName
(
this
.
companyName
)
.
tagName
(
this
.
tagName
).
build
();
return
UserAccountVO
.
builder
().
id
(
this
.
id
).
uid
(
this
.
id
+
""
).
phoneNum
(
this
.
phoneNum
).
userName
(
this
.
userName
).
nickName
(
this
.
nickName
).
userImg
(
this
.
userImg
)
.
userSex
(
this
.
userSex
).
email
(
this
.
email
).
source
(
this
.
source
).
accountStatus
(
this
.
accountStatus
).
remark
(
this
.
remark
).
portType
(
this
.
portType
).
createTime
(
this
.
createTime
)
.
companyAuthStatus
(
this
.
companyAuthStatus
==
null
||
this
.
companyAuthStatus
!=
1
?
0
:
1
).
companyName
(
this
.
companyName
)
.
inviteCount
(
this
.
inviteCount
)
.
cooperationTagVOS
(
CollectionUtils
.
isEmpty
(
this
.
cooperationTagDOS
)
?
null
:
this
.
cooperationTagDOS
.
stream
().
map
(
CooperationTagDO:
:
buildCooperationTagVO
).
collect
(
Collectors
.
toList
()))
.
userRcdVO
(
this
.
userRcdDO
==
null
?
null
:
this
.
userRcdDO
.
buildUserRcdVO
())
.
build
();
}
public
UserAccountSimpleDTO
buildUserAccountSimpleDTO
()
{
return
UserAccountSimpleDTO
.
builder
().
id
(
this
.
id
).
uid
(
this
.
uid
).
phoneNum
(
this
.
phoneNum
).
userName
(
this
.
userName
).
nickName
(
this
.
nickName
)
return
UserAccountSimpleDTO
.
builder
().
id
(
this
.
id
).
uid
(
this
.
id
+
""
).
phoneNum
(
this
.
phoneNum
).
userName
(
this
.
userName
).
nickName
(
this
.
nickName
)
.
userImg
(
this
.
userImg
).
openid
(
this
.
openId
).
userSex
(
this
.
userSex
).
email
(
this
.
email
).
source
(
this
.
source
).
accountStatus
(
this
.
accountStatus
).
portType
(
this
.
portType
)
.
companyAuthStatus
(
this
.
companyAuthStatus
==
null
||
this
.
companyAuthStatus
!=
1
?
0
:
1
).
co
operationTagId
(
this
.
cooperationTagId
).
co
mpanyName
(
this
.
companyName
)
.
companyAuthStatus
(
this
.
companyAuthStatus
==
null
||
this
.
companyAuthStatus
!=
1
?
0
:
1
).
companyName
(
this
.
companyName
)
.
build
();
}
public
TopInviteVO
buildTopInviteVO
()
{
return
TopInviteVO
.
builder
().
id
(
this
.
id
).
uid
(
this
.
id
+
""
).
nickName
(
this
.
nickName
).
userName
(
this
.
userName
).
phoneNum
(
this
.
phoneNum
)
.
inviteCount
(
this
.
inviteCount
).
build
();
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/UserRcdDO.java
浏览文件 @
ba67911a
package
com
.
mmc
.
iuav
.
user
.
entity
;
import
com.mmc.iuav.user.model.vo.UserRcdVO
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
@@ -17,8 +18,27 @@ import java.util.Date;
public
class
UserRcdDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5407029715338119583L
;
private
Integer
id
;
/**
* 用户id(推荐接受人)
*/
private
Integer
userAccountId
;
/**
* 邀请人id(发起人)
*/
private
Integer
rcdUserId
;
/**
* 邀请人昵称(发起人)
*/
private
String
rcdNickname
;
/**
* 邀请人姓名(发起人)
*/
private
String
rcdUserName
;
private
String
remark
;
private
Date
createTime
;
public
UserRcdVO
buildUserRcdVO
()
{
return
UserRcdVO
.
builder
().
id
(
this
.
id
).
userAccountId
(
this
.
userAccountId
).
rcdUserId
(
this
.
rcdUserId
).
rcdNickname
(
this
.
rcdNickname
)
.
rcdUserName
(
this
.
rcdUserName
).
remark
(
this
.
remark
).
createTime
(
this
.
createTime
).
build
();
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/WebsiteInfoDO.java
浏览文件 @
ba67911a
...
...
@@ -25,6 +25,9 @@ public class WebsiteInfoDO implements Serializable {
private
Integer
type
;
private
Integer
userApplyTag
;
private
String
content
;
private
Integer
score
;
public
WebsiteRangeDTO
buildWebsiteRangeDTO
()
{
this
.
distance
=
this
.
distance
==
null
?
0
:
(
BigDecimal
.
valueOf
(
this
.
distance
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_DOWN
)).
doubleValue
();
...
...
@@ -33,6 +36,8 @@ public class WebsiteInfoDO implements Serializable {
.
address
(
address
)
.
lon
(
this
.
lon
)
.
lat
(
this
.
lat
)
.
content
(
content
)
.
score
(
score
)
.
distance
(
this
.
distance
/
1000
)
.
build
();
}
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/error/GlobalExceptionHandler.java
0 → 100644
浏览文件 @
ba67911a
package
com
.
mmc
.
iuav
.
user
.
error
;
import
com.mmc.iuav.http.BizException
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.response.ResultEnum
;
import
org.springframework.context.support.DefaultMessageSourceResolvable
;
import
org.springframework.validation.BindException
;
import
org.springframework.validation.ObjectError
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.MissingPathVariableException
;
import
org.springframework.web.bind.MissingServletRequestParameterException
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.validation.ConstraintViolation
;
import
javax.validation.ConstraintViolationException
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author 作者 geDuo
* @version 创建时间:2021年8月27日 上午10:15:30
* @explain 类说明
*/
@ControllerAdvice
public
class
GlobalExceptionHandler
{
/**
* 统一处理参数校验错误异常(非Spring接口数据绑定验证)
*
* @param e
* @return
*/
@ExceptionHandler
(
BindException
.
class
)
@ResponseBody
public
ResultBody
processValidException
(
BindException
e
)
{
// 获取校验错误结果信息,并将信息组装
List
<
String
>
errorStringList
=
e
.
getBindingResult
().
getAllErrors
().
stream
().
map
(
ObjectError:
:
getDefaultMessage
)
.
collect
(
Collectors
.
toList
());
String
errorMessage
=
String
.
join
(
"; "
,
errorStringList
);
return
ResultBody
.
error
(
ResultEnum
.
BODY_NOT_MATCH
.
getResultCode
(),
errorMessage
);
}
/**
* 统一处理参数校验错误异常
*
* @param e
* @return
*/
@ExceptionHandler
(
IllegalArgumentException
.
class
)
@ResponseBody
public
ResultBody
processValidException
(
IllegalArgumentException
e
)
{
String
errorMessage
=
String
.
join
(
"; "
,
e
.
getMessage
());
return
ResultBody
.
error
(
ResultEnum
.
BODY_NOT_MATCH
.
getResultCode
(),
errorMessage
);
}
@ExceptionHandler
(
ConstraintViolationException
.
class
)
@ResponseBody
public
ResultBody
processValidException
(
ConstraintViolationException
e
)
{
String
errorMessage
=
e
.
getConstraintViolations
().
stream
().
map
(
ConstraintViolation:
:
getMessage
)
.
collect
(
Collectors
.
joining
(
","
));
return
ResultBody
.
error
(
ResultEnum
.
BODY_NOT_MATCH
.
getResultCode
(),
errorMessage
);
}
@ExceptionHandler
(
MethodArgumentNotValidException
.
class
)
@ResponseBody
public
ResultBody
processValidException
(
MethodArgumentNotValidException
e
)
{
String
errorMessage
=
e
.
getBindingResult
().
getAllErrors
().
stream
()
.
map
(
DefaultMessageSourceResolvable:
:
getDefaultMessage
).
collect
(
Collectors
.
joining
(
","
));
return
ResultBody
.
error
(
ResultEnum
.
BODY_NOT_MATCH
.
getResultCode
(),
errorMessage
);
}
@ExceptionHandler
(
MissingServletRequestParameterException
.
class
)
@ResponseBody
public
ResultBody
processValidException
(
MissingServletRequestParameterException
e
)
{
String
errorMessage
=
e
.
getParameterName
()
+
" 不能为空"
;
return
ResultBody
.
error
(
ResultEnum
.
BODY_NOT_MATCH
.
getResultCode
(),
errorMessage
);
}
@ExceptionHandler
(
MissingPathVariableException
.
class
)
@ResponseBody
public
ResultBody
processValidException
(
MissingPathVariableException
e
)
{
String
errorMessage
=
e
.
getVariableName
()
+
" 不能为空"
;
return
ResultBody
.
error
(
ResultEnum
.
BODY_NOT_MATCH
.
getResultCode
(),
errorMessage
);
}
@ExceptionHandler
(
BizException
.
class
)
@ResponseBody
public
ResultBody
processValidException
(
BizException
e
)
{
return
ResultBody
.
error
(
e
.
getErrorCode
(),
e
.
getErrorMsg
());
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/UserAccountService.java
浏览文件 @
ba67911a
...
...
@@ -4,6 +4,7 @@ import com.mmc.iuav.response.ResultBody;
import
com.mmc.iuav.user.entity.UserAccountDO
;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.qo.UserAccountQO
;
import
com.mmc.iuav.user.model.qo.UserRcdQO
;
import
com.mmc.iuav.user.model.vo.UserAccountVO
;
import
java.util.List
;
...
...
@@ -75,9 +76,10 @@ public interface UserAccountService {
*
* @param id
* @param code
* @param rcdUserId
* @return
*/
ResultBody
getUserPhoneNumber
(
Integer
id
,
String
code
);
ResultBody
getUserPhoneNumber
(
Integer
id
,
String
code
,
Integer
rcdUserId
);
/**
* 根据id获取用户信息
...
...
@@ -127,5 +129,27 @@ public interface UserAccountService {
*/
ResultBody
disableAppAccount
(
Integer
userAccountId
);
/**
* 用户邀请人数
*
* @param userAccountId
* @return
*/
ResultBody
countRcd
(
Integer
userAccountId
);
/**
* 用户邀请列表
*
* @param userRcdQO
* @return
*/
ResultBody
listUserRcd
(
UserRcdQO
userRcdQO
);
/**
* 邀请排行榜
*
* @param topNum
* @return
*/
ResultBody
topRcd
(
Integer
topNum
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/AuthServiceImpl.java
浏览文件 @
ba67911a
...
...
@@ -4,7 +4,6 @@ import com.alibaba.fastjson2.JSON;
import
com.alibaba.fastjson2.JSONObject
;
import
com.mmc.iuav.auth.JwtConstant
;
import
com.mmc.iuav.auth.JwtUtil
;
import
com.mmc.iuav.general.CodeUtil
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.response.ResultEnum
;
import
com.mmc.iuav.user.auth.PwdUtil
;
...
...
@@ -94,21 +93,17 @@ public class AuthServiceImpl implements AuthService {
}
//数据库查询用户信息
UserAccountVO
userAccountVO
=
userAccountService
.
getUserAccountInfoByUnionId
(
unionId
);
String
uid
;
Integer
companyAuthStatus
=
0
;
if
(
userAccountVO
==
null
)
{
UserAccountDO
userAccountDO
=
new
UserAccountDO
();
userAccountDO
.
setUnionId
(
unionId
);
userAccountDO
.
setOpenId
(
openId
);
uid
=
CodeUtil
.
generateUserUID
();
userAccountDO
.
setUid
(
uid
);
userAccountDO
.
setPortType
(
100
);
userAccountDO
.
setSource
(
wxLoginVO
.
getSource
());
userAccountService
.
insertUserAccount
(
userAccountDO
);
userAccountVO
=
userAccountDO
.
buildUserAccountVO
();
payClient
.
createWallet
(
userAccountDO
.
getId
());
}
else
{
uid
=
userAccountVO
.
getUid
();
CompanyAuthDO
companyAuthDO
=
companyAuthDao
.
getCompanyAuth
(
userAccountVO
.
getId
());
if
(
companyAuthDO
!=
null
)
{
companyAuthStatus
=
companyAuthDO
.
getAuthStatus
();
...
...
@@ -120,7 +115,7 @@ public class AuthServiceImpl implements AuthService {
map
.
put
(
JwtConstant
.
TOKEN_TYPE
,
JwtConstant
.
IUAV_TOKEN
);
String
token
=
JwtUtil
.
createJwt
(
map
);
LoginSuccessDTO
loginSuccessDTO
=
LoginSuccessDTO
.
builder
().
token
(
token
).
userAccountId
(
userAccountVO
.
getId
()).
uid
(
u
id
)
LoginSuccessDTO
loginSuccessDTO
=
LoginSuccessDTO
.
builder
().
token
(
token
).
userAccountId
(
userAccountVO
.
getId
()).
uid
(
u
serAccountVO
.
getId
()
+
""
)
.
userName
(
userAccountVO
.
getUserName
()).
nickName
(
userAccountVO
.
getNickName
()).
phoneNum
(
userAccountVO
.
getPhoneNum
()).
portType
(
100
).
build
();
stringRedisTemplate
.
opsForValue
().
set
(
...
...
@@ -181,7 +176,7 @@ public class AuthServiceImpl implements AuthService {
companyAuthStatus
=
companyAuthDO
.
getAuthStatus
();
}
String
token
=
JwtUtil
.
createJwt
(
map
);
LoginSuccessDTO
loginSuccessDTO
=
LoginSuccessDTO
.
builder
().
token
(
token
).
userAccountId
(
userAccountVO
.
getId
()).
uid
(
userAccountVO
.
get
Uid
()
)
LoginSuccessDTO
loginSuccessDTO
=
LoginSuccessDTO
.
builder
().
token
(
token
).
userAccountId
(
userAccountVO
.
getId
()).
uid
(
userAccountVO
.
get
Id
()
+
""
)
.
userName
(
userAccountVO
.
getUserName
()).
nickName
(
userAccountVO
.
getNickName
()).
phoneNum
(
userAccountVO
.
getPhoneNum
()).
portType
(
100
).
build
();
stringRedisTemplate
.
opsForValue
().
set
(
token
,
JSONObject
.
toJSONString
(
loginSuccessDTO
),
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/CooperationServiceImpl.java
浏览文件 @
ba67911a
...
...
@@ -162,8 +162,16 @@ public class CooperationServiceImpl implements CooperationService {
userApplyTagDO
.
setContent
(
applyTagEditVO
.
getContent
());
userApplyTagDO
.
setScore
(
applyTagEditVO
.
getScore
());
cooperationDao
.
updateUserApplyTag
(
userApplyTagDO
);
// 保存网点信息
cooperationDao
.
addWebsiteInfo
(
applyTagEditVO
);
// 保存网点之前判断该网点是否存在 存在则修改不存在则新增
WebsiteInfoDO
websiteInfoDO
=
cooperationDao
.
getWebsiteInfoByUserApplyId
(
applyTagEditVO
.
getId
());
if
(
websiteInfoDO
==
null
)
{
// 保存网点信息
cooperationDao
.
addWebsiteInfo
(
applyTagEditVO
);
}
else
{
applyTagEditVO
.
setWebsiteId
(
websiteInfoDO
.
getId
());
// 修改网点信息
cooperationDao
.
updateWebsiteInfo
(
applyTagEditVO
);
}
return
ResultBody
.
success
();
}
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/UserAccountServiceImpl.java
浏览文件 @
ba67911a
...
...
@@ -11,8 +11,10 @@ import com.mmc.iuav.user.entity.UserAccountDO;
import
com.mmc.iuav.user.entity.UserRcdDO
;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.qo.UserAccountQO
;
import
com.mmc.iuav.user.model.qo.UserRcdQO
;
import
com.mmc.iuav.user.model.vo.CompanyAuthVO
;
import
com.mmc.iuav.user.model.vo.CooperationTagVO
;
import
com.mmc.iuav.user.model.vo.TopInviteVO
;
import
com.mmc.iuav.user.model.vo.UserAccountVO
;
import
com.mmc.iuav.user.mq.MqProducer
;
import
com.mmc.iuav.user.service.CompanyAuthService
;
...
...
@@ -21,6 +23,7 @@ import com.mmc.iuav.user.service.WxService;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
...
...
@@ -147,8 +150,9 @@ public class UserAccountServiceImpl implements UserAccountService {
}
}
@Transactional
@Override
public
ResultBody
getUserPhoneNumber
(
Integer
id
,
String
code
)
{
public
ResultBody
getUserPhoneNumber
(
Integer
id
,
String
code
,
Integer
rcdUserId
)
{
String
userPhoneNumber
=
wxService
.
getUserPhoneNumber
(
id
,
code
);
if
(
StringUtils
.
isBlank
(
userPhoneNumber
))
{
return
ResultBody
.
error
(
ResultEnum
.
AUTH_PHONE_NUMBER_ERROR
);
...
...
@@ -157,6 +161,12 @@ public class UserAccountServiceImpl implements UserAccountService {
userAccount
.
setId
(
id
);
userAccount
.
setPhoneNum
(
userPhoneNumber
);
userServiceDao
.
update
(
userAccount
);
if
(
rcdUserId
!=
null
)
{
UserRcdDO
userRcd
=
new
UserRcdDO
();
userRcd
.
setUserAccountId
(
id
);
userRcd
.
setRcdUserId
(
rcdUserId
);
userServiceDao
.
insertUserRcd
(
userRcd
);
}
return
ResultBody
.
success
();
}
...
...
@@ -218,18 +228,45 @@ public class UserAccountServiceImpl implements UserAccountService {
param
.
buildCurrentPage
();
List
<
UserAccountDO
>
userAccountDOList
=
userServiceDao
.
listAppUser
(
param
);
List
<
Integer
>
uIds
=
userAccountDOList
.
stream
().
map
(
UserAccountDO:
:
getId
).
collect
(
Collectors
.
toList
());
// 设置加盟商标签
buildTagsInfo
(
uIds
,
userAccountDOList
);
// 设置推荐(邀请)伙伴个数
buildInviteCount
(
uIds
,
userAccountDOList
);
List
<
UserAccountVO
>
userAccountVOS
=
userAccountDOList
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountVO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
userAccountVOS
));
}
/**
* 设置推荐伙伴个数
*
* @param uIds
* @param userAccountDOList
*/
private
void
buildInviteCount
(
List
<
Integer
>
uIds
,
List
<
UserAccountDO
>
userAccountDOList
)
{
List
<
UserAccountDO
>
userInviteList
=
userServiceDao
.
getInviteCount
(
uIds
);
if
(
CollectionUtils
.
isEmpty
(
userInviteList
))
{
userInviteList
.
forEach
(
d
->
d
.
setInviteCount
(
0
));
}
else
{
Map
<
Integer
,
Integer
>
inviteCount
=
userInviteList
.
stream
().
collect
(
Collectors
.
toMap
(
UserAccountDO:
:
getId
,
UserAccountDO:
:
getInviteCount
));
userAccountDOList
.
forEach
(
d
->
d
.
setInviteCount
(
inviteCount
.
get
(
d
.
getId
())
==
null
?
0
:
inviteCount
.
get
(
d
.
getId
())));
}
}
/**
* 设置加盟商标签
*
* @param uIds
* @param userAccountDOList
*/
private
void
buildTagsInfo
(
List
<
Integer
>
uIds
,
List
<
UserAccountDO
>
userAccountDOList
)
{
List
<
CooperationTagDO
>
cooperationTagDOS
=
cooperationDao
.
listUserCooperationTagByUIds
(
uIds
);
Map
<
Integer
,
List
<
CooperationTagDO
>>
userTagsMap
=
cooperationTagDOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
CooperationTagDO:
:
getUserAccountId
));
List
<
UserAccountDO
>
res
=
buildTagInfo
(
userAccountDOList
);
List
<
UserAccountVO
>
userAccountVOS
=
res
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountVO
).
collect
(
Collectors
.
toList
());
for
(
UserAccountVO
userAccountVO
:
userAccountVOS
)
{
List
<
CooperationTagDO
>
userCooperationTagDOS
=
userTagsMap
.
get
(
userAccountVO
.
getId
());
for
(
UserAccountDO
userAccountDO
:
userAccountDOList
)
{
List
<
CooperationTagDO
>
userCooperationTagDOS
=
userTagsMap
.
get
(
userAccountDO
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
userCooperationTagDOS
))
{
List
<
CooperationTagVO
>
cooperationTagVOS
=
userCooperationTagDOS
.
stream
().
map
(
CooperationTagDO:
:
buildCooperationTagVO
).
collect
(
Collectors
.
toList
());
userAccountVO
.
setCooperationTagVOS
(
cooperationTagVOS
);
userAccountDO
.
setCooperationTagDOS
(
userCooperationTagDOS
);
}
}
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
userAccountVOS
));
}
@Override
...
...
@@ -242,16 +279,33 @@ public class UserAccountServiceImpl implements UserAccountService {
return
ResultBody
.
success
();
}
private
List
<
UserAccountDO
>
buildTagInfo
(
List
<
UserAccountDO
>
userAccountDOList
)
{
List
<
CooperationTagDO
>
cooperationTagDOS
=
cooperationDao
.
listTags
();
Map
<
Integer
,
CooperationTagDO
>
cooperationTagDOMap
=
cooperationTagDOS
.
stream
().
collect
(
Collectors
.
toMap
(
CooperationTagDO:
:
getId
,
d
->
d
,
(
k1
,
k2
)
->
k2
));
for
(
UserAccountDO
userAccountDO
:
userAccountDOList
)
{
CooperationTagDO
cooperationTagDO
=
cooperationTagDOMap
.
get
(
userAccountDO
.
getCooperationTagId
());
if
(
cooperationTagDO
!=
null
)
{
userAccountDO
.
setTagName
(
cooperationTagDO
.
getTagName
());
}
@Override
public
ResultBody
countRcd
(
Integer
userAccountId
)
{
Integer
count
=
userServiceDao
.
countRcd
(
userAccountId
);
return
ResultBody
.
success
(
count
);
}
@Override
public
ResultBody
listUserRcd
(
UserRcdQO
userRcdQO
)
{
int
count
=
userServiceDao
.
countRcd
(
userRcdQO
.
getUserAccountId
());
if
(
count
==
0
)
{
return
ResultBody
.
success
(
PageResult
.
buildPage
(
userRcdQO
.
getPageNo
(),
userRcdQO
.
getPageSize
(),
count
));
}
return
userAccountDOList
;
int
pageNo
=
userRcdQO
.
getPageNo
();
userRcdQO
.
buildCurrentPage
();
List
<
UserAccountDO
>
userRcd
=
userServiceDao
.
listUserRcd
(
userRcdQO
);
List
<
UserAccountVO
>
userAccountVOS
=
userRcd
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountVO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
userRcdQO
.
getPageSize
(),
count
,
userAccountVOS
));
}
@Override
public
ResultBody
topRcd
(
Integer
topNum
)
{
List
<
UserAccountDO
>
topInviteUser
=
userServiceDao
.
topRcd
(
topNum
);
if
(!
CollectionUtils
.
isEmpty
(
topInviteUser
))
{
List
<
TopInviteVO
>
topInviteVOS
=
topInviteUser
.
stream
().
map
(
UserAccountDO:
:
buildTopInviteVO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
topInviteVOS
);
}
return
ResultBody
.
success
();
}
...
...
csm-service/cms-service-user/src/main/resources/mapper/CooperationDao.xml
浏览文件 @
ba67911a
...
...
@@ -34,6 +34,27 @@
values (#{name}, #{address}, #{lat}, #{lon}, #{cooperationTagId}, #{id})
</insert>
<update
id=
"updateWebsiteInfo"
>
update website_info
<set>
<if
test=
"name != null and name != ''"
>
name = #{name},
</if>
<if
test=
"address != null and address != ''"
>
address = #{address},
</if>
<if
test=
"lat != null"
>
lat = #{lat},
</if>
<if
test=
"lon != null"
>
lon = #{lon},
</if>
<if
test=
"cooperationTagId != null"
>
type = #{cooperationTagId}
</if>
</set>
where id = #{websiteId}
</update>
<update
id=
"updateUserApplyTag"
parameterType=
"com.mmc.iuav.user.entity.UserApplyTagDO"
>
UPDATE user_apply_tag
<set>
...
...
@@ -226,17 +247,33 @@
where type = #{type}
</select>
<select
id=
"listServiceBitmapData"
resultType=
"com.mmc.iuav.user.entity.WebsiteInfoDO"
>
SELECT id,
SELECT wi.id,
wi.`name`,
wi.address,
wi.lat,
wi.lon,
wi.type,
wi.user_apply_tag,
st_distance_sphere(
point(wi.lon, wi.lat),
point(${lon}, ${lat})) AS distance,
ua.content,
ua.score
FROM website_info wi
INNER JOIN user_apply_tag ua ON wi.user_apply_tag = ua.id
WHERE wi.type = #{type}
ORDER BY distance ASC
LIMIT #{pageNo}, #{pageSize}
</select>
<select
id=
"getWebsiteInfoByUserApplyId"
resultType=
"com.mmc.iuav.user.entity.WebsiteInfoDO"
>
select id,
`name`,
address,
lat,
lon,
`type`,
user_apply_tag,
st_distance_sphere(point(lon, lat), point(${lon}, ${lat})) as distance
FROM website_info
where type = #{type}
ORDER BY distance ASC
LIMIT #{pageNo}, #{pageSize}
user_apply_tag
from website_info
where user_apply_tag = #{id}
</select>
</mapper>
\ No newline at end of file
csm-service/cms-service-user/src/main/resources/mapper/UserServiceDao.xml
浏览文件 @
ba67911a
...
...
@@ -5,7 +5,6 @@
<mapper
namespace=
"com.mmc.iuav.user.dao.UserServiceDao"
>
<resultMap
id=
"userAccountResultMap"
type=
"com.mmc.iuav.user.entity.UserAccountDO"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"uid"
column=
"uid"
/>
<result
property=
"phoneNum"
column=
"phone_num"
/>
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"nickName"
column=
"nick_name"
/>
...
...
@@ -22,18 +21,32 @@
<result
property=
"createTime"
column=
"createTime"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"companyAuthStatus"
column=
"companyAuthStatus"
/>
<result
property=
"companyName"
column=
"companyName"
/>
<association
property=
"userRcdDO"
javaType=
"com.mmc.iuav.user.entity.UserRcdDO"
>
<id
property=
"id"
column=
"user_rcd_id"
/>
<result
property=
"rcdUserId"
column=
"rcd_user_id"
/>
<result
property=
"rcdNickname"
column=
"rcdNickname"
/>
<result
property=
"rcdUserName"
column=
"rcdUsername"
/>
</association>
</resultMap>
<insert
id=
"insertUserAccount"
parameterType=
"com.mmc.iuav.user.entity.UserAccountDO"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into user_account(
uid,
phone_num, user_name, nick_name, user_img, open_id,
insert into user_account(phone_num, user_name, nick_name, user_img, open_id,
union_id, user_sex, email, source, province_code, city_code, district_code, remark,
port_type, create_time)
values (#{
uid}, #{
phoneNum}, #{userName}, #{nickName}, #{userImg}, #{openId},
values (#{phoneNum}, #{userName}, #{nickName}, #{userImg}, #{openId},
#{unionId}, #{userSex}, #{email}, #{source}, #{provinceCode}, #{cityCode}, #{districtCode}, #{remark},
#{portType}, NOW())
</insert>
<insert
id=
"insertUserRcd"
parameterType=
"com.mmc.iuav.user.entity.UserRcdDO"
>
insert into user_rcd (user_account_id, rcd_user_id, create_time)
values (#{userAccountId}, #{rcdUserId}, NOW());
</insert>
<update
id=
"update"
parameterType=
"com.mmc.iuav.user.entity.UserAccountDO"
>
update user_account
<set>
...
...
@@ -88,7 +101,6 @@
<select
id=
"getUserAccountInfoByUnionId"
resultType=
"com.mmc.iuav.user.entity.UserAccountDO"
>
select id,
uid,
phone_num,
user_name,
nick_name,
...
...
@@ -111,7 +123,6 @@
<select
id=
"getUserAccountById"
resultType=
"com.mmc.iuav.user.entity.UserAccountDO"
>
select id,
uid,
phone_num,
user_name,
nick_name,
...
...
@@ -147,7 +158,7 @@
<select
id=
"feignListUserAccount"
resultType=
"com.mmc.iuav.user.entity.UserAccountDO"
parameterType=
"com.mmc.iuav.user.model.qo.UserAccountQO"
>
select ua.id, ua.
uid, ua.
phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
select ua.id, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus
from user_account ua left join company_auth ca on ua.id = ca.user_account_id
...
...
@@ -162,7 +173,7 @@
user_name like CONCAT("%",#{keyword},"%") or
nick_name like CONCAT("%",#{keyword},"%") or
phone_num like CONCAT("%",#{keyword},"%") or
u
id like CONCAT("%",#{keyword},"%"))
id like CONCAT("%",#{keyword},"%"))
</if>
<if
test=
"provinceCode != null"
>
and ua.province_code = #{provinceCode}
...
...
@@ -176,7 +187,7 @@
</select>
<select
id=
"listUserAccountByIds"
resultType=
"com.mmc.iuav.user.entity.UserAccountDO"
>
select ua.id, ua.
uid, ua.
phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
select ua.id, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus,
ca.company_name
...
...
@@ -190,7 +201,7 @@
</select>
<select
id=
"feignListRcdUserInfo"
resultType=
"com.mmc.iuav.user.entity.UserAccountDO"
>
select ua.id, ua.
uid, ua.
phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
select ua.id, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus,
ca.company_name
...
...
@@ -206,7 +217,6 @@
<select
id=
"getUserRcdByAccountId"
resultType=
"com.mmc.iuav.user.entity.UserAccountDO"
>
select ua.id,
ua.uid,
ua.phone_num,
ua.user_name,
ua.nick_name,
...
...
@@ -264,18 +274,21 @@
and (
ua.user_name like CONCAT("%",#{keyword},"%")
or ua.nick_name like CONCAT("%",#{keyword},"%")
or ua.
u
id like CONCAT("%",#{keyword},"%")
or ua.id like CONCAT("%",#{keyword},"%")
)
</if>
</select>
<select
id=
"listAppUser"
result
Type=
"com.mmc.iuav.user.entity.UserAccountDO
"
<select
id=
"listAppUser"
result
Map=
"userAccountResultMap
"
parameterType=
"com.mmc.iuav.user.model.qo.UserAccountQO"
>
select ua.id, ua.
uid, ua.
phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
select ua.id, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.disable, ua.create_time, ua.update_time, IFNULL(ca.auth_status, 0) as
companyAuthStatus, ca.company_name
companyAuthStatus, ca.company_name, rcd.id as user_rcd_id, rcd.rcd_user_id, r_user.nick_name as rcdNickname,
r_user.user_name as rcdUserName
from user_account ua left join company_auth ca on ua.id = ca.user_account_id
left join user_rcd rcd on rcd.user_account_id = ua.id
left join user_account r_user on r_user.id = rcd.rcd_user_id
where
ua.disable = 0 and ua.port_type = 100
<if
test=
"phoneNum != null and phoneNum != '' "
>
...
...
@@ -297,11 +310,56 @@
and (
ua.user_name like CONCAT("%",#{keyword},"%")
or ua.nick_name like CONCAT("%",#{keyword},"%")
or ua.
u
id like CONCAT("%",#{keyword},"%")
or ua.id like CONCAT("%",#{keyword},"%")
)
</if>
order by ua.create_time desc
limit #{pageNo}, #{pageSize}
</select>
<select
id=
"countRcd"
resultType=
"int"
>
select count(*) from user_rcd where rcd_user_id = #{userAccountId}
</select>
<select
id=
"listUserRcd"
resultType=
"com.mmc.iuav.user.entity.UserAccountDO"
parameterType=
"com.mmc.iuav.user.model.qo.UserRcdQO"
>
select ua.id,ua.phone_num, ua.user_name, ua.nick_name, ua.user_img,ur.create_time
from user_account ua inner join user_rcd ur on ua.id = ur.user_account_id
where ur.rcd_user_id = #{userAccountId}
order by ur.create_time desc
limit #{pageNo}, #{pageSize}
</select>
<select
id=
"topRcd"
resultType=
"com.mmc.iuav.user.entity.UserAccountDO"
>
select ua.id,
ua.nick_name,
ua.user_img,
ua.user_name,
ua.phone_num,
count(*) as invite_count
from user_rcd urd
INNER JOIN user_account ua ON urd.rcd_user_id = ua.id
where ua.disable = 0
GROUP BY urd.rcd_user_id
ORDER BY invite_count DESC limit #{topNum}
</select>
<select
id=
"getInviteCount"
resultType=
"com.mmc.iuav.user.entity.UserAccountDO"
>
select ua.id,
ua.nick_name,
ua.user_img,
ua.user_name,
ua.phone_num,
count(*) as invite_count
from user_rcd urd
INNER JOIN user_account ua ON urd.rcd_user_id = ua.id
where ua.disable = 0
<if
test=
"uIds != null"
>
<foreach
collection=
"uIds"
separator=
","
open=
"and urd.rcd_user_id in ("
close=
")"
item=
"id"
>
#{id}
</foreach>
</if>
GROUP BY urd.rcd_user_id
</select>
</mapper>
csm-service/cms-service-user/src/main/resources/not-check.yml
浏览文件 @
ba67911a
...
...
@@ -17,6 +17,7 @@ data-filter:
-
/userapp/wx/getAppletQRCode
-
/userapp/wx/wxSendMessage
-
/userapp/user-account/feignListUserAccountIds
-
/userapp/user-account/topRcd
-
/userapp/back-user/listTest
-
/userapp/company/listCompanyPageBack
-
/userapp/company/getCompanyInfoById
...
...
kustomization/base/deployment.yaml
浏览文件 @
ba67911a
...
...
@@ -4,7 +4,7 @@ metadata:
name
:
cms-deployment
namespace
:
default
spec
:
# minReadySeconds: 240
# minReadySeconds: 240
revisionHistoryLimit
:
2
replicas
:
1
selector
:
...
...
@@ -20,11 +20,11 @@ spec:
-
name
:
cms
image
:
REGISTRY/NAMESPACE/IMAGE:TAG
readinessProbe
:
initialDelaySeconds
:
480
periodSeconds
:
10
initialDelaySeconds
:
15
periodSeconds
:
5
#timeoutSeconds: 1
#successThreshold: 1
failureThreshold
:
2
0
failureThreshold
:
1
0
httpGet
:
path
:
/userapp/actuator/health/readiness
port
:
cms-port
...
...
@@ -34,10 +34,10 @@ spec:
-
name
:
localtime
mountPath
:
/etc/localtime
readOnly
:
true
resources
:
limits
:
# memory: 1024Mi
cpu
:
100m
resources
:
{
}
#
limits:
# memory: 1024Mi
#
cpu: 100m
ports
:
-
containerPort
:
35150
name
:
cms-port
...
...
kustomization/overlays/dev/kustomization.yaml
浏览文件 @
ba67911a
...
...
@@ -18,4 +18,4 @@ patches:
images
:
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag
:
6accac4106c773d7a04f22f7ea1686607acee6b9
newTag
:
42bc01e508130cfbe19ad17b27456cadc9aee4ca
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论