package com.kingdee.eas.custom.compensation.handler;

import com.kingdee.bos.Context;
import com.kingdee.shr.base.syssetting.app.osf.OSFAppUtil;
import com.kingdee.shr.base.syssetting.context.SHRContext;
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
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;
import java.util.HashMap;
import java.util.Map;

public class CmpGiveDynamicListHandlerEx extends CmpGiveDynamicListHandler {

    @Override
    public String calGiveAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
        super.calGiveAction(request, response, modelMap);
        String result=null;
        try {
            Context ctx = SHRContext.getInstance().getContext();
            String cmpschemeid = (String) ParseRequestHelper.getParameterByRequest(request, "cmpschemeid");
            Map<String, Object> map = new HashMap<String, Object>();
            //先处理
            Object obj = null;
            obj = OSFAppUtil.callService(ctx, "handMacDepositOSFService", map);
            result = (null != obj) ? obj.toString() : null;
        } catch (Exception e) {
            e.printStackTrace();
            result = e.getMessage();
        }
        return null;
    }

    @Override
    public String notcalGiveAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
        super.notcalGiveAction(request, response, modelMap);
        String result=null;
        try {
            Context ctx = SHRContext.getInstance().getContext();
            String cmpschemeid = (String) ParseRequestHelper.getParameterByRequest(request, "cmpschemeid");
            Map<String, Object> map = new HashMap<String, Object>();
            //先处理
            Object obj = null;
            obj = OSFAppUtil.callService(ctx, "handMacDepositOSFService", map);
            result = (null != obj) ? obj.toString() : null;
        } catch (Exception e) {
            e.printStackTrace();
            result = e.getMessage();
        }
        return null;
    }
}
