Sun 3 vuotta sitten
vanhempi
commit
8670007667

+ 7 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java

@@ -207,4 +207,11 @@ public interface TWhgenlegMapper {
                                                     @Param("warehouseId") Long warehouseId,
                                                     @Param("customerId") Long customerId);
 
+    /**
+     * bi大屏仓库概况
+     *
+     * @return
+     */
+    public List<Map<String, Object>> biWarehouseInfo(@Param("external") String external,
+                                                    @Param("customerId") Long customerId);
 }

+ 4 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java

@@ -658,6 +658,10 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
             external = user.getUserName();
         }
 
+        if (warehouseId == null && customerId != null) {
+
+        }
+
         return tWhgenlegMapper.biCustomerInfo(external, warehouseId, customerId);
     }
 

+ 11 - 4
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -6164,10 +6164,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                         if (StringUtils.isNotNull(tWhgenle) && (wb.getfQty() <= tWhgenle.getfQtyblc())) { // 非空 且 撤销数 <= 结余数
                             updateTWhgenlegData(wb, tWhgenle.getfId(), billsType);
                             TWhgenleg whgenleg = tWhgenlegMapper.selectTWhgenlegById(tWhgenle.getfId());
-                            Long qtyblc = whgenleg.getfQtyblc();
-                            BigDecimal grossweightblc = whgenleg.getfGrossweightblc();
-                            BigDecimal netweightblc = whgenleg.getfNetweightblc();
-                            if (qtyblc == 0 && grossweightblc.compareTo(BigDecimal.ZERO) == 0 && netweightblc.compareTo(BigDecimal.ZERO) == 0) {
+                            Long qtyd = whgenleg.getfQtyd();
+                            BigDecimal grossweightd = whgenleg.getfGrossweightd();
+                            BigDecimal netweightd = whgenleg.getfNetweightd();
+                            if (qtyd == 0 && grossweightd.compareTo(BigDecimal.ZERO) == 0 && netweightd.compareTo(BigDecimal.ZERO) == 0) {
                                 tWhgenlegMapper.deleteTWhgenlegById(whgenleg.getfId());
                             }
                         } else { // 撤销数>结余数
@@ -6197,6 +6197,13 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                         TWhgenleg tWhgenle = queryWhgenlegService.secondStockWhgenleg(tWarehousebills, wb, goods.getIfCntrno(), WarehouseTypeEnum.CONFIRM_OPERATION.getType());
                         if (StringUtils.isNotNull(tWhgenle) && (wb.getfQty() <= tWhgenle.getfQtyblc())) {
                             updateTWhgenlegData(wb, tWhgenle.getfId(), WarehouseTypeEnum.SJRK_REVOKE.getType());
+                            TWhgenleg whgenleg = tWhgenlegMapper.selectTWhgenlegById(tWhgenle.getfId());
+                            Long qtyd = whgenleg.getfQtyd();
+                            BigDecimal grossweightd = whgenleg.getfGrossweightd();
+                            BigDecimal netweightd = whgenleg.getfNetweightd();
+                            if (qtyd == 0 && grossweightd.compareTo(BigDecimal.ZERO) == 0 && netweightd.compareTo(BigDecimal.ZERO) == 0) {
+                                tWhgenlegMapper.deleteTWhgenlegById(whgenleg.getfId());
+                            }
                         } else {
                             throw new WarehouseException("第" + i + "行撤销数大于库存结余数");
                         }

+ 17 - 1
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -1249,7 +1249,7 @@
 
     <select id="biCustomerInfo" resultType="map">
         select
-            ifnull(tw.f_shipper, tc.f_name) as customerName,
+            ifnull(tw.f_shipper, tc.f_cname) as customerName,
             round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity
         from t_whgenleg tw left join t_corps tc on tw.f_corpid = tc.f_id
         where
@@ -1264,4 +1264,20 @@
         order by quantity desc limit 10
     </select>
 
+    <select id="biWarehouseInfo" resultType="map">
+        select
+            t.f_name as customerName,
+            round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity
+        from t_whgenleg tw left join t_warehouse t on tw.f_warehouseid = t.f_id
+        where
+            tw.f_qtyD != 0
+            and tw.f_qtyblc != 0
+            <if test="external != null and external != ''">
+                and tw.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
+            </if>
+            <if test="customerId != null"> and tw.f_corpid = #{customerId}</if>
+        group by customerName
+        order by quantity desc limit 10
+    </select>
+
 </mapper>

+ 2 - 2
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -2550,7 +2550,7 @@
             w.f_planvolumn fPlanvolumn,
             w.f_plannetweight fPlannetweight,
             w.f_plangrossweight fPlangrossweight,
-            IFNULL(ROUND(w.f_grossweight/1000.3465,2),0) fGrossweight,
+            IFNULL(ROUND(w.f_grossweight/1000,2),0) fGrossweight,
             w.f_grossweight fGrossweights,
             w.f_storekeeper fStorekeeper,
             w.create_by createBy,
@@ -2655,7 +2655,7 @@
             cntr.f_name cntrtypes,
             t.f_cntrtype fCntrtype,
             t.f_qty fQty,
-            IFNULL(ROUND(w.f_grossweight/1000.3465,2),0) fGrossweight,
+            IFNULL(ROUND(w.f_grossweight/1000,2),0) fGrossweight,
             t.f_grossweight fGrossweights,
             t.f_cntqty fCntqty,
             fleet.f_name fleetName,