| | |
| | | package com.ruoyi; |
| | | |
| | | import com.ruoyi.domain.ZfDoctor; |
| | | import com.ruoyi.domain.ZfEquipment; |
| | | import com.ruoyi.domain.ZfEvent; |
| | | import com.ruoyi.service.ZfDoctorService; |
| | | import com.ruoyi.service.ZfEquipmentService; |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private ZfEquipmentService zfEquipmentService; |
| | | |
| | | @Autowired |
| | | ZfCollectionService zfCollectionService; |
| | | |
| | | @Autowired |
| | | ZfEconomyService zfEconomyService; |
| | | |
| | | @Test |
| | | public void insert(){ |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | @Test |
| | | void insertDoctor(){ |
| | | List<String> l1 = Arrays.asList("牙科", "神经科","外科"); |
| | |
| | | } |
| | | } |
| | | |
| | | @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.setGetTime(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); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |