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
51a67d5a
Commit
51a67d5a
authored
May 07, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微盟店铺卡券配置接口
parent
5409ea70
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
762 additions
and
4 deletions
+762
-4
WmStoreCouponConfigDTO.java
...ava/com/gic/enterprise/dto/wm/WmStoreCouponConfigDTO.java
+141
-0
CouponConfigQO.java
...rc/main/java/com/gic/enterprise/qo/wm/CouponConfigQO.java
+55
-0
WmStoreApiService.java
...in/java/com/gic/enterprise/service/WmStoreApiService.java
+22
-0
TabWmStoreCouponConfigMapper.java
...c/enterprise/dao/mapper/TabWmStoreCouponConfigMapper.java
+57
-0
TabWmStoreCouponConfig.java
...ava/com/gic/enterprise/entity/TabWmStoreCouponConfig.java
+135
-0
WmStoreCouponConfigService.java
...om/gic/enterprise/service/WmStoreCouponConfigService.java
+28
-0
WmStoreCouponConfigServiceImpl.java
...terprise/service/impl/WmStoreCouponConfigServiceImpl.java
+33
-0
WmStoreApiServiceImpl.java
.../enterprise/service/outer/impl/WmStoreApiServiceImpl.java
+55
-0
TabWmStoreCouponConfigMapper.xml
...rc/main/resources/mapper/TabWmStoreCouponConfigMapper.xml
+159
-0
WmMallStoreController.java
...c/enterprise/web/controller/wm/WmMallStoreController.java
+18
-4
CouponVO.java
.../src/main/java/com/gic/enterprise/web/vo/wm/CouponVO.java
+58
-0
dubbo-gic-platform-enterprise-web.xml
.../src/main/resources/dubbo-gic-platform-enterprise-web.xml
+1
-0
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/wm/WmStoreCouponConfigDTO.java
0 → 100644
View file @
51a67d5a
package
com
.
gic
.
enterprise
.
dto
.
wm
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 微盟店铺卡券配置
* @ClassName: WmStoreCouponConfigDTO
* @Description:
* @author guojuxing
* @date 2020/5/7 10:42 AM
*/
public
class
WmStoreCouponConfigDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
452619999926042472L
;
/**
*
*/
private
Integer
couponConfigId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 微盟主账号(平台唯一),用于关联配置
*/
private
String
wmMainAccount
;
/**
* gic卡券id
*/
private
String
gicCouponId
;
/**
* 微盟卡券ID
*/
private
String
wmCouponId
;
/**
* gic卡券过期时间,如果是固定时间,则有值,如果未null,说明有效
*/
private
Date
gicCouponExpire
;
/**
* 1:有效
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
Integer
getCouponConfigId
()
{
return
couponConfigId
;
}
public
WmStoreCouponConfigDTO
setCouponConfigId
(
Integer
couponConfigId
)
{
this
.
couponConfigId
=
couponConfigId
;
return
this
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
WmStoreCouponConfigDTO
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
return
this
;
}
public
String
getWmMainAccount
()
{
return
wmMainAccount
;
}
public
WmStoreCouponConfigDTO
setWmMainAccount
(
String
wmMainAccount
)
{
this
.
wmMainAccount
=
wmMainAccount
;
return
this
;
}
public
String
getGicCouponId
()
{
return
gicCouponId
;
}
public
WmStoreCouponConfigDTO
setGicCouponId
(
String
gicCouponId
)
{
this
.
gicCouponId
=
gicCouponId
;
return
this
;
}
public
String
getWmCouponId
()
{
return
wmCouponId
;
}
public
WmStoreCouponConfigDTO
setWmCouponId
(
String
wmCouponId
)
{
this
.
wmCouponId
=
wmCouponId
;
return
this
;
}
public
Date
getGicCouponExpire
()
{
return
gicCouponExpire
;
}
public
WmStoreCouponConfigDTO
setGicCouponExpire
(
Date
gicCouponExpire
)
{
this
.
gicCouponExpire
=
gicCouponExpire
;
return
this
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
WmStoreCouponConfigDTO
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
return
this
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
WmStoreCouponConfigDTO
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
return
this
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
WmStoreCouponConfigDTO
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
return
this
;
}
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/qo/wm/CouponConfigQO.java
0 → 100644
View file @
51a67d5a
package
com
.
gic
.
enterprise
.
qo
.
wm
;
import
java.io.Serializable
;
/**
* 卡券配置查询参数
* @ClassName: CouponConfigQO
* @Description:
* @author guojuxing
* @date 2020/5/7 11:04 AM
*/
public
class
CouponConfigQO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
2703515379512499369L
;
/**
* 微盟主账号
*/
private
String
wmMainAccount
;
/**
* gic卡券ID
*/
private
String
gicCouponId
;
/**
* 微盟卡券ID
*/
private
String
wmCouponId
;
public
String
getWmMainAccount
()
{
return
wmMainAccount
;
}
public
CouponConfigQO
setWmMainAccount
(
String
wmMainAccount
)
{
this
.
wmMainAccount
=
wmMainAccount
;
return
this
;
}
public
String
getGicCouponId
()
{
return
gicCouponId
;
}
public
CouponConfigQO
setGicCouponId
(
String
gicCouponId
)
{
this
.
gicCouponId
=
gicCouponId
;
return
this
;
}
public
String
getWmCouponId
()
{
return
wmCouponId
;
}
public
CouponConfigQO
setWmCouponId
(
String
wmCouponId
)
{
this
.
wmCouponId
=
wmCouponId
;
return
this
;
}
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/WmStoreApiService.java
View file @
51a67d5a
...
...
@@ -5,6 +5,7 @@ import com.gic.enterprise.dto.WmMemberCardConfigDTO;
import
com.gic.enterprise.dto.WmOrderConfigDTO
;
import
com.gic.enterprise.dto.WmStoreDTO
;
import
com.gic.enterprise.dto.wm.WmStoreConfigDTO
;
import
com.gic.enterprise.dto.wm.WmStoreCouponConfigDTO
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -103,4 +104,25 @@ public interface WmStoreApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.util.Set<String>>
*/
ServiceResponse
<
Set
<
String
>>
getWmStoreConfigByWmMainAccount
(
String
wmMainAccount
);
/**
* 绑定卡券
* @Title: saveCouponConfig
* @Description:
* @author guojuxing
* @param dto
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
saveCouponConfig
(
WmStoreCouponConfigDTO
dto
);
/**
* 根据gic查询微盟绑定的卡券ID,店铺唯一
* @Title: getWmCouponId
* @Description:
* @author guojuxing
* @param couponId
* @param wmMallStoreId 店铺主键
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Long>
*/
ServiceResponse
<
Long
>
getWmCouponId
(
Long
couponId
,
Integer
wmMallStoreId
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/dao/mapper/TabWmStoreCouponConfigMapper.java
0 → 100644
View file @
51a67d5a
package
com
.
gic
.
enterprise
.
dao
.
mapper
;
import
com.gic.enterprise.entity.TabWmStoreCouponConfig
;
import
com.gic.enterprise.qo.wm.CouponConfigQO
;
public
interface
TabWmStoreCouponConfigMapper
{
/**
* 根据主键删除
*
* @param couponConfigId 主键
* @return 更新条目数
*/
int
deleteByPrimaryKey
(
Integer
couponConfigId
);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insert
(
TabWmStoreCouponConfig
record
);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insertSelective
(
TabWmStoreCouponConfig
record
);
/**
* 根据主键查询
*
* @param couponConfigId 主键
* @return 实体对象
*/
TabWmStoreCouponConfig
selectByPrimaryKey
(
Integer
couponConfigId
);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKeySelective
(
TabWmStoreCouponConfig
record
);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabWmStoreCouponConfig
record
);
TabWmStoreCouponConfig
getCouponConfig
(
CouponConfigQO
params
);
}
\ No newline at end of file
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/entity/TabWmStoreCouponConfig.java
0 → 100644
View file @
51a67d5a
package
com
.
gic
.
enterprise
.
entity
;
import
java.util.Date
;
/**
* tab_wm_store_coupon_config
*/
public
class
TabWmStoreCouponConfig
{
/**
*
*/
private
Integer
couponConfigId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 微盟主账号(平台唯一),用于关联配置
*/
private
String
wmMainAccount
;
/**
* gic卡券id
*/
private
String
gicCouponId
;
/**
* 微盟卡券ID
*/
private
String
wmCouponId
;
/**
* gic卡券过期时间,如果是固定时间,则有值,如果未null,说明有效
*/
private
Date
gicCouponExpire
;
/**
* 1:有效
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
Integer
getCouponConfigId
()
{
return
couponConfigId
;
}
public
TabWmStoreCouponConfig
setCouponConfigId
(
Integer
couponConfigId
)
{
this
.
couponConfigId
=
couponConfigId
;
return
this
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
TabWmStoreCouponConfig
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
return
this
;
}
public
String
getWmMainAccount
()
{
return
wmMainAccount
;
}
public
TabWmStoreCouponConfig
setWmMainAccount
(
String
wmMainAccount
)
{
this
.
wmMainAccount
=
wmMainAccount
;
return
this
;
}
public
String
getGicCouponId
()
{
return
gicCouponId
;
}
public
TabWmStoreCouponConfig
setGicCouponId
(
String
gicCouponId
)
{
this
.
gicCouponId
=
gicCouponId
;
return
this
;
}
public
String
getWmCouponId
()
{
return
wmCouponId
;
}
public
TabWmStoreCouponConfig
setWmCouponId
(
String
wmCouponId
)
{
this
.
wmCouponId
=
wmCouponId
;
return
this
;
}
public
Date
getGicCouponExpire
()
{
return
gicCouponExpire
;
}
public
TabWmStoreCouponConfig
setGicCouponExpire
(
Date
gicCouponExpire
)
{
this
.
gicCouponExpire
=
gicCouponExpire
;
return
this
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
TabWmStoreCouponConfig
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
return
this
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
TabWmStoreCouponConfig
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
return
this
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
TabWmStoreCouponConfig
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
return
this
;
}
}
\ No newline at end of file
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/WmStoreCouponConfigService.java
0 → 100644
View file @
51a67d5a
package
com
.
gic
.
enterprise
.
service
;
import
com.gic.enterprise.dto.wm.WmStoreCouponConfigDTO
;
import
com.gic.enterprise.entity.TabWmStoreCouponConfig
;
import
com.gic.enterprise.qo.wm.CouponConfigQO
;
public
interface
WmStoreCouponConfigService
{
/**
* 卡券绑定
* @Title: saveCouponConfig
* @Description:
* @author guojuxing
* @param dto
* @return void
*/
void
saveCouponConfig
(
WmStoreCouponConfigDTO
dto
);
/**
* 查询卡券配置记录
* @Title: getCouponConfig
* @Description:
* @author guojuxing
* @param params
* @return com.gic.enterprise.entity.TabWmStoreCouponConfig
*/
TabWmStoreCouponConfig
getCouponConfig
(
CouponConfigQO
params
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/WmStoreCouponConfigServiceImpl.java
0 → 100644
View file @
51a67d5a
package
com
.
gic
.
enterprise
.
service
.
impl
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.dao.mapper.TabWmStoreCouponConfigMapper
;
import
com.gic.enterprise.dto.wm.WmStoreCouponConfigDTO
;
import
com.gic.enterprise.entity.TabWmStoreCouponConfig
;
import
com.gic.enterprise.qo.wm.CouponConfigQO
;
import
com.gic.enterprise.service.WmStoreCouponConfigService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
@Service
(
"wmStoreCouponConfigService"
)
public
class
WmStoreCouponConfigServiceImpl
implements
WmStoreCouponConfigService
{
@Autowired
private
TabWmStoreCouponConfigMapper
tabWmStoreCouponConfigMapper
;
@Override
public
void
saveCouponConfig
(
WmStoreCouponConfigDTO
dto
)
{
Date
now
=
new
Date
();
dto
.
setCreateTime
(
now
);
dto
.
setUpdateTime
(
now
);
dto
.
setStatus
(
1
);
TabWmStoreCouponConfig
record
=
EntityUtil
.
changeEntityNew
(
TabWmStoreCouponConfig
.
class
,
dto
);
tabWmStoreCouponConfigMapper
.
insert
(
record
);
}
@Override
public
TabWmStoreCouponConfig
getCouponConfig
(
CouponConfigQO
params
)
{
return
tabWmStoreCouponConfigMapper
.
getCouponConfig
(
params
);
}
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/WmStoreApiServiceImpl.java
View file @
51a67d5a
...
...
@@ -6,6 +6,10 @@ import java.util.stream.Collectors;
import
com.alibaba.fastjson.JSON
;
import
com.gic.commons.util.StringUtil
;
import
com.gic.enterprise.dto.WmOrderConfigDTO
;
import
com.gic.enterprise.dto.wm.WmStoreCouponConfigDTO
;
import
com.gic.enterprise.entity.TabWmStoreCouponConfig
;
import
com.gic.enterprise.qo.wm.CouponConfigQO
;
import
com.gic.enterprise.service.WmStoreCouponConfigService
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -30,6 +34,8 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
private
WmStoreService
wmStoreService
;
@Autowired
private
WmStoreConfigService
wmStoreConfigService
;
@Autowired
private
WmStoreCouponConfigService
wmStoreCouponConfigService
;
@Override
public
ServiceResponse
<
Integer
>
saveWmStore
(
WmStoreDTO
wmStoreDTO
)
{
...
...
@@ -164,6 +170,55 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
return
ServiceResponse
.
success
(
result
);
}
@Override
public
ServiceResponse
<
Void
>
saveCouponConfig
(
WmStoreCouponConfigDTO
dto
)
{
if
(
dto
.
getEnterpriseId
()
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"商户ID不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getWmMainAccount
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"微盟主账号不能为空"
);
}
TabWmStore
wmStore
=
wmStoreService
.
getByWmMainAccount
(
dto
.
getWmMainAccount
());
if
(
wmStore
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"微盟主账号错误,查无数据"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getGicCouponId
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"gic卡券为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getWmCouponId
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"微盟卡券为空"
);
}
TabWmStoreCouponConfig
gicRecord
=
wmStoreCouponConfigService
.
getCouponConfig
(
new
CouponConfigQO
()
.
setWmMainAccount
(
dto
.
getWmMainAccount
())
.
setGicCouponId
(
dto
.
getGicCouponId
()));
if
(
gicRecord
!=
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"gic卡券重复绑定"
);
}
TabWmStoreCouponConfig
wmRecord
=
wmStoreCouponConfigService
.
getCouponConfig
(
new
CouponConfigQO
()
.
setWmMainAccount
(
dto
.
getWmMainAccount
())
.
setWmCouponId
(
dto
.
getWmCouponId
()));
if
(
wmRecord
!=
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"微盟卡券重复绑定"
);
}
wmStoreCouponConfigService
.
saveCouponConfig
(
dto
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Long
>
getWmCouponId
(
Long
couponId
,
Integer
wmMallStoreId
)
{
TabWmStore
wmStore
=
wmStoreService
.
getByWmMallStoreId
(
wmMallStoreId
);
if
(
wmStore
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"店铺不存在"
);
}
TabWmStoreCouponConfig
gicRecord
=
wmStoreCouponConfigService
.
getCouponConfig
(
new
CouponConfigQO
()
.
setWmMainAccount
(
wmStore
.
getWmMainAccount
())
.
setGicCouponId
(
couponId
.
toString
()));
return
ServiceResponse
.
success
(
Long
.
valueOf
(
gicRecord
.
getWmCouponId
()));
}
private
ServiceResponse
validWmMemberCardConfig
(
WmMemberCardConfigDTO
dto
)
{
if
(
dto
.
getEnterpriseId
()
==
null
)
{
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabWmStoreCouponConfigMapper.xml
0 → 100644
View file @
51a67d5a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.gic.enterprise.dao.mapper.TabWmStoreCouponConfigMapper"
>
<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_main_account"
jdbcType=
"VARCHAR"
property=
"wmMainAccount"
/>
<result
column=
"gic_coupon_id"
jdbcType=
"VARCHAR"
property=
"gicCouponId"
/>
<result
column=
"wm_coupon_id"
jdbcType=
"VARCHAR"
property=
"wmCouponId"
/>
<result
column=
"gic_coupon_expire"
jdbcType=
"TIMESTAMP"
property=
"gicCouponExpire"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
coupon_config_id, enterprise_id, wm_main_account, gic_coupon_id, wm_coupon_id, gic_coupon_expire,
status, create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_wm_store_coupon_config
where coupon_config_id = #{couponConfigId,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from tab_wm_store_coupon_config
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_main_account,
gic_coupon_id, wm_coupon_id, gic_coupon_expire,
status, create_time, update_time
)
values (#{couponConfigId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{wmMainAccount,jdbcType=VARCHAR},
#{gicCouponId,jdbcType=VARCHAR}, #{wmCouponId,jdbcType=VARCHAR}, #{gicCouponExpire,jdbcType=TIMESTAMP},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.enterprise.entity.TabWmStoreCouponConfig"
>
insert into tab_wm_store_coupon_config
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"couponConfigId != null"
>
coupon_config_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"wmMainAccount != null"
>
wm_main_account,
</if>
<if
test=
"gicCouponId != null"
>
gic_coupon_id,
</if>
<if
test=
"wmCouponId != null"
>
wm_coupon_id,
</if>
<if
test=
"gicCouponExpire != null"
>
gic_coupon_expire,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"couponConfigId != null"
>
#{couponConfigId,jdbcType=INTEGER},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"wmMainAccount != null"
>
#{wmMainAccount,jdbcType=VARCHAR},
</if>
<if
test=
"gicCouponId != null"
>
#{gicCouponId,jdbcType=VARCHAR},
</if>
<if
test=
"wmCouponId != null"
>
#{wmCouponId,jdbcType=VARCHAR},
</if>
<if
test=
"gicCouponExpire != null"
>
#{gicCouponExpire,jdbcType=TIMESTAMP},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.enterprise.entity.TabWmStoreCouponConfig"
>
update tab_wm_store_coupon_config
<set>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"wmMainAccount != null"
>
wm_main_account = #{wmMainAccount,jdbcType=VARCHAR},
</if>
<if
test=
"gicCouponId != null"
>
gic_coupon_id = #{gicCouponId,jdbcType=VARCHAR},
</if>
<if
test=
"wmCouponId != null"
>
wm_coupon_id = #{wmCouponId,jdbcType=VARCHAR},
</if>
<if
test=
"gicCouponExpire != null"
>
gic_coupon_expire = #{gicCouponExpire,jdbcType=TIMESTAMP},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where coupon_config_id = #{couponConfigId,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.enterprise.entity.TabWmStoreCouponConfig"
>
update tab_wm_store_coupon_config
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
wm_main_account = #{wmMainAccount,jdbcType=VARCHAR},
gic_coupon_id = #{gicCouponId,jdbcType=VARCHAR},
wm_coupon_id = #{wmCouponId,jdbcType=VARCHAR},
gic_coupon_expire = #{gicCouponExpire,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where coupon_config_id = #{couponConfigId,jdbcType=INTEGER}
</update>
<select
id=
"getCouponConfig"
resultMap=
"BaseResultMap"
parameterType=
"com.gic.enterprise.qo.wm.CouponConfigQO"
>
select
<include
refid=
"Base_Column_List"
></include>
from tab_wm_store_coupon_config
where status = 1
<if
test=
"wmMainAccount != null and wmMainAccount != '' "
>
and wm_main_account = #{wmMainAccount}
</if>
<if
test=
"gicCouponId != null and gicCouponId != '' "
>
and gic_coupon_id = #{gicCouponId}
</if>
<if
test=
"wmCouponId != null and wmCouponId != '' "
>
and wm_coupon_id = #{wmCouponId}
</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 @
51a67d5a
...
...
@@ -8,6 +8,9 @@ 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
;
...
...
@@ -30,10 +33,6 @@ 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.MemberGradeVO
;
import
com.gic.enterprise.web.vo.wm.WmCouponVO
;
import
com.gic.enterprise.web.vo.wm.WmStoreDetailVO
;
import
com.gic.enterprise.web.vo.wm.WmStoreVO
;
import
com.gic.member.config.api.service.MemberCardApiService
;
import
com.gic.weimob.api.service.WeimobMerchantService
;
import
com.gic.weimob.api.service.WeimobStoreSiteService
;
...
...
@@ -51,6 +50,8 @@ public class WmMallStoreController {
private
WeimobStoreSiteService
weimobStoreSiteService
;
@Autowired
private
WeimobMerchantService
weimobMerchantService
;
@Autowired
private
MemberCouponApiService
memberCouponApiService
;
@RequestMapping
(
"/save-wm-store"
)
public
RestResponse
save
(
WmStoreDTO
dto
)
{
...
...
@@ -188,6 +189,19 @@ public class WmMallStoreController {
return
RestResponse
.
failure
(
wmStoreResponse
.
getCode
(),
wmStoreResponse
.
getMessage
());
}
@RequestMapping
(
"/list-gic-coupon"
)
public
RestResponse
listGicCoupon
(
Integer
wmMallStoreId
,
String
cardName
)
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
//获取已配置的卡券ID
ServiceResponse
<
Long
>
mcuIdResponse
=
weimobMerchantService
.
getMcuAreaId
(
wmMallStoreId
);
if
(!
mcuIdResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
mcuIdResponse
.
getCode
(),
mcuIdResponse
.
getMessage
());
}
ServiceResponse
<
List
<
CouponDTO
>>
gicCouponResponse
=
memberCouponApiService
.
listGicCoupon
(
enterpriseId
,
mcuIdResponse
.
getResult
(),
cardName
);
return
ResultControllerUtils
.
commonResult
(
gicCouponResponse
,
CouponVO
.
class
);
}
/**
* 授权回调
* @param code
...
...
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/vo/wm/CouponVO.java
0 → 100644
View file @
51a67d5a
package
com
.
gic
.
enterprise
.
web
.
vo
.
wm
;
import
java.io.Serializable
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
/**
* gic卡券
* @ClassName: CouponVO
* @Description:
* @author guojuxing
* @date 2020/5/7 9:40 AM
*/
public
class
CouponVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5251156293561530439L
;
/**
* 卡券ID
*/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
couponId
;
/**
* 会员卡域id
*/
private
Long
memberCardId
;
/**
* 卡券名称
*/
private
String
cardName
;
public
Long
getCouponId
()
{
return
couponId
;
}
public
CouponVO
setCouponId
(
Long
couponId
)
{
this
.
couponId
=
couponId
;
return
this
;
}
public
Long
getMemberCardId
()
{
return
memberCardId
;
}
public
CouponVO
setMemberCardId
(
Long
memberCardId
)
{
this
.
memberCardId
=
memberCardId
;
return
this
;
}
public
String
getCardName
()
{
return
cardName
;
}
public
CouponVO
setCardName
(
String
cardName
)
{
this
.
cardName
=
cardName
;
return
this
;
}
}
gic-platform-enterprise-web/src/main/resources/dubbo-gic-platform-enterprise-web.xml
View file @
51a67d5a
...
...
@@ -127,4 +127,5 @@
<dubbo:reference
interface=
"com.gic.weimob.api.service.WeimobStoreSiteService"
id=
"weimobStoreSiteService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.weimob.api.service.WeimobMerchantService"
id=
"weimobMerchantService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.marketing.api.service.coupon.MemberCouponApiService"
id=
"memberCouponApiService"
timeout=
"6000"
/>
</beans>
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