Browse Source

Merge branch 'release_toaliyun_real' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real

release_toaliyun_real
xhxu 3 years ago
parent
commit
d3f3582729
10 changed files with 112 additions and 5 deletions
  1. +79
    -5
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxPressBatchController.java
  2. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxPressBatchItem.java
  3. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java
  4. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java
  5. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponService.java
  6. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxPressBatchService.java
  7. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java
  8. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  9. +8
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxPressBatchServiceImpl.java
  10. +5
    -0
      mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml

+ 79
- 5
mallinkAdmin/src/main/java/com/iformall/controller/market/WxPressBatchController.java View File

@@ -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,11 +104,33 @@ public class WxPressBatchController extends BaseController {
if (null == id) {
return new ResultData(Result.ERROR,"参数错误");
}
List<WxPressBatchItem> list = wxPressBatchService.getItemList(id, getTenantInfo().getTenantId());
return new ResultData(list);
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);
}
}
return new ResultData(items);
}
@ApiOperation("详情接口")
@ApiOperation("删除接口")
@PostMapping("delete")
public ResultData delete(@RequestBody WxPressBatch record) {
if (null == record.getId()) {
@@ -105,6 +139,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.simplelistAsPage(record, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增items")
@@ -145,6 +204,21 @@ public class WxPressBatchController extends BaseController {
wxPressBatchService.updateStatus(record);
return new ResultData();
}
@ApiOperation("详情接口")
@PostMapping("setRules")
public ResultData setRules(@RequestBody WxPressBatch record) {
if (null == record.getId()) {
return new ResultData(Result.ERROR,"参数错误");
}
WxPressBatch record1 = wxPressBatchService.getById(record.getId(), getTenantInfo().getTenantId());
record1.setPromoterLimitRule(record.getPromoterLimitRule());
record1.setPromoterAllowCount(record.getPromoterAllowCount());
record1.setBargainerAllowCount(record.getBargainerAllowCount());
record1.setBargainerAllowSame(record.getBargainerAllowSame());
wxPressBatchService.saveOrUpdate(record1);
return new ResultData();
}




+ 4
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxPressBatchItem.java View File

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

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

+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java View File

@@ -13,6 +13,8 @@ public interface WxCouponChannelMapper extends CommonMapper<WxCouponChannel, Str
WxCouponChannel selectById(@Param("id")Long id,@Param("tenantId")String tenantId);
List<WxCouponChannel> findList(WxCouponChannel wxCouponChannel);
List<Long> findCouponIdList(WxCouponChannel wxCouponChannel);

int countCoupon(WxCouponChannel wxCouponChannel);



+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java View File

@@ -26,6 +26,7 @@ public interface WxCouponChannelService {
*/
PageInfo<WxCouponChannel> listAsPage(WxCouponChannel record, Integer pageIndex, Integer pageSize);
List<WxCouponChannel> findList(WxCouponChannel record);
List<Long> findCouponIdList(WxCouponChannel record);


WxCouponCVo findDetailVo(Long id,String tenantId,boolean hasMerchant);


+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxCouponService.java View File

@@ -31,6 +31,8 @@ public interface WxCouponService {
* @return
*/
PageInfo<WxCoupon> listAsPage(WxCoupon record, Integer pageIndex, Integer pageSize);
PageInfo<WxCoupon> simplelistAsPage(WxCoupon record, Integer pageIndex, Integer pageSize);

/**
* 卡类列表,包括统计


+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxPressBatchService.java View File

@@ -40,6 +40,7 @@ public interface WxPressBatchService {
WxPressBatch getById(Long id,String tenantId);
List<WxPressBatchItem> getItemList(Long batchId,String tenantId);
List<Long> getItemCouponIdList(Long batchId,String tenantId);
void saveItems(WxPressBatch pressBatch,String[] couponIds);


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java View File

@@ -113,6 +113,11 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
return wxCouponChannelMapper.findList(record);
}
@Override
public List<Long> findCouponIdList(WxCouponChannel record) {
return wxCouponChannelMapper.findCouponIdList(record);
}
@Override
public WxCouponChannel getById(Long id,String tenantId) {
return wxCouponChannelMapper.selectById(id,tenantId);


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java View File

@@ -210,6 +210,11 @@ public class WxCouponServiceImpl implements WxCouponService {
public List<WxCoupon> list(WxCoupon wxCoupon){
return wxCouponMapper.findList(wxCoupon);
}
@Override
public PageInfo<WxCoupon> simplelistAsPage(WxCoupon record, Integer pageNum, Integer pageSize) {
return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findList(record));
}

@Override
public PageInfo<WxCoupon> listAsPage(WxCoupon record, Integer pageIndex, Integer pageSize) {


+ 8
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxPressBatchServiceImpl.java View File

@@ -94,6 +94,14 @@ public class WxPressBatchServiceImpl implements WxPressBatchService {
return wxPressBatchItemMapper.findList(iteq);
}
@Override
public List<Long> getItemCouponIdList(Long batchId, String tenantId) {
WxPressBatchItem iteq = new WxPressBatchItem();
iteq.setTenantId(tenantId);
iteq.setPressBatchId(batchId);
return wxPressBatchItemMapper.getCouponIds(batchId, tenantId, null);
}
@Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public void saveItems(WxPressBatch pressBatch, String[] couponIds) {


+ 5
- 0
mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml View File

@@ -143,6 +143,11 @@
select <include refid="allColumns" /> from wx_coupon_channel cc
<include refid="dynamicWhereConditions" />
</select>
<select id="findCouponIdList" parameterType="com.iformall.domain.po.WxCouponChannel" resultType="Long">
select distinct coupon_id from wx_coupon_channel cc
<include refid="dynamicWhereConditions" />
</select>

<update id="updateStatusByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">
update wx_coupon_channel


Loading…
Cancel
Save