Authored by TANLING

极速

... ... @@ -71,6 +71,14 @@ public interface SellerOrderGoodsMapper {
int selectCntByUid(@Param("uid")int uid);
int selectCntByUidAndAttr(@Param("uid")int uid, @Param("attributes") int attributes);
List<SellerOrderGoods> selectByUidAndAttr(@Param("uid")int uid,
@Param("attributes") int attributes,
@Param("offset")Integer offset,
@Param("limit")Integer limit);
int updateStatusBySkpu(SellerOrderGoods record);
int updateStatusAndUidBySkpu(SellerOrderGoods record);
... ...
... ... @@ -162,6 +162,18 @@
</select>
<select id="selectCntByUidAndAttr" resultType="java.lang.Integer">
select count(*) from seller_order_goods where uid = #{uid,jdbcType=INTEGER} and attributes = #{attributes,jdbcType=INTEGER}
</select>
<select id="selectByUidAndAttr" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from seller_order_goods
where uid = #{uid,jdbcType=INTEGER} and attributes = #{attributes,jdbcType=INTEGER}
order by id desc
limit #{offset, jdbcType=INTEGER}, #{limit, jdbcType=INTEGER}
</select>
<select id="selectMultiInfoBySkup" resultType="com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfDetailResp">
select
... ...
... ... @@ -4,6 +4,7 @@ import com.google.common.base.Throwables;
import com.yohobuy.ufo.model.order.req.*;
import com.yohobuy.ufo.model.order.resp.FastDeliveryBatchOnShelfResp;
import com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfDetailResp;
import com.yohobuy.ufo.model.order.vo.OrderGoodsListVo;
import com.yohobuy.ufo.model.response.StorageCheckResp;
import com.yohobuy.ufo.model.response.StorageInfoResp;
import com.yohoufo.common.ApiResponse;
... ... @@ -156,4 +157,23 @@ public class ErpFastDeliveryController {
return new ApiResponse.ApiResponseBuilder().data(data).code(200).build();
}
/**
* 查询极速商品
* @param req
* @return
*/
@IgnoreSignature
@IgnoreSession
@RequestMapping("/getOrderGoodsList")
public ApiResponse getOrderGoodsList(@RequestBody FastDeliveryGetShelfReq req){
logger.info("getOrderGoodsList param {}", req);
OrderGoodsListVo data = erpFastDeliveryService.getOrderGoodsList(req);
return new ApiResponse.ApiResponseBuilder().data(data).code(200).build();
}
}
... ...
... ... @@ -3,6 +3,7 @@ package com.yohoufo.order.service;
import com.yohobuy.ufo.model.order.req.*;
import com.yohobuy.ufo.model.order.resp.FastDeliveryBatchOnShelfResp;
import com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfDetailResp;
import com.yohobuy.ufo.model.order.vo.OrderGoodsListVo;
import com.yohobuy.ufo.model.response.StorageCheckResp;
import com.yohobuy.ufo.model.response.StorageInfoResp;
... ... @@ -50,4 +51,7 @@ public interface IErpFastDeliveryService {
* @return
*/
public List<StorageCheckResp> getStorageInfo(FastDeliveryBatchOnShelfReq req);
public OrderGoodsListVo getOrderGoodsList(FastDeliveryGetShelfReq request);
}
... ...
... ... @@ -6,6 +6,7 @@ import com.google.common.collect.Lists;
import com.yohobuy.ufo.model.ProductInfo;
import com.yohobuy.ufo.model.enums.StorageCheckEnum;
import com.yohobuy.ufo.model.order.bo.SellerBo;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.SellerFuncEnum;
import com.yohobuy.ufo.model.order.common.SkupStatus;
... ... @@ -13,6 +14,8 @@ import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.req.*;
import com.yohobuy.ufo.model.order.resp.*;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohobuy.ufo.model.order.vo.OrderGoodsInfo;
import com.yohobuy.ufo.model.order.vo.OrderGoodsListVo;
import com.yohobuy.ufo.model.request.product.ProductImportTranItemBo;
import com.yohobuy.ufo.model.request.product.ProductRequestBo;
import com.yohobuy.ufo.model.response.ProductDetailResp;
... ... @@ -25,6 +28,7 @@ import com.yohoufo.dal.order.model.*;
import com.yohoufo.order.common.BillTradeStatus;
import com.yohoufo.order.common.TradeType;
import com.yohoufo.order.model.dto.*;
import com.yohoufo.order.model.request.OrderListRequest;
import com.yohoufo.order.service.IErpFastDeliveryService;
import com.yohoufo.order.service.handler.SellerDecrPriceTaskHandler;
import com.yohoufo.order.service.handler.SellerDownShelfTaskHandler;
... ... @@ -44,6 +48,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -93,8 +98,6 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
@Autowired
PriceComputePrepareProcessor priceComputePrepareProcessor;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Autowired
private BuyerOrderMapper buyerOrderMapper;
... ... @@ -106,6 +109,9 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
private OrdersPayTransferMapper ordersPayTransferMapper;
@Autowired
SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Autowired
private TradeBillsMapper tradeBillsMapper;
private static final String ADDRESS_STR = "{\"address\":\"松金公路2758号sneakerburger仓储中心\",\"address_id\":17560803,\"area\":\"上海 金山区 张堰镇\",\"areaCode\":\"310116103\",\"consignee\":\"阿津\",\"isUpdate\":\"N\",\"mobile\":\"18121153590\",\"phone\":\"\",\"zipCode\":\"\"}";
... ... @@ -136,6 +142,51 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
/**
* 查询极速商品
* @param request
* @return
*/
public OrderGoodsListVo getOrderGoodsList(FastDeliveryGetShelfReq request){
if (request.getUid() < 0){
logger.warn("uid is empty");
throw new UfoServiceException(400, "参数[uid]不合法");
}
checkFastDeliveryAuth(request.getUid());
request.setPage(request.getPage()<=0?1:request.getPage());
request.setLimit(request.getLimit()<=0?10:request.getLimit());
int attr = OrderAttributes.FAST_DELIVERY.getCode();
int total = sellerOrderGoodsMapper.selectCntByUidAndAttr(request.getUid(), attr);
if (total == 0){
return null;
}
int offset = (request.getPage() - 1) * request.getLimit();
List<SellerOrderGoods> sellerOrderGoods = sellerOrderGoodsMapper.selectByUidAndAttr(request.getUid(), attr, offset, request.getLimit());
List<OrderGoodsInfo> goodsInfoList = sellerOrderGoods.stream().map(this::covertTo).collect(Collectors.toList());
return OrderGoodsListVo.builder()
.page(request.getPage())
.pageSize(request.getLimit())
.pagetotal(total)
.goodsInfoList(goodsInfoList)
.build();
}
public OrderGoodsInfo covertTo(SellerOrderGoods sellerOrderGoods){
OrderGoodsInfo orderGoodsInfo = new OrderGoodsInfo();
BeanUtils.copyProperties(sellerOrderGoods, orderGoodsInfo);
orderGoodsInfo.setStatusDesc(SkupStatus.getSkupStatus(orderGoodsInfo.getStatus()).getDesc());
return orderGoodsInfo;
}
/**
* 查询上架商品的信息
* @param req
*/
... ...