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
4941682c
Commit
4941682c
authored
Feb 28, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了bug
parent
91793a47
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
413 additions
and
180 deletions
+413
-180
AppActivityController.java
...oft/app/appActivity/controller/AppActivityController.java
+14
-2
AppMemInfoController.java
...isoft/app/appMemInfo/controller/AppMemInfoController.java
+20
-5
AppOpmTopicController.java
...oft/app/appOpmTopic/controller/AppOpmTopicController.java
+1
-1
WxPayServiceImpl.java
...va/org/rcisoft/app/pay/service/impl/WxPayServiceImpl.java
+6
-5
CmsActivityController.java
...usiness/cmsActivity/controller/CmsActivityController.java
+1
-1
CmsActivityRepository.java
...isoft/business/cmsActivity/dao/CmsActivityRepository.java
+9
-2
CmsActivityService.java
...soft/business/cmsActivity/service/CmsActivityService.java
+6
-1
CmsActivityServiceImpl.java
...ness/cmsActivity/service/impl/CmsActivityServiceImpl.java
+49
-5
CmsOrderServiceImpl.java
...t/business/cmsOrder/service/impl/CmsOrderServiceImpl.java
+25
-21
MemInfoController.java
...cisoft/business/memInfo/controller/MemInfoController.java
+1
-1
MemInfoRepository.java
...a/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
+6
-1
MemInfo.java
...ain/java/org/rcisoft/business/memInfo/entity/MemInfo.java
+12
-0
MemInfoService.java
.../org/rcisoft/business/memInfo/service/MemInfoService.java
+9
-2
MemInfoServiceImpl.java
...oft/business/memInfo/service/impl/MemInfoServiceImpl.java
+69
-53
MemLeaveMessageServiceImpl.java
...LeaveMessage/service/impl/MemLeaveMessageServiceImpl.java
+7
-3
OpmArticleServiceImpl.java
...siness/opmArticle/service/impl/OpmArticleServiceImpl.java
+9
-13
OpmTopicController.java
...soft/business/opmTopic/controller/OpmTopicController.java
+1
-1
OpmTopicRepository.java
...org/rcisoft/business/opmTopic/dao/OpmTopicRepository.java
+8
-1
OpmTopicService.java
...rg/rcisoft/business/opmTopic/service/OpmTopicService.java
+1
-1
OpmTopicServiceImpl.java
...t/business/opmTopic/service/impl/OpmTopicServiceImpl.java
+6
-5
UserUtil.java
src/main/java/org/rcisoft/core/util/UserUtil.java
+27
-0
CmsActivityMapper.xml
.../mapper/business/cmsActivity.mapper/CmsActivityMapper.xml
+42
-1
MemInfoMapper.xml
...esources/mapper/business/memInfo/mapper/MemInfoMapper.xml
+39
-28
OpmTopicMapper.xml
...ources/mapper/business/opmTopic.mapper/OpmTopicMapper.xml
+45
-27
No files found.
src/main/java/org/rcisoft/app/appActivity/controller/AppActivityController.java
View file @
4941682c
...
...
@@ -50,12 +50,24 @@ public class AppActivityController extends CyPaginationController<CmsActivity> {
/**
* 活动-查看活动列表
*/
// @PreAuthorize("@cyPerm.hasPerm('app:activity:query')")
@CyOpeLogAnno
(
title
=
"system-活动管理-查询活动"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@Operation
(
summary
=
"分页查询活动集合"
,
description
=
"分页查询活动集合"
)
@GetMapping
(
value
=
"/open/cmsActivity/queryCmsActivityByPagination"
)
public
CyGridModel
listByPagination
(
CmsActivity
cmsActivity
)
{
cmsActivityServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
cmsActivity
);
cmsActivityServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
cmsActivity
,
"app"
);
return
getGridModelResponse
();
}
/**
* 活动-查询是否已报名
*/
@CyOpeLogAnno
(
title
=
"system-活动管理-查询是否已报名"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@Operation
(
summary
=
"查询是否已报名"
,
description
=
"查询是否已报名"
)
@GetMapping
(
value
=
"/cmsActivity/getActivityIsApplication"
)
public
CyResult
getActivityIsApplication
(
Integer
activityId
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
cmsActivityServiceImpl
.
getIsApplication
(
activityId
));
}
}
src/main/java/org/rcisoft/app/appMemInfo/controller/AppMemInfoController.java
View file @
4941682c
...
...
@@ -81,12 +81,12 @@ public class AppMemInfoController extends CyPaginationController<MemInfo> {
}
@CyOpeLogAnno
(
title
=
"system-会员表管理-查询
会员表
"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@Operation
(
summary
=
"查询
单一会员表"
,
description
=
"查询单一会员表
"
)
@CyOpeLogAnno
(
title
=
"system-会员表管理-查询
其他人的会员详情
"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@Operation
(
summary
=
"查询
其他人的会员详情"
,
description
=
"查询其他人的会员详情
"
)
@Parameters
({
@Parameter
(
name
=
"businessId"
,
description
=
"businessId"
,
required
=
true
,
schema
=
@Schema
(
type
=
"string"
))})
@GetMapping
(
"/memInfo/detail/{businessId:\\w+}"
)
public
CyResult
detail
(
@PathVariable
int
businessId
)
{
MemInfo
info
=
memInfoServiceImpl
.
findById
(
businessId
);
MemInfo
info
=
memInfoServiceImpl
.
findById
(
businessId
,
"app"
);
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
...
...
@@ -392,8 +392,8 @@ public class AppMemInfoController extends CyPaginationController<MemInfo> {
* 根据token查询user信息
*/
@PreAuthorize
(
"@cyPerm.hasPerm('app:mem:query')"
)
@CyOpeLogAnno
(
title
=
"system-查询用户详情-查询用户详情"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@Operation
(
summary
=
"查询
用户详情"
,
description
=
"查询
用户详情"
)
@CyOpeLogAnno
(
title
=
"system-查询用户详情-查询
登录人
用户详情"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@Operation
(
summary
=
"查询
登录人用户详情"
,
description
=
"查询登录人
用户详情"
)
@GetMapping
(
value
=
"/memInfo/getUserInfo"
)
public
CyResult
getUserInfo
()
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
...
...
@@ -402,4 +402,19 @@ public class AppMemInfoController extends CyPaginationController<MemInfo> {
memInfoServiceImpl
.
getUserInfo
());
}
/**
* 查询当前用户是否已被停用
*/
@PreAuthorize
(
"@cyPerm.hasPerm('app:mem:query')"
)
@CyOpeLogAnno
(
title
=
"system-查询用户停用状态-查询用户停用状态"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@Operation
(
summary
=
"查询用户停用状态"
,
description
=
"查询用户停用状态"
)
@GetMapping
(
value
=
"/memInfo/getUserIsStop"
)
public
CyResult
getUserIsStop
()
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
memInfoServiceImpl
.
getUserIsStop
());
}
}
src/main/java/org/rcisoft/app/appOpmTopic/controller/AppOpmTopicController.java
View file @
4941682c
...
...
@@ -36,6 +36,6 @@ public class AppOpmTopicController extends CyPaginationController<OpmTopic> {
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
opmTopicServiceImpl
.
findAll
(
opmTopic
));
opmTopicServiceImpl
.
findAll
(
opmTopic
,
"app"
));
}
}
src/main/java/org/rcisoft/app/pay/service/impl/WxPayServiceImpl.java
View file @
4941682c
...
...
@@ -11,6 +11,7 @@ import org.rcisoft.business.cmsOrder.dao.CmsOrderRepository;
import
org.rcisoft.business.cmsOrder.entity.CmsOrder
;
import
org.rcisoft.business.memInfo.dao.MemInfoRepository
;
import
org.rcisoft.business.memInfo.entity.MemInfo
;
import
org.rcisoft.business.memInfo.service.impl.MemInfoServiceImpl
;
import
org.rcisoft.core.exception.CyServiceException
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.rabbitmq.bean.RabbitMQConfigBean
;
...
...
@@ -77,7 +78,10 @@ public class WxPayServiceImpl implements WxPayService {
@Autowired
private
MemInfoRepository
memInfoRepository
;
@Autowired
private
MemInfoServiceImpl
memInfoServiceImpl
;
@Autowired
private
UserUtil
userUtil
;
@Value
(
"${wx.appId}"
)
private
String
appId
;
...
...
@@ -97,10 +101,7 @@ public class WxPayServiceImpl implements WxPayService {
@Override
public
JSONObject
wxPay
(
Long
orderId
,
Long
activityId
,
Integer
type
,
HttpServletRequest
request
)
throws
IOException
,
JDOMException
{
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
memInfo
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
memInfo
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
"您未实名认证,不能报名"
);
userUtil
.
checkUserAuth
(
"请先进行实名认证!"
);
JSONObject
json
=
new
JSONObject
();
// try{
//redis key: 【order:activity:${aid}:${oid}】 value 【hash】;status -> 待支付 ,可以进行支付
...
...
src/main/java/org/rcisoft/business/cmsActivity/controller/CmsActivityController.java
View file @
4941682c
...
...
@@ -106,7 +106,7 @@ public class CmsActivityController extends CyPaginationController<CmsActivity> {
@Operation
(
summary
=
"分页查询活动集合"
,
description
=
"分页查询活动集合"
)
@GetMapping
(
value
=
"/queryCmsActivityByPagination"
)
public
CyGridModel
listByPagination
(
CmsActivity
cmsActivity
)
{
cmsActivityServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
cmsActivity
);
cmsActivityServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
cmsActivity
,
"web"
);
return
getGridModelResponse
();
}
...
...
src/main/java/org/rcisoft/business/cmsActivity/dao/CmsActivityRepository.java
View file @
4941682c
...
...
@@ -19,10 +19,15 @@ public interface CmsActivityRepository extends CyBaseMapper<CmsActivity> {
List
<
CmsActivity
>
queryCmsActivity
(
@Param
(
"entity"
)
CmsActivity
cmsActivity
);
/**
* 分页查询 cmsActivity
*
web端-
分页查询 cmsActivity
*
*/
IPage
<
CmsActivity
>
queryCmsActivityPaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
CmsActivity
cmsActivity
);
/**
* app端-分页查询 cmsActivity
*
*/
IPage
<
CmsActivity
>
appQueryCmsActivityPaged
(
CyPageInfo
<
CmsActivity
>
paginationUtility
,
CmsActivity
cmsActivity
);
//根据id逻辑删除
int
deleteCmsActivity
(
@Param
(
"businessId"
)
Integer
businessId
);
//修改状态
...
...
@@ -30,7 +35,9 @@ public interface CmsActivityRepository extends CyBaseMapper<CmsActivity> {
//查询活动详情
CmsActivity
selectById
(
@Param
(
"businessId"
)
Integer
businessId
);
//权重验重
CmsActivity
checkWeight
(
@Param
(
"weight"
)
Integer
weight
);
CmsActivity
checkWeight
(
@Param
(
"weight"
)
Integer
weight
);
//查询当前用户是否已报名该活动
Integer
getIsApplication
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"activityId"
)
Integer
activityId
);
}
src/main/java/org/rcisoft/business/cmsActivity/service/CmsActivityService.java
View file @
4941682c
...
...
@@ -46,7 +46,7 @@ public interface CmsActivityService {
* @return
*/
IPage
<
CmsActivity
>
findAllByPagination
(
CyPageInfo
<
CmsActivity
>
paginationUtility
,
CmsActivity
cmsActivity
);
CmsActivity
cmsActivity
,
String
type
);
/**
...
...
@@ -74,4 +74,9 @@ public interface CmsActivityService {
* @return 结果
*/
CyPersistModel
pushActivityInfo
(
Integer
businessId
,
String
status
);
/**
* 查询当前用户是否已报名该活动
*/
String
getIsApplication
(
Integer
activityId
);
}
src/main/java/org/rcisoft/business/cmsActivity/service/impl/CmsActivityServiceImpl.java
View file @
4941682c
package
org
.
rcisoft
.
business
.
cmsActivity
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
...
@@ -8,10 +9,12 @@ import lombok.extern.slf4j.Slf4j;
import
org.rcisoft.business.cmsActivity.dao.CmsActivityRepository
;
import
org.rcisoft.business.cmsActivity.entity.CmsActivity
;
import
org.rcisoft.business.cmsActivity.service.CmsActivityService
;
import
org.rcisoft.business.cmsOrder.entity.CmsOrder
;
import
org.rcisoft.core.exception.CyServiceException
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.service.CyRedisService
;
import
org.rcisoft.core.service.impl.CyRedisServiceImpl
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.util.RedisCons
;
import
org.rcisoft.core.util.TimeUtil
;
...
...
@@ -123,10 +126,14 @@ public class CmsActivityServiceImpl extends ServiceImpl<CmsActivityRepository, C
*/
@Override
public
IPage
<
CmsActivity
>
findAllByPagination
(
CyPageInfo
<
CmsActivity
>
paginationUtility
,
CmsActivity
cmsActivity
)
{
CmsActivity
cmsActivity
,
String
type
)
{
if
(
type
.
equals
(
"app"
)){
IPage
<
CmsActivity
>
cmsActivityIPage
=
baseMapper
.
appQueryCmsActivityPaged
(
paginationUtility
,
cmsActivity
);
return
cmsActivityIPage
;
}
else
{
IPage
<
CmsActivity
>
cmsActivityIPage
=
baseMapper
.
queryCmsActivityPaged
(
paginationUtility
,
cmsActivity
);
return
cmsActivityIPage
;
}
}
/**
...
...
@@ -215,10 +222,47 @@ public class CmsActivityServiceImpl extends ServiceImpl<CmsActivityRepository, C
}
private
void
extracted
(
Integer
businessId
,
CmsActivity
info
)
{
Set
<
String
>
map
=
redisTemplate
.
keys
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
businessId
+
"*"
);
Set
<
String
>
map
=
redisTemplate
.
keys
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
businessId
+
"
:"
+
"
*"
);
if
(
CollectionUtils
.
isNotEmpty
(
map
))
//报名人数和实际剩余报名人数不等
throw
new
CyServiceException
(
"活动已经报名,不允许取消发布"
);
if
(
"0"
.
equals
(
info
.
getPublishStatus
()))
throw
new
CyServiceException
(
"活动未发布,不能取消"
);
}
/**
* 查询当前用户是否已报名该活动
*
* @param activityId
*/
@Override
public
String
getIsApplication
(
Integer
activityId
)
{
//先查redis 再查数据库
Set
<
String
>
map
=
redisTemplate
.
keys
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
activityId
+
":"
+
"*"
);
if
(
map
==
null
){
//再查数据库 免费的活动报名
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
Integer
isApplication
=
baseMapper
.
getIsApplication
(
userId
,
activityId
);
return
String
.
valueOf
(
isApplication
);
}
else
{
//遍历map
for
(
String
key
:
map
)
{
Object
obj
=
cyRedisServiceImpl
.
get
(
key
);
if
(
obj
!=
null
){
CmsOrder
order
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
obj
),
CmsOrder
.
class
);
if
(
order
.
getUserId
().
equals
(
Integer
.
valueOf
(
CyUserUtil
.
getAuthenBusinessId
()))){
//说明当前活动已报名
return
"1"
;
}
else
{
return
"0"
;
}
}
}
//走到这说明 redis中没有 查询数据库
//再查数据库 免费的活动报名
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
Integer
isApplication
=
baseMapper
.
getIsApplication
(
userId
,
activityId
);
return
String
.
valueOf
(
isApplication
);
}
}
}
src/main/java/org/rcisoft/business/cmsOrder/service/impl/CmsOrderServiceImpl.java
View file @
4941682c
...
...
@@ -17,6 +17,7 @@ import org.rcisoft.business.memGoldCoinFlow.dao.MemGoldCoinFlowRepository;
import
org.rcisoft.business.memGoldCoinFlow.entity.MemGoldCoinFlow
;
import
org.rcisoft.business.memInfo.dao.MemInfoRepository
;
import
org.rcisoft.business.memInfo.entity.MemInfo
;
import
org.rcisoft.business.memInfo.service.impl.MemInfoServiceImpl
;
import
org.rcisoft.business.sysScheduledTaskLog.entity.SysScheduledTaskLog
;
import
org.rcisoft.business.sysScheduledTaskLog.service.SysScheduledTaskLogService
;
import
org.rcisoft.core.async.AsyncFactory
;
...
...
@@ -103,7 +104,10 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
private
MemGoldCoinFlowRepository
memGoldCoinFlowRepository
;
@Autowired
private
SysScheduledTaskLogService
sysScheduledTaskLogServiceImpl
;
@Autowired
private
MemInfoServiceImpl
memInfoServiceImpl
;
@Autowired
private
UserUtil
userUtil
;
/**
* 保存 订单信息表
* @param cmsOrder
...
...
@@ -115,10 +119,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
//增加操作
int
line
=
1
;
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
memInfo
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
memInfo
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
"您未实名认证,不能报名"
);
userUtil
.
checkUserAuth
(
"请先进行实名认证!"
);
//加redis锁
boolean
isGetLock
=
false
;
RLock
lock
=
redissonClient
.
getLock
(
RedisCons
.
ACTIVITY_INFO
+
cmsOrder
.
getGoodsId
());
...
...
@@ -185,12 +186,6 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
//计算价格 -开始
if
(
info
.
getApplicationFee
()
!=
null
&&
info
.
getApplicationFee
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
calculatePrice
(
orderInfo
,
info
);
}
else
{
//免费 --> 支付完成
orderInfo
.
setPrice
(
BigDecimal
.
ZERO
);
orderInfo
.
setPayPrice
(
BigDecimal
.
ZERO
);
orderInfo
.
setStatus
(
9
);
orderInfo
.
setApplicationStatus
(
"1"
);
}
orderInfo
.
setType
(
0
);
orderInfo
.
setOrderTime
(
new
Date
());
orderInfo
.
setDelFlag
(
"0"
);
...
...
@@ -201,6 +196,17 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
// orderInfo.setStoreId(info.getSource());
// orderInfo.setActivityPrice(info.getApplicationFee());
cyRedisServiceImpl
.
set
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
orderInfo
.
getGoodsId
()
+
":"
+
orderId
,
orderInfo
);
}
else
{
//免费 --> 支付完成 不插入订单表 插入报名表
//添加报名信息
CmsApplication
application
=
new
CmsApplication
();
application
.
setUserId
(
Integer
.
valueOf
(
CyUserUtil
.
getAuthenBusinessId
()));
application
.
setActivityId
(
info
.
getBusinessId
());
application
.
setStatus
(
"1"
);
application
.
setApplicationFee
(
BigDecimal
.
ZERO
);
applicationRepository
.
insert
(
application
);
//设置价格
orderInfo
.
setPrice
(
BigDecimal
.
ZERO
);
}
// return orderInfo;
}
else
throw
new
CyServiceException
(
"超出人数限制,报名失败"
);
...
...
@@ -1898,9 +1904,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
int
line
=
1
;
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
memInfo
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
memInfo
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
"您未实名认证,不能充值"
);
userUtil
.
checkUserAuth
(
"请先进行实名认证!"
);
long
orderId
=
cyIdGenUtil
.
getSnowFlakedId
();
CmsOrder
orderInfo
=
new
CmsOrder
();
orderInfo
.
setBusinessId
(
orderId
);
...
...
src/main/java/org/rcisoft/business/memInfo/controller/MemInfoController.java
View file @
4941682c
...
...
@@ -110,7 +110,7 @@ public class MemInfoController extends CyPaginationController<MemInfo> {
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
memInfoServiceImpl
.
findById
(
businessId
));
memInfoServiceImpl
.
findById
(
businessId
,
"web"
));
}
@PreAuthorize
(
"@cyPerm.hasPerm('mem:info:list')"
)
...
...
src/main/java/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
View file @
4941682c
...
...
@@ -220,6 +220,11 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
/**
* 根据token获取用户信息
*/
UserInfoVO
getUserInfo
(
String
userId
);
MemInfo
getUserInfo
(
String
userId
);
/**
* 查询当前用户是否已被停用
*/
String
getUserIsStop
(
String
userId
);
}
src/main/java/org/rcisoft/business/memInfo/entity/MemInfo.java
View file @
4941682c
...
...
@@ -596,5 +596,17 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> {
*/
@TableField
(
exist
=
false
)
private
Integer
memSort
;
/**
* 会员id
*/
@TableField
(
exist
=
false
)
private
Integer
memberId
;
/**
* 微信昵称
*/
@TableField
(
exist
=
false
)
private
String
wxNickName
;
}
src/main/java/org/rcisoft/business/memInfo/service/MemInfoService.java
View file @
4941682c
...
...
@@ -45,7 +45,7 @@ public interface MemInfoService {
* @param id
* @return
*/
MemInfo
findById
(
int
id
);
MemInfo
findById
(
int
id
,
String
type
);
/**
* 分页查询 会员表
...
...
@@ -127,6 +127,13 @@ public interface MemInfoService {
*/
MemUserTaskDTO
queryWeChatTaskRecord
(
MemUserTaskDTO
memUserTaskDTO
);
/**
* 查询用户信息
*/
MemInfo
getUserInfo
();
UserInfoVO
getUserInfo
();
/**
* 查询当前用户是否已被禁用
*/
String
getUserIsStop
();
}
src/main/java/org/rcisoft/business/memInfo/service/impl/MemInfoServiceImpl.java
View file @
4941682c
...
...
@@ -98,7 +98,8 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
private
SysScheduledTaskLogService
sysScheduledTaskLogServiceImpl
;
@Autowired
private
RedissonClient
redissonClient
;
@Autowired
private
UserUtil
userUtil
;
@Value
(
"${cy.init.password}"
)
private
String
password
;
...
...
@@ -236,7 +237,8 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
* @return
*/
@Override
public
MemInfo
findById
(
int
id
){
public
MemInfo
findById
(
int
id
,
String
type
){
if
(
type
.
equals
(
"app"
)){
//获取当前登录人id
Integer
userId
=
Integer
.
valueOf
(
CyUserUtil
.
getAuthenBusinessId
());
//获取当天时间 例2025/2/20 后获取0220
...
...
@@ -273,6 +275,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
//排除当前登录人
if
(!
userId
.
equals
(
memInfo
.
getUserId
())){
cyRedisServiceImpl
.
hset
(
MemberInfoRedisBean
.
USER_LOOK_DETAIL_COUNT
+
date
+
":"
+
userId
,
String
.
valueOf
(
memInfo
.
getUserId
()),
1
);
cyRedisServiceImpl
.
expire
(
MemberInfoRedisBean
.
USER_LOOK_DETAIL_COUNT
+
date
+
":"
+
userId
,
48
*
60
*
60
);
// 24小时
}
//查询我喜欢的 喜欢我的 互相喜欢的数量
MemInfo
memInfo1
=
baseMapper
.
selectUserFollowCount
(
memInfo
.
getUserId
());
...
...
@@ -280,6 +283,10 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
memInfo
.
setMeFollowCount
(
memInfo1
.
getMeFollowCount
());
memInfo
.
setEachFollowCount
(
memInfo1
.
getEachFollowCount
());
return
memInfo
;
}
else
{
MemInfo
memInfo
=
baseMapper
.
selectDetailById
(
id
);
return
memInfo
;
}
}
/**
...
...
@@ -639,10 +646,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
@Override
public
MemFollowDTO
isFollow
(
MemFollowDTO
followDTO
){
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
memInfo
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
memInfo
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
"请先进行实名认证"
);
userUtil
.
checkUserAuth
(
"请先进行实名认证!"
);
return
baseMapper
.
getIsFollow
(
followDTO
);
}
/**
...
...
@@ -667,9 +671,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
//获取当前登录用户id
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
//添加实名判断
MemInfo
info
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
info
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
"请先进行实名认证"
);
userUtil
.
checkUserAuth
(
"请先进行实名认证!"
);
//获取当前日期 例2025/2/20 获取02和20
LocalDate
today
=
LocalDate
.
now
();
DateTimeFormatter
monthFormatter
=
DateTimeFormatter
.
ofPattern
(
"MM"
);
...
...
@@ -750,6 +752,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
//今日第一次对该用户进行点赞
cyRedisServiceImpl
.
hset
(
MemberInfoRedisBean
.
USER_LIKE
+
date
+
":"
+
userId
,
String
.
valueOf
(
likeDTO
.
getTargetId
()),
1L
);
this
.
redisTemplate
.
opsForValue
().
increment
(
MemberInfoRedisBean
.
USER_LIKE_ALL
+
date
+
":"
+
userId
,
(
long
)
1L
);
cyRedisServiceImpl
.
expire
(
MemberInfoRedisBean
.
USER_LIKE
+
date
+
":"
+
userId
,
48
*
60
*
60
);
// 24小时
//新增点赞数据
likeDTO
.
setUserId
(
Integer
.
valueOf
(
userId
));
likeDTO
.
setLikeCount
(
0
);
...
...
@@ -875,7 +878,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
public
CyPersistModel
weChatTask
(
MemUserTaskDTO
memUserTaskDTO
)
{
//校验对方是不是已经填了微信号
Integer
targetId
=
memUserTaskDTO
.
getTargetId
();
UserInfoVO
targetInfo
=
memInfoRepository
.
getUserInfo
(
String
.
valueOf
(
targetId
));
MemInfo
targetInfo
=
memInfoRepository
.
getUserInfo
(
String
.
valueOf
(
targetId
));
MemInfo
memInfo
=
memInfoRepository
.
selectByOpenId
(
memUserTaskDTO
.
getWxOpenid
());
if
(
StringUtils
.
isEmpty
(
targetInfo
.
getMemWxCode
())){
throw
new
CyServiceException
(
1005
,
"对方还未填写微信号,不能交换"
);
...
...
@@ -1027,9 +1030,22 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
}
@Override
public
UserInfoVO
getUserInfo
()
{
public
MemInfo
getUserInfo
()
{
//获取当前登录人id
Integer
userId
=
Integer
.
valueOf
(
CyUserUtil
.
getAuthenBusinessId
());
MemInfo
memInfo
=
baseMapper
.
getUserInfo
(
String
.
valueOf
(
userId
));
//查询我喜欢的 喜欢我的 互相喜欢的数量
MemInfo
memInfo1
=
baseMapper
.
selectUserFollowCount
(
memInfo
.
getUserId
());
memInfo
.
setFollowMeCount
(
memInfo1
.
getFollowMeCount
());
memInfo
.
setMeFollowCount
(
memInfo1
.
getMeFollowCount
());
memInfo
.
setEachFollowCount
(
memInfo1
.
getEachFollowCount
());
return
memInfo
;
}
@Override
public
String
getUserIsStop
()
{
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
UserInfoVO
userInfo
=
baseMapper
.
getUserInfo
(
userId
);
return
userInfo
;
String
isStop
=
baseMapper
.
getUserIsStop
(
userId
);
return
isStop
;
}
}
src/main/java/org/rcisoft/business/memLeaveMessage/service/impl/MemLeaveMessageServiceImpl.java
View file @
4941682c
...
...
@@ -7,6 +7,7 @@ import org.rcisoft.business.memGoldCoinFlow.dao.MemGoldCoinFlowRepository;
import
org.rcisoft.business.memGoldCoinFlow.entity.MemGoldCoinFlow
;
import
org.rcisoft.business.memInfo.dao.MemInfoRepository
;
import
org.rcisoft.business.memInfo.entity.MemInfo
;
import
org.rcisoft.business.memInfo.service.impl.MemInfoServiceImpl
;
import
org.rcisoft.business.memLeaveMessage.bean.MemLeaveMessageRedisBean
;
import
org.rcisoft.business.memLeaveMessage.dao.MemLeaveMessageRepository
;
import
org.rcisoft.business.memLeaveMessage.entity.*
;
...
...
@@ -18,6 +19,7 @@ import org.rcisoft.core.service.impl.CyRedisServiceImpl;
import
org.rcisoft.core.util.CyIdGenUtil
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.util.RedisCons
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.sys.dictionary.entity.DictData
;
import
org.rcisoft.sys.dictionary.service.impl.DictionaryServiceImpl
;
import
org.redisson.api.RLock
;
...
...
@@ -71,6 +73,10 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
@Autowired
private
RedissonClient
redissonClient
;
@Autowired
private
MemInfoServiceImpl
memInfoServiceImpl
;
@Autowired
private
UserUtil
userUtil
;
/**
* 留言
* @param memLeaveMessage
...
...
@@ -81,9 +87,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
public
CyPersistModel
leaveMessage
(
MemLeaveMessage
memLeaveMessage
)
{
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
info
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
info
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
"请先进行实名认证"
);
userUtil
.
checkUserAuth
(
"请先进行实名认证!"
);
//获取当前日期 例2025/2/20 获取02和20
LocalDate
today
=
LocalDate
.
now
();
DateTimeFormatter
monthFormatter
=
DateTimeFormatter
.
ofPattern
(
"MM"
);
...
...
src/main/java/org/rcisoft/business/opmArticle/service/impl/OpmArticleServiceImpl.java
View file @
4941682c
...
...
@@ -14,6 +14,7 @@ import org.rcisoft.business.memGoldCoinFlow.entity.MemGoldCoinFlow;
import
org.rcisoft.business.memInfo.bean.MemberInfoRedisBean
;
import
org.rcisoft.business.memInfo.dao.MemInfoRepository
;
import
org.rcisoft.business.memInfo.entity.MemInfo
;
import
org.rcisoft.business.memInfo.service.impl.MemInfoServiceImpl
;
import
org.rcisoft.business.opmArticle.bean.OpmArticleRedisBean
;
import
org.rcisoft.business.opmArticle.dao.OpmArticleRepository
;
import
org.rcisoft.business.opmArticle.entity.ArticleCommentDTO
;
...
...
@@ -28,6 +29,7 @@ import org.rcisoft.core.service.CyFileStorageService;
import
org.rcisoft.core.service.impl.CyRedisServiceImpl
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.util.TimeUtil
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.sys.dictionary.entity.DictData
;
import
org.rcisoft.sys.dictionary.service.DictionaryService
;
import
org.redisson.api.RLock
;
...
...
@@ -75,6 +77,8 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
private
StringRedisTemplate
redisTemplate
;
@Autowired
private
MemGoldCoinFlowRepository
memGoldCoinFlowRepository
;
@Autowired
private
UserUtil
userUtil
;
/**
* 保存 opmArticle管理
* @param opmArticle
...
...
@@ -83,11 +87,9 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
persist
(
OpmArticle
opmArticle
){
//1、实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
info
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
info
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
"请先进行实名认证"
);
//1、实名判断
userUtil
.
checkUserAuth
(
"请先进行实名认证"
);
//2、判断今日发布动态的数量限制
//获取当天时间 例2025/2/20 后获取0220
LocalDate
today
=
LocalDate
.
now
();
...
...
@@ -424,9 +426,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
public
CyPersistModel
likeAdd
(
Integer
articleId
,
String
praiseType
){
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
info
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
info
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
"请先进行实名认证"
);
userUtil
.
checkUserAuth
(
"请先进行实名认证!"
);
int
line
=
0
;
if
(
praiseType
.
equals
(
"praise"
)){
//点赞
...
...
@@ -460,9 +460,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
public
CyPersistModel
likeCommentAdd
(
Integer
commentId
,
String
praiseType
){
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
info
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
info
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
"请先进行实名认证"
);
userUtil
.
checkUserAuth
(
"请先进行实名认证!"
);
int
line
=
0
;
if
(
praiseType
.
equals
(
"praise"
)){
//点赞
...
...
@@ -494,9 +492,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
public
CyPersistModel
addComment
(
ArticleCommentDTO
dto
)
{
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
info
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
info
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
"请先进行实名认证"
);
userUtil
.
checkUserAuth
(
"请先进行实名认证!"
);
//校验 超过规定的时间不能评论 计算天数对应的秒数
List
<
DictData
>
articleConfig
=
dictionaryService
.
selectByTypes
(
"article_config"
);
DictData
dictData
=
articleConfig
.
stream
().
filter
(
item
->
item
.
getDictLabel
().
equals
(
"comment_limit_days"
)).
findFirst
().
orElse
(
null
);
...
...
src/main/java/org/rcisoft/business/opmTopic/controller/OpmTopicController.java
View file @
4941682c
...
...
@@ -97,7 +97,7 @@ public class OpmTopicController extends CyPaginationController<OpmTopic> {
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
opmTopicServiceImpl
.
findAll
(
opmTopic
));
opmTopicServiceImpl
.
findAll
(
opmTopic
,
"web"
));
}
@PreAuthorize
(
"@cyPerm.hasPerm('opm:topic:query')"
)
...
...
src/main/java/org/rcisoft/business/opmTopic/dao/OpmTopicRepository.java
View file @
4941682c
...
...
@@ -15,9 +15,16 @@ import java.util.List;
public
interface
OpmTopicRepository
extends
CyBaseMapper
<
OpmTopic
>
{
/**
* web端-查询所有话题
*/
List
<
OpmTopic
>
queryOpmTopic
(
@Param
(
"entity"
)
OpmTopic
opmTopic
);
/**
* app端-查询所有话题
*/
List
<
OpmTopic
>
appQueryOpmTopic
(
@Param
(
"entity"
)
OpmTopic
opmTopic
);
/**
* 分页查询 cmsActivity
*
...
...
src/main/java/org/rcisoft/business/opmTopic/service/OpmTopicService.java
View file @
4941682c
...
...
@@ -54,7 +54,7 @@ public interface OpmTopicService {
* @param opmTopic
* @return
*/
List
<
OpmTopic
>
findAll
(
OpmTopic
opmTopic
);
List
<
OpmTopic
>
findAll
(
OpmTopic
opmTopic
,
String
type
);
/**
...
...
src/main/java/org/rcisoft/business/opmTopic/service/impl/OpmTopicServiceImpl.java
View file @
4941682c
...
...
@@ -121,8 +121,6 @@ public class OpmTopicServiceImpl extends ServiceImpl<OpmTopicRepository, OpmTopi
public
IPage
<
OpmTopic
>
findAllByPagination
(
CyPageInfo
<
OpmTopic
>
paginationUtility
,
OpmTopic
opmTopic
)
{
IPage
<
OpmTopic
>
opmTopicIPage
=
baseMapper
.
queryOpmTopicPaged
(
paginationUtility
,
opmTopic
);
List
<
OpmTopic
>
newsInformation
=
opmTopicIPage
.
getRecords
();
opmTopicIPage
.
setRecords
(
newsInformation
);
return
opmTopicIPage
;
}
...
...
@@ -134,9 +132,12 @@ public class OpmTopicServiceImpl extends ServiceImpl<OpmTopicRepository, OpmTopi
* @return
*/
@Override
public
List
<
OpmTopic
>
findAll
(
OpmTopic
opmTopic
)
{
public
List
<
OpmTopic
>
findAll
(
OpmTopic
opmTopic
,
String
type
)
{
if
(
type
.
equals
(
"app"
)){
return
baseMapper
.
appQueryOpmTopic
(
opmTopic
);
}
else
{
return
baseMapper
.
queryOpmTopic
(
opmTopic
);
}
}
/**
...
...
src/main/java/org/rcisoft/core/util/UserUtil.java
0 → 100644
View file @
4941682c
package
org
.
rcisoft
.
core
.
util
;
import
jakarta.servlet.http.HttpServletRequest
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.business.memInfo.dao.MemInfoRepository
;
import
org.rcisoft.business.memInfo.entity.MemInfo
;
import
org.rcisoft.core.exception.CyServiceException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
import
java.util.Random
;
@Configuration
public
class
UserUtil
{
@Autowired
MemInfoRepository
memInfoRepository
;
/**
* 校验当前登录人是否已实名
*/
public
void
checkUserAuth
(
String
message
){
//添加实名判断
String
userId
=
CyUserUtil
.
getAuthenBusinessId
();
MemInfo
memInfo
=
memInfoRepository
.
getInfoByUserId
(
userId
);
if
(!
"1"
.
equals
(
memInfo
.
getMemRealAuthen
()))
throw
new
CyServiceException
(
message
);
}
}
src/main/resources/mapper/business/cmsActivity.mapper/CmsActivityMapper.xml
View file @
4941682c
...
...
@@ -181,7 +181,35 @@
and ca.publish_status = #{entity.publishStatus}
</if>
ORDER BY
ca.publish_date DESC
ca.is_top DESC,ca.is_recommended DESC,ca.weight DESC
</select>
<select
id=
"appQueryCmsActivityPaged"
resultMap=
"BaseResultMap"
>
SELECT
ca.business_id,
ca.is_top,
ca.is_recommended,
ca.weight,
ca.publish_date,
ca.create_by,
ca.create_date,
ca.title,
ca.picture_id,
ca.application_fee,
ca.publish_status,
ca.is_application,
ca.start_time,
ca.end_time,
ca.summary,
oi.url
FROM
cms_activity ca
LEFT JOIN oss_info oi ON ca.picture_id = oi.business_id
WHERE 1=1
and ca.del_flag = '0'
and ca.flag = '1'
and ca.publish_status = '1'
ORDER BY
ca.is_top DESC,ca.is_recommended DESC,ca.weight DESC
</select>
<update
id=
"deleteCmsActivity"
parameterType=
"java.lang.Integer"
>
update cms_activity
...
...
@@ -207,4 +235,17 @@
and del_flag = '0'
and weight = #{weight}
</select>
<select
id=
"getIsApplication"
resultType=
"java.lang.Integer"
>
SELECT
CASE
WHEN COUNT(ca.business_id) > 0 THEN 1
ELSE 0
END AS isApplication
FROM cms_application ca
WHERE ca.activity_id = #{activityId}
AND ca.user_id = #{userId}
AND ca.status = '1'
AND ca.flag = '1'
AND ca.del_flag = '0'
</select>
</mapper>
src/main/resources/mapper/business/memInfo/mapper/MemInfoMapper.xml
View file @
4941682c
...
...
@@ -439,29 +439,11 @@
select m.business_id,m.user_id,m.mem_code,m.mem_sex,m.mem_birthday,m.mem_constellation,m.mem_height,m.mem_weight,m.mem_max_education,
m.mem_college,m.mem_career,m.mem_year_income,m.mem_work_place,m.mem_residence_province,m.mem_residence_city,m.mem_native_province,
m.mem_native_city,m.mem_introduce,m.mem_hobby,m.mem_future_plan,m.mem_half_desire,m.mem_marriage,m.mem_marriage_remarks,
m.mem_mbti,m.mem_wx_code,m.mem_real_authen,m.mem_real_authen_date,m.mem_education_authen,m.mem_education_authen_date,m.mem_education_picture_id,m.mem_level,m.mem_level_begin_date,m.mem_level_end_date,
m.mem_code_level,m.flag,m.del_flag,m.create_by,m.create_date,m.update_by,m.update_date,m.remarks,m.mem_nation,m.wx_openid,m.avatar,
oi.url AS avatarUrl,m.sort,m.is_recommended,m.avatar_open,
m.mem_picture_id,m.mem_education_picture_id,
IFNULL(m.mem_nick_name, su.wx_nick_name) AS mem_nick_name,
GROUP_CONCAT( DISTINCT pic_urls.url ORDER BY pic_urls.business_id DESC SEPARATOR ',' ) AS pictureUrls,
oss.url AS educationPictureUrl,m.gold_coins_count
m.mem_mbti,m.mem_real_authen,m.mem_real_authen_date,m.mem_education_authen,m.mem_education_authen_date,m.mem_education_picture_id,m.mem_level,m.mem_level_begin_date,m.mem_level_end_date,
m.mem_code_level,m.flag,m.del_flag,m.create_by,m.create_date,m.update_by,m.update_date,m.remarks,m.mem_nation,m.avatar,
m.sort,m.is_recommended,m.avatar_open,
IFNULL(m.mem_nick_name, su.wx_nick_name) AS mem_nick_name
from mem_info m
LEFT JOIN oss_info oi on oi.business_id = m.avatar
LEFT JOIN (
SELECT
mem_info.business_id,
CAST( JSON_UNQUOTE( JSON_EXTRACT( mem_picture_id, CONCAT( '$.id[', jt_ids.idx - 1, ']' ))) AS UNSIGNED ) AS mem_picture_id
FROM
mem_info,
JSON_TABLE (
JSON_EXTRACT( mem_info.mem_picture_id, '$.id' ),
'$[*]' COLUMNS ( idx FOR ORDINALITY )) AS jt_ids
WHERE
mem_info.del_flag = '0'
) AS pic_ids ON m.business_id = pic_ids.business_id
LEFT JOIN oss_info pic_urls ON pic_ids.mem_picture_id = pic_urls.business_id
LEFT JOIN oss_info oss ON m.mem_education_picture_id = oss.business_id
LEFT JOIN sys_user su ON su.business_id = m.user_id
where m.business_id = #{businessId}
...
...
@@ -825,11 +807,40 @@
and target_id = #{userId}
and status = '0'
</select>
<select
id=
"getUserInfo"
resultType=
"org.rcisoft.business.memInfo.entity.UserInfoVO"
>
SELECT su.*,mi.business_id as memberId,mi.mem_wx_code as memWxCode
from sys_user su
LEFT JOIN mem_info mi ON mi.user_id = su.business_id
where 1=1
and su.business_id = #{userId}
<select
id=
"getUserInfo"
resultType=
"org.rcisoft.business.memInfo.entity.MemInfo"
>
select m.business_id as memberId,m.user_id as businessId,m.mem_code,m.mem_sex,m.mem_birthday,m.mem_constellation,m.mem_height,m.mem_weight,m.mem_max_education,
m.mem_college,m.mem_career,m.mem_year_income,m.mem_work_place,m.mem_residence_province,m.mem_residence_city,m.mem_native_province,
m.mem_native_city,m.mem_introduce,m.mem_hobby,m.mem_future_plan,m.mem_half_desire,m.mem_marriage,m.mem_marriage_remarks,
m.mem_mbti,m.mem_wx_code,m.mem_real_authen,m.mem_real_authen_date,m.mem_education_authen,m.mem_education_authen_date,m.mem_education_picture_id,m.mem_level,m.mem_level_begin_date,m.mem_level_end_date,
m.mem_code_level,m.flag,m.del_flag,m.create_by,m.create_date,m.update_by,m.update_date,m.remarks,m.mem_nation,m.wx_openid,m.avatar,
oi.url AS avatarUrl,m.sort,m.is_recommended,m.avatar_open,
m.mem_picture_id,m.mem_education_picture_id,su.wx_nick_name,
IFNULL(m.mem_nick_name, su.wx_nick_name) AS mem_nick_name,
GROUP_CONCAT( DISTINCT pic_urls.url ORDER BY pic_urls.business_id DESC SEPARATOR ',' ) AS pictureUrls,
oss.url AS educationPictureUrl,m.gold_coins_count
from mem_info m
LEFT JOIN oss_info oi on oi.business_id = m.avatar
LEFT JOIN (
SELECT
mem_info.business_id,
CAST( JSON_UNQUOTE( JSON_EXTRACT( mem_picture_id, CONCAT( '$.id[', jt_ids.idx - 1, ']' ))) AS UNSIGNED ) AS mem_picture_id
FROM
mem_info,
JSON_TABLE (
JSON_EXTRACT( mem_info.mem_picture_id, '$.id' ),
'$[*]' COLUMNS ( idx FOR ORDINALITY )) AS jt_ids
WHERE
mem_info.del_flag = '0'
) AS pic_ids ON m.business_id = pic_ids.business_id
LEFT JOIN oss_info pic_urls ON pic_ids.mem_picture_id = pic_urls.business_id
LEFT JOIN oss_info oss ON m.mem_education_picture_id = oss.business_id
LEFT JOIN sys_user su ON su.business_id = m.user_id
where m.user_id = #{userId}
</select>
<select
id=
"getUserIsStop"
resultType=
"java.lang.String"
>
SELECT su.flag
FROM sys_user su
WHERE 1=1
AND su.business_id = #{userId}
</select>
</mapper>
src/main/resources/mapper/business/opmTopic.mapper/OpmTopicMapper.xml
View file @
4941682c
...
...
@@ -63,6 +63,24 @@
ORDER BY cn.exam_status,cn.weight,cn.business_id DESC
</select>
<select
id=
"appQueryOpmTopic"
resultMap=
"BaseResultMap"
>
SELECT cn.business_id,
cn.create_by,
cn.create_date,
cn.update_by,
cn.del_flag,
cn.flag,
cn.topic_name,
cn.exam_status,
cn.weight,
cn.article_count
FROM opm_topic cn
where 1=1
and cn.del_flag = '0'
and cn.flag = '1'
ORDER BY cn.weight DESC
</select>
<select
id=
"queryOpmTopicPaged"
resultMap=
"BaseResultMap"
>
SELECT cn.business_id,
cn.create_by,
...
...
@@ -77,7 +95,8 @@
su.nick_name as nickName
FROM opm_topic cn
LEFT JOIN sys_user su on su.business_id = cn.create_by
where cn.del_flag='0'
where 1=1
and cn.del_flag='0'
<if
test=
"entity.flag!=null and entity.flag != '' "
>
and cn.flag = #{entity.flag}
</if>
...
...
@@ -99,14 +118,13 @@
<if
test=
"entity.weight !=null and entity.weight != '' "
>
and weight like concat('%',#{entity.weight},'%')
</if>
<if
test=
"entity.articleCount !=null and entity.articleCount != '' "
>
and article_count like concat('%',#{entity.articleCount},'%')
</if>
<if
test=
"entity.topicName !=null and entity.topicName != '' "
>
and topic_name like concat('%',#{entity.topicName},'%')
</if>
ORDER BY cn.exam_status
,cn.weight,cn.business_id
DESC
ORDER BY cn.exam_status
ASC,cn.weight DESC,cn.article_count
DESC
</select>
<update
id=
"deleteOpmTopic"
parameterType=
"java.lang.Integer"
>
update opm_topic
...
...
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