Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-api
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
李伟
cust-api
Commits
f6224073
Commit
f6224073
authored
Mar 03, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了bug
parent
1e2e8592
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
39 deletions
+80
-39
CmsOrderServiceImpl.java
...t/business/cmsOrder/service/impl/CmsOrderServiceImpl.java
+4
-4
MemInfoRepository.java
...a/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
+7
-0
MemInfoServiceImpl.java
...oft/business/memInfo/service/impl/MemInfoServiceImpl.java
+12
-11
MemLeaveMessageServiceImpl.java
...LeaveMessage/service/impl/MemLeaveMessageServiceImpl.java
+5
-5
ArticleCommentDTO.java
...rcisoft/business/opmArticle/entity/ArticleCommentDTO.java
+4
-0
OpmArticleServiceImpl.java
...siness/opmArticle/service/impl/OpmArticleServiceImpl.java
+30
-11
MemInfoMapper.xml
...esources/mapper/business/memInfo/mapper/MemInfoMapper.xml
+4
-0
OpmArticleMapper.xml
...es/mapper/business/opmArticle/mapper/OpmArticleMapper.xml
+14
-8
No files found.
src/main/java/org/rcisoft/business/cmsOrder/service/impl/CmsOrderServiceImpl.java
View file @
f6224073
...
...
@@ -119,7 +119,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
//增加操作
int
line
=
1
;
//添加实名判断
userUtil
.
checkUserAuth
(
"请先
进行
实名认证!"
);
userUtil
.
checkUserAuth
(
"请先实名认证!"
);
//加redis锁
boolean
isGetLock
=
false
;
RLock
lock
=
redissonClient
.
getLock
(
RedisCons
.
ACTIVITY_INFO
+
cmsOrder
.
getGoodsId
());
...
...
@@ -132,9 +132,9 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
if
(
detail
!=
null
){
CmsActivity
info
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
detail
),
CmsActivity
.
class
);
if
(
info
.
getEndTime
().
before
(
new
Date
()))
throw
new
CyServiceException
(
"活动已结束,不允许报名"
);
throw
new
CyServiceException
(
"活动已结束,不允许报名
!
"
);
if
(
info
.
getStartTime
().
before
(
new
Date
()))
throw
new
CyServiceException
(
"活动进行中,不允许报名"
);
throw
new
CyServiceException
(
"活动进行中,不允许报名
!
"
);
//判断人数是否强制
CmsOrder
orderInfo
=
new
CmsOrder
();
// if (info.getIsRestrictions().equals(0)){
...
...
@@ -209,7 +209,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
}
// return orderInfo;
}
else
throw
new
CyServiceException
(
"超出人数限制,报名失败"
);
throw
new
CyServiceException
(
"超出人数限制,报名失败
!
"
);
}
//初始化redis 活动数
...
...
src/main/java/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
View file @
f6224073
...
...
@@ -126,6 +126,13 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
*/
MemInfo
selectByOpenId
(
String
openId
);
/**
* 根据userId查询用户信息
* @param userId
* @return
*/
MemInfo
selectByUserId
(
String
userId
);
/**
* 关注
*/
...
...
src/main/java/org/rcisoft/business/memInfo/service/impl/MemInfoServiceImpl.java
View file @
f6224073
...
...
@@ -600,7 +600,8 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
update
(
MemInfo
memInfo
){
MemInfo
info
=
baseMapper
.
selectByOpenId
(
memInfo
.
getWxOpenid
());
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
info
=
baseMapper
.
selectByUserId
(
userId
);
//手机号、身份证存储加密
if
(
StringUtils
.
isNotBlank
(
memInfo
.
getMemPhone
()))
memInfo
.
setMemPhone
(
CyAESUtils
.
encrypt
(
memInfo
.
getMemPhone
()));
...
...
@@ -671,7 +672,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
//获取当前登录用户id
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
//添加实名判断
userUtil
.
checkUserAuth
(
"请先
进行
实名认证!"
);
userUtil
.
checkUserAuth
(
"请先实名认证!"
);
//获取当前日期 例2025/2/20 获取02和20 用来存redis
LocalDate
today
=
LocalDate
.
now
();
DateTimeFormatter
monthFormatter
=
DateTimeFormatter
.
ofPattern
(
"MM"
);
...
...
@@ -716,7 +717,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
Integer
payCount
=
Integer
.
valueOf
(
dictData4
.
getDictValue
());
MemInfo
memInfo
=
memInfoRepository
.
selectByOpenId
(
likeDTO
.
getWxOpenid
());
if
(
memInfo
.
getGoldCoinsCount
()
-
payCount
<
0
){
throw
new
CyServiceException
(
1003
,
"金币
余额
不足,请先充值"
);
throw
new
CyServiceException
(
1003
,
"金币不足,请先充值"
);
}
memInfo
.
setGoldCoinsCount
(
memInfo
.
getGoldCoinsCount
()
-
payCount
);
memInfoRepository
.
updateById
(
memInfo
);
...
...
@@ -824,11 +825,11 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
Integer
targetId
=
memUserTaskDTO
.
getTargetId
();
MemInfo
targetInfo
=
memInfoRepository
.
getUserInfo
(
String
.
valueOf
(
targetId
));
MemInfo
memInfo
=
memInfoRepository
.
selectByOpenId
(
memUserTaskDTO
.
getWxOpenid
());
if
(
StringUtils
.
isEmpty
(
targetInfo
.
getMemWxCode
())){
throw
new
CyServiceException
(
1005
,
"对方还未填写微信号,不能交换"
);
}
if
(
StringUtils
.
isEmpty
(
memInfo
.
getMemWxCode
())){
throw
new
CyServiceException
(
1006
,
"还未完善个人微信号,不能交换"
);
throw
new
CyServiceException
(
1006
,
"还未完善个人微信号,不能交换!"
);
}
if
(
StringUtils
.
isEmpty
(
targetInfo
.
getMemWxCode
())){
throw
new
CyServiceException
(
1005
,
"对方还未填写微信号,不能交换!"
);
}
Integer
createBy
=
Integer
.
valueOf
(
CyUserUtil
.
getAuthenBusinessId
());
memUserTaskDTO
.
setCreateBy
(
createBy
);
...
...
@@ -851,7 +852,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
if
(
isGetLock
)
{
//查询用户信息
if
(
memInfo
.
getGoldCoinsCount
()
-
acceptGoldCoinCount
<
0
){
throw
new
CyServiceException
(
1003
,
"金币
余额不足,请先充值
"
);
throw
new
CyServiceException
(
1003
,
"金币
不足,请先充值!
"
);
}
//添加索要微信任务
memUserTaskDTO
.
setStatus
(
"0"
);
...
...
@@ -862,7 +863,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
memGoldCoinFlow
.
setCount
(
acceptGoldCoinCount
);
memGoldCoinFlow
.
setEndCount
(
memInfo
.
getGoldCoinsCount
()
-
acceptGoldCoinCount
);
memGoldCoinFlow
.
setType
(
"2"
);
memGoldCoinFlow
.
setActionType
(
"2
4
"
);
memGoldCoinFlow
.
setActionType
(
"2
3
"
);
memGoldCoinFlowRepository
.
insert
(
memGoldCoinFlow
);
//修改用户金币数量
memInfo
.
setGoldCoinsCount
(
memInfo
.
getGoldCoinsCount
()
-
acceptGoldCoinCount
);
...
...
@@ -893,7 +894,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
if
(
isGetLock
)
{
//查询用户信息
if
(
memInfo
.
getGoldCoinsCount
()
-
requestGoldCoinCount
<
0
){
throw
new
CyServiceException
(
1003
,
"金币
余额不足,请先充值
"
);
throw
new
CyServiceException
(
1003
,
"金币
不足,请先充值!
"
);
}
//修改微信任务
line
=
baseMapper
.
updateWeChatTask
(
memUserTaskDTO
);
...
...
@@ -903,7 +904,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
memGoldCoinFlow
.
setCount
(
requestGoldCoinCount
);
memGoldCoinFlow
.
setEndCount
(
memInfo
.
getGoldCoinsCount
()
-
requestGoldCoinCount
);
memGoldCoinFlow
.
setType
(
"2"
);
memGoldCoinFlow
.
setActionType
(
"2
3
"
);
memGoldCoinFlow
.
setActionType
(
"2
4
"
);
memGoldCoinFlowRepository
.
insert
(
memGoldCoinFlow
);
//修改用户金币数量
memInfo
.
setGoldCoinsCount
(
memInfo
.
getGoldCoinsCount
()
-
requestGoldCoinCount
);
...
...
src/main/java/org/rcisoft/business/memLeaveMessage/service/impl/MemLeaveMessageServiceImpl.java
View file @
f6224073
...
...
@@ -87,7 +87,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
public
CyPersistModel
leaveMessage
(
MemLeaveMessage
memLeaveMessage
)
{
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
userUtil
.
checkUserAuth
(
"请先
进行
实名认证!"
);
userUtil
.
checkUserAuth
(
"请先实名认证!"
);
//获取当前日期 例2025/2/20 获取02和20
LocalDate
today
=
LocalDate
.
now
();
DateTimeFormatter
monthFormatter
=
DateTimeFormatter
.
ofPattern
(
"MM"
);
...
...
@@ -132,7 +132,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
Integer
payCount
=
Integer
.
valueOf
(
dictData4
.
getDictValue
());
MemInfo
memInfo
=
memInfoRepository
.
selectByOpenId
(
memLeaveMessage
.
getWxOpenid
());
if
(
memInfo
.
getGoldCoinsCount
()
-
payCount
<
0
){
throw
new
CyServiceException
(
1003
,
"金币
余额不足,请先充值
"
);
throw
new
CyServiceException
(
1003
,
"金币
不足,请先充值!
"
);
}
memInfo
.
setGoldCoinsCount
(
memInfo
.
getGoldCoinsCount
()
-
payCount
);
memInfoRepository
.
updateById
(
memInfo
);
...
...
@@ -155,7 +155,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
}
}
else
{
//不进行留言
throw
new
CyServiceException
(
1001
,
"今日
对该用户
留言次数已达上限,请明日再试!"
);
throw
new
CyServiceException
(
1001
,
"今日留言次数已达上限,请明日再试!"
);
}
}
//先插入到留言表
...
...
@@ -233,7 +233,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
}
return
new
CyPersistModel
(
line
);
}
else
{
throw
new
CyServiceException
(
1001
,
"今日
对该用户留言次数已达上限,请明日再试!
"
);
throw
new
CyServiceException
(
1001
,
"今日
留言次数已达上限,请明日再试!
"
);
}
}
else
if
(
redisLeaveMessageCountAll
==
null
){
//当天第一次进行留言
...
...
@@ -273,7 +273,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
return
new
CyPersistModel
(
line1
);
}
else
{
//超出总次数限制
throw
new
CyServiceException
(
1002
,
"今日留言次数已达上限,请明日再试
!
"
);
throw
new
CyServiceException
(
1002
,
"今日留言次数已达上限,请明日再试
!
"
);
}
}
...
...
src/main/java/org/rcisoft/business/opmArticle/entity/ArticleCommentDTO.java
View file @
f6224073
...
...
@@ -24,4 +24,8 @@ public class ArticleCommentDTO {
private
Integer
createBy
;
//修改人
private
Integer
updateBy
;
//审核状态 0未审核,1审核通过,2驳回,3自动驳回
private
String
examStatus
;
//备注
private
String
remarks
;
}
src/main/java/org/rcisoft/business/opmArticle/service/impl/OpmArticleServiceImpl.java
View file @
f6224073
...
...
@@ -89,7 +89,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
public
CyPersistModel
persist
(
OpmArticle
opmArticle
){
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
//1、实名判断
userUtil
.
checkUserAuth
(
"请先
进行实名认证
"
);
userUtil
.
checkUserAuth
(
"请先
实名认证!
"
);
//2、判断今日发布动态的数量限制
//获取当天时间 例2025/2/20 后获取0220
LocalDate
today
=
LocalDate
.
now
();
...
...
@@ -110,7 +110,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
Object
redisCount
=
cyRedisServiceImpl
.
get
(
OpmArticleRedisBean
.
USER_ARTICLE_COUNT
+
date
+
":"
+
userId
);
if
(
redisCount
!=
null
&&
(
int
)
redisCount
>=
publishCountAll
){
//超出最大数量
throw
new
CyServiceException
(
1001
,
"今日发布动态
总次数已达上限
"
);
throw
new
CyServiceException
(
1001
,
"今日发布动态
次数已达上限!
"
);
}
else
if
(
redisCount
==
null
){
//当天第一次发布动态
cyRedisServiceImpl
.
set
(
OpmArticleRedisBean
.
USER_ARTICLE_COUNT
+
date
+
":"
+
userId
,
1
,
48
*
60
*
60L
);
...
...
@@ -130,7 +130,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
if
(
isGetLock
)
{
MemInfo
memInfo
=
memInfoRepository
.
selectByOpenId
(
opmArticle
.
getWxOpenid
());
if
(
memInfo
.
getGoldCoinsCount
()
-
payCount
<
0
){
throw
new
CyServiceException
(
1003
,
"金币
余额不足,请先充值
"
);
throw
new
CyServiceException
(
1003
,
"金币
不足,请先充值!
"
);
}
memInfo
.
setGoldCoinsCount
(
memInfo
.
getGoldCoinsCount
()
-
payCount
);
memInfoRepository
.
updateById
(
memInfo
);
...
...
@@ -154,7 +154,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
}
}
else
{
//不进行发表动态
throw
new
CyServiceException
(
1002
,
"今日发表动态
免费次数超出限制
"
);
throw
new
CyServiceException
(
1002
,
"今日发表动态
次数已达上限!
"
);
}
}
else
{
//没超过免费次数限制
...
...
@@ -426,7 +426,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
public
CyPersistModel
likeAdd
(
Integer
articleId
,
String
praiseType
){
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
userUtil
.
checkUserAuth
(
"请先
进行
实名认证!"
);
userUtil
.
checkUserAuth
(
"请先实名认证!"
);
int
line
=
0
;
if
(
praiseType
.
equals
(
"praise"
)){
//点赞
...
...
@@ -460,7 +460,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
public
CyPersistModel
likeCommentAdd
(
Integer
commentId
,
String
praiseType
){
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
userUtil
.
checkUserAuth
(
"请先
进行
实名认证!"
);
userUtil
.
checkUserAuth
(
"请先实名认证!"
);
int
line
=
0
;
if
(
praiseType
.
equals
(
"praise"
)){
//点赞
...
...
@@ -490,10 +490,10 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
*/
@Override
public
CyPersistModel
addComment
(
ArticleCommentDTO
dto
)
{
//
添加
实名判断
//
1、
实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
userUtil
.
checkUserAuth
(
"请先
进行
实名认证!"
);
//校验 超过规定的时间不能评论 计算天数对应的秒数
userUtil
.
checkUserAuth
(
"请先实名认证!"
);
//
2、
校验 超过规定的时间不能评论 计算天数对应的秒数
List
<
DictData
>
articleConfig
=
dictionaryService
.
selectByTypes
(
"article_config"
);
DictData
dictData
=
articleConfig
.
stream
().
filter
(
item
->
item
.
getDictLabel
().
equals
(
"comment_limit_days"
)).
findFirst
().
orElse
(
null
);
Integer
limitDays
=
Integer
.
valueOf
(
dictData
.
getDictValue
());
...
...
@@ -516,8 +516,27 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
//校验通过 进行插入评论数据
//3、进行审核 从redis获取动态审核配置 0:自动审核,1:人工审核
List
<
DictData
>
sysConfig
=
dictionaryService
.
selectByTypes
(
"sys_config"
);
String
style
=
sysConfig
.
get
(
0
).
getDictValue
();
if
(
"0"
.
equals
(
style
))
{
//调用百度,自动审核
boolean
flag
=
true
;
List
<
String
>
msg
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
dto
.
getCommentContent
()))
{
CensorResult
result
=
contentCensorService
.
getCommonTextCensorResult
(
dto
.
getCommentContent
());
flag
=
result
.
getIsPass
();
if
(!
flag
)
msg
.
addAll
(
result
.
getErrorMsg
());
}
if
(
flag
)
dto
.
setExamStatus
(
"1"
);
else
{
dto
.
setExamStatus
(
"3"
);
dto
.
setRemarks
(
msg
.
toString
());
}
}
//4、校验通过 进行插入评论数据
dto
.
setCommentedUserId
(
Integer
.
valueOf
(
CyUserUtil
.
getAuthenBusinessId
()));
dto
.
setCreateDate
(
new
Date
());
dto
.
setUpdateDate
(
new
Date
());
...
...
src/main/resources/mapper/business/memInfo/mapper/MemInfoMapper.xml
View file @
f6224073
...
...
@@ -576,6 +576,10 @@
parameterType=
"java.lang.String"
>
select * from mem_info where wx_openid = #{openId} and del_flag = 0
</select>
<select
id=
"selectByUserId"
resultType=
"org.rcisoft.business.memInfo.entity.MemInfo"
parameterType=
"java.lang.String"
>
select * from mem_info where user_id = #{userId} and del_flag = 0
</select>
<select
id=
"getIsFollow"
resultType=
"org.rcisoft.business.memInfo.entity.MemFollowDTO"
parameterType=
"org.rcisoft.business.memInfo.entity.MemFollowDTO"
>
SELECT
COALESCE(
...
...
src/main/resources/mapper/business/opmArticle/mapper/OpmArticleMapper.xml
View file @
f6224073
...
...
@@ -381,18 +381,21 @@
mi.mem_code as memCode,
mi.mem_nick_name as memNickName,
mi.avatar as avatarId,
oi.url as avatarUrl,
CASE
WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0
END AS isLike
FROM opm_article_comment opc
LEFT JOIN mem_info mi ON mi.user_id = opc.create_by
left join oss_info oi on oi.business_id = mi.avatar
LEFT JOIN opm_article_like oal on oal.comment_id = opc.business_id and oal.user_id = #{loginUserId}
WHERE 1 = 1
AND opc.del_flag = '0'
AND opc.parent_id is null
AND opc.article_id = #{articleId}
AND opc.article_id = 6
AND NOT EXISTS (
SELECT 1 FROM opm_black_list obl
WHERE (obl.user_id = #{loginUserId} AND obl.target_id = opc.user_id)
OR (obl.user_id = opc.user_id AND obl.target_id = #{loginUserId})
)
</select>
<select
id=
"selectArticleChildrenComment"
resultType=
"org.rcisoft.business.opmArticle.entity.ArticleCommentVO"
>
SELECT
...
...
@@ -409,19 +412,22 @@
mi2.mem_code as commentedMemCode,
mi2.mem_nick_name as commentedMemNickName,
mi.avatar as avatarId,
oi.url as avatarUrl,
CASE
WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0
END AS isLike
FROM opm_article_comment opc
LEFT JOIN mem_info mi ON mi.user_id = opc.create_by
LEFT JOIN oss_info oi on oi.business_id = mi.avatar
LEFT JOIN mem_info mi2 ON mi2.user_id = opc.user_id
LEFT JOIN opm_article_like oal on oal.comment_id = opc.business_id and oal.user_id = #{loginUserId}
WHERE 1 = 1
AND opc.del_flag = '0'
AND opc.article_id = #{articleId}
and opc.parent_id = #{parentId}
AND NOT EXISTS (
SELECT 1 FROM opm_black_list obl
WHERE (obl.user_id = #{loginUserId} AND obl.target_id = opc.user_id)
OR (obl.user_id = opc.user_id AND obl.target_id = #{loginUserId})
)
</select>
<delete
id=
"deleteComment"
>
update opm_article_comment set del_flag = '1' where business_id = #{businessId}
...
...
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