|
|
package com.yohoufo.order.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
|
|
|
import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
|
|
|
import com.yohobuy.ufo.model.order.bo.DepositProductBo;
|
|
|
import com.yohobuy.ufo.model.order.resp.PageResp;
|
|
|
import com.yohoufo.common.exception.UfoServiceException;
|
|
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.StorageDepositMapper;
|
...
|
...
|
@@ -43,10 +45,10 @@ public class DepositServiceImpl implements DepositService { |
|
|
|
|
|
|
|
|
@Override
|
|
|
public List<DepositProductBo> queryUserDoposit(Integer uid, Integer page, Integer limit) {
|
|
|
public PageResp<List<DepositProductBo>> queryUserDoposit(Integer uid, Integer page, Integer limit) {
|
|
|
int count = storageDepositMapper.queryUserDepositProductCount(uid);
|
|
|
if (count == 0) {
|
|
|
return new ArrayList<>();
|
|
|
return new PageResp<>();
|
|
|
}
|
|
|
List<Integer> productIdList = storageDepositMapper.queryUserDepositProductId(uid, (page - 1) * limit, limit);
|
|
|
LOGGER.info("productIdList is {}", productIdList);
|
...
|
...
|
@@ -75,14 +77,20 @@ public class DepositServiceImpl implements DepositService { |
|
|
}
|
|
|
result.add(bo);
|
|
|
}
|
|
|
return result;
|
|
|
PageResp resp = new PageResp();
|
|
|
resp.setData(result);
|
|
|
resp.setPage(page);
|
|
|
resp.setPageSize(limit);
|
|
|
resp.setPagetotal((int) Math.ceil(count * 1.0 / limit));
|
|
|
resp.setTotal(count);
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<DepositDetailBo> queryUserDopositBackDetail(Integer uid, Integer page, Integer limit) {
|
|
|
public PageResp<List<DepositDetailBo>> queryUserDopositBackDetail(Integer uid, Integer page, Integer limit) {
|
|
|
int count = storageDepositMapper.queryUserDopositBackCount(uid);
|
|
|
if (count == 0) {
|
|
|
return new ArrayList<>();
|
|
|
return new PageResp<>();
|
|
|
}
|
|
|
// 召回或者到期退回的
|
|
|
List<StorageDeposit> depositList = storageDepositMapper.queryUserDopositBack(uid, (page - 1) * limit, limit);
|
...
|
...
|
@@ -105,15 +113,21 @@ public class DepositServiceImpl implements DepositService { |
|
|
bo.setButtons(Arrays.asList(ButtonShowBo.detail()));
|
|
|
result.add(bo);
|
|
|
}
|
|
|
return result;
|
|
|
PageResp resp = new PageResp();
|
|
|
resp.setData(result);
|
|
|
resp.setPage(page);
|
|
|
resp.setPageSize(limit);
|
|
|
resp.setPagetotal((int) Math.ceil(count * 1.0 / limit));
|
|
|
resp.setTotal(count);
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
// 寄存中
|
|
|
@Override
|
|
|
public List<DepositDetailBo> queryUserProductDopositingDetail(Integer uid, Integer productId, Integer page, Integer limit) {
|
|
|
public PageResp<List<DepositDetailBo>> queryUserProductDopositingDetail(Integer uid, Integer productId, Integer page, Integer limit) {
|
|
|
int count = storageDepositMapper.queryUserProductDopositingCount(uid, productId);
|
|
|
if (count == 0) {
|
|
|
return new ArrayList<>();
|
|
|
return new PageResp<>();
|
|
|
}
|
|
|
List<StorageDeposit> depositList = storageDepositMapper.queryUserProductDopositing(uid, productId, (page - 1) * limit, limit);
|
|
|
List<Integer> skupList = depositList.stream().map(StorageDeposit::getSkup).collect(Collectors.toList());
|
...
|
...
|
@@ -140,7 +154,13 @@ public class DepositServiceImpl implements DepositService { |
|
|
bo.setButtons(Arrays.asList(ButtonShowBo.back(), ButtonShowBo.addDepositDays(), depo.getOrderStatus() == 0 ? ButtonShowBo.grounding() : ButtonShowBo.detail("详情")));
|
|
|
result.add(bo);
|
|
|
}
|
|
|
return result;
|
|
|
PageResp resp = new PageResp();
|
|
|
resp.setData(result);
|
|
|
resp.setPage(page);
|
|
|
resp.setPageSize(limit);
|
|
|
resp.setPagetotal((int) Math.ceil(count * 1.0 / limit));
|
|
|
resp.setTotal(count);
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
public DepositProductBo queryUserDepositProductCountInfo(Integer uid, Integer productId) {
|
...
|
...
|
|