CdwLotPlanPortalAction.java

package com.mycim.webapp.actions.lot.lotplanportal;

import com.fa.sesa.threadlocal.LocalContext;
import com.mycim.framework.utils.lang.StringUtils;
import com.mycim.framework.utils.lang.math.NumberUtils;
import com.mycim.valueobject.consts.LotInfoConstants;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

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

/**
 * @author can.yang
 * @date 2021/9/22
 */
public class CdwLotPlanPortalAction extends LotPlanPortalAction {


    @Override
    public ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                              HttpServletResponse response) throws Exception {
        int tabMaxCount = Integer.MAX_VALUE;
        String tabMaxCountStr = sysService.getRefFileValue("$PORTAL_TAB_MAX_COUNT", "LOTPORTAL", "DATA_1_VALUE");
        if (StringUtils.isNotBlank(tabMaxCountStr) && NumberUtils.isNumber(tabMaxCountStr)) {
            tabMaxCount = NumberUtils.toInt(tabMaxCountStr, Integer.MAX_VALUE);
        }
        request.setAttribute("totalTabCount", tabMaxCount);
        String[] types = new String[]{};
        registerOptionType(LocalContext.getFacilityRrn(), Arrays.asList(types), request);
        return mapping.getInputForward();
    }


    @Override
    public List<Map> queryCondition(Map<String, Object> params) {
        return super.queryCondition(params);
    }

    @Override
    public Map<String, Object> getLotPlansList(Map<String, Object> params) {
        params.put("lotCategory", LotInfoConstants.LOT_CATEGORY_C);
        return super.getLotPlansList(params);
    }

    @Override
    public ActionForward exportAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
        return super.exportAll(request, response);
    }


}