|
@@ -100,10 +100,8 @@ public class CommonBtnController extends BaseController {
|
|
|
DragTableBtn dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
|
|
|
// 根据流程的key判断当前按钮是否执行触发流程
|
|
|
if (!dragTableBtn.getBtnProcessKey().isEmpty()) {
|
|
|
-
|
|
|
// 调用发起流程接口
|
|
|
fromUtils.runBpmProductionScheduling(commonEntity);
|
|
|
-
|
|
|
// if (dragTableBtn.getBtnFormKey().isEmpty()) { // 校验当前按钮是否是直接触发流程 或者脚本 (新增按钮类型)
|
|
|
// fromUtils.runBpmProductionScheduling(commonEntity);
|
|
|
// }
|
|
@@ -144,7 +142,27 @@ public class CommonBtnController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
public AjaxResult executeBtn(CommonEntity commonEntity) {
|
|
|
- return AjaxResult.success();
|
|
|
+ if (commonEntity.getBasicMap().get("visible").toString().equals("true")) {
|
|
|
+ if (commonEntity.getBasicMap().containsKey("btnKey")) { // 按钮提交时会触发别的操作
|
|
|
+ // 根据按钮别名查询按钮详细信息
|
|
|
+ DragTableBtn dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
|
|
|
+ if (!dragTableBtn.getBtnScriptKey().isEmpty()) {
|
|
|
+ // 调用执行脚本接口
|
|
|
+ fromUtils.triggerScript(commonEntity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ commonService.edit(commonEntity);
|
|
|
+ return AjaxResult.success("执行脚本成功!");
|
|
|
+ } else if (commonEntity.getBasicMap().get("visible").toString().equals("false")) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ String sqlKey = commonEntity.getBasicMap().get("sqlKey").toString();
|
|
|
+ DragForm dragForm = dragFormService.selectDragFormBySqlKey(sqlKey);
|
|
|
+ map.put("template", dragForm);
|
|
|
+ map.put("result", commonService.getInfoById(commonEntity));
|
|
|
+ return success(map);
|
|
|
+ } else {
|
|
|
+ return AjaxResult.error("执行脚本失败!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -154,10 +172,35 @@ public class CommonBtnController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
public AjaxResult initiatedBtn(CommonEntity commonEntity) {
|
|
|
- // 调用发起流程接口
|
|
|
- if (fromUtils.runBpmProductionScheduling(commonEntity).is2xxSuccessful()) {
|
|
|
+ //是否开启弹窗
|
|
|
+ if (commonEntity.getBasicMap().get("visible").toString().equals("true")) {
|
|
|
+ if (commonEntity.getBasicMap().containsKey("btnKey")) { // 按钮提交时会触发别的操作
|
|
|
+ // 根据按钮别名查询按钮详细信息
|
|
|
+ DragTableBtn dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
|
|
|
+ // 根据流程的key判断当前按钮是否执行触发流程
|
|
|
+ if (!dragTableBtn.getBtnProcessKey().isEmpty()) {
|
|
|
+ // 表示对当前操作是及时选择的流程模板
|
|
|
+ if (dragTableBtn.getBtnProcessKey().equals("unknown")) {
|
|
|
+ // 调用发起流程接口
|
|
|
+ fromUtils.runBpmProductionScheduling(commonEntity);
|
|
|
+ } else {
|
|
|
+ // 执行当前按钮绑定的流程-》暂无直接执行流程
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ toAjax(commonService.edit(commonEntity));
|
|
|
return AjaxResult.success("启动流程成功!");
|
|
|
+ } else if (commonEntity.getBasicMap().get("visible").toString().equals("false")) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ // 单纯是表格还是弹窗里有表格
|
|
|
+ String sqlKey = commonEntity.getBasicMap().get("sqlKey").toString();
|
|
|
+ DragForm dragForm = dragFormService.selectDragFormBySqlKey(sqlKey);
|
|
|
+ map.put("template", dragForm);
|
|
|
+ // 返回结果
|
|
|
+ map.put("result", commonService.getInfoById(commonEntity));
|
|
|
+ return success(map);
|
|
|
} else {
|
|
|
+ // return warn("暂不支持该操作!");
|
|
|
return AjaxResult.error("发起流程失败!");
|
|
|
}
|
|
|
}
|