package org.example.Entity.System;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.example.Entity.Control.Base.Component;
import org.example.Enums.SystemTypeEnums;
import org.example.Utils.DataTableUtil;
import org.example.Utils.JsEngine;
import org.example.Utils.PublicUtil;

import java.util.Map;

import static com.microsoft.sqlserver.jdbc.StringUtils.isEmpty;
import static io.micrometer.common.util.StringUtils.isNotEmpty;
import static org.example.Utils.DataTableUtil.get;
import static org.example.Utils.NativeExtensionUtils.*;

public class BaseModule extends ModuleBaseEntity {

    public BaseModule(Map<String, Object> basemodule) {
        super(basemodule);
        this.basemodule = basemodule;
    }

    public BaseModule() {
        super();
    }

    Map<String, Object> basemodule;

    @JsonProperty("IdField")
    @Override
    public String getIdField() {
        if (getUnionBillCode() == null) {
            return super.getIdField();
        }
        return "billid";
    }

    @Override
    public void setIdField(String idField) {
        super.setIdField(idField);
    }

    @JsonProperty("IsSpecModule")
    public boolean IsSpecModule;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    public String detailId;

    private String _condKey;

    @JsonIgnore
    @JsonProperty("CondKey")
    public String getCondKey() {
        Object _fk = get(basemodule, "condkey", _condKey);
        if (_fk != null && !(_fk + "").isEmpty()) {
            _condKey = _fk + "";
            return _condKey;
        }
        return null;
    }

    @JsonProperty("PageAble")
    public boolean getPageAble() {
        return toBoolean(DataTableUtil.get(basemodule, "pagerflag", true));
    }


    @JsonProperty("PageSize")
    public int getPageSize() {
        return ToInt32(DataTableUtil.get(basemodule, "pagesize", true));
    }


    @JsonProperty("SelectLeaf")
    public int getSelectLeaf() {
        return ToInt32(get(basemodule, "selectLeaf", true));
    }

    private Boolean _selfEdit;

    @JsonProperty("SelfEdit")
    public boolean isSelfEdit() {
        if (_selfEdit != null) {
            return _selfEdit;
        }

        boolean editFlag = toBoolean(get(basemodule, "EditFlag", false));
        _selfEdit = (isSaveAble() && (isUpdateAble() || isAddAble())) && editFlag;

        return _selfEdit;
    }

    public void setSelfEdit(boolean value) {
        this._selfEdit = value;
    }

    @JsonProperty("ModuleType")
    public Integer ModuleType = 0;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public String Title;

    @JsonProperty("Title")
    public String getTitle() {
        return getMenuName();
    }

    public void setTitle(String value) {
        this.Title = value;
    }

    private String _unionBillCode;

    @JsonProperty("UnionBillCode")
    public String getUnionBillCode() {
        if (_unionBillCode == null) {
            Object value = get(basemodule, "UnionBillCode", _unionBillCode);
            _unionBillCode = (value != null) ? value.toString() : null;
        }
        return _unionBillCode;
    }

    private String _masterTab;

    @JsonIgnore
    @JsonProperty("MasterTable")
    @Override
    public String getMasterTable() {
        return (String) get(basemodule, "TableName", _masterTab);
    }

    @Override
    public void setMasterTable(String value) {
        this._masterTab = value;
    }

    private String _masterSql;

    @JsonIgnore
    @JsonProperty("MasterSql")
    public String getMasterSql() {
        return (String) get(basemodule, "TableSQL", _masterSql);
    }

    public void setMasterSql(String MasterSql) {
        this._masterSql = MasterSql;
    }

    private String _apiDataNode;

    @JsonIgnore
    @JsonProperty("ApiDataNode")
    public String getApiDataNode() {
        return (String) get(basemodule, "apiDataNode", _apiDataNode);
    }

    public void setApiDataNode(String apiDataNode) {
        _apiDataNode = apiDataNode;
    }

    private String _apiSuccNode;

    @JsonIgnore
    @JsonProperty("ApiSuccNode")
    public String getApiSuccNode() {
        return (String) get(basemodule, "apiSuccNode", _apiSuccNode);
    }

    public void setApiSuccNode(String apiSuccNode) {
        this._apiSuccNode = apiSuccNode;
    }

    private String _apiSuccVal;

    @JsonIgnore
    @JsonProperty("ApiSuccVal")
    public String getApiSuccVal() {
        return (String) get(basemodule, "apiSuccVal", _apiSuccVal);
    }

    public void setApiSuccVal(String value) {
        this._apiSuccVal = value;
    }

    private Integer _menuType;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("MenuType")
    public Integer getMenuType() {
        return (Integer) get(basemodule, "MenuType", _menuType);
    }

    public void setMenuType(Integer menuType) {
        _menuType = menuType;
    }

    private Boolean _isReport;

    @JsonProperty("IsReport")
    public boolean isIsReport() {
        Object value = get(basemodule, "ReportFlag", false);
        this._isReport = toBoolean(value);
        return _isReport;
    }

    public void setIsReport(Boolean IsReport) {
        this._isReport = IsReport;
    }

    private String _addCond;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("AddCond")
    public String getAddCond() {
        if (_addCond != null && !_addCond.isEmpty()) {
            return _addCond;
        }
        _addCond = (String) get(basemodule, "AddCond", _addCond);
        _addCond = PublicUtil.ReqSqlPmsByRow(null, null, PublicUtil.SqlToCode(_addCond), SystemTypeEnums.PmType.ignorenull);
        if (_addCond != null && _addCond.indexOf("{") < 0) {
            if (_addCond == null || _addCond.isEmpty()) {
                _addCond = "1==1";
            }
        }
        return _addCond;
    }

    public void setAddCond(String value) {
        this._addCond = value;
    }

    private Boolean _updateAble = null;

    @JsonProperty("UpdateAble")
    public boolean isUpdateAble() {
        if (toBoolean(!OperAble)) {
            return false;
        }

        if (_updateAble != null) {
            return _updateAble;
        }

        if (toBoolean(!isSaveAble())) {
            return false;
        }
        if (isNotEmpty(getUpdateCond())) {
            return !isIsReport();
        } else {
            if (!getUpdateCond().contains("{")) {
                _updateAble = toBoolean(JsEngine.Eval(getUpdateCond()));
            } else {
                return !isIsReport();
            }
            return _updateAble != null && _updateAble && !isIsReport();
        }
    }

    private String _updateCond = null;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("UpdateCond")
    public String getUpdateCond() {
        if (isNotEmpty(_updateCond)) {
            return _updateCond;
        }

        Object value = get(basemodule, "UpdateCond", _updateCond);
        _updateCond = (value != null) ? value.toString() : null;

        _updateCond = PublicUtil.SqlToCode(_updateCond);
        _updateCond = PublicUtil.ReqSqlPmsByRow(
                null,
                null,
                _updateCond,
                SystemTypeEnums.PmType.ignorenull
        );

        if (_updateCond != null && _updateCond.indexOf("{") < 0) {
            if (isEmpty(_updateCond)) {
                _updateCond = "1==1";
            }
        }
        return _updateCond;
    }

    public void setUpdateCond(String updateCond) {
        this._updateCond = updateCond;
    }

    private String _deleteCond;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("DeleteCond")
    public String getDeleteCond() {
        if (_deleteCond != null && !_deleteCond.isEmpty()) {
            return _deleteCond;
        }
        _deleteCond = (String) get(basemodule, "DeleteCond", _deleteCond);
        _deleteCond = PublicUtil.ReqSqlPmsByRow(null, null, PublicUtil.SqlToCode(_deleteCond),
                SystemTypeEnums.PmType.ignorenull);
        if (_deleteCond == null || !_deleteCond.contains("{")) {
            if (_deleteCond == null || _deleteCond.isEmpty()) {
                _deleteCond = "1==1";
            }
        }
        return _deleteCond;
    }

    public void setDeleteCond(String value) {
        this._deleteCond = value;
    }

    private String _applyCond;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("ApplyCond")
    public String getApplyCond() {
        return (String) get(basemodule, "ApplyCond", _applyCond);
    }

    public void setApplyCond(String value) {
        this._applyCond = value;
    }

    private String _copyCond;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("CopyCond")
    public String getCopyCond() {
        return (String) get(basemodule, "CopyCond", _copyCond);
    }

    public void setCopyCond(String value) {
        this._copyCond = value;
    }

    private Boolean _addFlag;

    @JsonProperty("AddAble")
    public boolean isAddAble() {
        if (!OperAble) {
            return false;
        }

        Object addFlagValue = get(basemodule, "AddFlag");
        if (addFlagValue == null) {
            addFlagValue = (_addFlag != null) ? _addFlag : false;
        }
        boolean addable = toBoolean(addFlagValue);

        if (!addable) {
            return false;
        }

        if (isNullOrEmpty(getAddCond())) {
            return !isIsReport();
        } else if (getAddCond().indexOf("{") < 0) {
            Object evalResult = PublicUtil.EvalCond(PublicUtil.SqlToCode(getAddCond()));
            addable = toBoolean(evalResult);
        }

        return addable && !isIsReport();
    }

    public void setAddAble(Boolean value) {
        this._addFlag = value;
    }

    @JsonIgnore
    private Boolean _saveFlag;

    @JsonProperty("SaveAble")
    public boolean isSaveAble() {
        return toBoolean(get(basemodule, "SaveFlag", _saveFlag, true));
    }

    public void setSaveAble(Boolean value) {
        this._saveFlag = value;
    }

    private Boolean _deleteFlag;

    @JsonProperty("DeleteAble")
    public boolean getDeleteAble() {
        if (!OperAble) return false;
        boolean delable = toBoolean(get(basemodule, "DeleteFlag", _deleteFlag));
        if (!delable) {
            return false;
        }
        if (getDeleteCond() == null || getDeleteCond().isEmpty()) {
            return !isIsReport();
        } else if (!getDeleteCond().contains("{")) {
            delable = toBoolean(PublicUtil.EvalCond(getDeleteCond()));
        }
        return delable && !isIsReport();
    }

    public void setDeleteAble(Boolean value) {
        this._deleteFlag = value;
    }

    private Boolean _searchFlag;

    @JsonProperty("SearchAble")
    public boolean isSearchAble() {
        Object value = get(basemodule, "searchable");
        if (value == null) {
            value = (_searchFlag != null) ? _searchFlag : true;
        }
        return toBoolean(value);
    }

    public void setSearchAble(Boolean value) {
        this._searchFlag = value;
    }

    private Boolean _saveApplyFlag;

    @JsonProperty("SaveApplyAble")
    public boolean isSaveApplyAble() {
        Object value = get(basemodule, "SaveApplyFlag");
        if (value == null) {
            value = (_saveApplyFlag != null) ? _saveApplyFlag : true;
        }
        return toBoolean(value);
    }

    public void setSaveApplyAble(Boolean value) {
        this._saveApplyFlag = value;
    }


    private String _saveCaption;

    @JsonProperty("saveText")
    public String getSaveText() {
        Object value = get(basemodule, "saveCapiton", _saveCaption, null);
        return value == null ? null : value.toString();
    }

    public void setSaveCaption(String value) {
        this._saveCaption = value;
    }

    private String _addCaption;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("addText")
    public String getAddText() {
        return (String) get(basemodule, "addCaption", _addCaption);
    }

    public void setAddText(String value) {
        this._addCaption = value;
    }

    private String _modifyCaption;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("modifyText")
    public String getModifyText() {
        return (String) get(basemodule, "modifyCaption", _modifyCaption);
    }

    public void setModifyText(String value) {
        this._modifyCaption = value;
    }

    private String _applyCaption;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("applyText")
    public String getApplyText() {
        return (String) get(basemodule, "applyCaption", _applyCaption, null);
    }

    public void setApplyText(String value) {
        this._applyCaption = value;
    }

    private String _delCaption;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("delText")
    public String getDelText() {
        return (String) get(basemodule, "delCaption", _delCaption);
    }

    public void setDelText(String value) {
        this._delCaption = value;
    }

    private String _printFile;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("PrintFile")
    public String getPrintFile() {
        return (String) get(basemodule, "PrintFile", _printFile);
    }

    public void setPrintFile(String value) {
        this._printFile = value;
    }

    private Integer _printType;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("PrintType")
    public Integer getPrintType() {
        Object value = get(basemodule, "PrintType", _printType);
        return value != null ? ToInt32(value) : null;
    }

    public void setPrintType(Integer value) {
        this._printType = value;
    }

    private String _printSql;

    @JsonIgnore
    @JsonProperty("PrintSql")
    public String getPrintSql() {
        return (String) get(basemodule, "PrintSQL", _printSql);
    }

    public void setPrintSql(String value) {
        this._printSql = value;
    }

    private String _printSql2;

    @JsonIgnore
    @JsonProperty("PrintSql2")
    public String getPrintSql2() {
        return (String) get(basemodule, "PrintSQL2", _printSql2);
    }

    public void setPrintSql2(String value) {
        this._printSql2 = value;
    }

    private String _printSql3;


    @JsonIgnore
    @JsonProperty("PrintSql3")
    public String getPrintSql3() {
        return (String) get(basemodule, "PrintSQL3", _printSql3);
    }

    public void setPrintSql3(String value) {
        this._printSql3 = value;
    }

    private Integer _leftWidth;

    @JsonInclude(JsonInclude.Include.NON_NULL)


    @JsonProperty("LeftWidth")
    public Integer getLeftWidth() {
        Object value = get(basemodule, "LeftWidth", _leftWidth);
        return value != null ? ToInt32(value) : null;
    }

    public void setLeftWidth(Integer value) {
        this._leftWidth = value;
    }

    private Integer topHeight;

    @JsonProperty("TopHeight")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public Integer getTopHeight() {
        Object value = get(basemodule, "TopHeight", topHeight, null);
        return value instanceof Integer ? (Integer) value : (value != null ? ToInt32(value) : null);
    }

    public void setTopHeight(Integer topHeight) {
        this.topHeight = topHeight;
    }

    private Integer popupWidth;

    @JsonProperty("PopupWidth")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public Integer getPopupWidth() {
        Object value = get(basemodule, "pWidth", popupWidth, null);
        return value instanceof Integer ? (Integer) value : (value != null ? ToInt32(value) : null);
    }

    public void setPopupWidth(Integer popupWidth) {
        this.popupWidth = popupWidth;
    }

    private Integer popupHeight;

    @JsonProperty("PopupHeight")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public Integer getPopupHeight() {
        Object value = get(basemodule, "pHeight", popupHeight, null);
        return value instanceof Integer ? (Integer) value : (value != null ? ToInt32(value) : null);
    }

    public void setPopupHeight(Integer popupHeight) {
        this.popupHeight = popupHeight;
    }

    private Integer winWidth;

    @JsonProperty("WinWidth")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public Integer getWinWidth() {
        Object value = get(basemodule, "winWidth", winWidth, null);
        return value instanceof Integer ? (Integer) value : (value != null ? ToInt32(value) : null);
    }

    public void setWinWidth(Integer winWidth) {
        this.winWidth = winWidth;
    }

    private Integer winpHeight;

    @JsonProperty("WinHeight")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public Integer getWinHeight() {
        Object value = get(basemodule, "winHeight", winpHeight, null);
        return value instanceof Integer ? (Integer) value : (value != null ? ToInt32(value) : null);
    }

    public void setWinHeight(Integer winpHeight) {
        this.winpHeight = winpHeight;
    }

    @JsonInclude(JsonInclude.Include.NON_NULL)
    public Integer OrderId;

    private String _operPurview;

    @JsonIgnore
    @JsonProperty("OperPurview")
    public String getOperPurview() {
        return (String) get(basemodule, "OperPurview", _operPurview);
    }

    public void setOperPurview(String value) {
        this._operPurview = value;
    }

    private String _readPurview;

    @JsonIgnore
    @JsonProperty("ReadPurview")
    public String getReadPurview() {
        return (String) get(basemodule, "ReadPurview", _readPurview);
    }

    public void setReadPurview(String value) {
        this._readPurview = value;
    }

    private String _addModuleId;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("AddModuleId")
    public String getAddModuleId() {
        return (String) get(basemodule, "addmodid", _addModuleId);
    }

    public void setAddModuleId(String value) {
        this._addModuleId = value;
    }

    private Boolean _closeAfterModify;

    @JsonProperty("UpdClose")
    public Boolean getUpdClose() {
        _closeAfterModify = (_closeAfterModify == null)
                ? toBoolean(get(basemodule, "closeAfterModify", _closeAfterModify))
                : _closeAfterModify;

        return Boolean.TRUE.equals(_closeAfterModify) ? _closeAfterModify : null;
    }

    public void setUpdClose(Boolean value) {
        this._closeAfterModify = value;
    }

    private Boolean _closeAfterAdd;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("AddClose")
    public Boolean getAddClose() {
        if (_closeAfterAdd == null) {
            Object value = get(basemodule, "closeAfterAdd", _closeAfterAdd);
            _closeAfterAdd = toBoolean(value);
        }

        return Boolean.TRUE.equals(_closeAfterAdd) ? _closeAfterAdd : null;
    }

    public void setAddClose(Boolean value) {
        this._closeAfterAdd = value;
    }

    private Boolean _noDetail;

    @JsonInclude(JsonInclude.Include.NON_NULL)

    @JsonProperty("NoDetail")
    public Boolean getNoDetail() {
        _noDetail = (_noDetail == null)
                ? toBoolean(get(basemodule, "disableDetail", _noDetail))
                : _noDetail;

        return Boolean.TRUE.equals(_noDetail) ? _noDetail : null;
    }

    public void setNoDetail(Boolean value) {
        this._noDetail = value;
    }

    private Integer _scanMode;

    @JsonInclude(JsonInclude.Include.NON_NULL)


    @JsonProperty("ScanMode")
    public Integer getScanMode() {
        if (_scanMode == null) {
            Object value = get(basemodule, "scanMode", null);
            _scanMode = value != null ? ToInt32(value) : 0;
        }
        return _scanMode == 0 ? null : _scanMode;
    }

    public void setScanMode(Integer value) {
        this._scanMode = value;
    }

    private Integer _scanNoRepet;

    @JsonInclude(JsonInclude.Include.NON_NULL)


    @JsonProperty("ScanNoRepet")
    public Integer getScanNoRepet() {
        Object value = get(basemodule, "scanNoRepet", _scanNoRepet);
        return value != null ? ToInt32(value) : _scanNoRepet;
    }

    public void setScanNoRepet(Integer value) {
        this._scanNoRepet = value;
    }

    private Integer _scanUnique;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("ScanUnique")
    public Integer getScanUnique() {
        Object value = get(basemodule,"ScanUnique", _scanUnique);
        return value != null ? ToInt32(value) : _scanUnique;
    }

    public void setScanUnique(Integer value) {
        this._scanUnique = value;
    }

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("ScanChar")
    public String getScanChar() {
        return (String) get(basemodule, "scanChar", null);
    }


    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("ScanFields")
    public String getScanFields() {
        return (String) get(basemodule, "scanFields", null);
    }


    private Boolean _disMobileTpl;

    @JsonIgnore
    @JsonProperty("DisMobileTpl")
    public Boolean getDisMobileTpl() {
        if (_disMobileTpl == null) {
            _disMobileTpl = toBoolean(get(basemodule, "DisMobileCard", false));
        }
        return _disMobileTpl;
    }

    public void setDisMobileTpl(Boolean value) {
        this._disMobileTpl = value;
    }

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("UnionField")
    public String getUnionField(){
        return DetailModule == null ? null : DetailModule.getUnionField();
    };

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("UnionParentField")
    public String getUnionParentField() {
        return DetailModule == null ? null : DetailModule.getUnionParentField();
    }

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("LeftUnionField")
    public String LeftUnionField;

    @JsonIgnore
    @JsonProperty("LeftUnionFieldSql")
    public String LeftUnionFieldSql;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("Left")
    public Component Left;

    //    @JsonIgnore
    @JsonProperty("Main")
    public Component Main;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("Details")
    public Object Details;

    private Integer _bottomHeight;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("BottomHeight")
    public Integer getBottomHeight() {
        Object value = get(basemodule, "bottomHeight", _bottomHeight);
        return value != null ? ToInt32(value) : null;
    }

    public void setBottomHeight(Integer value) {
        this._bottomHeight = value;
    }

    private Integer detailPageAlign;

    @JsonProperty("DetailPageAlign")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public Integer getDetailPageAlign() {
        Object value = get(basemodule, "detailPageAlign", detailPageAlign, null);
        return value instanceof Integer ? (Integer) value : (value != null ? ToInt32(value) : null);
    }

    public void setDetailPageAlign(Integer detailPageAlign) {
        this.detailPageAlign = detailPageAlign;
    }

    private Integer _appAutoSave;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("scanAutoSave")
    public Integer getScanAutoSave() {
        if (_appAutoSave == null) {
            Object value = DataTableUtil.getRowVal(basemodule, "appAutoSave", null);
            if (value != null) {
                _appAutoSave = ToInt32(value);
            }
        }
        return _appAutoSave;
    }

    public void setScanAutoSave(Integer scanAutoSave) {
        this._appAutoSave = scanAutoSave;
    }

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("MainDataColumns")
    public Object MainDataColumns;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("AttCfgs")
    public Object AttCfgs;

    @JsonIgnore
    @JsonProperty("IsCard")
    public boolean IsCard;

    private Boolean _multCheck;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("MultCheck")
    public Boolean getMultCheck() {
        if (_multCheck != null) return _multCheck;
        _multCheck = toBoolean(get(basemodule, "MultCheck", false));
        return !_multCheck ? null : _multCheck;
    }

    public void setMultCheck(Boolean value) {
        this._multCheck = value;
    }

    private Boolean _refreshAll;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("RefreshAll")
    public Boolean getRefreshAll() {
        if (_refreshAll != null) return _refreshAll;
        _refreshAll = toBoolean(get(basemodule, "RefreshAll"));
        if (!(boolean) _refreshAll) return null;
        return _refreshAll;
    }

    public void setRefreshAll(boolean value) {
        _refreshAll = value;
    }

    @JsonProperty("IsChart")
    public boolean IsChart;

    @JsonIgnore
    @JsonProperty("MainModifyFields")
    public String MainModifyFields;

    @JsonProperty("IsBase")
    public boolean IsBase = true;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("ModuleTabs")
    public Object ModuleTabs;

    private Boolean _appPrint;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("AppPrint")
    public  Boolean IsAppPrint() {
        _appPrint = _appPrint == null ? toBoolean(get(basemodule,"appPrint", _appPrint,null)) : _appPrint;
        if(_appPrint == true){
            return _appPrint;
        }
        return null;
    }

    public void setAppPrint(Boolean value) {
        this._appPrint = value;
    }

    private Integer _appPrintType;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("appPrintType")
    public Integer getappPrintType() {
        int t = ToInt32(get(basemodule,"appPrintType", _appPrintType,null));
        if(t>0){
            return t;
        }
        return null;
    }

    public void setappPrintType(Integer value) {
        this._appPrintType = value;
    }

    private Integer _scanReadOnly;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("scanReadOnly")
    public Integer getscanReadOnly() {
        int t  = ToInt32(get(basemodule,"scanReadOnly", _scanReadOnly,null));
        if(t>0){
            return t;
        }
        return null;
    }

    public void setscanReadOnly(Integer value) {
        this._scanReadOnly = value;
    }

//    2026.2.5 新增mrpType
    public Integer mrpType;

}
