This commit is contained in:
zhouhefeng
2026-04-27 08:42:06 +08:00
parent dcbb1904c2
commit 48892370c0
14 changed files with 1890 additions and 463 deletions
@@ -18,6 +18,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
@@ -110,14 +111,39 @@ public class FlowDesignController {
@ApiOperation("获取流程设计分页列表")
@SaCheckPermission("flow.design")
public Result pageData(PageForm pageForm, String displayName, String name, String category, Boolean deployed) {
Sql sql = Sqls.create("""
SELECT
pd.*
FROM
wf_process_design pd
LEFT JOIN wf_process_category pc ON pc.id = pd.category
$condition
""");
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);
cnd.and(Cnd.likeEX("pd.displayName", displayName));
cnd.and(Cnd.likeEX("pd.name", name));
cnd.andEX("pd.category", "=", category);
cnd.andEX("pd.isDeployed", "=", deployed);
if ("sortNo".equals(pageForm.getPageOrderName())) {
if ("descending".equals(pageForm.getPageOrderBy())) {
cnd.desc("pd.sortNo");
} else {
cnd.asc("pd.sortNo");
}
} else if ("category".equals(pageForm.getPageOrderName())) {
if ("descending".equals(pageForm.getPageOrderBy())) {
cnd.desc("pc.name");
} else {
cnd.asc("pc.name");
}
} else {
cnd.asc("pd.sortNo");
}
cnd.asc("pd.id");
Pagination pagination = processDesignService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
sql.setCondition(cnd);
Pagination pagination = processDesignService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
@@ -206,6 +232,17 @@ public class FlowDesignController {
return Result.success();
}
@At
@ApiOperation("修改流程设计排序编码")
@SaCheckPermission("flow.design")
public Result updateSortNo(@Param("id") Long id, @Param("sortNo") Integer sortNo) {
if (id == null || sortNo == null || sortNo < 0) {
return Result.error("排序编码必须是非负整数");
}
processDesignService.update(Chain.make("sortNo", sortNo), Cnd.where(ProcessDesign::getId, "=", id));
return Result.success();
}
@At
@SaCheckLogin
@ApiOperation("获取流程设计任务参与者处理类")