zhangyuewww 3 年之前
父节点
当前提交
640073adc7

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/InventoryCostInfo.java

@@ -57,7 +57,7 @@ public class InventoryCostInfo extends BaseModel<InventoryCostInfo> {
     /**
      * 金额(元)
      */
-    private Float amount;
+    private Double amount;
     /**
      * 日期
      */

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

@@ -1,9 +1,13 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.common.support.util.StringUtils;
+import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.entity.CostManagementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.CustomerInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.WeightedDetails;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CostManagementInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ICostManagementInfoService;
@@ -32,12 +36,13 @@ public class CostManagementInfoServiceImpl extends ServiceImpl<CostManagementInf
      */
     @Override
     public Page<CostManagementInfo> selectCostManagementInfo(CostManagementInfo costManagementInfo) {
-        Page<CostManagementInfo> costManagementInfoPage = this.selectPage(costManagementInfo.getQueryPage(), new EntityWrapper<CostManagementInfo>()
-                .eq("warehouse_id", costManagementInfo.getWarehouseId())
-                .eq("warehouse_type", costManagementInfo.getWarehouseType()));
-        int count = this.selectCount(new EntityWrapper<CostManagementInfo>()
-                .eq("warehouse_id", costManagementInfo.getWarehouseId())
-                .eq("warehouse_type", costManagementInfo.getWarehouseType()));
+        Wrapper<CostManagementInfo> costManagementInfoWrapper = new EntityWrapper<>();
+        costManagementInfoWrapper.eq("warehouse_type", costManagementInfo.getWarehouseType());
+        if (costManagementInfo.getWarehouseId()!=null&&!costManagementInfo.getWarehouseId().isEmpty()){
+            costManagementInfoWrapper.eq("warehouse_id", costManagementInfo.getWarehouseId());
+        }
+        Page<CostManagementInfo> costManagementInfoPage = this.selectPage(costManagementInfo.getQueryPage(), costManagementInfoWrapper);
+        int count = this.selectCount(costManagementInfoWrapper);
         costManagementInfoPage.setSize(count);
         return costManagementInfoPage;
     }

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

@@ -45,11 +45,12 @@ public class InventoryCostInfoServiceImpl extends ServiceImpl<InventoryCostInfoM
         Page<InventoryCostInfo> inventoryCostInfoPage = this.selectPage(inventoryCostInfo.getQueryPage(), new EntityWrapper<InventoryCostInfo>()
                 .eq("warehouse_id", inventoryCostInfo.getWarehouseId())
         .gt("cost_date",start)
-        .lt("cost_date",end));
+        .lt("cost_date",end)
+        .orderBy("cost_date",false));
         int count = this.selectCount( new EntityWrapper<InventoryCostInfo>()
                 .eq("warehouse_id", inventoryCostInfo.getWarehouseId())
                 .gt("cost_date",start)
-                .lt("cost_date",end));
+                .lt("cost_date",end).orderBy("cost_date",false));
         inventoryCostInfoPage.setSize(count);
         return inventoryCostInfoPage;
     }