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
16126772
Commit
16126772
authored
May 08, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微盟店铺卡券配置接口
parent
8ce3fce3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
44 deletions
+93
-44
WmStoreCouponConfigDTO.java
...ava/com/gic/enterprise/dto/wm/WmStoreCouponConfigDTO.java
+6
-6
CouponConfigQO.java
...rc/main/java/com/gic/enterprise/qo/wm/CouponConfigQO.java
+20
-6
TabWmStoreCouponConfig.java
...ava/com/gic/enterprise/entity/TabWmStoreCouponConfig.java
+6
-6
WmStoreApiServiceImpl.java
.../enterprise/service/outer/impl/WmStoreApiServiceImpl.java
+6
-6
TabWmStoreCouponConfigMapper.xml
...rc/main/resources/mapper/TabWmStoreCouponConfigMapper.xml
+20
-13
WmMallStoreController.java
...c/enterprise/web/controller/wm/WmMallStoreController.java
+35
-7
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/wm/WmStoreCouponConfigDTO.java
View file @
16126772
...
...
@@ -24,9 +24,9 @@ public class WmStoreCouponConfigDTO implements Serializable{
private
Integer
enterpriseId
;
/**
*
微盟主账号(平台唯一)
,用于关联配置
*
店铺主键ID
,用于关联配置
*/
private
String
wmMainAccount
;
private
Integer
wmMallStoreId
;
/**
* gic卡券id
...
...
@@ -86,12 +86,12 @@ public class WmStoreCouponConfigDTO implements Serializable{
return
this
;
}
public
String
getWmMainAccount
()
{
return
wmMa
inAccount
;
public
Integer
getWmMallStoreId
()
{
return
wmMa
llStoreId
;
}
public
WmStoreCouponConfigDTO
setWmMa
inAccount
(
String
wmMainAccount
)
{
this
.
wmMa
inAccount
=
wmMainAccount
;
public
WmStoreCouponConfigDTO
setWmMa
llStoreId
(
Integer
wmMallStoreId
)
{
this
.
wmMa
llStoreId
=
wmMallStoreId
;
return
this
;
}
...
...
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/qo/wm/CouponConfigQO.java
View file @
16126772
...
...
@@ -14,9 +14,9 @@ public class CouponConfigQO extends PageQO implements Serializable{
private
static
final
long
serialVersionUID
=
2703515379512499369L
;
/**
*
微盟主账号
*
店铺主键ID,用于关联配置
*/
private
String
wmMainAccount
;
private
Integer
wmMallStoreId
;
/**
* gic卡券ID
...
...
@@ -38,12 +38,17 @@ public class CouponConfigQO extends PageQO implements Serializable{
*/
private
String
couponName
;
public
String
getWmMainAccount
()
{
return
wmMainAccount
;
/**
* 1:绑定时间正序 2:绑定时间倒叙
*/
private
Integer
orderByCode
;
public
Integer
getWmMallStoreId
()
{
return
wmMallStoreId
;
}
public
CouponConfigQO
setWmMa
inAccount
(
String
wmMainAccount
)
{
this
.
wmMa
inAccount
=
wmMainAccount
;
public
CouponConfigQO
setWmMa
llStoreId
(
Integer
wmMallStoreId
)
{
this
.
wmMa
llStoreId
=
wmMallStoreId
;
return
this
;
}
...
...
@@ -82,4 +87,13 @@ public class CouponConfigQO extends PageQO implements Serializable{
this
.
couponName
=
couponName
;
return
this
;
}
public
Integer
getOrderByCode
()
{
return
orderByCode
;
}
public
CouponConfigQO
setOrderByCode
(
Integer
orderByCode
)
{
this
.
orderByCode
=
orderByCode
;
return
this
;
}
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/entity/TabWmStoreCouponConfig.java
View file @
16126772
...
...
@@ -17,9 +17,9 @@ public class TabWmStoreCouponConfig {
private
Integer
enterpriseId
;
/**
*
微盟主账号(平台唯一)
,用于关联配置
*
店铺主键ID
,用于关联配置
*/
private
String
wmMainAccount
;
private
Integer
wmMallStoreId
;
/**
* gic卡券id
...
...
@@ -79,12 +79,12 @@ public class TabWmStoreCouponConfig {
return
this
;
}
public
String
getWmMainAccount
()
{
return
wmMa
inAccount
;
public
Integer
getWmMallStoreId
()
{
return
wmMa
llStoreId
;
}
public
TabWmStoreCouponConfig
setWmMa
inAccount
(
String
wmMainAccount
)
{
this
.
wmMa
inAccount
=
wmMainAccount
;
public
TabWmStoreCouponConfig
setWmMa
llStoreId
(
Integer
wmMallStoreId
)
{
this
.
wmMa
llStoreId
=
wmMallStoreId
;
return
this
;
}
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/WmStoreApiServiceImpl.java
View file @
16126772
...
...
@@ -179,12 +179,12 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
if
(
dto
.
getEnterpriseId
()
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"商户ID不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getWmMainAccount
())
)
{
if
(
dto
.
getWmMallStoreId
()
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"微盟主账号不能为空"
);
}
TabWmStore
wmStore
=
wmStoreService
.
getByWmMa
inAccount
(
dto
.
getWmMainAccount
());
TabWmStore
wmStore
=
wmStoreService
.
getByWmMa
llStoreId
(
dto
.
getWmMallStoreId
());
if
(
wmStore
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"
微盟主账号错误,查无数据
"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"
店铺不存在
"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getGicCouponId
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"gic卡券为空"
);
...
...
@@ -194,14 +194,14 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
}
List
<
TabWmStoreCouponConfig
>
gicRecord
=
wmStoreCouponConfigService
.
getCouponConfig
(
new
CouponConfigQO
()
.
setWmMa
inAccount
(
dto
.
getWmMainAccount
())
.
setWmMa
llStoreId
(
dto
.
getWmMallStoreId
())
.
setGicCouponId
(
dto
.
getGicCouponId
()));
if
(
CollectionUtils
.
isNotEmpty
(
gicRecord
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"gic卡券重复绑定"
);
}
List
<
TabWmStoreCouponConfig
>
wmRecord
=
wmStoreCouponConfigService
.
getCouponConfig
(
new
CouponConfigQO
()
.
setWmMa
inAccount
(
dto
.
getWmMainAccount
())
.
setWmMa
llStoreId
(
dto
.
getWmMallStoreId
())
.
setWmCouponId
(
dto
.
getWmCouponId
()));
if
(
CollectionUtils
.
isNotEmpty
(
wmRecord
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"微盟卡券重复绑定"
);
...
...
@@ -221,7 +221,7 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
List
<
WmCouponDTO
>
list
=
gicRecord
.
stream
().
map
(
e
->
{
WmCouponDTO
temp
=
new
WmCouponDTO
();
temp
.
setWmCouponId
(
Long
.
valueOf
(
e
.
getWmCouponId
()));
temp
.
setWmMallStoreId
(
wmStoreService
.
getByWmMainAccount
(
e
.
getWmMainAccount
())
.
getWmMallStoreId
());
temp
.
setWmMallStoreId
(
e
.
getWmMallStoreId
());
return
temp
;
}).
collect
(
Collectors
.
toList
());
return
ServiceResponse
.
success
(
list
);
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabWmStoreCouponConfigMapper.xml
View file @
16126772
...
...
@@ -4,7 +4,7 @@
<resultMap
id=
"BaseResultMap"
type=
"com.gic.enterprise.entity.TabWmStoreCouponConfig"
>
<id
column=
"coupon_config_id"
jdbcType=
"INTEGER"
property=
"couponConfigId"
/>
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"wm_ma
in_account"
jdbcType=
"VARCHAR"
property=
"wmMainAccount
"
/>
<result
column=
"wm_ma
ll_store_id"
jdbcType=
"INTEGER"
property=
"wmMallStoreId
"
/>
<result
column=
"gic_coupon_id"
jdbcType=
"VARCHAR"
property=
"gicCouponId"
/>
<result
column=
"gic_coupon_name"
jdbcType=
"VARCHAR"
property=
"gicCouponName"
/>
<result
column=
"wm_coupon_id"
jdbcType=
"VARCHAR"
property=
"wmCouponId"
/>
...
...
@@ -15,7 +15,7 @@
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
coupon_config_id, enterprise_id, wm_ma
in_account
, gic_coupon_id, gic_coupon_name, wm_coupon_id, wm_coupon_name, gic_coupon_expire,
coupon_config_id, enterprise_id, wm_ma
ll_store_id
, gic_coupon_id, gic_coupon_name, wm_coupon_id, wm_coupon_name, gic_coupon_expire,
status, create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
...
...
@@ -29,11 +29,11 @@
where coupon_config_id = #{couponConfigId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.enterprise.entity.TabWmStoreCouponConfig"
>
insert into tab_wm_store_coupon_config (coupon_config_id, enterprise_id, wm_ma
in_account,
insert into tab_wm_store_coupon_config (coupon_config_id, enterprise_id, wm_ma
ll_store_id,
gic_coupon_id, gic_coupon_name, wm_coupon_id, wm_coupon_name, gic_coupon_expire,
status, create_time, update_time
)
values (#{couponConfigId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{wmMa
inAccount,jdbcType=VARCHAR},
values (#{couponConfigId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{wmMa
llStoreId,jdbcType=INTEGER},
#{gicCouponId,jdbcType=VARCHAR}, #{gicCouponName,jdbcType=VARCHAR}, #{wmCouponId,jdbcType=VARCHAR},
#{wmCouponName,jdbcType=VARCHAR}, #{gicCouponExpire,jdbcType=TIMESTAMP},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
...
...
@@ -48,8 +48,8 @@
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"wmMa
inAccount
!= null"
>
wm_ma
in_account
,
<if
test=
"wmMa
llStoreId
!= null"
>
wm_ma
ll_store_id
,
</if>
<if
test=
"gicCouponId != null"
>
gic_coupon_id,
...
...
@@ -83,8 +83,8 @@
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"wmMa
inAccount
!= null"
>
#{wmMa
inAccount,jdbcType=VARCHA
R},
<if
test=
"wmMa
llStoreId
!= null"
>
#{wmMa
llStoreId,jdbcType=INTEGE
R},
</if>
<if
test=
"gicCouponId != null"
>
#{gicCouponId,jdbcType=VARCHAR},
...
...
@@ -118,8 +118,8 @@
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"wmMa
inAccount
!= null"
>
wm_ma
in_account = #{wmMainAccount,jdbcType=VARCHA
R},
<if
test=
"wmMa
llStoreId
!= null"
>
wm_ma
ll_store_id = #{wmMallStoreId,jdbcType=INTEGE
R},
</if>
<if
test=
"gicCouponId != null"
>
gic_coupon_id = #{gicCouponId,jdbcType=VARCHAR},
...
...
@@ -151,7 +151,7 @@
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.enterprise.entity.TabWmStoreCouponConfig"
>
update tab_wm_store_coupon_config
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
wm_ma
in_account = #{wmMainAccount,jdbcType=VARCHA
R},
wm_ma
ll_store_id = #{wmMallStoreId,jdbcType=INTEGE
R},
gic_coupon_id = #{gicCouponId,jdbcType=VARCHAR},
gic_coupon_name = #{gicCouponName,jdbcType=VARCHAR},
wm_coupon_id = #{wmCouponId,jdbcType=VARCHAR},
...
...
@@ -168,8 +168,8 @@
from tab_wm_store_coupon_config
where status = 1
<if
test=
"wmMa
inAccount != null and wmMainAccount
!= '' "
>
and wm_ma
in_account = #{wmMainAccount
}
<if
test=
"wmMa
llStoreId != null and wmMallStoreId
!= '' "
>
and wm_ma
ll_store_id = #{wmMallStoreId
}
</if>
<if
test=
"gicCouponId != null and gicCouponId != '' "
>
and gic_coupon_id = #{gicCouponId}
...
...
@@ -183,5 +183,11 @@
<if
test=
"couponName != null and couponName != '' "
>
and (gic_coupon_name like concat('%', #{couponName}, '%') or wm_coupon_name like concat('%', #{couponName}, '%'))
</if>
<if
test=
"orderByCode != null and orderByCode == 1"
>
order by create_time
</if>
<if
test=
"orderByCode != null and orderByCode == 2"
>
order by create_time desc
</if>
</select>
</mapper>
\ No newline at end of file
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/wm/WmMallStoreController.java
View file @
16126772
...
...
@@ -8,9 +8,6 @@ import java.util.Set;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
com.gic.enterprise.web.vo.wm.*
;
import
com.gic.marketing.api.dto.coupon.CouponDTO
;
import
com.gic.marketing.api.service.coupon.MemberCouponApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -28,11 +25,16 @@ import com.gic.enterprise.constant.MallModeEnum;
import
com.gic.enterprise.constant.WmStoreConfigTypeEnum
;
import
com.gic.enterprise.dto.WmStoreDTO
;
import
com.gic.enterprise.dto.wm.WmStoreConfigDTO
;
import
com.gic.enterprise.dto.wm.WmStoreCouponConfigDTO
;
import
com.gic.enterprise.qo.wm.CouponConfigQO
;
import
com.gic.enterprise.service.WmStoreApiService
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.enterprise.web.utils.DomainUtils
;
import
com.gic.enterprise.web.vo.MemberCardVO
;
import
com.gic.enterprise.web.vo.wm.*
;
import
com.gic.marketing.api.dto.coupon.CouponDTO
;
import
com.gic.marketing.api.service.coupon.MemberCouponApiService
;
import
com.gic.member.config.api.service.MemberCardApiService
;
import
com.gic.weimob.api.service.WeimobMerchantService
;
import
com.gic.weimob.api.service.WeimobStoreSiteService
;
...
...
@@ -256,8 +258,13 @@ public class WmMallStoreController {
*/
@RequestMapping
(
"/get-integral-config"
)
public
RestResponse
getIntegralConfig
(
Integer
wmMallStoreId
)
{
//todo 查询已配置的会员卡ID
return
ResultControllerUtils
.
commonResult
(
memberCardApiService
.
isGicCalculateIntegral
(
22L
,
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
()));
//获取已配置的卡券ID
ServiceResponse
<
Long
>
mcuIdResponse
=
weimobMerchantService
.
getMcuAreaId
(
wmMallStoreId
);
if
(!
mcuIdResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
mcuIdResponse
.
getCode
(),
mcuIdResponse
.
getMessage
());
}
return
ResultControllerUtils
.
commonResult
(
memberCardApiService
.
isGicCalculateIntegral
(
mcuIdResponse
.
getResult
(),
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
()));
}
/**
...
...
@@ -271,8 +278,13 @@ public class WmMallStoreController {
*/
@RequestMapping
(
"/edit-integral-config"
)
public
RestResponse
editIntegralConfig
(
Integer
wmMallStoreId
,
String
integralRule
)
{
//todo 查询已配置的会员卡ID
return
ResultControllerUtils
.
commonResult
(
memberCardApiService
.
updateIntegralRule
(
22L
,
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
integralRule
));
//获取已配置的卡券ID
ServiceResponse
<
Long
>
mcuIdResponse
=
weimobMerchantService
.
getMcuAreaId
(
wmMallStoreId
);
if
(!
mcuIdResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
mcuIdResponse
.
getCode
(),
mcuIdResponse
.
getMessage
());
}
return
ResultControllerUtils
.
commonResult
(
memberCardApiService
.
updateIntegralRule
(
mcuIdResponse
.
getResult
(),
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
integralRule
));
}
@RequestMapping
(
"/list-wm-store-config"
)
...
...
@@ -301,4 +313,20 @@ public class WmMallStoreController {
return
ResultControllerUtils
.
commonResult
(
wmStoreApiService
.
getWmStoreConfigByWmMainAccount
(
wmMainAccount
,
wmStoreConfigType
));
}
@RequestMapping
(
"/bind-coupon"
)
public
RestResponse
bindCoupon
(
WmStoreCouponConfigDTO
dto
)
{
dto
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
return
OperationResultUtils
.
operationResult
(
wmStoreApiService
.
saveCouponConfig
(
dto
),
"绑定卡券"
+
dto
.
getGicCouponName
()
+
":"
+
dto
.
getWmCouponName
(),
"微盟商城"
);
}
@RequestMapping
(
"/page-coupon-config"
)
public
RestResponse
pageCouponConfig
(
CouponConfigQO
params
)
{
return
ResultControllerUtils
.
commonResult
(
wmStoreApiService
.
pageCouponConfig
(
params
));
}
}
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