87,914
社区成员
发帖
与我相关
我的任务
分享
public ActionForward checkIdentityUnique(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
response.setContentType("text/plain;charset=GBK");
response.setCharacterEncoding("GBK");
StringBuffer sb = new StringBuffer();
if(request.getParameter("identity")!=null && request.getParameter("real")!=null){
String identity=request.getParameter("identity").trim();
String real=request.getParameter("real").trim();
if(UtilCollection.hasValue(identity) && UtilCollection.hasValue("real")){
DispatchEmployee dispatch=dispatchService.displayDispatchEmployeeByCard(identity);
if(dispatch!=null){
String coString=new String(real.getBytes("ISO-8859-1"),"UTF-8");
if(dispatch.getRealname().toLowerCase().equals(coString.toLowerCase())){
sb.append("您录入派谴员工已经存在.请重新确认");
}else{sb.append("您录入的派谴员工可能存在争议状态!");}
}else{sb.append("该身份证号码通过了唯一性验证 :)");}
}else{sb.append("验证身份证的唯一性需要的参数得不到满足");}
}else{sb.append("动态验证派谴员工的身份证无法继续");}
response.getWriter().print(sb.toString());
return null;
}