From 86d65e6f837ff14b090ffc3312c013987b6f67d8 Mon Sep 17 00:00:00 2001
From: zqy <2522236926@qq.com>
Date: 星期二, 14 十月 2025 21:59:13 +0800
Subject: [PATCH] 荣誉 新增两个字段的查询
---
ruoyi-admin/src/test/java/com/ruoyi/insertData.java | 233 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 216 insertions(+), 17 deletions(-)
diff --git a/ruoyi-admin/src/test/java/com/ruoyi/insertData.java b/ruoyi-admin/src/test/java/com/ruoyi/insertData.java
index b8b722d..e68210b 100644
--- a/ruoyi-admin/src/test/java/com/ruoyi/insertData.java
+++ b/ruoyi-admin/src/test/java/com/ruoyi/insertData.java
@@ -1,11 +1,13 @@
package com.ruoyi;
-import com.ruoyi.domain.ZfEvent;
-import com.ruoyi.service.ZfEventService;
+import com.ruoyi.domain.*;
+import com.ruoyi.service.*;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -22,31 +24,228 @@
@Autowired
private ZfEventService zfEventService;
+ @Autowired
+ private ZfDoctorService zfDoctorService;
+
+ @Autowired
+ private ZfEquipmentService zfEquipmentService;
+
+ @Autowired
+ ZfCollectionService zfCollectionService;
+
+ @Autowired
+ ZfEconomyService zfEconomyService;
+
@Test
- public void insert(){
+ public void insert() {
List<String> people = Arrays.asList("寮犱笁锛屽紶寮猴紝寮犲姏", "寮犺悓锛屽紶钂�", "寮犳椇锛屽紶鐐癸紝寮犲彲", "寮犵珷锛屽紶甯�", "寮犵拠锛屽紶涓猴紝寮犲己锛屽紶鍔�");
List<String> address = Arrays.asList("鑺卞洯", "娴锋哗", "鍏洯", "娓镐箰鍦�", "鐢板洯", "鍐滃簞");
+ System.out.println(zfEventService);
+// ZfEvent zfEvent = null;
+//
+// for (int i = 0; i < 200; i++) {
+// zfEvent = new ZfEvent();
+// int peopleRandom = new Random().nextInt(5);//0-4鐨勯殢鏈烘暟
+// int addressRandom = new Random().nextInt(6);//0-5鐨勯殢鏈烘暟
+//
+// String base = "abcdefghijklmnopqrstuvwxyz";
+// int strRandom1 = new Random().nextInt(16);//0-15鐨勯殢鏈烘暟
+// int strRandom2 = new Random().nextInt(16);//0-15鐨勯殢鏈烘暟
+// String title = base.substring(strRandom1, strRandom1 + 8);
+// String remark = base.substring(strRandom2, strRandom2 + 8);
+//
+// zfEvent.setPeople(people.get(peopleRandom));
+// zfEvent.setAddress(address.get(addressRandom));
+// zfEvent.setTitle(title);
+// zfEvent.setRemark(remark);
+// zfEventService.save(zfEvent);
+//
+// }
- ZfEvent zfEvent = null;
+ }
+ @Test
+ void insertDoctor() {
+ List<String> l1 = Arrays.asList("鐗欑", "绁炵粡绉�", "澶栫");
+ List<String> l2 = Arrays.asList("鐗欑棝", "澶寸棝", "鐨偆鐐�");
+ List<String> l3 = Arrays.asList("涓�涓湀", "鍗婁釜鏈�", "涓�澶�");
+ List<String> l4 = Arrays.asList("鐧借姺10g", "涓尰鑽�1", "涓尰鑽�2");
+ List<String> l5 = Arrays.asList("缁寸敓绱燙", "甯冩礇鑺�", "鐨悍闇�");
+ List<String> l6 = Arrays.asList("缂撹В鐗欑棝", "缂撹В澶寸棝", "缂撹В鐨偆鐐�");
+ List<String> l7 = Arrays.asList("寮犱笁", "鏉庡洓", "鐜嬩簲");
+ List<String> l8 = Arrays.asList("涓撴不鐗欑棝", "涓撴不澶寸棝", "涓撴不鐨偆鐐�");
+
+ ZfDoctor zfDoctor = null;
+ int count = 0;
for (int i = 0; i < 200; i++) {
- zfEvent=new ZfEvent();
- int peopleRandom = new Random().nextInt(5);//0-4鐨勯殢鏈烘暟
- int addressRandom = new Random().nextInt(6);//0-5鐨勯殢鏈烘暟
+ count = count % 3;
+ zfDoctor = new ZfDoctor();
+ zfDoctor.setType(l1.get(count));
+ zfDoctor.setSymptom(l2.get(count));
+ zfDoctor.setDuration(l3.get(count));
+ zfDoctor.setCmedical(l4.get(count));
+ zfDoctor.setWmedical(l5.get(count));
+ zfDoctor.setEffect(l6.get(count));
+ zfDoctor.setSuitable(l7.get(count));
+ zfDoctor.setRemark(l8.get(count));
+ zfDoctor.setUrl("profile/upload/2023/03/19/test7_20230319222030A007.jpg");
+ count++;
+ zfDoctorService.save(zfDoctor);
+ }
+ }
- String base="abcdefghijklmnopqrstuvwxyz";
- int strRandom1 = new Random().nextInt(16);//0-15鐨勯殢鏈烘暟
- int strRandom2 = new Random().nextInt(16);//0-15鐨勯殢鏈烘暟
- String title=base.substring(strRandom1,strRandom1+8);
- String remark=base.substring(strRandom2,strRandom2+8);
+ @Test
+ void insertEquipment() {
+ List<String> l1 = Arrays.asList("鐢佃", "鐢靛啺绠�", "鐢佃剳");
+ List<String> l2 = Arrays.asList("2020-11-11", "2021-11-12", "2022-12-08");
+ List<String> l3 = Arrays.asList("寮犱笁", "鏉庡洓", "鐜嬩簲");
+ List<String> l4 = Arrays.asList("澶忔櫘娑叉櫠鐢佃", "瑗块棬瀛愮數鍐扮", "鑻规灉鐢佃剳");
+ List<String> l5 = Arrays.asList("瀹㈠巺", "鍘ㄦ埧", "鍗у");
+ List<String> l6 = Arrays.asList("4k瓒呴珮娓�", "鍙屽紑闂�", "M2鑺墖");
- zfEvent.setPeople(people.get(peopleRandom));
- zfEvent.setAddress(address.get(addressRandom));
- zfEvent.setTitle(title);
- zfEvent.setRemark(remark);
- zfEventService.save(zfEvent);
+ ZfEquipment zfEquipment = null;
+ int count = 0;
+ for (int i = 0; i < 200; i++) {
+ count = count % 3;
+ zfEquipment = new ZfEquipment();
+ zfEquipment.setName(l1.get(count));
+ zfEquipment.setBuyer(l3.get(count));
+ zfEquipment.setContent(l4.get(count));
+ zfEquipment.setLocation(l5.get(count));
+ zfEquipment.setRemark(l6.get(count));
+ zfEquipment.setUrl("profile/upload/2023/03/19/test7_20230319222030A007.jpg");
+ count++;
+ zfEquipmentService.save(zfEquipment);
+ }
+ }
+
+ @Test
+ void insertCollection() throws ParseException {
+ List<String> l1 = Arrays.asList("2020-11-11", "2021-11-12", "2022-12-08");
+ List<String> l2 = Arrays.asList("閭エ", "鏃ユ湰鍐涘垁", "鐡峰櫒");
+ List<String> l3 = Arrays.asList("鍗佷簩鐢熻倴绾康閭エ", "澶╃洰褰辨墦鍒�", "闈掕姳鐡�");
+ List<String> l4 = Arrays.asList("璐拱", "鑾疯禒", "鎷嶅崠");
+ List<String> l5 = Arrays.asList("寮犱笁", "鏉庡洓", "鐜嬩簲");
+ List<String> l6 = Arrays.asList("10000", "16000", "28000");
+ List<String> l7 = Arrays.asList("搴婂ご鏌�", "閰掓煖", "瀹㈠巺鐢佃鏌�");
+ List<String> l8 = Arrays.asList("鍗佷簩鐢熻倴", "瀹濆垁鏈��", "鍙よ懀鐡峰櫒");
+ List<String> l9 = Arrays.asList("1", "2", "3", "4");
+
+ Random type = new Random();
+ Random source = new Random();
+ Random own = new Random();
+ Random family = new Random();
+
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+
+
+ ZfCollection zfCollection = null;
+
+ for (int i = 0; i < 50; i++) {
+ int typeNum = type.nextInt(3);
+ int sourceNum = source.nextInt(3);
+ int ownNum = own.nextInt(3);
+// int familyNum = family.nextInt(4);
+
+ zfCollection = new ZfCollection();
+ zfCollection.setHappenTime(simpleDateFormat.parse(l1.get(typeNum)));
+ zfCollection.setType(l2.get(typeNum));
+ zfCollection.setName(l3.get(typeNum));
+ zfCollection.setSource(l4.get(sourceNum));
+ zfCollection.setOwner(l5.get(ownNum));
+ zfCollection.setPrice(l6.get(typeNum));
+ zfCollection.setLocation(l7.get(typeNum));
+ zfCollection.setRemark(l8.get(typeNum));
+ //zfCollection.setFamilyId(4);
+ zfCollection.setUrl("profile/upload/2023/03/19/test7_20230319222030A007.jpg");
+
+ zfCollectionService.save(zfCollection);
+ }
+ }
+
+
+ @Test
+ void insertEconomy() throws ParseException {
+ List<String> l1 = Arrays.asList("2020-11-11", "2021-11-12", "2022-12-08");
+ List<String> l2 = Arrays.asList("-8000", "+10000");
+ List<String> l3 = Arrays.asList("渚涙ゼ", "瀛樻");
+ List<String> l4 = Arrays.asList("寮犱笁", "鏉庡洓");
+ List<String> l5 = Arrays.asList("20000", "30000");
+ List<Integer> l6 = Arrays.asList(0,1);
+ List<String> l9 = Arrays.asList("1", "2", "3", "4");
+
+ Random type = new Random();
+ Random source = new Random();
+ Random own = new Random();
+ Random family = new Random();
+
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+
+
+ ZfEconomy zfEconomy = null;
+
+ for (int i = 0; i < 400; i++) {
+ int timeNum = type.nextInt(3);
+ int typeNum = source.nextInt(2);
+ int ownNum = own.nextInt(3);
+ int familyNum = family.nextInt(4);
+
+ zfEconomy = new ZfEconomy();
+ zfEconomy.setCreateTime(simpleDateFormat.parse(l1.get(timeNum)));
+// zfEconomy.setType(l6.get(typeNum));
+// zfEconomy.setPrice(l2.get(typeNum));
+// zfEconomy.setUseFor(l3.get(typeNum));
+// zfEconomy.setUsePeople(l4.get(typeNum));
+// zfEconomy.setKind(l6.get(typeNum));
+// zfEconomy.setBalance(l5.get(typeNum));
+// zfEconomy.setRemark(l3.get(typeNum));
+// zfEconomy.setFamilyId(l9.get(familyNum));
+ zfEconomy.setUrl("profile/upload/2023/03/19/test7_20230319222030A007.jpg");
+
+ zfEconomyService.save(zfEconomy);
}
}
+
+
+ @Autowired
+ ZfCleanService zfCleanService;
+ @Test
+ void insertClean() {
+ List<Integer> l1 = Arrays.asList(0,1);
+ List<String> l2 = Arrays.asList("鎵�鏈変汉", "寮犱笁");
+ List<String> l3 = Arrays.asList("鐜荤拑绐�", "琚瓙");
+ List<String> l4 = Arrays.asList("鐜荤拑姘存礂", "鎶樺ソ鏀捐琚�");
+ List<String> l5 = Arrays.asList("鏉傜墿鎴�", "琛f煖");
+ List<String> l6 = Arrays.asList("绐楁埛", "鏀剁撼鏌�");
+ List<String> l7 = Arrays.asList("1", "2", "3", "4");
+ List<String> l9 = Arrays.asList("鎿︾幓鐠冭灏忓績","鍙犺瀛愯缁嗗績");
+
+ ZfClean zfClean=null;
+ int count=0;
+ int familyNum = 0;
+ Random family = new Random();
+
+ for (int i = 0; i < 100; i++) {
+ count=i%2;
+ familyNum=family.nextInt(4);
+ zfClean=new ZfClean();
+ zfClean.setKind(l1.get(count));
+ zfClean.setSuitable(l2.get(count));
+ zfClean.setType(l3.get(count));
+ zfClean.setMethod(l4.get(count));
+ zfClean.setPlace(l5.get(count));
+ zfClean.setLocation(l6.get(count));
+ zfClean.setRemark(l9.get(count));
+ zfClean.setUrl("profile/upload/2023/03/19/test7_20230319222030A007.jpg");
+ // zfClean.setFamilyId(l7.get(familyNum));
+ zfCleanService.save(zfClean);
+ }
+
+ }
+
}
+
+
+
--
Gitblit v1.9.1