|
@@ -0,0 +1,388 @@
|
|
|
|
+package com.yh.saas.plugin.yiliangyiyun.controller;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.plugins.Page;
|
|
|
|
+import com.winsea.svc.base.base.util.DateUtils;
|
|
|
|
+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.service.*;
|
|
|
|
+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.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+import java.io.FileInputStream;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.io.InputStream;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * <p>
|
|
|
|
+ * 导入 前端控制器
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @author Gongdc
|
|
|
|
+ * @since 2021-08-30
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/biInfoController")
|
|
|
|
+public class BiInfoController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IContractManagementInfoService contractManagementInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ITranProcessInfoService tranProcessInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IWarehouseInOutInfoService warehouseInOutInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ITranTaskInfoService tranTaskInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ITranCarInfoService tranCarInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IContractProcessInfoService contractProcessInfoService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/selectBiInfo")
|
|
|
|
+ public List<BiViewInfo> selectBiInfo() {
|
|
|
|
+ List<BiViewInfo> biViewInfos = new ArrayList<>();
|
|
|
|
+ // 销售合同 执行中的合同
|
|
|
|
+ List<ContractManagementInfo> contractManagementInfos = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>().eq("contract_type", "2")
|
|
|
|
+ .eq("status_flag", "1").eq("comp_id", AuthSecurityUtils.getCurrentUserInfo().getCompId()));
|
|
|
|
+ // 执行中的所有合同-已完成量、待完成量 2 执行中的合同额 -已开票、待开票 3 已付款 未付款
|
|
|
|
+ getCompletedAndNotQuantity(contractManagementInfos, biViewInfos);
|
|
|
|
+ // 采购
|
|
|
|
+ getBuyInfo(contractManagementInfos, biViewInfos);
|
|
|
|
+ // 车辆
|
|
|
|
+ getTranCount(biViewInfos);
|
|
|
|
+
|
|
|
|
+ return biViewInfos;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 车辆
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private List<BiViewInfo> getTranCount(List<BiViewInfo> biViewInfos) {
|
|
|
|
+ List<BiViewInfo> biViewInfoList = new ArrayList<>();
|
|
|
|
+ // 今日装车
|
|
|
|
+ int inCount = tranCarInfoService.selectCount(new EntityWrapper<TranCarInfo>()
|
|
|
|
+ .eq("status_flag", "3")
|
|
|
|
+ .eq("update_date", DateUtil.formatDate(new Date(), DateUtils.DATE_FMT_YYYY_MM_DD)));
|
|
|
|
+ //今日在途
|
|
|
|
+ int inAfterCount = tranCarInfoService.selectCount(new EntityWrapper<TranCarInfo>()
|
|
|
|
+ .eq("status_flag", "3")
|
|
|
|
+ .lt("update_date", DateUtil.formatDate(new Date(), DateUtils.DATE_FMT_YYYY_MM_DD)));
|
|
|
|
+ //今日在途
|
|
|
|
+ int outCount = tranCarInfoService.selectCount(new EntityWrapper<TranCarInfo>()
|
|
|
|
+ .eq("status_flag", "5")
|
|
|
|
+ .eq("update_date", DateUtil.formatDate(new Date(), DateUtils.DATE_FMT_YYYY_MM_DD)));
|
|
|
|
+ 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));
|
|
|
|
+ biViewInfo2.setName("装货车辆");
|
|
|
|
+ biViewInfo2.setCount(String.valueOf(inAfterCount));
|
|
|
|
+ biViewInfo3.setName("卸货车辆");
|
|
|
|
+ biViewInfo3.setCount(String.valueOf(outCount));
|
|
|
|
+ biViewInfoList.add(biViewInfo1);
|
|
|
|
+ biViewInfoList.add(biViewInfo2);
|
|
|
|
+ biViewInfoList.add(biViewInfo3);
|
|
|
|
+ biViewInfo.setBiViewInfoList(biViewInfoList);
|
|
|
|
+ biViewInfos.add(biViewInfo);
|
|
|
|
+ return biViewInfos;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 采购
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private List<BiViewInfo> getBuyInfo(List<ContractManagementInfo> contractManagementInfos, List<BiViewInfo> biViewInfos) {
|
|
|
|
+ // 采购合同总量
|
|
|
|
+ Float sumTotal = 0f;
|
|
|
|
+ // 采购合同完成量
|
|
|
|
+ Float completedQuantity = 0f;
|
|
|
|
+ // 采购合同总金额
|
|
|
|
+ Double moneyTotal = 0.00;
|
|
|
|
+ //采购合同已开发票金额
|
|
|
|
+ Double invoicingTotal = 0.00;
|
|
|
|
+ // 采购合同已回款金额
|
|
|
|
+ Double payTotal = 0.00;
|
|
|
|
+ for (int i = 0; i < contractManagementInfos.size(); i++) {
|
|
|
|
+ ContractManagementInfo contractManagementInfo = contractManagementInfos.get(i);
|
|
|
|
+ sumTotal = sumTotal + contractManagementInfo.getWeight();
|
|
|
|
+ moneyTotal = moneyTotal + contractManagementInfo.getTotalContractPrice();
|
|
|
|
+ if ("1".equals(contractManagementInfo.getGoodsType()) && "1".equals(contractManagementInfo.getDeliverType()) && "2".equals(contractManagementInfo.getContractType())) {
|
|
|
|
+ //定义出库量
|
|
|
|
+ Float outWeight = 0.0f;
|
|
|
|
+ //查询同名临时库出库量
|
|
|
|
+ List<WarehouseInOutInfo> warehouseInOutInfoList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
|
|
|
|
+ .eq("warehouse_name", contractManagementInfo.getContractNo())
|
|
|
|
+ .eq("in_out_flag", "1")
|
|
|
|
+ .eq("status_flag", "3")
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ if (!CollectionUtils.isEmpty(warehouseInOutInfoList)) {
|
|
|
|
+ for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList) {
|
|
|
|
+ outWeight = outWeight + warehouseInOutInfo.getNetWeight();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //定义退库量
|
|
|
|
+ Float returnWeight = 0.0f;
|
|
|
|
+ //查询同名临时库出库量
|
|
|
|
+ List<WarehouseInOutInfo> warehouseInOutInfoList1 = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
|
|
|
|
+ .eq("warehouse_name", contractManagementInfo.getContractNo())
|
|
|
|
+ .eq("in_out_type", "退库")
|
|
|
|
+ .eq("status_flag", "3")
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ if (!CollectionUtils.isEmpty(warehouseInOutInfoList1)) {
|
|
|
|
+ for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList1) {
|
|
|
|
+ returnWeight = returnWeight + warehouseInOutInfo.getNetWeight();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ completedQuantity = completedQuantity + outWeight - returnWeight;
|
|
|
|
+ }
|
|
|
|
+ //现货他运采购合同
|
|
|
|
+ else if ("1".equals(contractManagementInfo.getGoodsType()) && "2".equals(contractManagementInfo.getDeliverType()) && "2".equals(contractManagementInfo.getContractType())) {
|
|
|
|
+ //定义出库量
|
|
|
|
+ Float inWeight = 0.0f;
|
|
|
|
+ //查询同合同编号入库量
|
|
|
|
+ List<WarehouseInOutInfo> warehouseInOutInfoList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
|
|
|
|
+ .eq("contract_no", contractManagementInfo.getContractNo())
|
|
|
|
+ .eq("in_out_flag", "2")
|
|
|
|
+ .eq("status_flag", "3")
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ if (!CollectionUtils.isEmpty(warehouseInOutInfoList)) {
|
|
|
|
+ for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList) {
|
|
|
|
+ inWeight = Float.valueOf(inWeight) + warehouseInOutInfo.getNetWeight();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ completedQuantity = completedQuantity + inWeight;
|
|
|
|
+ }
|
|
|
|
+ // 查询已开票未开票
|
|
|
|
+ ContractProcessInfo contractProcessInfo = contractProcessInfoService.selectOne(new EntityWrapper<ContractProcessInfo>().eq(ContractGoodsInfo.QueryFiles.CONTRACT_ID, contractManagementInfo.getId()));
|
|
|
|
+ invoicingTotal = invoicingTotal + (contractProcessInfo.getGoodsName() != null ? contractProcessInfo.getGoodsName() : 0.00);
|
|
|
|
+ payTotal = payTotal + (contractProcessInfo.getMildewGrain() != null ? contractProcessInfo.getMildewGrain() : 0.00);
|
|
|
|
+ }
|
|
|
|
+ // 执行中的所有合同量求和-- 已完成量、待完成量
|
|
|
|
+ BiViewInfo biViewInfo = new BiViewInfo();
|
|
|
|
+ biViewInfo.setBiType("4-采购合同(已完成量、待完成量)");
|
|
|
|
+ biViewInfo.setTotal(String.valueOf(sumTotal));
|
|
|
|
+ List<BiViewInfo> biViewInfos1 = new ArrayList<>();
|
|
|
|
+ BiViewInfo biViewInfo1 = new BiViewInfo();
|
|
|
|
+ biViewInfo1.setName("已完成量");
|
|
|
|
+ biViewInfo1.setCount(String.valueOf(completedQuantity));
|
|
|
|
+ biViewInfo1.setPercentage(completedQuantity / sumTotal * 100 + "%");
|
|
|
|
+ BiViewInfo biViewInfo2 = new BiViewInfo();
|
|
|
|
+ biViewInfo2.setName("待完成量");
|
|
|
|
+ biViewInfo2.setCount(String.valueOf(sumTotal - completedQuantity));
|
|
|
|
+ biViewInfo2.setPercentage((sumTotal - completedQuantity) / sumTotal * 100 + "%");
|
|
|
|
+ biViewInfos1.add(biViewInfo1);
|
|
|
|
+ biViewInfos1.add(biViewInfo2);
|
|
|
|
+ biViewInfo.setBiViewInfoList(biViewInfos1);
|
|
|
|
+ biViewInfos.add(biViewInfo);
|
|
|
|
+
|
|
|
|
+ // 执行中的合同额 -已开票、待开票
|
|
|
|
+ BiViewInfo biViewInfoa = new BiViewInfo();
|
|
|
|
+ biViewInfoa.setBiType("5-采购合同(已开票、待开票)");
|
|
|
|
+ biViewInfoa.setTotal(String.valueOf(moneyTotal));
|
|
|
|
+ List<BiViewInfo> biViewInfosa1 = new ArrayList<>();
|
|
|
|
+ BiViewInfo biViewInfoa1 = new BiViewInfo();
|
|
|
|
+ biViewInfoa1.setName("已开票");
|
|
|
|
+ biViewInfoa1.setCount(String.valueOf(invoicingTotal));
|
|
|
|
+ biViewInfoa1.setPercentage(invoicingTotal != 0 ? invoicingTotal / moneyTotal * 100 + "%" : 0 + "%");
|
|
|
|
+ BiViewInfo biViewInfoa2 = new BiViewInfo();
|
|
|
|
+ biViewInfoa2.setName("待开票");
|
|
|
|
+ biViewInfoa2.setCount(String.valueOf(moneyTotal - (invoicingTotal != null ? invoicingTotal : 0)));
|
|
|
|
+ biViewInfoa2.setPercentage((moneyTotal - (invoicingTotal != null ? invoicingTotal : 0)) / moneyTotal * 100 + "%");
|
|
|
|
+ biViewInfosa1.add(biViewInfoa1);
|
|
|
|
+ biViewInfosa1.add(biViewInfoa2);
|
|
|
|
+ biViewInfoa.setBiViewInfoList(biViewInfosa1);
|
|
|
|
+ biViewInfos.add(biViewInfoa);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 执行中的合同额 -已付款、待付款
|
|
|
|
+ BiViewInfo biViewInfob = new BiViewInfo();
|
|
|
|
+ biViewInfob.setBiType("6-采购合同(已回款、待回款)");
|
|
|
|
+ biViewInfob.setTotal(String.valueOf(moneyTotal));
|
|
|
|
+ List<BiViewInfo> biViewInfosb1 = new ArrayList<>();
|
|
|
|
+ BiViewInfo biViewInfob1 = new BiViewInfo();
|
|
|
|
+ biViewInfob1.setName("已付款");
|
|
|
|
+ biViewInfob1.setCount(String.valueOf(payTotal));
|
|
|
|
+ biViewInfob1.setPercentage(payTotal != 0 ? payTotal / moneyTotal * 100 + "%" : 0 + "%");
|
|
|
|
+ BiViewInfo biViewInfob2 = new BiViewInfo();
|
|
|
|
+ biViewInfob2.setName("待付款");
|
|
|
|
+ biViewInfob2.setCount(String.valueOf(moneyTotal - (payTotal != null ? payTotal : 0)));
|
|
|
|
+ biViewInfob2.setPercentage((moneyTotal - (payTotal != null ? payTotal : 0)) / moneyTotal * 100 + "%");
|
|
|
|
+ biViewInfosb1.add(biViewInfoa1);
|
|
|
|
+ biViewInfosb1.add(biViewInfoa2);
|
|
|
|
+ biViewInfob.setBiViewInfoList(biViewInfosb1);
|
|
|
|
+ biViewInfos.add(biViewInfob);
|
|
|
|
+ return biViewInfos;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 销售
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private List<BiViewInfo> getCompletedAndNotQuantity(List<ContractManagementInfo> contractManagementInfos, List<BiViewInfo> biViewInfos) {
|
|
|
|
+ // 销售合同总量
|
|
|
|
+ Float sumTotal = 0f;
|
|
|
|
+ // 销售合同完成量
|
|
|
|
+ Float completedQuantity = 0f;
|
|
|
|
+ // 销售合同总金额
|
|
|
|
+ Double moneyTotal = 0.00;
|
|
|
|
+ // 销售合同已开发票金额
|
|
|
|
+ Double invoicingTotal = 0.00;
|
|
|
|
+ // 销售合同已付款金额
|
|
|
|
+ Double payTotal = 0.00;
|
|
|
|
+ for (int i = 0; i < contractManagementInfos.size(); i++) {
|
|
|
|
+ ContractManagementInfo contractManagementInfo = contractManagementInfos.get(i);
|
|
|
|
+ sumTotal = sumTotal + contractManagementInfo.getWeight();
|
|
|
|
+ moneyTotal = moneyTotal + contractManagementInfo.getTotalContractPrice();
|
|
|
|
+ //定义出库量
|
|
|
|
+ Float outWeight = 0.0f;
|
|
|
|
+ //查询同合同编号出库量
|
|
|
|
+ List<WarehouseInOutInfo> warehouseInOutInfoList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
|
|
|
|
+ .eq("contract_no", contractManagementInfo.getContractNo())
|
|
|
|
+ .eq("in_out_flag", "1")
|
|
|
|
+ .eq("status_flag", "3")
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ if (!CollectionUtils.isEmpty(warehouseInOutInfoList)) {
|
|
|
|
+ for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList) {
|
|
|
|
+ outWeight = outWeight + warehouseInOutInfo.getNetWeight();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //定义运输损耗
|
|
|
|
+ Float loss = 0.0f;
|
|
|
|
+ //查询同合同编号的运输任务
|
|
|
|
+ TranTaskInfo tranTaskInfo = tranTaskInfoService.selectOne(new EntityWrapper<TranTaskInfo>()
|
|
|
|
+ .eq("contract_no", contractManagementInfo.getContractNo())
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ if (tranTaskInfo != null) {
|
|
|
|
+ //定义装车净重
|
|
|
|
+ Float loadNetWeight = 0.0f;
|
|
|
|
+ //定义卸车净重
|
|
|
|
+ Float unloadNetWeight = 0.0f;
|
|
|
|
+ //查询运输车辆
|
|
|
|
+ List<TranCarInfo> tranCarInfoList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
|
|
|
|
+ .eq("info_id", tranTaskInfo.getId())
|
|
|
|
+ .eq("status_flag", "1")
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ if (!CollectionUtils.isEmpty(tranCarInfoList)) {
|
|
|
|
+ for (TranCarInfo tranCarInfo : tranCarInfoList) {
|
|
|
|
+ loadNetWeight = loadNetWeight + tranCarInfo.getLoadNetWeight();
|
|
|
|
+ unloadNetWeight = unloadNetWeight + tranCarInfo.getUnloadNetWeight();
|
|
|
|
+ }
|
|
|
|
+ loss = loadNetWeight - unloadNetWeight;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //定义退库量
|
|
|
|
+ Float returnWeight = 0.0f;
|
|
|
|
+ //查询同合同编号出库量
|
|
|
|
+ List<WarehouseInOutInfo> warehouseInOutInfoList1 = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
|
|
|
|
+ .eq("contract_no", contractManagementInfo.getContractNo())
|
|
|
|
+ .eq("in_out_type", "退库")
|
|
|
|
+ .eq("status_flag", "3")
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ if (!CollectionUtils.isEmpty(warehouseInOutInfoList1)) {
|
|
|
|
+ for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList1) {
|
|
|
|
+ returnWeight = returnWeight + warehouseInOutInfo.getNetWeight();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //自运的销售合同
|
|
|
|
+ if ("1".equals(contractManagementInfo.getDeliverType())) {
|
|
|
|
+ //已完货的粮款结算阶段
|
|
|
|
+ TranProcessInfo tranProcessInfo = tranProcessInfoService.selectOne(new EntityWrapper<TranProcessInfo>()
|
|
|
|
+ .eq("end_flag", "1")
|
|
|
|
+ .eq("contract_no", contractManagementInfo.getContractNo())
|
|
|
|
+ .eq("receiving_status_flag", "1"));
|
|
|
|
+ if (tranProcessInfo != null) {
|
|
|
|
+ //完成量等于完货净重
|
|
|
|
+ completedQuantity = completedQuantity + tranProcessInfo.getWeight();
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ completedQuantity = completedQuantity + (outWeight - loss - returnWeight);
|
|
|
|
+ }
|
|
|
|
+ // 查询已开票未开票
|
|
|
|
+ ContractProcessInfo contractProcessInfo = contractProcessInfoService.selectOne(new EntityWrapper<ContractProcessInfo>().eq(ContractGoodsInfo.QueryFiles.CONTRACT_ID, contractManagementInfo.getId()));
|
|
|
|
+ invoicingTotal = invoicingTotal + (contractProcessInfo.getGoodsName() != null ? contractProcessInfo.getGoodsName() : 0.00);
|
|
|
|
+ payTotal = payTotal + (contractProcessInfo.getGoodsNameKey() != null ? contractProcessInfo.getGoodsNameKey() : 0.00);
|
|
|
|
+ }
|
|
|
|
+ // 执行中的所有合同量求和-- 已完成量、待完成量
|
|
|
|
+ BiViewInfo biViewInfo = new BiViewInfo();
|
|
|
|
+ biViewInfo.setBiType("1-销售合同(已完成量、待完成量)");
|
|
|
|
+ biViewInfo.setTotal(String.valueOf(sumTotal));
|
|
|
|
+ List<BiViewInfo> biViewInfos1 = new ArrayList<>();
|
|
|
|
+ BiViewInfo biViewInfo1 = new BiViewInfo();
|
|
|
|
+ biViewInfo1.setName("已完成量");
|
|
|
|
+ biViewInfo1.setCount(String.valueOf(completedQuantity));
|
|
|
|
+ biViewInfo1.setPercentage(completedQuantity / sumTotal * 100 + "%");
|
|
|
|
+ BiViewInfo biViewInfo2 = new BiViewInfo();
|
|
|
|
+ biViewInfo2.setName("待完成量");
|
|
|
|
+ biViewInfo2.setCount(String.valueOf(sumTotal - completedQuantity));
|
|
|
|
+ biViewInfo2.setPercentage((sumTotal - completedQuantity) / sumTotal * 100 + "%");
|
|
|
|
+ biViewInfos1.add(biViewInfo1);
|
|
|
|
+ biViewInfos1.add(biViewInfo2);
|
|
|
|
+ biViewInfo.setBiViewInfoList(biViewInfos1);
|
|
|
|
+ biViewInfos.add(biViewInfo);
|
|
|
|
+
|
|
|
|
+ // 执行中的合同额 -已开票、待开票
|
|
|
|
+ BiViewInfo biViewInfoa = new BiViewInfo();
|
|
|
|
+ biViewInfoa.setBiType("2-销售合同(已开票、待开票)");
|
|
|
|
+ biViewInfoa.setTotal(String.valueOf(moneyTotal));
|
|
|
|
+ List<BiViewInfo> biViewInfosa1 = new ArrayList<>();
|
|
|
|
+ BiViewInfo biViewInfoa1 = new BiViewInfo();
|
|
|
|
+ biViewInfoa1.setName("已开票");
|
|
|
|
+ biViewInfoa1.setCount(String.valueOf(invoicingTotal));
|
|
|
|
+ biViewInfoa1.setPercentage(invoicingTotal != 0 ? invoicingTotal / moneyTotal * 100 + "%" : 0 + "%");
|
|
|
|
+ BiViewInfo biViewInfoa2 = new BiViewInfo();
|
|
|
|
+ biViewInfoa2.setName("待开票");
|
|
|
|
+ biViewInfoa2.setCount(String.valueOf(moneyTotal - (invoicingTotal != null ? invoicingTotal : 0)));
|
|
|
|
+ biViewInfoa2.setPercentage((moneyTotal - (invoicingTotal != null ? invoicingTotal : 0)) / moneyTotal * 100 + "%");
|
|
|
|
+ biViewInfosa1.add(biViewInfoa1);
|
|
|
|
+ biViewInfosa1.add(biViewInfoa2);
|
|
|
|
+ biViewInfoa.setBiViewInfoList(biViewInfosa1);
|
|
|
|
+ biViewInfos.add(biViewInfoa);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 执行中的合同额 -已付款、待付款
|
|
|
|
+ BiViewInfo biViewInfob = new BiViewInfo();
|
|
|
|
+ biViewInfob.setBiType("3-销售合同(已付款、待付款)");
|
|
|
|
+ biViewInfob.setTotal(String.valueOf(moneyTotal));
|
|
|
|
+ List<BiViewInfo> biViewInfosb1 = new ArrayList<>();
|
|
|
|
+ BiViewInfo biViewInfob1 = new BiViewInfo();
|
|
|
|
+ biViewInfob1.setName("已付款");
|
|
|
|
+ biViewInfob1.setCount(String.valueOf(payTotal));
|
|
|
|
+ biViewInfob1.setPercentage(payTotal != 0 ? payTotal / moneyTotal * 100 + "%" : 0 + "%");
|
|
|
|
+ BiViewInfo biViewInfob2 = new BiViewInfo();
|
|
|
|
+ biViewInfob2.setName("待付款");
|
|
|
|
+ biViewInfob2.setCount(String.valueOf(moneyTotal - (payTotal != null ? payTotal : 0)));
|
|
|
|
+ biViewInfob2.setPercentage((moneyTotal - (payTotal != null ? payTotal : 0)) / moneyTotal * 100 + "%");
|
|
|
|
+ biViewInfosb1.add(biViewInfoa1);
|
|
|
|
+ biViewInfosb1.add(biViewInfoa2);
|
|
|
|
+ biViewInfob.setBiViewInfoList(biViewInfosb1);
|
|
|
|
+ biViewInfos.add(biViewInfob);
|
|
|
|
+ return biViewInfos;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|