| | |
| | | public void insert() { |
| | | List<String> people = Arrays.asList("张三,张强,张力", "张萌,张蒙", "张旺,张点,张可", "张章,张常", "张璇,张为,张强,张力"); |
| | | List<String> address = Arrays.asList("花园", "海滩", "公园", "游乐场", "田园", "农庄"); |
| | | |
| | | 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); |
| | | |
| | | } |
| | | 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); |
| | | // |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | // int familyNum = family.nextInt(4); |
| | | |
| | | zfCollection = new ZfCollection(); |
| | | zfCollection.setGetTime(simpleDateFormat.parse(l1.get(typeNum))); |
| | | zfCollection.setHappenTime(simpleDateFormat.parse(l1.get(typeNum))); |
| | | zfCollection.setType(l2.get(typeNum)); |
| | | zfCollection.setName(l3.get(typeNum)); |
| | | zfCollection.setSource(l4.get(sourceNum)); |
| | |
| | | zfCollection.setPrice(l6.get(typeNum)); |
| | | zfCollection.setLocation(l7.get(typeNum)); |
| | | zfCollection.setRemark(l8.get(typeNum)); |
| | | zfCollection.setFamilyId("4"); |
| | | //zfCollection.setFamilyId(4); |
| | | zfCollection.setUrl("profile/upload/2023/03/19/test7_20230319222030A007.jpg"); |
| | | |
| | | zfCollectionService.save(zfCollection); |
| | |
| | | |
| | | 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.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("杂物房", "衣柜"); |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |