|
@@ -56,7 +56,11 @@ public class BiInfoController {
|
|
|
@Autowired
|
|
|
private ICostManagementInfoService costManagementInfoService;
|
|
|
@Autowired
|
|
|
+ private IWarehousePositionStorageInfoService warehousePositionStorageInfoService;
|
|
|
+ @Autowired
|
|
|
private IWarehouseBaseInfoService warehouseBaseInfoService;
|
|
|
+ @Autowired
|
|
|
+ private IWeighingManagementService weighingManagementService;
|
|
|
private String companyId;
|
|
|
|
|
|
/**
|
|
@@ -169,28 +173,35 @@ public class BiInfoController {
|
|
|
//
|
|
|
// }
|
|
|
// }
|
|
|
- List<CostManagementInfo> costManagementInfos = costManagementInfoService.selectList(costManagementInfoEntityWrapper);
|
|
|
- Double sumTotal = 0d;
|
|
|
- Double sumCost = 0d;
|
|
|
- if (CollectionUtils.isNotEmpty(costManagementInfos)) {
|
|
|
- for (int i = 0; i < costManagementInfos.size(); i++) {
|
|
|
- CostManagementInfo costManagementInfo = costManagementInfos.get(i);
|
|
|
- sumTotal = sumTotal + costManagementInfo.getStorage();
|
|
|
- sumCost = sumCost + (costManagementInfo.getStorage() * costManagementInfo.getCost());
|
|
|
- }
|
|
|
- }
|
|
|
+// List<CostManagementInfo> costManagementInfos = costManagementInfoService.selectList(costManagementInfoEntityWrapper);
|
|
|
+ Double sumAct = warehousePositionStorageInfoService.selectSumStoreage(companyId);
|
|
|
+ Double sumBuy = contractManagementInfoService.selectSumBuy(companyId);
|
|
|
+ Double sumSale = contractManagementInfoService.selectSumSale(companyId);
|
|
|
+// if (CollectionUtils.isNotEmpty(costManagementInfos)) {
|
|
|
+// for (int i = 0; i < costManagementInfos.size(); i++) {
|
|
|
+// CostManagementInfo costManagementInfo = costManagementInfos.get(i);
|
|
|
+// sumTotal = sumTotal + costManagementInfo.getStorage();
|
|
|
+// sumCost = sumCost + (costManagementInfo.getStorage() * costManagementInfo.getCost());
|
|
|
+// }
|
|
|
+// }
|
|
|
List<BiViewInfo> biViewInfoList = new ArrayList<>();
|
|
|
BiViewInfo biViewInfo = new BiViewInfo();
|
|
|
BiViewInfo biViewInfo1 = new BiViewInfo();
|
|
|
BiViewInfo biViewInfo2 = new BiViewInfo();
|
|
|
+ BiViewInfo biViewInfo0 = new BiViewInfo();
|
|
|
biViewInfo.setBiType("8-库存成本");
|
|
|
- biViewInfo1.setName("总库存量");
|
|
|
- biViewInfo1.setCount(String.valueOf(sumTotal));
|
|
|
- biViewInfo2.setName("库存价值");
|
|
|
- BigDecimal bg = new BigDecimal(sumCost);
|
|
|
+ biViewInfo1.setName("实际库存");
|
|
|
+ BigDecimal bg = new BigDecimal(sumAct);
|
|
|
+ biViewInfo1.setCount(String.valueOf(bg));
|
|
|
+ biViewInfo2.setName("采购待执行");
|
|
|
+ bg = new BigDecimal(sumBuy);
|
|
|
biViewInfo2.setCount(String.valueOf(bg));
|
|
|
+ biViewInfo0.setName("销售待执行");
|
|
|
+ bg = new BigDecimal(sumSale);
|
|
|
+ biViewInfo0.setCount(String.valueOf(bg));
|
|
|
biViewInfoList.add(biViewInfo1);
|
|
|
biViewInfoList.add(biViewInfo2);
|
|
|
+ biViewInfoList.add(biViewInfo0);
|
|
|
biViewInfo.setBiViewInfoList(biViewInfoList);
|
|
|
biViewInfos.add(biViewInfo);
|
|
|
|
|
@@ -251,29 +262,30 @@ public class BiInfoController {
|
|
|
// 今日装车
|
|
|
int inCount = tranCarInfoService.selectCount(new EntityWrapper<TranCarInfo>()
|
|
|
.eq("status_flag", "3")
|
|
|
- .eq("comp_id", companyId)
|
|
|
- .ge("update_date", DateUtil.formatDate(new Date(), DateUtils.DATE_FMT_YYYY_MM_DD)));
|
|
|
+ .eq("comp_id", companyId));
|
|
|
//今日在途
|
|
|
- int inAfterCount = tranCarInfoService.selectCount(new EntityWrapper<TranCarInfo>()
|
|
|
- .eq("status_flag", "3")
|
|
|
- .eq("comp_id", companyId)
|
|
|
- .lt("update_date", DateUtil.formatDate(new Date(), DateUtils.DATE_FMT_YYYY_MM_DD)));
|
|
|
+// int inAfterCount = tranCarInfoService.selectCount(new EntityWrapper<TranCarInfo>()
|
|
|
+// .eq("status_flag", "3")
|
|
|
+// .eq("comp_id", companyId)
|
|
|
+// .lt("update_date", DateUtil.formatDate(new Date(), DateUtils.DATE_FMT_YYYY_MM_DD)));
|
|
|
+ int inAfterCount = warehouseInOutInfoService.selectCountCompany(companyId,"出库");
|
|
|
//今日卸车
|
|
|
- int outCount = tranCarInfoService.selectCount(new EntityWrapper<TranCarInfo>()
|
|
|
- .eq("status_flag", "5")
|
|
|
- .eq("comp_id", companyId)
|
|
|
- .ge("update_date", DateUtil.formatDate(new Date(), DateUtils.DATE_FMT_YYYY_MM_DD)));
|
|
|
+ int outCount = warehouseInOutInfoService.selectCountCompany(companyId,"入库");
|
|
|
+ int outCount1 = weighingManagementService.selectCount(new EntityWrapper<WeighingManagement>()
|
|
|
+ .le("status_flag", "3")
|
|
|
+ .eq("delete_flag", "0")
|
|
|
+ .eq("comp_id", companyId));
|
|
|
BiViewInfo biViewInfo = new BiViewInfo();
|
|
|
BiViewInfo biViewInfo1 = new BiViewInfo();
|
|
|
BiViewInfo biViewInfo2 = new BiViewInfo();
|
|
|
BiViewInfo biViewInfo3 = new BiViewInfo();
|
|
|
biViewInfo.setBiType("7-车辆信息");
|
|
|
biViewInfo1.setName("在途车辆");
|
|
|
- biViewInfo1.setCount(String.valueOf(inCount + inAfterCount));
|
|
|
+ biViewInfo1.setCount(String.valueOf(inCount));
|
|
|
biViewInfo2.setName("装货车辆");
|
|
|
- biViewInfo2.setCount(String.valueOf(inCount));
|
|
|
+ biViewInfo2.setCount(String.valueOf(inAfterCount));
|
|
|
biViewInfo3.setName("卸货车辆");
|
|
|
- biViewInfo3.setCount(String.valueOf(outCount));
|
|
|
+ biViewInfo3.setCount(String.valueOf(outCount+outCount1));
|
|
|
biViewInfoList.add(biViewInfo1);
|
|
|
biViewInfoList.add(biViewInfo2);
|
|
|
biViewInfoList.add(biViewInfo3);
|