AtsOverTimeBillBatchEditHandlerEx.java 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. package com.kingdee.eas.custom.ot.handler;
  2. import com.kingdee.bos.Context;
  3. import com.kingdee.eas.custom.ot.util.OverTimeAgainstApproveUtil;
  4. import com.kingdee.shr.ats.web.handler.AtsOverTimeBillBatchEditHandler;
  5. import com.kingdee.shr.base.syssetting.context.SHRContext;
  6. import com.kingdee.shr.base.syssetting.exception.SHRWebException;
  7. import org.springframework.ui.ModelMap;
  8. import javax.servlet.http.HttpServletRequest;
  9. import javax.servlet.http.HttpServletResponse;
  10. import java.util.Map;
  11. /**
  12. * 多人加班单审核通过的单据分录,删除、变更实现
  13. * @author lhbj
  14. */
  15. public class AtsOverTimeBillBatchEditHandlerEx extends AtsOverTimeBillBatchEditHandler {
  16. /**
  17. * 核通过的单据分录删除
  18. * @param request
  19. * @param response
  20. * @param modelMap
  21. * @return
  22. * @throws SHRWebException
  23. */
  24. public String deleteOTEntryAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
  25. try {
  26. Context ctx = SHRContext.getInstance().getContext();
  27. String billid = this.getBillId(request);
  28. String entryId = request.getParameter("entryId");
  29. OverTimeAgainstApproveUtil u = new OverTimeAgainstApproveUtil();
  30. Map<String, Object> map = u.deleteOTEntry(ctx, billid, entryId);
  31. System.out.println("deleteOTEntryAction:"+map);
  32. this.writeSuccessData(map);
  33. }catch (Exception e){
  34. e.printStackTrace();
  35. throw new SHRWebException(e);
  36. }
  37. return null;
  38. }
  39. /**
  40. * 核通过的单据分录变更
  41. * @param request
  42. * @param response
  43. * @param modelMap
  44. * @return
  45. * @throws SHRWebException
  46. */
  47. public String changeOTEntryAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
  48. try {
  49. Context ctx = SHRContext.getInstance().getContext();
  50. String billid = this.getBillId(request);
  51. String entryId = request.getParameter("entryId");
  52. OverTimeAgainstApproveUtil u = new OverTimeAgainstApproveUtil();
  53. Map<String, Object> map = u.changeOTEntry(ctx, billid, entryId);
  54. this.writeSuccessData(map);
  55. }catch (Exception e){
  56. e.printStackTrace();
  57. throw new SHRWebException(e);
  58. }
  59. return null;
  60. }
  61. /**
  62. * 取消核通过的单据分录变更
  63. * @param request
  64. * @param response
  65. * @param modelMap
  66. * @return
  67. * @throws SHRWebException
  68. */
  69. public String unChangeOTEntryAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
  70. try {
  71. Context ctx = SHRContext.getInstance().getContext();
  72. String billid = this.getBillId(request);
  73. String entryId = request.getParameter("entryId");
  74. OverTimeAgainstApproveUtil u = new OverTimeAgainstApproveUtil();
  75. Map<String, Object> map = u.unChangeOTEntry(ctx, billid, entryId);
  76. this.writeSuccessData(map);
  77. }catch (Exception e){
  78. e.printStackTrace();
  79. throw new SHRWebException(e);
  80. }
  81. return null;
  82. }
  83. }