86f7cb1c21524fd44a109bbffb4d953c88020e3a.svn-base 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package com.kingdee.shr.ats.web.handler;
  2. import javax.servlet.http.HttpServletRequest;
  3. import javax.servlet.http.HttpServletResponse;
  4. import org.apache.commons.lang3.StringUtils;
  5. import org.apache.log4j.Logger;
  6. import org.springframework.ui.ModelMap;
  7. import com.kingdee.bos.BOSException;
  8. import com.kingdee.bos.Context;
  9. import com.kingdee.eas.common.EASBizException;
  10. import com.kingdee.eas.framework.CoreBaseInfo;
  11. import com.kingdee.eas.hr.ats.AtsLeaveBillCollection;
  12. import com.kingdee.eas.hr.ats.AtsLeaveBillFactory;
  13. import com.kingdee.eas.hr.ats.AtsLeaveBillInfo;
  14. import com.kingdee.shr.ats.web.handler.util.AtsLeaveBillOperationUtil;
  15. import com.kingdee.shr.base.syssetting.context.SHRContext;
  16. import com.kingdee.shr.base.syssetting.exception.SHRWebException;
  17. public class AtsLeaveBillListHandlerEx extends AtsLeaveBillListHandler{
  18. private static Logger logger =
  19. Logger.getLogger("com.kingdee.shr.ats.web.handler.AtsLeaveBillListHandlerEx");
  20. /**
  21. * 提交工作流
  22. */
  23. @Override
  24. protected void doBeforeSubmitForWF(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model) {
  25. // TODO 自动生成的方法存根
  26. logger.info("AtsLeaveBillListHandlerEx.....doBeforeSubmitForWF...start");
  27. super.doBeforeSubmitForWF(request, response, model);
  28. try {
  29. Context ctx = SHRContext.getInstance().getContext();
  30. AtsLeaveBillInfo info=(AtsLeaveBillInfo)model;
  31. AtsLeaveBillCollection atsCollection = AtsLeaveBillFactory.getLocalInstance(ctx).getAtsLeaveBillCollection(" where id='" + info.getId().toString() + "'");
  32. if(atsCollection !=null && atsCollection.size()>0) {
  33. for (int i = 0; i < atsCollection.size(); ++i) {
  34. AtsLeaveBillInfo atsLeaveBillInfo = atsCollection.get(i);
  35. logger.info("AtsLeaveBillListHandlerEx.....number..."+atsLeaveBillInfo.getNumber());
  36. logger.info("AtsLeaveBillListHandlerEx.....BillID..."+atsLeaveBillInfo.getId().toString());
  37. //先删除拆分数据
  38. String billFormatter = "('" + atsLeaveBillInfo.getId().toString() + "')";
  39. AtsLeaveBillOperationUtil.deleteInfo(ctx, billFormatter);
  40. //审批中的数据存入拆分表
  41. AtsLeaveBillOperationUtil.saveInfo(ctx, atsLeaveBillInfo);
  42. }
  43. }
  44. logger.info("AtsLeaveBillListHandlerEx.....doBeforeSubmitForWF...end");
  45. }catch(Exception e) {
  46. }
  47. }
  48. /**
  49. * 撤销方法
  50. */
  51. @Override
  52. public void abortBillAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
  53. throws SHRWebException, EASBizException, BOSException {
  54. // TODO 自动生成的方法存根
  55. logger.info("AtsLeaveBillListHandlerEx.....abortBillAction...start");
  56. super.abortBillAction(request, response, modelMap);
  57. Context ctx = SHRContext.getInstance().getContext();
  58. String billId = request.getParameter("billId");
  59. if(StringUtils.isNotBlank(billId)) {
  60. String billFormatter = "('" + billId.replaceAll(",", "','") + "')";
  61. AtsLeaveBillOperationUtil.deleteInfo(ctx, billFormatter);
  62. }
  63. logger.info("AtsLeaveBillListHandlerEx.....abortBillAction...start");
  64. }
  65. /**
  66. * 反审核
  67. */
  68. @Override
  69. public void againstApproveAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
  70. throws SHRWebException {
  71. logger.info("AtsLeaveBillListHandlerEx.....againstApproveAction...start");
  72. // TODO 自动生成的方法存根
  73. super.againstApproveAction(request, response, modelMap);
  74. String billId = request.getParameter("billId");
  75. Context ctx = SHRContext.getInstance().getContext();
  76. if(StringUtils.isNotBlank(billId)) {
  77. String billFormatter = "('" + billId.replaceAll(",", "','") + "')";
  78. AtsLeaveBillOperationUtil.deleteInfo(ctx, billFormatter);
  79. }
  80. }
  81. }