package com.kingdee.shr.customer.gtiit.handler;

import com.kingdee.bos.Context;
import com.kingdee.eas.custom.erp.util.SynSalaryFromErpUtilsEx;
import com.kingdee.shr.base.syssetting.context.SHRContext;
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
import com.kingdee.shr.compensation.exception.ExceptionHandle;
import com.kingdee.shr.compensation.request.ParseRequestHelper;
import com.kingdee.shr.compensation.web.handler.CmpGiveDynamicListHandler;
import org.springframework.ui.ModelMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 薪酬发放
 * description: CmpGiveDynamicListHandler <br>
 * date: 2025/3/19 14:03 <br>
 * author: lhbj <br>
 * version: 1.0 <br>
 */
public class CmpGiveDynamicListHandlerEx extends CmpGiveDynamicListHandler {

    public void dataToERPAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        Context ctx = SHRContext.getInstance().getContext();
        String cmpschemeid = (String)ParseRequestHelper.getParameterByRequest(request, "cmpschemeid");
        SynSalaryFromErpUtilsEx.getYearMonth(ctx, cmpschemeid);
    }

    /**
     * 同步薪酬数据
     * @param request
     * @param response
     * @param modelMap
     * @return
     * @throws SHRWebException
     */
    public String calGiveAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
        String cmpschemeid = (String)ParseRequestHelper.getParameterByRequest(request, "cmpschemeid");
        try {
            super.calGiveAction(request,response,modelMap);
        } catch (Exception var17) {
            ExceptionHandle.handleException(var17);
        }finally {
            Context ctx = SHRContext.getInstance().getContext();
            SynSalaryFromErpUtilsEx.getYearMonth(ctx, cmpschemeid);
        }
        return null;
    }
}
