..
This commit is contained in:
@@ -47,6 +47,16 @@ public class SysHomeV4Controller {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务中心
|
||||
*/
|
||||
@At("/serv")
|
||||
@Ok("beetl:/layouts/v4/serv.html")
|
||||
@SaCheckLogin
|
||||
public void serv(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 子系统
|
||||
* @param appId 应用ID
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.budwk.app.sys.controller.v4;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.entity.ProcessCategory;
|
||||
import com.budwk.app.sys.services.SysMenuService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/v4/serv")
|
||||
@Api(value = "服务中心接口", tags = "服务中心接口")
|
||||
public class SysV4ServController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SysMenuService sysMenuService;
|
||||
|
||||
@At("/categories")
|
||||
@Ok("json")
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取分类")
|
||||
public Result categories() {
|
||||
List<ProcessCategory> list = dao.query(ProcessCategory.class, Cnd.NEW());
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At("/list")
|
||||
@Ok("json:full")
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取应用列表")
|
||||
public Result list(@Param("categoryId") String categoryId, @Param("letter") String letter, @Param("keyword") String keyword, HttpServletRequest req) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT t.*
|
||||
FROM wf_process_define t
|
||||
INNER JOIN (
|
||||
SELECT name, MAX(id) AS max_id
|
||||
FROM wf_process_define
|
||||
GROUP BY name
|
||||
) sub ON t.name = sub.name AND t.id = sub.max_id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(keyword)) {
|
||||
cnd.where().andLike("t.disPlayName", keyword);
|
||||
}
|
||||
cnd.andEX("t.category", "=", categoryId);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = sysMenuService.listMap(sql);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user