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

import com.kingdee.bos.metadata.entity.FilterInfo;
import com.kingdee.bos.metadata.entity.FilterItemInfo;
import com.kingdee.eas.custom.performancenew.app.periodStatusEnum;
import com.kingdee.eas.util.app.ContextUtil;
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
import com.kingdee.shr.base.syssetting.web.handler.ListHandler;
import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
import com.kingdee.util.StringUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @author qingwu
 * @date 2024/5/8
 * @apiNote 绩效考核正态分布得分
 */
public class ExamineGradePersonEntryScoreList extends ListHandler {
    @Override
    protected FilterInfo getDefaultFilter(HttpServletRequest request, HttpServletResponse response) throws SHRWebException {
        FilterInfo customFilter = null;
        String custom_params = request.getParameter("custom_params");
        if (!StringUtils.isEmpty(custom_params)) {
            customFilter = new FilterInfo();
            Map customParams = JSONUtils.convertJsonToObject(custom_params);
            String billId = (String) customParams.get("billId");
            customFilter.getFilterItems().add(new FilterItemInfo("parent.id", billId));
            customFilter.getFilterItems().add(new FilterItemInfo("parent.periodStatus", periodStatusEnum.periodLock));
        }
        return customFilter;
    }

}
