Browse Source

Merge remote-tracking branch 'origin/master' into master-碰一下

tanbin 9 tháng trước cách đây
mục cha
commit
34836b862c

+ 5 - 2
device-api-service/src/main/java/com/xy/service/DeviceInfoServiceImpl.java

@@ -1346,6 +1346,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
                 if (CollUtil.isNotEmpty(deviceIdGoodsMap)) {
                     List<GoodsDeviceDto.Vo> goodsDevice = deviceIdGoodsMap.get(dId);
                     if (CollUtil.isNotEmpty(goodsDevice)) {
+                        //过滤商品id为1 和 2的商品
+                        goodsDevice = goodsDevice.stream().filter(g -> g.getGoodsId() != 1 && g.getGoodsId() != 2).collect(Collectors.toList());
                         device.setOnSaleNum(goodsDevice.stream().mapToInt(GoodsDeviceDto.Vo::getStock).sum());
                         device.setFillNum(goodsDevice.stream().mapToInt(GoodsDeviceDto.Vo::getFillCount).sum());
                     }
@@ -1830,6 +1832,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
         Integer stock = 0;
         Integer afterFillStock = 0;
         if (CollUtil.isNotEmpty(goodsDeviceList)) {
+            //goodsDeviceList 过滤商品id=1和商品id=2的商品
+            goodsDeviceList = goodsDeviceList.stream().filter(g -> g.getGoodsId() != 1 && g.getGoodsId() != 2).collect(Collectors.toList());
             stock = goodsDeviceList.stream().mapToInt(GoodsDeviceDto.Vo::getStock).sum();
             afterFillStock = goodsDeviceList.stream().mapToInt(GoodsDeviceDto.Vo::getFillCount).sum();
         }
@@ -1879,8 +1883,7 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
                 .eq(DeviceInfo::getActiveState, DeviceActiveStateEnum.TRUE.getCode())
                 .eq(DeviceInfo::getBusyState, EnumDeviceBusyStatus.N_1.getCode())
                 .eq(DeviceInfo::getShowStatus, true)
-                .eq(DeviceInfo::getFreezeStatus, EnumDeviceFreezeStatus.N_1.getCode())
-                ;
+                .eq(DeviceInfo::getFreezeStatus, EnumDeviceFreezeStatus.N_1.getCode());
         List<DeviceInfo> list = list(lqw);
         if (!Emptys.check(list)) {
             return R.ok(new ArrayList<>());