日志文件存在D:/logs文件夹下,每分钟生成一次测试ing
parent
5df3f270bc
commit
779566b2c0
|
|
@ -15,37 +15,31 @@
|
|||
#
|
||||
# $Id: log4j.properties,v 1.3 2010/06/01 09:25:32 peng.lei Exp $
|
||||
|
||||
log4j.rootCategory=INFO, stdout
|
||||
log4j.rootCategory=INFO,stdout,R
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=[wms] %p [%t] %C{1}.%M(%L) | %m%n
|
||||
log4j.appender.stdout.layout.ConversionPattern=[zwwms] %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
|
||||
|
||||
|
||||
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.R.File=D:/logs/zwwms.log
|
||||
log4j.appender.R.DatePattern='_' yyyy-MM-dd-HH-mm
|
||||
log4j.appender.R.Append = true
|
||||
log4j.appender.R.Threshold = INFO
|
||||
log4j.appender.R.layout = org.apache.log4j.PatternLayout
|
||||
log4j.appender.R.layout.ConversionPattern = [zwwms] %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
|
||||
|
||||
|
||||
log4j.appender.R=org.apache.log4j.RollingFileAppender
|
||||
log4j.appender.R.File=wms.log
|
||||
log4j.appender.R.MaxFileSize=100KB
|
||||
log4j.appender.R.MaxBackupIndex=0
|
||||
log4j.appender.R.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
|
||||
|
||||
# Configuration for receiving e-mails when ERROR messages occur.
|
||||
log4j.appender.mail=org.apache.log4j.net.SMTPAppender
|
||||
log4j.appender.mail.To=system-error@dev.net
|
||||
log4j.appender.mail.From=wms@dev.com
|
||||
log4j.appender.mail.SMTPHost=mail.dev.com
|
||||
log4j.appender.mail.Threshold=ERROR
|
||||
log4j.appender.mail.BufferSize=1
|
||||
log4j.appender.mail.Subject=[wms] ELOG Enterprise WMS Application Error
|
||||
log4j.appender.mail.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.mail.layout.ConversionPattern=%d %-5p %c %x - %m%n
|
||||
|
||||
# If programmed properly the most messages would be at DEBUG
|
||||
# and the least at FATAL.
|
||||
log4j.logger.com.dev=ERROR
|
||||
log4j.logger.com.dev.energy=ERROR
|
||||
log4j.logger.com.dev.swms=ERROR
|
||||
log4j.logger.com.dev.energy.server.action=ERROR
|
||||
log4j.logger.com.dev.swms.server.action=ERROR
|
||||
log4j.logger.com.dev=INFO
|
||||
log4j.logger.com.dev.energy=INFO
|
||||
log4j.logger.com.dev.swms=INFO
|
||||
log4j.logger.com.dev.energy.server.action=INFO
|
||||
log4j.logger.com.dev.swms.server.action=INFO
|
||||
#log4j.logger.com.dev.swms=ERROR
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
import com.dev.energy.client.utils.StringUtils;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
import org.mortbay.http.SocketListener;
|
||||
import org.mortbay.jetty.Server;
|
||||
|
||||
|
|
@ -6,10 +9,18 @@ public class AjaxJettyLauncher {
|
|||
protected int port = 8080;
|
||||
protected String contextName = "zwwms";
|
||||
protected String deployPath = null;
|
||||
|
||||
private static Logger logger = Logger.getLogger(AjaxJettyLauncher.class);
|
||||
public static void main(String[] args) throws Exception {
|
||||
String currentDir = System.getProperty("user.dir");
|
||||
System.out.println("当前根目录是: " + currentDir);
|
||||
PropertyConfigurator.configure("log4j.properties");
|
||||
|
||||
|
||||
|
||||
AjaxJettyLauncher jl = new AjaxJettyLauncher();
|
||||
jl.run();
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
|
|
@ -22,6 +33,7 @@ public class AjaxJettyLauncher {
|
|||
server.addListener(listener);
|
||||
server.addWebApplication("/" + getContextName() , getDeployPath());
|
||||
server.start();
|
||||
logger.error("1232221231");
|
||||
}
|
||||
|
||||
protected int getPort() {
|
||||
|
|
|
|||
|
|
@ -41,21 +41,21 @@ public class DefaultImageFileManager extends DefaultBaseManager implements Image
|
|||
|
||||
commonDao.store(item);
|
||||
}else {
|
||||
throw new BusinessException("请选择文件!");
|
||||
throw new BusinessException("璇烽<EFBFBD>夋嫨鏂囦欢锛<EFBFBD>");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
LocalizedMessage.addLocalizedMessage("上传成功");
|
||||
LocalizedMessage.addLocalizedMessage("涓婁紶鎴愬姛");
|
||||
}
|
||||
|
||||
public <T extends Entity> void importImageFile(Long id, File file,
|
||||
String imageType, String objectType ,String strExtend1){
|
||||
SignFile imageFile = (SignFile) EntityFactory.getEntity(SignFile.class);
|
||||
/*String fileURL=file.getPath();
|
||||
//截取admin前面的字符串内容
|
||||
//鎴彇admin鍓嶉潰鐨勫瓧绗︿覆鍐呭
|
||||
String str=fileURL.substring(1, fileURL.indexOf("admin"));
|
||||
//截取admin后的字符串内容
|
||||
//鎴彇admin鍚庣殑瀛楃涓插唴瀹<EFBFBD>
|
||||
String bb=fileURL.substring(str.length()+1, fileURL.length());
|
||||
String str2=bb.substring(0, bb.indexOf("-"));
|
||||
String bb2=bb.substring(str2.length()+1, bb.length());
|
||||
|
|
@ -69,28 +69,28 @@ public class DefaultImageFileManager extends DefaultBaseManager implements Image
|
|||
date = new Date();
|
||||
}
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
File file2 = new File("C:/tomcat-8080/webapps/zwwms/images/zw/imageTarget/");// 存放生成的图片的目标文件夹
|
||||
File file2 = new File("C:/tomcat-8080/webapps/zwwms/images/zw/imageTarget/");// 瀛樻斁鐢熸垚鐨勫浘鐗囩殑鐩爣鏂囦欢澶<EFBFBD>
|
||||
if (!file2.exists()) {
|
||||
file2.mkdirs();
|
||||
}
|
||||
try {
|
||||
FileInputStream in = new FileInputStream(file);// 定义文件输入流
|
||||
FileInputStream in = new FileInputStream(file);// 瀹氫箟鏂囦欢杈撳叆娴<EFBFBD>
|
||||
|
||||
MultipartFile multipartFile = new MockMultipartFile(file.getName(),file.getName(),ContentType.APPLICATION_OCTET_STREAM.toString(),in);
|
||||
byte[] bytes = PicUtils.compressPicForScale(multipartFile.getBytes(), 120);
|
||||
File fOut = new File("C:/tomcat-8080/webapps/zwwms/images/zw/imageTarget/"+ fileName);
|
||||
|
||||
BufferedInputStream bin = new BufferedInputStream(in);
|
||||
FileOutputStream out = new FileOutputStream(fOut);// 定义文件输出流
|
||||
FileOutputStream out = new FileOutputStream(fOut);// 瀹氫箟鏂囦欢杈撳嚭娴<EFBFBD>
|
||||
out.write(bytes);
|
||||
bin.close();
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
throw new BusinessException("文件上传出错!");
|
||||
throw new BusinessException("鏂囦欢涓婁紶鍑洪敊!");
|
||||
}
|
||||
if (file != null) {
|
||||
imageFile.setFileName(fileName);
|
||||
imageFile.processFileUrl(fileName);// 生成带img标签的目标图片的url地址
|
||||
imageFile.processFileUrl(fileName);// 鐢熸垚甯mg鏍囩鐨勭洰鏍囧浘鐗囩殑url鍦板潃
|
||||
imageFile.setImageType(imageType);
|
||||
imageFile.setObjectType(objectType);
|
||||
imageFile.setOperate(UserHolder.getUser().getName());
|
||||
|
|
@ -108,7 +108,7 @@ public class DefaultImageFileManager extends DefaultBaseManager implements Image
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取文件的文件扩展名如:.jpg
|
||||
* 鑾峰彇鏂囦欢鐨勬枃浠舵墿灞曞悕濡傦細.jpg
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
|
|
@ -121,7 +121,7 @@ public class DefaultImageFileManager extends DefaultBaseManager implements Image
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取图片名称的后缀:一个6位的随机数
|
||||
* 鑾峰彇鍥剧墖鍚嶇О鐨勫悗缂<EFBFBD>:涓<EFBFBD>涓紪浣嶇殑闅忔満鏁<EFBFBD>
|
||||
*
|
||||
* @author dev
|
||||
* @param order
|
||||
|
|
@ -133,11 +133,11 @@ public class DefaultImageFileManager extends DefaultBaseManager implements Image
|
|||
}
|
||||
|
||||
/**
|
||||
* 将临时文件转换成图片
|
||||
* 灏嗕复鏃舵枃浠惰浆鎹㈡垚鍥剧墖
|
||||
*
|
||||
* @author dev
|
||||
* @param file
|
||||
* @param 进仓编号或者预配编号
|
||||
* @param 杩涗粨缂栧彿鎴栬<EFBFBD>呴閰嶇紪鍙<EFBFBD>
|
||||
*/
|
||||
private void createFile(File file, String fileName, String code) {
|
||||
Calendar date = Calendar.getInstance();
|
||||
|
|
@ -145,15 +145,15 @@ public class DefaultImageFileManager extends DefaultBaseManager implements Image
|
|||
|
||||
String dateString = format.format(date.getTime());
|
||||
|
||||
// 判断待存放图片的目录文件夹是否存在,如果不存在新建一个
|
||||
// 鍒ゆ柇寰呭瓨鏀惧浘鐗囩殑鐩綍鏂囦欢澶规槸鍚﹀瓨鍦<EFBFBD>,濡傛灉涓嶅瓨鍦ㄦ柊寤轰竴涓<E7ABB4>
|
||||
File file1 = new File(
|
||||
GlobalParamUtils.getGloableStringValue("tempFileDir"));// 源文件存放的临时文件夹
|
||||
GlobalParamUtils.getGloableStringValue("tempFileDir"));// 婧愭枃浠跺瓨鏀剧殑涓存椂鏂囦欢澶<EFBFBD>
|
||||
if (!file1.exists()) {
|
||||
throw new BusinessException("tempFile.not.exists");
|
||||
}
|
||||
File file2 = new File(
|
||||
// GlobalParamUtils.getGloableStringValue("imageTarget")+dateString+"\\"+code+"\\");
|
||||
GlobalParamUtils.getGloableStringValue("imageTarget"));// 存放生成的图片的目标文件夹
|
||||
GlobalParamUtils.getGloableStringValue("imageTarget"));// 瀛樻斁鐢熸垚鐨勫浘鐗囩殑鐩爣鏂囦欢澶<EFBFBD>
|
||||
if (!file2.exists()) {
|
||||
file2.mkdirs();
|
||||
}
|
||||
|
|
@ -165,42 +165,42 @@ public class DefaultImageFileManager extends DefaultBaseManager implements Image
|
|||
File outputFile = new File(
|
||||
GlobalParamUtils.getGloableStringValue("imageTarget")
|
||||
+ fileName);
|
||||
FileInputStream in = new FileInputStream(file);// 定义文件输入流
|
||||
BufferedInputStream bin = new BufferedInputStream(in);// 将文件输入流构造到缓存中
|
||||
FileOutputStream out = new FileOutputStream(outputFile);// 定义文件输出流
|
||||
BufferedOutputStream bout = new BufferedOutputStream(out);// 将文件输出流构造到缓存中
|
||||
FileInputStream in = new FileInputStream(file);// 瀹氫箟鏂囦欢杈撳叆娴<EFBFBD>
|
||||
BufferedInputStream bin = new BufferedInputStream(in);// 灏嗘枃浠惰緭鍏ユ祦鏋勯<EFBFBD>犲埌缂撳瓨涓<EFBFBD>
|
||||
FileOutputStream out = new FileOutputStream(outputFile);// 瀹氫箟鏂囦欢杈撳嚭娴<EFBFBD>
|
||||
BufferedOutputStream bout = new BufferedOutputStream(out);// 灏嗘枃浠惰緭鍑烘祦鏋勯<EFBFBD>犲埌缂撳瓨涓<EFBFBD>
|
||||
int i;
|
||||
while ((i = bin.read()) != -1) {
|
||||
bout.write(i);
|
||||
}
|
||||
bin.close();
|
||||
bout.close();// 关闭输入输出流,释放资源
|
||||
bout.close();// 鍏抽棴杈撳叆杈撳嚭娴侊紝閲婃斁璧勬簮
|
||||
} catch (IOException e) {
|
||||
throw new BusinessException("IO.error");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将临时文件共享到指定目录
|
||||
* 灏嗕复鏃舵枃浠跺叡浜埌鎸囧畾鐩綍
|
||||
*
|
||||
* @author dev
|
||||
* @param file
|
||||
* @param 箱号或进仓编号
|
||||
* ,进仓时间或箱子进场时间
|
||||
* @param 绠卞彿鎴栬繘浠撶紪鍙<EFBFBD>
|
||||
* 锛岃繘浠撴椂闂存垨绠卞瓙杩涘満鏃堕棿
|
||||
*/
|
||||
private void createShareFile(File file, String date, String code,
|
||||
String fileName) {
|
||||
|
||||
// 判断待存放图片的目录文件夹是否存在,如果不存在新建一个
|
||||
// 鍒ゆ柇寰呭瓨鏀惧浘鐗囩殑鐩綍鏂囦欢澶规槸鍚﹀瓨鍦<EFBFBD>,濡傛灉涓嶅瓨鍦ㄦ柊寤轰竴涓<E7ABB4>
|
||||
/*
|
||||
* File file1 = new File(
|
||||
* GlobalParamUtils.getGloableStringValue("tempFileDir"));// 源文件存放的临时文件夹
|
||||
* GlobalParamUtils.getGloableStringValue("tempFileDir"));// 婧愭枃浠跺瓨鏀剧殑涓存椂鏂囦欢澶<EFBFBD>
|
||||
* if (!file1.exists()) { throw new
|
||||
* BusinessException("tempFile.not.exists"); }
|
||||
*/
|
||||
File file2 = new File("d:\\picture\\" + date + "\\" + code + "\\");
|
||||
// GlobalParamUtils.getGloableStringValue("imageTarget"));//
|
||||
// 存放生成的图片的目标文件夹
|
||||
// 瀛樻斁鐢熸垚鐨勫浘鐗囩殑鐩爣鏂囦欢澶<EFBFBD>
|
||||
if (!file2.exists()) {
|
||||
file2.mkdirs();
|
||||
}
|
||||
|
|
@ -213,23 +213,23 @@ public class DefaultImageFileManager extends DefaultBaseManager implements Image
|
|||
* GlobalParamUtils.getGloableStringValue("imageTarget") +
|
||||
* fileName);
|
||||
*/
|
||||
FileInputStream in = new FileInputStream(file);// 定义文件输入流
|
||||
BufferedInputStream bin = new BufferedInputStream(in);// 将文件输入流构造到缓存中
|
||||
FileOutputStream out = new FileOutputStream(outputFile);// 定义文件输出流
|
||||
BufferedOutputStream bout = new BufferedOutputStream(out);// 将文件输出流构造到缓存中
|
||||
FileInputStream in = new FileInputStream(file);// 瀹氫箟鏂囦欢杈撳叆娴<EFBFBD>
|
||||
BufferedInputStream bin = new BufferedInputStream(in);// 灏嗘枃浠惰緭鍏ユ祦鏋勯<EFBFBD>犲埌缂撳瓨涓<EFBFBD>
|
||||
FileOutputStream out = new FileOutputStream(outputFile);// 瀹氫箟鏂囦欢杈撳嚭娴<EFBFBD>
|
||||
BufferedOutputStream bout = new BufferedOutputStream(out);// 灏嗘枃浠惰緭鍑烘祦鏋勯<EFBFBD>犲埌缂撳瓨涓<EFBFBD>
|
||||
int i;
|
||||
while ((i = bin.read()) != -1) {
|
||||
bout.write(i);
|
||||
}
|
||||
bin.close();
|
||||
bout.close();// 关闭输入输出流,释放资源
|
||||
bout.close();// 鍏抽棴杈撳叆杈撳嚭娴侊紝閲婃斁璧勬簮
|
||||
} catch (IOException e) {
|
||||
throw new BusinessException("IO.error");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图片存放目录的路径
|
||||
* 鑾峰彇鍥剧墖瀛樻斁鐩綍鐨勮矾寰<EFBFBD>
|
||||
*
|
||||
* @author dev
|
||||
* @param buffer
|
||||
|
|
@ -244,7 +244,7 @@ public class DefaultImageFileManager extends DefaultBaseManager implements Image
|
|||
String fileSite = GlobalParamUtils.getGloableStringValue("imageTarget");
|
||||
// String fileSite =
|
||||
// GlobalParamUtils.getGloableStringValue("imageTarget")+dateString+"\\"+code+"\\";
|
||||
// 目标文件夹存放的路径
|
||||
// 鐩爣鏂囦欢澶瑰瓨鏀剧殑璺緞
|
||||
buffer.append(fileSite + fileName);
|
||||
}
|
||||
|
||||
|
|
@ -255,9 +255,9 @@ public class DefaultImageFileManager extends DefaultBaseManager implements Image
|
|||
if (signFile != null) {
|
||||
commonDao.delete(signFile);
|
||||
} else {
|
||||
throw new BusinessException("待删除文件不存在!");
|
||||
throw new BusinessException("寰呭垹闄ゆ枃浠朵笉瀛樺湪锛<EFBFBD>");
|
||||
}
|
||||
// 删除对应的图片资料
|
||||
// 鍒犻櫎瀵瑰簲鐨勫浘鐗囪祫鏂<EFBFBD>
|
||||
String fileUrl = GlobalParamUtils
|
||||
.getGloableStringValue("imageTarget")
|
||||
+ signFile.getFileName();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.dev.swms.server.web.servlet;
|
||||
|
||||
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
|
@ -21,6 +23,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.hibernate.Session;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
|
@ -81,7 +84,7 @@ import net.sf.json.JSONObject;
|
|||
*/
|
||||
public class ASNReceiveServlet extends HttpServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static Logger logger = Logger.getLogger(ASNReceiveServlet.class);
|
||||
protected static ApplicationContext ac;
|
||||
/**
|
||||
* @see HttpServlet#HttpServlet()
|
||||
|
|
@ -107,7 +110,7 @@ public class ASNReceiveServlet extends HttpServlet {
|
|||
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
*/
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
System.out.println("==========ASNReceiveServlet========"+new Date());
|
||||
logger.info("==========ASNReceiveServlet========"+new Date());
|
||||
CommonDao commonDao = (CommonDao) ac.getBean("commonDao");
|
||||
request.setCharacterEncoding("utf-8");
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream(),"utf-8"));//post方式传递读取字符流
|
||||
|
|
@ -120,7 +123,7 @@ public class ASNReceiveServlet extends HttpServlet {
|
|||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("result:"+result.toString());
|
||||
logger.info("result:"+result.toString());
|
||||
JSONObject json= JSONObject.fromObject(result.toString());
|
||||
QueryAppManager app = (QueryAppManager) ac.getBean("queryAppManager");
|
||||
String methodType =json.has("methodType")?json.getString("methodType"):"";
|
||||
|
|
@ -460,7 +463,7 @@ public class ASNReceiveServlet extends HttpServlet {
|
|||
sid="0";
|
||||
}
|
||||
long s_id = Long.parseLong(sid);
|
||||
System.out.println(location_id);
|
||||
logger.info(location_id);
|
||||
if(location_id==null||location_id.equals("")||location_id.equals("\"null\"")) {
|
||||
location_id="0";
|
||||
}
|
||||
|
|
@ -816,7 +819,7 @@ public class ASNReceiveServlet extends HttpServlet {
|
|||
resultJson=exitLoginPC(mac, accountType, commonDao);
|
||||
}
|
||||
|
||||
System.out.println("======"+resultJson.toString());
|
||||
logger.info("======"+resultJson.toString());
|
||||
PrintWriter out = null;
|
||||
try {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import javax.servlet.http.HttpServlet;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
|
||||
|
|
@ -50,7 +51,7 @@ import net.sf.json.JSONObject;
|
|||
*/
|
||||
public class MoveServlet extends HttpServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static Logger logger = Logger.getLogger(MoveServlet.class);
|
||||
protected static ApplicationContext ac;
|
||||
/**
|
||||
* @see HttpServlet#HttpServlet()
|
||||
|
|
@ -77,7 +78,7 @@ public class MoveServlet extends HttpServlet {
|
|||
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
*/
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
System.out.println("==========app移位========"+new Date());
|
||||
logger.info("==========app移位========"+new Date());
|
||||
CommonDao commonDao = (CommonDao) ac.getBean("commonDao");
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream(),"UTF-8"));//post方式传递读取字符流
|
||||
|
|
@ -90,7 +91,7 @@ public class MoveServlet extends HttpServlet {
|
|||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("result:"+result.toString());
|
||||
logger.info("result:"+result.toString());
|
||||
JSONObject json= JSONObject.fromObject(result.toString());
|
||||
QueryAppManager app = (QueryAppManager) ac.getBean("queryAppManager");
|
||||
String methodType =json.has("methodType")?json.getString("methodType"):"";
|
||||
|
|
@ -153,7 +154,7 @@ public class MoveServlet extends HttpServlet {
|
|||
response.setCharacterEncoding("UTF-8");
|
||||
out = response.getWriter();
|
||||
out.print(resultJson.toString());
|
||||
System.out.println(resultJson.toString());
|
||||
logger.info(resultJson.toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
package com.dev.swms.server.web.servlet;
|
||||
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
|
@ -17,6 +19,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.hibernate.Session;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
|
|
@ -61,7 +64,7 @@ import com.dev.swms.server.web.filter.WarehouseHolder;
|
|||
*/
|
||||
public class PickingServlet extends HttpServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static Logger logger = Logger.getLogger(PickingServlet.class);
|
||||
protected static ApplicationContext ac;
|
||||
/**
|
||||
* @see HttpServlet#HttpServlet()
|
||||
|
|
@ -88,7 +91,7 @@ public class PickingServlet extends HttpServlet {
|
|||
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
*/
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
System.out.println("==========app出库========"+new Date());
|
||||
logger.info("==========app出库========"+new Date());
|
||||
CommonDao commonDao = (CommonDao) ac.getBean("commonDao");
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream(),"UTF-8"));//post方式传递读取字符流
|
||||
|
|
@ -101,7 +104,7 @@ public class PickingServlet extends HttpServlet {
|
|||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("result:"+result.toString());
|
||||
logger.info("result:"+result.toString());
|
||||
JSONObject json= JSONObject.fromObject(result.toString());
|
||||
QueryAppManager app = (QueryAppManager) ac.getBean("queryAppManager");
|
||||
String methodType =json.has("methodType")?json.getString("methodType"):"";
|
||||
|
|
@ -232,7 +235,7 @@ public class PickingServlet extends HttpServlet {
|
|||
resultJson=this.printLocationCode(location_code,workerId, wId);
|
||||
}
|
||||
|
||||
System.out.println("======"+resultJson.toString());
|
||||
logger.info("======"+resultJson.toString());
|
||||
PrintWriter out = null;
|
||||
try {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
|
|
|
|||
Loading…
Reference in New Issue