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

fix press

release_toaliyun_real
zhengfangyuan 3 лет назад
Родитель
Сommit
e828d73ad7
7 измененных файлов: 70 добавлений и 3 удалений
  1. +48
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxPressBatchController.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java
  3. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java
  4. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxPressBatchService.java
  5. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java
  6. +8
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxPressBatchServiceImpl.java
  7. +5
    -0
      mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml

+ 48
- 3
mallinkAdmin/src/main/java/com/iformall/controller/market/WxPressBatchController.java Просмотреть файл

@@ -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")


+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java Просмотреть файл

@@ -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 Просмотреть файл

@@ -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);


+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxPressBatchService.java Просмотреть файл

@@ -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 Просмотреть файл

@@ -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);


+ 8
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxPressBatchServiceImpl.java Просмотреть файл

@@ -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 Просмотреть файл

@@ -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


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