|
|
@@ -219,6 +219,26 @@ public class ApiService {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ // api管理列表-获取带分页的page数据
|
|
|
+ public Map itemListHasPaging(Map<String, String> maps) {
|
|
|
+ String page = "1"; // 页数
|
|
|
+ String perPage = "15"; // 显示多少条
|
|
|
+ Map res = new HashMap<>();
|
|
|
+ Map bindData = commonUtil.filterApiBindParams(maps);
|
|
|
+ if(maps.containsKey("page")) {
|
|
|
+ page = maps.get("page");
|
|
|
+ }
|
|
|
+ if(maps.containsKey("perPage")) {
|
|
|
+ perPage = maps.get("perPage");
|
|
|
+ }
|
|
|
+ Integer count = pageDao.getAllItemListHasPagingCount(bindData);
|
|
|
+ List info = pageDao.getAllItemListHasPaging(bindData, page, perPage, count);
|
|
|
+ res.put("count", count);
|
|
|
+ res.put("rows", info);
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
// 获取全部sql_details
|
|
|
public List sqlList() {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
@@ -475,6 +495,69 @@ public class ApiService {
|
|
|
return info;
|
|
|
}
|
|
|
|
|
|
+ // 获取item详情
|
|
|
+ public Map itemDetailById(Map params) {
|
|
|
+ String id = params.get("id").toString();
|
|
|
+ Map info = apiDao.getDetailsInfoByIdAndType("item_details", id);
|
|
|
+
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 添加/编辑item_details表数据
|
|
|
+ public Map saveItem(Map maps, String authorization) {
|
|
|
+ String itemDesc = "";
|
|
|
+ String isEnable = maps.get("is_enable").toString();
|
|
|
+ String itemCode = maps.get("item_code").toString();
|
|
|
+ String itemName = maps.get("item_name").toString();
|
|
|
+ if(maps.containsKey("item_description")) {
|
|
|
+ itemDesc = maps.get("item_description").toString();
|
|
|
+ }
|
|
|
+ // 通过是否存在id,判读是新增还是修改
|
|
|
+ String editId = "";
|
|
|
+ if (maps.containsKey("id")) {
|
|
|
+ editId = maps.get("id").toString();
|
|
|
+ }
|
|
|
+ String createdAt = commonUtil.getNowYYMMDDHHIISS();
|
|
|
+ Map<String, Object> addPagePamars = new HashMap<>();
|
|
|
+ addPagePamars.put("isEnable", isEnable);
|
|
|
+ addPagePamars.put("itemCode", itemCode);
|
|
|
+ addPagePamars.put("itemName", itemName);
|
|
|
+ addPagePamars.put("itemDesc", itemDesc);
|
|
|
+// Map<String, Object> loginResult = this.userInfo(authorization);
|
|
|
+// addPagePamars.put("actionUser", loginResult.get("userName")); // 获取当前用户信息
|
|
|
+ if (editId.length()==0) {
|
|
|
+ // 如果不存在说明是新增
|
|
|
+ addPagePamars.put("createdAt", createdAt);
|
|
|
+ }
|
|
|
+ // 添加/编辑
|
|
|
+ Integer pageId = apiDao.saveItemDetails(addPagePamars, editId);
|
|
|
+ Map retInfo = new HashMap<>();
|
|
|
+ if(pageId <= 0){
|
|
|
+ retInfo.put("sysErrorCode", "500");
|
|
|
+ }
|
|
|
+ return retInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 用户管理列表-获取带分页的page数据
|
|
|
+ public Map userListHasPaging(Map<String, String> maps) {
|
|
|
+ String page = "1"; // 页数
|
|
|
+ String perPage = "15"; // 显示多少条
|
|
|
+ Map res = new HashMap<>();
|
|
|
+ Map bindData = commonUtil.filterApiBindParams(maps);
|
|
|
+ if(maps.containsKey("page")) {
|
|
|
+ page = maps.get("page");
|
|
|
+ }
|
|
|
+ if(maps.containsKey("perPage")) {
|
|
|
+ perPage = maps.get("perPage");
|
|
|
+ }
|
|
|
+ Integer count = pageDao.getAllUserListHasPagingCount(bindData);
|
|
|
+ List info = pageDao.getAllUserListHasPaging(bindData, page, perPage, count);
|
|
|
+ res.put("count", count);
|
|
|
+ res.put("rows", info);
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
// 转换tree结构数据
|
|
|
private List<Map<String, Object>> treeMenu(List<Map<String, Object>> renderMenu){
|
|
|
// 处理的数据存在
|