Commit 5c1df9e6 by guojuxing

提供删除微盟卡券绑定删除gic卡券接口

parent 735cfee1
......@@ -164,4 +164,14 @@ public interface WmStoreApiService {
* @return com.gic.api.base.commons.ServiceResponse<com.gic.api.base.commons.Page<com.gic.enterprise.dto.wm.WmStoreCouponConfigDTO>>


*/
ServiceResponse<Page<WmStoreCouponConfigDTO>> pageCouponConfig(CouponConfigQO params);
/**
* 卡券删除消息通知,gic卡券删除
* @Title: deleteWmGicCoupon

* @Description:

* @author guojuxing
* @param gicCouponId

* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


*/
ServiceResponse<Void> deleteWmGicCoupon(Long gicCouponId);
}
......@@ -2,6 +2,7 @@ package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabWmStoreCouponConfig;
import com.gic.enterprise.qo.wm.CouponConfigQO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -55,4 +56,6 @@ public interface TabWmStoreCouponConfigMapper {
int updateByPrimaryKey(TabWmStoreCouponConfig record);
List<TabWmStoreCouponConfig> getCouponConfig(CouponConfigQO params);
int deleteWmGicCoupon(@Param("gicCouponId") String gicCouponId);
}
\ No newline at end of file
......@@ -30,4 +30,6 @@ public interface WmStoreCouponConfigService {
List<TabWmStoreCouponConfig> getCouponConfig(CouponConfigQO params);
Page<TabWmStoreCouponConfig> pageCouponConfig(CouponConfigQO params);
int deleteWmGicCoupon(String gicCouponId);
}
......@@ -40,4 +40,9 @@ public class WmStoreCouponConfigServiceImpl implements WmStoreCouponConfigServic
List<TabWmStoreCouponConfig> list = tabWmStoreCouponConfigMapper.getCouponConfig(params);
return (Page<TabWmStoreCouponConfig>) list;
}
@Override
public int deleteWmGicCoupon(String gicCouponId) {
return tabWmStoreCouponConfigMapper.deleteWmGicCoupon(gicCouponId);
}
}
......@@ -10,6 +10,8 @@ import com.gic.enterprise.service.*;
import com.gic.weimob.api.service.WeimobMerchantService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -32,6 +34,7 @@ import com.gic.enterprise.qo.wm.CouponConfigQO;
@Service("wmStoreApiService")
public class WmStoreApiServiceImpl implements WmStoreApiService {
private final static Logger LOGGER = LogManager.getLogger(WmStoreApiServiceImpl.class);
@Autowired
private WmStoreService wmStoreService;
@Autowired
......@@ -318,6 +321,19 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
return ServiceResponse.success(resultPage);
}
@Override
public ServiceResponse<Void> deleteWmGicCoupon(Long gicCouponId) {
LOGGER.info("删除gic卡券参数:{}", gicCouponId);
if (gicCouponId == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "卡券ID为空");
}
int count = wmStoreCouponConfigService.deleteWmGicCoupon(gicCouponId.toString());
if (count < 1) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "卡券ID有误,无数据删除");
}
return ServiceResponse.success();
}
private ServiceResponse validWmMemberCardConfig(WmMemberCardConfigDTO dto) {
if (dto.getEnterpriseId() == null) {
......
......@@ -167,7 +167,7 @@
select <include refid="Base_Column_List"></include>
from tab_wm_store_coupon_config
where status = 1
where 1 = 1
<if test="wmMallStoreId != null and wmMallStoreId != '' ">
and wm_mall_store_id = #{wmMallStoreId}
</if>
......@@ -185,6 +185,7 @@
</if>
<if test="onlyShowEffective != null and onlyShowEffective == 1">
and (gic_coupon_expire is null or TIMESTAMPDIFF(DAY, now(), gic_coupon_expire) >= 0)
and status = 1
</if>
<if test="couponName != null and couponName != '' ">
and (gic_coupon_name like concat('%', #{couponName}, '%') or wm_coupon_name like concat('%', #{couponName}, '%'))
......@@ -196,4 +197,12 @@
order by create_time desc
</if>
</select>
<update id="deleteWmGicCoupon">
update tab_wm_store_coupon_config set status = 0
where gic_coupon_id = #{gicCouponId}
and status = 1
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment