|
|
@@ -0,0 +1,48 @@ |
|
|
|
package cc.smtweb.system.bpm.web.engine.model.listcard.abshandler; |
|
|
|
|
|
|
|
import cc.smtweb.framework.core.common.R; |
|
|
|
import cc.smtweb.framework.core.common.SwMap; |
|
|
|
import cc.smtweb.framework.core.exception.BizException; |
|
|
|
import cc.smtweb.framework.core.session.UserSession; |
|
|
|
import cc.smtweb.system.bpm.web.design.form.ModelForm; |
|
|
|
import cc.smtweb.system.bpm.web.design.form.ModelFormHelper; |
|
|
|
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; |
|
|
|
import cc.smtweb.system.bpm.web.design.form.define.PageDatasets; |
|
|
|
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageListHandler; |
|
|
|
import cc.smtweb.system.bpm.web.engine.dynPage.DynRetBean; |
|
|
|
|
|
|
|
/** |
|
|
|
* Created by Akmm at 2022-09-15 15:01 |
|
|
|
* 列表类服务handler |
|
|
|
*/ |
|
|
|
public class ModelListHandler extends DynPageListHandler { |
|
|
|
protected String dsName; |
|
|
|
private ModelListHandler(long pageId, SwMap filter, PageDataset pageDataSet) { |
|
|
|
super(pageId, filter, pageDataSet); |
|
|
|
} |
|
|
|
|
|
|
|
public ModelListHandler(String dsName) { |
|
|
|
this.dsName = dsName; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void init(SwMap params, UserSession us) { |
|
|
|
super.init(params, us); |
|
|
|
String pId = params.readString("pageId"); |
|
|
|
ModelForm form = ModelFormHelper.getFromCache(pId); |
|
|
|
if (form == null) throw new BizException("没有找到页面定义数据(" + pageId + ")!"); |
|
|
|
pageId = form.getId(); |
|
|
|
PageDatasets datasets = form.getDatasets(); |
|
|
|
if (datasets == null || datasets.list == null) throw new BizException("没有找到页面定义的数据集数据(" + pageId + ")!"); |
|
|
|
|
|
|
|
filter = params.readMap("filter"); |
|
|
|
pageDataSet = datasets.findByName(dsName); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public R data() { |
|
|
|
DynRetBean bean = DynRetBean.createList(buildListData()); |
|
|
|
return R.success(bean); |
|
|
|
} |
|
|
|
|
|
|
|
} |