瀏覽代碼

2023年6月1日18:05:53

纪新园 2 年之前
父節點
當前提交
3527bd1fee

+ 35 - 2
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java

@@ -1,10 +1,11 @@
 package com.ruoyi;
 
 import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 
+import java.util.Random;
+
 /**
  * 启动程序
  *
@@ -13,7 +14,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
 @MapperScan("mapper")
 public class RuoYiApplication {
-    public static void main(String[] args) {
+    /*public static void main(String[] args) {
         // System.setProperty("spring.devtools.restart.enabled", "false");
         SpringApplication.run(RuoYiApplication.class, args);
         System.out.println("(♥◠‿◠)ノ゙  若依启动成功   ლ(´ڡ`ლ)゙  \n" +
@@ -26,5 +27,37 @@ public class RuoYiApplication {
                 " |  | \\ `'   /|   `-'  /           \n" +
                 " |  |  \\    /  \\      /           \n" +
                 " ''-'   `'-'    `-..-'              ");
+    }*/
+
+    public static void main(String[] args) {
+        String[] numbers = {"愤怒巨刃", "魅影忍刀", "神速长裤", "愤怒之兜", "愤怒戒指"};
+        int f1 = 0;
+        int m1 = 0;
+        int s1 = 0;
+        int f2 = 0;
+        int f3 = 0;
+        for (int i = 0; i < 100; i++) {
+            int randomIndex = new Random().nextInt(numbers.length);
+            String randomNumber = numbers[randomIndex];
+            if ("愤怒巨刃".equals(randomNumber)) {
+                f1 = f1 + 1;
+            } else if ("魅影忍刀".equals(randomNumber)) {
+                m1 = m1 + 1;
+            } else if ("神速长裤".equals(randomNumber)) {
+                s1 = s1 + 1;
+            } else if ("愤怒之兜".equals(randomNumber)) {
+                f2 = f2 + 1;
+            } else {
+                f3 = f3 + 1;
+            }
+        }
+        System.out.println("愤怒巨刃:" + f1);
+        System.out.println("魅影忍刀:" + m1);
+        System.out.println("神速长裤:" + s1);
+        System.out.println("愤怒之兜:" + f2);
+        System.out.println("愤怒戒指:" + f3);
+
+        /*int randomNumber = ThreadLocalRandom.current().nextInt(1, 11);
+        System.out.println(randomNumber);*/
     }
 }

+ 2 - 0
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -381,6 +381,7 @@
         LEFT JOIN t_goods TG ON TG.f_id = TWG.f_goodsid
         <where>
             TW.del_flag = '0'
+            and TWG.f_qtyblc > 0
             <if test="warehouseCode != null  and warehouseCode != ''"> and TW.f_id = #{warehouseCode}</if>
             <if test="ownerName != null  and ownerName != ''"> and TC.f_name like concat('%', #{ownerName}, '%')</if>
             <if test="goodsName != null  and goodsName != ''"> and TG.f_name like concat('%', #{goodsName}, '%')</if>
@@ -433,6 +434,7 @@
         LEFT JOIN t_warehousebills TWB ON TWG.f_originalbillno = TWB.f_billno
         <where>
             TW.del_flag = '0'
+            and TWG.f_qtyblc > 0
             <if test="warehouseCode != null  and warehouseCode != ''"> and TWG.f_warehouseid = #{warehouseCode}</if>
             <if test="ownerName != null  and ownerName != ''"> and TC.f_name like concat('%', #{ownerName}, '%')</if>
             <if test="ownerCode != null  and ownerCode != ''"> and TC.f_id = #{ownerCode}</if>