Index: ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/stdxyxyfszlyy/OrgUserDataWebServiceManagerImpl.java =================================================================== diff -u -r25045 -r25189 --- ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/stdxyxyfszlyy/OrgUserDataWebServiceManagerImpl.java (.../OrgUserDataWebServiceManagerImpl.java) (revision 25045) +++ ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/stdxyxyfszlyy/OrgUserDataWebServiceManagerImpl.java (.../OrgUserDataWebServiceManagerImpl.java) (revision 25189) @@ -4,6 +4,7 @@ import javax.jws.WebParam; import javax.jws.WebService; +import net.sf.json.JSONArray; import net.sf.json.JSONObject; import net.sf.json.xml.XMLSerializer; @@ -165,7 +166,15 @@ vo.setDeptName(jsonObject.optString("dept_name")); vo.setParentCoding(jsonObject.optString("super_code")); }else{ - vo.setDeptCode(jsonObject.optJSONArray("whereBean").optString(0)); + Object whereBean = jsonObject.opt("whereBean"); + if(whereBean instanceof JSONArray){ + vo.setDeptCode(jsonObject.optJSONArray("whereBean").optString(0)); + }else if(whereBean instanceof JSONObject){ + vo.setDeptCode(jsonObject.optJSONObject("whereBean").optString("dept_code")); + }else{ + return constructReturnValue(DATATYPE_EMPLOYEE, jsonObject.optString("messageId"), + jsonObject.optString("businessTime"), "", RESULT_CODE_FAILURE, "未找到科室编码参数"); + } vo.setDeptName(jsonObject.optJSONObject("setBean").optString("dept_name")); vo.setParentCoding(jsonObject.optJSONObject("setBean").optString("super_code")); } @@ -177,6 +186,7 @@ return constructReturnValue(DATATYPE_EMPLOYEE, jsonObject.optString("messageId"), jsonObject.optString("businessTime"), String.valueOf(orgUnit.getId()), RESULT_CODE_SUCCESS, "成功"); }catch(Exception e){ + e.printStackTrace(); if(jsonObject == null){ return constructReturnValue(DATATYPE_EMPLOYEE, "", "", "", RESULT_CODE_FAILURE, "message数据格式错误"); @@ -197,7 +207,15 @@ vo.setName(jsonObject.optString("emp_name")); vo.setDeptCode(jsonObject.optString("dept_code")); }else{ - vo.setCoding(jsonObject.optJSONArray("whereBean").optString(0)); + Object whereBean = jsonObject.opt("whereBean"); + if(whereBean instanceof JSONArray){ + vo.setCoding(jsonObject.optJSONArray("whereBean").optString(0)); + }else if(whereBean instanceof JSONObject){ + vo.setCoding(jsonObject.optJSONObject("whereBean").optString("emp_code")); + }else{ + return constructReturnValue(DATATYPE_EMPLOYEE, jsonObject.optString("messageId"), + jsonObject.optString("businessTime"), "", RESULT_CODE_FAILURE, "未找到人员工号参数"); + } vo.setName(jsonObject.optJSONObject("setBean").optString("emp_name")); vo.setDeptCode(jsonObject.optJSONObject("setBean").optString("dept_code")); } @@ -209,6 +227,7 @@ return constructReturnValue(DATATYPE_EMPLOYEE, jsonObject.optString("messageId"), jsonObject.optString("businessTime"), String.valueOf(user.getId()), RESULT_CODE_SUCCESS, "成功"); }catch(Exception e){ + e.printStackTrace(); if(jsonObject == null){ return constructReturnValue(DATATYPE_EMPLOYEE, "", "", "", RESULT_CODE_FAILURE, "message数据格式错误");