commit
This commit is contained in:
@@ -41,190 +41,193 @@ import java.util.*;
|
||||
@Slf4j
|
||||
public class FlowDesignController {
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private ProcessDesignService processDesignService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private ProcessDesignService processDesignService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
// 获取所有任务参与者处理类
|
||||
public static final List<JSONObject> ASSIGMENT_HANDLER_LIST;
|
||||
// 获取所有候选用户处理类
|
||||
public static final List<JSONObject> CANDIDATE_HANDLER_LIST;
|
||||
// 获取所有任务参与者处理类
|
||||
public static final List<JSONObject> ASSIGMENT_HANDLER_LIST;
|
||||
// 获取所有候选用户处理类
|
||||
public static final List<JSONObject> CANDIDATE_HANDLER_LIST;
|
||||
|
||||
static {
|
||||
Set<Class<?>> classes = ClassScanner.scanPackageBySuper("com.budwk.app", AssignmentHandler.class);
|
||||
ArrayList<JSONObject> list = new ArrayList<>(classes.size());
|
||||
for (Class<?> aClass : classes) {
|
||||
try {
|
||||
AssignmentHandler handler = (AssignmentHandler) ReflectUtil.newInstance(aClass);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("value", handler.getClass().getName());
|
||||
jsonObject.set("order", handler.getOrder());
|
||||
jsonObject.set("name", handler.getMessage());
|
||||
list.add(jsonObject);
|
||||
} catch (Exception e) {
|
||||
log.error("初始化AssignmentHandler失败: {}", aClass.getName());
|
||||
}
|
||||
}
|
||||
// 排序 按order
|
||||
list.sort(Comparator.comparingInt(o -> o.getInt("order")));
|
||||
ASSIGMENT_HANDLER_LIST = Collections.unmodifiableList(list);
|
||||
}
|
||||
static {
|
||||
Set<Class<?>> classes = ClassScanner.scanPackageBySuper("com.budwk.app", AssignmentHandler.class);
|
||||
ArrayList<JSONObject> list = new ArrayList<>(classes.size());
|
||||
for (Class<?> aClass : classes) {
|
||||
try {
|
||||
AssignmentHandler handler = (AssignmentHandler) ReflectUtil.newInstance(aClass);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("value", handler.getClass().getName());
|
||||
jsonObject.set("order", handler.getOrder());
|
||||
jsonObject.set("name", handler.getMessage());
|
||||
list.add(jsonObject);
|
||||
} catch (Exception e) {
|
||||
log.error("初始化AssignmentHandler失败: {}", aClass.getName());
|
||||
}
|
||||
}
|
||||
// 排序 按order
|
||||
list.sort(Comparator.comparingInt(o -> o.getInt("order")));
|
||||
ASSIGMENT_HANDLER_LIST = Collections.unmodifiableList(list);
|
||||
}
|
||||
|
||||
static {
|
||||
Set<Class<?>> classes = ClassScanner.scanPackageBySuper("com.budwk.app", CandidateHandler.class);
|
||||
ArrayList<JSONObject> list = new ArrayList<>(classes.size());
|
||||
for (Class<?> aClass : classes) {
|
||||
try {
|
||||
CandidateHandler handler = (CandidateHandler) ReflectUtil.newInstance(aClass);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("value", handler.getClass().getName());
|
||||
jsonObject.set("order", handler.getOrder());
|
||||
jsonObject.set("name", handler.getMessage());
|
||||
list.add(jsonObject);
|
||||
} catch (Exception e) {
|
||||
log.error("初始化CandidateHandler失败: {}", aClass.getName());
|
||||
}
|
||||
}
|
||||
// 排序 按order
|
||||
list.sort(Comparator.comparingInt(o -> o.getInt("order")));
|
||||
CANDIDATE_HANDLER_LIST = Collections.unmodifiableList(list);
|
||||
}
|
||||
static {
|
||||
Set<Class<?>> classes = ClassScanner.scanPackageBySuper("com.budwk.app", CandidateHandler.class);
|
||||
ArrayList<JSONObject> list = new ArrayList<>(classes.size());
|
||||
for (Class<?> aClass : classes) {
|
||||
try {
|
||||
CandidateHandler handler = (CandidateHandler) ReflectUtil.newInstance(aClass);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("value", handler.getClass().getName());
|
||||
jsonObject.set("order", handler.getOrder());
|
||||
jsonObject.set("name", handler.getMessage());
|
||||
list.add(jsonObject);
|
||||
} catch (Exception e) {
|
||||
log.error("初始化CandidateHandler失败: {}", aClass.getName());
|
||||
}
|
||||
}
|
||||
// 排序 按order
|
||||
list.sort(Comparator.comparingInt(o -> o.getInt("order")));
|
||||
CANDIDATE_HANDLER_LIST = Collections.unmodifiableList(list);
|
||||
}
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/flow/design/index.html")
|
||||
@At("")
|
||||
@Ok("beetl:/platform/flow/design/index.html")
|
||||
@SaCheckPermission("flow.design")
|
||||
public void index() {
|
||||
}
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/flow/design/designer.html")
|
||||
@SaCheckLogin
|
||||
public void designer(HttpServletRequest request) {
|
||||
request.setAttribute("id", request.getParameter("id"));
|
||||
}
|
||||
@At
|
||||
@Ok("beetl:/platform/flow/design/designer.html")
|
||||
@SaCheckLogin
|
||||
public void designer(HttpServletRequest request) {
|
||||
request.setAttribute("id", request.getParameter("id"));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("获取流程设计分页列表")
|
||||
@At
|
||||
@ApiOperation("获取流程设计分页列表")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result pageData(PageForm pageForm, String displayName, String name, String category, Boolean deployed) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
public Result pageData(PageForm pageForm, String displayName, String name, String category, Boolean deployed) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.and(Cnd.likeEX(ProcessDesign::getDisplayName, displayName));
|
||||
cnd.and(Cnd.likeEX(ProcessDesign::getName, name));
|
||||
cnd.andEX(ProcessDesign::getCategory, "=", category);
|
||||
cnd.andEX(ProcessDesign::getIsDeployed, "=", deployed);
|
||||
|
||||
Pagination pagination = processDesignService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
Pagination pagination = processDesignService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("保存流程设计")
|
||||
@At
|
||||
@ApiOperation("保存流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result insert(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
dao.insert(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
public Result insert(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("picIcon", processDesign.getPicIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
dao.insert(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("修改流程设计")
|
||||
@At
|
||||
@ApiOperation("修改流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result update(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = processDesign.getContent();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
processDesignService.update(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
public Result update(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = processDesign.getContent();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("picIcon", processDesign.getPicIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
processDesignService.update(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("修改流程设计")
|
||||
@At
|
||||
@ApiOperation("修改流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result updateContent(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = processDesign.getContent();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
processDesignService.update(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
public Result updateContent(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = processDesign.getContent();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("picIcon", processDesign.getPicIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
processDesignService.update(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除流程设计")
|
||||
@At
|
||||
@ApiOperation("删除流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result delete(@Param("id") Long id) {
|
||||
dao.delete(ProcessDesign.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
public Result delete(@Param("id") Long id) {
|
||||
dao.delete(ProcessDesign.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("流程设计详情")
|
||||
public Result detail(@Param("id") Long id) {
|
||||
ProcessDesign design = dao.fetch(ProcessDesign.class, id);
|
||||
return Result.success(design);
|
||||
}
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("流程设计详情")
|
||||
public Result detail(@Param("id") Long id) {
|
||||
ProcessDesign design = dao.fetch(ProcessDesign.class, id);
|
||||
return Result.success(design);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("发布流程设计")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@At
|
||||
@ApiOperation("发布流程设计")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result deploy(@Param("id") Long id) {
|
||||
processDesignService.deploy(id);
|
||||
return Result.success();
|
||||
}
|
||||
public Result deploy(@Param("id") Long id) {
|
||||
processDesignService.deploy(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者处理类")
|
||||
public Result assigmentHandlerClass() {
|
||||
return Result.success(ASSIGMENT_HANDLER_LIST);
|
||||
}
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者处理类")
|
||||
public Result assigmentHandlerClass() {
|
||||
return Result.success(ASSIGMENT_HANDLER_LIST);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者处理类")
|
||||
public Result candidateHandlerClass() {
|
||||
return Result.success(CANDIDATE_HANDLER_LIST);
|
||||
}
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者处理类")
|
||||
public Result candidateHandlerClass() {
|
||||
return Result.success(CANDIDATE_HANDLER_LIST);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者分页数据")
|
||||
public Result assigneePage(Integer pageNumber, Integer pageSize, String searchKeyword, @Param("userIds") String[] userIds) {
|
||||
Sql sql = Sqls.create("select id,loginname,username,unitName from vw_user $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者分页数据")
|
||||
public Result assigneePage(Integer pageNumber, Integer pageSize, String searchKeyword, @Param("userIds") String[] userIds) {
|
||||
Sql sql = Sqls.create("select id,loginname,username,unitName from vw_user $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("username", searchKeyword);
|
||||
@@ -233,17 +236,17 @@ public class FlowDesignController {
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
// cnd.andEX("id", "in", userIds);
|
||||
Pagination pagination = sysUserService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
Pagination pagination = sysUserService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者分页数据回显")
|
||||
public Result assigneeEcho(@Param("userIds") String[] userIds) {
|
||||
Sql sql = Sqls.create("select id,loginname,username,unitName from vw_user where id in (@userIds)");
|
||||
sql.setParam("userIds", userIds);
|
||||
List<NutMap> list = sysUserService.listMap(sql);
|
||||
return Result.success(list);
|
||||
}
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者分页数据回显")
|
||||
public Result assigneeEcho(@Param("userIds") String[] userIds) {
|
||||
Sql sql = Sqls.create("select id,loginname,username,unitName from vw_user where id in (@userIds)");
|
||||
sql.setParam("userIds", userIds);
|
||||
List<NutMap> list = sysUserService.listMap(sql);
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,20 +12,25 @@ import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
@Comment("流程分类")
|
||||
public class ProcessCategory extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@PrevInsert(uu32 = true)
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String id;
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@PrevInsert(uu32 = true)
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String id;
|
||||
|
||||
@Comment("名称")
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String name;
|
||||
@Comment("名称")
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String name;
|
||||
|
||||
@Comment("图标")
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String icon;
|
||||
@Comment("图片图标")
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String picIcon;
|
||||
|
||||
@Comment("图标")
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String icon;
|
||||
|
||||
}
|
||||
|
||||
@@ -20,62 +20,66 @@ import org.nutz.dao.entity.annotation.*;
|
||||
@Comment("流程设计")
|
||||
public class ProcessDesign extends BaseModel {
|
||||
|
||||
@Comment("主键")
|
||||
@Id
|
||||
private Long id;
|
||||
@Comment("主键")
|
||||
@Id
|
||||
private Long id;
|
||||
|
||||
@Comment("唯一编码")
|
||||
@Column
|
||||
private String name;
|
||||
@Comment("唯一编码")
|
||||
@Column
|
||||
private String name;
|
||||
|
||||
@Comment("显示名称")
|
||||
@Column
|
||||
private String displayName;
|
||||
@Comment("显示名称")
|
||||
@Column
|
||||
private String displayName;
|
||||
|
||||
@Comment("流程分类")
|
||||
@Column
|
||||
private String type;
|
||||
@Comment("流程分类")
|
||||
@Column
|
||||
private String type;
|
||||
|
||||
@Comment("流程分类")
|
||||
@Column
|
||||
private String category;
|
||||
@Comment("流程分类")
|
||||
@Column
|
||||
private String category;
|
||||
|
||||
@Comment("电脑端发起地址")
|
||||
@Column
|
||||
private String instanceUrl;
|
||||
@Comment("电脑端发起地址")
|
||||
@Column
|
||||
private String instanceUrl;
|
||||
|
||||
@Comment("手机端发起地址")
|
||||
@Column
|
||||
private String h5InstanceUrl;
|
||||
@Comment("手机端发起地址")
|
||||
@Column
|
||||
private String h5InstanceUrl;
|
||||
|
||||
@Comment("电脑端发起地址")
|
||||
@Column
|
||||
private String instanceViewUrl;
|
||||
@Comment("电脑端发起地址")
|
||||
@Column
|
||||
private String instanceViewUrl;
|
||||
|
||||
@Comment("手机端发起地址")
|
||||
@Column
|
||||
private String h5InstanceViewUrl;
|
||||
@Comment("手机端发起地址")
|
||||
@Column
|
||||
private String h5InstanceViewUrl;
|
||||
|
||||
@Comment("图标")
|
||||
@Column
|
||||
private String icon;
|
||||
@Comment("图片图标")
|
||||
@Column
|
||||
private String picIcon;
|
||||
|
||||
@Comment("是否已部署")
|
||||
@Column
|
||||
private Integer isDeployed;
|
||||
@Comment("图标")
|
||||
@Column
|
||||
private String icon;
|
||||
|
||||
@Comment("备注")
|
||||
@Column
|
||||
private String remark;
|
||||
@Comment("是否已部署")
|
||||
@Column
|
||||
private Integer isDeployed;
|
||||
|
||||
@Comment("流程描述")
|
||||
@Column
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String description;
|
||||
@Comment("备注")
|
||||
@Column
|
||||
private String remark;
|
||||
|
||||
@Comment("流程定义")
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private JSONObject content;
|
||||
@Comment("流程描述")
|
||||
@Column
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String description;
|
||||
|
||||
@Comment("流程定义")
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private JSONObject content;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user