ccjgmwz 3 years ago
parent
commit
fe7d9202f8

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

@@ -161,14 +161,14 @@ public class BiInfoController {
     private List<BiViewInfo> getCostCount(List<BiViewInfo> biViewInfos,String seachMoth) {
         EntityWrapper<CostManagementInfo> costManagementInfoEntityWrapper = new EntityWrapper<CostManagementInfo>();
         costManagementInfoEntityWrapper.eq("comp_id", companyId);
-        if(seachMoth != null) {
-            if (!seachMoth.contains("-")) {
-                costManagementInfoEntityWrapper.and("YEAR(create_date)='" + seachMoth + "'");
-            } else {
-                costManagementInfoEntityWrapper.and("(YEAR(create_date)+\"-\"+MONTH(create_date))='" + seachMoth + "'");
-
-            }
-        }
+//        if(seachMoth != null) {
+//            if (!seachMoth.contains("-")) {
+//                costManagementInfoEntityWrapper.and("YEAR(create_date)='" + seachMoth + "'");
+//            } else {
+//                costManagementInfoEntityWrapper.and("(YEAR(create_date)+\"-\"+MONTH(create_date))='" + seachMoth + "'");
+//
+//            }
+//        }
         List<CostManagementInfo> costManagementInfos = costManagementInfoService.selectList(costManagementInfoEntityWrapper);
         Float sumTotal = 0f;
         Float sumCost = 0f;
@@ -198,14 +198,14 @@ public class BiInfoController {
         EntityWrapper<CostManagementInfo> costManagementInfoEntityWrapper1 = new EntityWrapper<CostManagementInfo>();
         costManagementInfoEntityWrapper1.eq("comp_id", companyId);
         costManagementInfoEntityWrapper1.groupBy("goods_name_key");
-        if(seachMoth != null) {
-            if (!seachMoth.contains("-")) {
-                costManagementInfoEntityWrapper1.and("YEAR(create_date)='" + seachMoth + "'");
-            } else {
-                costManagementInfoEntityWrapper1.and("(YEAR(create_date)+\"-\"+MONTH(create_date))='" + seachMoth + "'");
-
-            }
-        }
+//        if(seachMoth != null) {
+//            if (!seachMoth.contains("-")) {
+//                costManagementInfoEntityWrapper1.and("YEAR(create_date)='" + seachMoth + "'");
+//            } else {
+//                costManagementInfoEntityWrapper1.and("(YEAR(create_date)+\"-\"+MONTH(create_date))='" + seachMoth + "'");
+//
+//            }
+//        }
         List<CostManagementInfo> costManagementInfoList = costManagementInfoService.selectList(costManagementInfoEntityWrapper1);
         BiViewInfo biViewInfo4 = new BiViewInfo();
         List<BiViewInfo> biViewInfos1 = new ArrayList<>();
@@ -216,18 +216,18 @@ public class BiInfoController {
                 EntityWrapper<CostManagementInfo> costManagementInfoEntityWrapper2 = new EntityWrapper<CostManagementInfo>();
                 costManagementInfoEntityWrapper2.eq("comp_id", companyId);
                 costManagementInfoEntityWrapper2.eq("goods_name_key", costManagementInfo.getGoodsNameKey());
-                if(seachMoth != null) {
-                    if (!seachMoth.contains("-")) {
-                        costManagementInfoEntityWrapper1.and("YEAR(create_date)='" + seachMoth + "'");
-                    } else {
-                        costManagementInfoEntityWrapper1.and("(YEAR(create_date)+\"-\"+MONTH(create_date))='" + seachMoth + "'");
-
-                    }
-                }
+//                if(seachMoth != null) {
+//                    if (!seachMoth.contains("-")) {
+//                        costManagementInfoEntityWrapper1.and("YEAR(create_date)='" + seachMoth + "'");
+//                    } else {
+//                        costManagementInfoEntityWrapper1.and("(YEAR(create_date)+\"-\"+MONTH(create_date))='" + seachMoth + "'");
+//
+//                    }
+//                }
                 List<CostManagementInfo> costManagementInfoList1 = costManagementInfoService.selectList(costManagementInfoEntityWrapper2);
                 Float weight = 0f;
                 for (int j = 0; j < costManagementInfoList1.size(); j++) {
-                    CostManagementInfo costManagementInfo1 = costManagementInfoList.get(i);
+                    CostManagementInfo costManagementInfo1 = costManagementInfoList1.get(j);
                     weight = weight + costManagementInfo1.getStorage();
                 }
                 biViewInfo3.setName(costManagementInfo.getGoodsName());

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

@@ -45,13 +45,16 @@ public class CostManagementInfoServiceImpl extends ServiceImpl<CostManagementInf
         Wrapper<CostManagementInfo> costManagementInfoWrapper = new EntityWrapper<>();
         costManagementInfoWrapper.eq("warehouse_type", costManagementInfo.getWarehouseType())
                                  .eq("comp_id", AuthSecurityUtils.getCurrentUserInfo().getCompId());
-        costManagementInfoWrapper.orderBy("warehouse_name");
         if (costManagementInfo.getWarehouseId()!=null&&!costManagementInfo.getWarehouseId().isEmpty()){
             costManagementInfoWrapper.eq("warehouse_id", costManagementInfo.getWarehouseId());
         }
         if (costManagementInfo.getWarehouseName()!=null&&!costManagementInfo.getWarehouseName().isEmpty()){
             costManagementInfoWrapper.like("warehouse_name", "%" + costManagementInfo.getWarehouseName() + "%");
         }
+
+        costManagementInfoWrapper.gt("storage", 0);
+        costManagementInfoWrapper.orderBy("warehouse_name",false);
+
         List<CostManagementInfo> costManagementInfoList = this.selectList(costManagementInfoWrapper);
         return costManagementInfoList;
     }

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

@@ -419,7 +419,21 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
             pageView.put("searchKeyWord", identityAuthenticationInfo.getSearchKeyWord());
             pageView.put("pageSize", identityAuthenticationInfo.getPageSize());
             pageView.put("currentPage", identityAuthenticationInfo.getCurrentPage());
+            Calendar cal = Calendar.getInstance();
+            int yearNum = cal.get(Calendar.YEAR);
+            int month = cal.get(Calendar.MONTH) + 1;
+            if(month < 9){
+                yearNum --;
+            }
 
+            SimpleDateFormat now = new SimpleDateFormat(yearNum +"-09-01 00:00:00");
+            Calendar c = Calendar.getInstance();
+            c.setTime(new java.util.Date());
+            c.add(Calendar.YEAR, 0);
+            Date y = c.getTime();
+            String year = now.format(y);
+            //公司id
+            pageView.put("year", year);
             List<IdentityAuthenticationInfo> dataList = this.baseMapper.getIdentityInfoByCondition(pageView);
 
 

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

@@ -22,7 +22,15 @@
         a.payee_address_url as payeeAddressUrl,
         a.card_address_url as cardAddressUrl,
         a.comp_id as compId,
-        a.supplier
+        a.supplier,
+        ROUND((SELECT IFNULL(sum(case when p.type ='潮粮' then p.pure_weight else p.net_weight end),0)
+        FROM payment_management p
+        WHERE p.delete_flag = '0'
+        AND p.customer_number_card = a.customer_number_card
+        AND p.goods_name like '%玉米%'
+        AND (DATE_FORMAT(p.create_date,"%Y%m%d") >=
+        DATE_FORMAT(#{year},"%Y%m%d"))
+        AND p.comp_id = b.com_id)/1000,2) as completedQuantity
         FROM identity_authentication_info a
         left join
         common_company_identity b