Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/action/RecyclingApplicationAction.java =================================================================== diff -u -r20787 -r20788 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/action/RecyclingApplicationAction.java (.../RecyclingApplicationAction.java) (revision 20787) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/action/RecyclingApplicationAction.java (.../RecyclingApplicationAction.java) (revision 20788) @@ -359,10 +359,7 @@ */ private JSONObject saveRecyclingApplication(RecyclingApplication application, Collection newTousseItemVoList) { - try { - HttpServletResponse response = StrutsParamUtils.getResponse(); - response.setCharacterEncoding("UTF-8"); - + try { //校验申请的物品(器械包)能否被所选处理科室(供应室)处理以及申请的科室能否被所选处理科室(供应室)服务 JSONObject jsonObject = tousseDefinitionManager.validateRecyclingApplicationCssdPrivilege(application, newTousseItemVoList); @@ -387,7 +384,7 @@ SupplyRoomConfig cssd = supplyRoomConfigManager.getFirstSupplyRoomConfig(); if (committedStatus && !StringTools.equals(code, cssd.getOrgUnitCoding()) && application.readed()) { - outPrint(response, "该申请单已被阅读过,不能修改。如果需要修改,请联系管理员!"); + StrutsResponseUtils.output(true, "该申请单已被阅读过,不能修改。如果需要修改,请联系管理员!"); return null; } @@ -431,26 +428,13 @@ catch(RecyclingRecordException e){ message = e.getMessage(); } - - outPrint(response, message); - + StrutsResponseUtils.output(true, message); } catch (Exception e) { e.printStackTrace(); } return null; } - private void outPrint(HttpServletResponse response, String message) { - PrintWriter out; - try { - out = response.getWriter(); - out.print("{success:true,message:'" + message + "'}"); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - // 取物品名称及数量 private Map convertVosToMap(Collection vos) { Map applyTousses = new HashMap<>(); @@ -631,10 +615,7 @@ message = "提交失败。" + ex.getMessage(); // message = "提交失败。"; } - - HttpServletResponse response = StrutsParamUtils.getResponse(); - response.setCharacterEncoding("UTF-8"); - outPrint(response, message); + StrutsResponseUtils.output(true, message); } /**