package com.kingdee.eas.custom.ot.handler; import com.kingdee.bos.Context; import com.kingdee.eas.custom.ot.util.OverTimeAgainstApproveUtil; import com.kingdee.shr.ats.web.handler.AtsOverTimeBillBatchEditHandler; import com.kingdee.shr.base.syssetting.context.SHRContext; import com.kingdee.shr.base.syssetting.exception.SHRWebException; import org.springframework.ui.ModelMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Map; /** * 多人加班单审核通过的单据分录,删除、变更实现 * @author lhbj */ public class AtsOverTimeBillBatchEditHandlerEx extends AtsOverTimeBillBatchEditHandler { /** * 核通过的单据分录删除 * @param request * @param response * @param modelMap * @return * @throws SHRWebException */ public String deleteOTEntryAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException { try { Context ctx = SHRContext.getInstance().getContext(); String billid = this.getBillId(request); String entryId = request.getParameter("entryId"); OverTimeAgainstApproveUtil u = new OverTimeAgainstApproveUtil(); Map map = u.deleteOTEntry(ctx, billid, entryId); System.out.println("deleteOTEntryAction:"+map); this.writeSuccessData(map); }catch (Exception e){ e.printStackTrace(); throw new SHRWebException(e); } return null; } /** * 核通过的单据分录变更 * @param request * @param response * @param modelMap * @return * @throws SHRWebException */ public String changeOTEntryAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException { try { Context ctx = SHRContext.getInstance().getContext(); String billid = this.getBillId(request); String entryId = request.getParameter("entryId"); OverTimeAgainstApproveUtil u = new OverTimeAgainstApproveUtil(); Map map = u.changeOTEntry(ctx, billid, entryId); this.writeSuccessData(map); }catch (Exception e){ e.printStackTrace(); throw new SHRWebException(e); } return null; } /** * 取消核通过的单据分录变更 * @param request * @param response * @param modelMap * @return * @throws SHRWebException */ public String unChangeOTEntryAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException { try { Context ctx = SHRContext.getInstance().getContext(); String billid = this.getBillId(request); String entryId = request.getParameter("entryId"); OverTimeAgainstApproveUtil u = new OverTimeAgainstApproveUtil(); Map map = u.unChangeOTEntry(ctx, billid, entryId); this.writeSuccessData(map); }catch (Exception e){ e.printStackTrace(); throw new SHRWebException(e); } return null; } }