gongdecai 3 jaren geleden
bovenliggende
commit
b30a6e828e

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

@@ -266,6 +266,12 @@ public class TranCarInfo extends BaseModel<TranCarInfo> {
      */
     private Float contractPrice;
 
+    /**
+     * 合同id
+     */
+    @TableField(exist = false)
+    private String contractId;
+
     @Override
     protected Serializable pkVal() {
         return this.id;

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

@@ -1,5 +1,6 @@
 package com.yh.saas.plugin.yiliangyiyun.mapper;
 
+import com.yh.saas.plugin.yiliangyiyun.entity.TranCarInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.yh.saas.plugin.yiliangyiyun.entity.view.ExportVView;
@@ -75,4 +76,5 @@ public interface WarehouseBaseInfoMapper extends BaseMapper<WarehouseBaseInfo> {
      */
     Integer getTemWareHouseCountByCondition(Map<String, Object> pageView);
 
+    List<TranCarInfo> getTranCarInfo(Map<String, Object> pageView);
 }

+ 329 - 145
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseBaseInfoServiceImpl.java

@@ -114,11 +114,12 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
 
     /**
      * 全部仓库
+     *
      * @param compId
      * @return
      */
     @Override
-    public List<WarehouseView> allWarehouse(String compId,String warehouseName,String goodsName) {
+    public List<WarehouseView> allWarehouse(String compId, String warehouseName, String goodsName) {
         Map<String, Object> pageView = new HashMap<>();
         //  公司ID
         pageView.put("compId", compId);
@@ -130,6 +131,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
 
     /**
      * 今日储量明细
+     *
      * @param compId
      * @return
      */
@@ -152,8 +154,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
     @Transactional(rollbackFor = Exception.class)
     public WarehouseBaseInfo selectWarehouseViewinfo(String compId, String warehouseName, String warehouseType) {
         WarehouseBaseInfo warehouseBaseInfos = new WarehouseBaseInfo();
-        if(compId == null || compId.isEmpty()){
-            compId=AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId();
+        if (compId == null || compId.isEmpty()) {
+            compId = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId();
 
         }
         String personCharge = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffMobilePhone();
@@ -185,7 +187,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 for (WarehouseBaseInfo warehouseBaseInfo : warehouseBaseInfoList) {
                     // 以库位为维度查询
                     List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
-                            .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number",false));
+                            .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number", false));
                     if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
                         for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfos) {
                             WarehouseView warehouseView = new WarehouseView();
@@ -324,8 +326,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                     warehouseView.setWarehousePositioning(warehouseBaseInfo.getWarehousePositioning());
                     warehouseView.setAddress(warehouseBaseInfo.getWarehousePrivate() + warehouseBaseInfo.getWarehouseCity() + warehouseBaseInfo.getWarehouseArea() + warehouseBaseInfo.getDetailedAddress());
                     ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
-                        .eq("contract_no",warehouseBaseInfo.getWarehouseName()).eq("delete_flag","0"));
-                    warehouseView.setMaxInStorage(String.valueOf(contractManagementInfo.getWeight()+(contractManagementInfo.getWeight()*contractManagementInfo.getOverShort()/100)+50));
+                            .eq("contract_no", warehouseBaseInfo.getWarehouseName()).eq("delete_flag", "0"));
+                    warehouseView.setMaxInStorage(String.valueOf(contractManagementInfo.getWeight() + (contractManagementInfo.getWeight() * contractManagementInfo.getOverShort() / 100) + 50));
                     // 定义待完成数量
                     int count = 0;
                     //定义入库
@@ -582,7 +584,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 List<WarehousePositionStorageInfo> temp = new ArrayList();
                 // 以库位为维度查询
                 List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
-                        .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number",false));
+                        .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number", false));
                 if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
                     for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfos) {
                         //查询仓库内的货名
@@ -610,12 +612,11 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         WarehouseBaseInfo warehouseBaseInfo = this.selectById(id);
         List<WarehousePositionInfo> warehousePositionInfoList = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
                 .eq("base_id", id)
-                .eq("delete_flag", "0").orderBy("bin_number",false));
+                .eq("delete_flag", "0").orderBy("bin_number", false));
         warehousePositionInfoList.forEach(warehousePositionInfo -> {
             List<WarehousePositionStorageInfo> warehousePositionStorageInfoList = warehousePositionStorageInfoService.selectList(new EntityWrapper<WarehousePositionStorageInfo>()
                     .eq("position_id", warehousePositionInfo.getId())
-                    .eq("delete_flag", "0"))
-                    ;
+                    .eq("delete_flag", "0"));
             Float storage = 0f;
             String detailStorage = "";
             for (WarehousePositionStorageInfo warehousePositionStorageInfo : warehousePositionStorageInfoList) {
@@ -673,7 +674,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 Float residual = 0f;
                 // 以库位为维度查询
                 List<WarehousePositionInfo> warehousePositionInfoList = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
-                        .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number",false));
+                        .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number", false));
                 if (!CollectionUtils.isEmpty(warehousePositionInfoList)) {
                     for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfoList) {
                         // 查询应余量
@@ -745,7 +746,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         if (warehouseBaseInfo.getWarehouseType().equals("1")) {
             //查询仓位信息
             List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
-                    .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number",false));
+                    .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number", false));
             if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
                 for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfos) {
                     warehousePositionInfoService.deleteById(warehousePositionInfo.getId());
@@ -961,7 +962,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 //查船名
                 Wrapper<TranCarInfo> shipListWrapper = new EntityWrapper<>();
                 shipListWrapper.eq("contract_no", inOutWarehouseTask.getMoveTaskNo())
-                       .eq("delete_flag", "0");
+                        .eq("delete_flag", "0");
                 shipListWrapper.andNew().eq("tran_type", "3").or()
                         .eq("three_tran_type", "散船");
                 List<TranCarInfo> shipInfoList = tranCarInfoService.selectList(shipListWrapper);
@@ -1080,52 +1081,235 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         }
         //查采购合同编号(不包含自运),以及移库任务编号,销售合同
         else if (flag == 7) {
-            List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
-                    .eq("comp_id", compId)
-                    .eq("delete_flag", "0")
-                    .eq("contract_type", "2")
-                    .eq("status_flag", "1")
-                    .eq("deliver_type", "2")
-                    .orderBy("update_date", false));
-            for (ContractManagementInfo contractManagementInfo : contractManagementInfoList) {
-                ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
-                        .eq("contract_id", contractManagementInfo.getId()));
-                //查合同下的车牌号,入库只能查到未提交的
-                List<TranCarInfo> tranCarInfoList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
-                        .eq("contract_no", contractManagementInfo.getContractNo())
-                        .eq("fleet_flag", "0").eq("tran_type", "4").eq("three_tran_type", "汽运").ne("submit", "2")
-                        .last("ORDER BY CONVERT ( car_no USING gbk ) ASC"));
-                if (!CollectionUtils.isEmpty(tranCarInfoList)) {
-                    contractManagementInfo.setTranCarInfoList(tranCarInfoList);
-                }
-                //查合同下的车队,入库只能查到未提交的
-                List<TranCarInfo> tranCarInfoList1 = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
-                        .eq("contract_no", contractManagementInfo.getContractNo())
-                        .eq("fleet_flag", "1").eq("tran_type", "4").eq("three_tran_type", "汽运")
-                        .last("ORDER BY CONVERT ( fleet_name USING gbk ) ASC"));
-                if (!CollectionUtils.isEmpty(tranCarInfoList1)) {
-                    contractManagementInfo.setTranCarInfoList1(tranCarInfoList1);
-                }
-                //查船名
-                Wrapper<TranCarInfo> shipListWrapper = new EntityWrapper<>();
-                shipListWrapper.eq("contract_no", contractManagementInfo.getContractNo())
-                       .eq("delete_flag", "0");
-                shipListWrapper.andNew().eq("tran_type", "3").or()
-                        .eq("three_tran_type", "散船");
-                List<TranCarInfo> shipInfoList = tranCarInfoService.selectList(shipListWrapper);
-                if (!CollectionUtils.isEmpty(shipInfoList)) {
-                    contractManagementInfo.setShipInfoList(shipInfoList);
-                }
-                contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
-                contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
-                contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
-                contractManagementInfo.setInOutType("采购入库");
+            Map<String, Object> pageView = new HashMap<>();
+            pageView.put("compId", compId);
+            pageView.put("contractType", '2');
+            pageView.put("statusFlag", '1');
+            pageView.put("deliverType", '2');
+            pageView.put("fleetFlag", '0');
+            pageView.put("tranType", '4');
+            pageView.put("threeTranType", "汽运");
+            pageView.put("submit", '2');
+            pageView.put("flag", '1');
+            //查合同下的车牌号,入库只能查到未提交的
+            List<TranCarInfo> tranCarInfoLists = baseMapper.getTranCarInfo(pageView);
+            /*****************************/
+            Map<String, Object> pageView1 = new HashMap<>();
+            pageView1.put("compId", compId);
+            pageView1.put("contractType", '2');
+            pageView1.put("statusFlag", '1');
+            pageView1.put("deliverType", '2');
+            pageView1.put("fleetFlag", '1');
+            pageView1.put("tranType", '4');
+            pageView1.put("threeTranType", "汽运");
+            pageView1.put("flag", '1');
+            //查合同下的车牌号,入库只能查到未提交的
+            List<TranCarInfo> tranCarInfoLists1 = baseMapper.getTranCarInfo(pageView1);
+            /*****************************/
+            Map<String, Object> pageView2 = new HashMap<>();
+            pageView2.put("compId", compId);
+            pageView2.put("contractType", '2');
+            pageView2.put("statusFlag", '1');
+            pageView2.put("deliverType", '2');
+            pageView2.put("tranType", '3');
+            pageView2.put("threeTranType", "散船");
+            pageView2.put("flag", '2');
+            //查合同下的车牌号,入库只能查到未提交的
+            List<TranCarInfo> tranCarInfoLists2 = baseMapper.getTranCarInfo(pageView2);
+            tranCarInfoLists.addAll(tranCarInfoLists1);
+            tranCarInfoLists.addAll(tranCarInfoLists2);
+            Set< TranCarInfo > set = new HashSet<>(tranCarInfoLists);
+            tranCarInfoLists =  set.stream()
+                    .sorted(Comparator.comparingInt(a -> Integer.parseInt(a.getContractId().substring(1, 25)))).collect(Collectors.toList());
+//            List<ContractManagementInfo> contractManagementInfos = new ArrayList<>();
+            ContractManagementInfo contractManagementInfo = new ContractManagementInfo();
+            List<TranCarInfo> tranCarInfos = new ArrayList<>();
+            List<TranCarInfo> tranCarInfos1 = new ArrayList<>();
+            List<TranCarInfo> tranCarInfos2 = new ArrayList<>();
+            for (int i = 0; i < tranCarInfoLists.size(); i++) {
+                TranCarInfo tranCarInfo = tranCarInfoLists.get(i);
+
                 if (contractManagementInfo.getUnitContractPrice() != null) {
                     //期货取点价,现货取单价
                     contractManagementInfo.setContractPrice(contractManagementInfo.getPointPrice() != null ? contractManagementInfo.getPointPrice() : Float.valueOf(String.valueOf(contractManagementInfo.getUnitContractPrice())));
                 }
-                temp.add(contractManagementInfo);
+                if("0".equals(tranCarInfo.getFleetFlag())&&"4".equals(tranCarInfo.getTranType())&&"汽运".equals(tranCarInfo.getThreeTranType())&&"2".equals(tranCarInfo.getSubmit())) {
+                    if (i == 0) {
+                        contractManagementInfo = new ContractManagementInfo();
+                        contractManagementInfo = contractManagementInfoService.selectById(tranCarInfo.getContractId());
+                        ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
+                                .eq("contract_id", tranCarInfo.getContractId()));
+                        contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
+                        contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
+                        contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
+                        contractManagementInfo.setInOutType("采购入库");
+                        tranCarInfos = new ArrayList<>();
+                        tranCarInfos1 = new ArrayList<>();
+                        tranCarInfos2 = new ArrayList<>();
+                        contractManagementInfo.setId(tranCarInfo.getId());
+                        contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
+                        contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
+                        contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
+                        contractManagementInfo.setInOutType("采购入库");
+                        tranCarInfos.add(tranCarInfo);
+                    } else if (!tranCarInfo.getContractId().equals(tranCarInfoLists.get(i - 1).getContractId())) {
+                        contractManagementInfo.setTranCarInfoList(tranCarInfos);
+                        contractManagementInfo.setTranCarInfoList1(tranCarInfos1);
+                        contractManagementInfo.setShipInfoList(tranCarInfos2);
+                        temp.add(contractManagementInfo);
+                        contractManagementInfo = new ContractManagementInfo();
+                        contractManagementInfo = contractManagementInfoService.selectById(tranCarInfo.getContractId());
+                        ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
+                                .eq("contract_id", tranCarInfo.getContractId()));
+                        contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
+                        contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
+                        contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
+                        contractManagementInfo.setInOutType("采购入库");
+                        tranCarInfos = new ArrayList<>();
+                        tranCarInfos1 = new ArrayList<>();
+                        tranCarInfos2 = new ArrayList<>();
+                        contractManagementInfo.setId(tranCarInfo.getId());
+                        tranCarInfos.add(tranCarInfo);
+                    } else if (i == tranCarInfoLists.size() - 1) {
+                        tranCarInfos.add(tranCarInfo);
+                        contractManagementInfo.setTranCarInfoList(tranCarInfos);
+                        temp.add(contractManagementInfo);
+                    } else {
+                        tranCarInfos.add(tranCarInfo);
+                    }
+                }
+                if("1".equals(tranCarInfo.getFleetFlag())&&"4".equals(tranCarInfo.getTranType())&&"汽运".equals(tranCarInfo.getThreeTranType())) {
+                    if (i == 0) {
+                        contractManagementInfo = new ContractManagementInfo();
+                        contractManagementInfo = contractManagementInfoService.selectById(tranCarInfo.getContractId());
+                        ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
+                                .eq("contract_id", tranCarInfo.getContractId()));
+                        contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
+                        contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
+                        contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
+                        contractManagementInfo.setInOutType("采购入库");
+                        tranCarInfos = new ArrayList<>();
+                        tranCarInfos1 = new ArrayList<>();
+                        tranCarInfos2 = new ArrayList<>();
+                        contractManagementInfo.setId(tranCarInfo.getId());
+                        tranCarInfos1.add(tranCarInfo);
+                    } else if (!tranCarInfo.getContractId().equals(tranCarInfoLists.get(i - 1).getContractId())) {
+                        contractManagementInfo.setTranCarInfoList(tranCarInfos);
+                        contractManagementInfo.setTranCarInfoList1(tranCarInfos1);
+                        contractManagementInfo.setShipInfoList(tranCarInfos2);
+                        temp.add(contractManagementInfo);
+                        contractManagementInfo = new ContractManagementInfo();
+                        contractManagementInfo = contractManagementInfoService.selectById(tranCarInfo.getContractId());
+                        ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
+                                .eq("contract_id", tranCarInfo.getContractId()));
+                        contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
+                        contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
+                        contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
+                        contractManagementInfo.setInOutType("采购入库");
+                        tranCarInfos = new ArrayList<>();
+                        tranCarInfos1 = new ArrayList<>();
+                        tranCarInfos2 = new ArrayList<>();
+                        contractManagementInfo.setId(tranCarInfo.getId());
+                        tranCarInfos.add(tranCarInfo);
+                    } else if (i == tranCarInfoLists.size() - 1) {
+                        tranCarInfos1.add(tranCarInfo);
+                        contractManagementInfo.setTranCarInfoList(tranCarInfos);
+                        temp.add(contractManagementInfo);
+                    } else {
+                        tranCarInfos1.add(tranCarInfo);
+                    }
+                }
+                if("3".equals(tranCarInfo.getTranType())||"散船".equals(tranCarInfo.getThreeTranType())) {
+                    if (i == 0) {
+                        contractManagementInfo = new ContractManagementInfo();
+                        contractManagementInfo = contractManagementInfoService.selectById(tranCarInfo.getContractId());
+                        ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
+                                .eq("contract_id", tranCarInfo.getContractId()));
+                        contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
+                        contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
+                        contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
+                        contractManagementInfo.setInOutType("采购入库");
+                        tranCarInfos = new ArrayList<>();
+                        tranCarInfos1 = new ArrayList<>();
+                        tranCarInfos2 = new ArrayList<>();
+                        contractManagementInfo.setId(tranCarInfo.getId());
+                        tranCarInfos2.add(tranCarInfo);
+                    } else if (!tranCarInfo.getContractId().equals(tranCarInfoLists.get(i - 1).getContractId())) {
+                        contractManagementInfo.setTranCarInfoList(tranCarInfos);
+                        contractManagementInfo.setTranCarInfoList1(tranCarInfos1);
+                        contractManagementInfo.setShipInfoList(tranCarInfos2);
+                        temp.add(contractManagementInfo);
+                        contractManagementInfo = new ContractManagementInfo();
+                        contractManagementInfo = contractManagementInfoService.selectById(tranCarInfo.getContractId());
+                        ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
+                                .eq("contract_id", tranCarInfo.getContractId()));
+                        contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
+                        contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
+                        contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
+                        contractManagementInfo.setInOutType("采购入库");
+                        tranCarInfos = new ArrayList<>();
+                        tranCarInfos1 = new ArrayList<>();
+                        tranCarInfos2 = new ArrayList<>();
+                        contractManagementInfo.setId(tranCarInfo.getId());
+                        tranCarInfos2.add(tranCarInfo);
+                    } else if (i == tranCarInfoLists.size() - 1) {
+                        tranCarInfos2.add(tranCarInfo);
+                        contractManagementInfo.setTranCarInfoList(tranCarInfos);
+                        temp.add(contractManagementInfo);
+                    } else {
+                        tranCarInfos2.add(tranCarInfo);
+                    }
+                }
             }
+
+
+/*****************************************************---------------------------******************************/
+//            List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
+//                    .eq("comp_id", compId)
+//                    .eq("delete_flag", "0")
+//                    .eq("contract_type", "2")
+//                    .eq("status_flag", "1")
+//                    .eq("deliver_type", "2")
+//                    .orderBy("update_date", false));
+//            for (ContractManagementInfo contractManagementInfo : contractManagementInfoList) {
+//                ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
+//                        .eq("contract_id", contractManagementInfo.getId()));
+//                //查合同下的车牌号,入库只能查到未提交的
+//                List<TranCarInfo> tranCarInfoList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
+//                        .eq("contract_no", contractManagementInfo.getContractNo())
+//                        .eq("fleet_flag", "0").eq("tran_type", "4").eq("three_tran_type", "汽运").ne("submit", "2")
+//                        .last("ORDER BY CONVERT ( car_no USING gbk ) ASC"));
+//                if (!CollectionUtils.isEmpty(tranCarInfoList)) {
+//                    contractManagementInfo.setTranCarInfoList(tranCarInfoList);
+//                }
+//                //查合同下的车队,入库只能查到未提交的
+//                List<TranCarInfo> tranCarInfoList1 = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
+//                        .eq("contract_no", contractManagementInfo.getContractNo())
+//                        .eq("fleet_flag", "1").eq("tran_type", "4").eq("three_tran_type", "汽运")
+//                        .last("ORDER BY CONVERT ( fleet_name USING gbk ) ASC"));
+//                if (!CollectionUtils.isEmpty(tranCarInfoList1)) {
+//                    contractManagementInfo.setTranCarInfoList1(tranCarInfoList1);
+//                }
+//                //查船名
+//                Wrapper<TranCarInfo> shipListWrapper = new EntityWrapper<>();
+//                shipListWrapper.eq("contract_no", contractManagementInfo.getContractNo())
+//                        .eq("delete_flag", "0");
+//                shipListWrapper.andNew().eq("tran_type", "3").or()
+//                        .eq("three_tran_type", "散船");
+//                List<TranCarInfo> shipInfoList = tranCarInfoService.selectList(shipListWrapper);
+//                if (!CollectionUtils.isEmpty(shipInfoList)) {
+//                    contractManagementInfo.setShipInfoList(shipInfoList);
+//                }
+//                contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
+//                contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
+//                contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
+//                contractManagementInfo.setInOutType("采购入库");
+//                if (contractManagementInfo.getUnitContractPrice() != null) {
+//                    //期货取点价,现货取单价
+//                    contractManagementInfo.setContractPrice(contractManagementInfo.getPointPrice() != null ? contractManagementInfo.getPointPrice() : Float.valueOf(String.valueOf(contractManagementInfo.getUnitContractPrice())));
+//                }
+//                temp.add(contractManagementInfo);
+//            }
             List<ContractManagementInfo> contractManagementInfoList1 = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
                     .eq("comp_id", compId)
                     .eq("status_flag", "1")
@@ -1151,7 +1335,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 //查船名
                 Wrapper<TranCarInfo> shipListWrapper = new EntityWrapper<>();
                 shipListWrapper.eq("contract_no", contractManagementInfo1.getContractNo())
-                       .eq("delete_flag", "0");
+                        .eq("delete_flag", "0");
                 shipListWrapper.andNew().eq("tran_type", "3").or()
                         .eq("three_tran_type", "散船");
                 List<TranCarInfo> shipInfoList = tranCarInfoService.selectList(shipListWrapper);
@@ -1171,20 +1355,20 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                     .eq("in_out_flag", "1")
                     .orderBy("update_date", false));
             for (InOutWarehouseTask inOutWarehouseTask : inOutWarehouseTaskList) {
-                ContractManagementInfo contractManagementInfo = new ContractManagementInfo();
+                ContractManagementInfo contractManagementInfo1 = new ContractManagementInfo();
                 BeanUtils.copyProperties(inOutWarehouseTask, contractManagementInfo);
                 //查移库任务编号下的车牌号,入库只能查到已出库的
                 List<TranCarInfo> tranCarInfoList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
                         .eq("contract_no", inOutWarehouseTask.getMoveTaskNo()).eq("fleet_flag", "0").eq("tran_type", "1").eq("submit", "1")
                         .last("ORDER BY CONVERT ( car_no USING gbk ) ASC"));
                 if (!CollectionUtils.isEmpty(tranCarInfoList)) {
-                    contractManagementInfo.setTranCarInfoList(tranCarInfoList);
+                    contractManagementInfo1.setTranCarInfoList(tranCarInfoList);
                 }
                 List<TranCarInfo> tranCarInfoList1 = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
                         .eq("contract_no", inOutWarehouseTask.getMoveTaskNo()).eq("fleet_flag", "1").eq("tran_type", "1")
                         .last("ORDER BY CONVERT ( fleet_name USING gbk ) ASC"));
                 if (!CollectionUtils.isEmpty(tranCarInfoList1)) {
-                    contractManagementInfo.setTranCarInfoList1(tranCarInfoList1);
+                    contractManagementInfo1.setTranCarInfoList1(tranCarInfoList1);
                 }
                 //查船名
                 Wrapper<TranCarInfo> shipListWrapper = new EntityWrapper<>();
@@ -1194,23 +1378,23 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                         .eq("three_tran_type", "散船");
                 List<TranCarInfo> shipInfoList = tranCarInfoService.selectList(shipListWrapper);
                 if (!CollectionUtils.isEmpty(shipInfoList)) {
-                    contractManagementInfo.setShipInfoList(shipInfoList);
+                    contractManagementInfo1.setShipInfoList(shipInfoList);
                 }
-                contractManagementInfo.setContractNo(inOutWarehouseTask.getMoveTaskNo());
-                contractManagementInfo.setContractPrice(inOutWarehouseTask.getUnitPrice());
+                contractManagementInfo1.setContractNo(inOutWarehouseTask.getMoveTaskNo());
+                contractManagementInfo1.setContractPrice(inOutWarehouseTask.getUnitPrice());
                 //自运采购的移库
-                ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                ContractManagementInfo contractManagementInfo2 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
                         .eq("comp_id", inOutWarehouseTask.getCompId())
                         .eq("contract_no", inOutWarehouseTask.getSendWarehouse()));
-                if (contractManagementInfo1 != null) {
-                    contractManagementInfo.setContractPrice(Float.valueOf(String.valueOf(contractManagementInfo1.getUnitContractPrice())));
+                if (contractManagementInfo2 != null) {
+                    contractManagementInfo1.setContractPrice(Float.valueOf(String.valueOf(contractManagementInfo1.getUnitContractPrice())));
                 }
                 //移库看成自运
-                contractManagementInfo.setDeliverType("1");
-                contractManagementInfo.setSendWarehouse(inOutWarehouseTask.getSendWarehouse());
-                contractManagementInfo.setGrade(inOutWarehouseTask.getGrade());
-                contractManagementInfo.setInOutType("移库入库");
-                temp.add(contractManagementInfo);
+                contractManagementInfo1.setDeliverType("1");
+                contractManagementInfo1.setSendWarehouse(inOutWarehouseTask.getSendWarehouse());
+                contractManagementInfo1.setGrade(inOutWarehouseTask.getGrade());
+                contractManagementInfo1.setInOutType("移库入库");
+                temp.add(contractManagementInfo1);
             }
             return temp;
         }
@@ -1295,13 +1479,13 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 Map<String, Object> pageView = new HashMap<>();
                 pageView.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                 pageView.put("compId", warehouseBaseInfo.getCompId());
-                pageView.put("serviceManagementType","3");
+                pageView.put("serviceManagementType", "3");
                 // 查询收购质检信息包括已删除的
                 Integer dataCount = baseMapper.getCountByCondition(pageView);
                 Map<String, Object> pageView1 = new HashMap<>();
                 pageView1.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                 pageView1.put("compId", warehouseBaseInfo.getCompId());
-                pageView1.put("serviceManagementType","1");
+                pageView1.put("serviceManagementType", "1");
                 // 查询贸易质检信息包括已删除的
                 Integer dataCount1 = baseMapper.getCountByCondition(pageView1);
                 warehouseBaseInfo.setCount(dataCount);
@@ -1309,7 +1493,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 Map<String, Object> pageView2 = new HashMap<>();
                 pageView2.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                 pageView2.put("compId", warehouseBaseInfo.getCompId());
-                pageView2.put("serviceManagementType","2");
+                pageView2.put("serviceManagementType", "2");
                 // 查询出库信息包括已删除的
                 Integer dataCount2 = baseMapper.getCountByCondition(pageView2);
                 warehouseBaseInfo.setOutCount(dataCount2);
@@ -1338,13 +1522,13 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                         Map<String, Object> pageView = new HashMap<>();
                         pageView.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                         pageView.put("compId", warehouseBaseInfo.getCompId());
-                        pageView.put("serviceManagementType","3");
+                        pageView.put("serviceManagementType", "3");
                         // 查询收购质检信息包括已删除的
                         Integer dataCount = baseMapper.getCountByCondition(pageView);
                         Map<String, Object> pageView1 = new HashMap<>();
                         pageView1.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                         pageView1.put("compId", warehouseBaseInfo.getCompId());
-                        pageView1.put("serviceManagementType","1");
+                        pageView1.put("serviceManagementType", "1");
                         // 查询贸易质检信息包括已删除的
                         Integer dataCount1 = baseMapper.getCountByCondition(pageView1);
                         warehouseBaseInfo.setCount(dataCount);
@@ -1352,7 +1536,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                         Map<String, Object> pageView2 = new HashMap<>();
                         pageView2.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                         pageView2.put("compId", warehouseBaseInfo.getCompId());
-                        pageView2.put("serviceManagementType","2");
+                        pageView2.put("serviceManagementType", "2");
                         // 查询出库信息包括已删除的
                         Integer dataCount2 = baseMapper.getCountByCondition(pageView2);
                         warehouseBaseInfo.setOutCount(dataCount2);
@@ -1368,7 +1552,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 List<WarehousePositionStorageInfo> temp = new ArrayList();
                 // 以库位为维度查询
                 List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
-                        .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number",false));
+                        .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number", false));
                 if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
                     for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfos) {
                         //查询仓库内的货名
@@ -1405,7 +1589,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             personCharge = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffMobilePhone();
         }
         Wrapper<WarehouseBaseInfo> warehouseBaseInfoWrapper = new EntityWrapper<>();
-        warehouseBaseInfoWrapper.eq("comp_id", compId).eq("warehouse_type","1")
+        warehouseBaseInfoWrapper.eq("comp_id", compId).eq("warehouse_type", "1")
                 .orderBy("warehouse_type", true).eq("delete_flag", "0");
         warehouseBaseInfoWrapper.andNew().eq("person_phone", personCharge).or()
                 .like("other_person_charge", personCharge);
@@ -1422,13 +1606,13 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 Map<String, Object> pageView = new HashMap<>();
                 pageView.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                 pageView.put("compId", warehouseBaseInfo.getCompId());
-                pageView.put("serviceManagementType","3");
+                pageView.put("serviceManagementType", "3");
                 // 查询收购质检信息包括已删除的
                 Integer dataCount = baseMapper.getCountByCondition(pageView);
                 Map<String, Object> pageView1 = new HashMap<>();
                 pageView1.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                 pageView1.put("compId", warehouseBaseInfo.getCompId());
-                pageView1.put("serviceManagementType","1");
+                pageView1.put("serviceManagementType", "1");
                 // 查询贸易质检信息包括已删除的
                 Integer dataCount1 = baseMapper.getCountByCondition(pageView1);
                 warehouseBaseInfo.setCount(dataCount);
@@ -1436,7 +1620,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 Map<String, Object> pageView2 = new HashMap<>();
                 pageView2.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                 pageView2.put("compId", warehouseBaseInfo.getCompId());
-                pageView2.put("serviceManagementType","2");
+                pageView2.put("serviceManagementType", "2");
                 // 查询出库信息包括已删除的
                 Integer dataCount2 = baseMapper.getCountByCondition(pageView2);
                 warehouseBaseInfo.setOutCount(dataCount2);
@@ -1466,13 +1650,13 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                         Map<String, Object> pageView = new HashMap<>();
                         pageView.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                         pageView.put("compId", warehouseBaseInfo.getCompId());
-                        pageView.put("serviceManagementType","3");
+                        pageView.put("serviceManagementType", "3");
                         // 查询收购质检信息包括已删除的
                         Integer dataCount = baseMapper.getCountByCondition(pageView);
                         Map<String, Object> pageView1 = new HashMap<>();
                         pageView1.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                         pageView1.put("compId", warehouseBaseInfo.getCompId());
-                        pageView1.put("serviceManagementType","1");
+                        pageView1.put("serviceManagementType", "1");
                         // 查询贸易质检信息包括已删除的
                         Integer dataCount1 = baseMapper.getCountByCondition(pageView1);
                         warehouseBaseInfo.setCount(dataCount);
@@ -1480,7 +1664,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                         Map<String, Object> pageView2 = new HashMap<>();
                         pageView2.put("warehouseName", warehouseBaseInfo.getWarehouseName());
                         pageView2.put("compId", warehouseBaseInfo.getCompId());
-                        pageView2.put("serviceManagementType","2");
+                        pageView2.put("serviceManagementType", "2");
                         // 查询出库信息包括已删除的
                         Integer dataCount2 = baseMapper.getCountByCondition(pageView2);
                         warehouseBaseInfo.setOutCount(dataCount2);
@@ -1496,7 +1680,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 List<WarehousePositionStorageInfo> temp = new ArrayList();
                 // 以库位为维度查询
                 List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
-                        .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number",false));
+                        .eq("base_id", warehouseBaseInfo.getId()).orderBy("bin_number", false));
                 if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
                     for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfos) {
                         //查询仓库内的货名
@@ -1887,16 +2071,16 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
 
         // 设置列宽
         sheet.setColumnWidth(0, 1 * 256 + 184);
-        sheet.setColumnWidth(1, "采购公司".getBytes().length*3*256);
-        sheet.setColumnWidth(2, "收货仓库".getBytes().length*25/10*256);
+        sheet.setColumnWidth(1, "采购公司".getBytes().length * 3 * 256);
+        sheet.setColumnWidth(2, "收货仓库".getBytes().length * 25 / 10 * 256);
         sheet.setColumnWidth(3, 12 * 256 + 184);
-        sheet.setColumnWidth(4, "开票日期".getBytes().length*2*256);
-        sheet.setColumnWidth(5, "合同编号".getBytes().length*2*256);
-        sheet.setColumnWidth(6, "业务编号".getBytes().length*2*256);
+        sheet.setColumnWidth(4, "开票日期".getBytes().length * 2 * 256);
+        sheet.setColumnWidth(5, "合同编号".getBytes().length * 2 * 256);
+        sheet.setColumnWidth(6, "业务编号".getBytes().length * 2 * 256);
         sheet.setColumnWidth(7, 12 * 256 + 184);
         sheet.setColumnWidth(8, 12 * 256 + 184);
         sheet.setColumnWidth(9, 12 * 256 + 184);
-        sheet.setColumnWidth(10, "货名".getBytes().length*3*256);
+        sheet.setColumnWidth(10, "货名".getBytes().length * 3 * 256);
         sheet.setColumnWidth(11, 12 * 256 + 184);
         sheet.setColumnWidth(12, 12 * 256 + 184);
         sheet.setColumnWidth(13, 12 * 256 + 184);
@@ -1917,17 +2101,17 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(28, 12 * 256 + 184);
         sheet.setColumnWidth(29, 12 * 256 + 184);
         sheet.setColumnWidth(30, 12 * 256 + 184);
-        sheet.setColumnWidth(31, "发货库".getBytes().length*25/10*256);
+        sheet.setColumnWidth(31, "发货库".getBytes().length * 25 / 10 * 256);
         sheet.setColumnWidth(32, 12 * 256 + 184);
         sheet.setColumnWidth(33, 12 * 256 + 184);
         sheet.setColumnWidth(34, 12 * 256 + 184);
         sheet.setColumnWidth(35, 12 * 256 + 184);
         sheet.setColumnWidth(36, 12 * 256 + 184);
-        sheet.setColumnWidth(37, "合计应付".getBytes().length*2*256);
+        sheet.setColumnWidth(37, "合计应付".getBytes().length * 2 * 256);
         sheet.setColumnWidth(38, 12 * 256 + 184);
         sheet.setColumnWidth(39, 12 * 256 + 184);
-        sheet.setColumnWidth(40, "卡号".getBytes().length*4*256);
-        sheet.setColumnWidth(41, "开户支行".getBytes().length*4*256);
+        sheet.setColumnWidth(40, "卡号".getBytes().length * 4 * 256);
+        sheet.setColumnWidth(41, "开户支行".getBytes().length * 4 * 256);
         sheet.setColumnWidth(42, 1 * 256 + 184);
 
         // 创建单元格对象
@@ -2357,32 +2541,32 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 cell.setCellValue(editString(exportVView.getGrade()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(13);
-                if(!StringUtils.isEmpty(exportVView.getWaterContent())){
+                if (!StringUtils.isEmpty(exportVView.getWaterContent())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getWaterContent()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(14);
-                if(!StringUtils.isEmpty(exportVView.getImpurity())){
+                if (!StringUtils.isEmpty(exportVView.getImpurity())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getImpurity()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(15);
-                if(!StringUtils.isEmpty(exportVView.getMildewGrain())){
+                if (!StringUtils.isEmpty(exportVView.getMildewGrain())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getMildewGrain()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(16);
-                if(!StringUtils.isEmpty(exportVView.getImperfectGrain())){
+                if (!StringUtils.isEmpty(exportVView.getImperfectGrain())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getImperfectGrain()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(17);
-                if(!StringUtils.isEmpty(exportVView.getBulkDensity())){
+                if (!StringUtils.isEmpty(exportVView.getBulkDensity())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getBulkDensity()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(18);
-                if(!StringUtils.isEmpty(exportVView.getJiaorenli())){
+                if (!StringUtils.isEmpty(exportVView.getJiaorenli())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getJiaorenli()));
                 }
                 cell.setCellStyle(contextstyle);
@@ -2716,16 +2900,16 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
 
         // 设置列宽
         sheet.setColumnWidth(0, 1 * 256 + 184);
-        sheet.setColumnWidth(1, "采购公司".getBytes().length*3*256);
-        sheet.setColumnWidth(2, "收货仓库".getBytes().length*25/10*256);
+        sheet.setColumnWidth(1, "采购公司".getBytes().length * 3 * 256);
+        sheet.setColumnWidth(2, "收货仓库".getBytes().length * 25 / 10 * 256);
         sheet.setColumnWidth(3, 12 * 256 + 184);
-        sheet.setColumnWidth(4, "开票日期".getBytes().length*2*256);
-        sheet.setColumnWidth(5, "合同编号".getBytes().length*2*256);
-        sheet.setColumnWidth(6, "业务编号".getBytes().length*2*256);
+        sheet.setColumnWidth(4, "开票日期".getBytes().length * 2 * 256);
+        sheet.setColumnWidth(5, "合同编号".getBytes().length * 2 * 256);
+        sheet.setColumnWidth(6, "业务编号".getBytes().length * 2 * 256);
         sheet.setColumnWidth(7, 12 * 256 + 184);
         sheet.setColumnWidth(8, 12 * 256 + 184);
         sheet.setColumnWidth(9, 12 * 256 + 184);
-        sheet.setColumnWidth(10, "货名".getBytes().length*3*256);
+        sheet.setColumnWidth(10, "货名".getBytes().length * 3 * 256);
         sheet.setColumnWidth(11, 12 * 256 + 184);
         sheet.setColumnWidth(12, 12 * 256 + 184);
         sheet.setColumnWidth(13, 12 * 256 + 184);
@@ -2746,17 +2930,17 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(28, 12 * 256 + 184);
         sheet.setColumnWidth(29, 12 * 256 + 184);
         sheet.setColumnWidth(30, 12 * 256 + 184);
-        sheet.setColumnWidth(31, "发货库".getBytes().length*25/10*256);
+        sheet.setColumnWidth(31, "发货库".getBytes().length * 25 / 10 * 256);
         sheet.setColumnWidth(32, 12 * 256 + 184);
         sheet.setColumnWidth(33, 12 * 256 + 184);
         sheet.setColumnWidth(34, 12 * 256 + 184);
         sheet.setColumnWidth(35, 12 * 256 + 184);
         sheet.setColumnWidth(36, 12 * 256 + 184);
-        sheet.setColumnWidth(37, "合计应付".getBytes().length*2*256);
+        sheet.setColumnWidth(37, "合计应付".getBytes().length * 2 * 256);
         sheet.setColumnWidth(38, 12 * 256 + 184);
         sheet.setColumnWidth(39, 12 * 256 + 184);
-        sheet.setColumnWidth(40, "卡号".getBytes().length*4*256);
-        sheet.setColumnWidth(41, "开户支行".getBytes().length*4*256);
+        sheet.setColumnWidth(40, "卡号".getBytes().length * 4 * 256);
+        sheet.setColumnWidth(41, "开户支行".getBytes().length * 4 * 256);
         sheet.setColumnWidth(42, 1 * 256 + 184);
 
         // 创建单元格对象
@@ -3176,32 +3360,32 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 cell.setCellValue(editString(exportVView.getGrade()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(13);
-                if(!StringUtils.isEmpty(exportVView.getWaterContent())){
+                if (!StringUtils.isEmpty(exportVView.getWaterContent())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getWaterContent()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(14);
-                if(!StringUtils.isEmpty(exportVView.getImpurity())){
+                if (!StringUtils.isEmpty(exportVView.getImpurity())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getImpurity()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(15);
-                if(!StringUtils.isEmpty(exportVView.getMildewGrain())){
+                if (!StringUtils.isEmpty(exportVView.getMildewGrain())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getMildewGrain()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(16);
-                if(!StringUtils.isEmpty(exportVView.getImperfectGrain())){
+                if (!StringUtils.isEmpty(exportVView.getImperfectGrain())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getImperfectGrain()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(17);
-                if(!StringUtils.isEmpty(exportVView.getBulkDensity())){
+                if (!StringUtils.isEmpty(exportVView.getBulkDensity())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getBulkDensity()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(18);
-                if(!StringUtils.isEmpty(exportVView.getJiaorenli())){
+                if (!StringUtils.isEmpty(exportVView.getJiaorenli())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getJiaorenli()));
                 }
                 cell.setCellStyle(contextstyle);
@@ -3535,17 +3719,17 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
 
         // 设置列宽
         sheet.setColumnWidth(0, 1 * 256 + 184);
-        sheet.setColumnWidth(1, "销售公司".getBytes().length*3*256);
-        sheet.setColumnWidth(2, "发货仓库".getBytes().length*25/10*256);
+        sheet.setColumnWidth(1, "销售公司".getBytes().length * 3 * 256);
+        sheet.setColumnWidth(2, "发货仓库".getBytes().length * 25 / 10 * 256);
         sheet.setColumnWidth(3, 12 * 256 + 184);
         sheet.setColumnWidth(4, 12 * 256 + 184);
-        sheet.setColumnWidth(5, "发货日期".getBytes().length*2*256);
-        sheet.setColumnWidth(6, "合同编号".getBytes().length*2*256);
+        sheet.setColumnWidth(5, "发货日期".getBytes().length * 2 * 256);
+        sheet.setColumnWidth(6, "合同编号".getBytes().length * 2 * 256);
         sheet.setColumnWidth(7, 12 * 256 + 184);
         sheet.setColumnWidth(8, 12 * 256 + 184);
         sheet.setColumnWidth(9, 12 * 256 + 184);
-        sheet.setColumnWidth(10, "客户".getBytes().length*6*256);
-        sheet.setColumnWidth(11, "货名".getBytes().length*3*256);
+        sheet.setColumnWidth(10, "客户".getBytes().length * 6 * 256);
+        sheet.setColumnWidth(11, "货名".getBytes().length * 3 * 256);
         sheet.setColumnWidth(12, 12 * 256 + 184);
         sheet.setColumnWidth(13, 12 * 256 + 184);
         sheet.setColumnWidth(14, 12 * 256 + 184);
@@ -3567,7 +3751,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(30, 12 * 256 + 184);
         sheet.setColumnWidth(31, 12 * 256 + 184);
         sheet.setColumnWidth(32, 12 * 256 + 184);
-        sheet.setColumnWidth(33, "反馈日期".getBytes().length*2*256);
+        sheet.setColumnWidth(33, "反馈日期".getBytes().length * 2 * 256);
         sheet.setColumnWidth(34, 12 * 256 + 184);
         sheet.setColumnWidth(35, 12 * 256 + 184);
         sheet.setColumnWidth(36, 12 * 256 + 184);
@@ -3577,7 +3761,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(40, 12 * 256 + 184);
         sheet.setColumnWidth(41, 12 * 256 + 184);
         sheet.setColumnWidth(42, 12 * 256 + 184);
-        sheet.setColumnWidth(43, "收款日期".getBytes().length*2*256);
+        sheet.setColumnWidth(43, "收款日期".getBytes().length * 2 * 256);
         sheet.setColumnWidth(44, 12 * 256 + 184);
         sheet.setColumnWidth(45, 12 * 256 + 184);
         sheet.setColumnWidth(46, 1 * 256 + 184);
@@ -4027,32 +4211,32 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 cell.setCellValue(editString(exportVView.getGrade()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(14);
-                if(!StringUtils.isEmpty(exportVView.getWaterContent())){
+                if (!StringUtils.isEmpty(exportVView.getWaterContent())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getWaterContent()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(15);
-                if(!StringUtils.isEmpty(exportVView.getImpurity())){
+                if (!StringUtils.isEmpty(exportVView.getImpurity())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getImpurity()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(16);
-                if(!StringUtils.isEmpty(exportVView.getMildewGrain())){
+                if (!StringUtils.isEmpty(exportVView.getMildewGrain())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getMildewGrain()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(17);
-                if(!StringUtils.isEmpty(exportVView.getImperfectGrain())){
+                if (!StringUtils.isEmpty(exportVView.getImperfectGrain())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getImperfectGrain()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(18);
-                if(!StringUtils.isEmpty(exportVView.getBulkDensity())){
+                if (!StringUtils.isEmpty(exportVView.getBulkDensity())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getBulkDensity()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(19);
-                if(!StringUtils.isEmpty(exportVView.getJiaorenli())){
+                if (!StringUtils.isEmpty(exportVView.getJiaorenli())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getJiaorenli()));
                 }
                 cell.setCellStyle(contextstyle);
@@ -4396,17 +4580,17 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
 
         // 设置列宽
         sheet.setColumnWidth(0, 1 * 256 + 184);
-        sheet.setColumnWidth(1, "销售公司".getBytes().length*3*256);
-        sheet.setColumnWidth(2, "发货仓库".getBytes().length*25/10*256);
+        sheet.setColumnWidth(1, "销售公司".getBytes().length * 3 * 256);
+        sheet.setColumnWidth(2, "发货仓库".getBytes().length * 25 / 10 * 256);
         sheet.setColumnWidth(3, 12 * 256 + 184);
         sheet.setColumnWidth(4, 12 * 256 + 184);
-        sheet.setColumnWidth(5, "发货日期".getBytes().length*2*256);
-        sheet.setColumnWidth(6, "合同编号".getBytes().length*2*256);
+        sheet.setColumnWidth(5, "发货日期".getBytes().length * 2 * 256);
+        sheet.setColumnWidth(6, "合同编号".getBytes().length * 2 * 256);
         sheet.setColumnWidth(7, 12 * 256 + 184);
         sheet.setColumnWidth(8, 12 * 256 + 184);
         sheet.setColumnWidth(9, 12 * 256 + 184);
-        sheet.setColumnWidth(10, "客户".getBytes().length*6*256);
-        sheet.setColumnWidth(11, "货名".getBytes().length*3*256);
+        sheet.setColumnWidth(10, "客户".getBytes().length * 6 * 256);
+        sheet.setColumnWidth(11, "货名".getBytes().length * 3 * 256);
         sheet.setColumnWidth(12, 12 * 256 + 184);
         sheet.setColumnWidth(13, 12 * 256 + 184);
         sheet.setColumnWidth(14, 12 * 256 + 184);
@@ -4428,7 +4612,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(30, 12 * 256 + 184);
         sheet.setColumnWidth(31, 12 * 256 + 184);
         sheet.setColumnWidth(32, 12 * 256 + 184);
-        sheet.setColumnWidth(33, "反馈日期".getBytes().length*2*256);
+        sheet.setColumnWidth(33, "反馈日期".getBytes().length * 2 * 256);
         sheet.setColumnWidth(34, 12 * 256 + 184);
         sheet.setColumnWidth(35, 12 * 256 + 184);
         sheet.setColumnWidth(36, 12 * 256 + 184);
@@ -4438,7 +4622,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(40, 12 * 256 + 184);
         sheet.setColumnWidth(41, 12 * 256 + 184);
         sheet.setColumnWidth(42, 12 * 256 + 184);
-        sheet.setColumnWidth(43, "收款日期".getBytes().length*2*256);
+        sheet.setColumnWidth(43, "收款日期".getBytes().length * 2 * 256);
         sheet.setColumnWidth(44, 12 * 256 + 184);
         sheet.setColumnWidth(45, 12 * 256 + 184);
         sheet.setColumnWidth(46, 1 * 256 + 184);
@@ -4887,32 +5071,32 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 cell.setCellValue(editString(exportVView.getGrade()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(14);
-                if(!StringUtils.isEmpty(exportVView.getWaterContent())){
+                if (!StringUtils.isEmpty(exportVView.getWaterContent())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getWaterContent()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(15);
-                if(!StringUtils.isEmpty(exportVView.getImpurity())){
+                if (!StringUtils.isEmpty(exportVView.getImpurity())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getImpurity()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(16);
-                if(!StringUtils.isEmpty(exportVView.getMildewGrain())){
+                if (!StringUtils.isEmpty(exportVView.getMildewGrain())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getMildewGrain()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(17);
-                if(!StringUtils.isEmpty(exportVView.getImperfectGrain())){
+                if (!StringUtils.isEmpty(exportVView.getImperfectGrain())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getImperfectGrain()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(18);
-                if(!StringUtils.isEmpty(exportVView.getBulkDensity())){
+                if (!StringUtils.isEmpty(exportVView.getBulkDensity())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getBulkDensity()));
                 }
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(19);
-                if(!StringUtils.isEmpty(exportVView.getJiaorenli())){
+                if (!StringUtils.isEmpty(exportVView.getJiaorenli())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getJiaorenli()));
                 }
                 cell.setCellStyle(contextstyle);
@@ -5026,7 +5210,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             log.debug(e.getMessage());
         }
         // 下载
-         return downloadPhone(path, response, wb);
+        return downloadPhone(path, response, wb);
 
     }
 

+ 112 - 45
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

@@ -61,7 +61,8 @@
         q.box_no_other as boxNoOther,
         q.title_no as titleNo,
         q.title_no_other as titleNoOther,
-        ROUND(case when a.type ='干粮' then  q.dry_grain_price*1000 else q.tidal_grain_price*1000 end ,2) as netWeightPrice,
+        ROUND(case when a.type ='干粮' then q.dry_grain_price*1000 else q.tidal_grain_price*1000 end ,2) as
+        netWeightPrice,
         ROUND(a.gross_weight/1000,2) as grossWeight,
         ROUND(a.tare/1000,2) as tare,
         ROUND(a.weight_deduction/1000,2) as buckleWeight,
@@ -76,12 +77,13 @@
         i.bank_deposit as bankDeposit,
         i.bank_deposit_branch as bankDepositBranch
         FROM payment_management a
-        left join quality_inspection_management q on q.relation_id = a.relation_id and q.comp_id = a.comp_id and q.delete_flag = 0
+        left join quality_inspection_management q on q.relation_id = a.relation_id and q.comp_id = a.comp_id and
+        q.delete_flag = 0
         left join weighing_management w on w.relation_id = a.relation_id and w.comp_id = a.comp_id and w.delete_flag = 0
         left join common_company c on c.comp_id = a.comp_id and c.delete_flag = 0
         left join identity_authentication_info i on i.customer_name = a.customer_name
         and i.customer_phone = a.customer_phone and i.customer_type_flag = 1 and i.delete_flag = 0 and i.cover = 0
-        left join common_company_identity cci on  cci.com_id = a.comp_id  and cci.delete_flag = 0
+        left join common_company_identity cci on cci.com_id = a.comp_id and cci.delete_flag = 0
         WHERE a.delete_flag = '0'
         and cci.identity_id = i.id
         AND a.comp_id = #{compId}
@@ -143,12 +145,15 @@
         FROM stock_purchase_receipt_report s
         left join warehouse_in_out_info w on w.id = s.warehouse_record_id and w.delete_flag = 0
         left join warehouse_in_out_detail wd on wd.info_id = w.id
-        left join tran_car_info t on t.contract_no = w.contract_no and t.delete_flag = 0 and t.tran_car_no = w.tran_car_no and t.car_no = w.car_no
+        left join tran_car_info t on t.contract_no = w.contract_no and t.delete_flag = 0 and t.tran_car_no =
+        w.tran_car_no and t.car_no = w.car_no
         left join tran_settlement_report r on r.car_id = t.id and r.delete_flag = 0
         left join common_company c on c.comp_id = s.comp_id and c.delete_flag = 0
-        left join contract_management_info m on m.comp_id = s.comp_id and m.contract_no = s.contract_no and  m.delete_flag = 0
-        left join contract_goods_info g on m.id=g.contract_id and  g.delete_flag = 0
-        left join customer_info i on ((i.comp_name = m.seller and customer_type='企业客户') or (i.customer_name = m.seller and customer_type='个人客户'))
+        left join contract_management_info m on m.comp_id = s.comp_id and m.contract_no = s.contract_no and
+        m.delete_flag = 0
+        left join contract_goods_info g on m.id=g.contract_id and g.delete_flag = 0
+        left join customer_info i on ((i.comp_name = m.seller and customer_type='企业客户') or (i.customer_name = m.seller
+        and customer_type='个人客户'))
         and i.customer_phone = m.seller_phone and i.delete_flag = 0
         WHERE s.delete_flag = '0'
         AND s.comp_id = #{compId}
@@ -212,9 +217,11 @@
         left join stock_purchase_receipt_report s on s.warehouse_record_id=w.id and s.delete_flag = 0
         left join warehouse_base_info b on b.id=w.base_id and b.delete_flag = 0
         left join common_company c on c.comp_id = b.comp_id and c.delete_flag = 0
-        left join in_out_warehouse_task i on w.contract_no = i.move_task_no and i.delete_flag = 0 and i.in_out_type = '移库出库'
+        left join in_out_warehouse_task i on w.contract_no = i.move_task_no and i.delete_flag = 0 and i.in_out_type =
+        '移库出库'
         and i.receive_warehouse = #{warehouseName}
-        left join tran_car_info t on t.contract_no = w.contract_no and t.delete_flag = 0 and t.tran_car_no = w.tran_car_no and t.car_no = w.car_no
+        left join tran_car_info t on t.contract_no = w.contract_no and t.delete_flag = 0 and t.tran_car_no =
+        w.tran_car_no and t.car_no = w.car_no
         left join tran_settlement_report r on r.car_id = t.id and r.delete_flag = 0
         WHERE w.delete_flag = '0'
         AND b.comp_id = #{compId}
@@ -347,9 +354,11 @@
         w.net_weight as netWeight
         FROM warehouse_in_out_info w
         left join warehouse_in_out_detail d on w.id=d.info_id and d.delete_flag = 0
-        left join tran_car_info t on t.contract_no = w.contract_no and t.delete_flag = 0 and t.tran_car_no = w.tran_car_no and t.car_no = w.car_no
+        left join tran_car_info t on t.contract_no = w.contract_no and t.delete_flag = 0 and t.tran_car_no =
+        w.tran_car_no and t.car_no = w.car_no
         left join warehouse_base_info b on b.id=w.base_id and b.delete_flag = 0
-        left join contract_management_info m on m.comp_id = b.comp_id and m.contract_no = w.warehouse_name and  m.delete_flag = 0
+        left join contract_management_info m on m.comp_id = b.comp_id and m.contract_no = w.warehouse_name and
+        m.delete_flag = 0
         WHERE w.delete_flag = '0'
         AND b.comp_id = #{compId}
         and w.in_out_flag = 1
@@ -396,7 +405,8 @@
         m.weight as weight,
         s.gross_weight as grossWeight,
         s.tare as tare,
-        CASE WHEN ( SELECT sum( ssrr.amount_not_receivable ) FROM stock_sale_receipt_report ssrr WHERE ssrr.contract_no = s.contract_no ) > 0 THEN
+        CASE WHEN ( SELECT sum( ssrr.amount_not_receivable ) FROM stock_sale_receipt_report ssrr WHERE ssrr.contract_no
+        = s.contract_no ) > 0 THEN
         '未结算' ELSE '已结算' END AS contractStatus,
         s.feedback_weight as feedbackWeight,
         s.feedback_date as feedbackDate,
@@ -404,7 +414,7 @@
         case when p.tran_type_key = '1' then p.actual_freight else '' end as carFreight,
         case when p.tran_type_key = '2' then p.actual_freight else '' end as trainFreight,
         case when p.tran_type_key = '3' then p.actual_freight else '' end as shipFreight,
-        case when m.deliver_type = '1' then  IFNULL(r.amount_ed_payable,0) else 0 end as freight,
+        case when m.deliver_type = '1' then IFNULL(r.amount_ed_payable,0) else 0 end as freight,
         s.amount_ing_receivable as amountIngReceivable,
         s.amount_ed_receivable as amountEdReceivable,
         s.amount_not_receivable as amountNotReceivable,
@@ -416,11 +426,14 @@
         left join warehouse_in_out_info w on w.id = s.warehouse_record_id and w.delete_flag = 0
         left join tran_process_info p on p.id = s.process_id and p.delete_flag = 0
         left join tran_task_info t on t.id = p.info_id and t.delete_flag = 0
-        left join tran_car_info i on i.process_id = p.id and i.delete_flag = 0 and i.tran_car_no = s.tran_car_no and i.car_no = s.car_no
+        left join tran_car_info i on i.process_id = p.id and i.delete_flag = 0 and i.tran_car_no = s.tran_car_no and
+        i.car_no = s.car_no
         left join tran_settlement_report r on r.car_id = i.id and r.delete_flag = 0
-        left join cost_management_info cm on cm.warehouse_name = t.send_warehouse and cm.comp_id = t.comp_id and cm.goods_name = t.goods_name and cm.delete_flag = 0
-        left join contract_management_info m on  m.contract_no = s.contract_no and m.comp_id=s.comp_id and  m.delete_flag = 0
-        left join contract_goods_info g on m.id=g.contract_id and  g.delete_flag = 0
+        left join cost_management_info cm on cm.warehouse_name = t.send_warehouse and cm.comp_id = t.comp_id and
+        cm.goods_name = t.goods_name and cm.delete_flag = 0
+        left join contract_management_info m on m.contract_no = s.contract_no and m.comp_id=s.comp_id and m.delete_flag
+        = 0
+        left join contract_goods_info g on m.id=g.contract_id and g.delete_flag = 0
         WHERE s.delete_flag = '0'
         AND s.comp_id = #{compId}
         <if test="warehouseName != null and warehouseName != ''">
@@ -499,7 +512,7 @@
         AND tti.goods_name = wpsi.goods_name
         AND tti.delete_flag = 0
         AND tci.status_flag = 3
-        )  as saleNum
+        ) as saleNum
         FROM
         warehouse_base_info wbi
         LEFT JOIN warehouse_position_info wpi ON wpi.base_id = wbi.id
@@ -539,40 +552,40 @@
     <select id="getAllWarehouseListByCondition" parameterType="Map"
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseView">
         SELECT
-		wbi.warehouse_name as warehouseName,
+        wbi.warehouse_name as warehouseName,
         wpi.bin_number as binNumber,
         wpi.id as binNumberId,
         wpi.max_storage as capacity,
 
-				(SELECT
-				sum(wioi.net_weight)
-				FROM
-				warehouse_in_out_info wioi
-				WHERE
-				wioi.in_out_flag = '2'
-				AND wioi.delete_flag=0
-				AND wioi.status_flag=3
-				and wioi.position_id=wpi.id
-				and wioi.goods_name=wpsi.goods_name
-				)as inNetWeight,/*入库量*/
+        (SELECT
+        sum(wioi.net_weight)
+        FROM
+        warehouse_in_out_info wioi
+        WHERE
+        wioi.in_out_flag = '2'
+        AND wioi.delete_flag=0
+        AND wioi.status_flag=3
+        and wioi.position_id=wpi.id
+        and wioi.goods_name=wpsi.goods_name
+        )as inNetWeight,/*入库量*/
 
-				(SELECT
-				sum(wioi.net_weight)
-				FROM
-				warehouse_in_out_info wioi
-				WHERE
-				wioi.in_out_flag = '1'
-				AND wioi.delete_flag=0
-				AND wioi.status_flag=3
-				and wioi.position_id=wpi.id
-				and wioi.goods_name=wpsi.goods_name
-				)as outNetWeight,/*出库量*/
+        (SELECT
+        sum(wioi.net_weight)
+        FROM
+        warehouse_in_out_info wioi
+        WHERE
+        wioi.in_out_flag = '1'
+        AND wioi.delete_flag=0
+        AND wioi.status_flag=3
+        and wioi.position_id=wpi.id
+        and wioi.goods_name=wpsi.goods_name
+        )as outNetWeight,/*出库量*/
 
         wpsi.storage as storage,
-		wpsi.goods_name as goodsName
+        wpsi.goods_name as goodsName
 
-		FROM
-		warehouse_base_info wbi
+        FROM
+        warehouse_base_info wbi
         LEFT JOIN warehouse_position_info wpi ON wpi.base_id = wbi.id
         LEFT JOIN warehouse_position_storage_info wpsi ON wpsi.position_id = wpi.id
         WHERE
@@ -586,7 +599,61 @@
         </if>
         GROUP BY
         wpi.id,wpsi.goods_name_key
-		order by wbi.common_warehouse_no,wpi.bin_number
+        order by wbi.common_warehouse_no,wpi.bin_number
+    </select>
+
+
+    <!-- 出入库质检用 -->
+    <select id="getTranCarInfo" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.TranCarInfo">
+        SELECT
+        wbi.id as contractId,
+        wpi.*
+        FROM
+        contract_management_info wbi
+        LEFT JOIN tran_car_info wpi ON wpi.contract_no = wbi.contract_no
+        WHERE
+        wbi.delete_flag ='0'
+        AND
+        wpi.delete_flag ='0'
+        <if test="compId != null and compId != ''">
+            AND wbi.comp_id= #{compId}
+        </if>
+        <if test="contractType != null and contractType != ''">
+            AND wbi.contract_type= #{contractType}
+        </if>
+        <if test="statusFlag != null and statusFlag != ''">
+            AND wbi.status_flag= #{statusFlag}
+        </if>
+        <if test="deliverType != null and deliverType != ''">
+            AND wbi.deliver_type= #{deliverType}
+        </if>
+        <if test="flag != null and flag = '1'">
+            <if test="fleetFlag != null and fleetFlag != ''">
+                AND wpi.fleet_flag= #{fleetFlag}
+            </if>
+            <if test="tranType != null and tranType != ''">
+                AND wpi.tran_type= #{tranType}
+            </if>
+            <if test="threeTranType != null and threeTranType != ''">
+                AND wpi.three_tran_type= #{threeTranType}
+            </if>
+            <if test="submit != null and submit != ''">
+                AND wpi.submit= #{submit}
+            </if>
+        </if>
+        <if test="flag != null and flag = '2'">
+            and(
+            <if test="tranType != null and tranType != ''">
+                wpi.tran_type= #{tranType}
+            </if>
+            <if test="threeTranType != null and threeTranType != ''">
+                or wpi.three_tran_type= #{threeTranType}
+            </if>
+            )
+        </if>
+        ORDER BY
+        wbi.update_date;
     </select>
 
 </mapper>