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
3f3e4518
Commit
3f3e4518
authored
Jan 16, 2025
by
gaoyingwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 发布活动
parent
aa4491e7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
12 deletions
+14
-12
CmsActivityController.java
...usiness/cmsActivity/controller/CmsActivityController.java
+1
-1
CmsActivityService.java
...soft/business/cmsActivity/service/CmsActivityService.java
+1
-1
CmsActivityServiceImpl.java
...ness/cmsActivity/service/impl/CmsActivityServiceImpl.java
+7
-5
CmsOrderServiceImpl.java
...t/business/cmsOrder/service/impl/CmsOrderServiceImpl.java
+4
-4
OrderSyncSchedule.java
...ain/java/org/rcisoft/core/schedule/OrderSyncSchedule.java
+1
-1
No files found.
src/main/java/org/rcisoft/business/cmsActivity/controller/CmsActivityController.java
View file @
3f3e4518
...
...
@@ -148,7 +148,7 @@ public class CmsActivityController extends CyPaginationController<CmsActivity> {
@CyOpeLogAnno
(
title
=
"system-活动管理-发布/取消活动"
,
businessType
=
CyLogTypeEnum
.
UPDATE
)
@Operation
(
summary
=
"发布/取消活动"
,
description
=
"发布/取消活动"
)
@PutMapping
(
"/pushActivityInfo"
)
public
CyResult
pushActivityInfo
(
@RequestParam
Long
businessId
,
@RequestParam
String
status
)
{
public
CyResult
pushActivityInfo
(
@RequestParam
Integer
businessId
,
@RequestParam
String
status
)
{
CyPersistModel
data
=
cmsActivityServiceImpl
.
pushActivityInfo
(
businessId
,
status
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
...
...
src/main/java/org/rcisoft/business/cmsActivity/service/CmsActivityService.java
View file @
3f3e4518
...
...
@@ -73,5 +73,5 @@ public interface CmsActivityService {
*
* @return 结果
*/
CyPersistModel
pushActivityInfo
(
Long
businessId
,
String
status
);
CyPersistModel
pushActivityInfo
(
Integer
businessId
,
String
status
);
}
src/main/java/org/rcisoft/business/cmsActivity/service/impl/CmsActivityServiceImpl.java
View file @
3f3e4518
...
...
@@ -170,9 +170,9 @@ public class CmsActivityServiceImpl extends ServiceImpl<CmsActivityRepository, C
*
* @return 结果
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Transactional
@Override
public
CyPersistModel
pushActivityInfo
(
Long
businessId
,
String
status
)
public
CyPersistModel
pushActivityInfo
(
Integer
businessId
,
String
status
)
{
CmsActivity
info
=
baseMapper
.
selectById
(
businessId
);
int
line
=
0
;
...
...
@@ -180,6 +180,8 @@ public class CmsActivityServiceImpl extends ServiceImpl<CmsActivityRepository, C
if
(
"1"
.
equals
(
status
)){
if
(
"1"
.
equals
(
info
.
getPublishStatus
()))
throw
new
CyServiceException
(
"活动不是未发布状态,不能发布"
);
if
(
new
Date
().
after
(
info
.
getEndTime
()))
throw
new
CyServiceException
(
"活动已结束,不能发布"
);
info
.
setUpdateDate
(
new
Date
());
info
.
setUpdateBy
(
CyUserUtil
.
getAuthenBusinessId
());
info
.
setPublishDate
(
new
Date
());
...
...
@@ -204,8 +206,8 @@ public class CmsActivityServiceImpl extends ServiceImpl<CmsActivityRepository, C
info
.
setUpdateBy
(
CyUserUtil
.
getAuthenBusinessId
());
info
.
setPublishStatus
(
status
);
line
=
baseMapper
.
updateById
(
info
);
cyRedisServiceImpl
.
del
(
RedisCons
.
ACTIVITY_DETAIL
+
":"
+
businessId
);
cyRedisServiceImpl
.
del
(
RedisCons
.
ACTIVITY_COUNT
+
":"
+
businessId
);
redisTemplate
.
delete
(
RedisCons
.
ACTIVITY_DETAIL
+
":"
+
businessId
);
redisTemplate
.
delete
(
RedisCons
.
ACTIVITY_COUNT
+
":"
+
businessId
);
}
}
catch
(
InterruptedException
e
)
{
Thread
.
currentThread
().
interrupt
();
...
...
@@ -218,7 +220,7 @@ public class CmsActivityServiceImpl extends ServiceImpl<CmsActivityRepository, C
return
new
CyPersistModel
(
line
);
}
private
void
extracted
(
Long
businessId
,
CmsActivity
info
)
{
private
void
extracted
(
Integer
businessId
,
CmsActivity
info
)
{
Set
<
String
>
map
=
redisTemplate
.
keys
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
businessId
+
"*"
);
if
(
CollectionUtils
.
isNotEmpty
(
map
))
//报名人数和实际剩余报名人数不等
throw
new
CyServiceException
(
"活动已经报名,不允许取消发布"
);
...
...
src/main/java/org/rcisoft/business/cmsOrder/service/impl/CmsOrderServiceImpl.java
View file @
3f3e4518
...
...
@@ -855,7 +855,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
Long
.
parseLong
(
RedisCons
.
ORDER_INFO_LOCK_LEASE_TIME
),
TimeUnit
.
SECONDS
);
if
(
isGetLock
)
{
//del redis key: 【order:activity:${aid}:${oid}】
cyRedisServiceImpl
.
del
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
orderDetail
.
getGoodsId
()
+
":"
+
orderDetail
.
getBusinessId
());
redisTemplate
.
delete
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
orderDetail
.
getGoodsId
()
+
":"
+
orderDetail
.
getBusinessId
());
}
}
catch
(
InterruptedException
e
)
{
Thread
.
currentThread
().
interrupt
();
...
...
@@ -894,7 +894,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
Long
.
parseLong
(
RedisCons
.
ORDER_INFO_LOCK_LEASE_TIME
),
TimeUnit
.
SECONDS
);
if
(
isGetLock
)
{
//del redis key: 【order:activity:${aid}:${oid}】
cyRedisServiceImpl
.
del
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
orderDetail
.
getGoodsId
()
+
":"
+
orderDetail
.
getBusinessId
());
redisTemplate
.
delete
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
orderDetail
.
getGoodsId
()
+
":"
+
orderDetail
.
getBusinessId
());
}
}
catch
(
InterruptedException
e
)
{
Thread
.
currentThread
().
interrupt
();
...
...
@@ -924,7 +924,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
Long
.
parseLong
(
RedisCons
.
ORDER_INFO_LOCK_LEASE_TIME
),
TimeUnit
.
SECONDS
);
if
(
isGetLock
)
{
//del redis key: 【order:activity:${aid}:${oid}】
cyRedisServiceImpl
.
del
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
orderDetail
.
getGoodsId
()
+
":"
+
orderDetail
.
getBusinessId
());
redisTemplate
.
delete
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
orderDetail
.
getGoodsId
()
+
":"
+
orderDetail
.
getBusinessId
());
}
}
catch
(
InterruptedException
e
)
{
Thread
.
currentThread
().
interrupt
();
...
...
@@ -970,7 +970,7 @@ public class CmsOrderServiceImpl extends ServiceImpl<CmsOrderRepository,CmsOrder
Long
.
parseLong
(
RedisCons
.
ORDER_INFO_LOCK_LEASE_TIME
),
TimeUnit
.
SECONDS
);
if
(
isGetLock
)
{
//del redis key: 【order:activity:${aid}:${oid}】
cyRedisServiceImpl
.
del
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
orderDetail
.
getGoodsId
()
+
":"
+
orderDetail
.
getBusinessId
());
redisTemplate
.
delete
(
RedisCons
.
ORDER_ACTIVITY
+
":"
+
orderDetail
.
getGoodsId
()
+
":"
+
orderDetail
.
getBusinessId
());
}
}
catch
(
InterruptedException
e
)
{
Thread
.
currentThread
().
interrupt
();
...
...
src/main/java/org/rcisoft/core/schedule/OrderSyncSchedule.java
View file @
3f3e4518
...
...
@@ -624,7 +624,7 @@ public class OrderSyncSchedule {
CmsOrder
orderDetail
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
detail
),
CmsOrder
.
class
);
//state->已同步 => del key
if
(
Objects
.
equals
(
orderDetail
.
getState
(),
1
))
cyRedisServiceImpl
.
del
(
key
);
redisTemplate
.
delete
(
key
);
}
}
}
...
...
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