在线超市,库存商品选择分页
This commit is contained in:
1 parent
e250a1083c
commit
8bac74233c
23 files changed
+210
-55
No files matched your search
+6
-6
@@ -26,7 +26,7 @@ import com.bsd.pjcloud.hard.mapper.order.HardOrderMapper;
|
||||
import com.bsd.pjcloud.hard.mapper.order.HardParentCarMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardCarService;
|
||||
import com.bsd.pjcloud.supermarket.api.feign.RemoteSupermarketUnitSkuService;
|
||||
import com.bsd.pjcloud.supermarket.vo.SupermarketUnitWithSpuVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpUnitWithSpuVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -77,7 +77,7 @@ public class HardCarServiceImpl extends ServiceImpl<HardCarMapper, HardCarEntity
|
||||
}
|
||||
// 超市线上、线下
|
||||
if (ObjectUtil.equals(HardTypeEnum.SUPERMARKET, hardTypeEnum)) {
|
||||
List<SupermarketUnitWithSpuVo> supList = supermarketUnitSkuService.getSupermarketUnits(productIds).getData();
|
||||
List<SmErpUnitWithSpuVo> supList = supermarketUnitSkuService.getSupermarketUnits(productIds).getData();
|
||||
for (HardCarVo v : resultList) {
|
||||
supList.stream().filter(i -> ObjectUtil.equals(i.getId(), v.getProductId())).findFirst().ifPresent(spu -> {
|
||||
v.setSpuId(spu.getSpuId());
|
||||
@@ -161,7 +161,7 @@ public class HardCarServiceImpl extends ServiceImpl<HardCarMapper, HardCarEntity
|
||||
case SUPERMARKET -> {
|
||||
// 查询超市商品
|
||||
AtomicInteger supermarketTotalPrice = new AtomicInteger();
|
||||
List<SupermarketUnitWithSpuVo> supList = supermarketUnitSkuService.getSupermarketUnits(productIds).getData();
|
||||
List<SmErpUnitWithSpuVo> supList = supermarketUnitSkuService.getSupermarketUnits(productIds).getData();
|
||||
for (HardCreateCarDto v : list) {
|
||||
supList.stream().filter(i -> ObjectUtil.equals(i.getId(), v.getProductId())).findFirst().ifPresent(spu -> {
|
||||
Integer price = getSupermarket(spu);
|
||||
@@ -233,7 +233,7 @@ public class HardCarServiceImpl extends ServiceImpl<HardCarMapper, HardCarEntity
|
||||
// 超市
|
||||
if (ObjectUtil.equals(sysType, HardTypeEnum.SUPERMARKET)) {
|
||||
List<HardCarEntity> carObjectList = new ArrayList<>();
|
||||
List<SupermarketUnitWithSpuVo> supList = supermarketUnitSkuService.getSupermarketUnits(productIds).getData();
|
||||
List<SmErpUnitWithSpuVo> supList = supermarketUnitSkuService.getSupermarketUnits(productIds).getData();
|
||||
for (HardCreateCarDto v : productList) {
|
||||
HardCarEntity item = HardCarEntity.builder().parentCarId(parentCarId).build();
|
||||
supList.stream().filter(i -> ObjectUtil.equals(i.getId(), v.getProductId())).findFirst().ifPresent(spu -> {
|
||||
@@ -281,7 +281,7 @@ public class HardCarServiceImpl extends ServiceImpl<HardCarMapper, HardCarEntity
|
||||
}
|
||||
// 超市
|
||||
if (ObjectUtil.equals(sysType, HardTypeEnum.SUPERMARKET)) {
|
||||
List<SupermarketUnitWithSpuVo> supList = supermarketUnitSkuService.getSupermarketUnits(productIds).getData();
|
||||
List<SmErpUnitWithSpuVo> supList = supermarketUnitSkuService.getSupermarketUnits(productIds).getData();
|
||||
for (HardCreateCarDto v : list) {
|
||||
supList.stream().filter(i -> ObjectUtil.equals(i.getId(), v.getProductId())).findFirst().ifPresent(spu -> {
|
||||
str.append(spu.getProductName()).append("x").append(v.getProductCount()).append(";");
|
||||
@@ -301,7 +301,7 @@ public class HardCarServiceImpl extends ServiceImpl<HardCarMapper, HardCarEntity
|
||||
);
|
||||
}
|
||||
|
||||
private Integer getSupermarket(SupermarketUnitWithSpuVo vo) {
|
||||
private Integer getSupermarket(SmErpUnitWithSpuVo vo) {
|
||||
if (ObjectUtil.isEmpty(vo)) return 0;
|
||||
if (ObjectUtil.isNotEmpty(vo.getPromotionPrice()) && !ObjectUtil.equals(vo.getPromotionPrice(), 0)) {
|
||||
return vo.getPromotionPrice();
|
||||
|
||||
Reference in new issue
Block a user