ソースを参照

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun

# Conflicts:
#	winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CommonUserController.java
ccj 2 年 前
コミット
b471af45b2
19 ファイル変更459 行追加149 行削除
  1. 127 26
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BiInfoController.java
  2. 10 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CommonUserController.java
  3. 8 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ContractManagementInfo.java
  4. 2 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/ContractManagementInfoMapper.java
  5. 3 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehousePositionStorageInfoMapper.java
  6. 20 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java
  7. 6 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PaymentManagementServiceImpl.java
  8. 7 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/StockSaleReceiptReportServiceImpl.java
  9. 34 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranProcessInfoServiceImpl.java
  10. 29 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranSettlementReportServiceImpl.java
  11. 62 18
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java
  12. 13 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousePositionStorageInfoServiceImpl.java
  13. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousingOrderServiceImpl.java
  14. 23 14
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml
  15. 79 63
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/StockSaleReceiptReportMapper.xml
  16. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml
  17. 17 5
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseInOutInfoMapper.xml
  18. 11 8
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousePositionStorageInfoMapper.xml
  19. 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;

+ 10 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CommonUserController.java

@@ -256,7 +256,9 @@ public class CommonUserController {
                                 }
                                 newWorkflowStep.setCommonStaffs(commonStaffs);
                             }
-                            newWorkflowSteps.add(newWorkflowStep);
+                            if(!"_PLACEHOLDER_".equals(newWorkflowStep.getDesc())){
+                                newWorkflowSteps.add(newWorkflowStep);
+                            }
                         }
                         if (!StringUtils.isEmpty(workflowSteps.get(i).getBranchExpression())
                                 &&workflowSteps.get(i).getBranchExpression().contains(branch)
@@ -302,13 +304,15 @@ public class CommonUserController {
                                 }
                                 newWorkflowStep.setCommonStaffs(commonStaffs);
                             }
-                            newWorkflowSteps.add(newWorkflowStep);
+                            if(!"_PLACEHOLDER_".equals(newWorkflowStep.getDesc())){
+                                newWorkflowSteps.add(newWorkflowStep);
+                            }
                         }
-
                         if(workflowSteps.get(i).getBranchNodeLocation()!= null
                                 &&"END".equals(workflowSteps.get(i).getBranchNodeLocation().name())
                                 && !StringUtils.isEmpty(workflowSteps.get(i).getBranchExpression())
                                 &&workflowSteps.get(i).getBranchExpression().contains("!=")){
+
                             biaoshi = 0;
                         }
                     }
@@ -341,7 +345,9 @@ public class CommonUserController {
                         }
                         newWorkflowStep.setCommonStaffs(commonStaffs);
                     }
-                    newWorkflowSteps.add(newWorkflowStep);
+                    if(!"_PLACEHOLDER_".equals(newWorkflowStep.getDesc())){
+                        newWorkflowSteps.add(newWorkflowStep);
+                    }
                 }
 
             }

+ 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);
     }
 
     /**

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

@@ -343,6 +343,9 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
             warehouseInOutInfo.setGrossWeight(paymentManagement1.getGrossWeight() / 1000);
             warehouseInOutInfo.setTare(paymentManagement1.getTare() / 1000);
             warehouseInOutInfo.setNetWeight(Double.valueOf(paymentManagement.getNetWeight() / 1000));
+            if (paymentManagement.getWeightDeduction()!=null) {
+                warehouseInOutInfo.setDeductionWeight(paymentManagement.getWeightDeduction() / 1000);
+            }
             warehouseInOutInfo.setContractNo(paymentManagement1.getContractNo());
             warehouseInOutInfo.setInOutType("收购入库");
             warehouseInOutInfo.setInOutFlag("2");
@@ -524,6 +527,9 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
                 warehouseInOutInfo1.setPureWeight(paymentManagement.getPureWeight() / 1000);
             }
             warehouseInOutInfo1.setNetWeight(Double.valueOf(paymentManagement.getNetWeight() / 1000));
+            if (paymentManagement.getWeightDeduction()!=null) {
+                warehouseInOutInfo1.setDeductionWeight(paymentManagement.getWeightDeduction() / 1000);
+            }
             warehouseInOutInfo1.setStatusFlag("3");
             warehouseInOutInfo1.setDeductionWeight(paymentManagement.getWeightDeduction());
             warehouseInOutInfoService.insert(warehouseInOutInfo1);

+ 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);

+ 34 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranProcessInfoServiceImpl.java

@@ -308,6 +308,22 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                                 tranSettlementReport.setTranType("汽运");
                                 tranSettlementReport.setTranTypeKey("1");
                                 tranSettlementReport.setContractNo(tranTaskInfo.getContractNo());
+                                ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                                        .eq("contract_no", tranSettlementReport.getContractNo())
+                                        .eq("delete_flag", "0"));
+                                if (contractManagementInfo!=null){
+                                    tranSettlementReport.setGrainPrice(contractManagementInfo.getUnitContractPrice());
+                                }
+                                else {
+                                    if ("移库".equals(tranTaskInfo.getTaskType())) {
+                                        ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                                                .eq("contract_no", tranTaskInfo.getSendWarehouse())
+                                                .eq("comp_id", tranTaskInfo.getCompId()));
+                                        if (contractManagementInfo1 != null) {
+                                            tranSettlementReport.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
+                                        }
+                                    }
+                                }
                                 tranSettlementReport.setProcessNo(tranProcessInfo.getProcessNo());
                                 tranSettlementReport.setName(tranCarInfo.getDriver());
                                 tranSettlementReport.setPhone(tranCarInfo.getDriverPhone());
@@ -468,20 +484,34 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                                         tranSettlementReport1.setSettlementWeight(tranCarInfo.getLoadNetWeight() > tranCarInfo.getUnloadNetWeight() ? tranCarInfo.getUnloadNetWeight() : tranCarInfo.getLoadNetWeight());
                                         tranSettlementReport1.setTransportDamage(tranSettlementReport1.getSettlementWeight()*0.001);
                                     }
-                                    //损耗大于结算重量的1‰时=损耗-结算重量x1‰
-                                    if (tranSettlementReport1.getLossWeight()>tranSettlementReport1.getSettlementWeight()*0.001){
+                                    if(tranSettlementReport1.getLossWeight()<0){
+                                        tranSettlementReport1.setActualLoss(0d);
+                                        tranSettlementReport1.setDeductionAmount("0");
+                                    }
+                                    //损耗大于结算重量的1‰时
+                                    else if (tranSettlementReport1.getLossWeight()>tranSettlementReport1.getSettlementWeight()*0.001){
+                                        //货损=损耗-结算重量x1‰
                                         tranSettlementReport1.setCargoDamage(tranSettlementReport1.getLossWeight()-tranSettlementReport1.getSettlementWeight()*0.001);
+                                        //实际损耗默认为结算重量的1‰
+                                        tranSettlementReport1.setActualLoss(tranSettlementReport1.getSettlementWeight()*0.001);
+                                        if (tranSettlementReport1.getGrainPrice()!=null){
+                                            tranSettlementReport1.setDeductionAmount(String.valueOf(tranSettlementReport1.getCargoDamage()*tranSettlementReport1.getGrainPrice()));
+                                        }
+                                    }
+                                    //0<损耗<结算重量的1‰时
+                                    else if(tranSettlementReport1.getLossWeight()>0&&tranSettlementReport1.getLossWeight()<tranSettlementReport1.getSettlementWeight()*0.001){
+                                        //实际损耗默认为损耗
+                                        tranSettlementReport1.setActualLoss(Double.valueOf(String.valueOf(tranSettlementReport1.getLossWeight())));
+                                        tranSettlementReport1.setDeductionAmount("0");
                                     }
                                     //扣款
                                     if (tranSettlementReport1.getLossWeight() <= (tranCarInfo.getLoadNetWeight() / 1000)) {
-                                        tranSettlementReport1.setDeductionAmount("0");
                                         //应付=单价x结算重量-扣款
                                         tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice() * tranSettlementReport1.getSettlementWeight());
                                         //实付金额
                                         tranSettlementReport1.setAmountActuallyPaid(Double.valueOf(tranSettlementReport1.getTransportPrice()) * tranSettlementReport1.getSettlementWeight()
                                                 - tranSettlementReport1.getServiceCharge());
                                     } else {
-                                        tranSettlementReport1.setDeductionAmount(String.format("%.2f", (Float.valueOf(tranCarInfo.getLoadNetWeight() - tranCarInfo.getUnloadNetWeight()) - (tranCarInfo.getLoadNetWeight() / 1000)) * Float.valueOf(tranCarInfo.getTranPrice())));
                                         //应付=单价x结算重量-扣款
                                         tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice() * tranSettlementReport1.getSettlementWeight() - Float.valueOf(tranSettlementReport1.getDeductionAmount()));
                                         //实付金额

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

@@ -276,6 +276,7 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
             }
             //1 修改扣款
             else if (tranSettlementReport.getFlag() == 1) {
+                tranSettlementReport1.setManualIdentification("1");
                 tranSettlementReport1.setDeductionAmount(tranSettlementReport.getDeductionAmount());
 //                tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getSettlementWeight()*tranSettlementReport1.getTransportPrice()-Float.valueOf(tranSettlementReport1.getDeductionAmount()));
 //                tranSettlementReport1.setAmountNotPayable(tranSettlementReport1.getAmountIngPayable()-tranSettlementReport1.getAmountEdPayable());
@@ -350,6 +351,34 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
                 //更改汽运结算信息
                 this.updateById(tranSettlementReport1);
             }
+            //7 修改粮食单价
+            else if (tranSettlementReport.getFlag() == 7) {
+                List<TranSettlementReport> tranSettlementReportList=this.selectList(new EntityWrapper<TranSettlementReport>()
+                .eq("contract_no",tranSettlementReport1.getContractNo())
+                .eq("manual_identification","0"));
+                if (!CollectionUtils.isEmpty(tranSettlementReportList)){
+                    for (TranSettlementReport tranSettlementReport2:tranSettlementReportList){
+                        tranSettlementReport2.setGrainPrice(tranSettlementReport.getGrainPrice());
+                        if (tranSettlementReport2.getLossWeight()>tranSettlementReport2.getSettlementWeight()*0.001){
+                            tranSettlementReport2.setDeductionAmount(String.valueOf(tranSettlementReport2.getCargoDamage()*tranSettlementReport2.getGrainPrice()));
+                            //实付金额
+                            tranSettlementReport2.setAmountActuallyPaid(Double.valueOf(tranSettlementReport2.getTransportPrice()) * tranSettlementReport2.getSettlementWeight()
+                                    - Double.valueOf(tranSettlementReport2.getDeductionAmount()) - tranSettlementReport2.getServiceCharge());
+                            //税点
+                            tranSettlementReport2.setTaxPoint(tranSettlementReport2.getAmountActuallyPaid()/0.946*0.054);
+                            //合计应付
+                            tranSettlementReport2.setTotalPayable(tranSettlementReport2.getAmountActuallyPaid()+tranSettlementReport2.getTaxPoint());
+                            //未付金额
+                            Float f = 0.0f;
+                            f = tranSettlementReport2.getTotalPayable().floatValue() - tranSettlementReport2.getAmountEdPayable();
+                            DecimalFormat df1 = new DecimalFormat("#.00");
+                            tranSettlementReport2.setAmountNotPayable(Float.parseFloat(df1.format(f)));
+                        }
+                        //更改汽运结算信息
+                        this.updateById(tranSettlementReport2);
+                    }
+                }
+            }
         }
         return "OK";
     }

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

@@ -969,21 +969,34 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
                                     tranSettlementReport.setTransportDamage(tranSettlementReport.getSettlementWeight()*0.001);
                                 }
-                                //损耗大于结算重量的1‰时=损耗-结算重量x1‰
-                                if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
+                                if(tranSettlementReport.getLossWeight()<0){
+                                    tranSettlementReport.setActualLoss(0d);
+                                    tranSettlementReport.setDeductionAmount("0");
+                                }
+                                //损耗大于结算重量的1‰时
+                                else if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
+                                    //货损=损耗-结算重量x1‰
                                     tranSettlementReport.setCargoDamage(tranSettlementReport.getLossWeight()-tranSettlementReport.getSettlementWeight()*0.001);
+                                    //实际损耗默认为结算重量的1‰
+                                    tranSettlementReport.setActualLoss(tranSettlementReport.getSettlementWeight()*0.001);
+                                    if (tranSettlementReport.getGrainPrice()!=null){
+                                        tranSettlementReport.setDeductionAmount(String.valueOf(tranSettlementReport.getCargoDamage()*tranSettlementReport.getGrainPrice()));
+                                    }
+                                }
+                                //0<损耗<=结算重量的1‰时
+                                else if(tranSettlementReport.getLossWeight()>0&&tranSettlementReport.getLossWeight()<=tranSettlementReport.getSettlementWeight()*0.001){
+                                    //实际损耗默认为损耗
+                                    tranSettlementReport.setActualLoss(Double.valueOf(String.valueOf(tranSettlementReport.getLossWeight())));
+                                    tranSettlementReport.setDeductionAmount("0");
                                 }
                                 if (tranSettlementReport.getTransportPrice()!=null) {
-                                    //扣款
                                     if (tranSettlementReport.getLossWeight() <= (tranSettlementReport.getLoadingWeight() / 1000)) {
-                                        tranSettlementReport.setDeductionAmount("0");
-                                        //应付=单价x结算重量-扣款
+                                        //应付=单价x结算重量
                                         tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
                                         //实付金额
                                         tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
                                                 - tranSettlementReport.getServiceCharge());
                                     } else {
-                                        tranSettlementReport.setDeductionAmount(String.format("%.2f", (Float.valueOf(tranSettlementReport.getLoadingWeight() - tranSettlementReport.getUnloadingWeight()) - (tranSettlementReport.getLoadingWeight() / 1000)) * Float.valueOf(tranSettlementReport.getTransportPrice())));
                                         //应付=单价x结算重量-扣款
                                         tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight() - Float.valueOf(tranSettlementReport.getDeductionAmount()));
                                         //实付金额
@@ -1499,6 +1512,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
                                     tranSettlementReport.setId(IdGenerator.generateUUID());
                                     if ("汽运".equals(warehouseInOutInfo.getOutType())) {
+                                        tranSettlementReport.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
                                         tranSettlementReport.setTranType("汽运");
                                         tranSettlementReport.setTranTypeKey("1");
                                         tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
@@ -2129,6 +2143,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         if (contractManagementInfo1 == null) {
                             throw new YException(YExceptionEnum.CONTRACT_NO_NOT_EXSITS_ERROR);
                         }
+                        warehouseInOutInfo.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
                         Wrapper wrapper = new EntityWrapper<TranCarInfo>()
                                 .eq("contract_no", warehouseInOutInfo.getContractNo())
                                 .eq("car_no", warehouseInOutInfo.getCarNo())
@@ -2234,6 +2249,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         tranSettlementReport.setId(IdGenerator.generateUUID());
                         tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
                         if ("汽运".equals(warehouseInOutInfo.getOutType())) {
+                            tranSettlementReport.setGrainPrice(warehouseInOutInfo.getGrainPrice());
                             tranSettlementReport.setTranType("汽运");
                             tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                             tranSettlementReport.setServiceCharge(20d);
@@ -2734,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);
     }
 
@@ -2741,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);
     }
     /**
@@ -3778,28 +3808,39 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                         tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
                                         tranSettlementReport.setTransportDamage(tranSettlementReport.getSettlementWeight()*0.001);
                                     }
-                                    //损耗大于结算重量的1‰时=损耗-结算重量x1‰
-                                    if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
+                                    if(tranSettlementReport.getLossWeight()<0){
+                                        tranSettlementReport.setActualLoss(0d);
+                                        tranSettlementReport.setDeductionAmount("0");
+                                    }
+                                    //损耗大于结算重量的1‰时
+                                    else if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
+                                        //货损=损耗-结算重量x1‰
                                         tranSettlementReport.setCargoDamage(tranSettlementReport.getLossWeight()-tranSettlementReport.getSettlementWeight()*0.001);
+                                        //实际损耗默认为结算重量的1‰
+                                        tranSettlementReport.setActualLoss(tranSettlementReport.getSettlementWeight()*0.001);
+                                        if (tranSettlementReport.getGrainPrice()!=null){
+                                            tranSettlementReport.setDeductionAmount(String.valueOf(tranSettlementReport.getCargoDamage()*tranSettlementReport.getGrainPrice()));
+                                        }
+                                    }
+                                    //0<损耗<=结算重量的1‰时
+                                    else if(tranSettlementReport.getLossWeight()>0&&tranSettlementReport.getLossWeight()<=tranSettlementReport.getSettlementWeight()*0.001){
+                                        //实际损耗默认为损耗
+                                        tranSettlementReport.setActualLoss(Double.valueOf(String.valueOf(tranSettlementReport.getLossWeight())));
+                                        tranSettlementReport.setDeductionAmount("0");
                                     }
                                     if (tranSettlementReport.getTransportPrice() != null) {
-                                        //扣款
                                         if (tranSettlementReport.getLossWeight() <= (tranSettlementReport.getLoadingWeight() / 1000)) {
-                                            tranSettlementReport.setDeductionAmount("0");
-                                            //应付=单价x结算重量-扣款
+                                            //应付=单价x结算重量
                                             tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
+                                            //实付金额
+                                            tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
+                                                    - tranSettlementReport.getServiceCharge());
                                         } else {
-                                            tranSettlementReport.setDeductionAmount(String.format("%.2f", (Float.valueOf(tranSettlementReport.getLoadingWeight() - tranSettlementReport.getUnloadingWeight()) - (tranSettlementReport.getLoadingWeight() / 1000)) * Float.valueOf(tranSettlementReport.getTransportPrice())));
                                             //应付=单价x结算重量-扣款
                                             tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight() - Float.valueOf(tranSettlementReport.getDeductionAmount()));
-                                        }
-                                        //实付金额
-                                        if(tranSettlementReport.getDeductionAmount() != null){
+                                            //实付金额
                                             tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
                                                     - Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
-                                        }else{
-                                            tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
-                                                    - tranSettlementReport.getServiceCharge());
                                         }
                                         //税点
                                         tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
@@ -4424,6 +4465,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
                                     tranSettlementReport.setId(IdGenerator.generateUUID());
                                     if ("汽运".equals(warehouseInOutInfo.getOutType())) {
+                                        tranSettlementReport.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
                                         tranSettlementReport.setTranType("汽运");
                                         tranSettlementReport.setTranTypeKey("1");
                                         tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
@@ -5115,6 +5157,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         if (contractManagementInfo1 == null) {
                             throw new YException(YExceptionEnum.CONTRACT_NO_NOT_EXSITS_ERROR);
                         }
+                        warehouseInOutInfo.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
                         Wrapper wrapper = new EntityWrapper<TranCarInfo>()
                                 .eq("contract_no", warehouseInOutInfo.getContractNo())
                                 .eq("car_no", warehouseInOutInfo.getCarNo())
@@ -5261,6 +5304,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
                         tranSettlementReport.setId(IdGenerator.generateUUID());
                         if ("汽运".equals(warehouseInOutInfo.getOutType())) {
+                            tranSettlementReport.setGrainPrice(warehouseInOutInfo.getGrainPrice());
                             tranSettlementReport.setTranType("汽运");
                             tranSettlementReport.setTranTypeKey("1");
                             tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));

+ 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>

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

@@ -332,7 +332,7 @@
         w.warehouse_name as warehouseName,
         w.bin_number as binNumber,
         w.create_date as createDate,
-        IFNULL(m.unit_contract_price,IFNULL(w.cost,0))+IFNULL(t.tran_price,0) as costPrice,
+        IFNULL(m.unit_contract_price,IFNULL(w.cost,0)) as costPrice,
 --         w.warehouse_name as contractNo,
         case when m.contract_type = '1' then m.contract_no else '' end as contractNo,
         IFNULL(m.seller,'') as customerName,

+ 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">