|
@@ -10,6 +10,7 @@ import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionStorageInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionStorageInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseView;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseView;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView;
|
|
import com.yh.saas.plugin.yiliangyiyun.exception.YException;
|
|
import com.yh.saas.plugin.yiliangyiyun.exception.YException;
|
|
import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.WarehouseBaseInfoMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.WarehouseBaseInfoMapper;
|
|
@@ -60,7 +61,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
for (WarehouseBaseInfo warehouseBaseInfo : warehouseBaseInfoList) {
|
|
for (WarehouseBaseInfo warehouseBaseInfo : warehouseBaseInfoList) {
|
|
// 以库位为维度查询
|
|
// 以库位为维度查询
|
|
List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
|
|
List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
|
|
- .eq("comp_id", compId).eq("base_id", warehouseBaseInfo.getId()));
|
|
|
|
|
|
+ .eq("base_id", warehouseBaseInfo.getId()));
|
|
if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
|
|
if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
|
|
for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfos) {
|
|
for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfos) {
|
|
WarehouseView warehouseView = new WarehouseView();
|
|
WarehouseView warehouseView = new WarehouseView();
|
|
@@ -75,15 +76,19 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
String storage = "";
|
|
String storage = "";
|
|
//定义入库
|
|
//定义入库
|
|
String inNetWeight = "";
|
|
String inNetWeight = "";
|
|
|
|
+ // 子集合
|
|
|
|
+ List<WarehouseNumView> warehouseNumViewList = new ArrayList<>();
|
|
// 查询入库数量
|
|
// 查询入库数量
|
|
List<WarehouseInOutInfo> warehouseInOutInfoList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
|
|
List<WarehouseInOutInfo> warehouseInOutInfoList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
|
|
.eq("position_id", warehousePositionInfo.getId()).eq("in_out_flag", "2").groupBy("goods_name_key").orderBy("goods_name_key"));
|
|
.eq("position_id", warehousePositionInfo.getId()).eq("in_out_flag", "2").groupBy("goods_name_key").orderBy("goods_name_key"));
|
|
if (!CollectionUtils.isEmpty(warehouseInOutInfoList)) {
|
|
if (!CollectionUtils.isEmpty(warehouseInOutInfoList)) {
|
|
|
|
+ WarehouseNumView warehouseNumView = new WarehouseNumView();
|
|
for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList) {
|
|
for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList) {
|
|
// 查询入库数量
|
|
// 查询入库数量
|
|
List<WarehouseInOutInfo> warehouseInOutInfoAllList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
|
|
List<WarehouseInOutInfo> warehouseInOutInfoAllList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
|
|
.eq("position_id", warehousePositionInfo.getId()).eq("in_out_flag", "2")
|
|
.eq("position_id", warehousePositionInfo.getId()).eq("in_out_flag", "2")
|
|
.eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
|
|
.eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
|
|
|
|
+
|
|
if (!CollectionUtils.isEmpty(warehouseInOutInfoAllList)) {
|
|
if (!CollectionUtils.isEmpty(warehouseInOutInfoAllList)) {
|
|
Float netWeight = 0f;
|
|
Float netWeight = 0f;
|
|
for (WarehouseInOutInfo warehouse : warehouseInOutInfoAllList) {
|
|
for (WarehouseInOutInfo warehouse : warehouseInOutInfoAllList) {
|
|
@@ -92,17 +97,20 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
count++;
|
|
count++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- inNetWeight = inNetWeight + warehouseInOutInfo.getGoodsName() + "(" + netWeight + ") ";
|
|
|
|
|
|
+ warehouseNumView.setGoodsName(warehouseInOutInfoAllList.get(0).getGoodsName());
|
|
|
|
+ warehouseNumView.setInNetWeight(String.valueOf(netWeight));
|
|
|
|
+ inNetWeight = String.valueOf(netWeight);
|
|
}
|
|
}
|
|
// 查询应余量
|
|
// 查询应余量
|
|
WarehousePositionStorageInfo warehousePositionStorageInfo = warehousePositionStorageInfoService.selectOne(new EntityWrapper<WarehousePositionStorageInfo>()
|
|
WarehousePositionStorageInfo warehousePositionStorageInfo = warehousePositionStorageInfoService.selectOne(new EntityWrapper<WarehousePositionStorageInfo>()
|
|
.eq("position_id", warehouseInOutInfo.getPositionId()).eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
|
|
.eq("position_id", warehouseInOutInfo.getPositionId()).eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
|
|
- storage = storage + warehousePositionStorageInfo.getGoodsName() + "(" + warehousePositionStorageInfo.getStorage() + ")";
|
|
|
|
-
|
|
|
|
|
|
+ storage = String.valueOf(warehousePositionStorageInfo.getStorage());
|
|
|
|
+ warehouseView.setStorage(storage);
|
|
|
|
+ warehouseView.setInNetWeight(inNetWeight);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
- warehouseView.setStorage(storage);
|
|
|
|
- warehouseView.setInNetWeight(inNetWeight);
|
|
|
|
|
|
+
|
|
//定义出库
|
|
//定义出库
|
|
String outNetWeight = "";
|
|
String outNetWeight = "";
|
|
// 查询出库数量
|
|
// 查询出库数量
|
|
@@ -120,13 +128,22 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
count++;
|
|
count++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- outNetWeight = outNetWeight + warehouseInOutInfo.getGoodsName() + "(" + netWeight + ") ";
|
|
|
|
|
|
+
|
|
|
|
+ outNetWeight = outNetWeight + netWeight;
|
|
|
|
+ }
|
|
|
|
+ for(WarehouseNumView warehouseNumView : warehouseNumViewList){
|
|
|
|
+ if(warehouseNumView.getGoodsName().equals(warehouseInOutInfos.get(0).getGoodsName())){
|
|
|
|
+ warehouseNumView.setOutNetWeight(String.valueOf(outNetWeight));
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
warehouseView.setOutNetWeight(outNetWeight);
|
|
warehouseView.setOutNetWeight(outNetWeight);
|
|
warehouseView.setNumber(count);
|
|
warehouseView.setNumber(count);
|
|
|
|
+ warehouseView.setWarehouseNumViewList(warehouseNumViewList);
|
|
warehouseViews.add(warehouseView);
|
|
warehouseViews.add(warehouseView);
|
|
|
|
|
|
}
|
|
}
|