Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
Details
Activity
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
base_platform_enterprise
gic-platform-enterprise
Commits
9da628ea
Commit
9da628ea
authored
May 08, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
卡券绑定修改:添加gic过期时间,用于查询
parent
758818b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
WmMallStoreController.java
...c/enterprise/web/controller/wm/WmMallStoreController.java
+27
-0
No files found.
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/wm/WmMallStoreController.java
View file @
9da628ea
...
...
@@ -8,6 +8,7 @@ import java.util.Set;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
com.gic.enterprise.error.ErrorCode
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -317,6 +318,16 @@ public class WmMallStoreController {
@RequestMapping
(
"/bind-coupon"
)
public
RestResponse
bindCoupon
(
WmStoreCouponConfigDTO
dto
)
{
dto
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
Map
<
String
,
CouponDTO
>
gicCouponMap
=
getGicCoupon
(
dto
.
getWmMallStoreId
());
CouponDTO
couponDTO
=
gicCouponMap
.
get
(
dto
.
getGicCouponId
());
if
(
couponDTO
==
null
)
{
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"gic卡券不存在"
);
}
//计算过期时间
if
(
couponDTO
.
getCardEffectiveMode
().
intValue
()
==
0
)
{
//固定日期,需要给一个过期时间
dto
.
setGicCouponExpire
(
couponDTO
.
getExpireDate
());
}
return
OperationResultUtils
.
operationResult
(
wmStoreApiService
.
saveCouponConfig
(
dto
),
"绑定卡券"
...
...
@@ -329,4 +340,20 @@ public class WmMallStoreController {
return
ResultControllerUtils
.
commonResult
(
wmStoreApiService
.
pageCouponConfig
(
params
));
}
private
Map
<
String
,
CouponDTO
>
getGicCoupon
(
Integer
wmMallStoreId
)
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
//获取已配置的卡券ID
ServiceResponse
<
Long
>
mcuIdResponse
=
weimobMerchantService
.
getMcuAreaId
(
wmMallStoreId
);
if
(!
mcuIdResponse
.
isSuccess
())
{
return
new
HashMap
<>(
2
);
}
ServiceResponse
<
List
<
CouponDTO
>>
gicCouponResponse
=
memberCouponApiService
.
listGicCoupon
(
enterpriseId
,
mcuIdResponse
.
getResult
(),
""
);
if
(
gicCouponResponse
.
isSuccess
())
{
List
<
CouponDTO
>
list
=
gicCouponResponse
.
getResult
();
return
list
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getCouponId
().
toString
(),
e
->
e
));
}
return
new
HashMap
<>(
2
);
}
}
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