Browse Source

把返回json里的占位符去掉

pancy 11 months ago
parent
commit
7576a4c17f

+ 6 - 3
mmpac/mmpac/src/private/u8c/impl/mmpac/mmpac/InvAddImpl.java

@@ -9,6 +9,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.transaction.UserTransaction;
 
+import org.apache.commons.lang.StringEscapeUtils;
+
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -299,11 +301,12 @@ public class InvAddImpl extends BaseServlet implements IHttpServletAdaptor{
 			}//异常时事务回滚
 			JSONArray errMessage = new JSONArray();
 			JSONObject returnobj = new JSONObject();
+			String emsg = e.getMessage().replace("\"", "\'");
 			errMessage.add(formatRSJsonData("失败",
-					e.getMessage(),"").toString());
+					emsg,""));
 			returnobj.put("info", "失败");
-			returnobj.put("errMessage", e.getMessage());
-			returnobj.put("result", errMessage);
+			returnobj.put("errMessage", emsg);
+			returnobj.put("result", errMessage);	
 			resp.getWriter().write(returnobj.toString());
 			NcLog.info(returnobj.toString());
 			return;

+ 4 - 3
mmpac/mmpac/src/private/u8c/impl/mmpac/mmpac/OrderAddImpl.java

@@ -221,11 +221,12 @@ public class OrderAddImpl extends BaseServlet implements IHttpServletAdaptor{
 			}//异常时事务回滚
 			JSONArray errMessage = new JSONArray();
 			JSONObject returnobj = new JSONObject();
+			String emsg = e.getMessage().replace("\"", "\'");
 			errMessage.add(formatRSJsonData("失败",
-					e.getMessage(),"").toString());
+					emsg,""));
 			returnobj.put("info", "失败");
-			returnobj.put("errMessage", e.getMessage());
-			returnobj.put("result", errMessage);
+			returnobj.put("errMessage", emsg);
+			returnobj.put("result", errMessage);	
 			resp.getWriter().write(returnobj.toString());
 			NcLog.info(returnobj.toString());
 			return;

+ 4 - 3
mmpac/mmpac/src/private/u8c/impl/mmpac/mmpac/SaleOrderAddImpl.java

@@ -355,11 +355,12 @@ public class SaleOrderAddImpl extends BaseServlet implements IHttpServletAdaptor
 		} catch (Exception e) {
 			JSONArray errMessage = new JSONArray();
 			JSONObject returnobj = new JSONObject();
+			String emsg = e.getMessage().replace("\"", "\'");
 			errMessage.add(formatRSJsonData("失败",
-					e.getMessage(),"").toString());
+					emsg,""));
 			returnobj.put("info", "失败");
-			returnobj.put("errMessage", e.getMessage());
-			returnobj.put("result", errMessage);
+			returnobj.put("errMessage", emsg);
+			returnobj.put("result", errMessage);	
 			resp.getWriter().write(returnobj.toString());
 			NcLog.info(returnobj.toString());
 			return;