Browse Source

update gift

release_toaliyun_real
xhxu 4 years ago
parent
commit
d4900fa409
4 changed files with 29 additions and 12 deletions
  1. +5
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +14
    -8
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java
  3. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  4. +7
    -4
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 5
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java View File

@@ -87,6 +87,11 @@ public class WxCouponController extends BaseController {
EnumCouponType.COUPON_MULTIMCH.getCode()};

wxCoupon.setTypes(Arrays.asList(typeArray));

Integer[] sendTypeArray = {
EnumCouponSendType.ACTIVE.getCode(),
EnumCouponSendType.PASSIVE.getCode(),};
wxCoupon.setSendTypes(Arrays.asList(sendTypeArray));
}
return wxCouponService.list(wxCoupon,wxCoupon, pageNum, pageSize); //全列表
}


+ 14
- 8
mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java View File

@@ -67,9 +67,12 @@ public class WxCouponController extends BaseController {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空");
}
Long couponChannelIdL = 0L, couponIdL = 0L;

try {
couponChannelIdL = Long.valueOf(couponChannelId);
if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) {
if (StringUtils.isNotBlank(couponChannelId) && !couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) {
couponChannelIdL = Long.valueOf(couponChannelId);
}
if (!StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) {
couponIdL = Long.valueOf(couponId);
}
} catch (NumberFormatException e) {
@@ -144,9 +147,12 @@ public class WxCouponController extends BaseController {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空");
}
Long couponChannelIdL = 0L, couponIdL = 0L;

try {
couponChannelIdL = Long.valueOf(couponChannelId);
if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) {
if (StringUtils.isNotBlank(couponChannelId) && !couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) {
couponChannelIdL = Long.valueOf(couponChannelId);
}
if (!StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) {
couponIdL = Long.valueOf(couponId);
}
} catch (NumberFormatException e) {
@@ -201,7 +207,7 @@ public class WxCouponController extends BaseController {
}

private WxCouponCVo generateWxCouponCVoForHtml(Long couponChannelIdL, Long couponIdL,String tenantId) {
if(couponChannelIdL != null){
if(couponChannelIdL > 0l){
WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId);
if(cc == null){
return null;
@@ -215,7 +221,7 @@ public class WxCouponController extends BaseController {
couponCVo.setCouponId(cc.getCouponId());
couponCVo.setHtml(c.getHtml());
return couponCVo;
}else if(couponIdL != null){
}else if(couponIdL > 0l){
WxCoupon c = couponService.getHtmlById(couponIdL,tenantId);
if (c == null) {
return null;
@@ -231,7 +237,7 @@ public class WxCouponController extends BaseController {

private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,Long couponIdL,String tenantId) throws IllegalAccessException, InvocationTargetException {
if(couponChannelIdL != null){
if(couponChannelIdL > 0l){
WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId);
if(cc == null){
return null;
@@ -247,7 +253,7 @@ public class WxCouponController extends BaseController {
wxcv.setEndTime(cc.getEndTime());
wxcv.setQrCode(cc.getQrCode());
return wxcv;
}else if(couponIdL != null){
}else if(couponIdL > 0l){
WxCouponCVo wxcv = couponService.getVoById(couponIdL,tenantId);
return wxcv;
}


+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java View File

@@ -29,6 +29,9 @@ public class WxCoupon extends TenantEntity {
@TableField(exist = false)
protected List<Integer> types;

@TableField(exist = false)
protected List<Integer> sendTypes;

@TableField(exist = false)
protected List<Long> notinTypes;



+ 7
- 4
mallinkService/src/main/resources/mapper/WxCouponMapper.xml View File

@@ -392,10 +392,6 @@
and c.`use_limit_quantity` = #{useLimitQuantity}
</if>

<if test=" null == sendType ">
and c.`send_type` != 3
</if>

<if test=" null != sendType ">
and c.`send_type` = #{sendType}
</if>
@@ -577,6 +573,13 @@
</foreach>
</if>

<if test=" null != sendTypes ">
and c.send_types in
<foreach collection="sendTypes" index="index" item="typesItem" open="(" separator="," close=")">
#{typesItem}
</foreach>
</if>

<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>



Loading…
Cancel
Save