|
|
|
@@ -9,14 +9,20 @@ import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.AliBusinessCircleOrder; |
|
|
|
import com.iformall.domain.po.WxBusinessCircleOrder; |
|
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.domain.po.WxCouponChannel; |
|
|
|
import com.iformall.domain.po.WxPressBatch; |
|
|
|
import com.iformall.domain.po.WxPressBatchItem; |
|
|
|
import com.iformall.domain.po.base.BaseEntity; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.enums.EnumCouponChannelStatus; |
|
|
|
import com.iformall.enums.EnumCouponChannelType; |
|
|
|
import com.iformall.enums.EnumCouponContentType; |
|
|
|
import com.iformall.enums.EnumCouponSourceType; |
|
|
|
import com.iformall.enums.EnumCouponType; |
|
|
|
import com.iformall.enums.EnumRentContractAppStatus; |
|
|
|
import com.iformall.service.AliBusinessCircleOrderService; |
|
|
|
import com.iformall.service.WxCouponChannelService; |
|
|
|
import com.iformall.service.WxCouponService; |
|
|
|
import com.iformall.service.WxPressBatchService; |
|
|
|
import com.iformall.utils.Constant; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
@@ -46,7 +52,13 @@ public class WxPressBatchController extends BaseController { |
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxPressBatchService wxPressBatchService; |
|
|
|
WxPressBatchService wxPressBatchService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCouponService wxCouponService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCouponChannelService wxCouponChannelService; |
|
|
|
|
|
|
|
@ApiOperation("分页列表接口") |
|
|
|
@GetMapping("list") |
|
|
|
@@ -84,7 +96,7 @@ public class WxPressBatchController extends BaseController { |
|
|
|
return new ResultData(order); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("详情接口") |
|
|
|
@ApiOperation("砍价券接口") |
|
|
|
@GetMapping("itemList") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)}) |
|
|
|
@@ -92,7 +104,15 @@ public class WxPressBatchController extends BaseController { |
|
|
|
if (null == id) { |
|
|
|
return new ResultData(Result.ERROR,"参数错误"); |
|
|
|
} |
|
|
|
List<WxPressBatchItem> list = wxPressBatchService.getItemList(id, getTenantInfo().getTenantId()); |
|
|
|
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); |
|
|
|
} |
|
|
|
List<WxCoupon> list = wxCouponService.list(record); |
|
|
|
return new ResultData(list); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -105,6 +125,31 @@ public class WxPressBatchController extends BaseController { |
|
|
|
wxPressBatchService.deleteBatch(record.getId(), getTenantInfo().getTenantId()); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("已投放砍价券列表接口") |
|
|
|
@GetMapping("couponList") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true),}) |
|
|
|
public ResultData couponList(@ModelAttribute WxCoupon record, Integer pageNum, Integer pageSize) { |
|
|
|
WxCouponChannel couponChannelQ = new WxCouponChannel(); |
|
|
|
couponChannelQ.updateTenantInfo(getTenantInfo()); |
|
|
|
couponChannelQ.setType(EnumCouponType.COUPON_PRESS.getCode()); |
|
|
|
couponChannelQ.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_PRESS.getCode()); |
|
|
|
couponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); |
|
|
|
List<Long> couponIds = wxCouponChannelService.findCouponIdList(couponChannelQ); |
|
|
|
if (null == record) { |
|
|
|
record = new WxCoupon(); |
|
|
|
} |
|
|
|
record.updateTenantInfo(couponChannelQ); |
|
|
|
if (null != couponIds && couponIds.size() > 0 ) { |
|
|
|
record.setIds(couponIds); |
|
|
|
}else { |
|
|
|
record.setId(0L); |
|
|
|
} |
|
|
|
PageInfo<WxCoupon> page = wxCouponService.listAsPage(record, pageNum, pageSize); |
|
|
|
return new ResultData(page); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("新增items") |
|
|
|
|