Authored by qinchao

Merge branch 'test6.8.2' of http://git.yoho.cn/ufo/yohoufo-fore into test6.8.2

... ... @@ -216,7 +216,6 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
//发布支付超时取消消息
pushAutoCancelEvent(context);
// 发消息
GoodsInfo goodsInfo = context.getSoldProduct();
OrderSubmitResp resp = OrderSubmitResp.builder().orderCode(orderCode).productId(goodsInfo.getProductId()).build();
... ... @@ -235,13 +234,11 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
if(isEntryShop){
log.info("in publishPrd use batchPublishPrds, req {}", req);
resp = batchPublishPrds(context, req);
}else{
log.info("in publishPrd use publishSinglePrd, req {}", req);
resp = publishSinglePrd(req, context);
cacheCleaner.cleanList(req.getUid(), TabType.SELL.getValue());
}
return resp;
}
... ... @@ -263,8 +260,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
int uid = req.getUid();
SellerOrderComputeResult socr = ctx.getSellerOrderComputeResult();
BigDecimal singleEarestMoney = socr.getEarnestMoney().getEarnestMoney();
BigDecimal mEarestMoney = BigDecimalHelper.halfUp(new BigDecimal(num).multiply(singleEarestMoney));
BigDecimal mEarestMoney = sellerOrderPrepareProcessor.checkNGetMergeEarnestMoney(uid, singleEarestMoney, num, ctx.getSalePrice());
SellerWalletDetail.Type swdType = SellerWalletDetail.Type.PUBLISH;
MerchantOrderAttachInfo moai = MerchantOrderAttachInfo.builder().uid(uid)
.storageId(ctx.getStorageId()).earnestMoney(mEarestMoney)
... ...
... ... @@ -361,4 +361,18 @@ public class ProductController {
return new ApiResponse(code, e.getMessage(), Boolean.FALSE);
}
}
@ApiOperation(name = "ufo.product.storageInfo", desc="再次出售商品,卖家出售的价格区间 供app调用")
@RequestMapping(params = "method=ufo.product.storageInfo")
@Cachable(expire = 180)
public ApiResponse queryStorageBaseInfoEx(@RequestParam(value = "storage_id") Integer storageId) {
if (storageId == null) {
LOG.info("in method=ufo.product.storageInfo storageId Is Null");
return null;
}
LOG.info("in method=ufo.product.storageInfo storageId = {}", storageId);
StorageLeastPriceResp resp = productService.querStorageLeastPriceEx(storageId);
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("storage data").build();
}
}
\ No newline at end of file
... ...
... ... @@ -21,4 +21,7 @@ public class StorageLeastPriceResp {
@JSONField(name="suggest_high_price")
private BigDecimal suggestHighPrice;
@JSONField(name="product_max_price")
private BigDecimal productMaxPrice = new BigDecimal(100000); //默认商品的最高售价
}
... ...
... ... @@ -58,4 +58,11 @@ public interface ProductService {
* @return
*/
int sellerBatchUpdatePrice(List<Integer> skupList, Double price);
/**
* 根据storageId查询建议价格,商品最高售价,skup出售价格
* @param storageId
* @return
*/
StorageLeastPriceResp querStorageLeastPriceEx(Integer storageId);
}
... ...
... ... @@ -124,21 +124,36 @@ public class ProductServiceImpl implements ProductService{
@Override
public StorageLeastPriceResp queryStorageLeastPrice(Integer storageId) {
StoragePrice storagePrice = storagePriceMapper.selectLeastPrice(storageId);
if (storagePrice == null) {
return null;
}
StorageLeastPriceResp resp = new StorageLeastPriceResp();
resp.setStorageId(storageId);
resp.setLeastPrice(storagePrice.getPrice());
resp.setSkup(storagePrice.getSkup());
return resp;
}
public StorageLeastPriceResp querStorageLeastPriceEx(Integer storageId) {
Storage storage = storageMapper.selectByPrimaryKey(storageId);
if (null == storage) {
LOGGER.warn("storageMapper.selectByPrimaryKey is null, storageId is {}", storageId);
return null;
return new StorageLeastPriceResp();
}
StoragePrice storagePrice = storagePriceMapper.selectLeastPrice(storageId);
StorageLeastPriceResp resp = new StorageLeastPriceResp();
if (storagePrice == null) {
resp.setSuggestHighPrice(storage.getSuggestHighPrice());
resp.setSuggestLowPrice(storage.getSuggestLowPrice());
return resp;
}
resp.setStorageId(storageId);
resp.setLeastPrice(storagePrice.getPrice());
resp.setSkup(storagePrice.getSkup());
resp.setSuggestLowPrice(storage.getSuggestLowPrice());
resp.setSuggestHighPrice(storage.getSuggestHighPrice());
// 如果最低价高于建议售价,则相当于没有此库存
if (null != storagePrice && (null == storage.getSuggestHighPrice() || (null != storage.getSuggestHighPrice() && storagePrice.getPrice().compareTo(storage.getSuggestHighPrice()) <= 0))) {
resp.setLeastPrice(storagePrice.getPrice());
resp.setSkup(storagePrice.getSkup());
}
return resp;
}
... ... @@ -583,13 +598,19 @@ public class ProductServiceImpl implements ProductService{
Map<Integer, StoragePrice> storagePriceMap = getStoragePriceMap(storageList);
for (Storage storage : storageList) {
StoragePrice storagePrice = storagePriceMap.get(storage.getId());
//高于建议价,不展示skup
if(null != storagePrice && null != storage.getSuggestHighPrice() && storagePrice.getPrice().compareTo(storage.getSuggestHighPrice()) > 0) {
continue;
}
GoodsSize goodsSize = new GoodsSize();
goodsSize.setId(storage.getId());
goodsSize.setSizeId(storage.getSizeId());
Size size = sizeMap.get(storage.getSizeId());
goodsSize.setSizeName(size == null ? "" : size.getSizeName());
goodsSize.setOrderBy(size == null ? 0 : size.getOrderBy());
StoragePrice storagePrice = storagePriceMap.get(storage.getId());
goodsSize.setLeastPrice(storagePrice == null ? null : storagePrice.getPrice());
goodsSize.setStatus(storagePrice == null ? null : storagePrice.getStatus());
goodsSize.setStorageNum(storagePrice == null ? 0 : storage.getStorageNum());
... ...