|
@@ -1,6 +1,7 @@
|
|
|
package com.yh.saas.plugin.yiliangyiyun.controller;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
@@ -9,14 +10,16 @@ import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.view.BiViewInfo;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.ContractManagementInfoMapper;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.mapper.WarehouseInOutInfoMapper;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.mapper.WarehousePositionStorageInfoMapper;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.*;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.util.Const;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.util.StringSizeUtil;
|
|
|
import jxl.Cell;
|
|
|
import jxl.Sheet;
|
|
|
import jxl.Workbook;
|
|
|
import jxl.read.biff.BiffException;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
-import org.apache.commons.httpclient.util.DateUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -28,7 +31,10 @@ import java.io.FileInputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.temporal.TemporalAdjusters;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -45,9 +51,9 @@ public class BiInfoController {
|
|
|
@Autowired
|
|
|
private IContractManagementInfoService contractManagementInfoService;
|
|
|
@Autowired
|
|
|
- private ContractManagementInfoMapper contractManagementInfoMapper;
|
|
|
+ private WarehouseInOutInfoMapper warehouseInOutInfoMapper;
|
|
|
@Autowired
|
|
|
- private ITranProcessInfoService tranProcessInfoService;
|
|
|
+ private IWarehousePositionStorageInfoService warehousePositionStorageInfoService;
|
|
|
@Autowired
|
|
|
private IWarehouseInOutInfoService warehouseInOutInfoService;
|
|
|
@Autowired
|
|
@@ -59,11 +65,11 @@ public class BiInfoController {
|
|
|
@Autowired
|
|
|
private ICostManagementInfoService costManagementInfoService;
|
|
|
@Autowired
|
|
|
- private IWarehousePositionStorageInfoService warehousePositionStorageInfoService;
|
|
|
+ private IWarehousePositionInfoService warehousePositionInfoService;
|
|
|
@Autowired
|
|
|
private IWarehouseBaseInfoService warehouseBaseInfoService;
|
|
|
@Autowired
|
|
|
- private IWeighingManagementService weighingManagementService;
|
|
|
+ private WarehousePositionStorageInfoMapper warehousePositionStorageInfoMapper;
|
|
|
@Autowired
|
|
|
private IStockSaleReceiptReportService stockSaleReceiptReportService;
|
|
|
@Autowired
|
|
@@ -74,22 +80,23 @@ public class BiInfoController {
|
|
|
|
|
|
//清理所有Redis缓存
|
|
|
@GetMapping("/clearCache")
|
|
|
- public void clearCache(){
|
|
|
+ public void clearCache() {
|
|
|
cacheComponent.delPrefixKey(Const.SELF_WAREHOUSE);
|
|
|
cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
|
|
|
cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
|
|
|
cacheComponent.delPrefixKey(Const.ADMIN_CONTRACTINFO);
|
|
|
cacheComponent.delPrefixKey(Const.ADMIN_BI_INFO);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 查询
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/selectBiInfo")
|
|
|
- public List<BiViewInfo> selectBiInfo(String compId,String seachMoth) {
|
|
|
- List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO,BiViewInfo.class);
|
|
|
- if(listRedis != null && listRedis.size() > 0 ){
|
|
|
+ public List<BiViewInfo> selectBiInfo(String compId, String seachMoth) {
|
|
|
+ List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO, BiViewInfo.class);
|
|
|
+ if (listRedis != null && listRedis.size() > 0) {
|
|
|
return listRedis;
|
|
|
}
|
|
|
companyId = compId;
|
|
@@ -98,12 +105,11 @@ public class BiInfoController {
|
|
|
EntityWrapper<ContractManagementInfo> contractManagementInfoEntityWrapper = new EntityWrapper<ContractManagementInfo>();
|
|
|
contractManagementInfoEntityWrapper.eq("status_flag", "1");
|
|
|
contractManagementInfoEntityWrapper.eq("comp_id", compId);
|
|
|
- if(seachMoth != null){
|
|
|
- if(!seachMoth.contains("-")){
|
|
|
- contractManagementInfoEntityWrapper .and("YEAR(create_date)='"+seachMoth+"'");
|
|
|
- }
|
|
|
- else{
|
|
|
- contractManagementInfoEntityWrapper .like("create_date",seachMoth+"%");
|
|
|
+ if (seachMoth != null) {
|
|
|
+ if (!seachMoth.contains("-")) {
|
|
|
+ contractManagementInfoEntityWrapper.and("YEAR(create_date)='" + seachMoth + "'");
|
|
|
+ } else {
|
|
|
+ contractManagementInfoEntityWrapper.like("create_date", seachMoth + "%");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -113,77 +119,152 @@ public class BiInfoController {
|
|
|
// 采购
|
|
|
getBuyInfo(contractManagementInfos, biViewInfos);
|
|
|
// 车辆
|
|
|
- getTranCount(biViewInfos,seachMoth);
|
|
|
+ getTranCount(biViewInfos, seachMoth);
|
|
|
// 库存成本
|
|
|
- getCostCount(biViewInfos,seachMoth);
|
|
|
+ getCostCount(biViewInfos, seachMoth);
|
|
|
// 库点流向
|
|
|
- getMapInfo(biViewInfos,seachMoth);
|
|
|
+ getMapInfo(biViewInfos, seachMoth);
|
|
|
// 收入支出毛利润
|
|
|
- getMoney(biViewInfos,seachMoth);
|
|
|
+ getMoney(biViewInfos, seachMoth);
|
|
|
|
|
|
- cacheComponent.putRaw(Const.ADMIN_BI_INFO, JSONObject.toJSONString(biViewInfos),60*60);
|
|
|
+ cacheComponent.putRaw(Const.ADMIN_BI_INFO, JSONObject.toJSONString(biViewInfos), 60 * 60);
|
|
|
return biViewInfos;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 查询
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/selectBiInfoNew")
|
|
|
- public List<BiViewInfo> selectBiInfoNew(String compId,String seachMoth) {
|
|
|
- List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO,BiViewInfo.class);
|
|
|
- if(listRedis != null && listRedis.size() > 0 ){
|
|
|
+ public List<BiViewInfo> selectBiInfoNew(String compId, String seachMoth) {
|
|
|
+ List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO, BiViewInfo.class);
|
|
|
+ if (listRedis != null && listRedis.size() > 0) {
|
|
|
// return listRedis;
|
|
|
}
|
|
|
companyId = compId;
|
|
|
List<BiViewInfo> biViewInfos = new ArrayList<>();
|
|
|
- Map<String, Object> pageView = new HashMap<>();
|
|
|
- // 公司ID
|
|
|
- pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
|
|
|
- pageView.put("seachMoth", seachMoth);
|
|
|
+ // 车辆
|
|
|
+ getTranCount(biViewInfos, seachMoth);
|
|
|
+ // 库存成本
|
|
|
+ getCostCount(biViewInfos, seachMoth);
|
|
|
+ // 库点流向
|
|
|
+ getMapInfo(biViewInfos, seachMoth);
|
|
|
+ // 出入库分布
|
|
|
+ getInOutInfo(biViewInfos);
|
|
|
+ // 合营比例
|
|
|
+ getHeYing(biViewInfos);
|
|
|
+ // 库存
|
|
|
+ getWarehouseStorge(biViewInfos);
|
|
|
+ // 合同
|
|
|
+ getcontract(biViewInfos);
|
|
|
+ // 在途
|
|
|
+ getTranProess(biViewInfos);
|
|
|
+
|
|
|
+ cacheComponent.putRaw(Const.ADMIN_BI_INFO, JSONObject.toJSONString(biViewInfos), 60 * 60);
|
|
|
+ return biViewInfos;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 合同
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<BiViewInfo> getcontract(List<BiViewInfo> biViewInfos) {
|
|
|
+ List<ContractManagementInfo> contractManagementInfoList = new ArrayList<>();
|
|
|
+ BiViewInfo biViewInfoa = new BiViewInfo();
|
|
|
+ List<ContractManagementInfo> contractManagementInfos = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
|
|
|
+ .eq("delete_flag", "0").eq("comp_id", companyId).orderBy("create_date", false));
|
|
|
+ if (CollectionUtils.isNotEmpty(contractManagementInfos)) {
|
|
|
+ for (int i = 0; i < 10; i++) {
|
|
|
+ if (contractManagementInfos.size() < i) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ contractManagementInfoList.add(contractManagementInfos.get(i));
|
|
|
+ }
|
|
|
|
|
|
- BiViewInfo biViewInfo = new BiViewInfo();
|
|
|
- BiViewInfo biViewInfo1 = new BiViewInfo();
|
|
|
- List<ContractManagementInfo> sellContractList = contractManagementInfoMapper.getSellContractList(pageView);
|
|
|
- biViewInfo.setBiType("销售合同");
|
|
|
- List<BiViewInfo> biViewInfoList = new ArrayList<>();
|
|
|
- for(ContractManagementInfo contractManagementInfo : sellContractList){
|
|
|
- biViewInfo1.setName(contractManagementInfo.getBuyer());
|
|
|
- biViewInfo1.setValue(contractManagementInfo.getWeight());
|
|
|
- biViewInfoList.add(biViewInfo1);
|
|
|
}
|
|
|
- biViewInfo.setBiViewInfoList(biViewInfoList);
|
|
|
- biViewInfos.add(biViewInfo);
|
|
|
+ biViewInfoa.setBiType("合同");
|
|
|
+ biViewInfoa.setContractManagementInfos(contractManagementInfoList);
|
|
|
+ biViewInfos.add(biViewInfoa);
|
|
|
+ return biViewInfos;
|
|
|
+ }
|
|
|
|
|
|
- List<ContractManagementInfo> buyContractList = contractManagementInfoMapper.getBuyContractList(pageView);
|
|
|
|
|
|
- BiViewInfo biViewInfo2 = new BiViewInfo();
|
|
|
- BiViewInfo biViewInfo3 = new BiViewInfo();
|
|
|
- biViewInfo2.setBiType("采购合同");
|
|
|
- List<BiViewInfo> biViewInfoList1 = new ArrayList<>();
|
|
|
- for(ContractManagementInfo contractManagementInfo : buyContractList){
|
|
|
- biViewInfo3.setName(contractManagementInfo.getSeller());
|
|
|
- biViewInfo3.setValue(contractManagementInfo.getWeight());
|
|
|
- biViewInfoList1.add(biViewInfo3);
|
|
|
+ /**
|
|
|
+ * 库存
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<BiViewInfo> getWarehouseStorge(List<BiViewInfo> biViewInfos) {
|
|
|
+ List<BiViewInfo> biViewInfoList = new ArrayList<>();
|
|
|
+ BiViewInfo biViewInfoa = new BiViewInfo();
|
|
|
+
|
|
|
+ // 查询库存
|
|
|
+ List<WarehouseBaseInfo> warehouseBaseInfoList = warehouseBaseInfoService.selectList(new EntityWrapper<WarehouseBaseInfo>()
|
|
|
+ .eq("delete_flag", "0").eq("comp_id", companyId).eq("warehouse_type", "1"));
|
|
|
+ if (CollectionUtils.isNotEmpty(warehouseBaseInfoList)) {
|
|
|
+ for (int i = 0; i < warehouseBaseInfoList.size(); i++) {
|
|
|
+ BiViewInfo biViewInfo = new BiViewInfo();
|
|
|
+ WarehouseBaseInfo warehouseBaseInfo = warehouseBaseInfoList.get(i);
|
|
|
+ Double sum = warehousePositionStorageInfoMapper.selectSumWare(companyId, warehouseBaseInfo.getId());
|
|
|
+ biViewInfo.setName(warehouseBaseInfo.getWarehouseName());
|
|
|
+ biViewInfo.setWeight(sum);
|
|
|
+ if(sum != null){
|
|
|
+ biViewInfoList.add(biViewInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- biViewInfo2.setBiViewInfoList(biViewInfoList1);
|
|
|
- biViewInfos.add(biViewInfo2);
|
|
|
- // 车辆
|
|
|
- getTranCount(biViewInfos,seachMoth);
|
|
|
- // 库存成本
|
|
|
- getCostCount(biViewInfos,seachMoth);
|
|
|
- // 库点流向
|
|
|
- getMapInfo(biViewInfos,seachMoth);
|
|
|
+ List<BiViewInfo> listSort = biViewInfoList.stream().sorted(Comparator.comparing(BiViewInfo::getWeight).reversed().thenComparing(BiViewInfo::getWeight)).collect(Collectors.toList());
|
|
|
+ biViewInfoa.setBiType("库存");
|
|
|
+ biViewInfoa.setBiViewInfoList(listSort.subList(0,10));
|
|
|
+ biViewInfos.add(biViewInfoa);
|
|
|
|
|
|
- cacheComponent.putRaw(Const.ADMIN_BI_INFO, JSONObject.toJSONString(biViewInfos),60*60);
|
|
|
return biViewInfos;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 合营比例
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<BiViewInfo> getHeYing(List<BiViewInfo> biViewInfos) {
|
|
|
+ List<BiViewInfo> biViewInfoList = new ArrayList<>();
|
|
|
+ BiViewInfo biViewInfoa = new BiViewInfo();
|
|
|
+ BiViewInfo biViewInfob = new BiViewInfo();
|
|
|
+ BiViewInfo biViewInfoc = new BiViewInfo();
|
|
|
+ Integer countWare = warehouseBaseInfoService.selectCount(new EntityWrapper<WarehouseBaseInfo>()
|
|
|
+ .eq("comp_id",companyId).eq("delete_flag", "0").eq("warehouse_type","1"));
|
|
|
+ // 查询仓库总数
|
|
|
+ Integer count = warehousePositionInfoService.selectCount(new EntityWrapper<WarehousePositionInfo>()
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
+ // 查询自由库数量
|
|
|
+ List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
|
|
|
+ .eq("delete_flag", "0").like("bin_number", "合营").groupBy("base_id"));
|
|
|
+ Integer count1 = warehousePositionInfos.size();
|
|
|
+ biViewInfoa.setCount(String.valueOf(count1));
|
|
|
+ biViewInfoa.setName("合营");
|
|
|
+ biViewInfoa.setPercentage(String.valueOf(count1 / countWare * 100) + "%");
|
|
|
+ biViewInfob.setCount(String.valueOf(countWare - count1));
|
|
|
+ biViewInfob.setName("自有");
|
|
|
+ biViewInfob.setPercentage(String.valueOf((countWare - count1) / countWare * 100) + "%");
|
|
|
+ biViewInfoList.add(biViewInfoa);
|
|
|
+ biViewInfoList.add(biViewInfob);
|
|
|
+ biViewInfoc.setBiType("合营");
|
|
|
+ biViewInfoc.setBiViewInfoList(biViewInfoList);
|
|
|
+ biViewInfos.add(biViewInfoc);
|
|
|
+ return biViewInfos;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 库点流向
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- private List<BiViewInfo> getMapInfo(List<BiViewInfo> biViewInfos,String seachMoth) {
|
|
|
+ private List<BiViewInfo> getMapInfo(List<BiViewInfo> biViewInfos, String seachMoth) {
|
|
|
List<BiViewInfo> biViewInfoList = new ArrayList<>();
|
|
|
BiViewInfo biViewInfoa = new BiViewInfo();
|
|
|
List<TranTaskInfo> tranTaskInfos = tranTaskInfoService.selectList(new EntityWrapper<TranTaskInfo>()
|
|
@@ -240,7 +321,7 @@ public class BiInfoController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- private List<BiViewInfo> getMoney(List<BiViewInfo> biViewInfos,String seachMoth) {
|
|
|
+ private List<BiViewInfo> getMoney(List<BiViewInfo> biViewInfos, String seachMoth) {
|
|
|
|
|
|
return stockSaleReceiptReportService.getMoney(biViewInfos, seachMoth);
|
|
|
}
|
|
@@ -250,7 +331,7 @@ public class BiInfoController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- private List<BiViewInfo> getCostCount(List<BiViewInfo> biViewInfos,String seachMoth) {
|
|
|
+ private List<BiViewInfo> getCostCount(List<BiViewInfo> biViewInfos, String seachMoth) {
|
|
|
EntityWrapper<CostManagementInfo> costManagementInfoEntityWrapper = new EntityWrapper<CostManagementInfo>();
|
|
|
costManagementInfoEntityWrapper.eq("comp_id", companyId);
|
|
|
// if(seachMoth != null) {
|
|
@@ -272,13 +353,13 @@ public class BiInfoController {
|
|
|
// sumCost = sumCost + (costManagementInfo.getStorage() * costManagementInfo.getCost());
|
|
|
// }
|
|
|
// }
|
|
|
- if(sumAct == null){
|
|
|
+ if (sumAct == null) {
|
|
|
sumAct = 0d;
|
|
|
}
|
|
|
- if(sumBuy == null){
|
|
|
+ if (sumBuy == null) {
|
|
|
sumBuy = 0d;
|
|
|
}
|
|
|
- if(sumSale == null){
|
|
|
+ if (sumSale == null) {
|
|
|
sumSale = 0d;
|
|
|
}
|
|
|
List<BiViewInfo> biViewInfoList = new ArrayList<>();
|
|
@@ -349,12 +430,43 @@ public class BiInfoController {
|
|
|
return biViewInfos;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 在途
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<BiViewInfo> getTranProess(List<BiViewInfo> biViewInfos) {
|
|
|
+ List<BiViewInfo> biViewInfoList = new ArrayList<>();
|
|
|
+ BiViewInfo biViewInfo = new BiViewInfo();
|
|
|
+ // 今日装车
|
|
|
+ List<TranCarInfo> tranCarInfos = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
|
|
|
+ .eq("status_flag", "3")
|
|
|
+ .eq("comp_id", companyId)
|
|
|
+ .orderBy("create_date",false));
|
|
|
+ List<TranCarInfo> tranCarInfoList = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(tranCarInfos)) {
|
|
|
+ for (int i = 0; i < 30; i++) {
|
|
|
+
|
|
|
+ TranTaskInfo tranTaskInfo = tranTaskInfoService.selectById(tranCarInfos.get(i).getInfoId());
|
|
|
+ tranCarInfos.get(i).setTranTaskInfos(tranTaskInfo);
|
|
|
+ tranCarInfoList.add(tranCarInfos.get(i));
|
|
|
+
|
|
|
+ }
|
|
|
+ biViewInfo.setTranCarInfos(tranCarInfoList);
|
|
|
+ }
|
|
|
+
|
|
|
+ biViewInfos.add(biViewInfo);
|
|
|
+
|
|
|
+ return biViewInfos;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 车辆
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- private List<BiViewInfo> getTranCount(List<BiViewInfo> biViewInfos,String seachMoth) {
|
|
|
+ private List<BiViewInfo> getTranCount(List<BiViewInfo> biViewInfos, String seachMoth) {
|
|
|
List<BiViewInfo> biViewInfoList = new ArrayList<>();
|
|
|
// 今日装车
|
|
|
int inCount = tranCarInfoService.selectCount(new EntityWrapper<TranCarInfo>()
|
|
@@ -365,9 +477,9 @@ public class BiInfoController {
|
|
|
// .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 inAfterCount = warehouseInOutInfoService.selectCountCompany(companyId, "出库");
|
|
|
//今日卸车
|
|
|
- int outCount = warehouseInOutInfoService.selectCountCompany(companyId,"入库");
|
|
|
+ int outCount = warehouseInOutInfoService.selectCountCompany(companyId, "入库");
|
|
|
// int outCount1 = weighingManagementService.selectCount(new EntityWrapper<WeighingManagement>()
|
|
|
// .le("status_flag", "3")
|
|
|
// .eq("delete_flag", "0")
|
|
@@ -392,6 +504,82 @@ public class BiInfoController {
|
|
|
return biViewInfos;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 出入库分布
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<BiViewInfo> getInOutInfo(List<BiViewInfo> biViewInfos) {
|
|
|
+ List<BiViewInfo> biViewInfoList = new ArrayList<>();
|
|
|
+ BiViewInfo biViewInfo = new BiViewInfo();
|
|
|
+ List<BiViewInfo> biViewInfoList1 = new ArrayList<>();
|
|
|
+ BiViewInfo biViewInfo1 = new BiViewInfo();
|
|
|
+ // 出库
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ int year = calendar.get(Calendar.YEAR);
|
|
|
+ for (int i = 1; i <= 12; i++) {
|
|
|
+ String start = year + "-" + StringSizeUtil.stringSize(String.valueOf(i)) + "-" + "01" + " 00:00:00";
|
|
|
+ String end = year + "-" + StringSizeUtil.stringSize(String.valueOf(i)) + "-" + "31" + " 23:59:59";
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
+ pageView.put("start", start);
|
|
|
+ pageView.put("end", end);
|
|
|
+ pageView.put("type", "1");
|
|
|
+ List<WarehouseInOutInfo> list = warehouseInOutInfoMapper.brokenLineStatisticalChartByYear(pageView);
|
|
|
+ if (list.size() == 0) {
|
|
|
+ Double money = 0D;
|
|
|
+ BiViewInfo taskYearChartVo = new BiViewInfo();
|
|
|
+ taskYearChartVo.setName(i + "月");
|
|
|
+ taskYearChartVo.setCount(String.valueOf(money));
|
|
|
+ taskYearChartVo.setBiType("出库");
|
|
|
+ biViewInfoList.add(taskYearChartVo);
|
|
|
+ } else {
|
|
|
+ Double money = list.stream().collect(Collectors.summingDouble(WarehouseInOutInfo::getNetWeight));
|
|
|
+ BiViewInfo taskYearChartVo = new BiViewInfo();
|
|
|
+ taskYearChartVo.setName(i + "月");
|
|
|
+ taskYearChartVo.setCount(String.valueOf(money));
|
|
|
+ taskYearChartVo.setBiType("出库");
|
|
|
+ biViewInfoList.add(taskYearChartVo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ biViewInfo.setBiType("出库");
|
|
|
+ biViewInfo.setBiViewInfoList(biViewInfoList);
|
|
|
+ biViewInfos.add(biViewInfo);
|
|
|
+
|
|
|
+
|
|
|
+ // 入库
|
|
|
+ for (int i = 1; i <= 12; i++) {
|
|
|
+ String start = year + "-" + StringSizeUtil.stringSize(String.valueOf(i)) + "-" + "01" + " 00:00:00";
|
|
|
+ String end = year + "-" + StringSizeUtil.stringSize(String.valueOf(i)) + "-" + "31" + " 23:59:59";
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
+ pageView.put("start", start);
|
|
|
+ pageView.put("end", end);
|
|
|
+ pageView.put("type", "2");
|
|
|
+ List<WarehouseInOutInfo> list = warehouseInOutInfoMapper.brokenLineStatisticalChartByYear(pageView);
|
|
|
+ if (list.size() == 0) {
|
|
|
+ Double money = 0D;
|
|
|
+ BiViewInfo taskYearChartVo = new BiViewInfo();
|
|
|
+ taskYearChartVo.setName(i + "月");
|
|
|
+ taskYearChartVo.setCount(String.valueOf(money));
|
|
|
+ taskYearChartVo.setBiType("入库");
|
|
|
+ biViewInfoList1.add(taskYearChartVo);
|
|
|
+ } else {
|
|
|
+ Double money = list.stream().collect(Collectors.summingDouble(WarehouseInOutInfo::getNetWeight));
|
|
|
+ BiViewInfo taskYearChartVo = new BiViewInfo();
|
|
|
+ taskYearChartVo.setName(i + "月");
|
|
|
+ taskYearChartVo.setCount(String.valueOf(money));
|
|
|
+ taskYearChartVo.setBiType("入库");
|
|
|
+ biViewInfoList1.add(taskYearChartVo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ biViewInfo1.setBiType("入库");
|
|
|
+ biViewInfo1.setBiViewInfoList(biViewInfoList1);
|
|
|
+ biViewInfos.add(biViewInfo1);
|
|
|
+
|
|
|
+ return biViewInfos;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 采购
|
|
|
*
|
|
@@ -563,9 +751,9 @@ public class BiInfoController {
|
|
|
.eq("delete_flag", "0"));
|
|
|
if (!CollectionUtils.isEmpty(stockSaleReceiptReportList)) {
|
|
|
for (StockSaleReceiptReport stockSaleReceiptReport : stockSaleReceiptReportList) {
|
|
|
- outWeight = outWeight + (stockSaleReceiptReport.getSettlementWeight()!=null?stockSaleReceiptReport.getSettlementWeight():0);
|
|
|
- moneyTotal += (stockSaleReceiptReport.getAmountIngReceivable()!=null?stockSaleReceiptReport.getAmountIngReceivable():0);
|
|
|
- payMoney += (stockSaleReceiptReport.getAmountEdReceivable()!=null?stockSaleReceiptReport.getAmountEdReceivable():0);
|
|
|
+ outWeight = outWeight + (stockSaleReceiptReport.getSettlementWeight() != null ? stockSaleReceiptReport.getSettlementWeight() : 0);
|
|
|
+ moneyTotal += (stockSaleReceiptReport.getAmountIngReceivable() != null ? stockSaleReceiptReport.getAmountIngReceivable() : 0);
|
|
|
+ payMoney += (stockSaleReceiptReport.getAmountEdReceivable() != null ? stockSaleReceiptReport.getAmountEdReceivable() : 0);
|
|
|
}
|
|
|
}
|
|
|
//查询同合同编号出库量
|