@@ -7,6 +7,7 @@ import cc.smtweb.framework.core.common.SwMap; | |||||
import cc.smtweb.framework.core.mvc.service.AbstractHandler; | import cc.smtweb.framework.core.mvc.service.AbstractHandler; | ||||
import cc.smtweb.framework.core.session.UserSession; | import cc.smtweb.framework.core.session.UserSession; | ||||
import cc.smtweb.system.bpm.web.engine.model.common.*; | import cc.smtweb.system.bpm.web.engine.model.common.*; | ||||
import cc.smtweb.system.bpm.web.engine.model.listcard.lclc1.LCLC1Config; | |||||
import cc.smtweb.system.bpm.web.engine.model.listcard.lclc1.LCLC1Service; | import cc.smtweb.system.bpm.web.engine.model.listcard.lclc1.LCLC1Service; | ||||
/** | /** | ||||
@@ -16,7 +17,10 @@ import cc.smtweb.system.bpm.web.engine.model.listcard.lclc1.LCLC1Service; | |||||
*/ | */ | ||||
@SwService | @SwService | ||||
public class FlowLcLc1Service extends FlowModelService { | public class FlowLcLc1Service extends FlowModelService { | ||||
private LCLC1Service worker = new LCLC1Service(); | |||||
public final static String TYPE_MODEL_LEFT_LIST = "modelLList"; | |||||
public final static String TYPE_MODEL_LEFT_LOAD = "modelLLoad"; | |||||
public final static String TYPE_MODEL_LEFT_SAVE = "modelLSave"; | |||||
public final static String TYPE_MODEL_LEFT_DEL = "modelLDel"; | |||||
@Override | @Override | ||||
protected AbstractHandler createHandler(String type) { | protected AbstractHandler createHandler(String type) { | ||||
@@ -27,8 +31,16 @@ public class FlowLcLc1Service extends FlowModelService { | |||||
case TYPE_MODEL_DEL: | case TYPE_MODEL_DEL: | ||||
case TYPE_FLOW: | case TYPE_FLOW: | ||||
return super.createHandler(type); | return super.createHandler(type); | ||||
case TYPE_MODEL_LEFT_LIST: | |||||
return new ModelListHandler(LCLC1Config.dsLList); | |||||
case TYPE_MODEL_LEFT_LOAD: | |||||
return new ModelLoadHandler<>(LCLC1Config.dsLCard); | |||||
case TYPE_MODEL_LEFT_SAVE: | |||||
return new ModelSaveHandler<>(LCLC1Config.dsLCard); | |||||
case TYPE_MODEL_LEFT_DEL: | |||||
return new ModelDelHandler(LCLC1Config.dsLCard); | |||||
} | } | ||||
return worker.createHandler(type); | |||||
return super.createHandler(type); | |||||
} | } | ||||
/** | /** | ||||
@@ -38,7 +50,7 @@ public class FlowLcLc1Service extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelLSave(@SwBody SwMap params, UserSession us) { | public R modelLSave(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelLSave(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_LEFT_SAVE, handler -> ((ModelSaveHandler) handler).save()); | |||||
} | } | ||||
/** | /** | ||||
@@ -48,7 +60,7 @@ public class FlowLcLc1Service extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelLLoad(@SwBody SwMap params, UserSession us) { | public R modelLLoad(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelLLoad(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_LEFT_LOAD, handler -> ((ModelLoadHandler) handler).load()); | |||||
} | } | ||||
/** | /** | ||||
@@ -58,7 +70,7 @@ public class FlowLcLc1Service extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelLAdd(@SwBody SwMap params, UserSession us) { | public R modelLAdd(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelLAdd(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_LEFT_LOAD, handler -> ((ModelLoadHandler) handler).add()); | |||||
} | } | ||||
/** | /** | ||||
@@ -68,7 +80,7 @@ public class FlowLcLc1Service extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelLDel(@SwBody SwMap params, UserSession us) { | public R modelLDel(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelLDel(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_LEFT_DEL, handler -> ((ModelDelHandler) handler).del()); | |||||
} | } | ||||
/** | /** | ||||
@@ -78,7 +90,7 @@ public class FlowLcLc1Service extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelLList(@SwBody SwMap params, UserSession us) { | public R modelLList(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelLList(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_LEFT_LIST, handler -> ((ModelListHandler) handler).data()); | |||||
} | } | ||||
/** | /** | ||||
@@ -88,6 +100,6 @@ public class FlowLcLc1Service extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelLListTotal(@SwBody SwMap params, UserSession us) { | public R modelLListTotal(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelLListTotal(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_LEFT_LIST, handler -> ((ModelListHandler) handler).getTotal()); | |||||
} | } | ||||
} | } |
@@ -6,7 +6,8 @@ import cc.smtweb.framework.core.common.R; | |||||
import cc.smtweb.framework.core.common.SwMap; | import cc.smtweb.framework.core.common.SwMap; | ||||
import cc.smtweb.framework.core.mvc.service.AbstractHandler; | import cc.smtweb.framework.core.mvc.service.AbstractHandler; | ||||
import cc.smtweb.framework.core.session.UserSession; | import cc.smtweb.framework.core.session.UserSession; | ||||
import cc.smtweb.system.bpm.web.engine.model.common.FlowModelService; | |||||
import cc.smtweb.system.bpm.web.engine.model.common.*; | |||||
import cc.smtweb.system.bpm.web.engine.model.listcard.lcms.LCMsConfig; | |||||
import cc.smtweb.system.bpm.web.engine.model.listcard.lcms.LCMsService; | import cc.smtweb.system.bpm.web.engine.model.listcard.lcms.LCMsService; | ||||
/** | /** | ||||
@@ -16,7 +17,10 @@ import cc.smtweb.system.bpm.web.engine.model.listcard.lcms.LCMsService; | |||||
*/ | */ | ||||
@SwService | @SwService | ||||
public class FlowLcMsService extends FlowModelService { | public class FlowLcMsService extends FlowModelService { | ||||
private LCMsService worker = new LCMsService(); | |||||
public final static String TYPE_MODEL_SUB_LIST = "modelSubList"; | |||||
public final static String TYPE_MODEL_SUB_LOAD = "modelSubLoad"; | |||||
public final static String TYPE_MODEL_SUB_SAVE = "modelSubSave"; | |||||
public final static String TYPE_MODEL_SUB_DEL = "modelSubDel"; | |||||
protected AbstractHandler createHandler(String type) { | protected AbstractHandler createHandler(String type) { | ||||
switch (type) { | switch (type) { | ||||
@@ -28,8 +32,16 @@ public class FlowLcMsService extends FlowModelService { | |||||
return new FlowLcMsSaveHandler(); | return new FlowLcMsSaveHandler(); | ||||
case TYPE_MODEL_DEL: | case TYPE_MODEL_DEL: | ||||
return new FlowLcMsDelHandler(); | return new FlowLcMsDelHandler(); | ||||
case TYPE_MODEL_SUB_LIST: | |||||
return new ModelListHandler(LCMsConfig.dsSList); | |||||
case TYPE_MODEL_SUB_LOAD: | |||||
return new ModelLoadHandler<>(LCMsConfig.dsSCard); | |||||
case TYPE_MODEL_SUB_SAVE: | |||||
return new ModelSaveHandler<>(LCMsConfig.dsSCard); | |||||
case TYPE_MODEL_SUB_DEL: | |||||
return new ModelDelHandler(LCMsConfig.dsSCard); | |||||
} | } | ||||
return worker.createHandler(type); | |||||
return super.createHandler(type); | |||||
} | } | ||||
/** | /** | ||||
@@ -39,7 +51,7 @@ public class FlowLcMsService extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelSubSave(@SwBody SwMap params, UserSession us) { | public R modelSubSave(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelSubSave(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_SUB_SAVE, handler -> ((ModelSaveHandler) handler).save()); | |||||
} | } | ||||
/** | /** | ||||
@@ -49,7 +61,7 @@ public class FlowLcMsService extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelSubLoad(@SwBody SwMap params, UserSession us) { | public R modelSubLoad(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelSubLoad(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_SUB_LOAD, handler -> ((ModelLoadHandler) handler).load()); | |||||
} | } | ||||
/** | /** | ||||
@@ -59,7 +71,7 @@ public class FlowLcMsService extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelSubAdd(@SwBody SwMap params, UserSession us) { | public R modelSubAdd(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelSubAdd(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_SUB_LOAD, handler -> ((ModelLoadHandler) handler).add()); | |||||
} | } | ||||
/** | /** | ||||
@@ -69,7 +81,7 @@ public class FlowLcMsService extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelSubDel(@SwBody SwMap params, UserSession us) { | public R modelSubDel(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelSubDel(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_SUB_DEL, handler -> ((ModelDelHandler) handler).del()); | |||||
} | } | ||||
/** | /** | ||||
@@ -79,7 +91,7 @@ public class FlowLcMsService extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelSubList(@SwBody SwMap params, UserSession us) { | public R modelSubList(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelSubList(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_SUB_LIST, handler -> ((ModelListHandler) handler).data()); | |||||
} | } | ||||
/** | /** | ||||
@@ -89,6 +101,6 @@ public class FlowLcMsService extends FlowModelService { | |||||
* @return | * @return | ||||
*/ | */ | ||||
public R modelSubListTotal(@SwBody SwMap params, UserSession us) { | public R modelSubListTotal(@SwBody SwMap params, UserSession us) { | ||||
return worker.modelSubListTotal(params,us); | |||||
return pageHandler(params, us, TYPE_MODEL_SUB_LIST, handler -> ((ModelListHandler) handler).getTotal()); | |||||
} | } | ||||
} | } |