Просмотр исходного кода

update gift

release_toaliyun_real
xhxu 4 лет назад
Родитель
Сommit
d4900fa409
4 измененных файлов: 29 добавлений и 12 удалений
  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 Просмотреть файл

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


wxCoupon.setTypes(Arrays.asList(typeArray)); 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); //全列表 return wxCouponService.list(wxCoupon,wxCoupon, pageNum, pageSize); //全列表
} }


+ 14
- 8
mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java Просмотреть файл

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

try { 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); couponIdL = Long.valueOf(couponId);
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
@@ -144,9 +147,12 @@ public class WxCouponController extends BaseController {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空");
} }
Long couponChannelIdL = 0L, couponIdL = 0L; Long couponChannelIdL = 0L, couponIdL = 0L;

try { 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); couponIdL = Long.valueOf(couponId);
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
@@ -201,7 +207,7 @@ public class WxCouponController extends BaseController {
} }


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


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


+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java Просмотреть файл

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


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

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




+ 7
- 4
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

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


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

<if test=" null != sendType "> <if test=" null != sendType ">
and c.`send_type` = #{sendType} and c.`send_type` = #{sendType}
</if> </if>
@@ -577,6 +573,13 @@
</foreach> </foreach>
</if> </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> <if test=" null != sortColumns">order by ${sortColumns}</if>
</sql> </sql>




Загрузка…
Отмена
Сохранить