ccj 2 vuotta sitten
vanhempi
commit
ba7d554ff0

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/AppVersionController.java

@@ -46,7 +46,7 @@ public class AppVersionController {
      */
     @GetMapping("/test")
     public void test() {
-        geTuiUtils.pushByCid("工作事项提醒","您有新的易粮易运流程,请及时审批","10272f536dd9405da38c28c4e6c34457");
+        geTuiUtils.pushByCid("工作事项提醒","您有新的易粮易运流程,请及时审批","26cfe455616c49b1871f14a3a2483762");
 //       List<CommonUser> list =   commonUserService.selectList(new EntityWrapper<>());
 //       for(CommonUser commonUser:list){
 //           commonUser.setPassword(Md5Crypt.md5Crypt("123456".getBytes(), "$1$" + commonUser.getPhone().substring(0, 7)));

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

@@ -98,7 +98,7 @@ public class BiInfoController {
      */
     @GetMapping("/selectBiInfo")
     public List<BiViewInfo> selectBiInfo(String compId, String seachMoth) {
-        List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO, BiViewInfo.class);
+        List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO+compId+seachMoth, BiViewInfo.class);
         if (listRedis != null && listRedis.size() > 0) {
             return listRedis;
         }
@@ -130,7 +130,7 @@ public class BiInfoController {
         // 收入支出毛利润
         getMoney(biViewInfos, seachMoth);
 
-        cacheComponent.putRaw(Const.ADMIN_BI_INFO, JSONObject.toJSONString(biViewInfos), 60 * 60);
+        cacheComponent.putRaw(Const.ADMIN_BI_INFO+compId+seachMoth, JSONObject.toJSONString(biViewInfos), 60 * 60);
         return biViewInfos;
     }
 
@@ -141,14 +141,17 @@ public class BiInfoController {
      */
     @GetMapping("/selectBiInfoNew")
     public List<BiViewInfo> selectBiInfoNew(String compId, String seachMoth) {
-        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
-            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
-            List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO+userId+seachMoth, BiViewInfo.class);
-            if (listRedis != null && listRedis.size() > 0) {
-                return listRedis;
-            }
+//        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+//            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+//            List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO+userId+seachMoth, BiViewInfo.class);
+//            if (listRedis != null && listRedis.size() > 0) {
+//                return listRedis;
+//            }
+//        }
+        List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO+compId+seachMoth, BiViewInfo.class);
+        if (listRedis != null && listRedis.size() > 0) {
+//            return listRedis;
         }
-
         companyId = compId;
         List<BiViewInfo> biViewInfos = new ArrayList<>();
         // 车辆
@@ -158,7 +161,7 @@ public class BiInfoController {
         // 库点流向
         getMapInfo(biViewInfos, seachMoth);
         // 出入库分布
-        getInOutInfo(biViewInfos, seachMoth);
+        getInOutInfo(biViewInfos, seachMoth,compId);
         // 合营比例
         getHeYing(biViewInfos, seachMoth);
         // 库存
@@ -175,7 +178,7 @@ public class BiInfoController {
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 contractManagementInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
             }
         }
@@ -196,10 +199,12 @@ public class BiInfoController {
         getMoney(biViewInfos, seachMoth);
 
 
-        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
-            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
-            cacheComponent.putRaw(Const.ADMIN_BI_INFO+userId+seachMoth, JSONObject.toJSONString(biViewInfos), 60 * 20);
-        }
+//        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+//            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+//            cacheComponent.putRaw(Const.ADMIN_BI_INFO+userId+seachMoth, JSONObject.toJSONString(biViewInfos), 60 * 20);
+//        }
+        cacheComponent.putRaw(Const.ADMIN_BI_INFO+compId+seachMoth, JSONObject.toJSONString(biViewInfos), 60 * 20);
+
         return biViewInfos;
     }
 
@@ -222,7 +227,7 @@ public class BiInfoController {
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 contractManagementInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
             }
         }
@@ -260,7 +265,7 @@ public class BiInfoController {
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 warehouseBaseInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
             }
         }
@@ -311,11 +316,12 @@ public class BiInfoController {
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 warehouseBaseInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
             }
         }
         Integer countWare = warehouseBaseInfoService.selectCount(warehouseBaseInfoEntityWrapper);
+
 //        Integer countWare = warehouseBaseInfoService.selectCount(new EntityWrapper<WarehouseBaseInfo>()
 //        .eq("comp_id",companyId).eq("delete_flag", "0").eq("warehouse_type","1"));
         // 查询仓库总数
@@ -325,7 +331,7 @@ public class BiInfoController {
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 List<WarehouseBaseInfo> warehouseBaseInfoList = warehouseBaseInfoService.selectList(new EntityWrapper<WarehouseBaseInfo>()
                         .eq("comp_id", companyId).eq("delete_flag", "0").eq("warehouse_type", "1")
                         .eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司"));
@@ -343,17 +349,33 @@ public class BiInfoController {
                 count1 = warehousePositionInfos.size();
             }
         }
-        biViewInfoa.setCount(String.valueOf(count1));
-        biViewInfoa.setName("合营");
-        biViewInfoa.setPercentage(String.valueOf(count1 / countWare * 100) + "%");
-        biViewInfob.setCount(String.valueOf(countWare - count1));
-        biViewInfob.setName("自有");
-        biViewInfob.setPercentage(String.valueOf((countWare - count1) / countWare * 100) + "%");
-        biViewInfoList.add(biViewInfoa);
-        biViewInfoList.add(biViewInfob);
-        biViewInfoc.setBiType("合营");
-        biViewInfoc.setBiViewInfoList(biViewInfoList);
-        biViewInfos.add(biViewInfoc);
+        if(countWare == 0){
+            biViewInfoa.setCount(String.valueOf(0));
+            biViewInfoa.setName("合营");
+            biViewInfoa.setPercentage(String.valueOf(0) + "%");
+            biViewInfob.setCount(String.valueOf(0));
+            biViewInfob.setName("自有");
+            biViewInfob.setPercentage(String.valueOf(0) + "%");
+            biViewInfoList.add(biViewInfoa);
+            biViewInfoList.add(biViewInfob);
+            biViewInfoc.setBiType("合营");
+            biViewInfoc.setBiViewInfoList(biViewInfoList);
+            biViewInfos.add(biViewInfoc);
+        }
+        else{
+            biViewInfoa.setCount(String.valueOf(count1));
+            biViewInfoa.setName("合营");
+            biViewInfoa.setPercentage(String.valueOf(count1 / countWare * 100) + "%");
+            biViewInfob.setCount(String.valueOf(countWare - count1));
+            biViewInfob.setName("自有");
+            biViewInfob.setPercentage(String.valueOf((countWare - count1) / countWare * 100) + "%");
+            biViewInfoList.add(biViewInfoa);
+            biViewInfoList.add(biViewInfob);
+            biViewInfoc.setBiType("合营");
+            biViewInfoc.setBiViewInfoList(biViewInfoList);
+            biViewInfos.add(biViewInfoc);
+        }
+
         return biViewInfos;
     }
 
@@ -381,7 +403,7 @@ public class BiInfoController {
                         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
                             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
                             //洮南瀚城合营人员查看
-                            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                                 warehouseBaseInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
                             }
                         }
@@ -393,7 +415,7 @@ public class BiInfoController {
                         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
                             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
                             //洮南瀚城合营人员查看
-                            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                                 contractManagementInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
                             }
                         }
@@ -413,7 +435,7 @@ public class BiInfoController {
                         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
                             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
                             //洮南瀚城合营人员查看
-                            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                                 warehouseBaseInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
                             }
                         }
@@ -424,7 +446,7 @@ public class BiInfoController {
                         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
                             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
                             //洮南瀚城合营人员查看
-                            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                                 warehouseBaseInfoEntityWrapper1.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
                             }
                         }
@@ -478,6 +500,12 @@ public class BiInfoController {
 //        Double sumAct = warehousePositionStorageInfoService.selectSumStoreage(companyId);
         Double inWeight = warehousePositionStorageInfoMapper.selectSumWareNew(companyId, null,"2",seachMoth);
         Double outWeight = warehousePositionStorageInfoMapper.selectSumWareNew(companyId, null,"1",seachMoth);
+        if (inWeight == null) {
+            inWeight = 0d;
+        }
+        if (outWeight == null) {
+            outWeight = 0d;
+        }
         Double sumAct = inWeight - outWeight;
         Double sumBuy = contractManagementInfoService.selectSumBuy(companyId,seachMoth);
         Double sumSale = contractManagementInfoService.selectSumSale(companyId,seachMoth);
@@ -535,10 +563,11 @@ public class BiInfoController {
                 biViewInfo3.setCount(String.valueOf(weight));
                 biViewInfos1.add(biViewInfo3);
             }
-            biViewInfo4.setBiType("9-粮食总储存量");
-            biViewInfo4.setBiViewInfoList(biViewInfos1);
-            biViewInfos.add(biViewInfo4);
+
         }
+        biViewInfo4.setBiType("9-粮食总储存量");
+        biViewInfo4.setBiViewInfoList(biViewInfos1);
+        biViewInfos.add(biViewInfo4);
         return biViewInfos;
     }
 
@@ -560,7 +589,7 @@ public class BiInfoController {
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 contractManagementInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
             }
         }
@@ -651,7 +680,7 @@ public class BiInfoController {
      *
      * @return
      */
-    private List<BiViewInfo> getInOutInfo(List<BiViewInfo> biViewInfos,String seachMoth) {
+    private List<BiViewInfo> getInOutInfo(List<BiViewInfo> biViewInfos,String seachMoth,String compId) {
         List<BiViewInfo> biViewInfoList = new ArrayList<>();
         BiViewInfo biViewInfo = new BiViewInfo();
         List<BiViewInfo> biViewInfoList1 = new ArrayList<>();
@@ -669,10 +698,12 @@ public class BiInfoController {
             if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
                 String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
                 //洮南瀚城合营人员查看
-                if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                     pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
                 }
             }
+            pageView.put("seachMoth", seachMoth);
+            pageView.put("compId", compId);
             List<WarehouseInOutInfo> list = warehouseInOutInfoMapper.brokenLineStatisticalChartByYear(pageView);
             if (list.size() == 0) {
                 Double money = 0D;
@@ -707,10 +738,13 @@ public class BiInfoController {
             if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
                 String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
                 //洮南瀚城合营人员查看
-                if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                     pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
                 }
             }
+
+            pageView.put("seachMoth", seachMoth);
+            pageView.put("compId", compId);
             List<WarehouseInOutInfo> list = warehouseInOutInfoMapper.brokenLineStatisticalChartByYear(pageView);
             if (list.size() == 0) {
                 Double money = 0D;

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

@@ -1933,7 +1933,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
             }
         }
@@ -1947,7 +1947,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
             }
         }

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

@@ -68,7 +68,7 @@ public class CostManagementInfoServiceImpl extends ServiceImpl<CostManagementInf
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
             }
         }
@@ -101,7 +101,7 @@ public class CostManagementInfoServiceImpl extends ServiceImpl<CostManagementInf
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
             }
         }

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

@@ -392,7 +392,7 @@ public class StockSaleReceiptReportServiceImpl extends ServiceImpl<StockSaleRece
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
             }
         }

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

@@ -2756,7 +2756,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
             }
         }
@@ -2770,7 +2770,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
             }
         }

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

@@ -45,7 +45,7 @@ public class WarehousePositionStorageInfoServiceImpl extends ServiceImpl<Warehou
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
-            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+            if("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
                 pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
             }
         }

+ 30 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CostManagementInfoMapper.xml

@@ -5,8 +5,30 @@
     <select id="getListByCondition" resultType="com.yh.saas.plugin.yiliangyiyun.entity.CostManagementInfo">
         SELECT
         wbi.warehouse_name AS warehouseName,
-        wpsi.goods_name AS goodsName,
-        sum( wpsi.`storage` ) AS STORAGE,
+        IFNULL( wpsi.goods_name, cgi.goods_name ) AS goodsName,
+        CASE
+        wbi.warehouse_type
+        WHEN 1 THEN
+        sum( wpsi.`storage` ) ELSE IFNULL((
+        SELECT
+        sum( wioi.net_weight )
+        FROM
+        warehouse_in_out_info wioi
+        WHERE
+        wioi.warehouse_name = wbi.warehouse_name
+        AND wioi.delete_flag = 0
+        AND wioi.in_out_flag = 2
+        ),0) - IFNULL((
+        SELECT
+        sum( wioi.net_weight )
+        FROM
+        warehouse_in_out_info wioi
+        WHERE
+        wioi.warehouse_name = wbi.warehouse_name
+        AND wioi.delete_flag = 0
+        AND wioi.in_out_flag = 1
+        ) ,0)
+        END AS STORAGE,
         (
         SELECT
         ROUND( AVG( wo.avg_cost ), 3 )
@@ -23,10 +45,13 @@
         AND wpi.delete_flag = 0
         LEFT JOIN warehouse_position_storage_info wpsi ON wpsi.position_id = wpi.id
         AND wpsi.delete_flag = 0
+        LEFT JOIN contract_management_info cmi ON cmi.contract_no = wbi.warehouse_name
+        AND cmi.delete_flag = 0
+        LEFT JOIN contract_goods_info cgi ON cgi.contract_id = cmi.id
+        AND cgi.delete_flag = 0
         WHERE
         1 = 1
-        AND wpsi.`storage` > 0
-        AND wbi.warehouse_type = 1
+        AND ( cmi.id IS NOT NULL OR wpsi.`storage` > 0 )
         AND wbi.delete_flag = 0
         AND wbi.comp_id =#{compId}
         AND wbi.create_date >=#{searchMoth}
@@ -36,6 +61,7 @@
         GROUP BY
             wpsi.goods_name,
             wbi.warehouse_name
+        ORDER BY wbi.warehouse_name desc
     </select>
     <select id="getListByConditionBi" resultType="com.yh.saas.plugin.yiliangyiyun.entity.CostManagementInfo">
         SELECT

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

@@ -356,6 +356,12 @@
         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="seachMoth != null">
+            AND w.create_date > #{seachMoth}
+        </if>
+        <if test="compId != null">
+            AND wbi.comp_id = #{compId}
+        </if>
         <if test="jointVentureParties != null">
             AND wbi.joint_venture_parties = #{jointVentureParties}
         </if>