Bläddra i källkod

fix press batch

release_toaliyun_real
zhengfangyuan 3 år sedan
förälder
incheckning
3b909509e2
2 ändrade filer med 27 tillägg och 9 borttagningar
  1. +23
    -9
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxPressBatchController.java
  2. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxPressBatchItem.java

+ 23
- 9
mallinkAdmin/src/main/java/com/iformall/controller/market/WxPressBatchController.java Visa fil

@@ -104,16 +104,30 @@ public class WxPressBatchController extends BaseController {
if (null == id) { if (null == id) {
return new ResultData(Result.ERROR,"参数错误"); return new ResultData(Result.ERROR,"参数错误");
} }
List<Long> couponIdList = wxPressBatchService.getItemCouponIdList(id, getTenantInfo().getTenantId());
WxCoupon record = new WxCoupon();
record.updateTenantInfo(getTenantInfo());
if (null != couponIdList && couponIdList.size() > 0 ) {
record.setIds(couponIdList);
}else {
record.setId(0L);
TenantEntity tenantEntity = getTenantInfo();
List<WxPressBatchItem> items = wxPressBatchService.getItemList(id, tenantEntity.getTenantId());
if (null != items && items.size() > 0 ) {
List<Long> couponIdList = wxPressBatchService.getItemCouponIdList(id, tenantEntity.getTenantId());
WxCoupon record = new WxCoupon();
record.updateTenantInfo(getTenantInfo());
if (null != couponIdList && couponIdList.size() > 0 ) {
record.setIds(couponIdList);
}else {
record.setId(0L);
}
List<WxCoupon> list = wxCouponService.list(record);
Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>();
if (null != list && list.size() > 0 ) {
for (WxCoupon c : list) {
couponMap.put(c.getId(), c);
}
}
for (WxPressBatchItem pbi : items) {
WxCoupon coupon = couponMap.get(pbi.getCouponId());
pbi.setCoupon(coupon);
}
} }
List<WxCoupon> list = wxCouponService.list(record);
return new ResultData(list);
return new ResultData(items);
} }
@ApiOperation("删除接口") @ApiOperation("删除接口")


+ 4
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxPressBatchItem.java Visa fil

@@ -1,5 +1,6 @@
package com.iformall.domain.po; package com.iformall.domain.po;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.base.TenantEntity;
import lombok.Data; import lombok.Data;
@@ -27,4 +28,7 @@ public class WxPressBatchItem extends TenantEntity {
private Date createDate; private Date createDate;
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
private Date updateDate; private Date updateDate;
@TableField(exist = false)
private WxCoupon coupon;
} }

Laddar…
Avbryt
Spara