|
@@ -20,6 +20,7 @@ import com.qs.mp.channel.domain.Channel;
|
|
|
import com.qs.mp.channel.service.IChannelService;
|
|
|
import com.qs.mp.common.core.domain.AjaxResult;
|
|
|
import com.qs.mp.common.core.page.TableDataInfo;
|
|
|
+import com.qs.mp.common.enums.CdKeyGroupGoodsTypeEnum;
|
|
|
import com.qs.mp.common.enums.CdKeyGroupStatusEnum;
|
|
|
import com.qs.mp.common.enums.CdKeyStatusEnum;
|
|
|
import com.qs.mp.common.utils.StringUtils;
|
|
@@ -118,7 +119,7 @@ public class CdKeyMgrController extends BaseController {
|
|
|
if (CollectionUtils.isNotEmpty(cdKeyGroupList)) {
|
|
|
cdKeyGroupList.forEach(cdKeyGroupVO -> {
|
|
|
Channel channel = channelService.getById(cdKeyGroupVO.getChannelId());
|
|
|
- String siteName = channel.getSiteName() == null ? "-- " : channel.getSiteName();
|
|
|
+ String siteName = channel.getName() == null ? "-- " : channel.getName();
|
|
|
cdKeyGroupVO.setSiteName(siteName + "(" + channel.getMobile() + ")");
|
|
|
});
|
|
|
}
|
|
@@ -159,17 +160,17 @@ public class CdKeyMgrController extends BaseController {
|
|
|
@ApiResponse(code = 200, message = "查询成功", response = CdKeyExchangeVO.class)
|
|
|
)
|
|
|
public TableDataInfo exchangeDetail(@PathVariable String groupId) {
|
|
|
+ List<CdKey> cdKeyList = cdKeyService.list(new QueryWrapper<CdKey>().eq("group_id", groupId));
|
|
|
+ long unCashedCount = cdKeyList.stream().filter(cdKey -> CdKeyStatusEnum.UNCASHED.getValue().equals(cdKey.getStatus())).count();
|
|
|
+ long cashedCount = cdKeyList.stream().filter(cdKey -> CdKeyStatusEnum.CASHED.getValue().equals(cdKey.getStatus())).count();
|
|
|
startPage();
|
|
|
List<CdKeyExchangeVO> cdKeyExchangeVOList = cdKeyService.listCdKeyExchangeVO(new QueryWrapper<CdKey>().eq("t1.group_id", groupId).orderByDesc("t2.exchange_time"));
|
|
|
- long unCashedCount = cdKeyExchangeVOList.stream().filter(cdKey -> CdKeyStatusEnum.UNCASHED.getValue().equals(cdKey.getStatus())).count();
|
|
|
- long cashedCount = cdKeyExchangeVOList.stream().filter(cdKey -> CdKeyStatusEnum.CASHED.getValue().equals(cdKey.getStatus())).count();
|
|
|
cdKeyExchangeVOList.forEach(cdKeyExchangeVO -> {
|
|
|
cdKeyExchangeVO.setRemainQty((int) unCashedCount);
|
|
|
cdKeyExchangeVO.setCashedQty((int) cashedCount);
|
|
|
});
|
|
|
- TableDataInfo resp = getDataTable(cdKeyExchangeVOList);
|
|
|
- resp.setRows(cdKeyExchangeVOList);
|
|
|
- return resp;
|
|
|
+ return getDataTable(cdKeyExchangeVOList);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@ApiOperation("导出兑换码订单")
|
|
@@ -181,9 +182,12 @@ public class CdKeyMgrController extends BaseController {
|
|
|
cdKeyExportList.forEach(cdKey -> {
|
|
|
CdKeyOrderExcel cdKeyOrderExcel = new CdKeyOrderExcel();
|
|
|
cdKeyOrderExcel.setCdKey(cdKey.getCdKey());
|
|
|
- List<CdKeyGroupGoods> goodsList = cdKeyGroupGoodsService.list(new QueryWrapper<CdKeyGroupGoods>().eq("ref_id", cdKey.getRefId()));
|
|
|
- cdKeyOrderExcel.setGoodsName(goodsList.get(0).getTitle());
|
|
|
- String picUrl = "https://" + publicBucketName + ".cos." + region + ".myqcloud.com/" + goodsList.get(0).getPicUrl();
|
|
|
+ if (CdKeyGroupGoodsTypeEnum.COIN.equals(cdKey.getType())) {
|
|
|
+ cdKeyOrderExcel.setGoodsName(cdKey.getGoodsName() + " x" + cdKey.getValue());
|
|
|
+ } else {
|
|
|
+ cdKeyOrderExcel.setGoodsName(cdKey.getGoodsName());
|
|
|
+ }
|
|
|
+ String picUrl = "https://" + publicBucketName + ".cos." + region + ".myqcloud.com/" + cdKey.getPicUrl();
|
|
|
cdKeyOrderExcel.setPicUrl(picUrl);
|
|
|
excelList.add(cdKeyOrderExcel);
|
|
|
});
|