| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- package cn.com.lzt.personnelbasearchivesmanage.util;
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileNotFoundException;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.OutputStreamWriter;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.Map;
- import java.util.UUID;
- import org.jeecgframework.core.util.FileUtils;
- import org.jeecgframework.core.util.ResourceUtil;
- import org.springframework.util.FileCopyUtils;
- import cn.com.lzt.common.entity.TSysFileEntity;
- /**
- * 员工基本档案导入日志
- * @author zbw
- * 2018-1-11
- */
- public class OutPutMsg {
- /**
- * @author zbw
- * 2018-1-11
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- }
-
- /**
- * 先把日志进行本地存储;
- * @author zbw
- * 2018-1-15
- * @param toPath
- * @param fileName
- * @param msg
- */
- public static void writeMsgTxT(String toPath,String fileName,String msg) {
- // SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyy-MM-dd HH:mm:ss ms");
- // System.out.println(visitorIp+"--"+simpleDateFormat.format(new Date()));
- File fileVal =new File(toPath+fileName);
- //如果文件夹不存在则创建
- // if (!fileVal.exists() && !fileVal.isDirectory()) {
- //// System.out.println("//不存在");
- // File fileVal2 =new File(toPathPart);
- // if (!fileVal2.exists() && !fileVal2.isDirectory()) {
- // fileVal.mkdirs();
- // }else{
- // fileVal.mkdir();
- // }
- // }
- try
- {
- FileOutputStream out = new FileOutputStream(fileVal,true);
- BufferedWriter bw = new BufferedWriter(
- new OutputStreamWriter(out));
- if(msg.indexOf(";")!=-1){
- for (int i = 0; i < msg.split(";").length; i++) {
- bw.write(msg.split(";")[i]+";");
- bw.newLine();
- }
- }else{
- bw.write(msg);
- bw.newLine();
- }
-
- bw.flush();
- bw.close();
- }
- catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- public static void writeMsgXls(Map<String, Object> fileMsgMap) {
-
- }
-
-
-
- }
|