|
@@ -16,12 +16,14 @@ import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsHeader;
|
|
|
import com.kingdee.shr.base.syssetting.context.SHRContext;
|
|
import com.kingdee.shr.base.syssetting.context.SHRContext;
|
|
|
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
|
|
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
|
|
|
import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
|
|
import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
|
|
|
|
|
+import com.kingdee.shr.base.syssetting.ml.SHRWebResource;
|
|
|
import com.kingdee.util.StringUtils;
|
|
import com.kingdee.util.StringUtils;
|
|
|
import org.apache.log4j.Logger;
|
|
import org.apache.log4j.Logger;
|
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.util.Enumeration;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -37,12 +39,48 @@ public class EmployeeListHandlerEx extends EmployeeListHandler {
|
|
|
public void syncPersonToOAAction(HttpServletRequest request,
|
|
public void syncPersonToOAAction(HttpServletRequest request,
|
|
|
HttpServletResponse response,
|
|
HttpServletResponse response,
|
|
|
ModelMap modelMap) throws BOSException, EASBizException, SHRWebException {
|
|
ModelMap modelMap) throws BOSException, EASBizException, SHRWebException {
|
|
|
|
|
+ Enumeration<String> headerNames = request.getHeaderNames();
|
|
|
|
|
+ while (headerNames.hasMoreElements()) {
|
|
|
|
|
+ String headerName = headerNames.nextElement();
|
|
|
|
|
+ String headerValue = request.getHeader(headerName);
|
|
|
|
|
+ logger.error("----headerNames------key¡¾" + headerName + "¡¿-value¡¾ " + headerValue + "¡¿");
|
|
|
|
|
+ }
|
|
|
|
|
+ Enumeration enu = request.getParameterNames();
|
|
|
|
|
+ while (enu.hasMoreElements()) {
|
|
|
|
|
+ String paraName = (String) enu.nextElement();
|
|
|
|
|
+ logger.error("----ParameterNames------key¡¾" + paraName + "¡¿-value¡¾ " + request.getParameter(paraName) + "¡¿");
|
|
|
|
|
+ }
|
|
|
|
|
+ //String billId = request.getParameter("billId[]");
|
|
|
|
|
+ ////}
|
|
|
|
|
+ //if (StringUtils.isEmpty(billId)) {
|
|
|
|
|
+ // billId = (String) request.getAttribute("billId[]");
|
|
|
|
|
+ //}
|
|
|
|
|
+ //if (StringUtils.isEmpty(billId)) {
|
|
|
|
|
+ // billId = request.getParameter("billIds[]");
|
|
|
|
|
+ //}
|
|
|
|
|
+ //if (StringUtils.isEmpty(billId)) {
|
|
|
|
|
+ // billId = (String) request.getAttribute("billIds[]");
|
|
|
|
|
+ //}
|
|
|
|
|
+ //logger.error("----headerNames------billId----" + billId);
|
|
|
|
|
+
|
|
|
this.handleEnableWithTips(request, "");
|
|
this.handleEnableWithTips(request, "");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void handleEnableWithTips(HttpServletRequest request, String methodName) throws SHRWebException {
|
|
protected void handleEnableWithTips(HttpServletRequest request, String methodName) throws SHRWebException {
|
|
|
- String billId = this.getBillId(request);
|
|
|
|
|
|
|
+ //String billId = this.getBillId(request);
|
|
|
|
|
+ //if (StringUtils.isEmpty(billId)) {
|
|
|
|
|
+ String billId = request.getParameter("billId");
|
|
|
|
|
+ //}
|
|
|
|
|
+ if (StringUtils.isEmpty(billId)) {
|
|
|
|
|
+ billId = (String) request.getAttribute("billId");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isEmpty(billId)) {
|
|
|
|
|
+ billId = request.getParameter("billIds[]");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isEmpty(billId)) {
|
|
|
|
|
+ billId = (String) request.getAttribute("billId[]");
|
|
|
|
|
+ }
|
|
|
try {
|
|
try {
|
|
|
IPerson iPerson = PersonFactory.getLocalInstance(ctx);
|
|
IPerson iPerson = PersonFactory.getLocalInstance(ctx);
|
|
|
if (StringUtils.isEmpty(billId)) {
|
|
if (StringUtils.isEmpty(billId)) {
|
|
@@ -55,7 +93,9 @@ public class EmployeeListHandlerEx extends EmployeeListHandler {
|
|
|
sb.deleteCharAt(sb.lastIndexOf(","));
|
|
sb.deleteCharAt(sb.lastIndexOf(","));
|
|
|
}
|
|
}
|
|
|
Map<String, Map<String, String>> resultMap = SyncTranForOAFacadeFactory.getLocalInstance(ctx).syncPersonToOA(billId, null);
|
|
Map<String, Map<String, String>> resultMap = SyncTranForOAFacadeFactory.getLocalInstance(ctx).syncPersonToOA(billId, null);
|
|
|
- if (resultMap != null && resultMap.isEmpty()) {
|
|
|
|
|
|
|
+ logger.error("handleEnableWithTips----- resultMap----" + resultMap);
|
|
|
|
|
+ if (resultMap != null && !resultMap.isEmpty()) {
|
|
|
|
|
+ logger.error("handleEnableWithTips----- start ");
|
|
|
PersonCollection personCollection = iPerson.getPersonCollection("select id,number where id in (" + AtsUtil.getStrFromString(billId) + ")");
|
|
PersonCollection personCollection = iPerson.getPersonCollection("select id,number where id in (" + AtsUtil.getStrFromString(billId) + ")");
|
|
|
int sucess = 0;
|
|
int sucess = 0;
|
|
|
int failure = 0;
|
|
int failure = 0;
|
|
@@ -68,6 +108,8 @@ public class EmployeeListHandlerEx extends EmployeeListHandler {
|
|
|
Map<String, String> map = resultMap.get(personNumber);
|
|
Map<String, String> map = resultMap.get(personNumber);
|
|
|
if ("success".equals(map.get("state"))) {
|
|
if ("success".equals(map.get("state"))) {
|
|
|
++sucess;
|
|
++sucess;
|
|
|
|
|
+ body.setMuitTipsState(Boolean.TRUE);
|
|
|
|
|
+ body.setMuitTipsMessage(map.get("msg"));
|
|
|
} else {
|
|
} else {
|
|
|
++failure;
|
|
++failure;
|
|
|
body.setMuitTipsState(Boolean.FALSE);
|
|
body.setMuitTipsState(Boolean.FALSE);
|
|
@@ -75,11 +117,15 @@ public class EmployeeListHandlerEx extends EmployeeListHandler {
|
|
|
}
|
|
}
|
|
|
batchMessageTipsHeader.addResult(body);
|
|
batchMessageTipsHeader.addResult(body);
|
|
|
}
|
|
}
|
|
|
|
|
+ logger.error("handleEnableWithTips----- >> ");
|
|
|
batchMessageTipsHeader.setBillId(billId);
|
|
batchMessageTipsHeader.setBillId(billId);
|
|
|
batchMessageTipsHeader.setFailureCount(failure);
|
|
batchMessageTipsHeader.setFailureCount(failure);
|
|
|
batchMessageTipsHeader.setSuccessCount(sucess);
|
|
batchMessageTipsHeader.setSuccessCount(sucess);
|
|
|
|
|
+ logger.error("batchMessageTipsHeader " + batchMessageTipsHeader.getSuccessCount());
|
|
|
request.setAttribute("res_method_data", batchMessageTipsHeader);
|
|
request.setAttribute("res_method_data", batchMessageTipsHeader);
|
|
|
this.writeSuccessData(batchMessageTipsHeader);
|
|
this.writeSuccessData(batchMessageTipsHeader);
|
|
|
|
|
+ logger.error("handleEnableWithTips----- end ");
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|