mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-01 18:05:28 +08:00
JeecgBoot 2.3 里程碑版本发布,支持微服务和单体自由切换、提供新行编辑表格JVXETable
This commit is contained in:
@ -0,0 +1,20 @@
|
||||
//package org.jeecg;
|
||||
//
|
||||
//import org.springframework.boot.SpringApplication;
|
||||
//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
//import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
//import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
//
|
||||
//import java.net.UnknownHostException;
|
||||
//
|
||||
//@SpringBootApplication
|
||||
//@EnableDiscoveryClient
|
||||
//@EnableFeignClients
|
||||
//@EnableAutoConfiguration(exclude={org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class})
|
||||
//public class JeecgDemoApplication {
|
||||
//
|
||||
// public static void main(String[] args) throws UnknownHostException {
|
||||
// SpringApplication.run(JeecgDemoApplication.class, args);
|
||||
// }
|
||||
//}
|
||||
@ -0,0 +1,204 @@
|
||||
package org.jeecg.modules.demo.mock;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.swing.filechooser.FileSystemView;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
@Slf4j
|
||||
public class MockController {
|
||||
|
||||
private final String JSON_PATH = "classpath:org/jeecg/modules/demo/mock/json";
|
||||
|
||||
/**
|
||||
* 通用json访问接口
|
||||
* 格式: http://localhost:8080/jeecg-boot/api/json/{filename}
|
||||
* @param filename
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/json/{filename}", method = RequestMethod.GET)
|
||||
public String getJsonData(@PathVariable String filename) {
|
||||
String jsonpath = "classpath:org/jeecg/modules/demo/mock/json/"+filename+".json";
|
||||
return readJson(jsonpath);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/asynTreeList")
|
||||
public String asynTreeList(String id) {
|
||||
return readJson(JSON_PATH + "/asyn_tree_list_" + id + ".json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/user")
|
||||
public String user() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/user.json");
|
||||
}
|
||||
|
||||
/**
|
||||
* 老的登录获取用户信息接口
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/user/info")
|
||||
public String userInfo() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/user_info.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/role")
|
||||
public String role() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/role.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/service")
|
||||
public String service() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/service.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/permission")
|
||||
public String permission() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/permission.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/permission/no-pager")
|
||||
public String permission_no_page() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/permission_no_page.json");
|
||||
}
|
||||
|
||||
/**
|
||||
* 省市县
|
||||
*/
|
||||
@GetMapping(value = "/area")
|
||||
public String area() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/area.json");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试报表数据
|
||||
*/
|
||||
@GetMapping(value = "/report/getYearCountInfo")
|
||||
public String getYearCountInfo() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/getCntrNoCountInfo.json");
|
||||
}
|
||||
@GetMapping(value = "/report/getMonthCountInfo")
|
||||
public String getMonthCountInfo() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/getCntrNoCountInfo.json");
|
||||
}
|
||||
@GetMapping(value = "/report/getCntrNoCountInfo")
|
||||
public String getCntrNoCountInfo() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/getCntrNoCountInfo.json");
|
||||
}
|
||||
@GetMapping(value = "/report/getCabinetCountInfo")
|
||||
public String getCabinetCountInfo() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/getCntrNoCountInfo.json");
|
||||
}
|
||||
|
||||
/**
|
||||
* 实时磁盘监控
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryDiskInfo")
|
||||
public Result<List<Map<String,Object>>> queryDiskInfo(HttpServletRequest request, HttpServletResponse response){
|
||||
Result<List<Map<String,Object>>> res = new Result<>();
|
||||
try {
|
||||
// 当前文件系统类
|
||||
FileSystemView fsv = FileSystemView.getFileSystemView();
|
||||
// 列出所有windows 磁盘
|
||||
File[] fs = File.listRoots();
|
||||
log.info("查询磁盘信息:"+fs.length+"个");
|
||||
List<Map<String,Object>> list = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < fs.length; i++) {
|
||||
if(fs[i].getTotalSpace()==0) {
|
||||
continue;
|
||||
}
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("name", fsv.getSystemDisplayName(fs[i]));
|
||||
map.put("max", fs[i].getTotalSpace());
|
||||
map.put("rest", fs[i].getFreeSpace());
|
||||
map.put("restPPT", fs[i].getFreeSpace()*100/fs[i].getTotalSpace());
|
||||
list.add(map);
|
||||
log.info(map.toString());
|
||||
}
|
||||
res.setResult(list);
|
||||
res.success("查询成功");
|
||||
} catch (Exception e) {
|
||||
res.error500("查询失败"+e.getMessage());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* 工作台首页的数据
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/list/search/projects")
|
||||
public String projects() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_projects.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/workplace/activity")
|
||||
public String activity() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_activity.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/workplace/teams")
|
||||
public String teams() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_teams.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/workplace/radar")
|
||||
public String radar() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_radar.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/task/process")
|
||||
public String taskProcess() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/task_process.json");
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
||||
//author:lvdandan-----date:20190315---for:添加数据日志json----
|
||||
public String sysDataLogJson() {
|
||||
return readJson("classpath:org/jeecg/modules/demo/mock/json/sysdatalog.json");
|
||||
}
|
||||
//author:lvdandan-----date:20190315---for:添加数据日志json----
|
||||
|
||||
/**
|
||||
* 读取json格式文件
|
||||
* @param jsonSrc
|
||||
* @return
|
||||
*/
|
||||
private String readJson(String jsonSrc) {
|
||||
String json = "";
|
||||
try {
|
||||
//File jsonFile = ResourceUtils.getFile(jsonSrc);
|
||||
//json = FileUtils.re.readFileToString(jsonFile);
|
||||
//换个写法,解决springboot读取jar包中文件的问题
|
||||
InputStream stream = getClass().getClassLoader().getResourceAsStream(jsonSrc.replace("classpath:", ""));
|
||||
json = IOUtils.toString(stream,"UTF-8");
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,36 @@
|
||||
[
|
||||
{"value": "110000", "label": "北京市"},
|
||||
{"value": "120000", "label": "天津市"},
|
||||
{"value": "130000", "label": "河北省"},
|
||||
{"value": "140000", "label": "山西省"},
|
||||
{"value": "150000", "label": "内蒙古自治区"},
|
||||
{"value": "210000", "label": "辽宁省"},
|
||||
{"value": "220000", "label": "吉林省"},
|
||||
{"value": "230000", "label": "黑龙江省"},
|
||||
{"value": "310000", "label": "上海市"},
|
||||
{"value": "320000", "label": "江苏省"},
|
||||
{"value": "330000", "label": "浙江省"},
|
||||
{"value": "340000", "label": "安徽省"},
|
||||
{"value": "350000", "label": "福建省"},
|
||||
{"value": "360000", "label": "江西省"},
|
||||
{"value": "370000", "label": "山东省"},
|
||||
{"value": "410000", "label": "河南省"},
|
||||
{"value": "420000", "label": "湖北省"},
|
||||
{"value": "430000", "label": "湖南省"},
|
||||
{"value": "440000", "label": "广东省"},
|
||||
{"value": "450000", "label": "广西壮族自治区"},
|
||||
{"value": "460000", "label": "海南省"},
|
||||
{"value": "500000", "label": "重庆市"},
|
||||
{"value": "510000", "label": "四川省"},
|
||||
{"value": "520000", "label": "贵州省"},
|
||||
{"value": "530000", "label": "云南省"},
|
||||
{"value": "540000", "label": "西藏自治区"},
|
||||
{"value": "610000", "label": "陕西省"},
|
||||
{"value": "620000", "label": "甘肃省"},
|
||||
{"value": "630000", "label": "青海省"},
|
||||
{"value": "640000", "label": "宁夏回族自治区"},
|
||||
{"value": "650000", "label": "新疆维吾尔自治区"},
|
||||
{"value": "710000", "label": "台湾省"},
|
||||
{"value": "810000", "label": "香港特别行政区"},
|
||||
{"value": "820000", "label": "澳门特别行政区"}
|
||||
]
|
||||
@ -0,0 +1,29 @@
|
||||
{
|
||||
"status": 200,
|
||||
"success": true,
|
||||
"message": "ok",
|
||||
"result": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "首页",
|
||||
"component": "dashboard/Analysis",
|
||||
"orderNum": 1,
|
||||
"hasChildren": false
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "常见案例",
|
||||
"component": "layouts/RouteView",
|
||||
"orderNum": 2,
|
||||
"hasChildren": true
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "系统监控",
|
||||
"component": "layouts/RouteView",
|
||||
"orderNum": 3,
|
||||
"hasChildren": true
|
||||
}
|
||||
],
|
||||
"timestamp": 1554950583837
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
{
|
||||
"status": 200,
|
||||
"success": true,
|
||||
"message": "ok",
|
||||
"result": [
|
||||
{
|
||||
"id": 11,
|
||||
"name": "首页",
|
||||
"component": "dashboard/Analysis",
|
||||
"orderNum": 1,
|
||||
"hasChildren": false
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"name": "系统管理",
|
||||
"component": "layouts/RouteView",
|
||||
"orderNum": 2,
|
||||
"hasChildren": true
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"name": "常见案例",
|
||||
"component": "layouts/RouteView",
|
||||
"orderNum": 3,
|
||||
"hasChildren": true
|
||||
}
|
||||
],
|
||||
"timestamp": 1554950583837
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
{
|
||||
"status": 200,
|
||||
"success": true,
|
||||
"message": "ok",
|
||||
"result": [
|
||||
{
|
||||
"id": 21,
|
||||
"name": "弹框选择Demo",
|
||||
"component": "jeecg/SelectDemo",
|
||||
"orderNum": 1,
|
||||
"hasChildren": false
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"name": "单表模型示例",
|
||||
"component": "jeecg/JeecgDemoList",
|
||||
"orderNum": 2,
|
||||
"hasChildren": false
|
||||
},
|
||||
{
|
||||
"id": 23,
|
||||
"name": "一对多Tab示例",
|
||||
"component": "jeecg/tablist/JeecgOrderDMainList",
|
||||
"orderNum": 3,
|
||||
"hasChildren": false
|
||||
}
|
||||
],
|
||||
"timestamp": 1554950583837
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
{
|
||||
"status": 200,
|
||||
"success": true,
|
||||
"message": "ok",
|
||||
"result": [
|
||||
{
|
||||
"id": 31,
|
||||
"name": "性能监控",
|
||||
"component": "layouts/RouteView",
|
||||
"orderNum": 1,
|
||||
"hasChildren": true
|
||||
},
|
||||
{
|
||||
"id": 32,
|
||||
"name": "在线文档",
|
||||
"component": "layouts/IframePageView",
|
||||
"orderNum": 2,
|
||||
"hasChildren": false
|
||||
},
|
||||
{
|
||||
"id": 33,
|
||||
"name": "工作台",
|
||||
"component": "dashboard/Workplace",
|
||||
"orderNum": 3,
|
||||
"hasChildren": false
|
||||
}
|
||||
],
|
||||
"timestamp": 1554950583837
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
{
|
||||
"status": 200,
|
||||
"success": true,
|
||||
"message": "ok",
|
||||
"result": [
|
||||
{
|
||||
"id": 311,
|
||||
"name": "Redis监控",
|
||||
"component": "modules/monitor/RedisInfo",
|
||||
"orderNum": 1,
|
||||
"hasChildren": false
|
||||
},
|
||||
{
|
||||
"id": 312,
|
||||
"name": "JVM信息",
|
||||
"component": "modules/monitor/JvmInfo",
|
||||
"orderNum": 2,
|
||||
"hasChildren": false
|
||||
},
|
||||
{
|
||||
"id": 313,
|
||||
"name": "Tomcat信息",
|
||||
"component": "modules/monitor/TomcatInfo",
|
||||
"orderNum": 3,
|
||||
"hasChildren": false
|
||||
}
|
||||
],
|
||||
"timestamp": 1554950583837
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
{
|
||||
"success": true,
|
||||
"message": "查询成功",
|
||||
"code": null,
|
||||
"result": [
|
||||
{
|
||||
"resultIndex": 0,
|
||||
"yearcount": 623,
|
||||
"year": 2016,
|
||||
"month": "四月",
|
||||
"monthcount": 3255,
|
||||
"classifyname": "证明类",
|
||||
"cntrnocount": 24,
|
||||
"cabinetname": "一号柜",
|
||||
"cabinetcocunt": 12
|
||||
},
|
||||
{
|
||||
"resultIndex": 1,
|
||||
"yearcount": 243,
|
||||
"year": 2017,
|
||||
"month": "五月",
|
||||
"monthcount": 5673,
|
||||
"classifyname": "产权类",
|
||||
"cntrnocount": 52,
|
||||
"cabinetname": "二号柜",
|
||||
"cabinetcocunt": 52
|
||||
},
|
||||
{
|
||||
"resultIndex": 2,
|
||||
"yearcount": 345,
|
||||
"year": 2018,
|
||||
"month": "六月",
|
||||
"monthcount": 2673,
|
||||
"classifyname": "知识类",
|
||||
"cntrnocount": 85,
|
||||
"cabinetname": "三号柜",
|
||||
"cabinetcocunt": 24
|
||||
},
|
||||
{
|
||||
"resultIndex": 3,
|
||||
"yearcount": 452,
|
||||
"year": 2019,
|
||||
"month": "七月",
|
||||
"monthcount": 2341,
|
||||
"classifyname": "技术类",
|
||||
"cntrnocount": 67,
|
||||
"cabinetname": "四号柜",
|
||||
"cabinetcocunt": 45
|
||||
},
|
||||
{
|
||||
"resultIndex": 4,
|
||||
"yearcount": 645,
|
||||
"year": 2020,
|
||||
"month": "八月",
|
||||
"monthcount": 7473,
|
||||
"classifyname": "工具类",
|
||||
"cntrnocount": 93,
|
||||
"cabinetname": "五号柜",
|
||||
"cabinetcocunt": 94
|
||||
}
|
||||
],
|
||||
"timestamp": 1554285003594
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
{
|
||||
"status": 200,
|
||||
"success": true,
|
||||
"message": "ok",
|
||||
"result": {
|
||||
"data": [
|
||||
{
|
||||
"id": 0,
|
||||
"x": "1",
|
||||
"y": 889
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"x": "2",
|
||||
"y": 341
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": "3",
|
||||
"y": 1028
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": "4",
|
||||
"y": 1168
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": "5",
|
||||
"y": 653
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": "6",
|
||||
"y": 863
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": "7",
|
||||
"y": 421
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": "8",
|
||||
"y": 1320
|
||||
}
|
||||
]
|
||||
},
|
||||
"timestamp": 1554950583837
|
||||
}
|
||||
@ -0,0 +1,156 @@
|
||||
{
|
||||
"message": "",
|
||||
"result": {
|
||||
"data": [
|
||||
{
|
||||
"id": "marketing",
|
||||
"name": "营销管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": null,
|
||||
"parents": null,
|
||||
"type": null,
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"query",
|
||||
"get",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "member",
|
||||
"name": "会员管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"query",
|
||||
"get",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "menu",
|
||||
"name": "菜单管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"import\",\"defaultCheck\":false,\"describe\":\"导入\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"import",
|
||||
"get",
|
||||
"update"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "order",
|
||||
"name": "订单管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"query",
|
||||
"get",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "permission",
|
||||
"name": "权限管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"get",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "role",
|
||||
"name": "角色管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"get",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "test",
|
||||
"name": "测试权限",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"get"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "user",
|
||||
"name": "用户管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"add\",\"describe\":\"新增\",\"defaultCheck\":false},{\"action\":\"get\",\"describe\":\"查询\",\"defaultCheck\":false}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"get"
|
||||
]
|
||||
}
|
||||
],
|
||||
"pageSize": 10,
|
||||
"pageNo": 0,
|
||||
"totalPage": 1,
|
||||
"totalCount": 5
|
||||
},
|
||||
"status": 200,
|
||||
"timestamp": 1537082021471
|
||||
}
|
||||
@ -0,0 +1,150 @@
|
||||
{
|
||||
"message": "",
|
||||
"result": [
|
||||
{
|
||||
"id": "marketing",
|
||||
"name": "营销管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": null,
|
||||
"parents": null,
|
||||
"type": null,
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"query",
|
||||
"get",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "member",
|
||||
"name": "会员管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"query",
|
||||
"get",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "menu",
|
||||
"name": "菜单管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"import\",\"defaultCheck\":false,\"describe\":\"导入\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"import",
|
||||
"get",
|
||||
"update"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "order",
|
||||
"name": "订单管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"query",
|
||||
"get",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "permission",
|
||||
"name": "权限管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"get",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "role",
|
||||
"name": "角色管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"get",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "test",
|
||||
"name": "测试权限",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"get"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "user",
|
||||
"name": "用户管理",
|
||||
"describe": null,
|
||||
"status": 1,
|
||||
"actionData": "[{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"},{\"action\":\"import\",\"defaultCheck\":false,\"describe\":\"导入\"},{\"action\":\"export\",\"defaultCheck\":false,\"describe\":\"导出\"}]",
|
||||
"sptDaTypes": null,
|
||||
"optionalFields": "[]",
|
||||
"parents": null,
|
||||
"type": "default",
|
||||
"deleted": 0,
|
||||
"actions": [
|
||||
"add",
|
||||
"get"
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": 200,
|
||||
"timestamp": 1537082021471
|
||||
}
|
||||
@ -0,0 +1,608 @@
|
||||
{
|
||||
"message": "",
|
||||
"result": {
|
||||
"data": [
|
||||
{
|
||||
"id": "admin",
|
||||
"name": "管理员",
|
||||
"describe": "拥有所有权限",
|
||||
"status": 1,
|
||||
"creatorId": "system",
|
||||
"createTime": 1497160610259,
|
||||
"deleted": 0,
|
||||
"permissions": [
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "comment",
|
||||
"permissionName": "评论管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "member",
|
||||
"permissionName": "会员管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "menu",
|
||||
"permissionName": "菜单管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"import\",\"defaultCheck\":false,\"describe\":\"导入\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "import",
|
||||
"describe": "导入",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "order",
|
||||
"permissionName": "订单管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "permission",
|
||||
"permissionName": "权限管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "role",
|
||||
"permissionName": "角色管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "test",
|
||||
"permissionName": "测试权限",
|
||||
"actions": "[]",
|
||||
"actionEntitySet": [],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "user",
|
||||
"permissionName": "用户管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"import\",\"defaultCheck\":false,\"describe\":\"导入\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"},{\"action\":\"export\",\"defaultCheck\":false,\"describe\":\"导出\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "import",
|
||||
"describe": "导入",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "export",
|
||||
"describe": "导出",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "svip",
|
||||
"name": "SVIP",
|
||||
"describe": "超级会员",
|
||||
"status": 1,
|
||||
"creatorId": "system",
|
||||
"createTime": 1532417744846,
|
||||
"deleted": 0,
|
||||
"permissions": [
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "comment",
|
||||
"permissionName": "评论管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "member",
|
||||
"permissionName": "会员管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "menu",
|
||||
"permissionName": "菜单管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"import\",\"defaultCheck\":false,\"describe\":\"导入\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "import",
|
||||
"describe": "导入",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "order",
|
||||
"permissionName": "订单管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "permission",
|
||||
"permissionName": "权限管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "role",
|
||||
"permissionName": "角色管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "test",
|
||||
"permissionName": "测试权限",
|
||||
"actions": "[]",
|
||||
"actionEntitySet": [],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "user",
|
||||
"permissionName": "用户管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"import\",\"defaultCheck\":false,\"describe\":\"导入\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"},{\"action\":\"export\",\"defaultCheck\":false,\"describe\":\"导出\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "import",
|
||||
"describe": "导入",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "user",
|
||||
"name": "普通会员",
|
||||
"describe": "普通用户,只能查询",
|
||||
"status": 1,
|
||||
"creatorId": "system",
|
||||
"createTime": 1497160610259,
|
||||
"deleted": 0,
|
||||
"permissions": [
|
||||
{
|
||||
"roleId": "user",
|
||||
"permissionId": "comment",
|
||||
"permissionName": "评论管理",
|
||||
"actions": "[{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "user",
|
||||
"permissionId": "marketing",
|
||||
"permissionName": "营销管理",
|
||||
"actions": "[]",
|
||||
"actionEntitySet": [],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "user",
|
||||
"permissionId": "member",
|
||||
"permissionName": "会员管理",
|
||||
"actions": "[{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "user",
|
||||
"permissionId": "menu",
|
||||
"permissionName": "菜单管理",
|
||||
"actions": "[]",
|
||||
"actionEntitySet": [],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "user",
|
||||
"permissionId": "order",
|
||||
"permissionName": "订单管理",
|
||||
"actions": "[{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "user",
|
||||
"permissionId": "permission",
|
||||
"permissionName": "权限管理",
|
||||
"actions": "[]",
|
||||
"actionEntitySet": [],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "user",
|
||||
"permissionId": "role",
|
||||
"permissionName": "角色管理",
|
||||
"actions": "[]",
|
||||
"actionEntitySet": [],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "user",
|
||||
"permissionId": "test",
|
||||
"permissionName": "测试权限",
|
||||
"actions": "[]",
|
||||
"actionEntitySet": [],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "user",
|
||||
"permissionId": "user",
|
||||
"permissionName": "用户管理",
|
||||
"actions": "[]",
|
||||
"actionEntitySet": [],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"pageSize": 10,
|
||||
"pageNo": 0,
|
||||
"totalPage": 1,
|
||||
"totalCount": 5
|
||||
},
|
||||
"status": 200,
|
||||
"timestamp": 1537079497645
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
{
|
||||
"message": "",
|
||||
"result": {
|
||||
"pageSize": 10,
|
||||
"pageNo": 0,
|
||||
"totalCount": 57,
|
||||
"totalPage": 6,
|
||||
"data": [
|
||||
{
|
||||
"key": 1,
|
||||
"no": "No 1",
|
||||
"description": "这是一段描述",
|
||||
"callNo": 127,
|
||||
"status": 2,
|
||||
"updatedAt": "1970-06-24 11:51:20",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": 2,
|
||||
"no": "No 2",
|
||||
"description": "这是一段描述",
|
||||
"callNo": 573,
|
||||
"status": 2,
|
||||
"updatedAt": "1994-12-11 00:37:35",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": 3,
|
||||
"no": "No 3",
|
||||
"description": "这是一段描述",
|
||||
"callNo": 869,
|
||||
"status": 2,
|
||||
"updatedAt": "2013-11-11 08:04:03",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": 4,
|
||||
"no": "No 4",
|
||||
"description": "这是一段描述",
|
||||
"callNo": 26,
|
||||
"status": 2,
|
||||
"updatedAt": "1990-11-04 15:41:42",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": 5,
|
||||
"no": "No 5",
|
||||
"description": "这是一段描述",
|
||||
"callNo": 20,
|
||||
"status": 2,
|
||||
"updatedAt": "1970-01-05 11:04:56",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": 6,
|
||||
"no": "No 6",
|
||||
"description": "这是一段描述",
|
||||
"callNo": 675,
|
||||
"status": 2,
|
||||
"updatedAt": "1983-06-06 04:09:04",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": 7,
|
||||
"no": "No 7",
|
||||
"description": "这是一段描述",
|
||||
"callNo": 512,
|
||||
"status": 3,
|
||||
"updatedAt": "1996-08-26 21:47:44",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": 8,
|
||||
"no": "No 8",
|
||||
"description": "这是一段描述",
|
||||
"callNo": 962,
|
||||
"status": 2,
|
||||
"updatedAt": "2004-08-15 23:15:22",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": 9,
|
||||
"no": "No 9",
|
||||
"description": "这是一段描述",
|
||||
"callNo": 318,
|
||||
"status": 3,
|
||||
"updatedAt": "1988-08-10 14:36:35",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": 10,
|
||||
"no": "No 10",
|
||||
"description": "这是一段描述",
|
||||
"callNo": 789,
|
||||
"status": 0,
|
||||
"updatedAt": "1988-12-27 23:39:41",
|
||||
"editable": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": 200,
|
||||
"timestamp": 1534955098193
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"mobilePhone":"1872222222",
|
||||
"officePhone":"1222222",
|
||||
"email":"",
|
||||
"createDate":"Jun 23, 2016 12:00:00 PM",
|
||||
"sex":"1",
|
||||
"depId":"402880e447e99cf10147e9a03b320003",
|
||||
"userName":"9001",
|
||||
"status":"1",
|
||||
"content":"111",
|
||||
"id":"4028ef81550c1a7901550c1cd6e70001"
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
{
|
||||
"success": true,
|
||||
"message": "操作成功!",
|
||||
"code": 0,
|
||||
"result": {
|
||||
"records": [
|
||||
{
|
||||
"taskId": "48701",
|
||||
"name": "start",
|
||||
"taskBeginTime": "2019-03-07 09:33:04",
|
||||
"taskEndTime": "2019-03-08 04:03:01",
|
||||
"principal": "测试体验账号",
|
||||
"result": "已完成"
|
||||
},
|
||||
{
|
||||
"taskId": "48702",
|
||||
"name": "部门领导审批",
|
||||
"taskBeginTime": "2019-03-07 09:33:04",
|
||||
"taskEndTime": "2019-03-08 04:03:01",
|
||||
"principal": "测试体验账号",
|
||||
"result": "已完成"
|
||||
},
|
||||
{
|
||||
"taskId": "48703",
|
||||
"name": "调整申请",
|
||||
"taskBeginTime": "2019-03-07 09:33:04",
|
||||
"taskEndTime": "2019-03-08 04:03:01",
|
||||
"principal": "测试体验账号",
|
||||
"result": "已完成"
|
||||
},
|
||||
{
|
||||
"taskId": "48704",
|
||||
"name": "人事审批",
|
||||
"taskBeginTime": "2019-03-07 09:33:04",
|
||||
"taskEndTime": "2019-03-08 04:03:01",
|
||||
"principal": "测试体验账号",
|
||||
"result": "已完成"
|
||||
},
|
||||
{
|
||||
"taskId": "48705",
|
||||
"name": "end",
|
||||
"taskBeginTime": "2019-03-07 09:33:04",
|
||||
"taskEndTime": "2019-03-08 04:03:01",
|
||||
"principal": "测试体验账号",
|
||||
"result": "已完成"
|
||||
}
|
||||
],
|
||||
"total": 0,
|
||||
"size": 10,
|
||||
"current": 1,
|
||||
"searchCount": true,
|
||||
"pages": 0
|
||||
},
|
||||
"timestamp": 1551922394641
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,407 @@
|
||||
{
|
||||
"message": "",
|
||||
"result": {
|
||||
"id": "4291d7da9005377ec9aec4a71ea837f",
|
||||
"name": "天野远子",
|
||||
"username": "admin",
|
||||
"password": "",
|
||||
"avatar": "/avatar2.jpg",
|
||||
"status": 1,
|
||||
"telephone": "",
|
||||
"lastLoginIp": "27.154.74.117",
|
||||
"lastLoginTime": 1534837621348,
|
||||
"creatorId": "admin",
|
||||
"createTime": 1497160610259,
|
||||
"merchantCode": "TLif2btpzg079h15bk",
|
||||
"deleted": 0,
|
||||
"roleId": "admin",
|
||||
"role": {
|
||||
"id": "admin",
|
||||
"name": "管理员",
|
||||
"describe": "拥有所有权限",
|
||||
"status": 1,
|
||||
"creatorId": "system",
|
||||
"createTime": 1497160610259,
|
||||
"deleted": 0,
|
||||
"permissions": [
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "dashboard",
|
||||
"permissionName": "仪表盘",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "exception",
|
||||
"permissionName": "异常页面权限",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "result",
|
||||
"permissionName": "结果权限",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "profile",
|
||||
"permissionName": "详细页权限",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "table",
|
||||
"permissionName": "表格权限",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"import\",\"defaultCheck\":false,\"describe\":\"导入\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "import",
|
||||
"describe": "导入",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "form",
|
||||
"permissionName": "表单权限",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "order",
|
||||
"permissionName": "订单管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "permission",
|
||||
"permissionName": "权限管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "role",
|
||||
"permissionName": "角色管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "table",
|
||||
"permissionName": "桌子管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "query",
|
||||
"describe": "查询",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
},
|
||||
{
|
||||
"roleId": "admin",
|
||||
"permissionId": "user",
|
||||
"permissionName": "用户管理",
|
||||
"actions": "[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"import\",\"defaultCheck\":false,\"describe\":\"导入\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"},{\"action\":\"export\",\"defaultCheck\":false,\"describe\":\"导出\"}]",
|
||||
"actionEntitySet": [
|
||||
{
|
||||
"action": "add",
|
||||
"describe": "新增",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "import",
|
||||
"describe": "导入",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "get",
|
||||
"describe": "详情",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "update",
|
||||
"describe": "修改",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"describe": "删除",
|
||||
"defaultCheck": false
|
||||
},
|
||||
{
|
||||
"action": "export",
|
||||
"describe": "导出",
|
||||
"defaultCheck": false
|
||||
}
|
||||
],
|
||||
"actionList": null,
|
||||
"dataAccess": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"status": 200,
|
||||
"timestamp": 1534844188679
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
{
|
||||
"message": "",
|
||||
"result": [
|
||||
{
|
||||
"id": 1,
|
||||
"user": {
|
||||
"nickname": "Barbara Lee",
|
||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"
|
||||
},
|
||||
"project": {
|
||||
"name": "白鹭酱油开发组",
|
||||
"action": "更新",
|
||||
"event": "番组计划"
|
||||
},
|
||||
"time": "2018-08-23 14:47:00"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"user": {
|
||||
"nickname": "蓝莓酱",
|
||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png"
|
||||
},
|
||||
"project": {
|
||||
"name": "白鹭酱油开发组",
|
||||
"action": "更新",
|
||||
"event": "番组计划"
|
||||
},
|
||||
"time": "2018-08-23 09:35:37"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"user": {
|
||||
"nickname": "Brian Young",
|
||||
"avatar": "http://dummyimage.com/64x64"
|
||||
},
|
||||
"project": {
|
||||
"name": "白鹭酱油开发组",
|
||||
"action": "创建",
|
||||
"event": "番组计划"
|
||||
},
|
||||
"time": "2017-05-27 00:00:00"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"user": {
|
||||
"nickname": "曲丽丽",
|
||||
"avatar": "http://dummyimage.com/64x64"
|
||||
},
|
||||
"project": {
|
||||
"name": "高逼格设计天团",
|
||||
"action": "更新",
|
||||
"event": "六月迭代"
|
||||
},
|
||||
"time": "2018-08-23 14:47:00"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"user": {
|
||||
"nickname": "Dorothy Thompson",
|
||||
"avatar": "http://dummyimage.com/64x64"
|
||||
},
|
||||
"project": {
|
||||
"name": "高逼格设计天团",
|
||||
"action": "created",
|
||||
"event": "六月迭代"
|
||||
},
|
||||
"time": "2018-08-23 14:47:00"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"user": {
|
||||
"nickname": "曲丽丽",
|
||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"
|
||||
},
|
||||
"project": {
|
||||
"name": "高逼格设计天团",
|
||||
"action": "created",
|
||||
"event": "六月迭代"
|
||||
},
|
||||
"time": "2018-08-23 14:47:00"
|
||||
}
|
||||
],
|
||||
"status": 200,
|
||||
"timestamp": 0
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
{
|
||||
"message": "",
|
||||
"result": {
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"cover": "https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png",
|
||||
"title": "Alipay",
|
||||
"description": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"status": 1,
|
||||
"updatedAt": "2018-07-26 00:00:00"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"cover": "https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png",
|
||||
"title": "Angular",
|
||||
"description": "希望是一个好东西,也许是最好的,好东西是不会消亡的",
|
||||
"status": 1,
|
||||
"updatedAt": "2018-07-26 00:00:00"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"cover": "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png",
|
||||
"title": "Ant Design",
|
||||
"description": "城镇中有那么多的酒馆,她却偏偏走进了我的酒馆",
|
||||
"status": 1,
|
||||
"updatedAt": "2018-07-26 00:00:00"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"cover": "https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png",
|
||||
"title": "Ant Design Pro",
|
||||
"description": "那时候我只会想自己想要什么,从不想自己拥有什么",
|
||||
"status": 1,
|
||||
"updatedAt": "2018-07-26 00:00:00"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"cover": "https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png",
|
||||
"title": "Bootstrap",
|
||||
"description": "凛冬将至",
|
||||
"status": 1,
|
||||
"updatedAt": "2018-07-26 00:00:00"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"cover": "https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png",
|
||||
"title": "Vue",
|
||||
"description": "生命就像一盒巧克力,结果往往出人意料",
|
||||
"status": 1,
|
||||
"updatedAt": "2018-07-26 00:00:00"
|
||||
}
|
||||
],
|
||||
"pageSize": 10,
|
||||
"pageNo": 1,
|
||||
"totalPage": 6,
|
||||
"totalCount": 57
|
||||
},
|
||||
"status": 200,
|
||||
"timestamp": 1534955098193
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
{
|
||||
"message": "",
|
||||
"result": [
|
||||
{
|
||||
"item": "引用",
|
||||
"个人": 70,
|
||||
"团队": 30,
|
||||
"部门": 40
|
||||
},
|
||||
{
|
||||
"item": "口碑",
|
||||
"个人": 60,
|
||||
"团队": 70,
|
||||
"部门": 40
|
||||
},
|
||||
{
|
||||
"item": "产量",
|
||||
"个人": 50,
|
||||
"团队": 60,
|
||||
"部门": 40
|
||||
},
|
||||
{
|
||||
"item": "贡献",
|
||||
"个人": 40,
|
||||
"团队": 50,
|
||||
"部门": 40
|
||||
},
|
||||
{
|
||||
"item": "热度",
|
||||
"个人": 60,
|
||||
"团队": 70,
|
||||
"部门": 40
|
||||
},
|
||||
{
|
||||
"item": "引用",
|
||||
"个人": 70,
|
||||
"团队": 50,
|
||||
"部门": 40
|
||||
}
|
||||
],
|
||||
"status": 200,
|
||||
"timestamp": 1534955098193
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
{
|
||||
"message": "",
|
||||
"result": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "科学搬砖组",
|
||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "程序员日常",
|
||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/cnrhVkzwxjPwAaCfPbdc.png"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "设计天团",
|
||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/gaOngJwsRYRaVAuXXcmB.png"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "中二少女团",
|
||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/ubnKSIfAJTxIgXOKlciN.png"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "骗你学计算机",
|
||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/WhxKECPNujWoWEFNdnJE.png"
|
||||
}
|
||||
],
|
||||
"status": 200,
|
||||
"timestamp": 0
|
||||
}
|
||||
@ -0,0 +1,408 @@
|
||||
package org.jeecg.modules.demo.mock.vxe.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.VXESocketConst;
|
||||
import org.jeecg.common.system.query.MatchTypeEnum;
|
||||
import org.jeecg.common.system.query.QueryCondition;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.demo.mock.vxe.entity.MockEntity;
|
||||
import org.jeecg.modules.demo.mock.vxe.websocket.VXESocket;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mock/vxe")
|
||||
@Slf4j
|
||||
public class VxeMockController {
|
||||
|
||||
/**
|
||||
* 模拟更改状态
|
||||
*
|
||||
* @param id
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change1")
|
||||
public Result mockChange1(@RequestParam("id") String id, @RequestParam("status") String status) {
|
||||
/* id 为 行的id(rowId),只要获取到rowId,那么只需要调用 VXESocket.sendMessageToAll() 即可 */
|
||||
|
||||
// 封装行数据
|
||||
JSONObject rowData = new JSONObject();
|
||||
// 这个字段就是要更改的行数据ID
|
||||
rowData.put("id", id);
|
||||
// 这个字段就是要更改的列的key和具体的值
|
||||
rowData.put("status", status);
|
||||
// 模拟更改数据
|
||||
this.mockChange(rowData);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟更改拖轮状态
|
||||
*
|
||||
* @param id
|
||||
* @param tug_status
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change2")
|
||||
public Result mockChange2(@RequestParam("id") String id, @RequestParam("tug_status") String tug_status) {
|
||||
/* id 为 行的id(rowId),只要获取到rowId,那么只需要调用 VXESocket.sendMessageToAll() 即可 */
|
||||
|
||||
// 封装行数据
|
||||
JSONObject rowData = new JSONObject();
|
||||
// 这个字段就是要更改的行数据ID
|
||||
rowData.put("id", id);
|
||||
// 这个字段就是要更改的列的key和具体的值
|
||||
JSONObject tugStatus = JSON.parseObject(tug_status);
|
||||
rowData.put("tug_status", tugStatus);
|
||||
// 模拟更改数据
|
||||
this.mockChange(rowData);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟更改进度条状态
|
||||
*
|
||||
* @param id
|
||||
* @param progress
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change3")
|
||||
public Result mockChange3(@RequestParam("id") String id, @RequestParam("progress") String progress) {
|
||||
/* id 为 行的id(rowId),只要获取到rowId,那么只需要调用 VXESocket.sendMessageToAll() 即可 */
|
||||
|
||||
// 封装行数据
|
||||
JSONObject rowData = new JSONObject();
|
||||
// 这个字段就是要更改的行数据ID
|
||||
rowData.put("id", id);
|
||||
// 这个字段就是要更改的列的key和具体的值
|
||||
rowData.put("progress", progress);
|
||||
// 模拟更改数据
|
||||
this.mockChange(rowData);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
private void mockChange(JSONObject rowData) {
|
||||
// 封装socket数据
|
||||
JSONObject socketData = new JSONObject();
|
||||
// 这里的 socketKey 必须要和调度计划页面上写的 socketKey 属性保持一致
|
||||
socketData.put("socketKey", "page-dispatch");
|
||||
// 这里的 args 必须得是一个数组,下标0是行数据,下标1是caseId,一般不用传
|
||||
socketData.put("args", new Object[]{rowData, ""});
|
||||
// 封装消息字符串,这里的
|
||||
// type 必须是 VXESocketConst.TYPE_UVT
|
||||
String message = VXESocket.packageMessage(VXESocketConst.TYPE_UVT, socketData);
|
||||
// 调用 sendMessageToAll 发送给所有在线的用户
|
||||
VXESocket.sendMessageToAll(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟更改【大船待审】状态
|
||||
*
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change4")
|
||||
public Result mockChange4(@RequestParam("status") String status) {
|
||||
// 封装socket数据
|
||||
JSONObject socketData = new JSONObject();
|
||||
// 这里的 key 是前端注册时使用的key,必须保持一致
|
||||
socketData.put("key", "dispatch-dcds-status");
|
||||
// 这里的 args 必须得是一个数组,每一位都是注册方法的参数,按顺序传递
|
||||
socketData.put("args", new Object[]{status});
|
||||
|
||||
// 封装消息字符串,这里的 type 必须是 VXESocketConst.TYPE_UVT
|
||||
String message = VXESocket.packageMessage(VXESocketConst.TYPE_CSD, socketData);
|
||||
// 调用 sendMessageToAll 发送给所有在线的用户
|
||||
VXESocket.sendMessageToAll(message);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 【模拟】即时保存单行数据
|
||||
*
|
||||
* @param rowData 行数据,实际使用时可以替换成一个实体类
|
||||
*/
|
||||
@PutMapping("/immediateSaveRow")
|
||||
public Result mockImmediateSaveRow(@RequestBody JSONObject rowData) throws Exception {
|
||||
System.out.println("即时保存.rowData:" + rowData.toJSONString());
|
||||
// 延时1.5秒,模拟网慢堵塞真实感
|
||||
Thread.sleep(500);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 【模拟】即时保存整个表格的数据
|
||||
*
|
||||
* @param tableData 表格数据(实际使用时可以替换成一个List实体类)
|
||||
*/
|
||||
@PostMapping("/immediateSaveAll")
|
||||
public Result mockImmediateSaveAll(@RequestBody JSONArray tableData) throws Exception {
|
||||
// 【注】:
|
||||
// 1、tableData里包含该页所有的数据
|
||||
// 2、如果你实现了“即时保存”,那么除了新增的数据,其他的都是已经保存过的了,
|
||||
// 不需要再进行一次update操作了,所以可以在前端传数据的时候就遍历判断一下,
|
||||
// 只传新增的数据给后台insert即可,否者将会造成性能上的浪费。
|
||||
// 3、新增的行是没有id的,通过这一点,就可以判断是否是新增的数据
|
||||
|
||||
System.out.println("即时保存.tableData:" + tableData.toJSONString());
|
||||
// 延时1.5秒,模拟网慢堵塞真实感
|
||||
Thread.sleep(1000);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模拟数据
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页大小
|
||||
* @param parentId 父ID,不传则查询顶级
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getData")
|
||||
public Result getMockData(
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
// 父级id,根据父级id查询子级,如果为空则查询顶级
|
||||
@RequestParam(name = "parentId", required = false) String parentId
|
||||
) {
|
||||
// 模拟JSON数据路径
|
||||
String path = "classpath:org/jeecg/modules/demo/mock/vxe/json/dlglong.json";
|
||||
// 读取JSON数据
|
||||
JSONArray dataList = readJsonData(path);
|
||||
if (dataList == null) {
|
||||
return Result.error("读取数据失败!");
|
||||
}
|
||||
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模拟“调度计划”页面的数据
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页大小
|
||||
* @param parentId 父ID,不传则查询顶级
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDdjhData")
|
||||
public Result getMockDdjhData(
|
||||
// SpringMVC 会自动将参数注入到实体里
|
||||
MockEntity mockEntity,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
// 父级id,根据父级id查询子级,如果为空则查询顶级
|
||||
@RequestParam(name = "parentId", required = false) String parentId,
|
||||
@RequestParam(name = "status", required = false) String status,
|
||||
// 高级查询条件
|
||||
@RequestParam(name = "superQueryParams", required = false) String superQueryParams,
|
||||
// 高级查询模式
|
||||
@RequestParam(name = "superQueryMatchType", required = false) String superQueryMatchType,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
// 获取查询条件(前台传递的查询参数)
|
||||
Map<String, String[]> parameterMap = request.getParameterMap();
|
||||
// 遍历输出到控制台
|
||||
System.out.println("\ngetDdjhData - 普通查询条件:");
|
||||
for (String key : parameterMap.keySet()) {
|
||||
System.out.println("-- " + key + ": " + JSON.toJSONString(parameterMap.get(key)));
|
||||
}
|
||||
// 输出高级查询
|
||||
try {
|
||||
System.out.println("\ngetDdjhData - 高级查询条件:");
|
||||
// 高级查询模式
|
||||
MatchTypeEnum matchType = MatchTypeEnum.getByValue(superQueryMatchType);
|
||||
if (matchType == null) {
|
||||
System.out.println("-- 高级查询模式:不识别(" + superQueryMatchType + ")");
|
||||
} else {
|
||||
System.out.println("-- 高级查询模式:" + matchType.getValue());
|
||||
}
|
||||
superQueryParams = URLDecoder.decode(superQueryParams, "UTF-8");
|
||||
List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class);
|
||||
if (conditions != null) {
|
||||
for (QueryCondition condition : conditions) {
|
||||
System.out.println("-- " + JSON.toJSONString(condition));
|
||||
}
|
||||
} else {
|
||||
System.out.println("-- 没有传递任何高级查询条件");
|
||||
}
|
||||
System.out.println();
|
||||
} catch (Exception e) {
|
||||
log.error("-- 高级查询操作失败:" + superQueryParams, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
/* 注:实际使用中不用写上面那种繁琐的代码,这里只是为了直观的输出到控制台里而写的示例,
|
||||
使用下面这种写法更简洁方便 */
|
||||
|
||||
// 封装成 MyBatisPlus 能识别的 QueryWrapper,可以直接使用这个对象进行SQL筛选条件拼接
|
||||
// 这个方法也会自动封装高级查询条件,但是高级查询参数名必须是superQueryParams和superQueryMatchType
|
||||
QueryWrapper<MockEntity> queryWrapper = QueryGenerator.initQueryWrapper(mockEntity, parameterMap);
|
||||
System.out.println("queryWrapper: " + queryWrapper.getCustomSqlSegment());
|
||||
|
||||
// 模拟JSON数据路径
|
||||
String path = "classpath:org/jeecg/modules/demo/mock/vxe/json/ddjh.json";
|
||||
if ("8".equals(status)) {
|
||||
path = "classpath:org/jeecg/modules/demo/mock/vxe/json/ddjh_s8.json";
|
||||
}
|
||||
// 读取JSON数据
|
||||
JSONArray dataList = readJsonData(path);
|
||||
if (dataList == null) {
|
||||
return Result.error("读取数据失败!");
|
||||
}
|
||||
|
||||
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
|
||||
// 逐行查询子表数据,用于计算拖轮状态
|
||||
List<JSONObject> records = page.getRecords();
|
||||
for (JSONObject record : records) {
|
||||
Map<String, Integer> tugStatusMap = new HashMap<>();
|
||||
String id = record.getString("id");
|
||||
// 查询出主表的拖轮
|
||||
String tugMain = record.getString("tug");
|
||||
// 判断是否有值
|
||||
if (StringUtils.isNotBlank(tugMain)) {
|
||||
// 拖轮根据分号分割
|
||||
String[] tugs = tugMain.split(";");
|
||||
// 查询子表数据
|
||||
List<JSONObject> subRecords = this.queryDataPage(dataList, id, null, null).getRecords();
|
||||
// 遍历子表和拖轮数据,找出进行计算反推拖轮状态
|
||||
for (JSONObject subData : subRecords) {
|
||||
String subTug = subData.getString("tug");
|
||||
if (StringUtils.isNotBlank(subTug)) {
|
||||
for (String tug : tugs) {
|
||||
if (tug.equals(subTug)) {
|
||||
// 计算拖轮状态逻辑
|
||||
int statusCode = 0;
|
||||
|
||||
/* 如果有发船时间、作业开始时间、作业结束时间、回船时间,则主表中的拖轮列中的每个拖轮背景色要即时变色 */
|
||||
|
||||
// 有发船时间,状态 +1
|
||||
String departureTime = subData.getString("departure_time");
|
||||
if (StringUtils.isNotBlank(departureTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有作业开始时间,状态 +1
|
||||
String workBeginTime = subData.getString("work_begin_time");
|
||||
if (StringUtils.isNotBlank(workBeginTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有作业结束时间,状态 +1
|
||||
String workEndTime = subData.getString("work_end_time");
|
||||
if (StringUtils.isNotBlank(workEndTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有回船时间,状态 +1
|
||||
String returnTime = subData.getString("return_time");
|
||||
if (StringUtils.isNotBlank(returnTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 保存拖轮状态,key是拖轮的值,value是状态,前端根据不同的状态码,显示不同的颜色,这个颜色也可以后台计算完之后返回给前端直接使用
|
||||
tugStatusMap.put(tug, statusCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 新加一个字段用于保存拖轮状态,不要直接覆盖原来的,这个字段可以不保存到数据库里
|
||||
record.put("tug_status", tugStatusMap);
|
||||
}
|
||||
page.setRecords(records);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟查询数据,可以根据父ID查询,可以分页
|
||||
*
|
||||
* @param dataList 数据列表
|
||||
* @param parentId 父ID
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页大小
|
||||
* @return
|
||||
*/
|
||||
private IPage<JSONObject> queryDataPage(JSONArray dataList, String parentId, Integer pageNo, Integer pageSize) {
|
||||
// 根据父级id查询子级
|
||||
JSONArray dataDB = dataList;
|
||||
if (StringUtils.isNotBlank(parentId)) {
|
||||
JSONArray results = new JSONArray();
|
||||
List<String> parentIds = Arrays.asList(parentId.split(","));
|
||||
this.queryByParentId(dataDB, parentIds, results);
|
||||
dataDB = results;
|
||||
}
|
||||
// 模拟分页(实际中应用SQL自带的分页)
|
||||
List<JSONObject> records = new ArrayList<>();
|
||||
IPage<JSONObject> page;
|
||||
long beginIndex, endIndex;
|
||||
// 如果任意一个参数为null,则不分页
|
||||
if (pageNo == null || pageSize == null) {
|
||||
page = new Page<>(0, dataDB.size());
|
||||
beginIndex = 0;
|
||||
endIndex = dataDB.size();
|
||||
} else {
|
||||
page = new Page<>(pageNo, pageSize);
|
||||
beginIndex = page.offset();
|
||||
endIndex = page.offset() + page.getSize();
|
||||
}
|
||||
for (long i = beginIndex; (i < endIndex && i < dataDB.size()); i++) {
|
||||
JSONObject data = dataDB.getJSONObject((int) i);
|
||||
data = JSON.parseObject(data.toJSONString());
|
||||
// 不返回 children
|
||||
data.remove("children");
|
||||
records.add(data);
|
||||
}
|
||||
page.setRecords(records);
|
||||
page.setTotal(dataDB.size());
|
||||
return page;
|
||||
}
|
||||
|
||||
private void queryByParentId(JSONArray dataList, List<String> parentIds, JSONArray results) {
|
||||
for (int i = 0; i < dataList.size(); i++) {
|
||||
JSONObject data = dataList.getJSONObject(i);
|
||||
JSONArray children = data.getJSONArray("children");
|
||||
// 找到了该父级
|
||||
if (parentIds.contains(data.getString("id"))) {
|
||||
if (children != null) {
|
||||
// addAll 的目的是将多个子表的数据合并在一起
|
||||
results.addAll(children);
|
||||
}
|
||||
} else {
|
||||
if (children != null) {
|
||||
queryByParentId(children, parentIds, results);
|
||||
}
|
||||
}
|
||||
}
|
||||
results.addAll(new JSONArray());
|
||||
}
|
||||
|
||||
private JSONArray readJsonData(String path) {
|
||||
try {
|
||||
InputStream stream = getClass().getClassLoader().getResourceAsStream(path.replace("classpath:", ""));
|
||||
if (stream != null) {
|
||||
String json = IOUtils.toString(stream, "UTF-8");
|
||||
return JSON.parseArray(json);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package org.jeecg.modules.demo.mock.vxe.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 模拟实体
|
||||
*/
|
||||
@Data
|
||||
public class MockEntity {
|
||||
|
||||
// id
|
||||
private String id;
|
||||
// 父级ID
|
||||
private String parentId;
|
||||
// 状态
|
||||
private String status;
|
||||
|
||||
/* -- 省略其他字段 -- */
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,216 @@
|
||||
package org.jeecg.modules.demo.mock.vxe.websocket;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.constant.VXESocketConst;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.websocket.OnClose;
|
||||
import javax.websocket.OnMessage;
|
||||
import javax.websocket.OnOpen;
|
||||
import javax.websocket.Session;
|
||||
import javax.websocket.server.PathParam;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* vxe WebSocket,用于实现实时无痕刷新的功能
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@ServerEndpoint("/vxeSocket/{userId}/{pageId}")
|
||||
public class VXESocket {
|
||||
|
||||
/**
|
||||
* 当前 session
|
||||
*/
|
||||
private Session session;
|
||||
/**
|
||||
* 当前用户id
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 页面id,用于标识同一用户,不同页面的数据
|
||||
*/
|
||||
private String pageId;
|
||||
/**
|
||||
* 当前socket唯一id
|
||||
*/
|
||||
private String socketId;
|
||||
|
||||
/**
|
||||
* 用户连接池,包含单个用户的所有socket连接;
|
||||
* 因为一个用户可能打开多个页面,多个页面就会有多个连接;
|
||||
* key是userId,value是Map对象;子Map的key是pageId,value是VXESocket对象
|
||||
*/
|
||||
private static Map<String, Map<String, VXESocket>> userPool = new HashMap<>();
|
||||
/**
|
||||
* 连接池,包含所有WebSocket连接;
|
||||
* key是socketId,value是VXESocket对象
|
||||
*/
|
||||
private static Map<String, VXESocket> socketPool = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 获取某个用户所有的页面
|
||||
*/
|
||||
public static Map<String, VXESocket> getUserPool(String userId) {
|
||||
return userPool.computeIfAbsent(userId, k -> new HashMap<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 向当前用户发送消息
|
||||
*
|
||||
* @param message 消息内容
|
||||
*/
|
||||
public void sendMessage(String message) {
|
||||
try {
|
||||
this.session.getAsyncRemote().sendText(message);
|
||||
} catch (Exception e) {
|
||||
log.error("【vxeSocket】消息发送失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装消息json
|
||||
*
|
||||
* @param data 消息内容
|
||||
*/
|
||||
public static String packageMessage(String type, Object data) {
|
||||
JSONObject message = new JSONObject();
|
||||
message.put(VXESocketConst.TYPE, type);
|
||||
message.put(VXESocketConst.DATA, data);
|
||||
return message.toJSONString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 向指定用户的所有页面发送消息
|
||||
*
|
||||
* @param userId 接收消息的用户ID
|
||||
* @param message 消息内容
|
||||
*/
|
||||
public static void sendMessageTo(String userId, String message) {
|
||||
Collection<VXESocket> values = getUserPool(userId).values();
|
||||
if (values.size() > 0) {
|
||||
for (VXESocket socketItem : values) {
|
||||
socketItem.sendMessage(message);
|
||||
}
|
||||
} else {
|
||||
log.warn("【vxeSocket】消息发送失败:userId\"" + userId + "\"不存在或未在线!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向指定用户的指定页面发送消息
|
||||
*
|
||||
* @param userId 接收消息的用户ID
|
||||
* @param message 消息内容
|
||||
*/
|
||||
public static void sendMessageTo(String userId, String pageId, String message) {
|
||||
VXESocket socketItem = getUserPool(userId).get(pageId);
|
||||
if (socketItem != null) {
|
||||
socketItem.sendMessage(message);
|
||||
} else {
|
||||
log.warn("【vxeSocket】消息发送失败:userId\"" + userId + "\"的pageId\"" + pageId + "\"不存在或未在线!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向多个用户的所有页面发送消息
|
||||
*
|
||||
* @param userIds 接收消息的用户ID数组
|
||||
* @param message 消息内容
|
||||
*/
|
||||
public static void sendMessageTo(String[] userIds, String message) {
|
||||
for (String userId : userIds) {
|
||||
VXESocket.sendMessageTo(userId, message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向所有用户的所有页面发送消息
|
||||
*
|
||||
* @param message 消息内容
|
||||
*/
|
||||
public static void sendMessageToAll(String message) {
|
||||
for (VXESocket socketItem : socketPool.values()) {
|
||||
socketItem.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* websocket 开启连接
|
||||
*/
|
||||
@OnOpen
|
||||
public void onOpen(Session session, @PathParam("userId") String userId, @PathParam("pageId") String pageId) {
|
||||
try {
|
||||
this.userId = userId;
|
||||
this.pageId = pageId;
|
||||
this.socketId = userId + pageId;
|
||||
this.session = session;
|
||||
|
||||
socketPool.put(this.socketId, this);
|
||||
getUserPool(userId).put(this.pageId, this);
|
||||
|
||||
log.info("【vxeSocket】有新的连接,总数为:" + socketPool.size());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* websocket 断开连接
|
||||
*/
|
||||
@OnClose
|
||||
public void onClose() {
|
||||
try {
|
||||
socketPool.remove(this.socketId);
|
||||
getUserPool(this.userId).remove(this.pageId);
|
||||
|
||||
log.info("【vxeSocket】连接断开,总数为:" + socketPool.size());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* websocket 收到消息
|
||||
*/
|
||||
@OnMessage
|
||||
public void onMessage(String message) {
|
||||
// log.info("【vxeSocket】onMessage:" + message);
|
||||
JSONObject json;
|
||||
try {
|
||||
json = JSON.parseObject(message);
|
||||
} catch (Exception e) {
|
||||
log.warn("【vxeSocket】收到不合法的消息:" + message);
|
||||
return;
|
||||
}
|
||||
String type = json.getString(VXESocketConst.TYPE);
|
||||
switch (type) {
|
||||
// 心跳检测
|
||||
case VXESocketConst.TYPE_HB:
|
||||
this.sendMessage(VXESocket.packageMessage(type, true));
|
||||
break;
|
||||
// 更新form数据
|
||||
case VXESocketConst.TYPE_UVT:
|
||||
this.handleUpdateForm(json);
|
||||
break;
|
||||
default:
|
||||
log.warn("【vxeSocket】收到不识别的消息类型:" + type);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 UpdateForm 事件
|
||||
*/
|
||||
private void handleUpdateForm(JSONObject json) {
|
||||
// 将事件转发给所有人
|
||||
JSONObject data = json.getJSONObject(VXESocketConst.DATA);
|
||||
VXESocket.sendMessageToAll(VXESocket.packageMessage(VXESocketConst.TYPE_UVT, data));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package org.jeecg.modules.demo.test.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgDemo;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 大屏预览入口
|
||||
* @Author: scott
|
||||
* @Date:2019-12-12
|
||||
* @Version:V1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequestMapping("/test/bigScreen/templat")
|
||||
public class BigScreenTemplatController extends JeecgController<JeecgDemo, IJeecgDemoService> {
|
||||
|
||||
/**
|
||||
* @param modelAndView
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/html")
|
||||
public ModelAndView ftl(ModelAndView modelAndView) {
|
||||
modelAndView.setViewName("demo3");
|
||||
List<String> userList = new ArrayList<String>();
|
||||
userList.add("admin");
|
||||
userList.add("user1");
|
||||
userList.add("user2");
|
||||
log.info("--------------test--------------");
|
||||
modelAndView.addObject("userList", userList);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产销售监控模版
|
||||
* @param modelAndView
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/index1")
|
||||
public ModelAndView index1(ModelAndView modelAndView) {
|
||||
modelAndView.setViewName("/bigscreen/template1/index");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 智慧物流监控模版
|
||||
* @param modelAndView
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/index2")
|
||||
public ModelAndView index2(ModelAndView modelAndView) {
|
||||
modelAndView.setViewName("/bigscreen/template2/index");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,295 @@
|
||||
package org.jeecg.modules.demo.test.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.aspect.annotation.PermissionData;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgDemo;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @Description: 单表示例
|
||||
* @Author: jeecg-boot
|
||||
* @Date:2018-12-29
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "单表DEMO")
|
||||
@RestController
|
||||
@RequestMapping("/test/jeecgDemo")
|
||||
public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoService> {
|
||||
@Autowired
|
||||
private IJeecgDemoService jeecgDemoService;
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param jeecgDemo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表")
|
||||
@GetMapping(value = "/list")
|
||||
@PermissionData(pageComponent = "jeecg/JeecgDemoList")
|
||||
public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeecgDemo> queryWrapper = QueryGenerator.initQueryWrapper(jeecgDemo, req.getParameterMap());
|
||||
Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize);
|
||||
|
||||
IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper);
|
||||
log.info("查询当前页:" + pageList.getCurrent());
|
||||
log.info("查询当前页数量:" + pageList.getSize());
|
||||
log.info("查询结果数量:" + pageList.getRecords().size());
|
||||
log.info("数据总数:" + pageList.getTotal());
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jeecgDemo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
@AutoLog(value = "添加测试DEMO")
|
||||
@ApiOperation(value = "添加DEMO", notes = "添加DEMO")
|
||||
public Result<?> add(@RequestBody JeecgDemo jeecgDemo) {
|
||||
jeecgDemoService.save(jeecgDemo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jeecgDemo
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/edit")
|
||||
@ApiOperation(value = "编辑DEMO", notes = "编辑DEMO")
|
||||
@AutoLog(value = "编辑DEMO", operateType = CommonConstant.OPERATE_TYPE_3)
|
||||
public Result<?> edit(@RequestBody JeecgDemo jeecgDemo) {
|
||||
jeecgDemoService.updateById(jeecgDemo);
|
||||
return Result.OK("更新成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "删除测试DEMO")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@ApiOperation(value = "通过ID删除DEMO", notes = "通过ID删除DEMO")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
jeecgDemoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@ApiOperation(value = "批量删除DEMO", notes = "批量删除DEMO")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.jeecgDemoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
@ApiOperation(value = "通过ID查询DEMO", notes = "通过ID查询DEMO")
|
||||
public Result<?> queryById(@ApiParam(name = "id", value = "示例id", required = true) @RequestParam(name = "id", required = true) String id) {
|
||||
JeecgDemo jeecgDemo = jeecgDemoService.getById(id);
|
||||
return Result.OK(jeecgDemo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
@PermissionData(pageComponent = "jeecg/JeecgDemoList")
|
||||
public ModelAndView exportXls(HttpServletRequest request, JeecgDemo jeecgDemo) {
|
||||
return super.exportXls(request, jeecgDemo, JeecgDemo.class, "单表模型");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, JeecgDemo.class);
|
||||
}
|
||||
|
||||
// =====Redis 示例===============================================================================================
|
||||
|
||||
/**
|
||||
* redis操作 -- set
|
||||
*/
|
||||
@GetMapping(value = "/redisSet")
|
||||
public void redisSet() {
|
||||
redisUtil.set("name", "张三" + DateUtils.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* redis操作 -- get
|
||||
*/
|
||||
@GetMapping(value = "/redisGet")
|
||||
public String redisGet() {
|
||||
return (String) redisUtil.get("name");
|
||||
}
|
||||
|
||||
/**
|
||||
* redis操作 -- setObj
|
||||
*/
|
||||
@GetMapping(value = "/redisSetObj")
|
||||
public void redisSetObj() {
|
||||
JeecgDemo p = new JeecgDemo();
|
||||
p.setAge(10);
|
||||
p.setBirthday(new Date());
|
||||
p.setContent("hello");
|
||||
p.setName("张三");
|
||||
p.setSex("男");
|
||||
redisUtil.set("user-zdh", p);
|
||||
}
|
||||
|
||||
/**
|
||||
* redis操作 -- setObj
|
||||
*/
|
||||
@GetMapping(value = "/redisGetObj")
|
||||
public Object redisGetObj() {
|
||||
return redisUtil.get("user-zdh");
|
||||
}
|
||||
|
||||
/**
|
||||
* redis操作 -- get
|
||||
*/
|
||||
@GetMapping(value = "/redis/{id}")
|
||||
public JeecgDemo redisGetJeecgDemo(@PathVariable("id") String id) {
|
||||
JeecgDemo t = jeecgDemoService.getByIdCacheable(id);
|
||||
log.info(t.toString());
|
||||
return t;
|
||||
}
|
||||
|
||||
// ===Freemaker示例================================================================================
|
||||
|
||||
/**
|
||||
* freemaker方式 【页面路径: src/main/resources/templates】
|
||||
*
|
||||
* @param modelAndView
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/html")
|
||||
public ModelAndView ftl(ModelAndView modelAndView) {
|
||||
modelAndView.setViewName("demo3");
|
||||
List<String> userList = new ArrayList<String>();
|
||||
userList.add("admin");
|
||||
userList.add("user1");
|
||||
userList.add("user2");
|
||||
log.info("--------------test--------------");
|
||||
modelAndView.addObject("userList", userList);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
// ==========================================动态表单 JSON接收测试===========================================
|
||||
@PostMapping(value = "/testOnlineAdd")
|
||||
public Result<?> testOnlineAdd(@RequestBody JSONObject json) {
|
||||
log.info(json.toJSONString());
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/*----------------------------------------外部获取权限示例------------------------------------*/
|
||||
|
||||
/**
|
||||
* 【数据权限示例 - 编程】mybatisPlus java类方式加载权限
|
||||
*
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/mpList")
|
||||
@PermissionData(pageComponent = "jeecg/JeecgDemoList")
|
||||
public Result<?> loadMpPermissonList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeecgDemo> queryWrapper = new QueryWrapper<JeecgDemo>();
|
||||
//编程方式,给queryWrapper装载数据权限规则
|
||||
QueryGenerator.installAuthMplus(queryWrapper, JeecgDemo.class);
|
||||
Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize);
|
||||
IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 【数据权限示例 - 编程】mybatis xml方式加载权限
|
||||
*
|
||||
* @param jeecgDemo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/sqlList")
|
||||
@PermissionData(pageComponent = "jeecg/JeecgDemoList")
|
||||
public Result<?> loadSqlPermissonList(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<JeecgDemo> pageList = jeecgDemoService.queryListWithPermission(pageSize, pageNo);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
/*----------------------------------------外部获取权限示例------------------------------------*/
|
||||
|
||||
}
|
||||
@ -0,0 +1,254 @@
|
||||
package org.jeecg.modules.demo.test.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgDemo;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderMain;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgOrderCustomerService;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgOrderMainService;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgOrderTicketService;
|
||||
import org.jeecg.modules.demo.test.vo.JeecgOrderMainPage;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @Description: 一对多示例(JEditableTable行编辑)
|
||||
* @Author: jeecg-boot
|
||||
* @Date:2019-02-15
|
||||
* @Version: V2.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test/jeecgOrderMain")
|
||||
@Slf4j
|
||||
public class JeecgOrderMainController extends JeecgController<JeecgOrderMain, IJeecgOrderMainService> {
|
||||
|
||||
@Autowired
|
||||
private IJeecgOrderMainService jeecgOrderMainService;
|
||||
@Autowired
|
||||
private IJeecgOrderCustomerService jeecgOrderCustomerService;
|
||||
@Autowired
|
||||
private IJeecgOrderTicketService jeecgOrderTicketService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param jeecgOrderMain
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(JeecgOrderMain jeecgOrderMain, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
||||
QueryWrapper<JeecgOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderMain, req.getParameterMap());
|
||||
Page<JeecgOrderMain> page = new Page<JeecgOrderMain>(pageNo, pageSize);
|
||||
IPage<JeecgOrderMain> pageList = jeecgOrderMainService.page(page, queryWrapper);
|
||||
return Result.ok(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jeecgOrderMainPage
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody JeecgOrderMainPage jeecgOrderMainPage) {
|
||||
JeecgOrderMain jeecgOrderMain = new JeecgOrderMain();
|
||||
BeanUtils.copyProperties(jeecgOrderMainPage, jeecgOrderMain);
|
||||
jeecgOrderMainService.saveMain(jeecgOrderMain, jeecgOrderMainPage.getJeecgOrderCustomerList(), jeecgOrderMainPage.getJeecgOrderTicketList());
|
||||
return Result.ok("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jeecgOrderMainPage
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> eidt(@RequestBody JeecgOrderMainPage jeecgOrderMainPage) {
|
||||
JeecgOrderMain jeecgOrderMain = new JeecgOrderMain();
|
||||
BeanUtils.copyProperties(jeecgOrderMainPage, jeecgOrderMain);
|
||||
jeecgOrderMainService.updateMain(jeecgOrderMain, jeecgOrderMainPage.getJeecgOrderCustomerList(), jeecgOrderMainPage.getJeecgOrderTicketList());
|
||||
return Result.ok("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
jeecgOrderMainService.delMain(id);
|
||||
return Result.ok("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.jeecgOrderMainService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.ok("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
JeecgOrderMain jeecgOrderMain = jeecgOrderMainService.getById(id);
|
||||
return Result.ok(jeecgOrderMain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryOrderCustomerListByMainId")
|
||||
public Result<?> queryOrderCustomerListByMainId(@RequestParam(name = "id", required = true) String id) {
|
||||
List<JeecgOrderCustomer> jeecgOrderCustomerList = jeecgOrderCustomerService.selectCustomersByMainId(id);
|
||||
return Result.ok(jeecgOrderCustomerList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryOrderTicketListByMainId")
|
||||
public Result<?> queryOrderTicketListByMainId(@RequestParam(name = "id", required = true) String id) {
|
||||
List<JeecgOrderTicket> jeecgOrderTicketList = jeecgOrderTicketService.selectTicketsByMainId(id);
|
||||
return Result.ok(jeecgOrderTicketList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, JeecgOrderMain jeecgOrderMain) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<JeecgOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderMain, request.getParameterMap());
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
//获取当前用户
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
List<JeecgOrderMainPage> pageList = new ArrayList<JeecgOrderMainPage>();
|
||||
|
||||
List<JeecgOrderMain> jeecgOrderMainList = jeecgOrderMainService.list(queryWrapper);
|
||||
for (JeecgOrderMain orderMain : jeecgOrderMainList) {
|
||||
JeecgOrderMainPage vo = new JeecgOrderMainPage();
|
||||
BeanUtils.copyProperties(orderMain, vo);
|
||||
// 查询机票
|
||||
List<JeecgOrderTicket> jeecgOrderTicketList = jeecgOrderTicketService.selectTicketsByMainId(orderMain.getId());
|
||||
vo.setJeecgOrderTicketList(jeecgOrderTicketList);
|
||||
// 查询客户
|
||||
List<JeecgOrderCustomer> jeecgOrderCustomerList = jeecgOrderCustomerService.selectCustomersByMainId(orderMain.getId());
|
||||
vo.setJeecgOrderCustomerList(jeecgOrderCustomerList);
|
||||
pageList.add(vo);
|
||||
}
|
||||
|
||||
// 导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "一对多订单示例");
|
||||
// 注解对象Class
|
||||
mv.addObject(NormalExcelConstants.CLASS, JeecgOrderMainPage.class);
|
||||
// 自定义表格参数
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("自定义导出Excel内容标题", "导出人:" + sysUser.getRealname(), "自定义Sheet名字"));
|
||||
// 导出数据列表
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(2);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<JeecgOrderMainPage> list = ExcelImportUtil.importExcel(file.getInputStream(), JeecgOrderMainPage.class, params);
|
||||
for (JeecgOrderMainPage page : list) {
|
||||
JeecgOrderMain po = new JeecgOrderMain();
|
||||
BeanUtils.copyProperties(page, po);
|
||||
jeecgOrderMainService.saveMain(po, page.getJeecgOrderCustomerList(), page.getJeecgOrderTicketList());
|
||||
}
|
||||
return Result.ok("文件导入成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error("文件导入失败:" + e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.error("文件导入失败!");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,267 @@
|
||||
package org.jeecg.modules.demo.test.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderMain;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgOrderCustomerService;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgOrderMainService;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgOrderTicketService;
|
||||
import org.jeecg.modules.demo.test.vo.JeecgOrderMainPage;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @Description: 一对多示例(ERP TAB风格)
|
||||
* @Author: ZhiLin
|
||||
* @Date: 2019-02-20
|
||||
* @Version: v2.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/test/order")
|
||||
public class JeecgOrderTabMainController {
|
||||
|
||||
@Autowired
|
||||
private IJeecgOrderMainService jeecgOrderMainService;
|
||||
@Autowired
|
||||
private IJeecgOrderCustomerService jeecgOrderCustomerService;
|
||||
@Autowired
|
||||
private IJeecgOrderTicketService jeecgOrderTicketService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param jeecgOrderMain
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/orderList")
|
||||
public Result<?> respondePagedData(JeecgOrderMain jeecgOrderMain,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeecgOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderMain, req.getParameterMap());
|
||||
Page<JeecgOrderMain> page = new Page<JeecgOrderMain>(pageNo, pageSize);
|
||||
IPage<JeecgOrderMain> pageList = jeecgOrderMainService.page(page, queryWrapper);
|
||||
return Result.ok(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jeecgOrderMainPage
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody JeecgOrderMainPage jeecgOrderMainPage) {
|
||||
JeecgOrderMain jeecgOrderMain = new JeecgOrderMain();
|
||||
BeanUtils.copyProperties(jeecgOrderMainPage, jeecgOrderMain);
|
||||
jeecgOrderMainService.save(jeecgOrderMain);
|
||||
return Result.ok("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jeecgOrderMainPage
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/edit")
|
||||
public Result<?> edit(@RequestBody JeecgOrderMainPage jeecgOrderMainPage) {
|
||||
JeecgOrderMain jeecgOrderMain = new JeecgOrderMain();
|
||||
BeanUtils.copyProperties(jeecgOrderMainPage, jeecgOrderMain);
|
||||
jeecgOrderMainService.updateById(jeecgOrderMain);
|
||||
return Result.ok("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
jeecgOrderMainService.delMain(id);
|
||||
return Result.ok("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.jeecgOrderMainService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.ok("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
JeecgOrderMain jeecgOrderMain = jeecgOrderMainService.getById(id);
|
||||
return Result.ok(jeecgOrderMain);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param jeecgOrderCustomer
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/listOrderCustomerByMainId")
|
||||
public Result<?> queryOrderCustomerListByMainId(JeecgOrderCustomer jeecgOrderCustomer,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeecgOrderCustomer> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderCustomer, req.getParameterMap());
|
||||
Page<JeecgOrderCustomer> page = new Page<JeecgOrderCustomer>(pageNo, pageSize);
|
||||
IPage<JeecgOrderCustomer> pageList = jeecgOrderCustomerService.page(page, queryWrapper);
|
||||
return Result.ok(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param jeecgOrderTicket
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/listOrderTicketByMainId")
|
||||
public Result<?> queryOrderTicketListByMainId(JeecgOrderTicket jeecgOrderTicket,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeecgOrderTicket> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderTicket, req.getParameterMap());
|
||||
Page<JeecgOrderTicket> page = new Page<JeecgOrderTicket>(pageNo, pageSize);
|
||||
IPage<JeecgOrderTicket> pageList = jeecgOrderTicketService.page(page, queryWrapper);
|
||||
return Result.ok(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jeecgOrderCustomer
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addCustomer")
|
||||
public Result<?> addCustomer(@RequestBody JeecgOrderCustomer jeecgOrderCustomer) {
|
||||
jeecgOrderCustomerService.save(jeecgOrderCustomer);
|
||||
return Result.ok("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jeecgOrderCustomer
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/editCustomer")
|
||||
public Result<?> editCustomer(@RequestBody JeecgOrderCustomer jeecgOrderCustomer) {
|
||||
jeecgOrderCustomerService.updateById(jeecgOrderCustomer);
|
||||
return Result.ok("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteCustomer")
|
||||
public Result<?> deleteCustomer(@RequestParam(name = "id", required = true) String id) {
|
||||
jeecgOrderCustomerService.removeById(id);
|
||||
return Result.ok("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatchCustomer")
|
||||
public Result<?> deleteBatchCustomer(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.jeecgOrderCustomerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.ok("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jeecgOrderTicket
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addTicket")
|
||||
public Result<?> addTicket(@RequestBody JeecgOrderTicket jeecgOrderTicket) {
|
||||
jeecgOrderTicketService.save(jeecgOrderTicket);
|
||||
return Result.ok("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jeecgOrderTicket
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/editTicket")
|
||||
public Result<?> editTicket(@RequestBody JeecgOrderTicket jeecgOrderTicket) {
|
||||
jeecgOrderTicketService.updateById(jeecgOrderTicket);
|
||||
return Result.ok("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteTicket")
|
||||
public Result<?> deleteTicket(@RequestParam(name = "id", required = true) String id) {
|
||||
jeecgOrderTicketService.removeById(id);
|
||||
return Result.ok("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatchTicket")
|
||||
public Result<?> deleteBatchTicket(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.jeecgOrderTicketService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.ok("批量删除成功!");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,244 @@
|
||||
package org.jeecg.modules.demo.test.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.demo.test.entity.JoaDemo;
|
||||
import org.jeecg.modules.demo.test.service.IJoaDemoService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test/joaDemo")
|
||||
@Slf4j
|
||||
public class JoaDemoController {
|
||||
@Autowired
|
||||
private IJoaDemoService joaDemoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @param joaDemo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<JoaDemo>> queryPageList(JoaDemo joaDemo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<JoaDemo>> result = new Result<IPage<JoaDemo>>();
|
||||
QueryWrapper<JoaDemo> queryWrapper = QueryGenerator.initQueryWrapper(joaDemo, req.getParameterMap());
|
||||
Page<JoaDemo> page = new Page<JoaDemo>(pageNo, pageSize);
|
||||
IPage<JoaDemo> pageList = joaDemoService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param joaDemo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public Result<JoaDemo> add(@RequestBody JoaDemo joaDemo) {
|
||||
Result<JoaDemo> result = new Result<JoaDemo>();
|
||||
try {
|
||||
joaDemoService.save(joaDemo);
|
||||
result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param joaDemo
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<JoaDemo> edit(@RequestBody JoaDemo joaDemo) {
|
||||
Result<JoaDemo> result = new Result<JoaDemo>();
|
||||
JoaDemo joaDemoEntity = joaDemoService.getById(joaDemo.getId());
|
||||
if(joaDemoEntity==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
boolean ok = joaDemoService.updateById(joaDemo);
|
||||
//TODO 返回false说明什么?
|
||||
if(ok) {
|
||||
result.success("修改成功!");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<JoaDemo> delete(@RequestParam(name="id",required=true) String id) {
|
||||
Result<JoaDemo> result = new Result<JoaDemo>();
|
||||
JoaDemo joaDemo = joaDemoService.getById(id);
|
||||
if(joaDemo==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
boolean ok = joaDemoService.removeById(id);
|
||||
if(ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<JoaDemo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<JoaDemo> result = new Result<JoaDemo>();
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
}else {
|
||||
this.joaDemoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<JoaDemo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
Result<JoaDemo> result = new Result<JoaDemo>();
|
||||
JoaDemo joaDemo = joaDemoService.getById(id);
|
||||
if(joaDemo==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
result.setResult(joaDemo);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<JoaDemo> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
JoaDemo joaDemo = JSON.parseObject(deString, JoaDemo.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(joaDemo, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<JoaDemo> pageList = joaDemoService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "流程测试列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, JoaDemo.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("流程测试列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<JoaDemo> listJoaDemos = ExcelImportUtil.importExcel(file.getInputStream(), JoaDemo.class, params);
|
||||
for (JoaDemo joaDemoExcel : listJoaDemos) {
|
||||
joaDemoService.save(joaDemoExcel);
|
||||
}
|
||||
return Result.ok("文件导入成功!数据行数:" + listJoaDemos.size());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error("文件导入失败:"+e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.ok("文件导入失败!");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package org.jeecg.modules.demo.test.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: jeecg 测试demo
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2018-12-29
|
||||
* @Version:V1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="测试DEMO对象", description="测试DEMO")
|
||||
@TableName("demo")
|
||||
public class JeecgDemo extends JeecgEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** 部门编码 */
|
||||
@Excel(name="部门编码",width=25)
|
||||
@ApiModelProperty(value = "部门编码")
|
||||
private java.lang.String sysOrgCode;
|
||||
/** 姓名 */
|
||||
@Excel(name="姓名",width=25)
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private java.lang.String name;
|
||||
/** 关键词 */
|
||||
@ApiModelProperty(value = "关键词")
|
||||
@Excel(name="关键词",width=15)
|
||||
private java.lang.String keyWord;
|
||||
/** 打卡时间 */
|
||||
@ApiModelProperty(value = "打卡时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name="打卡时间",width=20,format="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date punchTime;
|
||||
/** 工资 */
|
||||
@ApiModelProperty(value = "工资",example = "0")
|
||||
@Excel(name="工资",width=15)
|
||||
private java.math.BigDecimal salaryMoney;
|
||||
/** 奖金 */
|
||||
@ApiModelProperty(value = "奖金",example = "0")
|
||||
@Excel(name="奖金",width=15)
|
||||
private java.lang.Double bonusMoney;
|
||||
/** 性别 {男:1,女:2} */
|
||||
@ApiModelProperty(value = "性别")
|
||||
@Excel(name = "性别", width = 15, dicCode = "sex")
|
||||
private java.lang.String sex;
|
||||
/** 年龄 */
|
||||
@ApiModelProperty(value = "年龄",example = "0")
|
||||
@Excel(name="年龄",width=15)
|
||||
private java.lang.Integer age;
|
||||
/** 生日 */
|
||||
@ApiModelProperty(value = "生日")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name="生日",format="yyyy-MM-dd")
|
||||
private java.util.Date birthday;
|
||||
/** 邮箱 */
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
@Excel(name="邮箱",width=30)
|
||||
private java.lang.String email;
|
||||
/** 个人简介 */
|
||||
@ApiModelProperty(value = "个人简介")
|
||||
private java.lang.String content;
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package org.jeecg.modules.demo.test.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* @Description: 订单客户
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("jeecg_order_customer")
|
||||
public class JeecgOrderCustomer implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private java.lang.String id;
|
||||
/**客户名*/
|
||||
@Excel(name="客户名字",width=15)
|
||||
private java.lang.String name;
|
||||
/**性别*/
|
||||
private java.lang.String sex;
|
||||
/**身份证号码*/
|
||||
@Excel(name="身份证号码",width=15)
|
||||
private java.lang.String idcard;
|
||||
/**身份证扫描件*/
|
||||
private java.lang.String idcardPic;
|
||||
/**电话1*/
|
||||
@Excel(name="电话",width=15)
|
||||
private java.lang.String telphone;
|
||||
/**外键*/
|
||||
private java.lang.String orderId;
|
||||
/**创建人*/
|
||||
private java.lang.String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
/**修改人*/
|
||||
private java.lang.String updateBy;
|
||||
/**修改时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package org.jeecg.modules.demo.test.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* @Description: 订单
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("jeecg_order_main")
|
||||
public class JeecgOrderMain implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private java.lang.String id;
|
||||
/**订单号*/
|
||||
private java.lang.String orderCode;
|
||||
/**订单类型*/
|
||||
private java.lang.String ctype;
|
||||
/**订单日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date orderDate;
|
||||
/**订单金额*/
|
||||
private java.lang.Double orderMoney;
|
||||
/**订单备注*/
|
||||
private java.lang.String content;
|
||||
/**创建人*/
|
||||
private java.lang.String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
/**修改人*/
|
||||
private java.lang.String updateBy;
|
||||
/**修改时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package org.jeecg.modules.demo.test.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* @Description: 订单机票
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("jeecg_order_ticket")
|
||||
public class JeecgOrderTicket implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private java.lang.String id;
|
||||
/**航班号*/
|
||||
@Excel(name="航班号",width=15)
|
||||
private java.lang.String ticketCode;
|
||||
/**航班时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name="航班时间",width=15,format = "yyyy-MM-dd")
|
||||
private java.util.Date tickectDate;
|
||||
/**外键*/
|
||||
private java.lang.String orderId;
|
||||
/**创建人*/
|
||||
private java.lang.String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
/**修改人*/
|
||||
private java.lang.String updateBy;
|
||||
/**修改时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package org.jeecg.modules.demo.test.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("joa_demo")
|
||||
public class JoaDemo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private java.lang.String id;
|
||||
/**请假人*/
|
||||
@Excel(name = "请假人", width = 15)
|
||||
private java.lang.String name;
|
||||
/**请假天数*/
|
||||
@Excel(name = "请假天数", width = 15)
|
||||
private java.lang.Integer days;
|
||||
/**开始时间*/
|
||||
@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private java.util.Date beginDate;
|
||||
/**请假结束时间*/
|
||||
@Excel(name = "请假结束时间", width = 20, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private java.util.Date endDate;
|
||||
/**请假原因*/
|
||||
@Excel(name = "请假原因", width = 15)
|
||||
private java.lang.String reason;
|
||||
/**流程状态*/
|
||||
@Excel(name = "流程状态", width = 15)
|
||||
private java.lang.String bpmStatus;
|
||||
/**创建人id*/
|
||||
@Excel(name = "创建人id", width = 15)
|
||||
private java.lang.String createBy;
|
||||
/**创建时间*/
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime;
|
||||
/**修改时间*/
|
||||
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
/**修改人id*/
|
||||
@Excel(name = "修改人id", width = 15)
|
||||
private java.lang.String updateBy;
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package org.jeecg.modules.demo.test.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgDemo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
/**
|
||||
* @Description: jeecg 测试demo
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2018-12-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JeecgDemoMapper extends BaseMapper<JeecgDemo> {
|
||||
|
||||
public List<JeecgDemo> getDemoByName(@Param("name") String name);
|
||||
|
||||
/**
|
||||
* 查询列表数据 直接传数据权限的sql进行数据过滤
|
||||
* @param page
|
||||
* @param permissionSql
|
||||
* @return
|
||||
*/
|
||||
public IPage<JeecgDemo> queryListWithPermission(Page<JeecgDemo> page,@Param("permissionSql")String permissionSql);
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package org.jeecg.modules.demo.test.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 订单客户
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JeecgOrderCustomerMapper extends BaseMapper<JeecgOrderCustomer> {
|
||||
|
||||
/**
|
||||
* 通过主表外键批量删除客户
|
||||
* @param mainId
|
||||
* @return
|
||||
*/
|
||||
@Delete("DELETE FROM JEECG_ORDER_CUSTOMER WHERE ORDER_ID = #{mainId}")
|
||||
public boolean deleteCustomersByMainId(String mainId);
|
||||
|
||||
@Select("SELECT * FROM JEECG_ORDER_CUSTOMER WHERE ORDER_ID = #{mainId}")
|
||||
public List<JeecgOrderCustomer> selectCustomersByMainId(String mainId);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.demo.test.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderMain;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 订单
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JeecgOrderMainMapper extends BaseMapper<JeecgOrderMain> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package org.jeecg.modules.demo.test.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 订单机票
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JeecgOrderTicketMapper extends BaseMapper<JeecgOrderTicket> {
|
||||
|
||||
/**
|
||||
* 通过主表外键批量删除客户
|
||||
* @param mainId
|
||||
* @return
|
||||
*/
|
||||
@Delete("DELETE FROM JEECG_ORDER_TICKET WHERE ORDER_ID = #{mainId}")
|
||||
public boolean deleteTicketsByMainId(String mainId);
|
||||
|
||||
|
||||
@Select("SELECT * FROM JEECG_ORDER_TICKET WHERE ORDER_ID = #{mainId}")
|
||||
public List<JeecgOrderTicket> selectTicketsByMainId(String mainId);
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.jeecg.modules.demo.test.mapper;
|
||||
|
||||
import org.jeecg.modules.demo.test.entity.JoaDemo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JoaDemoMapper extends BaseMapper<JoaDemo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.test.mapper.JeecgDemoMapper">
|
||||
|
||||
<!-- 根据用户名查询 -->
|
||||
<select id="getDemoByName" resultType="org.jeecg.modules.demo.test.entity.JeecgDemo">
|
||||
select * from demo where name = #{name}
|
||||
</select>
|
||||
|
||||
<!-- 根据权限sql查询数据集 -->
|
||||
<select id="queryListWithPermission" parameterType="Object" resultType="org.jeecg.modules.demo.test.entity.JeecgDemo">
|
||||
select * from demo where 1=1 ${permissionSql}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.test.mapper.JeecgOrderCustomerMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.test.mapper.JeecgOrderMainMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.test.mapper.JeecgOrderTicketMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.test.mapper.JoaDemoMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,27 @@
|
||||
package org.jeecg.modules.demo.test.service;
|
||||
|
||||
import org.jeecg.common.system.base.service.JeecgService;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgDemo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
/**
|
||||
* @Description: jeecg 测试demo
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2018-12-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJeecgDemoService extends JeecgService<JeecgDemo> {
|
||||
|
||||
public void testTran();
|
||||
|
||||
public JeecgDemo getByIdCacheable(String id);
|
||||
|
||||
/**
|
||||
* 查询列表数据 在service中获取数据权限sql信息
|
||||
* @param pageSize
|
||||
* @param pageNo
|
||||
* @return
|
||||
*/
|
||||
IPage<JeecgDemo> queryListWithPermission(int pageSize,int pageNo);
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package org.jeecg.modules.demo.test.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 订单客户
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJeecgOrderCustomerService extends IService<JeecgOrderCustomer> {
|
||||
|
||||
public List<JeecgOrderCustomer> selectCustomersByMainId(String mainId);
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package org.jeecg.modules.demo.test.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderMain;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 订单
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJeecgOrderMainService extends IService<JeecgOrderMain> {
|
||||
|
||||
/**
|
||||
* 添加一对多
|
||||
*
|
||||
*/
|
||||
public void saveMain(JeecgOrderMain jeecgOrderMain,List<JeecgOrderCustomer> jeecgOrderCustomerList,List<JeecgOrderTicket> jeecgOrderTicketList) ;
|
||||
|
||||
/**
|
||||
* 修改一对多
|
||||
*
|
||||
*/
|
||||
public void updateMain(JeecgOrderMain jeecgOrderMain,List<JeecgOrderCustomer> jeecgOrderCustomerList,List<JeecgOrderTicket> jeecgOrderTicketList);
|
||||
|
||||
/**
|
||||
* 删除一对多
|
||||
* @param jformOrderMain
|
||||
*/
|
||||
public void delMain (String id);
|
||||
|
||||
/**
|
||||
* 批量删除一对多
|
||||
* @param jformOrderMain
|
||||
*/
|
||||
public void delBatchMain (Collection<? extends Serializable> idList);
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package org.jeecg.modules.demo.test.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 订单机票
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJeecgOrderTicketService extends IService<JeecgOrderTicket> {
|
||||
|
||||
public List<JeecgOrderTicket> selectTicketsByMainId(String mainId);
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.jeecg.modules.demo.test.service;
|
||||
|
||||
import org.jeecg.modules.demo.test.entity.JoaDemo;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJoaDemoService extends IService<JoaDemo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package org.jeecg.modules.demo.test.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.constant.CacheConstant;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgDemo;
|
||||
import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: jeecg 测试demo
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2018-12-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JeecgDemoServiceImpl extends ServiceImpl<JeecgDemoMapper, JeecgDemo> implements IJeecgDemoService {
|
||||
@Autowired
|
||||
JeecgDemoMapper jeecgDemoMapper;
|
||||
|
||||
/**
|
||||
* 事务控制在service层面
|
||||
* 加上注解:@Transactional,声明的方法就是一个独立的事务(有异常DB操作全部回滚)
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void testTran() {
|
||||
JeecgDemo pp = new JeecgDemo();
|
||||
pp.setAge(1111);
|
||||
pp.setName("测试事务 小白兔 1");
|
||||
jeecgDemoMapper.insert(pp);
|
||||
|
||||
JeecgDemo pp2 = new JeecgDemo();
|
||||
pp2.setAge(2222);
|
||||
pp2.setName("测试事务 小白兔 2");
|
||||
jeecgDemoMapper.insert(pp2);
|
||||
|
||||
Integer.parseInt("hello");//自定义异常
|
||||
|
||||
JeecgDemo pp3 = new JeecgDemo();
|
||||
pp3.setAge(3333);
|
||||
pp3.setName("测试事务 小白兔 3");
|
||||
jeecgDemoMapper.insert(pp3);
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 缓存注解测试: redis
|
||||
*/
|
||||
@Override
|
||||
@Cacheable(cacheNames = CacheConstant.TEST_DEMO_CACHE, key = "#id")
|
||||
public JeecgDemo getByIdCacheable(String id) {
|
||||
JeecgDemo t = jeecgDemoMapper.selectById(id);
|
||||
System.err.println("---未读缓存,读取数据库---");
|
||||
System.err.println(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<JeecgDemo> queryListWithPermission(int pageSize,int pageNo) {
|
||||
Page<JeecgDemo> page = new Page<>(pageNo, pageSize);
|
||||
//编程方式,获取当前请求的数据权限规则SQL片段
|
||||
String sql = QueryGenerator.installAuthJdbc(JeecgDemo.class);
|
||||
return this.baseMapper.queryListWithPermission(page, sql);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package org.jeecg.modules.demo.test.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
|
||||
import org.jeecg.modules.demo.test.mapper.JeecgOrderCustomerMapper;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgOrderCustomerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 订单客户
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JeecgOrderCustomerServiceImpl extends ServiceImpl<JeecgOrderCustomerMapper, JeecgOrderCustomer> implements IJeecgOrderCustomerService {
|
||||
|
||||
@Autowired
|
||||
private JeecgOrderCustomerMapper jeecgOrderCustomerMapper;
|
||||
|
||||
@Override
|
||||
public List<JeecgOrderCustomer> selectCustomersByMainId(String mainId) {
|
||||
return jeecgOrderCustomerMapper.selectCustomersByMainId(mainId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package org.jeecg.modules.demo.test.service.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderMain;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
|
||||
import org.jeecg.modules.demo.test.mapper.JeecgOrderCustomerMapper;
|
||||
import org.jeecg.modules.demo.test.mapper.JeecgOrderMainMapper;
|
||||
import org.jeecg.modules.demo.test.mapper.JeecgOrderTicketMapper;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgOrderMainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 订单
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JeecgOrderMainServiceImpl extends ServiceImpl<JeecgOrderMainMapper, JeecgOrderMain> implements IJeecgOrderMainService {
|
||||
|
||||
@Autowired
|
||||
private JeecgOrderMainMapper jeecgOrderMainMapper;
|
||||
@Autowired
|
||||
private JeecgOrderCustomerMapper jeecgOrderCustomerMapper;
|
||||
@Autowired
|
||||
private JeecgOrderTicketMapper jeecgOrderTicketMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveMain(JeecgOrderMain jeecgOrderMain, List<JeecgOrderCustomer> jeecgOrderCustomerList, List<JeecgOrderTicket> jeecgOrderTicketList) {
|
||||
jeecgOrderMainMapper.insert(jeecgOrderMain);
|
||||
if (jeecgOrderCustomerList != null) {
|
||||
for (JeecgOrderCustomer entity : jeecgOrderCustomerList) {
|
||||
entity.setOrderId(jeecgOrderMain.getId());
|
||||
jeecgOrderCustomerMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
if (jeecgOrderTicketList != null) {
|
||||
for (JeecgOrderTicket entity : jeecgOrderTicketList) {
|
||||
entity.setOrderId(jeecgOrderMain.getId());
|
||||
jeecgOrderTicketMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateMain(JeecgOrderMain jeecgOrderMain, List<JeecgOrderCustomer> jeecgOrderCustomerList, List<JeecgOrderTicket> jeecgOrderTicketList) {
|
||||
jeecgOrderMainMapper.updateById(jeecgOrderMain);
|
||||
|
||||
//1.先删除子表数据
|
||||
jeecgOrderTicketMapper.deleteTicketsByMainId(jeecgOrderMain.getId());
|
||||
jeecgOrderCustomerMapper.deleteCustomersByMainId(jeecgOrderMain.getId());
|
||||
|
||||
//2.子表数据重新插入
|
||||
if (jeecgOrderCustomerList != null) {
|
||||
for (JeecgOrderCustomer entity : jeecgOrderCustomerList) {
|
||||
entity.setOrderId(jeecgOrderMain.getId());
|
||||
jeecgOrderCustomerMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
if (jeecgOrderTicketList != null) {
|
||||
for (JeecgOrderTicket entity : jeecgOrderTicketList) {
|
||||
entity.setOrderId(jeecgOrderMain.getId());
|
||||
jeecgOrderTicketMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delMain(String id) {
|
||||
jeecgOrderMainMapper.deleteById(id);
|
||||
jeecgOrderTicketMapper.deleteTicketsByMainId(id);
|
||||
jeecgOrderCustomerMapper.deleteCustomersByMainId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delBatchMain(Collection<? extends Serializable> idList) {
|
||||
for(Serializable id:idList) {
|
||||
jeecgOrderMainMapper.deleteById(id);
|
||||
jeecgOrderTicketMapper.deleteTicketsByMainId(id.toString());
|
||||
jeecgOrderCustomerMapper.deleteCustomersByMainId(id.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package org.jeecg.modules.demo.test.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
|
||||
import org.jeecg.modules.demo.test.mapper.JeecgOrderTicketMapper;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgOrderTicketService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 订单机票
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JeecgOrderTicketServiceImpl extends ServiceImpl<JeecgOrderTicketMapper, JeecgOrderTicket> implements IJeecgOrderTicketService {
|
||||
@Autowired
|
||||
private JeecgOrderTicketMapper jeecgOrderTicketMapper;
|
||||
|
||||
@Override
|
||||
public List<JeecgOrderTicket> selectTicketsByMainId(String mainId) {
|
||||
return jeecgOrderTicketMapper.selectTicketsByMainId(mainId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package org.jeecg.modules.demo.test.service.impl;
|
||||
|
||||
import org.jeecg.modules.demo.test.entity.JoaDemo;
|
||||
import org.jeecg.modules.demo.test.mapper.JoaDemoMapper;
|
||||
import org.jeecg.modules.demo.test.service.IJoaDemoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JoaDemoServiceImpl extends ServiceImpl<JoaDemoMapper, JoaDemo> implements IJoaDemoService {
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package org.jeecg.modules.demo.test.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class JeecgOrderMainPage {
|
||||
|
||||
/**主键*/
|
||||
private java.lang.String id;
|
||||
/**订单号*/
|
||||
@Excel(name="订单号",width=15)
|
||||
private java.lang.String orderCode;
|
||||
/**订单类型*/
|
||||
private java.lang.String ctype;
|
||||
/**订单日期*/
|
||||
@Excel(name="订单日期",width=15,format = "yyyy-MM-dd")
|
||||
private java.util.Date orderDate;
|
||||
/**订单金额*/
|
||||
@Excel(name="订单金额",width=15)
|
||||
private java.lang.Double orderMoney;
|
||||
/**订单备注*/
|
||||
private java.lang.String content;
|
||||
/**创建人*/
|
||||
private java.lang.String createBy;
|
||||
/**创建时间*/
|
||||
private java.util.Date createTime;
|
||||
/**修改人*/
|
||||
private java.lang.String updateBy;
|
||||
/**修改时间*/
|
||||
private java.util.Date updateTime;
|
||||
|
||||
@ExcelCollection(name="客户")
|
||||
private List<JeecgOrderCustomer> jeecgOrderCustomerList;
|
||||
@ExcelCollection(name="机票")
|
||||
private List<JeecgOrderTicket> jeecgOrderTicketList;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user