记得上下班打卡 | 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
547a10be
Commit
547a10be
authored
Feb 21, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~JOB:商城:商铺活动开启关闭;
parent
da6daf38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
32 deletions
+31
-32
PlatformGoblinStoreCouponService.java
...service/impl/goblin/PlatformGoblinStoreCouponService.java
+31
-32
No files found.
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/goblin/PlatformGoblinStoreCouponService.java
View file @
547a10be
...
...
@@ -4,15 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.common.cache.redis.util.AbstractRedisUtil
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.dto.GoblinStoreMarketDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponBasicVo
;
import
com.liquidnet.service.goblin.entity.GoblinStoreCoupon
;
import
com.liquidnet.service.goblin.mapper.GoblinGoodsSkuMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinStoreCouponMapper
;
import
com.liquidnet.service.platform.utils.GoblinRedisUtils
;
import
com.mongodb.client.result.UpdateResult
;
...
...
@@ -45,20 +41,22 @@ public class PlatformGoblinStoreCouponService extends ServiceImpl<GoblinStoreCou
queryWrapper
.
eq
(
GoblinStoreCoupon:
:
getState
,
"0"
);
queryWrapper
.
le
(
GoblinStoreCoupon:
:
getStartTime
,
now
);
List
<
GoblinStoreCoupon
>
storeCouponList
=
this
.
list
(
queryWrapper
);
if
(!
CollectionUtils
.
isEmpty
(
storeCouponList
))
{
List
<
String
>
storeCouponIdList
=
storeCouponList
.
stream
().
map
(
GoblinStoreCoupon:
:
getStoreCouponId
).
collect
(
Collectors
.
toList
());
List
<
GoblinStoreCoupon
>
storeCouponList
=
null
;
try
{
storeCouponList
=
this
.
list
(
queryWrapper
);
if
(!
CollectionUtils
.
isEmpty
(
storeCouponList
))
{
List
<
String
>
storeCouponIdList
=
storeCouponList
.
stream
().
map
(
GoblinStoreCoupon:
:
getStoreCouponId
).
collect
(
Collectors
.
toList
());
LambdaUpdateWrapper
<
GoblinStoreCoupon
>
updateWrapper
=
Wrappers
.
lambdaUpdate
(
GoblinStoreCoupon
.
class
);
updateWrapper
.
eq
(
GoblinStoreCoupon:
:
getDelFlg
,
"0"
);
updateWrapper
.
eq
(
GoblinStoreCoupon:
:
getState
,
"0"
);
updateWrapper
.
in
(
GoblinStoreCoupon:
:
getStoreCouponId
,
storeCouponIdList
);
LambdaUpdateWrapper
<
GoblinStoreCoupon
>
updateWrapper
=
Wrappers
.
lambdaUpdate
(
GoblinStoreCoupon
.
class
);
updateWrapper
.
eq
(
GoblinStoreCoupon:
:
getDelFlg
,
"0"
);
updateWrapper
.
eq
(
GoblinStoreCoupon:
:
getState
,
"0"
);
updateWrapper
.
in
(
GoblinStoreCoupon:
:
getStoreCouponId
,
storeCouponIdList
);
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getState
,
"1"
);
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getUpdatedAt
,
now
);
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getUpdatedBy
,
"task"
);
if
(
this
.
update
(
updateWrapper
))
{
try
{
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getState
,
"1"
);
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getUpdatedAt
,
now
);
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getUpdatedBy
,
"task"
);
if
(
this
.
update
(
updateWrapper
))
{
UpdateResult
updateResult
=
mongoTemplate
.
getCollection
(
GoblinStoreCouponBasicVo
.
class
.
getSimpleName
()).
updateMany
(
Query
.
query
(
Criteria
.
where
(
"delFlg"
).
is
(
"0"
).
and
(
"state"
).
is
(
"0"
).
and
(
"storeCouponId"
).
in
(
storeCouponIdList
)).
getQueryObject
(),
Update
.
update
(
"state"
,
"1"
).
set
(
"updatedAt"
,
now
).
set
(
"updatedBy"
,
"task"
).
getUpdateObject
()
...
...
@@ -77,10 +75,10 @@ public class PlatformGoblinStoreCouponService extends ServiceImpl<GoblinStoreCou
});
return
storeCouponList
.
size
();
}
}
catch
(
Exception
e
)
{
log
.
error
(
"###商铺活动:优惠券处理异常[now={},storeCouponList={}]"
,
now
,
JsonUtils
.
toJson
(
storeCouponIdList
),
e
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"###商铺活动:优惠券处理异常[now={},storeCouponList.size={}]"
,
now
,
null
==
storeCouponList
?
-
1
:
storeCouponList
.
size
(),
e
);
}
return
0
;
}
...
...
@@ -91,20 +89,21 @@ public class PlatformGoblinStoreCouponService extends ServiceImpl<GoblinStoreCou
queryWrapper
.
eq
(
GoblinStoreCoupon:
:
getState
,
"1"
);
queryWrapper
.
le
(
GoblinStoreCoupon:
:
getEndTime
,
now
);
List
<
GoblinStoreCoupon
>
storeCouponList
=
this
.
list
(
queryWrapper
);
if
(!
CollectionUtils
.
isEmpty
(
storeCouponList
))
{
List
<
String
>
storeCouponIdList
=
storeCouponList
.
stream
().
map
(
GoblinStoreCoupon:
:
getStoreCouponId
).
collect
(
Collectors
.
toList
());
List
<
GoblinStoreCoupon
>
storeCouponList
=
null
;
try
{
storeCouponList
=
this
.
list
(
queryWrapper
);
if
(!
CollectionUtils
.
isEmpty
(
storeCouponList
))
{
List
<
String
>
storeCouponIdList
=
storeCouponList
.
stream
().
map
(
GoblinStoreCoupon:
:
getStoreCouponId
).
collect
(
Collectors
.
toList
());
LambdaUpdateWrapper
<
GoblinStoreCoupon
>
updateWrapper
=
Wrappers
.
lambdaUpdate
(
GoblinStoreCoupon
.
class
);
updateWrapper
.
eq
(
GoblinStoreCoupon:
:
getDelFlg
,
"0"
);
updateWrapper
.
eq
(
GoblinStoreCoupon:
:
getState
,
"1"
);
updateWrapper
.
in
(
GoblinStoreCoupon:
:
getStoreCouponId
,
storeCouponIdList
);
LambdaUpdateWrapper
<
GoblinStoreCoupon
>
updateWrapper
=
Wrappers
.
lambdaUpdate
(
GoblinStoreCoupon
.
class
);
updateWrapper
.
eq
(
GoblinStoreCoupon:
:
getDelFlg
,
"0"
);
updateWrapper
.
eq
(
GoblinStoreCoupon:
:
getState
,
"1"
);
updateWrapper
.
in
(
GoblinStoreCoupon:
:
getStoreCouponId
,
storeCouponIdList
);
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getState
,
"2"
);
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getUpdatedAt
,
now
);
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getUpdatedBy
,
"task"
);
if
(
this
.
update
(
updateWrapper
))
{
try
{
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getState
,
"2"
);
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getUpdatedAt
,
now
);
updateWrapper
.
set
(
GoblinStoreCoupon:
:
getUpdatedBy
,
"task"
);
if
(
this
.
update
(
updateWrapper
))
{
UpdateResult
updateResult
=
mongoTemplate
.
getCollection
(
GoblinStoreCouponBasicVo
.
class
.
getSimpleName
()).
updateMany
(
Query
.
query
(
Criteria
.
where
(
"delFlg"
).
is
(
"0"
).
and
(
"state"
).
is
(
"1"
).
and
(
"storeCouponId"
).
in
(
storeCouponIdList
)).
getQueryObject
(),
Update
.
update
(
"state"
,
"2"
).
set
(
"updatedAt"
,
now
).
set
(
"updatedBy"
,
"task"
).
getUpdateObject
()
...
...
@@ -123,10 +122,10 @@ public class PlatformGoblinStoreCouponService extends ServiceImpl<GoblinStoreCou
});
return
storeCouponList
.
size
();
}
}
catch
(
Exception
e
)
{
log
.
error
(
"###商铺活动:优惠券处理异常[now={},storeCouponList={}]"
,
now
,
JsonUtils
.
toJson
(
storeCouponIdList
));
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"###商铺活动:优惠券处理异常[now={},storeCouponList.size={}]"
,
now
,
null
==
storeCouponList
?
-
1
:
storeCouponList
.
size
(),
e
);
}
return
0
;
}
...
...
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