流程相关2

This commit is contained in:
Timer
2026-03-06 01:08:17 +08:00
parent 3d81e6950f
commit ed81825425
6 changed files with 199 additions and 113 deletions

View File

@ -55,6 +55,7 @@ import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
@ -728,12 +729,21 @@ public class ModelController {
if(stencil.get("id").asText().toString().equals("UserTask")){
JSONObject json = JSONObject.fromObject(childShapes.path(i).toString());
JSONObject properties = JSONObject.fromObject(json.get("properties").toString());
String documentation = properties.get("documentation").toString();
String documentation = properties.get("documentation").toString();
// 获取节点名称
String nodeName = "";
if(properties.has("name") && properties.get("name") != null) {
nodeName = properties.get("name").toString();
}
// 添加节点名称字段,方便前端显示
json.put("nodeName", nodeName);
json.put("businessunit", businessUnitService.selectById(documentation));
String resourceId = json.get("resourceId").toString();
List<ModelNodeJob> list = this.jobService.selectModelNodeJobListByWhere(" where resource_id='"+resourceId+"' and model_id ='"+modelData.getId()+"' ");
StringBuilder jobNames= new StringBuilder();
StringBuilder jobIds = new StringBuilder();
StringBuilder jobIds= new StringBuilder();
if(list != null && !list.isEmpty()){
for(int j=0;j<list.size();j++){
if(list.get(j)!=null){
@ -874,6 +884,7 @@ public class ModelController {
@RequestMapping("/saveNode.do")
public String saveNode(HttpServletRequest request,Model model,
@RequestParam(value ="businessid") String businessid,
@RequestParam(value ="nodename") String nodename,
@RequestParam(value ="modelid") String modelid,
@RequestParam(value ="index") String index,
@RequestParam(value = "countersign",required = false,defaultValue = "false") boolean countersign,
@ -890,6 +901,8 @@ public class ModelController {
JSONObject json= modelobject.getJSONArray("childShapes").getJSONObject(i);
JSONObject properties =json.getJSONObject("properties");
properties.put("documentation", businessid);
properties.put("name", nodename);
properties.put("nodename", nodename);
// properties.put("usertaskassignment", "{\"assignment\":{\"candidateUsers\":[{\"value\":\"#{userIds}\",\"assignee\":\"${applicantId}\"}}");
//properties.put("usertaskassignment", "{\"assignment\":{\"candidateUsers\":[{\"value\":\"#{userIds}\",\"$$hashKey\":\"0BQ\"}],\"candidateGroups\":[{\"value\":\"#{groupIds}\",\"$$hashKey\":\"0AY\"}],\"assignee\":\"${applicantId}\"}}");
properties.put("usertaskassignment", "{\"assignment\":{\"candidateUsers\":[{\"value\":\"#{userIds}\",\"$$hashKey\":\"0BQ\"}],\"assignee\":\"${applicantId}\"}}");
@ -925,7 +938,7 @@ public class ModelController {
//保存
editorNode = new BpmnJsonConverter().convertToJson(bpmnModel);
}
repositoryService.addModelEditorSource(modelid, editorNode.toString().getBytes("utf-8"));
repositoryService.addModelEditorSource(modelid, editorNode.toString().getBytes(StandardCharsets.UTF_8));
result = modelid;
} catch (Exception e) {

View File

@ -47,14 +47,11 @@ public class BusinessUnitController {
@RequestParam(value = "order", required=false) String order) {
HttpSession currentSession = request.getSession(false);
User cu=(User)request.getSession().getAttribute("cu");
// if(cu==null){
// cu=loginService.Login(request.getParameter("username"), request.getParameter("pwd"));
// }
if(sort==null){
sort = " insdt ";
}
if(order==null){
order = " asc ";
order = " desc ";
}
String orderstr=" order by "+sort+" "+order;
@ -65,6 +62,9 @@ public class BusinessUnitController {
if(request.getParameter("search_name")!=null && !request.getParameter("search_name").isEmpty()){
wherestr += " and name like '%"+request.getParameter("search_name")+"%' ";
}
if(request.getParameter("search_processType")!=null && !request.getParameter("search_processType").isEmpty()){
wherestr += " and process_type_id = '"+request.getParameter("search_processType")+"' ";
}
PageHelper.startPage(page, rows);
List<BusinessUnit> list = this.businessUnitService.selectListByWhere(wherestr+orderstr);
@ -72,7 +72,6 @@ public class BusinessUnitController {
JSONArray json=JSONArray.fromObject(list);
String result="{\"total\":"+pi.getTotal()+",\"rows\":"+json+"}";
// System.out.println(result);
model.addAttribute("result",result);
return new ModelAndView("result");
}