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

import com.kingdee.bos.metadata.entity.FilterInfo;
import com.kingdee.bos.metadata.entity.FilterItemInfo;
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
import com.kingdee.shr.base.syssetting.web.handler.ListHandler;

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

/**
 * @Description e签宝模板字段列表handler
 * @Date 2025/11/25 14:13
 * @Created by 禾源
 */
public class ESignTemplateFileEntryFieldListHandler extends ListHandler {


    /**
     * 获取自定义过滤器信息
     *
     * @param request  HTTP请求对象，用于获取请求相关信息
     * @param response HTTP响应对象，用于设置响应相关信息
     * @return FilterInfo 过滤器信息对象
     * @throws SHRWebException 当获取过滤器信息过程中发生错误时抛出异常
     */
    @Override
    protected FilterInfo getCustomFilter(
            HttpServletRequest request,
            HttpServletResponse response
    ) throws SHRWebException {
        FilterInfo customFilter = super.getCustomFilter(request, response);
        if (customFilter == null) {
            customFilter = new FilterInfo();
        }
        String parentId = (String) this.getRequestParameter(request, "parentId");
        customFilter.getFilterItems().add(new FilterItemInfo("parent1.id", parentId));
        return customFilter;
    }

}
