gongdecai 2 年之前
父节点
当前提交
2de8a95204

+ 256 - 68
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BiInfoController.java

@@ -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);
                 }
             }
             //查询同合同编号出库量

+ 2 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/TranCarInfo.java

@@ -261,6 +261,8 @@ public class TranCarInfo extends BaseModel<TranCarInfo> {
     private List<DriverViewInfo> driverViewInfoList;
     @TableField(exist = false)
     private List<TranCarInfo> tranCarInfoList;
+    @TableField(exist = false)
+    private TranTaskInfo tranTaskInfos;
     /**
      * 当前价格
      */

+ 10 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/BiViewInfo.java

@@ -1,6 +1,8 @@
 package com.yh.saas.plugin.yiliangyiyun.entity.view;
 
 
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.TranCarInfo;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
@@ -38,6 +40,10 @@ public class BiViewInfo  {
      * 统计数量
      */
     private Float value;
+    /**
+     * 统计数量
+     */
+    private Double weight;
     /**
      * 统计百分比
      */
@@ -55,4 +61,8 @@ public class BiViewInfo  {
      */
     private List<BiViewInfo> biViewInfoList;
 
+    List<ContractManagementInfo> contractManagementInfos;
+
+    List<TranCarInfo> tranCarInfos;
+
 }

+ 2 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehouseInOutInfoMapper.java

@@ -56,4 +56,6 @@ public interface WarehouseInOutInfoMapper extends BaseMapper<WarehouseInOutInfo>
      * @return
      */
     List<WarehouseInOutInfo> selectInfoByKeyWord(Map<String, Object> pageView);
+
+    List<WarehouseInOutInfo> brokenLineStatisticalChartByYear(Map<String, Object> pageView);
 }

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehousePositionStorageInfoMapper.java

@@ -14,4 +14,5 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
 public interface WarehousePositionStorageInfoMapper extends BaseMapper<WarehousePositionStorageInfo> {
 
     Double selectSumStoreage(String compId);
+    Double selectSumWare(String compId,String baseId);
 }

+ 29 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/StringSizeUtil.java

@@ -0,0 +1,29 @@
+package com.yh.saas.plugin.yiliangyiyun.util;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+
+public class StringSizeUtil {
+
+    public static String stringSize(String a){
+
+        if (a.length()<2){
+            return "0"+a;
+        }else {
+            return a;
+        }
+    }
+
+
+    public static String exchangeRateTransform(Double param){
+
+        if (param == 0){
+            return "0";
+        }else{
+            BigDecimal decimal = new BigDecimal(param);
+            BigDecimal percentage = decimal.setScale(2, RoundingMode.HALF_UP);
+            //去掉小数点后多余的0
+            return percentage.stripTrailingZeros().toPlainString();
+        }
+    }
+}

+ 16 - 5
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseInOutInfoMapper.xml

@@ -120,8 +120,10 @@
         left join warehouse_base_info wbi on wbi.id = w.base_id
         left join common_company c on c.comp_id = wbi.comp_id and c.delete_flag = 0
         left join payment_management p on p.id = w.payment_id and p.delete_flag = 0 and p.comp_id = wbi.comp_id
-        left join weighing_management wm on wm.relation_id = p.relation_id and wm.comp_id = p.comp_id and wm.delete_flag = 0
-        left join quality_inspection_management q on q.relation_id = p.relation_id and q.comp_id = p.comp_id and q.delete_flag = 0
+        left join weighing_management wm on wm.relation_id = p.relation_id and wm.comp_id = p.comp_id and wm.delete_flag
+        = 0
+        left join quality_inspection_management q on q.relation_id = p.relation_id and q.comp_id = p.comp_id and
+        q.delete_flag = 0
         WHERE
         w.delete_flag = '0'
         <if test="searchType != null and searchType != ''">
@@ -137,9 +139,9 @@
                 AND w.base_id = #{baseId}
                 and w.status_flag = '3'
             </if>
-             <if test="pcFlag == 0">
-                 and wbi.person_phone = #{phone}
-             </if>
+            <if test="pcFlag == 0">
+                and wbi.person_phone = #{phone}
+            </if>
         </if>
         <if test="startDate != null">
             AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") &gt;=
@@ -310,4 +312,13 @@
         and w.status_flag = '1'
         and w.in_out_type like "%${type}%"
     </select>
+
+    <!-- 关键字查询 -->
+    <select id="brokenLineStatisticalChartByYear" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo">
+        select net_weight as netWeight FROM warehouse_in_out_info
+       where
+        in_out_flag = ${type} AND  (in_out_date BETWEEN #{start} ANd #{end})
+        and delete_flag = "0"
+    </select>
 </mapper>

+ 14 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousePositionStorageInfoMapper.xml

@@ -13,4 +13,18 @@
             a.delete_flag = 0
             and wbi.comp_id = #{compId}
     </select>
+
+    <select id="selectSumWare" parameterType="Map"  resultType="java.lang.Double">
+        SELECT
+            sum(a.`storage`)
+        FROM
+            warehouse_position_storage_info a
+            left join warehouse_position_info wpi on wpi.id = a.position_id and wpi.delete_flag = 0
+            left join warehouse_base_info wbi on wbi.id = wpi.base_id and wbi.delete_flag = 0
+        WHERE
+            a.delete_flag = 0
+            and
+            wbi.id = #{baseId}
+            and wbi.comp_id = #{compId}
+    </select>
 </mapper>