记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
bc0dccae
Commit
bc0dccae
authored
Oct 25, 2021
by
刘喆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre' into 'master'
Pre See merge request
!110
parents
19ae5497
84a6ad6e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
3 deletions
+78
-3
db_sweetsugar_structure.sql
.../liquidnet-service-sweet/docu/db_sweetsugar_structure.sql
+3
-0
SweetConstant.java
...a/com/liquidnet/service/sweet/constant/SweetConstant.java
+1
-0
SweetWechatTemplateController.java
...rvice/sweet/controller/SweetWechatTemplateController.java
+9
-2
SweetWechatUser.java
...a/com/liquidnet/service/sweet/entity/SweetWechatUser.java
+10
-0
SweetWechatTemplateServiceImpl.java
...ce/sweet/service/impl/SweetWechatTemplateServiceImpl.java
+39
-1
RedisDataUtils.java
...ava/com/liquidnet/service/sweet/utils/RedisDataUtils.java
+15
-0
sqlmap.properties
...uidnet-service-sweet/src/main/resources/sqlmap.properties
+1
-0
No files found.
liquidnet-bus-service/liquidnet-service-sweet/docu/db_sweetsugar_structure.sql
View file @
bc0dccae
...
...
@@ -441,6 +441,9 @@ CREATE TABLE `sweet_wechat_user`
ROW_FORMAT
=
DYNAMIC
COMMENT
'正在现场服务号关注事件储存用户信息表'
;
alter
table
sweet_wechat_user
add
type
tinyint
NOT
NULL
DEFAULT
1
COMMENT
'服务类型 1正在 2摩登'
after
user_id
;
alter
table
sweet_wechat_user
add
adam_user_id
varchar
(
200
)
NOT
NULL
DEFAULT
''
COMMENT
'adam用户id'
after
user_id
;
alter
table
sweet_wechat_user
add
adam_phone
varchar
(
200
)
NOT
NULL
DEFAULT
''
COMMENT
'adam用户手机号'
after
adam_user_id
;
-- 小程序登录记录用户解密后信息表
drop
TABLE
if
exists
`sweet_applet_user`
;
CREATE
TABLE
`sweet_applet_user`
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/constant/SweetConstant.java
View file @
bc0dccae
...
...
@@ -23,6 +23,7 @@ public class SweetConstant {
public
final
static
String
REDIS_KEY_SWEET_WECHAT_USER_INFO
=
"sweet:wechatUser:unionId:"
;
public
final
static
String
REDIS_KEY_SWEET_WECHAT_USER_INFO_STR
=
"sweet:wechatUser:unionIdStr:"
;
public
final
static
String
REDIS_KEY_SWEET_WECHAT_USER_UNIONID
=
"sweet:wechatUser:openId:"
;
public
final
static
String
REDIS_KEY_SWEET_WECHAT_USER_UNIONID_PHONE
=
"sweet:wechatUser:phone:"
;
public
final
static
String
REDIS_KEY_SWEET_ANSWER_PHONE
=
"sweet:answer:phone:"
;
public
final
static
String
REDIS_KEY_SWEET_CITY_VOTE_STAT_LIST
=
":StatList"
;
public
final
static
String
REDIS_KEY_SWEET_CITY_VOTE_CITY_CODE
=
":cityCode:"
;
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetWechatTemplateController.java
View file @
bc0dccae
...
...
@@ -7,12 +7,14 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
@Api
(
tags
=
"服务号-模版消息"
)
@Slf4j
@RestController
@RequestMapping
(
"/wechatTemplate"
)
public
class
SweetWechatTemplateController
{
...
...
@@ -52,12 +54,17 @@ public class SweetWechatTemplateController {
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"unionId"
,
value
=
"微信unionId"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"Integer"
,
name
=
"type"
,
value
=
"type 1正在 2摩登"
,
required
=
false
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"userId"
,
value
=
"正在用户ID"
,
required
=
false
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"phone"
,
value
=
"正在用户手机号"
,
required
=
false
),
})
public
ResponseDto
followStatus
(
@RequestParam
()
String
unionId
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
type
@RequestParam
(
defaultValue
=
"1"
)
Integer
type
,
@RequestParam
(
defaultValue
=
""
)
String
userId
,
@RequestParam
(
defaultValue
=
""
)
String
phone
)
{
boolean
status
=
sweetTemplateService
.
followStatus
(
unionId
,
type
);
log
.
info
(
"followStatus参数 [unionId:{},type:{},userId:{},phone:{}]"
,
unionId
,
type
,
userId
,
phone
);
boolean
status
=
sweetTemplateService
.
followStatus
(
unionId
,
type
,
userId
,
phone
);
if
(
status
)
{
return
ResponseDto
.
success
(
1
);
}
else
{
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/entity/SweetWechatUser.java
View file @
bc0dccae
...
...
@@ -30,6 +30,16 @@ public class SweetWechatUser implements Serializable {
*/
private
String
userId
;
/**
* adam_user_id
*/
private
String
adamUserId
;
/**
* adam_phone
*/
private
String
adamPhone
;
/**
* openId
*/
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetWechatTemplateServiceImpl.java
View file @
bc0dccae
...
...
@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.CollectionUtil;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.kylin.constant.KylinRedisConst
;
import
com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo
;
...
...
@@ -31,6 +32,7 @@ import org.springframework.util.CollectionUtils;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.LinkedList
;
import
java.util.List
;
/**
...
...
@@ -259,7 +261,7 @@ public class SweetWechatTemplateServiceImpl {
}
}
public
boolean
followStatus
(
String
unionId
,
Integer
type
)
{
public
boolean
followStatus
(
String
unionId
,
Integer
type
,
String
userId
,
String
phone
)
{
SweetWechatUser
sweetWechatUser
=
null
;
if
(
null
==
type
||
type
<=
1
)
{
sweetWechatUser
=
redisDataUtils
.
getSweetWechatUser
(
unionId
);
...
...
@@ -268,6 +270,42 @@ public class SweetWechatTemplateServiceImpl {
}
if
(
null
!=
sweetWechatUser
&&
!
sweetWechatUser
.
getUnionId
().
isEmpty
())
{
// 同步手机号
String
oldAdamUserId
=
sweetWechatUser
.
getAdamUserId
();
String
oldAdamPhone
=
sweetWechatUser
.
getAdamPhone
();
if
(
null
==
oldAdamUserId
)
{
oldAdamUserId
=
""
;
}
if
(
null
==
oldAdamPhone
)
{
oldAdamPhone
=
""
;
}
if
((!
phone
.
isEmpty
()
||
!
userId
.
isEmpty
())
&&
(
oldAdamUserId
.
isEmpty
()
||
oldAdamPhone
.
isEmpty
()))
{
if
(
phone
.
isEmpty
())
{
phone
=
oldAdamPhone
;
}
else
{
redisDataUtils
.
setUnionIdByPhone
(
phone
,
unionId
);
}
if
(
userId
.
isEmpty
())
{
userId
=
oldAdamUserId
;
}
sweetWechatUser
.
setAdamPhone
(
phone
);
sweetWechatUser
.
setAdamUserId
(
userId
);
if
(
null
==
type
||
type
<=
1
)
{
redisDataUtils
.
setSweetWechatUser
(
sweetWechatUser
);
}
else
if
(
type
==
2
)
{
redisDataUtils
.
setSweetWechatUserModernsky
(
sweetWechatUser
);
}
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"sweet_user.update2"
));
LocalDateTime
now
=
LocalDateTime
.
now
();
sqlsDataA
.
add
(
new
Object
[]{
userId
,
phone
,
now
,
unionId
,
type
});
queueUtils
.
sendMsgByRedis
(
MQConst
.
SweetQueue
.
SWEET_USER_INSERT_DRAW
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlsDataA
));
}
return
true
;
}
else
{
return
false
;
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/RedisDataUtils.java
View file @
bc0dccae
...
...
@@ -338,6 +338,21 @@ public class RedisDataUtils {
return
(
String
)
redisUtil
.
get
(
redisKey
);
}
public
String
getUnionIdByPhone
(
String
phone
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_WECHAT_USER_UNIONID_PHONE
.
concat
(
phone
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
null
==
obj
)
{
return
""
;
}
else
{
return
(
String
)
redisUtil
.
get
(
redisKey
);
}
}
public
void
setUnionIdByPhone
(
String
phone
,
String
unionId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_WECHAT_USER_UNIONID_PHONE
.
concat
(
phone
);
redisUtil
.
set
(
redisKey
,
unionId
);
}
public
SweetWechatUser
getSweetWechatUser
(
String
unionid
)
{
if
(
unionid
.
isEmpty
())
{
return
null
;
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/resources/sqlmap.properties
View file @
bc0dccae
...
...
@@ -45,6 +45,7 @@ sweet_answer.insert=INSERT INTO sweet_answer (answer_id,phone,answer_json,img_ur
# --------------------------关注/取消服务号的用户信息--------------------------
sweet_user.insert
=
INSERT INTO sweet_wechat_user (user_id,type,openId,unionId,nickname,sexDesc,sex,headImgUrl,language,country,province,city,subscribeTime,subscribeScene) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)
sweet_user.update
=
UPDATE sweet_wechat_user SET is_cancel = ?, updated_at = ? WHERE unionId = ? and type = ?
sweet_user.update2
=
UPDATE sweet_wechat_user SET adam_user_id = ?, adam_phone = ?, updated_at = ? WHERE unionId = ? and type = ?
# --------------------------提醒记录--------------------------
sweet_remind.insert
=
INSERT INTO sweet_remind (remind_id,openId,unionId,performancesId) VALUES (?,?,?,?)
# --------------------------小程序登录记录用户解密后信息--------------------------
...
...
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