ci: 模块名变更
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.jero.boot</groupId>
|
||||
<artifactId>kh</artifactId>
|
||||
<version>2.5.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>kh-module-demo</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jero.boot</groupId>
|
||||
<artifactId>jero-system-local-api</artifactId>
|
||||
</dependency>
|
||||
<!--引入微服务启动依赖 starter
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jero-boot-starter-cloud</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jero-boot-starter-job</artifactId>
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,48 @@
|
||||
//package com.jero.modules.demo.cloud.controller;
|
||||
//
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import com.jero.common.api.vo.Result;
|
||||
//import com.jero.common.system.api.ISysBaseAPI;
|
||||
//import com.jero.common.system.vo.DictModel;
|
||||
//import org.springframework.web.bind.annotation.GetMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// *
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Api(tags = "Cloud示例")
|
||||
//@RestController
|
||||
//@RequestMapping("/test")
|
||||
//public class JcloudDemoController {
|
||||
//
|
||||
//
|
||||
// @Resource
|
||||
// private ISysBaseAPI sysBaseAPI;
|
||||
//
|
||||
// /**
|
||||
// * 测试
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @GetMapping("/remote")
|
||||
// @ApiOperation(value = "测试feign", notes = "测试feign")
|
||||
// public Result remoteDict() {
|
||||
//// try{
|
||||
//// //睡5秒,网关Hystrix3秒超时,会触发熔断降级操作
|
||||
//// Thread.sleep(5000);
|
||||
//// }catch (Exception e){
|
||||
//// e.printStackTrace();
|
||||
//// }
|
||||
// List<DictModel> list = sysBaseAPI.queryAllDict();
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.jero.modules.demo.cloud.provider;
|
||||
|
||||
import com.jero.common.api.vo.Results;
|
||||
import com.jero.modules.demo.cloud.service.JcloudDemoService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* feign服务端接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
public class JcloudDemoProvider {
|
||||
|
||||
@Resource
|
||||
private JcloudDemoService jcloudDemoService;
|
||||
|
||||
@GetMapping("/getMessage")
|
||||
public Results<String> getMessage(@RequestParam String name) {
|
||||
return jcloudDemoService.getMessage(name);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.jero.modules.demo.cloud.service;
|
||||
|
||||
import com.jero.common.api.vo.Results;
|
||||
|
||||
public interface JcloudDemoService {
|
||||
Results<String> getMessage(String name);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.jero.modules.demo.cloud.service.impl;
|
||||
|
||||
import com.jero.common.api.vo.Results;
|
||||
import com.jero.modules.demo.cloud.service.JcloudDemoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class JcloudDemoServiceImpl implements JcloudDemoService {
|
||||
@Override
|
||||
public Results<String> getMessage(String name) {
|
||||
return Results.OK("Hello," + name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
package com.jero.modules.demo.mock;
|
||||
|
||||
import com.jero.common.api.vo.Results;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
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.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.swing.filechooser.FileSystemView;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mock/api")
|
||||
@Slf4j
|
||||
public class MockController {
|
||||
|
||||
private static final String JSON_PATH = "classpath:com/jero/modules/demo/mock/json";
|
||||
|
||||
private static final String CN_TR_NO_COUNT_INFO_PATH = "classpath:com/jero/modules/demo/mock/json/getCntrNoCountInfo.json";
|
||||
|
||||
/**
|
||||
* 通用json访问接口
|
||||
* 格式: http://localhost:8080/jero-boot/api/json/{filename}
|
||||
* @param filename
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/json/{filename}")
|
||||
public String getJsonData(@PathVariable String filename) {
|
||||
String jsonpath = "classpath:com/jero/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:com/jero/modules/demo/mock/json/user.json");
|
||||
}
|
||||
|
||||
/**
|
||||
* 老的登录获取用户信息接口
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/user/info")
|
||||
public String userInfo() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/user_info.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/role")
|
||||
public String role() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/role.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/service")
|
||||
public String service() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/service.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/permission")
|
||||
public String permission() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/permission.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/permission/no-pager")
|
||||
public String permission_no_page() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/permission_no_page.json");
|
||||
}
|
||||
|
||||
/**
|
||||
* 省市县
|
||||
*/
|
||||
@GetMapping(value = "/area")
|
||||
public String area() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/area.json");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试报表数据
|
||||
*/
|
||||
@GetMapping(value = "/report/getYearCountInfo")
|
||||
public String getYearCountInfo() {
|
||||
return readJson(CN_TR_NO_COUNT_INFO_PATH);
|
||||
}
|
||||
@GetMapping(value = "/report/getMonthCountInfo")
|
||||
public String getMonthCountInfo() {
|
||||
return readJson(CN_TR_NO_COUNT_INFO_PATH);
|
||||
}
|
||||
@GetMapping(value = "/report/getCntrNoCountInfo")
|
||||
public String getCntrNoCountInfo() {
|
||||
return readJson(CN_TR_NO_COUNT_INFO_PATH);
|
||||
}
|
||||
@GetMapping(value = "/report/getCabinetCountInfo")
|
||||
public String getCabinetCountInfo() {
|
||||
return readJson(CN_TR_NO_COUNT_INFO_PATH);
|
||||
}
|
||||
@GetMapping(value = "/report/getTubiao")
|
||||
public String getTubiao() {
|
||||
return readJson("classpath:org/jero/modules/demo/mock/json/getTubiao.json");
|
||||
}
|
||||
|
||||
/**
|
||||
* 实时磁盘监控
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryDiskInfo")
|
||||
public Results<List<Map<String,Object>>> queryDiskInfo(HttpServletRequest request, HttpServletResponse response){
|
||||
Results<List<Map<String,Object>>> res = new Results<>();
|
||||
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.setMessage("查询成功");
|
||||
} catch (Exception e) {
|
||||
return Results.error("查询失败"+e.getMessage());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* 工作台首页的数据
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/list/search/projects")
|
||||
public String projects() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/workplace_projects.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/workplace/activity")
|
||||
public String activity() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/workplace_activity.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/workplace/teams")
|
||||
public String teams() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/workplace_teams.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/workplace/radar")
|
||||
public String radar() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/workplace_radar.json");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/task/process")
|
||||
public String taskProcess() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/task_process.json");
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
||||
//author:lvdandan-----date:20190315---for:添加数据日志json----
|
||||
public String sysDataLogJson() {
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/sysdatalog.json");
|
||||
}
|
||||
//author:lvdandan-----date:20190315---for:添加数据日志json----
|
||||
|
||||
//--update-begin--author:wangshuai-----date:20201023---for:返回用户信息json数据----
|
||||
@GetMapping(value = "/getUserInfo")
|
||||
public String getUserInfo(){
|
||||
return readJson("classpath:com/jero/modules/demo/mock/json/userinfo.json");
|
||||
}
|
||||
//--update-end--author:wangshuai-----date:20201023---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, StandardCharsets.UTF_8);
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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": "jero/SelectDemo",
|
||||
"orderNum": 1,
|
||||
"hasChildren": false
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"name": "单表模型示例",
|
||||
"component": "jero/JeroDemoList",
|
||||
"orderNum": 2,
|
||||
"hasChildren": false
|
||||
},
|
||||
{
|
||||
"id": 23,
|
||||
"name": "一对多Tab示例",
|
||||
"component": "jero/tablist/JeroOrderDMainList",
|
||||
"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,10 @@
|
||||
{"data":
|
||||
[
|
||||
{"day": "星期一", "step": 1234, "assess": "良"},
|
||||
{"day": "星期二", "step": 1884, "assess": "优"},
|
||||
{"day": "星期三", "step": 1671, "assess": "良+"},
|
||||
{"day": "星期四", "step": 2197, "assess": "优+"},
|
||||
{"day": "星期五", "step": 1342, "assess": "中"},
|
||||
{"day": "星期六", "step": 545, "assess": "差"},
|
||||
{"day": "星期日", "step": 244, "assess": "极差"}
|
||||
]}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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,40 @@
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"department": "技术部",
|
||||
"post": "主管",
|
||||
"data": "2020年6月25日",
|
||||
"name": "张三",
|
||||
"sex": "男",
|
||||
"birth": "2020年6月25日",
|
||||
"political": "党员",
|
||||
"office": "法院",
|
||||
"nation": "汉",
|
||||
"health": "良好",
|
||||
"register": "农民",
|
||||
"education": "本科",
|
||||
"major": "计算机",
|
||||
"gdata": "2020年6月25日",
|
||||
"mailbox": "123@qq.com",
|
||||
"telphone": "18034569685",
|
||||
"homephone": "",
|
||||
"pworktime": "669633555222",
|
||||
"entrytime": "2020年6月25日",
|
||||
"school": "北京邮电大学",
|
||||
"iDCard": "523698541123333",
|
||||
"party": "2020年6月25日 上海",
|
||||
"marital": "已婚",
|
||||
"children": "有",
|
||||
"hukoustreet": "北京市朝阳区亚运村街道",
|
||||
"hukounum": "050000",
|
||||
"hukoudi": "北京市朝阳区亚运村亚运村小区19号楼7单元901",
|
||||
"Currentdi": "北京市朝阳区亚运村亚运村小区19号楼7单元901",
|
||||
"Currentnum": "050000",
|
||||
"socialsecurity": "是",
|
||||
"providentfund": "是",
|
||||
"hobby": "看书",
|
||||
"sbtype": "城镇社保",
|
||||
"archivesdi": "北京市朝阳区社保局"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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,424 @@
|
||||
package com.jero.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 com.jero.common.api.vo.Results;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.jero.common.constant.VXESocketConst;
|
||||
import com.jero.common.system.query.MatchTypeEnum;
|
||||
import com.jero.common.system.query.QueryCondition;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.demo.mock.vxe.entity.MockEntity;
|
||||
import com.jero.modules.demo.mock.vxe.websocket.VXESocket;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
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.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mock/vxe")
|
||||
@Slf4j
|
||||
public class VxeMockController {
|
||||
|
||||
/**
|
||||
* 模拟更改状态
|
||||
*
|
||||
* @param id
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change1")
|
||||
public Results<T> 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 Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟更改拖轮状态
|
||||
*
|
||||
* @param id
|
||||
* @param tug_status
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change2")
|
||||
public Results<T> 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 Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟更改进度条状态
|
||||
*
|
||||
* @param id
|
||||
* @param progress
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change3")
|
||||
public Results<T> 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 Results.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 Results<T> 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 Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 【模拟】即时保存单行数据
|
||||
*
|
||||
* @param rowData 行数据,实际使用时可以替换成一个实体类
|
||||
*/
|
||||
@PostMapping ("/immediateSaveRow")
|
||||
public Results<T> mockImmediateSaveRow(@RequestBody JSONObject rowData) throws InterruptedException {
|
||||
log.info("即时保存.rowData:" + rowData.toJSONString());
|
||||
// 延时1.5秒,模拟网慢堵塞真实感
|
||||
Thread.sleep(500);
|
||||
return Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 【模拟】即时保存整个表格的数据
|
||||
*
|
||||
* @param tableData 表格数据(实际使用时可以替换成一个List实体类)
|
||||
*/
|
||||
@PostMapping("/immediateSaveAll")
|
||||
public Results<T> mockImmediateSaveAll(@RequestBody JSONArray tableData) throws InterruptedException {
|
||||
// 【注】:
|
||||
// 1、tableData里包含该页所有的数据
|
||||
// 2、如果你实现了“即时保存”,那么除了新增的数据,其他的都是已经保存过的了,
|
||||
// 不需要再进行一次update操作了,所以可以在前端传数据的时候就遍历判断一下,
|
||||
// 只传新增的数据给后台insert即可,否者将会造成性能上的浪费。
|
||||
// 3、新增的行是没有id的,通过这一点,就可以判断是否是新增的数据
|
||||
|
||||
log.info("即时保存.tableData:" + tableData.toJSONString());
|
||||
// 延时1.5秒,模拟网慢堵塞真实感
|
||||
Thread.sleep(1000);
|
||||
return Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模拟数据
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页大小
|
||||
* @param parentId 父ID,不传则查询顶级
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getData")
|
||||
public Results<IPage<JSONObject>> 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:com/jero/modules/demo/mock/vxe/json/dlglong.json";
|
||||
// 读取JSON数据
|
||||
JSONArray dataList = readJsonData(path);
|
||||
if (dataList == null) {
|
||||
return Results.error("读取数据失败!");
|
||||
}
|
||||
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
|
||||
return Results.OK(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模拟“调度计划”页面的数据
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页大小
|
||||
* @param parentId 父ID,不传则查询顶级
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDdjhData")
|
||||
public Results<IPage<JSONObject>> 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();
|
||||
// 遍历输出到控制台
|
||||
log.info("\ngetDdjhData - 普通查询条件:");
|
||||
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
|
||||
log.info("-- " + entry.getKey() + ": " + JSON.toJSONString(entry.getValue()));
|
||||
}
|
||||
// 输出高级查询
|
||||
try {
|
||||
log.info("\ngetDdjhData - 高级查询条件:");
|
||||
// 高级查询模式
|
||||
MatchTypeEnum matchType = MatchTypeEnum.getByValue(superQueryMatchType);
|
||||
if (matchType == null) {
|
||||
log.info("-- 高级查询模式:不识别(" + superQueryMatchType + ")");
|
||||
} else {
|
||||
log.info("-- 高级查询模式:" + matchType.getValue());
|
||||
}
|
||||
superQueryParams = URLDecoder.decode(superQueryParams, "UTF-8");
|
||||
List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class);
|
||||
if (conditions != null) {
|
||||
for (QueryCondition condition : conditions) {
|
||||
log.info("-- " + JSON.toJSONString(condition));
|
||||
}
|
||||
} else {
|
||||
log.info("-- 没有传递任何高级查询条件");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("-- 高级查询操作失败:" + superQueryParams, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
/* 注:实际使用中不用写上面那种繁琐的代码,这里只是为了直观的输出到控制台里而写的示例,
|
||||
使用下面这种写法更简洁方便 */
|
||||
|
||||
// 封装成 MyBatisPlus 能识别的 QueryWrapper,可以直接使用这个对象进行SQL筛选条件拼接
|
||||
// 这个方法也会自动封装高级查询条件,但是高级查询参数名必须是superQueryParams和superQueryMatchType
|
||||
QueryWrapper<MockEntity> queryWrapper = QueryGenerator.initQueryWrapper(mockEntity, parameterMap);
|
||||
log.info("queryWrapper: " + queryWrapper.getCustomSqlSegment());
|
||||
|
||||
// 模拟JSON数据路径
|
||||
String path = "classpath:com/jero/modules/demo/mock/vxe/json/ddjh.json";
|
||||
if ("8".equals(status)) {
|
||||
path = "classpath:com/jero/modules/demo/mock/vxe/json/ddjh_s8.json";
|
||||
}
|
||||
// 读取JSON数据
|
||||
JSONArray dataList = readJsonData(path);
|
||||
if (dataList == null) {
|
||||
return Results.error("读取数据失败!");
|
||||
}
|
||||
|
||||
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
|
||||
List<JSONObject> records = getJsonObjects(dataList, page);
|
||||
page.setRecords(records);
|
||||
return Results.OK(page);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<JSONObject> getJsonObjects(JSONArray dataList, IPage<JSONObject> page) {
|
||||
// 逐行查询子表数据,用于计算拖轮状态
|
||||
List<JSONObject> records = page.getRecords();
|
||||
for (JSONObject obj : records) {
|
||||
Map<String, Integer> tugStatusMap = new HashMap<>();
|
||||
String id = obj.getString("id");
|
||||
// 查询出主表的拖轮
|
||||
String tugMain = obj.getString("tug");
|
||||
// 判断是否有值
|
||||
if (StringUtils.isNotBlank(tugMain)) {
|
||||
// 拖轮根据分号分割
|
||||
String[] tugs = tugMain.split(";");
|
||||
// 查询子表数据
|
||||
List<JSONObject> subRecords = this.queryDataPage(dataList, id, null, null).getRecords();
|
||||
// 遍历子表和拖轮数据,找出进行计算反推拖轮状态
|
||||
doForSubRecords(tugStatusMap, tugs, subRecords);
|
||||
}
|
||||
// 新加一个字段用于保存拖轮状态,不要直接覆盖原来的,这个字段可以不保存到数据库里
|
||||
obj.put("tug_status", tugStatusMap);
|
||||
}
|
||||
return records;
|
||||
}
|
||||
|
||||
private void doForSubRecords(Map<String, Integer> tugStatusMap, String[] tugs, List<JSONObject> subRecords) {
|
||||
for (JSONObject subData : subRecords) {
|
||||
String subTug = subData.getString("tug");
|
||||
if (StringUtils.isNotBlank(subTug)) {
|
||||
doForTugs(tugStatusMap, tugs, subData, subTug);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doForTugs(Map<String, Integer> tugStatusMap, String[] tugs, JSONObject subData, String 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟查询数据,可以根据父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, StandardCharsets.UTF_8);
|
||||
return JSON.parseArray(json);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return new JSONArray();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jero.modules.demo.mock.vxe.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 模拟实体
|
||||
*/
|
||||
@Data
|
||||
public class MockEntity {
|
||||
|
||||
// id
|
||||
private String id;
|
||||
// 父级ID
|
||||
private String parentId;
|
||||
// 状态
|
||||
private String status;
|
||||
|
||||
/* -- 省略其他字段 -- */
|
||||
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
package com.jero.modules.demo.mock.vxe.websocket;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.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.isEmpty()) {
|
||||
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) {
|
||||
log.error("异常",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) {
|
||||
log.error("异常",ignored);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* websocket 收到消息
|
||||
*/
|
||||
@OnMessage
|
||||
public void onMessage(String 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 com.jero.modules.demo.test.controller;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JeroDemo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.demo.test.service.IJeroDemoService;
|
||||
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 JeroController<JeroDemo, IJeroDemoService> {
|
||||
|
||||
/**
|
||||
* @param modelAndView
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/html")
|
||||
public ModelAndView ftl(ModelAndView modelAndView) {
|
||||
modelAndView.setViewName("demo3");
|
||||
List<String> userList = new ArrayList<>();
|
||||
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,289 @@
|
||||
package com.jero.modules.demo.test.controller;
|
||||
|
||||
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 com.jero.common.api.vo.Results;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.aspect.annotation.PermissionData;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.DateUtils;
|
||||
import com.jero.common.util.RedisUtil;
|
||||
import com.jero.modules.demo.test.entity.JeroDemo;
|
||||
import com.jero.modules.demo.test.service.IJeroDemoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 单表示例
|
||||
* @Author: jero-boot
|
||||
* @Date:2018-12-29
|
||||
* @Version:V2.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "单表DEMO")
|
||||
@RestController
|
||||
@RequestMapping("/test/jeroDemo")
|
||||
public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoService> {
|
||||
@Autowired
|
||||
private IJeroDemoService JeroDemoService;
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param jeroDemo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表")
|
||||
@GetMapping(value = "/list")
|
||||
@PermissionData(pageComponent = "jero/JeroDemoList")
|
||||
public Results<IPage<JeroDemo>> list(JeroDemo jeroDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeroDemo> queryWrapper = QueryGenerator.initQueryWrapper(jeroDemo, req.getParameterMap());
|
||||
Page<JeroDemo> page = new Page<>(pageNo, pageSize);
|
||||
|
||||
IPage<JeroDemo> pageList = JeroDemoService.page(page, queryWrapper);
|
||||
log.info("查询当前页:" + pageList.getCurrent());
|
||||
log.info("查询当前页数量:" + pageList.getSize());
|
||||
log.info("查询结果数量:" + pageList.getRecords().size());
|
||||
log.info("数据总数:" + pageList.getTotal());
|
||||
return Results.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jeroDemo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
@AutoLog(value = "添加测试DEMO")
|
||||
@ApiOperation(value = "添加DEMO", notes = "添加DEMO")
|
||||
public Results<T> add(@RequestBody JeroDemo jeroDemo) {
|
||||
JeroDemoService.save(jeroDemo);
|
||||
return Results.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jeroDemo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/edit")
|
||||
@ApiOperation(value = "编辑DEMO", notes = "编辑DEMO")
|
||||
@AutoLog(value = "编辑DEMO", operateType = CommonConstant.OPERATE_TYPE_3)
|
||||
public Results<T> edit(@RequestBody JeroDemo jeroDemo) {
|
||||
JeroDemoService.updateById(jeroDemo);
|
||||
return Results.OK("更新成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "删除测试DEMO")
|
||||
@PostMapping(value = "/delete")
|
||||
@ApiOperation(value = "通过ID删除DEMO", notes = "通过ID删除DEMO")
|
||||
public Results<T> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
JeroDemoService.removeById(id);
|
||||
return Results.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
@ApiOperation(value = "批量删除DEMO", notes = "批量删除DEMO")
|
||||
public Results<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
this.JeroDemoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Results.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
@ApiOperation(value = "通过ID查询DEMO", notes = "通过ID查询DEMO")
|
||||
public Results<JeroDemo> queryById(@ApiParam(name = "id", value = "示例id", required = true) @RequestParam(name = "id", required = true) String id) {
|
||||
JeroDemo jeroDemo = JeroDemoService.getById(id);
|
||||
return Results.OK(jeroDemo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
@PermissionData(pageComponent = "jero/JeroDemoList")
|
||||
public ModelAndView exportXls(HttpServletRequest request, JeroDemo jeroDemo) {
|
||||
//分sheet导出表格字段
|
||||
return super.exportXlsSheet(request, jeroDemo, JeroDemo.class, "单表模型",500);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Results<JeroDemo> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, JeroDemo.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() {
|
||||
JeroDemo p = new JeroDemo();
|
||||
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 JeroDemo redisGetJeroDemo(@PathVariable("id") String id) {
|
||||
JeroDemo t = JeroDemoService.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 Results<T> testOnlineAdd(@RequestBody JSONObject json) {
|
||||
log.info(json.toJSONString());
|
||||
return Results.OK("操作成功!");
|
||||
}
|
||||
|
||||
/*----------------------------------------外部获取权限示例------------------------------------*/
|
||||
|
||||
/**
|
||||
* 【数据权限示例 - 编程】mybatisPlus java类方式加载权限
|
||||
*
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/mpList")
|
||||
@PermissionData(pageComponent = "jero/JeroDemoList")
|
||||
public Results<IPage<JeroDemo>> loadMpPermissonList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeroDemo> queryWrapper = new QueryWrapper<JeroDemo>();
|
||||
//编程方式,给queryWrapper装载数据权限规则
|
||||
QueryGenerator.installAuthMplus(queryWrapper, JeroDemo.class);
|
||||
Page<JeroDemo> page = new Page<JeroDemo>(pageNo, pageSize);
|
||||
IPage<JeroDemo> pageList = JeroDemoService.page(page, queryWrapper);
|
||||
return Results.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 【数据权限示例 - 编程】mybatis xml方式加载权限
|
||||
*
|
||||
* @param jeroDemo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/sqlList")
|
||||
@PermissionData(pageComponent = "jero/JeroDemoList")
|
||||
public Results<IPage<JeroDemo>> loadSqlPermissonList(JeroDemo jeroDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<JeroDemo> pageList = JeroDemoService.queryListWithPermission(pageSize, pageNo);
|
||||
return Results.OK(pageList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
package com.jero.modules.demo.test.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Results;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.SpringContextUtils;
|
||||
import com.jero.config.easypoi.EasyPoiDictHandlerImpl;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderCustomer;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderMain;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderTicket;
|
||||
import com.jero.modules.demo.test.service.IJeroOrderCustomerService;
|
||||
import com.jero.modules.demo.test.service.IJeroOrderMainService;
|
||||
import com.jero.modules.demo.test.service.IJeroOrderTicketService;
|
||||
import com.jero.modules.demo.test.vo.JeroOrderMainPage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 一对多示例(JEditableTable行编辑)
|
||||
* @Author: jero-boot
|
||||
* @Date:2019-02-15
|
||||
* @Version: V2.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test/jeroOrderMain")
|
||||
@Slf4j
|
||||
public class JeroOrderMainController extends JeroController<JeroOrderMain, IJeroOrderMainService> {
|
||||
|
||||
@Autowired
|
||||
private IJeroOrderMainService jeroOrderMainService;
|
||||
@Autowired
|
||||
private IJeroOrderCustomerService jeroOrderCustomerService;
|
||||
@Autowired
|
||||
private IJeroOrderTicketService jeroOrderTicketService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param jeroOrderMain
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
public Results<IPage<JeroOrderMain>> queryPageList(JeroOrderMain jeroOrderMain, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
||||
QueryWrapper<JeroOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeroOrderMain, req.getParameterMap());
|
||||
Page<JeroOrderMain> page = new Page<>(pageNo, pageSize);
|
||||
IPage<JeroOrderMain> pageList = jeroOrderMainService.page(page, queryWrapper);
|
||||
return Results.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jeroOrderMainPage
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public Results<T> add(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
JeroOrderMain jeroOrderMain = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(jeroOrderMainPage, jeroOrderMain);
|
||||
jeroOrderMainService.saveMain(jeroOrderMain, jeroOrderMainPage.getJeroOrderCustomerList(), jeroOrderMainPage.getJeroOrderTicketList());
|
||||
return Results.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jeroOrderMainPage
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/edit")
|
||||
public Results<T> eidt(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
JeroOrderMain jeroOrderMain = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(jeroOrderMainPage, jeroOrderMain);
|
||||
jeroOrderMainService.updateCopyMain(jeroOrderMain, jeroOrderMainPage.getJeroOrderCustomerList(), jeroOrderMainPage.getJeroOrderTicketList());
|
||||
return Results.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/delete")
|
||||
public Results<T> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
jeroOrderMainService.delMain(id);
|
||||
return Results.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Results<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
this.jeroOrderMainService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Results.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
public Results<JeroOrderMain> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
JeroOrderMain jeroOrderMain = jeroOrderMainService.getById(id);
|
||||
return Results.OK(jeroOrderMain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryOrderCustomerListByMainId")
|
||||
public Results<List<JeroOrderCustomer>> queryOrderCustomerListByMainId(@RequestParam(name = "id", required = true) String id) {
|
||||
List<JeroOrderCustomer> jeroOrderCustomerList = jeroOrderCustomerService.selectCustomersByMainId(id);
|
||||
return Results.OK(jeroOrderCustomerList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryOrderTicketListByMainId")
|
||||
public Results<List<JeroOrderTicket>> queryOrderTicketListByMainId(@RequestParam(name = "id", required = true) String id) {
|
||||
List<JeroOrderTicket> jeroOrderTicketList = jeroOrderTicketService.selectTicketsByMainId(id);
|
||||
return Results.OK(jeroOrderTicketList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, JeroOrderMain jeroOrderMain) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<JeroOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeroOrderMain, request.getParameterMap());
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new EasypoiSingleExcelView());
|
||||
//获取当前用户
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
List<JeroOrderMainPage> pageList = new ArrayList<>();
|
||||
|
||||
List<JeroOrderMain> jeroOrderMainList = jeroOrderMainService.list(queryWrapper);
|
||||
for (JeroOrderMain orderMain : jeroOrderMainList) {
|
||||
JeroOrderMainPage vo = new JeroOrderMainPage();
|
||||
BeanUtils.copyProperties(orderMain, vo);
|
||||
// 查询机票
|
||||
List<JeroOrderTicket> jeroOrderTicketList = jeroOrderTicketService.selectTicketsByMainId(orderMain.getId());
|
||||
vo.setJeroOrderTicketList(jeroOrderTicketList);
|
||||
// 查询客户
|
||||
List<JeroOrderCustomer> jeroOrderCustomerList = jeroOrderCustomerService.selectCustomersByMainId(orderMain.getId());
|
||||
vo.setJeroOrderCustomerList(jeroOrderCustomerList);
|
||||
pageList.add(vo);
|
||||
}
|
||||
|
||||
// 导出文件名称
|
||||
mv.addObject(FILE_NAME, "一对多订单示例");
|
||||
// 注解对象Class
|
||||
mv.addObject(CLASS, JeroOrderMainPage.class);
|
||||
// 自定义表格参数
|
||||
ExportParams exportParams = new ExportParams("自定义导出Excel内容标题", "导出人:" + sysUser.getRealname(), "自定义Sheet名字");
|
||||
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
|
||||
mv.addObject(PARAMS, exportParams);
|
||||
|
||||
// 导出数据列表
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
@PostMapping("/importExcel")
|
||||
public Results<T> 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.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(2);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<JeroOrderMainPage> list = ExcelImportUtil.importExcel(file.getInputStream(), JeroOrderMainPage.class, params);
|
||||
for (JeroOrderMainPage page : list) {
|
||||
JeroOrderMain po = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(page, po);
|
||||
jeroOrderMainService.saveMain(po, page.getJeroOrderCustomerList(), page.getJeroOrderTicketList());
|
||||
}
|
||||
return Results.OK("文件导入成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Results.error("文件导入失败:" + e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Results.error("文件导入失败!");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
package com.jero.modules.demo.test.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.jero.common.api.vo.Results;
|
||||
import com.jero.common.api.vo.ResultConstant;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderCustomer;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderMain;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderTicket;
|
||||
import com.jero.modules.demo.test.service.IJeroOrderCustomerService;
|
||||
import com.jero.modules.demo.test.service.IJeroOrderMainService;
|
||||
import com.jero.modules.demo.test.service.IJeroOrderTicketService;
|
||||
import com.jero.modules.demo.test.vo.JeroOrderMainPage;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
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 JeroOrderTabMainController {
|
||||
|
||||
@Autowired
|
||||
private IJeroOrderMainService jeroOrderMainService;
|
||||
@Autowired
|
||||
private IJeroOrderCustomerService jeroOrderCustomerService;
|
||||
@Autowired
|
||||
private IJeroOrderTicketService jeroOrderTicketService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param jeroOrderMain
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/orderList")
|
||||
public Results<IPage<JeroOrderMain>> respondePagedData(JeroOrderMain jeroOrderMain,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeroOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeroOrderMain, req.getParameterMap());
|
||||
Page<JeroOrderMain> page = new Page<>(pageNo, pageSize);
|
||||
IPage<JeroOrderMain> pageList = jeroOrderMainService.page(page, queryWrapper);
|
||||
return Results.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jeroOrderMainPage
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public Results<T> add(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
JeroOrderMain jeroOrderMain = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(jeroOrderMainPage, jeroOrderMain);
|
||||
jeroOrderMainService.save(jeroOrderMain);
|
||||
return Results.OK(ResultConstant.OP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jeroOrderMainPage
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/edit")
|
||||
public Results<T> edit(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
JeroOrderMain jeroOrderMain = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(jeroOrderMainPage, jeroOrderMain);
|
||||
jeroOrderMainService.updateById(jeroOrderMain);
|
||||
return Results.OK(ResultConstant.OP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/delete")
|
||||
public Results<T> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
jeroOrderMainService.delMain(id);
|
||||
return Results.OK(ResultConstant.DEL_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Results<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
this.jeroOrderMainService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Results.OK(ResultConstant.BATCH_DEL_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
public Results<JeroOrderMain> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
JeroOrderMain jeroOrderMain = jeroOrderMainService.getById(id);
|
||||
return Results.OK(jeroOrderMain);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param jeroOrderCustomer
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/listOrderCustomerByMainId")
|
||||
public Results<IPage<JeroOrderCustomer>> queryOrderCustomerListByMainId(JeroOrderCustomer jeroOrderCustomer,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeroOrderCustomer> queryWrapper = QueryGenerator.initQueryWrapper(jeroOrderCustomer, req.getParameterMap());
|
||||
Page<JeroOrderCustomer> page = new Page<>(pageNo, pageSize);
|
||||
IPage<JeroOrderCustomer> pageList = jeroOrderCustomerService.page(page, queryWrapper);
|
||||
return Results.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param jeroOrderTicket
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/listOrderTicketByMainId")
|
||||
public Results<IPage<JeroOrderTicket>> queryOrderTicketListByMainId(JeroOrderTicket jeroOrderTicket,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeroOrderTicket> queryWrapper = QueryGenerator.initQueryWrapper(jeroOrderTicket, req.getParameterMap());
|
||||
Page<JeroOrderTicket> page = new Page<>(pageNo, pageSize);
|
||||
IPage<JeroOrderTicket> pageList = jeroOrderTicketService.page(page, queryWrapper);
|
||||
return Results.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jeroOrderCustomer
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addCustomer")
|
||||
public Results<T> addCustomer(@RequestBody JeroOrderCustomer jeroOrderCustomer) {
|
||||
jeroOrderCustomerService.save(jeroOrderCustomer);
|
||||
return Results.OK(ResultConstant.OP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jeroOrderCustomer
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/editCustomer")
|
||||
public Results<T> editCustomer(@RequestBody JeroOrderCustomer jeroOrderCustomer) {
|
||||
jeroOrderCustomerService.updateById(jeroOrderCustomer);
|
||||
return Results.OK(ResultConstant.OP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteCustomer")
|
||||
public Results<T> deleteCustomer(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
jeroOrderCustomerService.removeById(id);
|
||||
return Results.OK(ResultConstant.DEL_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatchCustomer")
|
||||
public Results<T> deleteBatchCustomer(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
this.jeroOrderCustomerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Results.OK(ResultConstant.BATCH_DEL_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jeroOrderTicket
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addTicket")
|
||||
public Results<T> addTicket(@RequestBody JeroOrderTicket jeroOrderTicket) {
|
||||
jeroOrderTicketService.save(jeroOrderTicket);
|
||||
return Results.OK(ResultConstant.OP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jeroOrderTicket
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/editTicket")
|
||||
public Results<T> editTicket(@RequestBody JeroOrderTicket jeroOrderTicket) {
|
||||
jeroOrderTicketService.updateById(jeroOrderTicket);
|
||||
return Results.OK(ResultConstant.OP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteTicket")
|
||||
public Results<T> deleteTicket(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
jeroOrderTicketService.removeById(id);
|
||||
return Results.OK(ResultConstant.DEL_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatchTicket")
|
||||
public Results<T> deleteBatchTicket(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
this.jeroOrderTicketService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Results.OK(ResultConstant.BATCH_DEL_OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
package com.jero.modules.demo.test.controller;
|
||||
|
||||
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 com.jero.common.api.vo.Results;
|
||||
import com.jero.common.api.vo.ResultConstant;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.SpringContextUtils;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.config.easypoi.EasyPoiDictHandlerImpl;
|
||||
import com.jero.modules.demo.test.entity.JoaDemo;
|
||||
import com.jero.modules.demo.test.service.IJoaDemoService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.view.EasypoiSingleExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jero-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 Results<IPage<JoaDemo>> queryPageList(JoaDemo joaDemo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Results<IPage<JoaDemo>> result = new Results<>();
|
||||
QueryWrapper<JoaDemo> queryWrapper = QueryGenerator.initQueryWrapper(joaDemo, req.getParameterMap());
|
||||
Page<JoaDemo> page = new Page<>(pageNo, pageSize);
|
||||
IPage<JoaDemo> pageList = joaDemoService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param joaDemo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public Results<Object> add(@RequestBody JoaDemo joaDemo) {
|
||||
try {
|
||||
joaDemoService.save(joaDemo);
|
||||
return Results.OK("操作成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Results.error("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param joaDemo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/edit")
|
||||
public Results<Object> edit(@RequestBody JoaDemo joaDemo) {
|
||||
JoaDemo joaDemoEntity = joaDemoService.getById(joaDemo.getId());
|
||||
if(joaDemoEntity==null) {
|
||||
return Results.error(ResultConstant.EN_WAS_NOT_FOUND);
|
||||
}else {
|
||||
boolean ok = joaDemoService.updateById(joaDemo);
|
||||
if(ok) {
|
||||
return Results.OK("操作成功!");
|
||||
}
|
||||
}
|
||||
|
||||
return Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/delete")
|
||||
public Results<Object> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Results.error("参数不识别!");
|
||||
}
|
||||
JoaDemo joaDemo = joaDemoService.getById(id);
|
||||
if(joaDemo==null) {
|
||||
return Results.error(ResultConstant.EN_WAS_NOT_FOUND);
|
||||
}else {
|
||||
boolean ok = joaDemoService.removeById(id);
|
||||
if(ok) {
|
||||
return Results.OK("删除成功!");
|
||||
}
|
||||
}
|
||||
return Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Results<Object> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
return Results.error("参数不识别!");
|
||||
}else {
|
||||
this.joaDemoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Results.OK("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
public Results<JoaDemo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
JoaDemo joaDemo = joaDemoService.getById(id);
|
||||
if(joaDemo==null) {
|
||||
return Results.error(ResultConstant.EN_WAS_NOT_FOUND);
|
||||
}else {
|
||||
return Results.OK(joaDemo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出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 EasypoiSingleExcelView());
|
||||
List<JoaDemo> pageList = joaDemoService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(JeroController.FILE_NAME, "流程测试列表");
|
||||
mv.addObject(JeroController.CLASS, JoaDemo.class);
|
||||
ExportParams exportParams = new ExportParams("流程测试列表数据", "导出人:Jero", "导出信息");
|
||||
exportParams.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
|
||||
mv.addObject(JeroController.PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
|
||||
@PostMapping("/importExcel")
|
||||
public Results<T> 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.setDictHandler(SpringContextUtils.getApplicationContext().getBean(EasyPoiDictHandlerImpl.class));
|
||||
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 Results.OK("文件导入成功!数据行数:" + listJoaDemos.size());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Results.error("文件导入失败:"+e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Results.OK("文件导入失败!");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.jero.modules.demo.test.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.jero.common.system.base.entity.JeroEntity;
|
||||
import cn.afterturn.easypoi.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: Jero 测试demo
|
||||
* @Author: jero-boot
|
||||
* @Date: 2018-12-29
|
||||
* @Version:V1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="测试DEMO对象", description="测试DEMO")
|
||||
@TableName("demo")
|
||||
public class JeroDemo extends JeroEntity 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, dict = "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;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private java.lang.Integer tenantId;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.jero.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 cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* @Description: 订单客户
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("jero_order_customer")
|
||||
public class JeroOrderCustomer 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 com.jero.modules.demo.test.entity;
|
||||
|
||||
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;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 订单
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("jero_order_main")
|
||||
public class JeroOrderMain 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 com.jero.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 cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* @Description: 订单机票
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("jero_order_ticket")
|
||||
public class JeroOrderTicket 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 com.jero.modules.demo.test.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import cn.afterturn.easypoi.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: jero-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,44 @@
|
||||
package com.jero.modules.demo.test.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JeroDemo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
/**
|
||||
* @Description: jero 测试demo
|
||||
* @Author: jero-boot
|
||||
* @Date: 2018-12-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JeroDemoMapper extends BaseMapper<JeroDemo> {
|
||||
|
||||
public List<JeroDemo> getDemoByName(@Param("name") String name);
|
||||
|
||||
/**
|
||||
* 查询列表数据 直接传数据权限的sql进行数据过滤
|
||||
* @param page
|
||||
* @param permissionSql
|
||||
* @return
|
||||
*/
|
||||
public IPage<JeroDemo> queryListWithPermission(Page<JeroDemo> page, @Param("permissionSql")String permissionSql);
|
||||
|
||||
/**
|
||||
* 根据前缀获取所有有效权限
|
||||
* @param permsPrefix
|
||||
* @return
|
||||
*/
|
||||
public List<String> queryAllAuth(@Param("permsPrefix")String permsPrefix);
|
||||
|
||||
/**
|
||||
* 查询用户已授权字段
|
||||
* @param userId
|
||||
* @param permsPrefix
|
||||
* @return
|
||||
*/
|
||||
public List<String> queryUserAuth(@Param("userId")String userId,@Param("permsPrefix")String permsPrefix);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jero.modules.demo.test.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderCustomer;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 订单客户
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JeroOrderCustomerMapper extends BaseMapper<JeroOrderCustomer> {
|
||||
|
||||
/**
|
||||
* 通过主表外键批量删除客户
|
||||
* @param mainId
|
||||
* @return
|
||||
*/
|
||||
@Delete("DELETE FROM JERO_ORDER_CUSTOMER WHERE ORDER_ID = #{mainId}")
|
||||
public boolean deleteCustomersByMainId(String mainId);
|
||||
|
||||
@Select("SELECT * FROM JERO_ORDER_CUSTOMER WHERE ORDER_ID = #{mainId}")
|
||||
public List<JeroOrderCustomer> selectCustomersByMainId(String mainId);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.demo.test.mapper;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JeroOrderMain;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 订单
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JeroOrderMainMapper extends BaseMapper<JeroOrderMain> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jero.modules.demo.test.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderTicket;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 订单机票
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JeroOrderTicketMapper extends BaseMapper<JeroOrderTicket> {
|
||||
|
||||
/**
|
||||
* 通过主表外键批量删除客户
|
||||
* @param mainId
|
||||
* @return
|
||||
*/
|
||||
@Delete("DELETE FROM JERO_ORDER_TICKET WHERE ORDER_ID = #{mainId}")
|
||||
public boolean deleteTicketsByMainId(String mainId);
|
||||
|
||||
|
||||
@Select("SELECT * FROM JERO_ORDER_TICKET WHERE ORDER_ID = #{mainId}")
|
||||
public List<JeroOrderTicket> selectTicketsByMainId(String mainId);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.jero.modules.demo.test.mapper;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JoaDemo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface JoaDemoMapper extends BaseMapper<JoaDemo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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="com.jero.modules.demo.test.mapper.JeroDemoMapper">
|
||||
|
||||
<!-- 根据用户名查询 -->
|
||||
<select id="getDemoByName" resultType="com.jero.modules.demo.test.entity.JeroDemo">
|
||||
select * from demo where name = #{name}
|
||||
</select>
|
||||
|
||||
<!-- 根据权限sql查询数据集 -->
|
||||
<select id="queryListWithPermission" parameterType="Object" resultType="com.jero.modules.demo.test.entity.JeroDemo">
|
||||
select * from demo where 1=1 ${permissionSql}
|
||||
</select>
|
||||
|
||||
<!-- 查询所有符合前缀且有效字段 -->
|
||||
<select id="queryAllAuth" resultType="java.lang.String">
|
||||
select perms from sys_permission
|
||||
where perms
|
||||
like concat(concat('%',#{permsPrefix}),'%')
|
||||
and del_flag=0
|
||||
and status='1'
|
||||
</select>
|
||||
|
||||
<!-- 查询用户已授权字段 -->
|
||||
<select id="queryUserAuth" resultType="java.lang.String">
|
||||
select DISTINCT perms from sys_user_role sur,
|
||||
sys_role_permission srp,
|
||||
sys_permission sp
|
||||
where sur.role_id = srp.role_id
|
||||
and sp.id = srp.permission_id
|
||||
and sur.user_id = #{userId}
|
||||
and sp.perms like concat(concat('%',#{permsPrefix}),'%')
|
||||
</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="com.jero.modules.demo.test.mapper.JeroOrderCustomerMapper">
|
||||
|
||||
</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="com.jero.modules.demo.test.mapper.JeroOrderMainMapper">
|
||||
|
||||
</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="com.jero.modules.demo.test.mapper.JeroOrderTicketMapper">
|
||||
|
||||
</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="com.jero.modules.demo.test.mapper.JoaDemoMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.jero.modules.demo.test.service;
|
||||
|
||||
import com.jero.common.system.base.service.JeroService;
|
||||
import com.jero.modules.demo.test.entity.JeroDemo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
/**
|
||||
* @Description: jero 测试demo
|
||||
* @Author: jero-boot
|
||||
* @Date: 2018-12-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJeroDemoService extends JeroService<JeroDemo> {
|
||||
|
||||
public void testTran();
|
||||
|
||||
public JeroDemo getByIdCacheable(String id);
|
||||
|
||||
/**
|
||||
* 查询列表数据 在service中获取数据权限sql信息
|
||||
* @param pageSize
|
||||
* @param pageNo
|
||||
* @return
|
||||
*/
|
||||
IPage<JeroDemo> queryListWithPermission(int pageSize, int pageNo);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.jero.modules.demo.test.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JeroOrderCustomer;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 订单客户
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJeroOrderCustomerService extends IService<JeroOrderCustomer> {
|
||||
|
||||
public List<JeroOrderCustomer> selectCustomersByMainId(String mainId);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.jero.modules.demo.test.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JeroOrderCustomer;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderMain;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderTicket;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 订单
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJeroOrderMainService extends IService<JeroOrderMain> {
|
||||
|
||||
/**
|
||||
* 添加一对多
|
||||
*
|
||||
*/
|
||||
public void saveMain(JeroOrderMain jeroOrderMain, List<JeroOrderCustomer> jeroOrderCustomerList, List<JeroOrderTicket> jeroOrderTicketList) ;
|
||||
|
||||
/**
|
||||
* 修改一对多
|
||||
*
|
||||
*/
|
||||
public void updateMain(JeroOrderMain jeroOrderMain, List<JeroOrderCustomer> jeroOrderCustomerList, List<JeroOrderTicket> jeroOrderTicketList);
|
||||
|
||||
/**
|
||||
* 删除一对多
|
||||
* @param jformOrderMain
|
||||
*/
|
||||
public void delMain (String id);
|
||||
|
||||
/**
|
||||
* 批量删除一对多
|
||||
* @param jformOrderMain
|
||||
*/
|
||||
public void delBatchMain (Collection<? extends Serializable> idList);
|
||||
|
||||
public void updateCopyMain(JeroOrderMain jeroOrderMain, List<JeroOrderCustomer> jeroOrderCustomerList, List<JeroOrderTicket> jeroOrderTicketList);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.jero.modules.demo.test.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JeroOrderTicket;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 订单机票
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJeroOrderTicketService extends IService<JeroOrderTicket> {
|
||||
|
||||
public List<JeroOrderTicket> selectTicketsByMainId(String mainId);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.jero.modules.demo.test.service;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JoaDemo;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IJoaDemoService extends IService<JoaDemo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.jero.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 com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.demo.test.entity.JeroDemo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.demo.test.mapper.JeroDemoMapper;
|
||||
import com.jero.modules.demo.test.service.IJeroDemoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: Jero 测试demo
|
||||
* @Author: jero-boot
|
||||
* @Date: 2018-12-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class JeroDemoServiceImpl extends ServiceImpl<JeroDemoMapper, JeroDemo> implements IJeroDemoService {
|
||||
@Autowired
|
||||
JeroDemoMapper jeroDemoMapper;
|
||||
|
||||
/**
|
||||
* 事务控制在service层面
|
||||
* 加上注解:@Transactional,声明的方法就是一个独立的事务(有异常DB操作全部回滚)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public void testTran() {
|
||||
JeroDemo pp = new JeroDemo();
|
||||
pp.setAge(1111);
|
||||
pp.setName("测试事务 小白兔 1");
|
||||
jeroDemoMapper.insert(pp);
|
||||
|
||||
JeroDemo pp2 = new JeroDemo();
|
||||
pp2.setAge(2222);
|
||||
pp2.setName("测试事务 小白兔 2");
|
||||
jeroDemoMapper.insert(pp2);
|
||||
|
||||
// Integer.parseInt("hello");//自定义异常
|
||||
|
||||
JeroDemo pp3 = new JeroDemo();
|
||||
pp3.setAge(3333);
|
||||
pp3.setName("测试事务 小白兔 3");
|
||||
jeroDemoMapper.insert(pp3);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 缓存注解测试: redis
|
||||
*/
|
||||
@Override
|
||||
@Cacheable(cacheNames = CacheConstant.TEST_DEMO_CACHE, key = "#id")
|
||||
public JeroDemo getByIdCacheable(String id) {
|
||||
JeroDemo t = jeroDemoMapper.selectById(id);
|
||||
log.info("---未读缓存,读取数据库---");
|
||||
log.error(String.valueOf(t));
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<JeroDemo> queryListWithPermission(int pageSize, int pageNo) {
|
||||
Page<JeroDemo> page = new Page<>(pageNo, pageSize);
|
||||
//编程方式,获取当前请求的数据权限规则SQL片段
|
||||
String sql = QueryGenerator.installAuthJdbc(JeroDemo.class);
|
||||
return this.baseMapper.queryListWithPermission(page, sql);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jero.modules.demo.test.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JeroOrderCustomer;
|
||||
import com.jero.modules.demo.test.mapper.JeroOrderCustomerMapper;
|
||||
import com.jero.modules.demo.test.service.IJeroOrderCustomerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 订单客户
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JeroOrderCustomerServiceImpl extends ServiceImpl<JeroOrderCustomerMapper, JeroOrderCustomer> implements IJeroOrderCustomerService {
|
||||
|
||||
@Autowired
|
||||
private JeroOrderCustomerMapper jeroOrderCustomerMapper;
|
||||
|
||||
@Override
|
||||
public List<JeroOrderCustomer> selectCustomersByMainId(String mainId) {
|
||||
return jeroOrderCustomerMapper.selectCustomersByMainId(mainId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.jero.modules.demo.test.service.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderCustomer;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderMain;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderTicket;
|
||||
import com.jero.modules.demo.test.mapper.JeroOrderCustomerMapper;
|
||||
import com.jero.modules.demo.test.mapper.JeroOrderMainMapper;
|
||||
import com.jero.modules.demo.test.mapper.JeroOrderTicketMapper;
|
||||
import com.jero.modules.demo.test.service.IJeroOrderMainService;
|
||||
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: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JeroOrderMainServiceImpl extends ServiceImpl<JeroOrderMainMapper, JeroOrderMain> implements IJeroOrderMainService {
|
||||
|
||||
@Autowired
|
||||
private JeroOrderMainMapper jeroOrderMainMapper;
|
||||
@Autowired
|
||||
private JeroOrderCustomerMapper jeroOrderCustomerMapper;
|
||||
@Autowired
|
||||
private JeroOrderTicketMapper jeroOrderTicketMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveMain(JeroOrderMain jeroOrderMain, List<JeroOrderCustomer> jeroOrderCustomerList, List<JeroOrderTicket> jeroOrderTicketList) {
|
||||
jeroOrderMainMapper.insert(jeroOrderMain);
|
||||
if (jeroOrderCustomerList != null) {
|
||||
for (JeroOrderCustomer entity : jeroOrderCustomerList) {
|
||||
entity.setOrderId(jeroOrderMain.getId());
|
||||
jeroOrderCustomerMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
if (jeroOrderTicketList != null) {
|
||||
for (JeroOrderTicket entity : jeroOrderTicketList) {
|
||||
entity.setOrderId(jeroOrderMain.getId());
|
||||
jeroOrderTicketMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateMain(JeroOrderMain jeroOrderMain, List<JeroOrderCustomer> jeroOrderCustomerList, List<JeroOrderTicket> jeroOrderTicketList) {
|
||||
jeroOrderMainMapper.updateById(jeroOrderMain);
|
||||
|
||||
//1.先删除子表数据
|
||||
jeroOrderTicketMapper.deleteTicketsByMainId(jeroOrderMain.getId());
|
||||
jeroOrderCustomerMapper.deleteCustomersByMainId(jeroOrderMain.getId());
|
||||
|
||||
//2.子表数据重新插入
|
||||
if (jeroOrderCustomerList != null) {
|
||||
for (JeroOrderCustomer entity : jeroOrderCustomerList) {
|
||||
entity.setOrderId(jeroOrderMain.getId());
|
||||
jeroOrderCustomerMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
if (jeroOrderTicketList != null) {
|
||||
for (JeroOrderTicket entity : jeroOrderTicketList) {
|
||||
entity.setOrderId(jeroOrderMain.getId());
|
||||
jeroOrderTicketMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 一对多维护逻辑改造 LOWCOD-315
|
||||
* @param jeroOrderMain
|
||||
* @param jeroOrderCustomerList
|
||||
* @param jeroOrderTicketList
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public void updateCopyMain(JeroOrderMain jeroOrderMain, List<JeroOrderCustomer> jeroOrderCustomerList, List<JeroOrderTicket> jeroOrderTicketList) {
|
||||
jeroOrderMainMapper.updateById(jeroOrderMain);
|
||||
|
||||
// 循环前台传过来的数据
|
||||
for (JeroOrderTicket ticket: jeroOrderTicketList){
|
||||
// 先查询子表数据库
|
||||
JeroOrderTicket orderTicket = jeroOrderTicketMapper.selectById(ticket.getId());
|
||||
if(orderTicket == null){
|
||||
// 当传过来的id数据库不存在时,说明数据库没有,走新增逻辑
|
||||
ticket.setOrderId(jeroOrderMain.getId());
|
||||
jeroOrderTicketMapper.insert(ticket);
|
||||
break;
|
||||
}
|
||||
if(orderTicket.getId().equals(ticket.getId())){
|
||||
// 传过来的id和数据库id一至时,说明数据库存在该数据,走更新逻辑
|
||||
jeroOrderTicketMapper.updateById(ticket);
|
||||
}
|
||||
}
|
||||
for (JeroOrderCustomer customer: jeroOrderCustomerList){
|
||||
// 先查询子表数据库
|
||||
JeroOrderCustomer customers = jeroOrderCustomerMapper.selectById(customer.getId());
|
||||
if(customers == null){
|
||||
// 当传过来的id数据库不存在时,说明数据库没有,走新增逻辑
|
||||
customer.setOrderId(jeroOrderMain.getId());
|
||||
jeroOrderCustomerMapper.insert(customer);
|
||||
break;
|
||||
}
|
||||
if(customers.getId().equals(customer.getId())){
|
||||
jeroOrderCustomerMapper.updateById(customer);
|
||||
}
|
||||
}
|
||||
// 当跟新和删除之后取差集, 当传过来的id不存在,而数据库存在时,说明已删除,走删除逻辑
|
||||
List<JeroOrderTicket> jeroOrderTickets = jeroOrderTicketMapper.selectTicketsByMainId(jeroOrderMain.getId());
|
||||
List<JeroOrderTicket> collect = jeroOrderTickets.stream()
|
||||
.filter(item -> !jeroOrderTicketList.stream()
|
||||
.map(JeroOrderTicket::getId)
|
||||
.collect(Collectors.toList())
|
||||
.contains(item.getId()))
|
||||
.collect(Collectors.toList());
|
||||
// for循环删除id
|
||||
for (JeroOrderTicket ticket:collect){
|
||||
jeroOrderTicketMapper.deleteById(ticket.getId());
|
||||
}
|
||||
|
||||
List<JeroOrderCustomer> jeroOrderCustomers = jeroOrderCustomerMapper.selectCustomersByMainId(jeroOrderMain.getId());
|
||||
List<JeroOrderCustomer> customersCollect = jeroOrderCustomers.stream()
|
||||
.filter(item -> !jeroOrderCustomerList.stream()
|
||||
.map(JeroOrderCustomer::getId)
|
||||
.collect(Collectors.toList())
|
||||
.contains(item.getId()))
|
||||
.collect(Collectors.toList());
|
||||
for (JeroOrderCustomer c:customersCollect){
|
||||
jeroOrderCustomerMapper.deleteById(c.getId());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@Transactional
|
||||
public void delMain(String id) {
|
||||
jeroOrderMainMapper.deleteById(id);
|
||||
jeroOrderTicketMapper.deleteTicketsByMainId(id);
|
||||
jeroOrderCustomerMapper.deleteCustomersByMainId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delBatchMain(Collection<? extends Serializable> idList) {
|
||||
for(Serializable id:idList) {
|
||||
jeroOrderMainMapper.deleteById(id);
|
||||
jeroOrderTicketMapper.deleteTicketsByMainId(id.toString());
|
||||
jeroOrderCustomerMapper.deleteCustomersByMainId(id.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jero.modules.demo.test.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JeroOrderTicket;
|
||||
import com.jero.modules.demo.test.mapper.JeroOrderTicketMapper;
|
||||
import com.jero.modules.demo.test.service.IJeroOrderTicketService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 订单机票
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JeroOrderTicketServiceImpl extends ServiceImpl<JeroOrderTicketMapper, JeroOrderTicket> implements IJeroOrderTicketService {
|
||||
@Autowired
|
||||
private JeroOrderTicketMapper jeroOrderTicketMapper;
|
||||
|
||||
@Override
|
||||
public List<JeroOrderTicket> selectTicketsByMainId(String mainId) {
|
||||
return jeroOrderTicketMapper.selectTicketsByMainId(mainId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jero.modules.demo.test.service.impl;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JoaDemo;
|
||||
import com.jero.modules.demo.test.mapper.JoaDemoMapper;
|
||||
import com.jero.modules.demo.test.service.IJoaDemoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
* @Author: jero-boot
|
||||
* @Date: 2019-05-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JoaDemoServiceImpl extends ServiceImpl<JoaDemoMapper, JoaDemo> implements IJoaDemoService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.jero.modules.demo.test.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jero.modules.demo.test.entity.JeroOrderCustomer;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderTicket;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class JeroOrderMainPage {
|
||||
|
||||
/**主键*/
|
||||
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<JeroOrderCustomer> jeroOrderCustomerList;
|
||||
@ExcelCollection(name="机票")
|
||||
private List<JeroOrderTicket> jeroOrderTicketList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,427 @@
|
||||
package com.jero.modules.dlglong.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 com.jero.common.api.vo.Results;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.jero.common.system.query.MatchTypeEnum;
|
||||
import com.jero.common.system.query.QueryCondition;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.constant.VXESocketConst;
|
||||
import com.jero.modules.demo.mock.vxe.websocket.VXESocket;
|
||||
import com.jero.modules.dlglong.entity.MockEntity;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
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.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/mock/dlglong")
|
||||
public class DlMockController {
|
||||
|
||||
/**
|
||||
* 模拟更改状态
|
||||
*
|
||||
* @param id
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change1")
|
||||
public Results<T> 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 Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟更改拖轮状态
|
||||
*
|
||||
* @param id
|
||||
* @param tug_status
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change2")
|
||||
public Results<T> 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 Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟更改进度条状态
|
||||
*
|
||||
* @param id
|
||||
* @param progress
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change3")
|
||||
public Results<T> 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 Results.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 Results<T> 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 Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 【模拟】即时保存单行数据
|
||||
*
|
||||
* @param rowData 行数据,实际使用时可以替换成一个实体类
|
||||
*/
|
||||
@PostMapping("/immediateSaveRow")
|
||||
public Results<T> mockImmediateSaveRow(@RequestBody JSONObject rowData) throws InterruptedException {
|
||||
log.info("即时保存.rowData:" + rowData.toJSONString());
|
||||
// 延时1.5秒,模拟网慢堵塞真实感
|
||||
Thread.sleep(500);
|
||||
return Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 【模拟】即时保存整个表格的数据
|
||||
*
|
||||
* @param tableData 表格数据(实际使用时可以替换成一个List实体类)
|
||||
*/
|
||||
@PostMapping("/immediateSaveAll")
|
||||
public Results<T> mockImmediateSaveAll(@RequestBody JSONArray tableData) throws InterruptedException {
|
||||
// 【注】:
|
||||
// 1、tableData里包含该页所有的数据
|
||||
// 2、如果你实现了“即时保存”,那么除了新增的数据,其他的都是已经保存过的了,
|
||||
// 不需要再进行一次update操作了,所以可以在前端传数据的时候就遍历判断一下,
|
||||
// 只传新增的数据给后台insert即可,否者将会造成性能上的浪费。
|
||||
// 3、新增的行是没有id的,通过这一点,就可以判断是否是新增的数据
|
||||
|
||||
log.info("即时保存.tableData:" + tableData.toJSONString());
|
||||
// 延时1.5秒,模拟网慢堵塞真实感
|
||||
Thread.sleep(1000);
|
||||
return Results.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模拟数据
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页大小
|
||||
* @param parentId 父ID,不传则查询顶级
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getData")
|
||||
public Results<IPage<JSONObject>> 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:com/jero/modules/dlglong/json/dlglong.json";
|
||||
// 读取JSON数据
|
||||
JSONArray dataList = readJsonData(path);
|
||||
if (dataList == null) {
|
||||
return Results.error("读取数据失败!");
|
||||
}
|
||||
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
|
||||
return Results.OK(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模拟“调度计划”页面的数据
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页大小
|
||||
* @param parentId 父ID,不传则查询顶级
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDdjhData")
|
||||
public Results<IPage<JSONObject>> 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();
|
||||
// 遍历输出到控制台
|
||||
log.info("\ngetDdjhData - 普通查询条件:");
|
||||
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
|
||||
log.info("-- " + entry.getKey() + ": " + JSON.toJSONString(entry.getValue()));
|
||||
}
|
||||
// 输出高级查询
|
||||
printExpertQuery(superQueryParams, superQueryMatchType);
|
||||
|
||||
/* 注:实际使用中不用写上面那种繁琐的代码,这里只是为了直观的输出到控制台里而写的示例,
|
||||
使用下面这种写法更简洁方便 */
|
||||
|
||||
// 封装成 MyBatisPlus 能识别的 QueryWrapper,可以直接使用这个对象进行SQL筛选条件拼接
|
||||
// 这个方法也会自动封装高级查询条件,但是高级查询参数名必须是superQueryParams和superQueryMatchType
|
||||
QueryWrapper<MockEntity> queryWrapper = QueryGenerator.initQueryWrapper(mockEntity, parameterMap);
|
||||
log.info("queryWrapper: " + queryWrapper.getCustomSqlSegment());
|
||||
|
||||
// 模拟JSON数据路径
|
||||
String path = "classpath:com/jero/modules/dlglong/json/ddjh.json";
|
||||
if ("8".equals(status)) {
|
||||
path = "classpath:com/jero/modules/dlglong/json/ddjh_s8.json";
|
||||
}
|
||||
// 读取JSON数据
|
||||
JSONArray dataList = readJsonData(path);
|
||||
if (dataList == null) {
|
||||
return Results.error("读取数据失败!");
|
||||
}
|
||||
|
||||
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
|
||||
// 逐行查询子表数据,用于计算拖轮状态
|
||||
List<JSONObject> records = getJsonObjects(dataList, page);
|
||||
page.setRecords(records);
|
||||
return Results.OK(page);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<JSONObject> getJsonObjects(JSONArray dataList, IPage<JSONObject> page) {
|
||||
List<JSONObject> records = page.getRecords();
|
||||
for (JSONObject obj : records) {
|
||||
Map<String, Integer> tugStatusMap = new HashMap<>();
|
||||
String id = obj.getString("id");
|
||||
// 查询出主表的拖轮
|
||||
String tugMain = obj.getString("tug");
|
||||
// 判断是否有值
|
||||
if (StringUtils.isNotBlank(tugMain)) {
|
||||
// 拖轮根据分号分割
|
||||
String[] tugs = tugMain.split(";");
|
||||
// 查询子表数据
|
||||
List<JSONObject> subRecords = this.queryDataPage(dataList, id, null, null).getRecords();
|
||||
// 遍历子表和拖轮数据,找出进行计算反推拖轮状态
|
||||
getRecords(tugStatusMap, tugs, subRecords);
|
||||
}
|
||||
// 新加一个字段用于保存拖轮状态,不要直接覆盖原来的,这个字段可以不保存到数据库里
|
||||
obj.put("tug_status", tugStatusMap);
|
||||
}
|
||||
return records;
|
||||
}
|
||||
|
||||
private void getRecords(Map<String, Integer> tugStatusMap, String[] tugs, List<JSONObject> subRecords) {
|
||||
for (JSONObject subData : subRecords) {
|
||||
String subTug = subData.getString("tug");
|
||||
if (StringUtils.isNotBlank(subTug)) {
|
||||
doForTugs(tugStatusMap, tugs, subData, subTug);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doForTugs(Map<String, Integer> tugStatusMap, String[] tugs, JSONObject subData, String 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void printExpertQuery(@RequestParam(name = "superQueryParams", required = false) String superQueryParams, @RequestParam(name = "superQueryMatchType", required = false) String superQueryMatchType) {
|
||||
try {
|
||||
log.info("\ngetDdjhData - 高级查询条件:");
|
||||
// 高级查询模式
|
||||
MatchTypeEnum matchType = MatchTypeEnum.getByValue(superQueryMatchType);
|
||||
if (matchType == null) {
|
||||
log.info("-- 高级查询模式:不识别(" + superQueryMatchType + ")");
|
||||
} else {
|
||||
log.info("-- 高级查询模式:" + matchType.getValue());
|
||||
}
|
||||
superQueryParams = URLDecoder.decode(superQueryParams, "UTF-8");
|
||||
List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class);
|
||||
if (conditions != null) {
|
||||
for (QueryCondition condition : conditions) {
|
||||
log.info("-- " + JSON.toJSONString(condition));
|
||||
}
|
||||
} else {
|
||||
log.info("-- 没有传递任何高级查询条件");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("-- 高级查询操作失败:" + superQueryParams, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟查询数据,可以根据父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, StandardCharsets.UTF_8);
|
||||
return JSON.parseArray(json);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return new JSONArray();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jero.modules.dlglong.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 模拟实体
|
||||
*/
|
||||
@Data
|
||||
public class MockEntity {
|
||||
|
||||
// id
|
||||
private String id;
|
||||
// 父级ID
|
||||
private String parentId;
|
||||
// 状态
|
||||
private String status;
|
||||
|
||||
/* -- 省略其他字段 -- */
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
server:
|
||||
port: 7002
|
||||
spring:
|
||||
application:
|
||||
name: jero-demo
|
||||
@@ -0,0 +1,66 @@
|
||||
body,html{width:100%;height:100%;margin:0px;padding:0px;font-size:12px;color:#555;background-color:#000;font-family:'微软雅黑'}
|
||||
#main{width:4352px;height:1536px;display:inline-block; background:url(../images/screenbg_design1.jpg) left top no-repeat}
|
||||
|
||||
/*年月日文字*/
|
||||
#currentYear{width:213px;height:107px;position:absolute;left:430px;top:100px;color:#FFF;font-size:36px; font-family:'微软雅黑';text-align:center}
|
||||
#currentMonth{width:213px;height:107px;position:absolute;left:1504px;top:75px;color:#FFF;font-size:36px; font-family:'微软雅黑';text-align:center}
|
||||
#currentDay{width:213px;height:107px;position:absolute;left:2574px;top:100px;color:#FFF;font-size:36px; font-family:'微软雅黑';text-align:center}
|
||||
|
||||
/*年的进度条*/
|
||||
#y_gauge1{width:250px;height:250px;position:absolute;left:60px;top:200px;}
|
||||
#y_gauge2{width:250px;height:250px;position:absolute;left:290px;top:200px;}
|
||||
#y_gauge3{width:250px;height:250px;position:absolute;left:530px;top:200px;}
|
||||
#y_gauge4{width:250px;height:250px;position:absolute;left:770px;top:200px;}
|
||||
|
||||
/*月的进度条*/
|
||||
#m_gauge1{width:250px;height:250px;position:absolute;left:1140px;top:130px;}
|
||||
#m_gauge2{width:250px;height:250px;position:absolute;left:1370px;top:130px;}
|
||||
#m_gauge3{width:250px;height:250px;position:absolute;left:1610px;top:130px;}
|
||||
#m_gauge4{width:250px;height:250px;position:absolute;left:1850px;top:130px;}
|
||||
|
||||
/*日的进度条*/
|
||||
#d_gauge1{width:250px;height:250px;position:absolute;left:2210px;top:200px;}
|
||||
#d_gauge2{width:250px;height:250px;position:absolute;left:2440px;top:200px;}
|
||||
#d_gauge3{width:250px;height:250px;position:absolute;left:2680px;top:200px;}
|
||||
#d_gauge4{width:250px;height:250px;position:absolute;left:2920px;top:200px;}
|
||||
|
||||
/*监控的仪表盘*/
|
||||
#gauge1{width:250px;height:250px;position:absolute;left:2200px;top:1050px;}
|
||||
#gauge2{width:250px;height:250px;position:absolute;left:2550px;top:1050px;}
|
||||
#gauge3{width:250px;height:250px;position:absolute;left:2910px;top:1050px;}
|
||||
#gauge4{width:250px;height:250px;position:absolute;left:2380px;top:1190px;}
|
||||
#gauge5{width:250px;height:250px;position:absolute;left:2730px;top:1190px;}
|
||||
|
||||
/*仪表盘文字*/
|
||||
.gaugeTitle{width:250px;height:40px;position:absolute;left:0px;top:200px;color:#B7E1FF;font-size:24px;display:inline-block;text-align:center;font-family:Arial;}
|
||||
|
||||
/*地图*/
|
||||
#map{width:1100px;height:800px;position:absolute;left:0px;top:620px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
|
||||
#plan{width:900px;height:420px;position:absolute;left:1170px;top:520px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
#quality{width:900px;height:420px;position:absolute;left:1170px;top:1030px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
|
||||
#orderTable{width:1000px;height:430px;position:absolute;left:2160px;top:930px;display:inline-block}
|
||||
#orderTable table{width:100%;color:#666;font-size:24px}
|
||||
#orderTable table td{text-align:center;}
|
||||
#orderTable table .head{height:80px;font-size:24px;color:#FFF}
|
||||
#orderTable table .row2{color:#000}
|
||||
#orderTable table .row1{background-color:#CCC}
|
||||
|
||||
#orderMessage{width:800px;position:absolute;left:33px;top:1420px;display:inline-block;color:#E1E1E1;font-size:24px}
|
||||
|
||||
/*生产情况展示表*/
|
||||
#produce{width:1000px;height:380px;position:absolute;left:2190px;top:600px;display:inline-block;color:#B7E2FF;font-size:24px;}
|
||||
#produce table{width:100%;font-size:24px;}
|
||||
#produce table td{text-align:center;border:1px solid #069}
|
||||
#produce table .row1{}
|
||||
#produce table .row2{}
|
||||
|
||||
/*视频*/
|
||||
#video{width:960px;height:540px;position:absolute;left:3280px;top:140px;display:inline-block;}
|
||||
|
||||
/*监控视频*/
|
||||
#Monitor{width:960px;height:540px;position:absolute;left:3280px;top:940px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
|
||||
/*刷新时间*/
|
||||
#refresh{width:800px;position:absolute;left:3350px;top:40px;display:inline-block;color:#FFF;font-size:24px;}
|
||||
@@ -0,0 +1,62 @@
|
||||
body,html{width:100%;height:100%;margin:0px;padding:0px;font-size:12px;color:#555;background-color:#000;font-family:'微软雅黑'}
|
||||
#main{width:4352px;height:1536px;display:inline-block; background:url(../images/war_room_main.jpg) left top no-repeat}
|
||||
|
||||
/*下钻按钮*/
|
||||
.contentButton{width:218px;height:100px;position:absolute;}
|
||||
.contentButton a{width:218px;height:100px;display:inline-block; background:url(../images/content_comm.png) no-repeat top left}
|
||||
.contentButton a:hover{width:218px;height:100px;display:inline-block; background:url(../images/content_down.png) no-repeat top left}
|
||||
.contentButton .a1{width:218px;height:100px;display:inline-block; background:url(../images/content_comm1.png) no-repeat top left}
|
||||
.contentButton .a1:hover{width:218px;height:100px;display:inline-block; background:url(../images/content_down1.png) no-repeat top left}
|
||||
|
||||
/*弹出窗口*/
|
||||
#popWindow{width:2200px;height:1000px;display:inline-block;position:absolute;top:240px;left:1070px;background-color:#06274A;border:1px solid #09f}
|
||||
|
||||
/*年的进度条*/
|
||||
#y_gauge1{width:250px;height:250px;position:absolute;left:60px;top:200px;}
|
||||
#y_gauge2{width:250px;height:250px;position:absolute;left:290px;top:200px;}
|
||||
#y_gauge3{width:250px;height:250px;position:absolute;left:530px;top:200px;}
|
||||
#y_gauge4{width:250px;height:250px;position:absolute;left:770px;top:200px;}
|
||||
|
||||
/*螺旋DNA*/
|
||||
#orderStatus{width:1000px;height:320px;position:absolute;left:80px;top:460px;}
|
||||
|
||||
/*监控的仪表盘*/
|
||||
#gauge1{width:250px;height:250px;position:absolute;left:2200px;top:280px;}
|
||||
#gauge2{width:250px;height:250px;position:absolute;left:2550px;top:280px;}
|
||||
#gauge3{width:250px;height:250px;position:absolute;left:2910px;top:280px;}
|
||||
#gauge4{width:250px;height:250px;position:absolute;left:2380px;top:550px;}
|
||||
#gauge5{width:250px;height:250px;position:absolute;left:2730px;top:550px;}
|
||||
|
||||
/*仪表盘文字*/
|
||||
.gaugeTitle{width:250px;height:40px;position:absolute;left:0px;top:200px;color:#B7E1FF;font-size:24px;display:inline-block;text-align:center;font-family:Arial;}
|
||||
|
||||
/*地图*/
|
||||
#map{width:1100px;height:800px;position:absolute;left:1080px;top:170px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
|
||||
#productPie{width:1000px;height:680px;position:absolute;left:2210px;top:260px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
|
||||
/*业务进展图*/
|
||||
#businessProgress{width:1000px;height:640px;position:absolute;left:3330px;top:180px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
|
||||
/*计划完成情况*/
|
||||
#plan{width:1000px;height:400px;position:absolute;left:80px;top:1020px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
/*质量指标分析*/
|
||||
#quality{width:1000px;height:400px;position:absolute;left:1170px;top:1020px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
/*舆情文字云*/
|
||||
#wordCloud{width:900px;height:420px;position:absolute;left:3330px;top:1000px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
|
||||
/*投诉情况展示表*/
|
||||
#produce{width:900px;height:380px;position:absolute;left:2250px;top:1050px;display:inline-block;color:#B7E2FF;font-size:24px;}
|
||||
#produce table{width:100%;font-size:24px;}
|
||||
#produce table td{text-align:center;border:1px solid #069}
|
||||
#produce table .row1{}
|
||||
#produce table .row2{}
|
||||
|
||||
/*视频*/
|
||||
#video{width:960px;height:540px;position:absolute;left:3280px;top:140px;display:inline-block;}
|
||||
|
||||
/*监控视频*/
|
||||
#Monitor{width:960px;height:540px;position:absolute;left:3280px;top:940px;display:inline-block;color:#E1E1E1;font-size:24px;}
|
||||
|
||||
/*刷新时间*/
|
||||
#refresh{width:800px;position:absolute;left:3350px;top:40px;display:inline-block;color:#FFF;font-size:24px;}
|
||||
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 622 KiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 244 KiB |
|
After Width: | Height: | Size: 247 KiB |
@@ -0,0 +1,836 @@
|
||||
//计划完成表的当前所选
|
||||
var indexnum = 0;
|
||||
var color=['#F35331','#2499F8','#3DF098','#33B734'];
|
||||
var fontColor='#FFF';
|
||||
|
||||
//定义进度条组件和属性
|
||||
var y_gauge1 =null;
|
||||
var y_gauge2 =null;
|
||||
var y_gauge3 =null;
|
||||
var y_gauge4 =null;
|
||||
var m_gauge1 =null;
|
||||
var m_gauge2 =null;
|
||||
var m_gauge3 =null;
|
||||
var m_gauge4 =null;
|
||||
var d_gauge1 =null;
|
||||
var d_gauge2 =null;
|
||||
var d_gauge3 =null;
|
||||
var d_gauge4 =null;
|
||||
var option_Progress =null;
|
||||
|
||||
//定义仪表盘组件和属性
|
||||
var gauge1 =null;
|
||||
var gauge2 =null;
|
||||
var gauge3 =null;
|
||||
var gauge4 =null;
|
||||
var gauge5 =null;
|
||||
var option_gauge =null;
|
||||
|
||||
//生产质量堆积图组件和属性
|
||||
var quality_chart = null;
|
||||
var quality_option=null;
|
||||
|
||||
//生产计划折线图组件和属性
|
||||
var plan_chart = null;
|
||||
var plan_option=null;
|
||||
|
||||
//环形图的风格定义
|
||||
var dataStyle = {
|
||||
normal: {
|
||||
label: {show:false},
|
||||
labelLine: {show:false}
|
||||
}
|
||||
};
|
||||
var placeHolderStyle = {
|
||||
normal : {
|
||||
color: 'rgba(0,0,0,0.1)',
|
||||
label: {show:false},
|
||||
labelLine: {show:false}
|
||||
},
|
||||
emphasis : {
|
||||
color: 'rgba(0,0,0,0)'
|
||||
}
|
||||
};
|
||||
|
||||
//最大订单号
|
||||
var lastOrderNumber=1;
|
||||
|
||||
$(document).ready(function ()
|
||||
{
|
||||
//环形进度条设置对象
|
||||
option_Progress={
|
||||
title : {
|
||||
text: '目前进度',
|
||||
subtext: '50%',
|
||||
x: 'center',
|
||||
y: 90,
|
||||
itemGap: 10,
|
||||
textStyle : {
|
||||
color : '#B7E1FF',
|
||||
fontWeight: 'normal',
|
||||
fontFamily : '微软雅黑',
|
||||
fontSize : 24
|
||||
},
|
||||
subtextStyle:{
|
||||
color: '#B7E1FF',
|
||||
fontWeight: 'bolder',
|
||||
fontSize:24,
|
||||
fontFamily : '微软雅黑'
|
||||
}
|
||||
},
|
||||
series : [{
|
||||
type : 'pie',
|
||||
center : ['50%', '50%'],
|
||||
radius : [75,90],
|
||||
x: '0%',
|
||||
tooltip:{show:false},
|
||||
data : [{
|
||||
name:'达成率',
|
||||
value:79,
|
||||
itemStyle:{color :'rgba(0,153,255,0.8)'},
|
||||
hoverAnimation: false,
|
||||
label : {
|
||||
show : false,
|
||||
position : 'center',
|
||||
textStyle: {
|
||||
fontFamily:'微软雅黑',
|
||||
fontWeight: 'bolder',
|
||||
color:'#B7E1FF',
|
||||
fontSize:24
|
||||
}
|
||||
},
|
||||
labelLine : {
|
||||
show : false
|
||||
}
|
||||
},
|
||||
{
|
||||
name:'79%',
|
||||
value:21,
|
||||
itemStyle:{color: 'rgba(0,153,255,0.1)'},
|
||||
hoverAnimation: false,
|
||||
label : {
|
||||
show : false,
|
||||
position : 'center',
|
||||
padding:20,
|
||||
textStyle: {
|
||||
fontFamily:'微软雅黑',
|
||||
fontSize: 24,
|
||||
color:'#B7E1FF'
|
||||
}
|
||||
},
|
||||
labelLine : {
|
||||
show : false
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
type : 'pie',
|
||||
center : ['50%', '50%'],
|
||||
radius : [95,100],
|
||||
x: '0%',
|
||||
hoverAnimation: false,
|
||||
data : [{
|
||||
value:100,
|
||||
itemStyle:{color :'rgba(0,153,255,0.3)'},
|
||||
label : {show : false},
|
||||
labelLine : {show : false}
|
||||
}]
|
||||
},
|
||||
{
|
||||
type : 'pie',
|
||||
center : ['50%', '50%'],
|
||||
radius : [69,70],
|
||||
x: '0%',
|
||||
hoverAnimation: false,
|
||||
data : [{
|
||||
value:100,
|
||||
itemStyle:{color :'rgba(0,153,255,0.3)'},
|
||||
label : {show : false},
|
||||
labelLine : {show : false}
|
||||
}]
|
||||
}]
|
||||
};
|
||||
|
||||
//年仪表盘
|
||||
y_gauge1 = echarts.init(document.getElementById('y_gauge1'));
|
||||
y_gauge2 = echarts.init(document.getElementById('y_gauge2'));
|
||||
y_gauge3 = echarts.init(document.getElementById('y_gauge3'));
|
||||
y_gauge4 = echarts.init(document.getElementById('y_gauge4'));
|
||||
|
||||
//月仪表盘
|
||||
m_gauge1 = echarts.init(document.getElementById('m_gauge1'));
|
||||
m_gauge2 = echarts.init(document.getElementById('m_gauge2'));
|
||||
m_gauge3 = echarts.init(document.getElementById('m_gauge3'));
|
||||
m_gauge4 = echarts.init(document.getElementById('m_gauge4'));
|
||||
|
||||
//日仪表盘
|
||||
d_gauge1 = echarts.init(document.getElementById('d_gauge1'));
|
||||
d_gauge2 = echarts.init(document.getElementById('d_gauge2'));
|
||||
d_gauge3 = echarts.init(document.getElementById('d_gauge3'));
|
||||
d_gauge4 = echarts.init(document.getElementById('d_gauge4'));
|
||||
|
||||
//监控仪表盘
|
||||
option_gauge = {
|
||||
title: {
|
||||
text: '', //标题文本内容
|
||||
},
|
||||
toolbox: { //可视化的工具箱
|
||||
show: false,
|
||||
},
|
||||
tooltip: { //弹窗组件
|
||||
formatter: "{a} <br/>{b} : {c}%"
|
||||
},
|
||||
series: [{
|
||||
type: 'gauge',
|
||||
axisLine: {// 坐标轴线
|
||||
lineStyle: { // 属性lineStyle控制线条样式
|
||||
color: [
|
||||
[0.2, color[0]],
|
||||
[0.8, color[1]],
|
||||
[1, color[2]]
|
||||
],
|
||||
width: 18
|
||||
}
|
||||
},
|
||||
splitLine: { // 分隔线
|
||||
show:true,
|
||||
length: 18,
|
||||
lineStyle: {
|
||||
color: '#28292D',
|
||||
width: 1
|
||||
}
|
||||
},
|
||||
axisTick : { //刻度线样式(及短线样式)
|
||||
show:false,
|
||||
lineStyle: {
|
||||
color: 'auto',
|
||||
width: 1
|
||||
},
|
||||
length : 20
|
||||
},
|
||||
axisLabel : {
|
||||
color:'#FFF',
|
||||
fontSize:14,
|
||||
fontFamily:'Verdana, Geneva, sans-serif'
|
||||
},
|
||||
title: {
|
||||
textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
|
||||
fontWeight: 'bolder',
|
||||
fontSize: 20,
|
||||
color: '#FFF'
|
||||
},
|
||||
offsetCenter: [0, '30%']
|
||||
},
|
||||
pointer: {
|
||||
width: 5,
|
||||
color: '#F00',
|
||||
shadowColor: '#FF0',
|
||||
shadowBlur: 10
|
||||
},
|
||||
detail: {
|
||||
show:false,
|
||||
formatter:'{value}%',
|
||||
textStyle:
|
||||
{
|
||||
fontFamily:'Arial',
|
||||
color: '#000',
|
||||
fontSize:'32px'
|
||||
},
|
||||
offsetCenter: [0, '90%']
|
||||
},
|
||||
data: [{value: 45, name: '水'}]
|
||||
}]
|
||||
};
|
||||
|
||||
gauge1 = echarts.init(document.getElementById('gauge1'));
|
||||
gauge2 = echarts.init(document.getElementById('gauge2'));
|
||||
gauge3 = echarts.init(document.getElementById('gauge3'));
|
||||
gauge4 = echarts.init(document.getElementById('gauge4'));
|
||||
gauge5 = echarts.init(document.getElementById('gauge5'));
|
||||
option_gauge.series[0].axisLine.lineStyle.color=[[0.2, color[0]],[0.8, color[1]],[1, color[2]]];
|
||||
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
|
||||
option_gauge.series[0].data[0].name ="水";
|
||||
$('#vg1').html(option_gauge.series[0].data[0].value);
|
||||
gauge1.setOption(option_gauge);
|
||||
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
|
||||
option_gauge.series[0].data[0].name ="电";
|
||||
$('#vg2').html(option_gauge.series[0].data[0].value);
|
||||
gauge2.setOption(option_gauge);
|
||||
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
|
||||
option_gauge.series[0].data[0].name ="天然气";
|
||||
$('#vg3').html(option_gauge.series[0].data[0].value);
|
||||
gauge3.setOption(option_gauge);
|
||||
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
|
||||
option_gauge.series[0].data[0].name ="压缩空气";
|
||||
$('#vg4').html(option_gauge.series[0].data[0].value);
|
||||
gauge4.setOption(option_gauge);
|
||||
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
|
||||
option_gauge.series[0].data[0].name ="蒸汽";
|
||||
$('#vg5').html(option_gauge.series[0].data[0].value);
|
||||
gauge5.setOption(option_gauge);
|
||||
|
||||
//生产质量堆积图
|
||||
quality_chart = echarts.init(document.getElementById('quality'));
|
||||
quality_option={
|
||||
title: {
|
||||
show:false,
|
||||
text: 'AUDIT',
|
||||
left: 'center',
|
||||
textStyle: {
|
||||
color: '#F00',
|
||||
fontSize:32
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
data: ['1月10日','2月10日','3月10日','4月10日','5月10日','6月10日'],
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#B7E1FF',
|
||||
fontSize:24
|
||||
}
|
||||
},
|
||||
axisLine:{
|
||||
lineStyle:{
|
||||
color:'#09F'
|
||||
}
|
||||
},
|
||||
axisTick:{
|
||||
lineStyle:{
|
||||
color:'#09F'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
inverse: false,
|
||||
splitArea: {show: false},
|
||||
axisLine: {show: false},
|
||||
axisTick: {show: false},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#B7E1FF',
|
||||
fontSize:24,
|
||||
fontFamily:'Arial',
|
||||
}
|
||||
},
|
||||
splitLine :{
|
||||
lineStyle:{
|
||||
color:'#09F'
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: 100
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
textStyle: {
|
||||
color: '#B7E1FF',
|
||||
fontSize:24
|
||||
}
|
||||
},
|
||||
legend:{
|
||||
show:false,
|
||||
top: 'bottom',
|
||||
textStyle: {
|
||||
color: '#F00',
|
||||
fontSize:24,
|
||||
fontFamily:'微软雅黑'
|
||||
},
|
||||
data:['AUDIT分数1','AUDIT分数']
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'AUDIT分数1',
|
||||
type: 'bar',
|
||||
stack: 'one',
|
||||
itemStyle:
|
||||
{
|
||||
normal: {color: color[1]}
|
||||
},
|
||||
barWidth : 60,
|
||||
data:[2200,2900,3680,2200,2900,3680]
|
||||
},
|
||||
{
|
||||
name: 'AUDIT分数',
|
||||
type: 'bar',
|
||||
stack: 'one',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#F90',
|
||||
label: {
|
||||
show: true,
|
||||
position: 'insideTop',
|
||||
textStyle: {
|
||||
color: '#000',
|
||||
fontSize:24
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
barWidth : 50,
|
||||
data: [1800,1100,320,1800,1100,320]
|
||||
}
|
||||
]
|
||||
};
|
||||
quality_chart.setOption(quality_option);
|
||||
|
||||
//生产计划折线图
|
||||
var plan_data1=[];
|
||||
var plan_data2=[];
|
||||
var plan_xAxis=[];
|
||||
for (var i = 1; i <= 7; i++) {
|
||||
plan_xAxis.push("3月"+i+"日");
|
||||
plan_data1.push(Math.round(Math.random() * 100));
|
||||
plan_data2.push(Math.round(Math.random() * 100));
|
||||
}
|
||||
plan_chart = echarts.init(document.getElementById('plan'));
|
||||
plan_option={
|
||||
xAxis: {
|
||||
data:plan_xAxis,
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#B7E1FF',
|
||||
fontSize:24
|
||||
}
|
||||
},
|
||||
axisLine:{
|
||||
lineStyle:{
|
||||
color:'#09F'
|
||||
}
|
||||
},
|
||||
axisTick:{
|
||||
lineStyle:{
|
||||
color:'#09F'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
inverse: false,
|
||||
splitArea: {show: false},
|
||||
axisLine: {show: false},
|
||||
axisTick: {show: false},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#B7E1FF',
|
||||
fontSize:24,
|
||||
fontFamily:'Arial',
|
||||
}
|
||||
},
|
||||
splitLine :{
|
||||
lineStyle:{
|
||||
color:'#09F'
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
textStyle: {
|
||||
color: '#FFF',
|
||||
fontSize:24
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: 100
|
||||
},
|
||||
legend:{
|
||||
show:false,
|
||||
top: 'bottom',
|
||||
textStyle: {
|
||||
color: '#F00',
|
||||
fontSize:24
|
||||
},
|
||||
data:['计划完成数','实际完成数']
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '计划完成数',
|
||||
type: 'bar',
|
||||
itemStyle:
|
||||
{
|
||||
normal: {color: color[1]},
|
||||
emphasis: {color: color[2]}
|
||||
},
|
||||
barWidth : 40,
|
||||
data:plan_data1
|
||||
},
|
||||
{
|
||||
name: '实际完成数',
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#F90',
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
textStyle: {
|
||||
color: '#CCC',
|
||||
fontSize:24
|
||||
}
|
||||
},
|
||||
lineStyle:{
|
||||
color:'#F90',
|
||||
width:4
|
||||
}
|
||||
},
|
||||
emphasis: {
|
||||
color: '#FF0'
|
||||
}
|
||||
},
|
||||
symbolSize: 24,
|
||||
data: plan_data2
|
||||
}
|
||||
]
|
||||
};
|
||||
plan_chart.setOption(plan_option);
|
||||
|
||||
//轮番显示tips
|
||||
function clock(){
|
||||
showToolTip_highlight(plan_chart);
|
||||
}
|
||||
setInterval(clock, 5000);
|
||||
|
||||
//地图开始
|
||||
var map_chart = echarts.init(document.getElementById('map'));
|
||||
|
||||
var CCData = [
|
||||
[{name:'长春'}, {name:'上海',value:95}],
|
||||
[{name:'长春'}, {name:'广州',value:90}],
|
||||
[{name:'长春'}, {name:'大连',value:80}],
|
||||
[{name:'长春'}, {name:'南宁',value:70}],
|
||||
[{name:'长春'}, {name:'南昌',value:60}],
|
||||
[{name:'长春'}, {name:'拉萨',value:50}],
|
||||
[{name:'长春'}, {name:'长春',value:40}],
|
||||
[{name:'长春'}, {name:'包头',value:30}],
|
||||
[{name:'长春'}, {name:'重庆',value:20}],
|
||||
[{name:'长春'}, {name:'北京',value:10}]
|
||||
];
|
||||
|
||||
var series = [];
|
||||
[['长春', CCData]].forEach(function (item, i) {
|
||||
series.push({
|
||||
name: '一汽汽车销售',
|
||||
type: 'lines',
|
||||
zlevel: 1,
|
||||
effect: {
|
||||
show: true,
|
||||
period: 6,
|
||||
trailLength: 0.7,
|
||||
color: '#FF0',
|
||||
symbolSize: 3
|
||||
},
|
||||
lineStyle: {
|
||||
normal: {
|
||||
color: '#000',
|
||||
width: 0,
|
||||
curveness: 0.2
|
||||
}
|
||||
},
|
||||
data: convertData(item[1])
|
||||
},
|
||||
{
|
||||
name: '一汽汽车销售',
|
||||
type: 'lines',
|
||||
zlevel: 2,
|
||||
symbol: ['none', 'arrow'],
|
||||
symbolSize: 10,
|
||||
lineStyle: {
|
||||
normal: {
|
||||
color: '#FF0',
|
||||
width: 1,
|
||||
opacity: 0.6,
|
||||
curveness: 0.2
|
||||
}
|
||||
},
|
||||
data: convertData(item[1])
|
||||
},
|
||||
{
|
||||
name: '一汽汽车销售',
|
||||
type: 'effectScatter',
|
||||
coordinateSystem: 'geo',
|
||||
zlevel: 2,
|
||||
rippleEffect: {
|
||||
brushType: 'stroke'
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: 'right',
|
||||
formatter: '{b}'
|
||||
}
|
||||
},
|
||||
symbolSize: function (val) {
|
||||
return 15;
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#FFF',
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
textStyle: {
|
||||
color: '#FFF',
|
||||
fontSize:24
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data: item[1].map(function (dataItem) {
|
||||
return {
|
||||
name: dataItem[1].name,
|
||||
value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
|
||||
};
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
map_option = {
|
||||
backgroundColor: '',
|
||||
title : {
|
||||
show:false,
|
||||
text: '一汽汽车销售地域分布示意图',
|
||||
subtext: '截至2018年05月04日',
|
||||
left: 'center',
|
||||
top:10,
|
||||
textStyle : {
|
||||
color: '#09F',
|
||||
fontSize:32
|
||||
},
|
||||
subtextStyle:{
|
||||
color: '#09F',
|
||||
fontSize:24
|
||||
}
|
||||
},
|
||||
tooltip : {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
show:false,
|
||||
orient: 'vertical',
|
||||
top: 'bottom',
|
||||
left: 'right',
|
||||
data:['一汽汽车销售'],
|
||||
textStyle: {
|
||||
color: '#000'
|
||||
},
|
||||
selectedMode: 'single'
|
||||
},
|
||||
geo: {
|
||||
map: 'china',
|
||||
label: {
|
||||
emphasis: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
roam: true,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
areaColor: '#09F',
|
||||
borderColor: '#09F',
|
||||
opacity:0.5
|
||||
},
|
||||
emphasis: {
|
||||
areaColor: '#09F',
|
||||
borderColor: '#09F',
|
||||
opacity:0.8
|
||||
}
|
||||
}
|
||||
},
|
||||
series: series
|
||||
};
|
||||
|
||||
map_chart.setOption(map_option, true);
|
||||
|
||||
resresh();
|
||||
|
||||
//开始定时刷新
|
||||
setInterval(resresh, 5*1000);
|
||||
});
|
||||
|
||||
var convertData = function (data) {
|
||||
var res = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var dataItem = data[i];
|
||||
var fromCoord = geoCoordMap[dataItem[0].name];
|
||||
var toCoord = geoCoordMap[dataItem[1].name];
|
||||
if (fromCoord && toCoord) {
|
||||
res.push({
|
||||
fromName: dataItem[0].name,
|
||||
toName: dataItem[1].name,
|
||||
coords: [fromCoord, toCoord]
|
||||
});
|
||||
}
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
function showToolTip_highlight(mychart)
|
||||
{
|
||||
var echartObj = mychart;
|
||||
|
||||
// 高亮当前图形
|
||||
var highlight =setInterval(function()
|
||||
{
|
||||
echartObj.dispatchAction({
|
||||
type: 'highlight',
|
||||
seriesIndex: 0,
|
||||
dataIndex: indexnum
|
||||
});
|
||||
|
||||
echartObj.dispatchAction({
|
||||
type: 'showTip',
|
||||
seriesIndex: 0,
|
||||
dataIndex: indexnum
|
||||
});
|
||||
clearInterval(highlight);
|
||||
indexnum = indexnum + 1;
|
||||
if(indexnum>=7) indexnum=0;
|
||||
},1000);
|
||||
}
|
||||
|
||||
//定时刷新数据
|
||||
function resresh()
|
||||
{
|
||||
var myDate = new Date();
|
||||
|
||||
// $('#refresh').html("<img src=\"images/wait.gif\" align=\"absmiddle\"><span>数据刷新中...</span>");
|
||||
|
||||
//年月日刷新
|
||||
$('#currentYear').html(myDate.getFullYear()+"年");
|
||||
$('#currentMonth').html(insertZero(myDate.getMonth()+1)+"月");
|
||||
$('#currentDay').html(insertZero(myDate.getDate())+"日");
|
||||
$('#currentDate').html(myDate.getFullYear()+"/"+insertZero(myDate.getMonth()+1)+"/"+insertZero(myDate.getDate()));
|
||||
|
||||
option_gauge.series[0].axisLabel.show=true;
|
||||
option_gauge.series[0].axisLine.lineStyle.color=[[0.2, color[0]],[0.8, color[1]],[1, color[2]]]
|
||||
|
||||
var maxg=Math.round(Math.random()*500)+400;
|
||||
var n1=Math.round(Math.random()*(maxg-100))+100;
|
||||
var n2=Math.round(Math.random()*(n1-50))+50;
|
||||
var n3=(n2/maxg*100).toFixed(2);
|
||||
|
||||
//年进度条
|
||||
option_Progress.title.text ="计划生产";
|
||||
option_Progress.series[0].data[0].value = maxg;
|
||||
option_Progress.title.subtext =maxg+"台";
|
||||
option_Progress.series[0].data[1].value =0;
|
||||
y_gauge1.setOption(option_Progress);
|
||||
|
||||
option_Progress.title.text ="已接订单";
|
||||
option_Progress.series[0].data[0].value = n1;
|
||||
option_Progress.title.subtext =n1+"台";
|
||||
option_Progress.series[0].data[1].value =(maxg-n1);
|
||||
y_gauge2.setOption(option_Progress);
|
||||
|
||||
option_Progress.title.text ="已经完成";
|
||||
option_Progress.series[0].data[0].value = n2;
|
||||
option_Progress.title.subtext =n2+"台";
|
||||
option_Progress.series[0].data[1].value =(maxg-n2);
|
||||
y_gauge3.setOption(option_Progress);
|
||||
|
||||
option_Progress.title.text ="计划完成率";
|
||||
option_Progress.series[0].data[0].value = n3;
|
||||
option_Progress.title.subtext =n3+"%";
|
||||
option_Progress.series[0].data[1].value =(100-n3);
|
||||
y_gauge4.setOption(option_Progress);
|
||||
|
||||
//月进度条
|
||||
maxg=Math.round(Math.random()*maxg)+1;
|
||||
n1=Math.round(Math.random()*maxg)+1;
|
||||
n2=Math.round(Math.random()*n1);
|
||||
n3=(n2/maxg*100).toFixed(2);
|
||||
|
||||
option_Progress.title.text ="计划生产";
|
||||
option_Progress.series[0].data[0].value = maxg;
|
||||
option_Progress.title.subtext =maxg+"台";
|
||||
option_Progress.series[0].data[1].value =0;
|
||||
m_gauge1.setOption(option_Progress);
|
||||
|
||||
option_Progress.title.text ="已接订单";
|
||||
option_Progress.series[0].data[0].value = n1;
|
||||
option_Progress.title.subtext =n1+"台";
|
||||
option_Progress.series[0].data[1].value =(maxg-n1);
|
||||
m_gauge2.setOption(option_Progress);
|
||||
|
||||
option_Progress.title.text ="已经完成";
|
||||
option_Progress.series[0].data[0].value = n2;
|
||||
option_Progress.title.subtext =n2+"台";
|
||||
option_Progress.series[0].data[1].value =(maxg-n2);
|
||||
m_gauge3.setOption(option_Progress);
|
||||
|
||||
option_Progress.title.text ="计划完成率";
|
||||
option_Progress.series[0].data[0].value = n3;
|
||||
option_Progress.title.subtext =n3+"%";
|
||||
option_Progress.series[0].data[1].value =(100-n3);
|
||||
m_gauge4.setOption(option_Progress);
|
||||
|
||||
//日进度条
|
||||
maxg=Math.round(Math.random()*maxg)+1;
|
||||
n1=Math.round(Math.random()*maxg)+1;
|
||||
n2=Math.round(Math.random()*n1);
|
||||
n3=(n2/maxg*100).toFixed(2);
|
||||
|
||||
option_Progress.title.text ="计划生产";
|
||||
option_Progress.series[0].data[0].value = maxg;
|
||||
option_Progress.title.subtext =maxg+"台";
|
||||
option_Progress.series[0].data[1].value =0;
|
||||
d_gauge1.setOption(option_Progress);
|
||||
|
||||
option_Progress.title.text ="已接订单";
|
||||
option_Progress.series[0].data[0].value = n1;
|
||||
option_Progress.title.subtext =n1+"台";
|
||||
option_Progress.series[0].data[1].value =(maxg-n1);
|
||||
d_gauge2.setOption(option_Progress);
|
||||
|
||||
option_Progress.title.text ="已经完成";
|
||||
option_Progress.series[0].data[0].value = n2;
|
||||
option_Progress.title.subtext =n2+"台";
|
||||
option_Progress.series[0].data[1].value =(maxg-n2);
|
||||
d_gauge3.setOption(option_Progress);
|
||||
|
||||
option_Progress.title.text ="计划完成率";
|
||||
option_Progress.series[0].data[0].value = n3;
|
||||
option_Progress.title.subtext =n3+"%";
|
||||
option_Progress.series[0].data[1].value =(100-n3);
|
||||
d_gauge4.setOption(option_Progress);
|
||||
|
||||
//仪表盘刷新
|
||||
option_gauge.series[0].axisLine.lineStyle.color=[[0.2, color[0]],[0.8, color[1]],[1, color[0]]];
|
||||
|
||||
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
|
||||
option_gauge.series[0].data[0].name ="水";
|
||||
$('#vg1').html(option_gauge.series[0].data[0].value);
|
||||
gauge1.setOption(option_gauge);
|
||||
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
|
||||
option_gauge.series[0].data[0].name ="电";
|
||||
$('#vg2').html(option_gauge.series[0].data[0].value);
|
||||
gauge2.setOption(option_gauge);
|
||||
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
|
||||
option_gauge.series[0].data[0].name ="天然气";
|
||||
$('#vg3').html(option_gauge.series[0].data[0].value);
|
||||
gauge3.setOption(option_gauge);
|
||||
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
|
||||
option_gauge.series[0].data[0].name ="压缩空气";
|
||||
$('#vg4').html(option_gauge.series[0].data[0].value);
|
||||
gauge4.setOption(option_gauge);
|
||||
option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
|
||||
option_gauge.series[0].data[0].name ="蒸汽";
|
||||
$('#vg5').html(option_gauge.series[0].data[0].value);
|
||||
gauge5.setOption(option_gauge);
|
||||
|
||||
//显示最后更新时间
|
||||
$('#refresh').html("<span id=\"refreshTime\">最后刷新时间:"+myDate.toLocaleDateString()+" "+myDate.toLocaleTimeString()+"</span>");
|
||||
}
|
||||
|
||||
//生成订单号
|
||||
function getOrderNumber(n)
|
||||
{
|
||||
var no="000000"+n.toString();
|
||||
return no.substring(no.length-6);
|
||||
}
|
||||
|
||||
//前面补0
|
||||
function insertZero(n)
|
||||
{
|
||||
var no="000000"+n.toString();
|
||||
return no.substring(no.length-2);
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
var geoCoordMap = {
|
||||
'上海': [121.4648,31.2891],
|
||||
'东莞': [113.8953,22.901],
|
||||
'东营': [118.7073,37.5513],
|
||||
'中山': [113.4229,22.478],
|
||||
'临汾': [111.4783,36.1615],
|
||||
'临沂': [118.3118,35.2936],
|
||||
'丹东': [124.541,40.4242],
|
||||
'丽水': [119.5642,28.1854],
|
||||
'乌鲁木齐': [87.9236,43.5883],
|
||||
'佛山': [112.8955,23.1097],
|
||||
'保定': [115.0488,39.0948],
|
||||
'兰州': [103.5901,36.3043],
|
||||
'包头': [110.3467,41.4899],
|
||||
'北京': [116.4551,40.2539],
|
||||
'北海': [109.314,21.6211],
|
||||
'南京': [118.8062,31.9208],
|
||||
'南宁': [108.479,23.1152],
|
||||
'南昌': [116.0046,28.6633],
|
||||
'南通': [121.1023,32.1625],
|
||||
'厦门': [118.1689,24.6478],
|
||||
'台州': [121.1353,28.6688],
|
||||
'合肥': [117.29,32.0581],
|
||||
'呼和浩特': [111.4124,40.4901],
|
||||
'咸阳': [108.4131,34.8706],
|
||||
'哈尔滨': [127.9688,45.368],
|
||||
'唐山': [118.4766,39.6826],
|
||||
'嘉兴': [120.9155,30.6354],
|
||||
'大同': [113.7854,39.8035],
|
||||
'大连': [122.2229,39.4409],
|
||||
'天津': [117.4219,39.4189],
|
||||
'太原': [112.3352,37.9413],
|
||||
'威海': [121.9482,37.1393],
|
||||
'宁波': [121.5967,29.6466],
|
||||
'宝鸡': [107.1826,34.3433],
|
||||
'宿迁': [118.5535,33.7775],
|
||||
'常州': [119.4543,31.5582],
|
||||
'广州': [113.5107,23.2196],
|
||||
'廊坊': [116.521,39.0509],
|
||||
'延安': [109.1052,36.4252],
|
||||
'张家口': [115.1477,40.8527],
|
||||
'徐州': [117.5208,34.3268],
|
||||
'德州': [116.6858,37.2107],
|
||||
'惠州': [114.6204,23.1647],
|
||||
'成都': [103.9526,30.7617],
|
||||
'扬州': [119.4653,32.8162],
|
||||
'承德': [117.5757,41.4075],
|
||||
'拉萨': [91.1865,30.1465],
|
||||
'无锡': [120.3442,31.5527],
|
||||
'日照': [119.2786,35.5023],
|
||||
'昆明': [102.9199,25.4663],
|
||||
'杭州': [119.5313,29.8773],
|
||||
'枣庄': [117.323,34.8926],
|
||||
'柳州': [109.3799,24.9774],
|
||||
'株洲': [113.5327,27.0319],
|
||||
'武汉': [114.3896,30.6628],
|
||||
'汕头': [117.1692,23.3405],
|
||||
'江门': [112.6318,22.1484],
|
||||
'沈阳': [123.1238,42.1216],
|
||||
'沧州': [116.8286,38.2104],
|
||||
'河源': [114.917,23.9722],
|
||||
'泉州': [118.3228,25.1147],
|
||||
'泰安': [117.0264,36.0516],
|
||||
'泰州': [120.0586,32.5525],
|
||||
'济南': [117.1582,36.8701],
|
||||
'济宁': [116.8286,35.3375],
|
||||
'海口': [110.3893,19.8516],
|
||||
'淄博': [118.0371,36.6064],
|
||||
'淮安': [118.927,33.4039],
|
||||
'深圳': [114.5435,22.5439],
|
||||
'清远': [112.9175,24.3292],
|
||||
'温州': [120.498,27.8119],
|
||||
'渭南': [109.7864,35.0299],
|
||||
'湖州': [119.8608,30.7782],
|
||||
'湘潭': [112.5439,27.7075],
|
||||
'滨州': [117.8174,37.4963],
|
||||
'潍坊': [119.0918,36.524],
|
||||
'烟台': [120.7397,37.5128],
|
||||
'玉溪': [101.9312,23.8898],
|
||||
'珠海': [113.7305,22.1155],
|
||||
'盐城': [120.2234,33.5577],
|
||||
'盘锦': [121.9482,41.0449],
|
||||
'石家庄': [114.4995,38.1006],
|
||||
'福州': [119.4543,25.9222],
|
||||
'秦皇岛': [119.2126,40.0232],
|
||||
'绍兴': [120.564,29.7565],
|
||||
'聊城': [115.9167,36.4032],
|
||||
'肇庆': [112.1265,23.5822],
|
||||
'舟山': [122.2559,30.2234],
|
||||
'苏州': [120.6519,31.3989],
|
||||
'莱芜': [117.6526,36.2714],
|
||||
'菏泽': [115.6201,35.2057],
|
||||
'营口': [122.4316,40.4297],
|
||||
'葫芦岛': [120.1575,40.578],
|
||||
'衡水': [115.8838,37.7161],
|
||||
'衢州': [118.6853,28.8666],
|
||||
'西宁': [101.4038,36.8207],
|
||||
'西安': [109.1162,34.2004],
|
||||
'贵阳': [106.6992,26.7682],
|
||||
'连云港': [119.1248,34.552],
|
||||
'邢台': [114.8071,37.2821],
|
||||
'邯郸': [114.4775,36.535],
|
||||
'郑州': [113.4668,34.6234],
|
||||
'鄂尔多斯': [108.9734,39.2487],
|
||||
'重庆': [107.7539,30.1904],
|
||||
'金华': [120.0037,29.1028],
|
||||
'铜川': [109.0393,35.1947],
|
||||
'银川': [106.3586,38.1775],
|
||||
'镇江': [119.4763,31.9702],
|
||||
'长春': [125.8154,44.2584],
|
||||
'长沙': [113.0823,28.2568],
|
||||
'长治': [112.8625,36.4746],
|
||||
'阳泉': [113.4778,38.0951],
|
||||
'青岛': [120.4651,36.3373],
|
||||
'韶关': [113.7964,24.7028]
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
window.onresize = function() {
|
||||
setAppScale();
|
||||
};
|
||||
|
||||
function setAppScale() {
|
||||
var ratioY = $(window).height()/1536;
|
||||
var ratioX = $(window).width()/4352;
|
||||
var screenWidth = window.screen.width;
|
||||
var screenHeigth = window.screen.height;
|
||||
if (screenWidth >= 960) {
|
||||
ratioX = 0.62
|
||||
}
|
||||
if(screenHeigth <= 1080){
|
||||
ratioY = 0.62
|
||||
}
|
||||
$("body").css({
|
||||
transform: "scale("+ ratioX+","+ ratioY+")",
|
||||
transformOrigin: "left top",
|
||||
overflow:"visible"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$().ready(function(){
|
||||
//初始化时调整大小
|
||||
setAppScale();
|
||||
});
|
||||
|
After Width: | Height: | Size: 375 B |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 1.8 KiB |