| | |
| | | package org.fanli.dynamic;
|
| | |
|
| | | import java.io.BufferedReader;
|
| | | import java.io.File;
|
| | | import java.io.FileInputStream;
|
| | | import java.io.FileOutputStream;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStreamReader;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | | import java.util.TreeMap;
|
| | |
|
| | | import org.junit.Test;
|
| | |
|
| | | import com.yeshi.fanli.entity.dynamic.InviteMaterial;
|
| | | import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService;
|
| | | import com.yeshi.fanli.service.inter.dynamic.InviteMaterialService;
|
| | | import com.yeshi.fanli.util.BeanUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | public class Test_InviteMaterialService {
|
| | |
|
| | |
|
| | | @Test
|
| | | public void insertMaterial() {
|
| | |
| | | buff.close();
|
| | |
|
| | | // 图片格式
|
| | | int startPic = 246;
|
| | | int endPic = 261;
|
| | | int startPic = 332;
|
| | | int endPic = 366;
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | String text = list.get(i);
|
| | | if (startPic > endPic) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | // 图片重命名
|
| | | public static void main(String[] args) throws IOException {
|
| | | File[] file = new File("F:\\company_material\\pic").listFiles();
|
| | | int start = 500;
|
| | | for (int i = 0; i < file.length; i++) {
|
| | | // 得到图片
|
| | | File f = file[i];
|
| | | rename(f, start + "");
|
| | | start ++;
|
| | | }
|
| | | }
|
| | |
|
| | | private static void rename(File f, String name) throws IOException {
|
| | | FileInputStream fin = new FileInputStream(f);
|
| | | String s = new String("F:/company_material/imgs/" + name + ".jpg");
|
| | | FileOutputStream fou = new FileOutputStream(s);
|
| | | byte[] b = new byte[1024];
|
| | | int len;
|
| | | while ((len = fin.read(b)) != -1) {
|
| | | fou.write(b, 0, len);
|
| | | fou.flush();
|
| | | }
|
| | | fin.close();
|
| | | fou.close();
|
| | | }
|
| | | }
|