huangfuli il y a 2 ans
Parent
commit
91f1674a1b
14 fichiers modifiés avec 331 ajouts et 122 suppressions
  1. 127 26
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BiInfoController.java
  2. 8 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ContractManagementInfo.java
  3. 2 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/ContractManagementInfoMapper.java
  4. 3 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehousePositionStorageInfoMapper.java
  5. 20 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java
  6. 7 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/StockSaleReceiptReportServiceImpl.java
  7. 14 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java
  8. 13 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousePositionStorageInfoServiceImpl.java
  9. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousingOrderServiceImpl.java
  10. 23 14
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml
  11. 79 63
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/StockSaleReceiptReportMapper.xml
  12. 17 5
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseInOutInfoMapper.xml
  13. 11 8
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousePositionStorageInfoMapper.xml
  14. 6 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousingOrderMapper.xml

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

@@ -138,10 +138,10 @@ public class BiInfoController {
      */
     @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) {
-            return listRedis;
-        }
+            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<>();
         // 车辆
@@ -165,6 +165,13 @@ public class BiInfoController {
         EntityWrapper<ContractManagementInfo> contractManagementInfoEntityWrapper = new EntityWrapper<ContractManagementInfo>();
         contractManagementInfoEntityWrapper.eq("status_flag", "1");
         contractManagementInfoEntityWrapper.eq("comp_id", compId);
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                contractManagementInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
         if (seachMoth != null) {
             if (!seachMoth.contains("-")) {
                 contractManagementInfoEntityWrapper.and("YEAR(create_date)='" + seachMoth + "'");
@@ -194,8 +201,20 @@ public class BiInfoController {
     private List<BiViewInfo> getcontract(List<BiViewInfo> biViewInfos,String seachMoth) {
         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));
+//        List<ContractManagementInfo> contractManagementInfos = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
+//                .eq("delete_flag", "0").eq("comp_id", companyId).orderBy("create_date", false));
+        EntityWrapper<ContractManagementInfo> contractManagementInfoEntityWrapper = new EntityWrapper<ContractManagementInfo>();
+        contractManagementInfoEntityWrapper.eq("delete_flag", "0");
+        contractManagementInfoEntityWrapper.eq("comp_id", companyId);
+        contractManagementInfoEntityWrapper.orderBy("create_date",false);
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                contractManagementInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
+        List<ContractManagementInfo> contractManagementInfos = contractManagementInfoService.selectList(contractManagementInfoEntityWrapper);
         if (CollectionUtils.isNotEmpty(contractManagementInfos)) {
             for (int i = 0; i < 10; i++) {
                 if (contractManagementInfos.size() <= i) {
@@ -222,8 +241,20 @@ public class BiInfoController {
         BiViewInfo biViewInfoa = new BiViewInfo();
 
         // 查询库存
-        List<WarehouseBaseInfo> warehouseBaseInfoList = warehouseBaseInfoService.selectList(new EntityWrapper<WarehouseBaseInfo>()
-                .eq("delete_flag", "0").eq("comp_id", companyId).eq("warehouse_type", "1"));
+        EntityWrapper<WarehouseBaseInfo> warehouseBaseInfoEntityWrapper = new EntityWrapper<WarehouseBaseInfo>();
+        warehouseBaseInfoEntityWrapper.eq("comp_id", companyId);
+        warehouseBaseInfoEntityWrapper.eq("delete_flag", "0");
+        warehouseBaseInfoEntityWrapper.eq("warehouse_type", "1");
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                warehouseBaseInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
+        List<WarehouseBaseInfo> warehouseBaseInfoList = warehouseBaseInfoService.selectList(warehouseBaseInfoEntityWrapper);
+//        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();
@@ -300,14 +331,31 @@ public class BiInfoController {
                 TranTaskInfo tranTaskInfo = tranTaskInfos.get(i);
                 if (StringUtils.isNotBlank(tranTaskInfo.getReceiveWarehouse())) {
                     if ("1".equals(tranTaskInfo.getTaskTypeKey())) {
-
                         BiViewInfo biViewInfo = new BiViewInfo();
-                        WarehouseBaseInfo warehouseBaseInfo = warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
-                                .eq("comp_id", companyId)
-                                .eq("warehouse_name", tranTaskInfo.getSendWarehouse()));
-                        ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
-                                .eq("contract_no", tranTaskInfo.getContractNo())
-                                .eq("comp_id", companyId));
+                        //仓库
+                        EntityWrapper<WarehouseBaseInfo> warehouseBaseInfoEntityWrapper = new EntityWrapper<WarehouseBaseInfo>();
+                        warehouseBaseInfoEntityWrapper.eq("comp_id", companyId);
+                        warehouseBaseInfoEntityWrapper.eq("warehouse_name", tranTaskInfo.getSendWarehouse());
+                        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+                            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+                            //洮南瀚城合营人员查看
+                            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                                warehouseBaseInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
+                            }
+                        }
+                        WarehouseBaseInfo warehouseBaseInfo = warehouseBaseInfoService.selectOne(warehouseBaseInfoEntityWrapper);
+                        //合同
+                        EntityWrapper<ContractManagementInfo> contractManagementInfoEntityWrapper = new EntityWrapper<ContractManagementInfo>();
+                        contractManagementInfoEntityWrapper.eq("contract_no", tranTaskInfo.getContractNo());
+                        contractManagementInfoEntityWrapper.eq("comp_id", companyId);
+                        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+                            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+                            //洮南瀚城合营人员查看
+                            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                                contractManagementInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
+                            }
+                        }
+                        ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(contractManagementInfoEntityWrapper);
                         if (warehouseBaseInfo != null && contractManagementInfo != null) {
                             biViewInfo.setStartPlace(warehouseBaseInfo.getWarehousePositioning());
                             biViewInfo.setEndPlace(contractManagementInfo.getDeliveryLocation());
@@ -317,12 +365,28 @@ public class BiInfoController {
 
                     } else if ("4".equals(tranTaskInfo.getTaskTypeKey())) {
                         BiViewInfo biViewInfo = new BiViewInfo();
-                        WarehouseBaseInfo warehouseBaseInfo = warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
-                                .eq("comp_id", companyId)
-                                .eq("warehouse_name", tranTaskInfo.getSendWarehouse()));
-                        WarehouseBaseInfo warehouseBaseInfo1 = warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
-                                .eq("comp_id", companyId)
-                                .eq("warehouse_name", tranTaskInfo.getReceiveWarehouse()));
+                        EntityWrapper<WarehouseBaseInfo> warehouseBaseInfoEntityWrapper = new EntityWrapper<WarehouseBaseInfo>();
+                        warehouseBaseInfoEntityWrapper.eq("comp_id", companyId);
+                        warehouseBaseInfoEntityWrapper.eq("warehouse_name", tranTaskInfo.getSendWarehouse());
+                        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+                            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+                            //洮南瀚城合营人员查看
+                            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                                warehouseBaseInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
+                            }
+                        }
+                        WarehouseBaseInfo warehouseBaseInfo = warehouseBaseInfoService.selectOne(warehouseBaseInfoEntityWrapper);
+                        EntityWrapper<WarehouseBaseInfo> warehouseBaseInfoEntityWrapper1 = new EntityWrapper<WarehouseBaseInfo>();
+                        warehouseBaseInfoEntityWrapper1.eq("comp_id", companyId);
+                        warehouseBaseInfoEntityWrapper1.eq("warehouse_name", tranTaskInfo.getReceiveWarehouse());
+                        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+                            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+                            //洮南瀚城合营人员查看
+                            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                                warehouseBaseInfoEntityWrapper1.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
+                            }
+                        }
+                        WarehouseBaseInfo warehouseBaseInfo1 = warehouseBaseInfoService.selectOne(warehouseBaseInfoEntityWrapper1);
                         if (warehouseBaseInfo != null && warehouseBaseInfo1 != null) {
                             biViewInfo.setStartPlace(warehouseBaseInfo.getWarehousePositioning());
                             biViewInfo.setEndPlace(warehouseBaseInfo1.getWarehousePositioning());
@@ -465,11 +529,34 @@ public class BiInfoController {
     private List<BiViewInfo> getTranProess(List<BiViewInfo> biViewInfos,String seachMoth) {
         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> tranCarInfos = new ArrayList<>();
+        //查询登录人合同
+        EntityWrapper<ContractManagementInfo> contractManagementInfoEntityWrapper = new EntityWrapper<ContractManagementInfo>();
+        contractManagementInfoEntityWrapper.eq("delete_flag", "0");
+        contractManagementInfoEntityWrapper.eq("comp_id", companyId);
+        contractManagementInfoEntityWrapper.orderBy("create_date",false);
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                contractManagementInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
+        List<ContractManagementInfo> contractManagementInfos = contractManagementInfoService.selectList(contractManagementInfoEntityWrapper);
+        if (CollectionUtils.isNotEmpty(contractManagementInfos)){
+            for (int i = 0; i < contractManagementInfos.size(); i++) {
+                // 今日装车
+                TranCarInfo tranCarInfo = tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
+                        .eq("status_flag", "3")
+                        .eq("comp_id", companyId)
+                        .eq("contract_no",contractManagementInfos.get(i).getContractNo())
+                        .orderBy("create_date",false));
+                if(tranCarInfo != null){
+                    tranCarInfos.add(tranCarInfo);
+                }
+            }
+        }
+
         List<TranCarInfo> tranCarInfoList = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(tranCarInfos)) {
             for (int i = 0; i < tranCarInfos.size(); i++) {
@@ -557,6 +644,13 @@ public class BiInfoController {
             pageView.put("start", start);
             pageView.put("end", end);
             pageView.put("type", "1");
+            if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+                String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+                //洮南瀚城合营人员查看
+                if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                    pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
+                }
+            }
             List<WarehouseInOutInfo> list = warehouseInOutInfoMapper.brokenLineStatisticalChartByYear(pageView);
             if (list.size() == 0) {
                 Double money = 0D;
@@ -588,6 +682,13 @@ public class BiInfoController {
             pageView.put("start", start);
             pageView.put("end", end);
             pageView.put("type", "2");
+            if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+                String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+                //洮南瀚城合营人员查看
+                if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                    pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
+                }
+            }
             List<WarehouseInOutInfo> list = warehouseInOutInfoMapper.brokenLineStatisticalChartByYear(pageView);
             if (list.size() == 0) {
                 Double money = 0D;

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

@@ -345,6 +345,14 @@ public class ContractManagementInfo extends BaseModel<ContractManagementInfo> {
      * 工作流ID
      */
     private String workflowId;
+    /**
+     * 结算单附件地址
+     */
+    private String statementUrl;
+    /**
+     * 发票附件地址
+     */
+    private String invoiceUrl;
     /**
      * 附件地址
      */

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

@@ -32,8 +32,8 @@ public interface ContractManagementInfoMapper extends BaseMapper<ContractManagem
      * @return
      */
     List<ContractManagementInfo> getListByCondition(Map<String, Object> pageView);
-    Double selectSumSale(String compId);
-    Double selectSumBuy(String compId);
+    Double selectSumSale(Map<String, Object> pageView);
+    Double selectSumBuy(Map<String, Object> pageView);
 
     /**
      * 根据条件查询合同利润详情

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

@@ -3,6 +3,8 @@ package com.yh.saas.plugin.yiliangyiyun.mapper;
 import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionStorageInfo;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 
+import java.util.Map;
+
 /**
  * <p>
  * 记录仓库仓位储存信息 Mapper 接口
@@ -13,6 +15,6 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
  */
 public interface WarehousePositionStorageInfoMapper extends BaseMapper<WarehousePositionStorageInfo> {
 
-    Double selectSumStoreage(String compId);
+    Double selectSumStoreage(Map<String, Object> pageView);
     Double selectSumWare(String compId,String baseId);
 }

+ 20 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java

@@ -1927,11 +1927,29 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
 
     @Override
     public Double selectSumSale(String compId) {
-        return baseMapper.selectSumSale(compId);
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("compId",compId);
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
+        return baseMapper.selectSumSale(pageView);
     }
     @Override
     public Double selectSumBuy(String compId) {
-        return baseMapper.selectSumBuy(compId);
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("compId",compId);
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
+        return baseMapper.selectSumBuy(pageView);
     }
 
     /**

+ 7 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/StockSaleReceiptReportServiceImpl.java

@@ -389,6 +389,13 @@ public class StockSaleReceiptReportServiceImpl extends ServiceImpl<StockSaleRece
         Map<String, Object> pageView = new HashMap<>();
         pageView.put("seachMoth",seachMoth);
         pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
         String  amonutIn = baseMapper.getAmonutIn(pageView);
         String  amonutout = baseMapper.getAmonutOut(pageView);
         String  amonutMao = baseMapper.getAmonutMao(pageView);

+ 14 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java

@@ -2750,6 +2750,13 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
         pageView.put("compId", compId);
         //  仓库ID
         pageView.put("type", type);
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
         return baseMapper.selectCountCompany(pageView);
     }
 
@@ -2757,6 +2764,13 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
     public Integer selectCountCompanyZT(String compId) {
         Map<String, Object> pageView = new HashMap<>();
         pageView.put("compId", compId);
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
         return baseMapper.selectCountCompanyZT(pageView);
     }
     /**

+ 13 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousePositionStorageInfoServiceImpl.java

@@ -1,6 +1,7 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionStorageInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.WarehousePositionStorageInfoMapper;
@@ -10,7 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -37,6 +40,15 @@ public class WarehousePositionStorageInfoServiceImpl extends ServiceImpl<Warehou
 
     @Override
     public Double selectSumStoreage(String compId) {
-       return baseMapper.selectSumStoreage(compId);
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("compId",compId);
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
+       return baseMapper.selectSumStoreage(pageView);
     }
 }

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousingOrderServiceImpl.java

@@ -213,6 +213,7 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
         pageView.put("endDate", warehousingOrder.getEndDate());
         pageView.put("compId", warehousingOrder.getCompId());
         pageView.put("baseId", warehousingOrder.getBaseId());
+        pageView.put("goodsName", warehousingOrder.getGoodsName());
         pageView.put("businessKeys", businessKeys);
         pageView.put("flag", warehousingOrder.getFlag());
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

+ 23 - 14
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml

@@ -83,6 +83,8 @@
         m.signing_date as signingDate,
         p.mildew_grain as mildewGrain,
         p.goods_name as goodsNames,
+        m.statement_url as statementUrl,
+        m.invoice_url as invoiceUrl,
         m.address_url as addressUrl,
         m.point_price as pointPrice,
         m.approve_status as approveStatus,
@@ -221,6 +223,9 @@
         AND a.comp_id = #{compId}
         AND a.signing_date >= '2022-10-01'
 		and a.seller != a.buyer
+        <if test="jointVentureParties != null">
+            AND a.joint_venture_parties = #{jointVentureParties}
+        </if>
         GROUP BY
         a.contract_no
         ) b
@@ -251,6 +256,9 @@
         AND a.comp_id = #{compId}
         AND a.signing_date >= '2022-10-01'
 		and a.seller != a.buyer
+        <if test="jointVentureParties != null">
+            AND a.joint_venture_parties = #{jointVentureParties}
+        </if>
         GROUP BY
         a.contract_no
         ) b
@@ -578,21 +586,21 @@
         m.approve_status as approveStatus,
         m.agreement_type as agreementType
         FROM contract_management_info m
---         LEFT JOIN expense_info exi ON exi.contract_id = m.id
---         AND exi.expenses_type = '1'
---         AND exi.expenses_purpose = '1'
---         AND exi.delete_flag = '0'
+        -- LEFT JOIN expense_info exi ON exi.contract_id = m.id
+        -- AND exi.expenses_type = '1'
+        -- AND exi.expenses_purpose = '1'
+        -- AND exi.delete_flag = '0'
         LEFT JOIN expense_info exi2 ON exi2.contract_id = m.id
         AND exi2.expenses_type = '2'
         AND exi2.expenses_purpose = '1'
         AND exi2.delete_flag = '0'
---         LEFT JOIN stock_sale_receipt_report ssrr ON ssrr.contract_no = m.contract_no
---         and ssrr.delete_flag = 0
---         LEFT JOIN warehouse_in_out_info wioi ON wioi.id = ssrr.warehouse_record_id
---         AND wioi.delete_flag = '0'
---         LEFT JOIN in_out_warehouse_task iowt ON iowt.in_out_task_no=wioi.in_out_task_no and iowt.delete_flag='0'
---         LEFT JOIN source_relation_info sri on sri.task_id=iowt.id and sri.delete_flag='0'
---         LEFT JOIN warehousing_order wo on wo.id=sri.source_id and wo.delete_flag='0'
+        -- LEFT JOIN stock_sale_receipt_report ssrr ON ssrr.contract_no = m.contract_no
+        -- and ssrr.delete_flag = 0
+        -- LEFT JOIN warehouse_in_out_info wioi ON wioi.id = ssrr.warehouse_record_id
+        -- AND wioi.delete_flag = '0'
+        -- LEFT JOIN in_out_warehouse_task iowt ON iowt.in_out_task_no=wioi.in_out_task_no and iowt.delete_flag='0'
+        -- LEFT JOIN source_relation_info sri on sri.task_id=iowt.id and sri.delete_flag='0'
+        -- LEFT JOIN warehousing_order wo on wo.id=sri.source_id and wo.delete_flag='0'
         WHERE
         m.comp_id = #{compId}
         AND m.delete_flag = '0'
@@ -664,12 +672,13 @@
         m.approve_status as approveStatus,
         m.agreement_type as agreementType
         FROM contract_management_info m
-        LEFT JOIN warehousing_order wo on wo.contract_no = m.contract_no and wo.comp_id=m.comp_id and wo.delete_flag = '0'
-        LEFT JOIN expense_info exi ON exi.contract_id =  m.id
+        LEFT JOIN warehousing_order wo on wo.contract_no = m.contract_no and wo.comp_id=m.comp_id and wo.delete_flag =
+        '0'
+        LEFT JOIN expense_info exi ON exi.contract_id = m.id
         AND exi.expenses_type = '1'
         AND exi.expenses_purpose = '1'
         AND exi.delete_flag = '0'
-        LEFT JOIN expense_info exi2 ON exi2.contract_id =  m.id
+        LEFT JOIN expense_info exi2 ON exi2.contract_id = m.id
         AND exi2.expenses_type = '2'
         AND exi2.expenses_purpose = '1'
         AND exi2.delete_flag = '0'

+ 79 - 63
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/StockSaleReceiptReportMapper.xml

@@ -105,78 +105,94 @@
 
     <select id="getAmonutIn" parameterType="Map"
             resultType="java.lang.String">
-       SELECT
-	sum(amount_ing_receivable) as amount
-FROM
-	stock_sale_receipt_report s
-WHERE
-	s.delete_flag = 0
-	AND s.comp_id = #{compId}
-	AND s.delivery_date like CONCAT('%',#{seachMoth},'%')
+        SELECT
+        sum(amount_ing_receivable) as amount
+        FROM
+        stock_sale_receipt_report s
+        LEFT JOIN warehouse_in_out_info wioi ON wioi.id = s.warehouse_record_id and wioi.delete_flag = 0
+        LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id and wbi.delete_flag = 0
+        WHERE
+        s.delete_flag = 0
+        AND s.comp_id = #{compId}
+        <if test="jointVentureParties != null">
+            AND wbi.joint_venture_parties = #{jointVentureParties}
+        </if>
+        AND s.delivery_date like CONCAT('%',#{seachMoth},'%')
     </select>
 
     <select id="getAmonutOut" parameterType="Map"
             resultType="java.lang.String">
-       SELECT
-	IFNULL( sum( s.amount_ing_payable ), 0 ) + IFNULL((
-		SELECT
-			sum( p.amount_ing_payable )
-		FROM
-			payment_management p
-		WHERE
-			p.delete_flag = 0
-			AND p.comp_id = #{compId}
-			AND p.create_date like CONCAT('%',#{seachMoth},'%')
-			),
-		0
-		) + IFNULL((
-		SELECT
-			sum( amount )
-		FROM
-			inventory_cost_info i
-		WHERE
-			i.delete_flag = 0
-			AND i.comp_id = #{compId}
-			AND i.create_date like CONCAT('%',#{seachMoth},'%')
-		),
-		0
-	)
-	+ IFNULL((
-		SELECT
-			sum( sale_cost )
-		FROM
-			stock_sale_receipt_report s
-		WHERE
-			s.delete_flag = 0
-			AND s.comp_id = #{compId}
-			AND s.delivery_date like CONCAT('%',#{seachMoth},'%')
-		),
-		0
-	)  as aa
-FROM
-	stock_purchase_receipt_report s
-WHERE
-	s.delete_flag = 0
-	AND s.comp_id = #{compId}
-	AND s.warehousing_date like CONCAT('%',#{seachMoth},'%')
+        SELECT
+        IFNULL( sum( s.amount_ing_payable ), 0 ) + IFNULL((
+        SELECT
+        sum( p.amount_ing_payable )
+        FROM
+        payment_management p
+        WHERE
+        p.delete_flag = 0
+        AND p.comp_id = #{compId}
+        AND p.create_date like CONCAT('%',#{seachMoth},'%')
+        ),
+        0
+        ) + IFNULL((
+        SELECT
+        sum( amount )
+        FROM
+        inventory_cost_info i
+        WHERE
+        i.delete_flag = 0
+        AND i.comp_id = #{compId}
+        AND i.create_date like CONCAT('%',#{seachMoth},'%')
+        ),
+        0
+        )
+        + IFNULL((
+        SELECT
+        sum( sale_cost )
+        FROM
+        stock_sale_receipt_report s
+        WHERE
+        s.delete_flag = 0
+        AND s.comp_id = #{compId}
+        AND s.delivery_date like CONCAT('%',#{seachMoth},'%')
+        ),
+        0
+        ) as aa
+        FROM
+        stock_purchase_receipt_report s
+        LEFT JOIN warehouse_in_out_info wioi ON wioi.id = s.warehouse_record_id and wioi.delete_flag = 0
+        LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id and wbi.delete_flag = 0
+        WHERE
+        s.delete_flag = 0
+        AND s.comp_id = #{compId}
+        <if test="jointVentureParties != null">
+            AND wbi.joint_venture_parties = #{jointVentureParties}
+        </if>
+        AND s.warehousing_date like CONCAT('%',#{seachMoth},'%')
     </select>
 
 
     <select id="getAmonutMao" parameterType="Map"
             resultType="java.lang.String">
-      SELECT
-	sum(
-	a.amount_ing_receivable - IFNULL( IFNULL( a.cost, w.cost ), 0 )* a.net_weight - IFNULL( a.sale_cost, 0 )) AS lirun
-FROM
-	stock_sale_receipt_report a
-	LEFT JOIN warehouse_cost w ON w.comp_id = a.comp_id
-	AND w.delete_flag = 0
-	AND w.warehouse_name = a.warehouse_name
-	AND w.calculate_date = DATE_SUB( a.delivery_date, INTERVAL 1 DAY )
-WHERE
-	1 = 1
-	AND a.delete_flag = 0
-		AND a.delivery_date like CONCAT('%',#{seachMoth},'%')
+        SELECT
+        sum(
+        a.amount_ing_receivable - IFNULL( IFNULL( a.cost, w.cost ), 0 )* a.net_weight - IFNULL( a.sale_cost, 0 )) AS
+        lirun
+        FROM
+        stock_sale_receipt_report a
+        LEFT JOIN warehouse_cost w ON w.comp_id = a.comp_id
+        AND w.delete_flag = 0
+        AND w.warehouse_name = a.warehouse_name
+        AND w.calculate_date = DATE_SUB( a.delivery_date, INTERVAL 1 DAY )
+        LEFT JOIN warehouse_in_out_info wioi ON wioi.id = a.warehouse_record_id and wioi.delete_flag = 0
+        LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id and wbi.delete_flag = 0
+        WHERE
+        1 = 1
+        AND a.delete_flag = 0
+        <if test="jointVentureParties != null">
+            AND wbi.joint_venture_parties = #{jointVentureParties}
+        </if>
+        AND a.delivery_date like CONCAT('%',#{seachMoth},'%')
     </select>
 
 </mapper>

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

@@ -314,8 +314,11 @@
     <select id="selectCountCompany" parameterType="Map" resultType="java.lang.Integer">
         select count(1)
         from warehouse_in_out_info w
-        left join warehouse_base_info wbi on wbi.id = w.base_id
+        left join warehouse_base_info wbi on wbi.id = w.base_id AND wbi.delete_flag = 0
         where wbi.comp_id = #{compId}
+        <if test="jointVentureParties != null">
+            AND wbi.joint_venture_parties = #{jointVentureParties}
+        </if>
         and w.delete_flag = '0'
         and w.status_flag = '3'
         and w.in_out_type like "%${type}%"
@@ -334,6 +337,9 @@
         WHERE
             a.delete_flag = 0
             AND b.comp_id = #{compId}
+            <if test="jointVentureParties != null">
+                AND b.joint_venture_parties = #{jointVentureParties}
+            </if>
             AND a.in_out_type = '移库出库'
 	        and a.create_date > '2022-10-10'
             AND a.car_id is not null
@@ -342,10 +348,16 @@
     <!-- 关键字查询 -->
     <select id="brokenLineStatisticalChartByYear" parameterType="Map"
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo">
-        select net_weight as netWeight FROM warehouse_in_out_info
+        select
+        w.net_weight as netWeight
+        FROM warehouse_in_out_info w
+        left join warehouse_base_info wbi on wbi.id = w.base_id AND wbi.delete_flag = 0
        where
-        in_out_flag = ${type} AND  (in_out_date BETWEEN #{start} ANd #{end})
-        and delete_flag = "0"
-        and status_flag = 3
+        w.in_out_flag = ${type} AND  (w.in_out_date BETWEEN #{start} ANd #{end})
+        and w.delete_flag = "0"
+        and w.status_flag = 3
+        <if test="jointVentureParties != null">
+            AND wbi.joint_venture_parties = #{jointVentureParties}
+        </if>
     </select>
 </mapper>

+ 11 - 8
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousePositionStorageInfoMapper.xml

@@ -2,19 +2,22 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.WarehousePositionStorageInfoMapper">
 
-    <select id="selectSumStoreage" parameterType="Map"  resultType="java.lang.Double">
+    <select id="selectSumStoreage" parameterType="Map" resultType="java.lang.Double">
         SELECT
-            sum(a.`storage`)
+        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
+        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.comp_id = #{compId}
+        a.delete_flag = 0
+        and wbi.comp_id = #{compId}
+        <if test="jointVentureParties != null">
+            AND wbi.joint_venture_parties = #{jointVentureParties}
+        </if>
     </select>
 
-    <select id="selectSumWare" parameterType="Map"  resultType="java.lang.Double">
+    <select id="selectSumWare" parameterType="Map" resultType="java.lang.Double">
         SELECT
             sum(a.`storage`)
         FROM

+ 6 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousingOrderMapper.xml

@@ -35,6 +35,9 @@
         <if test="batchId != null and batchId != ''">
             AND batch_id= #{batchId}
         </if>
+        <if test="goodsName != null and goodsName != ''">
+            AND goods_name= #{goodsName}
+        </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(goods_source) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
@@ -128,6 +131,9 @@
         <if test="baseId != null and baseId != ''">
             AND w.base_id= #{baseId}
         </if>
+        <if test="goodsName != null and goodsName != ''">
+            AND goods_name= #{goodsName}
+        </if>
         <if test="businessKeys != null and businessKeys.size > 0">
             and(
             <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">