|
|
@ -45,6 +45,7 @@ import com.yxt.anrui.portal.api.flow.*; |
|
|
|
import com.yxt.anrui.portal.api.flow.app.AppVo; |
|
|
|
import com.yxt.anrui.portal.api.flow.app.FlowTaskDoQuery; |
|
|
|
import com.yxt.anrui.portal.api.flow.app.FlowTaskDoVo; |
|
|
|
import com.yxt.anrui.portal.api.flow.app.FlowTaskFinishVo; |
|
|
|
import com.yxt.anrui.portal.biz.appsubsetversion.AppSubsetVersionService; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.ConstantUtils; |
|
|
@ -278,10 +279,10 @@ public class FlowableService extends MybatisBaseService<FlowableMapper, Flowable |
|
|
|
map.put("taskDefKey", taskDefKey); |
|
|
|
map.put("flowState", SysFormLinkFlowStateEnum.UNCOMMITTED.getCode()); |
|
|
|
} else {*/ |
|
|
|
map.put("nodeState", nodeState); |
|
|
|
map.put("taskDefKey", taskDefKey); |
|
|
|
map.put("flowState", nodeState); |
|
|
|
/* }*/ |
|
|
|
map.put("nodeState", nodeState); |
|
|
|
map.put("taskDefKey", taskDefKey); |
|
|
|
map.put("flowState", nodeState); |
|
|
|
/* }*/ |
|
|
|
sysFormLinkFeign.updateFiled(map); |
|
|
|
return new ResultBean().success(); |
|
|
|
} |
|
|
@ -319,7 +320,7 @@ public class FlowableService extends MybatisBaseService<FlowableMapper, Flowable |
|
|
|
map.put("nodeState", nodeState); |
|
|
|
map.put("taskDefKey", taskDefKey); |
|
|
|
// if (incomingSourceRef.contains("start")) {
|
|
|
|
map.put("flowState",nodeState); |
|
|
|
map.put("flowState", nodeState); |
|
|
|
// }
|
|
|
|
sysFormLinkFeign.updateFiled(map); |
|
|
|
return new ResultBean().success(); |
|
|
@ -347,7 +348,6 @@ public class FlowableService extends MybatisBaseService<FlowableMapper, Flowable |
|
|
|
sysFormLinkFeign.updateFiled(map); |
|
|
|
return resultBean.success(); |
|
|
|
}*/ |
|
|
|
|
|
|
|
public void stopProcess(FlowTaskVo flowTaskVo) { |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(flowTaskVo, fl); |
|
|
@ -556,4 +556,88 @@ public class FlowableService extends MybatisBaseService<FlowableMapper, Flowable |
|
|
|
page.setTotal(resultBean.getData().getTotal()); |
|
|
|
return rb.success().setData(page); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<PagerVo<FlowTaskFinishVo>> finishApp(PagerQuery<FlowTaskDoQuery> pagerQuery) { |
|
|
|
ResultBean<PagerVo<FlowTaskFinishVo>> rb = ResultBean.fireFail(); |
|
|
|
PagerQuery<BusinessTaskQuery> taskQueryPagerQuery = new PagerQuery<>(); |
|
|
|
taskQueryPagerQuery.setCurrent(pagerQuery.getCurrent()).setSize(pagerQuery.getSize()); |
|
|
|
FlowTaskDoQuery params = pagerQuery.getParams(); |
|
|
|
String names = params.getNames(); |
|
|
|
String userSid = params.getUserSid(); |
|
|
|
BusinessTaskQuery taskQuery = new BusinessTaskQuery(); |
|
|
|
List<BusinessTaskParam> taskParamList = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(names)) { |
|
|
|
BusinessTaskParam taskParam = new BusinessTaskParam(); |
|
|
|
taskParam.setField("proDefName"); |
|
|
|
taskParam.setValue(names); |
|
|
|
taskParam.setSqlOperationSymbol(SQLOperationSymbol.LIKE); |
|
|
|
taskParamList.add(taskParam); |
|
|
|
} |
|
|
|
taskQuery.setFields(taskParamList); |
|
|
|
taskQueryPagerQuery.setParams(taskQuery); |
|
|
|
ResultBean<Page<FlowTaskDto>> resultBean = flowTaskFeign.businessDoneListForApp(userSid, taskQueryPagerQuery); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg("流程错误"); |
|
|
|
} |
|
|
|
PagerVo<FlowTaskFinishVo> page = new PagerVo<>(); |
|
|
|
List<FlowTaskFinishVo> voList = Optional.ofNullable(resultBean.getData().getRecords()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FlowTaskFinishVo.class)).collect(Collectors.toList()); |
|
|
|
voList.removeAll(Collections.singleton(null)); |
|
|
|
//定义的app的sid的index集合
|
|
|
|
Map<String, List<Integer>> appVer = new HashMap<>(); |
|
|
|
for (int i = 0; i < voList.size(); i++) { |
|
|
|
FlowTaskFinishVo f = voList.get(i); |
|
|
|
Map<String, Object> flowMap = f.getProcessVariables(); |
|
|
|
Map<String, Object> appMap = ConstantUtils.getMap(flowMap, "app"); |
|
|
|
String json = JSONObject.toJSONString(appMap); |
|
|
|
System.out.println(json); |
|
|
|
AppVo appVo = new AppVo(); |
|
|
|
appVo.setJson(json); |
|
|
|
//app版本的sid
|
|
|
|
String appSid = ""; |
|
|
|
//app版本的类型
|
|
|
|
String type = ""; |
|
|
|
if (f.getSysProUrlVo() != null) { |
|
|
|
appVo.setModuleAction(f.getSysProUrlVo().getUrl()); |
|
|
|
appSid = f.getSysProUrlVo().getModulePluginName(); |
|
|
|
} |
|
|
|
//根据appSid查询最新版本的app插件包:以及类型:2插件,1框架
|
|
|
|
if (StringUtils.isNotBlank(appSid)) { |
|
|
|
if (appSid.contains("#")) { |
|
|
|
type = Arrays.asList(appSid.split("#")).get(1); |
|
|
|
} |
|
|
|
} |
|
|
|
if ("1".equals(type)) { |
|
|
|
//框架
|
|
|
|
|
|
|
|
} else if ("2".equals(type)) { |
|
|
|
//插件
|
|
|
|
String appSid2 = appSid.substring(0, appSid.indexOf("#")); |
|
|
|
List<Integer> integers = appVer.get(appSid2); |
|
|
|
if (integers == null) { |
|
|
|
integers = new ArrayList<>(); |
|
|
|
} |
|
|
|
integers.add(i); |
|
|
|
appVer.put(appSid2, integers); |
|
|
|
} |
|
|
|
appVo.setType(type); |
|
|
|
voList.get(i).setAppVariables(appVo); |
|
|
|
} |
|
|
|
// 循环取map:若为同一个app版本,则只查询一次
|
|
|
|
for (String key : appVer.keySet()) { |
|
|
|
AppSubsetVersionVo appSubsetVersions = appSubsetVersionService.selectByAppSidOne(key); |
|
|
|
if (appSubsetVersions != null) { |
|
|
|
List<Integer> integers = appVer.get(key); |
|
|
|
for (int i = 0; i < integers.size(); i++) { |
|
|
|
voList.get(i).getAppVariables().setPath(appSubsetVersions.getUpdateUrl()); |
|
|
|
voList.get(i).getAppVariables().setModuleVersion(appSubsetVersions.getVersionCode()); |
|
|
|
voList.get(i).getAppVariables().setModulePluginName(appSubsetVersions.getModulePluginName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
page.setRecords(voList); |
|
|
|
page.setCurrent(resultBean.getData().getCurrent()); |
|
|
|
page.setSize(resultBean.getData().getSize()); |
|
|
|
page.setTotal(resultBean.getData().getTotal()); |
|
|
|
return rb.success().setData(page); |
|
|
|
} |
|
|
|
} |
|
|
|