feat:共富商城适配订单
This commit is contained in:
1 parent
d53cfaadab
commit
d91a065976
2 files changed
+8
-4
No files matched your search
+8
-3
@@ -36,6 +36,7 @@ import com.bsd.pjcloud.supermarket.entity.ShopSkuEntity;
|
||||
import com.bsd.pjcloud.supermarket.vo.app.ShopSpuDetailAppVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpUnitWithSpuVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.mall.MallProductDetailAppVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.mall.MallProductSkuAppVo;
|
||||
import com.bsd.pjcloud.thirdparty.dto.pay.PayDto;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -422,11 +423,15 @@ public class HardCarServiceImpl extends ServiceImpl<HardCarMapper, HardCarEntity
|
||||
// 共富商城
|
||||
if (ObjectUtil.equals(sysType, HardTypeEnum.FARMER)) {
|
||||
List<HardCarEntity> carObjectList = new ArrayList<>();
|
||||
List<MallProductDetailAppVo> spuList = remoteMallProductService.getDetailByIds(productIds).getData();
|
||||
List<MallProductDetailAppVo> spuList = remoteMallProductService.getSkusWithSpuBySkuIds(productIds).getData();
|
||||
for (HardCreateCarDto v : productList) {
|
||||
HardCarEntity item = HardCarEntity.builder().parentCarId(parentCarId).build();
|
||||
spuList.stream().filter(i -> ObjectUtil.equals(i.getId(), v.getProductId())).findFirst().ifPresent(spu -> {
|
||||
Integer price = getSupermarket(spu);
|
||||
if (ObjectUtil.isEmpty(spu.getSkuList())) {
|
||||
throw new RuntimeException("共富商城商品无SKU信息商品名字:" + spu.getTitle() + "商品ID:" + spu.getId() + "请联系管理员");
|
||||
}
|
||||
MallProductSkuAppVo skuDetail = spu.getSkuList().get(0);
|
||||
Integer price = skuDetail.getPrice();
|
||||
int totalPrice = 0;
|
||||
if (ObjectUtil.isNotEmpty(v.getProductCount()) && !ObjectUtil.equals(v.getProductCount(), 0)) {
|
||||
// 按数量
|
||||
@@ -435,7 +440,7 @@ public class HardCarServiceImpl extends ServiceImpl<HardCarMapper, HardCarEntity
|
||||
// 按重量
|
||||
totalPrice = v.getProductWeight().multiply(BigDecimal.valueOf(price)).setScale(0, RoundingMode.CEILING).intValue();
|
||||
}
|
||||
item.setProductId(spu.getId());
|
||||
item.setProductId(skuDetail.getId());
|
||||
item.setProductName(spu.getTitle());
|
||||
item.setProductPrice(price);
|
||||
item.setProductPic(spu.getCoverImage());
|
||||
|
||||
-1
@@ -1317,7 +1317,6 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
List<MallProductStockChangeDTO.Item> itemList = carList.stream().map(v -> {
|
||||
MallProductStockChangeDTO.Item item = new MallProductStockChangeDTO.Item();
|
||||
item.setId(v.getProductId());
|
||||
item.setProductType(1);
|
||||
if (ObjectUtil.isNotEmpty(v.getProductCount()) && !ObjectUtil.equals(v.getProductCount(), 0)) {
|
||||
// 按数量
|
||||
int prouctCount = v.getProductCount();
|
||||
|
||||
Reference in new issue
Block a user