Ver Fonte

20221220 8:57

wangzhuo há 2 anos atrás
pai
commit
e37a180aad

+ 1 - 0
ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/impl/ForeignHttpServiceImpl.java

@@ -123,6 +123,7 @@ public class ForeignHttpServiceImpl implements ForeignHttpService{
         Map<String,Object> mapR = new HashMap<>();
 
         Map<String,Object> map= itWarehouseService.getStorageInfo(wareHouseId);
+
         if (map == null){
             mapR.put("data",new HashMap<>());
         }else {

+ 15 - 4
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -454,13 +454,24 @@
 
     <select id="getStorageInfo" resultType="map">
         SELECT
-            IFNULL( ROUND( TW.f_totalgross / 1000, 2 ), 0 ) AS capacity,
+            cast(IFNULL( ROUND( TW.f_totalgross / 1000, 2 ), 0 ) as DECIMAL(20,2)) AS capacity,
             IFNULL( ROUND( TWB.f_netweight / 1000, 2 ), 0 ) AS storage,
-            '' AS throughput,
-            '' AS customers
+            TTL.value AS throughput,
+            count(distinct(TWB.f_corpid)) AS customers
         FROM
             t_warehouse TW
-                LEFT JOIN t_warehousebills TWB ON TW.f_id = TWB.f_warehouseid
+        LEFT JOIN t_warehousebills TWB ON TW.f_id = TWB.f_warehouseid
+        LEFT JOIN (
+            SELECT
+                f_warehouseid,
+                ROUND( SUM(f_grossweight) / 1000, 2 ) as value
+            FROM t_warehousebills
+            where
+            del_flag = '0'
+            and f_billtype in ('SJCK')
+            GROUP BY
+            f_id
+        ) TTL ON TTL.f_warehouseid = TW.f_id
         <where>
             TW.del_flag = '0'
             AND TW.f_id = #{wareHouseId}