Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
safe-campus-bbs
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
万成波
safe-campus-bbs
Commits
00126d0e
Commit
00126d0e
authored
Sep 19, 2025
by
万成波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复Bug
parent
94215a4d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
6 deletions
+66
-6
safe-campus-moment/src/main/resources/mapper/BbsMomentCommentMapper.xml
...ment/src/main/resources/mapper/BbsMomentCommentMapper.xml
+1
-1
safe-campus-moment/src/main/resources/mapper/BbsMomentMapper.xml
...mpus-moment/src/main/resources/mapper/BbsMomentMapper.xml
+2
-2
safe-campus-points/src/main/java/com/tangguo/controller/BbsPointsSettingController.java
...va/com/tangguo/controller/BbsPointsSettingController.java
+22
-1
safe-campus-points/src/main/java/com/tangguo/domain/BbsUserPoints.java
...oints/src/main/java/com/tangguo/domain/BbsUserPoints.java
+6
-0
safe-campus-points/src/main/java/com/tangguo/service/IBbsPointsSettingService.java
...in/java/com/tangguo/service/IBbsPointsSettingService.java
+8
-0
safe-campus-points/src/main/java/com/tangguo/service/impl/BbsPointsSettingServiceImpl.java
...com/tangguo/service/impl/BbsPointsSettingServiceImpl.java
+23
-0
safe-campus-points/src/main/java/com/tangguo/service/impl/BbsUserPointsServiceImpl.java
...va/com/tangguo/service/impl/BbsUserPointsServiceImpl.java
+4
-2
No files found.
safe-campus-moment/src/main/resources/mapper/BbsMomentCommentMapper.xml
View file @
00126d0e
...
...
@@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
c.parent_id IS NULL
</if>
<if
test=
"comment.momentContent != null and comment.momentContent != ''"
>
AND
m
.content LIKE CONCAT('%', #{comment.momentContent}, '%')
AND
c
.content LIKE CONCAT('%', #{comment.momentContent}, '%')
</if>
<if
test=
"comment.nickName != null and comment.nickName != ''"
>
AND c.nick_name LIKE CONCAT('%', #{comment.nickName}, '%')
...
...
safe-campus-moment/src/main/resources/mapper/BbsMomentMapper.xml
View file @
00126d0e
...
...
@@ -20,10 +20,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
m.content LIKE CONCAT('%', #{moment.content}, '%')
</if>
<if
test=
"moment.params.startTime != null and moment.params.startTime != ''"
>
AND DATE_FORMAT(create_time, '%Y-%m-%d') >= #{moment.params.startTime}
AND DATE_FORMAT(
m.
create_time, '%Y-%m-%d') >= #{moment.params.startTime}
</if>
<if
test=
"moment.params.endTime != null and moment.params.endTime != ''"
>
AND DATE_FORMAT(create_time, '%Y-%m-%d')
<
= #{moment.params.endTime}
AND DATE_FORMAT(
m.
create_time, '%Y-%m-%d')
<
= #{moment.params.endTime}
</if>
</where>
ORDER BY
...
...
safe-campus-points/src/main/java/com/tangguo/controller/BbsPointsSettingController.java
View file @
00126d0e
...
...
@@ -5,6 +5,7 @@ import com.tangguo.common.core.controller.BaseController;
import
com.tangguo.common.core.domain.AjaxResult
;
import
com.tangguo.common.enums.BusinessType
;
import
com.tangguo.domain.BbsPointsSetting
;
import
com.tangguo.enums.PointsSettingType
;
import
com.tangguo.service.IBbsPointsSettingService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -12,6 +13,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -72,13 +74,32 @@ public class BbsPointsSettingController extends BaseController {
@ApiOperation
(
"修改积分规则配置"
)
@PreAuthorize
(
"@ss.hasPermi('points:points:edit')"
)
@Log
(
title
=
"积分规则配置"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
(
"/status"
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
BbsPointsSetting
setting
)
{
this
.
bbsPointsSettingService
.
editSetting
(
setting
);
return
AjaxResult
.
success
();
}
/**
* 修改积分规则配置
*/
@ApiOperation
(
"修改积分规则配置"
)
@PreAuthorize
(
"@ss.hasPermi('points:points:edit')"
)
@Log
(
title
=
"积分规则配置"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
(
"/batch"
)
public
AjaxResult
batchEdit
(
@RequestBody
Map
<
String
,
List
<
BbsPointsSetting
>>
pointMap
)
{
List
<
BbsPointsSetting
>
adds
=
pointMap
.
get
(
PointsSettingType
.
ADD
.
name
());
List
<
BbsPointsSetting
>
decs
=
pointMap
.
get
(
PointsSettingType
.
DEC
.
name
());
List
<
BbsPointsSetting
>
upds
=
new
ArrayList
<>(
15
);
upds
.
addAll
(
adds
);
upds
.
addAll
(
decs
);
this
.
bbsPointsSettingService
.
batchEditSetting
(
upds
);
return
AjaxResult
.
success
();
}
/**
* 删除积分规则配置
*/
...
...
safe-campus-points/src/main/java/com/tangguo/domain/BbsUserPoints.java
View file @
00126d0e
...
...
@@ -98,4 +98,10 @@ public class BbsUserPoints extends BaseEntity {
@TableField
(
exist
=
false
)
private
Integer
incrOrDecrPoints
;
/**
* 备注
*/
@TableField
(
exist
=
false
)
private
String
remarks
;
}
safe-campus-points/src/main/java/com/tangguo/service/IBbsPointsSettingService.java
View file @
00126d0e
...
...
@@ -56,6 +56,14 @@ public interface IBbsPointsSettingService extends IService<BbsPointsSetting> {
void
editSetting
(
BbsPointsSetting
setting
);
/**
* 修改积分配置
*
* @param settings 积分配置
*/
void
batchEditSetting
(
List
<
BbsPointsSetting
>
settings
);
/**
* 删除积分配置
*
...
...
safe-campus-points/src/main/java/com/tangguo/service/impl/BbsPointsSettingServiceImpl.java
View file @
00126d0e
...
...
@@ -14,6 +14,7 @@ import com.tangguo.service.IBbsPointsSettingService;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
...
...
@@ -158,6 +159,28 @@ public class BbsPointsSettingServiceImpl extends ServiceImpl<BbsPointsSettingMap
}
/**
* 修改积分配置
*
* @param settings 积分配置
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
batchEditSetting
(
List
<
BbsPointsSetting
>
settings
)
{
List
<
BbsPointsSetting
>
updSettings
=
new
ArrayList
<>(
settings
.
size
());
for
(
BbsPointsSetting
setting
:
settings
)
{
BbsPointsSetting
updSetting
=
new
BbsPointsSetting
();
updSetting
.
setId
(
setting
.
getId
());
updSetting
.
setOperatePoints
(
setting
.
getOperatePoints
());
updSetting
.
setLimitCount
(
setting
.
getLimitCount
());
updSetting
.
setEnableStatus
(
setting
.
getEnableStatus
());
updSettings
.
add
(
updSetting
);
}
this
.
updateBatchById
(
updSettings
);
this
.
initCachePointsSetting
();
}
/**
* 删除积分配置
*
...
...
safe-campus-points/src/main/java/com/tangguo/service/impl/BbsUserPointsServiceImpl.java
View file @
00126d0e
...
...
@@ -128,7 +128,8 @@ public class BbsUserPointsServiceImpl extends ServiceImpl<BbsUserPointsMapper, B
detail
.
setUserName
(
userName
);
detail
.
setDetailPoints
(
points
.
getIncrOrDecrPoints
());
detail
.
setDetailName
(
"后台手动增加"
);
detail
.
setDescription
(
String
.
format
(
"管理员【%s】后台手动增加用户【%s】积分"
,
SecurityUtils
.
getUsername
(),
userName
));
// detail.setDescription(String.format("管理员【%s】后台手动增加用户【%s】积分", SecurityUtils.getUsername(), userName));
detail
.
setDescription
(
points
.
getRemarks
());
this
.
incrUserPoints
(
detail
);
}
...
...
@@ -146,7 +147,8 @@ public class BbsUserPointsServiceImpl extends ServiceImpl<BbsUserPointsMapper, B
detail
.
setUserName
(
userName
);
detail
.
setDetailPoints
(
points
.
getIncrOrDecrPoints
());
detail
.
setDetailName
(
"后台手动扣减"
);
detail
.
setDescription
(
String
.
format
(
"管理员【%s】后台手动扣减用户【%s】积分"
,
SecurityUtils
.
getUsername
(),
userName
));
// detail.setDescription(String.format("管理员【%s】后台手动扣减用户【%s】积分", SecurityUtils.getUsername(), userName));
detail
.
setDescription
(
points
.
getRemarks
());
this
.
decrUserPoints
(
detail
);
}
...
...
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