后台目录结构大调整,让结构更清晰

This commit is contained in:
zhangdaiscott
2022-08-12 14:14:11 +08:00
parent d135f32b7b
commit ea0f9ed10d
1486 changed files with 94 additions and 213 deletions

View File

@ -0,0 +1,68 @@
//package org.jeecg.modules.demo.cloud.controller;
//
//import com.alibaba.csp.sentinel.annotation.SentinelResource;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.jeecg.common.api.vo.Result;
//import org.jeecg.common.system.api.ISysBaseAPI;
//import org.jeecg.common.system.vo.DictModel;
//import org.springframework.beans.factory.annotation.Autowired;
//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 = "【微服务】单元测试")
//@RestController
//@RequestMapping("/test")
//public class JcloudDemoFeignController {
// @Resource
// private ISysBaseAPI sysBaseApi;
//// @Autowired
//// private ErpHelloApi erpHelloApi;
//
// /**
// * 测试
// *
// * @return
// */
// @GetMapping("/callSystem")
// //@SentinelResource(value = "remoteDict",fallback = "getDefaultHandler")
// @ApiOperation(value = "通过feign调用system服务", notes = "测试jeecg-demo服务是否通过fegin调用system服务接口")
// public Result getRemoteDict() {
// List<DictModel> list = sysBaseApi.queryAllDict();
// return Result.OK(list);
// }
//
//
//// /**
//// * 测试调用 erp 微服务接口
//// * 【如何测试通过archetype生成微服务模块快速集成测试】
//// * http://doc.jeecg.com/2194069
//// * @return
//// */
//// @GetMapping("/callErp")
//// @ApiOperation(value = "测试feign erp", notes = "测试feign erp")
//// public Result callErp() {
//// log.info("call erp 服务");
//// String res = erpHelloApi.callHello();
//// return Result.OK(res);
//// }
//
// /**
// * 熔断,默认回调函数
// *
// * @return
// */
// public Result<Object> getDefaultHandler() {
// log.info("测试JcloudDemoController-remoteDict 熔断降级");
// return Result.error("测试JcloudDemoController-remoteDict 熔断降级");
// }
//
//}

View File

@ -0,0 +1,33 @@
package org.jeecg.modules.demo.cloud.controller;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.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接口
* 【提供给system-start调用测试看feign是否畅通】
* @author: jeecg-boot
*/
@Slf4j
@RestController
@RequestMapping("/test")
public class JcloudDemoProviderController {
@Resource
private JcloudDemoService jcloudDemoService;
@GetMapping("/getMessage")
public String getMessage(@RequestParam String name) {
String msg = jcloudDemoService.getMessage(name);
log.info(" 微服务被调用:{} ",msg);
return msg;
}
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.cloud.service;
import org.jeecg.common.api.vo.Result;
/**
* @Description: JcloudDemoService接口
* @author: jeecg-boot
*/
public interface JcloudDemoService {
/**
* 获取信息(测试)
* @param name 姓名
* @return "Hello" + name
*/
String getMessage(String name);
}

View File

@ -0,0 +1,18 @@
package org.jeecg.modules.demo.cloud.service.impl;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.cloud.service.JcloudDemoService;
import org.springframework.stereotype.Service;
/**
* @Description: JcloudDemoServiceImpl实现类
* @author: jeecg-boot
*/
@Service
public class JcloudDemoServiceImpl implements JcloudDemoService {
@Override
public String getMessage(String name) {
String resMsg = "Hello我是jeecg-demo服务节点收到你的消息"+ name +"";
return resMsg;
}
}

View File

@ -0,0 +1,74 @@
//
//package org.jeecg.modules.demo.cloud.xxljob;
//
//import com.xxl.job.core.biz.model.ReturnT;
//import com.xxl.job.core.handler.annotation.XxlJob;
//import lombok.extern.slf4j.Slf4j;
//import org.jeecg.common.config.mqtoken.UserTokenContext;
//import org.jeecg.common.constant.CommonConstant;
//import org.jeecg.common.system.api.ISysBaseAPI;
//import org.jeecg.common.system.util.JwtUtil;
//import org.jeecg.common.util.RedisUtil;
//import org.jeecg.common.util.SpringContextUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//
///**
// * xxl-job定时任务测试
// */
//@Slf4j
//@Component
//public class TestJobHandler {
// @Autowired
// ISysBaseAPI sysBaseApi;
//
// /**
// * 简单任务
// *
// * 测试无token调用feign接口
// *
// * @param params
// * @return
// */
//
// @XxlJob(value = "testJob")
// public ReturnT<String> demoJobHandler(String params) {
// //1.生成临时令牌Token到线程中
// UserTokenContext.setToken(getTemporaryToken());
//
// log.info("我是 jeecg-demo 服务里的定时任务 testJob , 我执行了...............................");
// log.info("我调用 jeecg-system 服务的字典接口:{}",sysBaseApi.queryAllDict());
// //。。。此处可以写多个feign接口调用
//
// //2.使用完删除临时令牌Token
// UserTokenContext.remove();
// return ReturnT.SUCCESS;
// }
//
// public void init() {
// log.info("init");
// }
//
// public void destroy() {
// log.info("destory");
// }
//
// /**
// * 获取临时令牌
// *
// * 模拟登陆接口,获取模拟 Token
// * @return
// */
// public static String getTemporaryToken() {
// RedisUtil redisUtil = SpringContextUtils.getBean(RedisUtil.class);
// // 模拟登录生成Token
// String token = JwtUtil.sign("??", "??");
// // 设置Token缓存有效时间为 5 分钟
// redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
// redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 5 * 60 * 1000);
// return token;
// }
//
//}
//

View File

@ -0,0 +1,220 @@
package org.jeecg.modules.demo.mock;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.jeecg.common.api.vo.Result;
import org.springframework.web.bind.annotation.*;
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.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description: MockController
* @author: jeecg-boot
*/
@RestController
@RequestMapping("/mock/api")
@Slf4j
public class MockController {
private final String JSON_PATH = "classpath:org/jeecg/modules/demo/mock/json";
/**
* 通用json访问接口
* 格式: http://localhost:8080/jeecg-boot/api/json/{filename}
* @param filename
* @return
*/
@RequestMapping(value = "/json/{filename}", method = RequestMethod.GET)
public String getJsonData(@PathVariable("filename") String filename) {
String jsonpath = "classpath:org/jeecg/modules/demo/mock/json/"+filename+".json";
return readJson(jsonpath);
}
@GetMapping(value = "/asynTreeList")
public Result asynTreeList(String id) {
String json = readJson(JSON_PATH + "/asyn_tree_list_" + id + ".json");
return Result.OK(JSON.parseArray(json));
}
@GetMapping(value = "/user")
public String user() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/user.json");
}
/**
* 老的登录获取用户信息接口
* @return
*/
@GetMapping(value = "/user/info")
public String userInfo() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/user_info.json");
}
@GetMapping(value = "/role")
public String role() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/role.json");
}
@GetMapping(value = "/service")
public String service() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/service.json");
}
@GetMapping(value = "/permission")
public String permission() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/permission.json");
}
@GetMapping(value = "/permission/no-pager")
public String permissionNoPage() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/permission_no_page.json");
}
/**
* 省市县
*/
@GetMapping(value = "/area")
public String area() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/area.json");
}
/**
* 测试报表数据
*/
@GetMapping(value = "/report/getYearCountInfo")
public String getYearCountInfo() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/getCntrNoCountInfo.json");
}
@GetMapping(value = "/report/getMonthCountInfo")
public String getMonthCountInfo() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/getCntrNoCountInfo.json");
}
@GetMapping(value = "/report/getCntrNoCountInfo")
public String getCntrNoCountInfo() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/getCntrNoCountInfo.json");
}
@GetMapping(value = "/report/getCabinetCountInfo")
public String getCabinetCountInfo() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/getCntrNoCountInfo.json");
}
@GetMapping(value = "/report/getTubiao")
public String getTubiao() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/getTubiao.json");
}
/**
* 实时磁盘监控
* @param request
* @param response
* @return
*/
@GetMapping("/queryDiskInfo")
public Result<List<Map<String,Object>>> queryDiskInfo(HttpServletRequest request, HttpServletResponse response){
Result<List<Map<String,Object>>> res = new Result<>();
try {
// 当前文件系统类
FileSystemView fsv = FileSystemView.getFileSystemView();
// 列出所有windows 磁盘
File[] fs = File.listRoots();
log.info("查询磁盘信息:"+fs.length+"");
List<Map<String,Object>> list = new ArrayList<>();
for (int i = 0; i < fs.length; i++) {
if(fs[i].getTotalSpace()==0) {
continue;
}
Map<String,Object> map = new HashMap<>(5);
map.put("name", fsv.getSystemDisplayName(fs[i]));
map.put("max", fs[i].getTotalSpace());
map.put("rest", fs[i].getFreeSpace());
map.put("restPPT", fs[i].getFreeSpace()*100/fs[i].getTotalSpace());
list.add(map);
log.info(map.toString());
}
res.setResult(list);
res.success("查询成功");
} catch (Exception e) {
res.error500("查询失败"+e.getMessage());
}
return res;
}
//-------------------------------------------------------------------------------------------
/**
* 工作台首页的数据
* @return
*/
@GetMapping(value = "/list/search/projects")
public String projects() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_projects.json");
}
@GetMapping(value = "/workplace/activity")
public String activity() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_activity.json");
}
@GetMapping(value = "/workplace/teams")
public String teams() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_teams.json");
}
@GetMapping(value = "/workplace/radar")
public String radar() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/workplace_radar.json");
}
@GetMapping(value = "/task/process")
public String taskProcess() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/task_process.json");
}
//-------------------------------------------------------------------------------------------
//author:lvdandan-----date20190315---for:添加数据日志json----
/**
* 数据日志
*/
public String sysDataLogJson() {
return readJson("classpath:org/jeecg/modules/demo/mock/json/sysdatalog.json");
}
//author:lvdandan-----date20190315---for:添加数据日志json----
//--update-begin--author:wangshuai-----date20201023---for:返回用户信息json数据----
/**
* 用户信息
*/
@GetMapping(value = "/getUserInfo")
public String getUserInfo(){
return readJson("classpath:org/jeecg/modules/demo/mock/json/userinfo.json");
}
//--update-end--author:wangshuai-----date20201023---for:返回用户信息json数据----
/**
* 读取json格式文件
* @param jsonSrc
* @return
*/
private String readJson(String jsonSrc) {
String json = "";
try {
//File jsonFile = ResourceUtils.getFile(jsonSrc);
//json = FileUtils.re.readFileToString(jsonFile);
//换个写法解决springboot读取jar包中文件的问题
InputStream stream = getClass().getClassLoader().getResourceAsStream(jsonSrc.replace("classpath:", ""));
json = IOUtils.toString(stream,"UTF-8");
} catch (IOException e) {
log.error(e.getMessage(),e);
}
return json;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -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": "澳门特别行政区"}
]

View File

@ -0,0 +1,23 @@
[
{
"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
}
]

View File

@ -0,0 +1,23 @@
[
{
"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
}
]

View File

@ -0,0 +1,23 @@
[
{
"id": 21,
"name": "弹框选择Demo",
"component": "jeecg/SelectDemo",
"orderNum": 1,
"hasChildren": false
},
{
"id": 22,
"name": "单表模型示例",
"component": "jeecg/JeecgDemoList",
"orderNum": 2,
"hasChildren": false
},
{
"id": 23,
"name": "一对多Tab示例",
"component": "jeecg/tablist/JeecgOrderDMainList",
"orderNum": 3,
"hasChildren": false
}
]

View File

@ -0,0 +1,23 @@
[
{
"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
}
]

View File

@ -0,0 +1,23 @@
[
{
"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
}
]

View File

@ -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
}

View File

@ -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": "极差"}
]}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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"
}

View File

@ -0,0 +1,55 @@
{
"success": true,
"message": "操作成功!",
"code": 0,
"result": {
"records": [
{
"taskId": "48701",
"name": "start",
"taskBeginTime": "2019-03-07 09:33:04",
"taskEndTime": "2019-03-08 04:03:01",
"principal": "测试体验账号",
"result": "已完成"
},
{
"taskId": "48702",
"name": "部门领导审批",
"taskBeginTime": "2019-03-07 09:33:04",
"taskEndTime": "2019-03-08 04:03:01",
"principal": "测试体验账号",
"result": "已完成"
},
{
"taskId": "48703",
"name": "调整申请",
"taskBeginTime": "2019-03-07 09:33:04",
"taskEndTime": "2019-03-08 04:03:01",
"principal": "测试体验账号",
"result": "已完成"
},
{
"taskId": "48704",
"name": "人事审批",
"taskBeginTime": "2019-03-07 09:33:04",
"taskEndTime": "2019-03-08 04:03:01",
"principal": "测试体验账号",
"result": "已完成"
},
{
"taskId": "48705",
"name": "end",
"taskBeginTime": "2019-03-07 09:33:04",
"taskEndTime": "2019-03-08 04:03:01",
"principal": "测试体验账号",
"result": "已完成"
}
],
"total": 0,
"size": 10,
"current": 1,
"searchCount": true,
"pages": 0
},
"timestamp": 1551922394641
}

File diff suppressed because it is too large Load Diff

View File

@ -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
}

View File

@ -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": "北京市朝阳区社保局"
}
]
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -0,0 +1,414 @@
package org.jeecg.modules.demo.mock.vxe.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.VxeSocketConst;
import org.jeecg.common.system.query.MatchTypeEnum;
import org.jeecg.common.system.query.QueryCondition;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.mock.vxe.entity.MockEntity;
import org.jeecg.modules.demo.mock.vxe.websocket.VxeSocket;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLDecoder;
import java.util.*;
/**
* @Description: VxeMockController
* @author: jeecg-boot
*/
@RestController
@RequestMapping("/mock/vxe")
@Slf4j
public class VxeMockController {
/**
* 模拟更改状态
*
* @param id
* @param status
* @return
*/
@GetMapping("/change1")
public Result mockChange1(@RequestParam("id") String id, @RequestParam("status") String status) {
/* id 为 行的idrowId只要获取到rowId那么只需要调用 VXESocket.sendMessageToAll() 即可 */
// 封装行数据
JSONObject rowData = new JSONObject();
// 这个字段就是要更改的行数据ID
rowData.put("id", id);
// 这个字段就是要更改的列的key和具体的值
rowData.put("status", status);
// 模拟更改数据
this.mockChange(rowData);
return Result.ok();
}
/**
* 模拟更改拖轮状态
*
* @param id
* @param tug_status
* @return
*/
@Deprecated
@GetMapping("/change2")
public Result mockChange2(@RequestParam("id") String id,@RequestParam("tug_status") String tugStatus) {
/* id 为 行的idrowId只要获取到rowId那么只需要调用 VXESocket.sendMessageToAll() 即可 */
// 封装行数据
JSONObject rowData = new JSONObject();
// 这个字段就是要更改的行数据ID
rowData.put("id", id);
// 这个字段就是要更改的列的key和具体的值
JSONObject status = JSON.parseObject(tugStatus);
rowData.put("tug_status", status);
// 模拟更改数据
this.mockChange(rowData);
return Result.ok();
}
/**
* 模拟更改进度条状态
*
* @param id
* @param progress
* @return
*/
@GetMapping("/change3")
public Result mockChange3(@RequestParam("id") String id, @RequestParam("progress") String progress) {
/* id 为 行的idrowId只要获取到rowId那么只需要调用 VXESocket.sendMessageToAll() 即可 */
// 封装行数据
JSONObject rowData = new JSONObject();
// 这个字段就是要更改的行数据ID
rowData.put("id", id);
// 这个字段就是要更改的列的key和具体的值
rowData.put("progress", progress);
// 模拟更改数据
this.mockChange(rowData);
return Result.ok();
}
private void mockChange(JSONObject rowData) {
// 封装socket数据
JSONObject socketData = new JSONObject();
// 这里的 socketKey 必须要和调度计划页面上写的 socketKey 属性保持一致
socketData.put("socketKey", "page-dispatch");
// 这里的 args 必须得是一个数组下标0是行数据下标1是caseId一般不用传
socketData.put("args", new Object[]{rowData, ""});
// 封装消息字符串,这里的
// type 必须是 VXESocketConst.TYPE_UVT
String message = VxeSocket.packageMessage(VxeSocketConst.TYPE_UVT, socketData);
// 调用 sendMessageToAll 发送给所有在线的用户
VxeSocket.sendMessageToAll(message);
}
/**
* 模拟更改【大船待审】状态
*
* @param status
* @return
*/
@GetMapping("/change4")
public Result mockChange4(@RequestParam("status") String status) {
// 封装socket数据
JSONObject socketData = new JSONObject();
// 这里的 key 是前端注册时使用的key必须保持一致
socketData.put("key", "dispatch-dcds-status");
// 这里的 args 必须得是一个数组,每一位都是注册方法的参数,按顺序传递
socketData.put("args", new Object[]{status});
// 封装消息字符串,这里的 type 必须是 VXESocketConst.TYPE_UVT
String message = VxeSocket.packageMessage(VxeSocketConst.TYPE_CSD, socketData);
// 调用 sendMessageToAll 发送给所有在线的用户
VxeSocket.sendMessageToAll(message);
return Result.ok();
}
/**
* 【模拟】即时保存单行数据
*
* @param rowData 行数据,实际使用时可以替换成一个实体类
*/
@PutMapping("/immediateSaveRow")
public Result mockImmediateSaveRow(@RequestBody JSONObject rowData) throws Exception {
System.out.println("即时保存.rowData" + rowData.toJSONString());
// 延时1.5秒,模拟网慢堵塞真实感
Thread.sleep(500);
return Result.ok();
}
/**
* 【模拟】即时保存整个表格的数据
*
* @param tableData 表格数据实际使用时可以替换成一个List实体类
*/
@PostMapping("/immediateSaveAll")
public Result mockImmediateSaveAll(@RequestBody JSONArray tableData) throws Exception {
// 【注】:
// 1、tableData里包含该页所有的数据
// 2、如果你实现了“即时保存”那么除了新增的数据其他的都是已经保存过的了
// 不需要再进行一次update操作了所以可以在前端传数据的时候就遍历判断一下
// 只传新增的数据给后台insert即可否者将会造成性能上的浪费。
// 3、新增的行是没有id的通过这一点就可以判断是否是新增的数据
System.out.println("即时保存.tableData" + tableData.toJSONString());
// 延时1.5秒,模拟网慢堵塞真实感
Thread.sleep(1000);
return Result.ok();
}
/**
* 获取模拟数据
*
* @param pageNo 页码
* @param pageSize 页大小
* @param parentId 父ID不传则查询顶级
* @return
*/
@GetMapping("/getData")
public Result getMockData(
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
// 父级id根据父级id查询子级如果为空则查询顶级
@RequestParam(name = "parentId", required = false) String parentId
) {
// 模拟JSON数据路径
String path = "classpath:org/jeecg/modules/demo/mock/vxe/json/dlglong.json";
// 读取JSON数据
JSONArray dataList = readJsonData(path);
if (dataList == null) {
return Result.error("读取数据失败!");
}
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
return Result.ok(page);
}
/**
* 获取模拟“调度计划”页面的数据
*
* @param pageNo 页码
* @param pageSize 页大小
* @param parentId 父ID不传则查询顶级
* @return
*/
@GetMapping("/getDdjhData")
public Result getMockDdjhData(
// SpringMVC 会自动将参数注入到实体里
MockEntity mockEntity,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
// 父级id根据父级id查询子级如果为空则查询顶级
@RequestParam(name = "parentId", required = false) String parentId,
@RequestParam(name = "status", required = false) String status,
// 高级查询条件
@RequestParam(name = "superQueryParams", required = false) String superQueryParams,
// 高级查询模式
@RequestParam(name = "superQueryMatchType", required = false) String superQueryMatchType,
HttpServletRequest request
) {
// 获取查询条件(前台传递的查询参数)
Map<String, String[]> parameterMap = request.getParameterMap();
// 遍历输出到控制台
System.out.println("\ngetDdjhData - 普通查询条件:");
for (String key : parameterMap.keySet()) {
System.out.println("-- " + key + ": " + JSON.toJSONString(parameterMap.get(key)));
}
// 输出高级查询
try {
System.out.println("\ngetDdjhData - 高级查询条件:");
// 高级查询模式
MatchTypeEnum matchType = MatchTypeEnum.getByValue(superQueryMatchType);
if (matchType == null) {
System.out.println("-- 高级查询模式:不识别(" + superQueryMatchType + "");
} else {
System.out.println("-- 高级查询模式:" + matchType.getValue());
}
superQueryParams = URLDecoder.decode(superQueryParams, "UTF-8");
List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class);
if (conditions != null) {
for (QueryCondition condition : conditions) {
System.out.println("-- " + JSON.toJSONString(condition));
}
} else {
System.out.println("-- 没有传递任何高级查询条件");
}
System.out.println();
} catch (Exception e) {
log.error("-- 高级查询操作失败:" + superQueryParams, e);
e.printStackTrace();
}
/* 注:实际使用中不用写上面那种繁琐的代码,这里只是为了直观的输出到控制台里而写的示例,
使用下面这种写法更简洁方便 */
// 封装成 MyBatisPlus 能识别的 QueryWrapper可以直接使用这个对象进行SQL筛选条件拼接
// 这个方法也会自动封装高级查询条件但是高级查询参数名必须是superQueryParams和superQueryMatchType
QueryWrapper<MockEntity> queryWrapper = QueryGenerator.initQueryWrapper(mockEntity, parameterMap);
System.out.println("queryWrapper " + queryWrapper.getCustomSqlSegment());
// 模拟JSON数据路径
String path = "classpath:org/jeecg/modules/demo/mock/vxe/json/ddjh.json";
String statusValue = "8";
if (statusValue.equals(status)) {
path = "classpath:org/jeecg/modules/demo/mock/vxe/json/ddjh_s8.json";
}
// 读取JSON数据
JSONArray dataList = readJsonData(path);
if (dataList == null) {
return Result.error("读取数据失败!");
}
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
// 逐行查询子表数据,用于计算拖轮状态
List<JSONObject> records = page.getRecords();
for (JSONObject record : records) {
Map<String, Integer> tugStatusMap = new HashMap<>(5);
String id = record.getString("id");
// 查询出主表的拖轮
String tugMain = record.getString("tug");
// 判断是否有值
if (StringUtils.isNotBlank(tugMain)) {
// 拖轮根据分号分割
String[] tugs = tugMain.split(";");
// 查询子表数据
List<JSONObject> subRecords = this.queryDataPage(dataList, id, null, null).getRecords();
// 遍历子表和拖轮数据,找出进行计算反推拖轮状态
for (JSONObject subData : subRecords) {
String subTug = subData.getString("tug");
if (StringUtils.isNotBlank(subTug)) {
for (String tug : tugs) {
if (tug.equals(subTug)) {
// 计算拖轮状态逻辑
int statusCode = 0;
/* 如果有发船时间、作业开始时间、作业结束时间、回船时间,则主表中的拖轮列中的每个拖轮背景色要即时变色 */
// 有发船时间,状态 +1
String departureTime = subData.getString("departure_time");
if (StringUtils.isNotBlank(departureTime)) {
statusCode += 1;
}
// 有作业开始时间,状态 +1
String workBeginTime = subData.getString("work_begin_time");
if (StringUtils.isNotBlank(workBeginTime)) {
statusCode += 1;
}
// 有作业结束时间,状态 +1
String workEndTime = subData.getString("work_end_time");
if (StringUtils.isNotBlank(workEndTime)) {
statusCode += 1;
}
// 有回船时间,状态 +1
String returnTime = subData.getString("return_time");
if (StringUtils.isNotBlank(returnTime)) {
statusCode += 1;
}
// 保存拖轮状态key是拖轮的值value是状态前端根据不同的状态码显示不同的颜色这个颜色也可以后台计算完之后返回给前端直接使用
tugStatusMap.put(tug, statusCode);
break;
}
}
}
}
}
// 新加一个字段用于保存拖轮状态,不要直接覆盖原来的,这个字段可以不保存到数据库里
record.put("tug_status", tugStatusMap);
}
page.setRecords(records);
return Result.ok(page);
}
/**
* 模拟查询数据可以根据父ID查询可以分页
*
* @param dataList 数据列表
* @param parentId 父ID
* @param pageNo 页码
* @param pageSize 页大小
* @return
*/
private IPage<JSONObject> queryDataPage(JSONArray dataList, String parentId, Integer pageNo, Integer pageSize) {
// 根据父级id查询子级
JSONArray dataDb = dataList;
if (StringUtils.isNotBlank(parentId)) {
JSONArray results = new JSONArray();
List<String> parentIds = Arrays.asList(parentId.split(","));
this.queryByParentId(dataDb, parentIds, results);
dataDb = results;
}
// 模拟分页实际中应用SQL自带的分页
List<JSONObject> records = new ArrayList<>();
IPage<JSONObject> page;
long beginIndex, endIndex;
// 如果任意一个参数为null则不分页
if (pageNo == null || pageSize == null) {
page = new Page<>(0, dataDb.size());
beginIndex = 0;
endIndex = dataDb.size();
} else {
page = new Page<>(pageNo, pageSize);
beginIndex = page.offset();
endIndex = page.offset() + page.getSize();
}
for (long i = beginIndex; (i < endIndex && i < dataDb.size()); i++) {
JSONObject data = dataDb.getJSONObject((int) i);
data = JSON.parseObject(data.toJSONString());
// 不返回 children
data.remove("children");
records.add(data);
}
page.setRecords(records);
page.setTotal(dataDb.size());
return page;
}
private void queryByParentId(JSONArray dataList, List<String> parentIds, JSONArray results) {
for (int i = 0; i < dataList.size(); i++) {
JSONObject data = dataList.getJSONObject(i);
JSONArray children = data.getJSONArray("children");
// 找到了该父级
if (parentIds.contains(data.getString("id"))) {
if (children != null) {
// addAll 的目的是将多个子表的数据合并在一起
results.addAll(children);
}
} else {
if (children != null) {
queryByParentId(children, parentIds, results);
}
}
}
results.addAll(new JSONArray());
}
private JSONArray readJsonData(String path) {
try {
InputStream stream = getClass().getClassLoader().getResourceAsStream(path.replace("classpath:", ""));
if (stream != null) {
String json = IOUtils.toString(stream, "UTF-8");
return JSON.parseArray(json);
}
} catch (IOException e) {
log.error(e.getMessage(), e);
}
return null;
}
}

View File

@ -0,0 +1,27 @@
package org.jeecg.modules.demo.mock.vxe.entity;
import lombok.Data;
/**
* 模拟实体
* @author: jeecg-boot
*/
@Data
public class MockEntity {
/**
* id
*/
private String id;
/**
* 父级ID
*/
private String parentId;
/**
* 状态
*/
private String status;
/* -- 省略其他字段 -- */
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,218 @@
package org.jeecg.modules.demo.mock.vxe.websocket;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.VxeSocketConst;
import org.springframework.stereotype.Component;
import javax.websocket.OnClose;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
/**
* vxe WebSocket用于实现实时无痕刷新的功能
* update: 【类名改了大小写】 date: 2022-04-18
* @author: jeecg-boot
*/
@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是userIdvalue是Map对象子Map的key是pageIdvalue是VXESocket对象
*/
private static Map<String, Map<String, VxeSocket>> userPool = new HashMap<>();
/**
* 连接池包含所有WebSocket连接
* key是socketIdvalue是VXESocket对象
*/
private static Map<String, VxeSocket> socketPool = new HashMap<>();
/**
* 获取某个用户所有的页面
*/
public static Map<String, VxeSocket> getUserPool(String userId) {
return userPool.computeIfAbsent(userId, k -> new HashMap<>(5));
}
/**
* 向当前用户发送消息
*
* @param message 消息内容
*/
public void sendMessage(String message) {
try {
this.session.getAsyncRemote().sendText(message);
} catch (Exception e) {
log.error("【vxeSocket】消息发送失败" + e.getMessage());
}
}
/**
* 封装消息json
*
* @param data 消息内容
*/
public static String packageMessage(String type, Object data) {
JSONObject message = new JSONObject();
message.put(VxeSocketConst.TYPE, type);
message.put(VxeSocketConst.DATA, data);
return message.toJSONString();
}
/**
* 向指定用户的所有页面发送消息
*
* @param userId 接收消息的用户ID
* @param message 消息内容
*/
public static void sendMessageTo(String userId, String message) {
Collection<VxeSocket> values = getUserPool(userId).values();
if (values.size() > 0) {
for (VxeSocket socketItem : values) {
socketItem.sendMessage(message);
}
} else {
log.warn("【vxeSocket】消息发送失败userId\"" + userId + "\"不存在或未在线!");
}
}
/**
* 向指定用户的指定页面发送消息
*
* @param userId 接收消息的用户ID
* @param message 消息内容
*/
public static void sendMessageTo(String userId, String pageId, String message) {
VxeSocket socketItem = getUserPool(userId).get(pageId);
if (socketItem != null) {
socketItem.sendMessage(message);
} else {
log.warn("【vxeSocket】消息发送失败userId\"" + userId + "\"的pageId\"" + pageId + "\"不存在或未在线!");
}
}
/**
* 向多个用户的所有页面发送消息
*
* @param userIds 接收消息的用户ID数组
* @param message 消息内容
*/
public static void sendMessageTo(String[] userIds, String message) {
for (String userId : userIds) {
VxeSocket.sendMessageTo(userId, message);
}
}
/**
* 向所有用户的所有页面发送消息
*
* @param message 消息内容
*/
public static void sendMessageToAll(String message) {
for (VxeSocket socketItem : socketPool.values()) {
socketItem.sendMessage(message);
}
}
/**
* websocket 开启连接
*/
@OnOpen
public void onOpen(Session session, @PathParam("userId") String userId, @PathParam("pageId") String pageId) {
try {
this.userId = userId;
this.pageId = pageId;
this.socketId = userId + pageId;
this.session = session;
socketPool.put(this.socketId, this);
getUserPool(userId).put(this.pageId, this);
log.info("【vxeSocket】有新的连接总数为:" + socketPool.size());
} catch (Exception ignored) {
}
}
/**
* websocket 断开连接
*/
@OnClose
public void onClose() {
try {
socketPool.remove(this.socketId);
getUserPool(this.userId).remove(this.pageId);
log.info("【vxeSocket】连接断开总数为:" + socketPool.size());
} catch (Exception ignored) {
}
}
/**
* websocket 收到消息
*/
@OnMessage
public void onMessage(String message) {
// log.info("【vxeSocket】onMessage:" + message);
JSONObject json;
try {
json = JSON.parseObject(message);
} catch (Exception e) {
log.warn("【vxeSocket】收到不合法的消息:" + message);
return;
}
String type = json.getString(VxeSocketConst.TYPE);
switch (type) {
// 心跳检测
case VxeSocketConst.TYPE_HB:
this.sendMessage(VxeSocket.packageMessage(type, true));
break;
// 更新form数据
case VxeSocketConst.TYPE_UVT:
this.handleUpdateForm(json);
break;
default:
log.warn("【vxeSocket】收到不识别的消息类型:" + type);
break;
}
}
/**
* 处理 UpdateForm 事件
*/
private void handleUpdateForm(JSONObject json) {
// 将事件转发给所有人
JSONObject data = json.getJSONObject(VxeSocketConst.DATA);
VxeSocket.sendMessageToAll(VxeSocket.packageMessage(VxeSocketConst.TYPE_UVT, data));
}
}

View File

@ -0,0 +1,117 @@
package org.jeecg.modules.demo.online;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.util.oConvertUtils;
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.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* Online表单开发 demo 示例
*
* @author sunjianlei
* @date 2021-12-16
*/
@Slf4j
@RestController("onlCgformDemoController")
@RequestMapping("/demo/online/cgform")
public class OnlCgformDemoController {
/**
* Online表单 http 增强list增强示例
* @param params
* @return
*/
@PostMapping("/enhanceJavaListHttp")
public Result<?> enhanceJavaListHttp(@RequestBody JSONObject params) {
log.info(" --- params" + params.toJSONString());
JSONArray dataList = params.getJSONArray("dataList");
List<DictModel> dict = virtualDictData();
for (int i = 0; i < dataList.size(); i++) {
JSONObject record = dataList.getJSONObject(i);
String province = record.getString("province");
if (province == null) {
continue;
}
String text = dict.stream()
.filter(p -> province.equals(p.getValue()))
.map(DictModel::getText)
.findAny()
.orElse(province);
record.put("province", text);
}
Result<?> res = Result.OK(dataList);
res.setCode(1);
return res;
}
/**
* 模拟字典数据
*
* @return
*/
private List<DictModel> virtualDictData() {
List<DictModel> dict = new ArrayList<>();
dict.add(new DictModel("bj", "北京"));
dict.add(new DictModel("sd", "山东"));
dict.add(new DictModel("ah", "安徽"));
return dict;
}
/**
* Online表单 http 增强add、edit增强示例
* @param params
* @return
*/
@PostMapping("/enhanceJavaHttp")
public Result<?> enhanceJavaHttp(@RequestBody JSONObject params) {
log.info(" --- params" + params.toJSONString());
String tableName = params.getString("tableName");
JSONObject record = params.getJSONObject("record");
/*
* 业务场景一: 获取提交表单数据,进行其他业务关联操作
* (比如:根据入库单,同步更改库存)
*/
log.info(" --- tableName" + tableName);
log.info(" --- 行数据:" + record.toJSONString());
/*
* 业务场景二: 保存数据之前进行数据的校验
* 直接返回错误状态即可
*/
String phone = record.getString("phone");
if (oConvertUtils.isEmpty(phone)) {
return Result.error("手机号不能为空!");
}
/*
* 业务场景三: 保存数据之对数据的处理
* 直接操作 record 即可
*/
record.put("phone", "010-" + phone);
/* 其他业务场景自行实现 */
// 返回场景一: 不对 record 做任何修改的情况下,可以直接返回 code
// 返回 0 = 丢弃当前数据
// 返回 1 = 新增当前数据
// 返回 2 = 修改当前数据 TODO存疑
// return Result.OK(1);
// 返回场景二: 需要对 record 做修改的情况下需要返回一个JSONObject对象或者Map也行
JSONObject res = new JSONObject();
res.put("code", 1);
// 将 record 返回以进行修改
res.put("record", record);
// TODO 不要 code 的概念
return Result.OK(res);
}
}

View File

@ -0,0 +1,63 @@
package org.jeecg.modules.demo.test.controller;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.demo.test.entity.JeecgDemo;
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.List;
/**
* @Description: 大屏预览入口
* @Author: scott
* @Date:2019-12-12
* @Version:V1.0
*/
@Slf4j
@Controller
@RequestMapping("/test/bigScreen/templat")
public class BigScreenTemplatController extends JeecgController<JeecgDemo, IJeecgDemoService> {
/**
* @param modelAndView
* @return
*/
@RequestMapping("/html")
public ModelAndView ftl(ModelAndView modelAndView) {
modelAndView.setViewName("demo3");
List<String> userList = new ArrayList<String>();
userList.add("admin");
userList.add("user1");
userList.add("user2");
log.info("--------------test--------------");
modelAndView.addObject("userList", userList);
return modelAndView;
}
/**
* 生产销售监控模版
* @param modelAndView
* @return
*/
@RequestMapping("/index1")
public ModelAndView index1(ModelAndView modelAndView) {
modelAndView.setViewName("/bigscreen/template1/index");
return modelAndView;
}
/**
* 智慧物流监控模版
* @param modelAndView
* @return
*/
@RequestMapping("/index2")
public ModelAndView index2(ModelAndView modelAndView) {
modelAndView.setViewName("/bigscreen/template2/index");
return modelAndView;
}
}

View File

@ -0,0 +1,459 @@
package org.jeecg.modules.demo.test.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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.aspect.annotation.PermissionData;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.demo.test.entity.JeecgDemo;
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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.Date;
import java.util.List;
/**
* @Description: 单表示例
* @Author: jeecg-boot
* @Date:2018-12-29
* @Version:V2.0
*/
@Slf4j
@Api(tags = "单表DEMO")
@RestController
@RequestMapping("/test/jeecgDemo")
public class JeecgDemoController extends JeecgController<JeecgDemo, IJeecgDemoService> {
@Autowired
private IJeecgDemoService jeecgDemoService;
@Autowired
private RedisUtil redisUtil;
/**
* 分页列表查询
*
* @param jeecgDemo
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表")
@GetMapping(value = "/list")
@PermissionData(pageComponent = "jeecg/JeecgDemoList")
public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<JeecgDemo> queryWrapper = QueryGenerator.initQueryWrapper(jeecgDemo, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize);
IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper);
log.info("查询当前页:" + pageList.getCurrent());
log.info("查询当前页数量:" + pageList.getSize());
log.info("查询结果数量:" + pageList.getRecords().size());
log.info("数据总数:" + pageList.getTotal());
return Result.OK(pageList);
}
/**
* 添加
*
* @param jeecgDemo
* @return
*/
@PostMapping(value = "/add")
@AutoLog(value = "添加测试DEMO")
@ApiOperation(value = "添加DEMO", notes = "添加DEMO")
public Result<?> add(@RequestBody JeecgDemo jeecgDemo) {
jeecgDemoService.save(jeecgDemo);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param jeecgDemo
* @return
*/
@AutoLog(value = "编辑DEMO", operateType = CommonConstant.OPERATE_TYPE_3)
@ApiOperation(value = "编辑DEMO", notes = "编辑DEMO")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<?> edit(@RequestBody JeecgDemo jeecgDemo) {
jeecgDemoService.updateById(jeecgDemo);
return Result.OK("更新成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "删除测试DEMO")
@DeleteMapping(value = "/delete")
@ApiOperation(value = "通过ID删除DEMO", notes = "通过ID删除DEMO")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
jeecgDemoService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@DeleteMapping(value = "/deleteBatch")
@ApiOperation(value = "批量删除DEMO", notes = "批量删除DEMO")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.jeecgDemoService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@GetMapping(value = "/queryById")
@ApiOperation(value = "通过ID查询DEMO", notes = "通过ID查询DEMO")
public Result<?> queryById(@ApiParam(name = "id", value = "示例id", required = true) @RequestParam(name = "id", required = true) String id) {
JeecgDemo jeecgDemo = jeecgDemoService.getById(id);
return Result.OK(jeecgDemo);
}
/**
* 导出excel
*
* @param request
*/
@RequestMapping(value = "/exportXls")
@PermissionData(pageComponent = "jeecg/JeecgDemoList")
public ModelAndView exportXls(HttpServletRequest request, JeecgDemo jeecgDemo) {
//获取导出表格字段
String exportFields = jeecgDemoService.getExportFields();
//分sheet导出表格字段
return super.exportXlsSheet(request, jeecgDemo, JeecgDemo.class, "单表模型",exportFields,500);
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, JeecgDemo.class);
}
// =====Redis 示例===============================================================================================
/**
* redis操作 -- set
*/
@GetMapping(value = "/redisSet")
public void redisSet() {
redisUtil.set("name", "张三" + DateUtils.now());
}
/**
* redis操作 -- get
*/
@GetMapping(value = "/redisGet")
public String redisGet() {
return (String) redisUtil.get("name");
}
/**
* redis操作 -- setObj
*/
@GetMapping(value = "/redisSetObj")
public void redisSetObj() {
JeecgDemo p = new JeecgDemo();
p.setAge(10);
p.setBirthday(new Date());
p.setContent("hello");
p.setName("张三");
p.setSex("");
redisUtil.set("user-zdh", p);
}
/**
* redis操作 -- setObj
*/
@GetMapping(value = "/redisGetObj")
public Object redisGetObj() {
return redisUtil.get("user-zdh");
}
/**
* redis操作 -- get
*/
@GetMapping(value = "/redis/{id}")
public JeecgDemo redisGetJeecgDemo(@PathVariable("id") String id) {
JeecgDemo t = jeecgDemoService.getByIdCacheable(id);
log.info(t.toString());
return t;
}
// ===Freemaker示例================================================================================
/**
* freemaker方式 【页面路径: src/main/resources/templates】
*
* @param modelAndView
* @return
*/
@RequestMapping("/html")
public ModelAndView ftl(ModelAndView modelAndView) {
modelAndView.setViewName("demo3");
List<String> userList = new ArrayList<String>();
userList.add("admin");
userList.add("user1");
userList.add("user2");
log.info("--------------test--------------");
modelAndView.addObject("userList", userList);
return modelAndView;
}
// ==========================================动态表单 JSON接收测试===========================================
/**
* online新增数据
*/
@PostMapping(value = "/testOnlineAdd")
public Result<?> testOnlineAdd(@RequestBody JSONObject json) {
log.info(json.toJSONString());
return Result.OK("添加成功!");
}
/*----------------------------------------外部获取权限示例------------------------------------*/
/**
* 【数据权限示例 - 编程】mybatisPlus java类方式加载权限
*
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/mpList")
@PermissionData(pageComponent = "jeecg/JeecgDemoList")
public Result<?> loadMpPermissonList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<JeecgDemo> queryWrapper = new QueryWrapper<JeecgDemo>();
//编程方式给queryWrapper装载数据权限规则
QueryGenerator.installAuthMplus(queryWrapper, JeecgDemo.class);
Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize);
IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 【数据权限示例 - 编程】mybatis xml方式加载权限
*
* @param jeecgDemo
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/sqlList")
@PermissionData(pageComponent = "jeecg/JeecgDemoList")
public Result<?> loadSqlPermissonList(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
IPage<JeecgDemo> pageList = jeecgDemoService.queryListWithPermission(pageSize, pageNo);
return Result.OK(pageList);
}
/*----------------------------------------外部获取权限示例------------------------------------*/
/**
* online api增强 列表
* @param params
* @return
*/
@PostMapping("/enhanceJavaListHttp")
public Result enhanceJavaListHttp(@RequestBody JSONObject params) {
log.info(" =========================================================== ");
log.info("params: " + params.toJSONString());
log.info("params.tableName: " + params.getString("tableName"));
log.info("params.json: " + params.getJSONObject("json").toJSONString());
JSONArray dataList = params.getJSONArray("dataList");
log.info("params.dataList: " + dataList.toJSONString());
log.info(" =========================================================== ");
return Result.OK(dataList);
}
/**
* online api增强 表单
* @param params
* @return
*/
@PostMapping("/enhanceJavaFormHttp")
public Result enhanceJavaFormHttp(@RequestBody JSONObject params) {
log.info(" =========================================================== ");
log.info("params: " + params.toJSONString());
log.info("params.tableName: " + params.getString("tableName"));
log.info("params.json: " + params.getJSONObject("json").toJSONString());
log.info(" =========================================================== ");
return Result.OK("1");
}
@GetMapping(value = "/hello")
public String hello(HttpServletRequest req) {
return "hello world!";
}
// =====Vue3 Native 原生页面示例===============================================================================================
@GetMapping(value = "/oneNative/list")
public Result oneNativeList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
Object oneNative = redisUtil.get("one-native");
JSONArray data = new JSONArray();
if(null != oneNative){
JSONObject nativeObject = (JSONObject) oneNative;
data = nativeObject.getJSONArray("data");
}
IPage<JSONObject> objectPage = queryDataPage(data, pageNo, pageSize);
return Result.OK(objectPage);
}
@PostMapping("/oneNative/add")
public Result<String> oneNativeAdd(@RequestBody JSONObject jsonObject){
Object oneNative = redisUtil.get("one-native");
JSONObject nativeObject = new JSONObject();
JSONArray data = new JSONArray();
if(null != oneNative){
nativeObject = (JSONObject) oneNative;
data = nativeObject.getJSONArray("data");
}
jsonObject.put("id", UUIDGenerator.generate());
data.add(jsonObject);
nativeObject.put("data",data);
redisUtil.set("one-native",nativeObject);
return Result.OK("添加成功");
}
@PutMapping("/oneNative/edit")
public Result<String> oneNativeEdit(@RequestBody JSONObject jsonObject){
JSONObject oneNative = (JSONObject)redisUtil.get("one-native");
JSONArray data = oneNative.getJSONArray("data");
data = getNativeById(data,jsonObject);
oneNative.put("data", data);
redisUtil.set("one-native", oneNative);
return Result.OK("修改成功");
}
@DeleteMapping("/oneNative/delete")
public Result<String> oneNativeDelete(@RequestParam(name = "ids") String ids){
Object oneNative = redisUtil.get("one-native");
if(null != oneNative){
JSONObject nativeObject = (JSONObject) oneNative;
JSONArray data = nativeObject.getJSONArray("data");
data = deleteNativeById(data,ids);
nativeObject.put("data",data);
redisUtil.set("one-native",nativeObject);
}
return Result.OK("删除成功");
}
/**
* 获取redis对应id的数据
* @param data
* @param jsonObject
* @return
*/
public JSONArray getNativeById(JSONArray data,JSONObject jsonObject){
String dbId = "id";
String id = jsonObject.getString(dbId);
for (int i = 0; i < data.size(); i++) {
if(id.equals(data.getJSONObject(i).getString(dbId))){
data.set(i,jsonObject);
break;
}
}
return data;
}
/**
* 删除redis中包含的id数据
* @param data
* @param ids
* @return
*/
public JSONArray deleteNativeById(JSONArray data,String ids){
String dbId = "id";
for (int i = 0; i < data.size(); i++) {
//如果id包含直接清除data中的数据
if(ids.contains(data.getJSONObject(i).getString(dbId))){
data.fluentRemove(i);
}
//判断data的长度是否还剩1位
if(data.size() == 1 && ids.contains(data.getJSONObject(0).getString(dbId))){
data.fluentRemove(0);
}
}
return data;
}
/**
* 模拟查询数据可以根据父ID查询可以分页
*
* @param dataList 数据列表
* @param pageNo 页码
* @param pageSize 页大小
* @return
*/
private IPage<JSONObject> queryDataPage(JSONArray dataList, Integer pageNo, Integer pageSize) {
// 根据父级id查询子级
JSONArray dataDb = dataList;
// 模拟分页实际中应用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;
}
// =====Vue3 Native 原生页面示例===============================================================================================
}

View File

@ -0,0 +1,47 @@
package org.jeecg.modules.demo.test.controller;
import io.lettuce.core.dynamic.annotation.Param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.demo.test.entity.JeecgDemo;
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
import org.jeecg.modules.demo.test.service.IJeecgDynamicDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Description: 动态数据源测试
* @Author: zyf
* @Date:2020-04-21
*/
@Slf4j
@Api(tags = "动态数据源测试")
@RestController
@RequestMapping("/test/dynamic")
public class JeecgDynamicDataController extends JeecgController<JeecgDemo, IJeecgDemoService> {
@Autowired
private IJeecgDynamicDataService jeecgDynamicDataService;
/**
* 动态切换数据源
* @return
*/
@PostMapping(value = "/test1")
@AutoLog(value = "动态切换数据源")
@ApiOperation(value = "动态切换数据源", notes = "动态切换数据源")
public Result<List<JeecgDemo>> selectSpelByKey(@RequestParam(required = false) String dsName) {
List<JeecgDemo> list = jeecgDynamicDataService.selectSpelByKey(dsName);
return Result.OK(list);
}
}

View File

@ -0,0 +1,256 @@
package org.jeecg.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 lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
import org.jeecg.modules.demo.test.entity.JeecgOrderMain;
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
import org.jeecg.modules.demo.test.service.IJeecgOrderCustomerService;
import org.jeecg.modules.demo.test.service.IJeecgOrderMainService;
import org.jeecg.modules.demo.test.service.IJeecgOrderTicketService;
import org.jeecg.modules.demo.test.vo.JeecgOrderMainPage;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
/**
* @Description: 一对多示例ERP TAB风格
* @Author: ZhiLin
* @Date: 2019-02-20
* @Version: v2.0
*/
@Slf4j
@RestController
@RequestMapping("/test/order")
public class JeecgOrderErpMainController {
@Autowired
private IJeecgOrderMainService jeecgOrderMainService;
@Autowired
private IJeecgOrderCustomerService jeecgOrderCustomerService;
@Autowired
private IJeecgOrderTicketService jeecgOrderTicketService;
/**
* 分页列表查询
*
* @param jeecgOrderMain
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/orderList")
public Result<?> respondePagedData(JeecgOrderMain jeecgOrderMain,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<JeecgOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderMain, req.getParameterMap());
Page<JeecgOrderMain> page = new Page<JeecgOrderMain>(pageNo, pageSize);
IPage<JeecgOrderMain> pageList = jeecgOrderMainService.page(page, queryWrapper);
return Result.ok(pageList);
}
/**
* 添加
*
* @param jeecgOrderMainPage
* @return
*/
@PostMapping(value = "/add")
public Result<?> add(@RequestBody JeecgOrderMainPage jeecgOrderMainPage) {
JeecgOrderMain jeecgOrderMain = new JeecgOrderMain();
BeanUtils.copyProperties(jeecgOrderMainPage, jeecgOrderMain);
jeecgOrderMainService.save(jeecgOrderMain);
return Result.ok("添加成功!");
}
/**
* 编辑
*
* @param jeecgOrderMainPage
* @return
*/
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<?> edit(@RequestBody JeecgOrderMainPage jeecgOrderMainPage) {
JeecgOrderMain jeecgOrderMain = new JeecgOrderMain();
BeanUtils.copyProperties(jeecgOrderMainPage, jeecgOrderMain);
jeecgOrderMainService.updateById(jeecgOrderMain);
return Result.ok("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
jeecgOrderMainService.delMain(id);
return Result.ok("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.jeecgOrderMainService.removeByIds(Arrays.asList(ids.split(",")));
return Result.ok("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
JeecgOrderMain jeecgOrderMain = jeecgOrderMainService.getById(id);
return Result.ok(jeecgOrderMain);
}
/**
* 通过id查询
*
* @param jeecgOrderCustomer
* @return
*/
@GetMapping(value = "/listOrderCustomerByMainId")
public Result<?> queryOrderCustomerListByMainId(JeecgOrderCustomer jeecgOrderCustomer,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<JeecgOrderCustomer> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderCustomer, req.getParameterMap());
Page<JeecgOrderCustomer> page = new Page<JeecgOrderCustomer>(pageNo, pageSize);
IPage<JeecgOrderCustomer> pageList = jeecgOrderCustomerService.page(page, queryWrapper);
return Result.ok(pageList);
}
/**
* 通过id查询
*
* @param jeecgOrderTicket
* @return
*/
@GetMapping(value = "/listOrderTicketByMainId")
public Result<?> queryOrderTicketListByMainId(JeecgOrderTicket jeecgOrderTicket,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<JeecgOrderTicket> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderTicket, req.getParameterMap());
Page<JeecgOrderTicket> page = new Page<JeecgOrderTicket>(pageNo, pageSize);
IPage<JeecgOrderTicket> pageList = jeecgOrderTicketService.page(page, queryWrapper);
return Result.ok(pageList);
}
/**
* 添加
*
* @param jeecgOrderCustomer
* @return
*/
@PostMapping(value = "/addCustomer")
public Result<?> addCustomer(@RequestBody JeecgOrderCustomer jeecgOrderCustomer) {
jeecgOrderCustomerService.save(jeecgOrderCustomer);
return Result.ok("添加成功!");
}
/**
* 编辑
*
* @param jeecgOrderCustomer
* @return
*/
@RequestMapping(value = "/editCustomer", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<?> editCustomer(@RequestBody JeecgOrderCustomer jeecgOrderCustomer) {
jeecgOrderCustomerService.updateById(jeecgOrderCustomer);
return Result.ok("添加成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@DeleteMapping(value = "/deleteCustomer")
public Result<?> deleteCustomer(@RequestParam(name = "id", required = true) String id) {
jeecgOrderCustomerService.removeById(id);
return Result.ok("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@DeleteMapping(value = "/deleteBatchCustomer")
public Result<?> deleteBatchCustomer(@RequestParam(name = "ids", required = true) String ids) {
this.jeecgOrderCustomerService.removeByIds(Arrays.asList(ids.split(",")));
return Result.ok("批量删除成功!");
}
/**
* 添加
*
* @param jeecgOrderTicket
* @return
*/
@PostMapping(value = "/addTicket")
public Result<?> addTicket(@RequestBody JeecgOrderTicket jeecgOrderTicket) {
jeecgOrderTicketService.save(jeecgOrderTicket);
return Result.ok("添加成功!");
}
/**
* 编辑
*
* @param jeecgOrderTicket
* @return
*/
@RequestMapping(value = "/editTicket", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<?> editTicket(@RequestBody JeecgOrderTicket jeecgOrderTicket) {
jeecgOrderTicketService.updateById(jeecgOrderTicket);
return Result.ok("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@DeleteMapping(value = "/deleteTicket")
public Result<?> deleteTicket(@RequestParam(name = "id", required = true) String id) {
jeecgOrderTicketService.removeById(id);
return Result.ok("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@DeleteMapping(value = "/deleteBatchTicket")
public Result<?> deleteBatchTicket(@RequestParam(name = "ids", required = true) String ids) {
this.jeecgOrderTicketService.removeByIds(Arrays.asList(ids.split(",")));
return Result.ok("批量删除成功!");
}
}

View File

@ -0,0 +1,255 @@
package org.jeecg.modules.demo.test.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.test.entity.JeecgDemo;
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
import org.jeecg.modules.demo.test.entity.JeecgOrderMain;
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
import org.jeecg.modules.demo.test.service.IJeecgOrderCustomerService;
import org.jeecg.modules.demo.test.service.IJeecgOrderMainService;
import org.jeecg.modules.demo.test.service.IJeecgOrderTicketService;
import org.jeecg.modules.demo.test.vo.JeecgOrderMainPage;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
/**
* @Description: 一对多示例JEditableTable行编辑
* @Author: jeecg-boot
* @Date:2019-02-15
* @Version: V2.0
*/
@RestController
@RequestMapping("/test/jeecgOrderMain")
@Slf4j
public class JeecgOrderMainController extends JeecgController<JeecgOrderMain, IJeecgOrderMainService> {
@Autowired
private IJeecgOrderMainService jeecgOrderMainService;
@Autowired
private IJeecgOrderCustomerService jeecgOrderCustomerService;
@Autowired
private IJeecgOrderTicketService jeecgOrderTicketService;
/**
* 分页列表查询
*
* @param jeecgOrderMain
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/list")
public Result<?> queryPageList(JeecgOrderMain jeecgOrderMain, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<JeecgOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderMain, req.getParameterMap());
Page<JeecgOrderMain> page = new Page<JeecgOrderMain>(pageNo, pageSize);
IPage<JeecgOrderMain> pageList = jeecgOrderMainService.page(page, queryWrapper);
return Result.ok(pageList);
}
/**
* 添加
*
* @param jeecgOrderMainPage
* @return
*/
@PostMapping(value = "/add")
public Result<?> add(@RequestBody JeecgOrderMainPage jeecgOrderMainPage) {
JeecgOrderMain jeecgOrderMain = new JeecgOrderMain();
BeanUtils.copyProperties(jeecgOrderMainPage, jeecgOrderMain);
jeecgOrderMainService.saveMain(jeecgOrderMain, jeecgOrderMainPage.getJeecgOrderCustomerList(), jeecgOrderMainPage.getJeecgOrderTicketList());
return Result.ok("添加成功!");
}
/**
* 编辑
*
* @param jeecgOrderMainPage
* @return
*/
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<?> eidt(@RequestBody JeecgOrderMainPage jeecgOrderMainPage) {
JeecgOrderMain jeecgOrderMain = new JeecgOrderMain();
BeanUtils.copyProperties(jeecgOrderMainPage, jeecgOrderMain);
jeecgOrderMainService.updateCopyMain(jeecgOrderMain, jeecgOrderMainPage.getJeecgOrderCustomerList(), jeecgOrderMainPage.getJeecgOrderTicketList());
return Result.ok("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
jeecgOrderMainService.delMain(id);
return Result.ok("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.jeecgOrderMainService.delBatchMain(Arrays.asList(ids.split(",")));
return Result.ok("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
JeecgOrderMain jeecgOrderMain = jeecgOrderMainService.getById(id);
return Result.ok(jeecgOrderMain);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@GetMapping(value = "/queryOrderCustomerListByMainId")
public Result<?> queryOrderCustomerListByMainId(@RequestParam(name = "id", required = true) String id) {
List<JeecgOrderCustomer> jeecgOrderCustomerList = jeecgOrderCustomerService.selectCustomersByMainId(id);
return Result.ok(jeecgOrderCustomerList);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@GetMapping(value = "/queryOrderTicketListByMainId")
public Result<?> queryOrderTicketListByMainId(@RequestParam(name = "id", required = true) String id) {
List<JeecgOrderTicket> jeecgOrderTicketList = jeecgOrderTicketService.selectTicketsByMainId(id);
return Result.ok(jeecgOrderTicketList);
}
/**
* 导出excel
*
* @param request
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, JeecgOrderMain jeecgOrderMain) {
// Step.1 组装查询条件
QueryWrapper<JeecgOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeecgOrderMain, request.getParameterMap());
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
//获取当前用户
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<JeecgOrderMainPage> pageList = new ArrayList<JeecgOrderMainPage>();
List<JeecgOrderMain> jeecgOrderMainList = jeecgOrderMainService.list(queryWrapper);
for (JeecgOrderMain orderMain : jeecgOrderMainList) {
JeecgOrderMainPage vo = new JeecgOrderMainPage();
BeanUtils.copyProperties(orderMain, vo);
// 查询机票
List<JeecgOrderTicket> jeecgOrderTicketList = jeecgOrderTicketService.selectTicketsByMainId(orderMain.getId());
vo.setJeecgOrderTicketList(jeecgOrderTicketList);
// 查询客户
List<JeecgOrderCustomer> jeecgOrderCustomerList = jeecgOrderCustomerService.selectCustomersByMainId(orderMain.getId());
vo.setJeecgOrderCustomerList(jeecgOrderCustomerList);
pageList.add(vo);
}
// 导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "一对多订单示例");
// 注解对象Class
mv.addObject(NormalExcelConstants.CLASS, JeecgOrderMainPage.class);
// 自定义表格参数
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("自定义导出Excel内容标题", "导出人:" + sysUser.getRealname(), "自定义Sheet名字"));
// 导出数据列表
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 通过excel导入数据
*
* @param request
* @param
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
// 获取上传文件对象
MultipartFile file = entity.getValue();
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(2);
params.setNeedSave(true);
try {
List<JeecgOrderMainPage> list = ExcelImportUtil.importExcel(file.getInputStream(), JeecgOrderMainPage.class, params);
for (JeecgOrderMainPage page : list) {
JeecgOrderMain po = new JeecgOrderMain();
BeanUtils.copyProperties(page, po);
jeecgOrderMainService.saveMain(po, page.getJeecgOrderCustomerList(), page.getJeecgOrderTicketList());
}
return Result.ok("文件导入成功!");
} catch (Exception e) {
log.error(e.getMessage(), e);
return Result.error("文件导入失败:" + e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
return Result.error("文件导入失败!");
}
}

View File

@ -0,0 +1,245 @@
package org.jeecg.modules.demo.test.controller;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.test.entity.JoaDemo;
import org.jeecg.modules.demo.test.service.IJoaDemoService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
/**
* @Description: 流程测试
* @Author: jeecg-boot
* @Date: 2019-05-14
* @Version: V1.0
*/
@RestController
@RequestMapping("/test/joaDemo")
@Slf4j
public class JoaDemoController {
@Autowired
private IJoaDemoService joaDemoService;
/**
* 分页列表查询
* @param joaDemo
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/list")
public Result<IPage<JoaDemo>> queryPageList(JoaDemo joaDemo,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<JoaDemo>> result = new Result<IPage<JoaDemo>>();
QueryWrapper<JoaDemo> queryWrapper = QueryGenerator.initQueryWrapper(joaDemo, req.getParameterMap());
Page<JoaDemo> page = new Page<JoaDemo>(pageNo, pageSize);
IPage<JoaDemo> pageList = joaDemoService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* 添加
* @param joaDemo
* @return
*/
@PostMapping(value = "/add")
public Result<JoaDemo> add(@RequestBody JoaDemo joaDemo) {
Result<JoaDemo> result = new Result<JoaDemo>();
try {
joaDemoService.save(joaDemo);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
}
return result;
}
/**
* 编辑
* @param joaDemo
* @return
*/
@PutMapping(value = "/edit")
public Result<JoaDemo> edit(@RequestBody JoaDemo joaDemo) {
Result<JoaDemo> result = new Result<JoaDemo>();
JoaDemo joaDemoEntity = joaDemoService.getById(joaDemo.getId());
if(joaDemoEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = joaDemoService.updateById(joaDemo);
//TODO 返回false说明什么
if(ok) {
result.success("修改成功!");
}
}
return result;
}
/**
* 通过id删除
* @param id
* @return
*/
@DeleteMapping(value = "/delete")
public Result<JoaDemo> delete(@RequestParam(name="id",required=true) String id) {
Result<JoaDemo> result = new Result<JoaDemo>();
JoaDemo joaDemo = joaDemoService.getById(id);
if(joaDemo==null) {
result.error500("未找到对应实体");
}else {
boolean ok = joaDemoService.removeById(id);
if(ok) {
result.success("删除成功!");
}
}
return result;
}
/**
* 批量删除
* @param ids
* @return
*/
@DeleteMapping(value = "/deleteBatch")
public Result<JoaDemo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<JoaDemo> result = new Result<JoaDemo>();
if(ids==null || "".equals(ids.trim())) {
result.error500("参数不识别!");
}else {
this.joaDemoService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
/**
* 通过id查询
* @param id
* @return
*/
@GetMapping(value = "/queryById")
public Result<JoaDemo> queryById(@RequestParam(name="id",required=true) String id) {
Result<JoaDemo> result = new Result<JoaDemo>();
JoaDemo joaDemo = joaDemoService.getById(id);
if(joaDemo==null) {
result.error500("未找到对应实体");
}else {
result.setResult(joaDemo);
result.setSuccess(true);
}
return result;
}
/**
* 导出excel
*
* @param request
* @param response
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<JoaDemo> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (oConvertUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
JoaDemo joaDemo = JSON.parseObject(deString, JoaDemo.class);
queryWrapper = QueryGenerator.initQueryWrapper(joaDemo, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<JoaDemo> pageList = joaDemoService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "流程测试列表");
mv.addObject(NormalExcelConstants.CLASS, JoaDemo.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("流程测试列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
// 获取上传文件对象
MultipartFile file = entity.getValue();
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<JoaDemo> listJoaDemos = ExcelImportUtil.importExcel(file.getInputStream(), JoaDemo.class, params);
for (JoaDemo joaDemoExcel : listJoaDemos) {
joaDemoService.save(joaDemoExcel);
}
return Result.ok("文件导入成功!数据行数:" + listJoaDemos.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.ok("文件导入失败!");
}
}

View File

@ -0,0 +1,82 @@
package org.jeecg.modules.demo.test.entity;
import java.io.Serializable;
import org.jeecg.common.system.base.entity.JeecgEntity;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: jeecg 测试demo
* @Author: jeecg-boot
* @Date: 2018-12-29
* @Version:V1.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="测试DEMO对象", description="测试DEMO")
@TableName("demo")
public class JeecgDemo extends JeecgEntity implements Serializable {
private static final long serialVersionUID = 1L;
/** 姓名 */
@Excel(name="姓名",width=25)
@ApiModelProperty(value = "姓名")
private java.lang.String name;
/** 关键词 */
@ApiModelProperty(value = "关键词")
@Excel(name="关键词",width=15)
private java.lang.String keyWord;
/** 打卡时间 */
@ApiModelProperty(value = "打卡时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name="打卡时间",width=20,format="yyyy-MM-dd HH:mm:ss")
private java.util.Date punchTime;
/** 工资 */
@ApiModelProperty(value = "工资",example = "0")
@Excel(name="工资",width=15)
private java.math.BigDecimal salaryMoney;
/** 奖金 */
@ApiModelProperty(value = "奖金",example = "0")
@Excel(name="奖金",width=15)
private java.lang.Double bonusMoney;
/** 性别 {男:1,女:2} */
@ApiModelProperty(value = "性别")
@Excel(name = "性别", width = 15, dicCode = "sex")
private java.lang.String sex;
/** 年龄 */
@ApiModelProperty(value = "年龄",example = "0")
@Excel(name="年龄",width=15)
private java.lang.Integer age;
/** 生日 */
@ApiModelProperty(value = "生日")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name="生日",format="yyyy-MM-dd")
private java.util.Date birthday;
/** 邮箱 */
@ApiModelProperty(value = "邮箱")
@Excel(name="邮箱",width=30)
private java.lang.String email;
/** 个人简介 */
@ApiModelProperty(value = "个人简介")
private java.lang.String content;
/** 部门编码 */
@Excel(name="部门编码",width=25)
@ApiModelProperty(value = "部门编码")
private java.lang.String sysOrgCode;
@ApiModelProperty(value = "租户ID")
private java.lang.Integer tenantId;
}

View File

@ -0,0 +1,54 @@
package org.jeecg.modules.demo.test.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* @Description: 订单客户
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
@Data
@TableName("jeecg_order_customer")
public class JeecgOrderCustomer implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
private java.lang.String id;
/**客户名*/
@Excel(name="客户名字",width=15)
private java.lang.String name;
/**性别*/
private java.lang.String sex;
/**身份证号码*/
@Excel(name="身份证号码",width=15)
private java.lang.String idcard;
/**身份证扫描件*/
private java.lang.String idcardPic;
/**电话1*/
@Excel(name="电话",width=15)
private java.lang.String telphone;
/**外键*/
private java.lang.String orderId;
/**创建人*/
private java.lang.String createBy;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**修改人*/
private java.lang.String updateBy;
/**修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
}

View File

@ -0,0 +1,52 @@
package org.jeecg.modules.demo.test.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
/**
* @Description: 订单
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
@Data
@TableName("jeecg_order_main")
public class JeecgOrderMain implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
private java.lang.String id;
/**订单号*/
private java.lang.String orderCode;
/**订单类型*/
private java.lang.String ctype;
/**订单日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date orderDate;
/**订单金额*/
private java.lang.Double orderMoney;
/**订单备注*/
private java.lang.String content;
/**创建人*/
private java.lang.String createBy;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**修改人*/
private java.lang.String updateBy;
/**修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
private String bpmStatus;
}

View File

@ -0,0 +1,48 @@
package org.jeecg.modules.demo.test.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* @Description: 订单机票
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
@Data
@TableName("jeecg_order_ticket")
public class JeecgOrderTicket implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
private java.lang.String id;
/**航班号*/
@Excel(name="航班号",width=15)
private java.lang.String ticketCode;
/**航班时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Excel(name="航班时间",width=15,format = "yyyy-MM-dd")
private java.util.Date tickectDate;
/**外键*/
private java.lang.String orderId;
/**创建人*/
private java.lang.String createBy;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**修改人*/
private java.lang.String updateBy;
/**修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
}

View File

@ -0,0 +1,67 @@
package org.jeecg.modules.demo.test.entity;
import java.io.Serializable;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
* @Description: 流程测试
* @Author: jeecg-boot
* @Date: 2019-05-14
* @Version: V1.0
*/
@Data
@TableName("joa_demo")
public class JoaDemo implements Serializable {
private static final long serialVersionUID = 1L;
/**ID*/
@TableId(type = IdType.ASSIGN_ID)
private java.lang.String id;
/**请假人*/
@Excel(name = "请假人", width = 15)
private java.lang.String name;
/**请假天数*/
@Excel(name = "请假天数", width = 15)
private java.lang.Integer days;
/**开始时间*/
@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date beginDate;
/**请假结束时间*/
@Excel(name = "请假结束时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date endDate;
/**请假原因*/
@Excel(name = "请假原因", width = 15)
private java.lang.String reason;
/**流程状态*/
@Excel(name = "流程状态", width = 15)
private java.lang.String bpmStatus;
/**创建人id*/
@Excel(name = "创建人id", width = 15)
private java.lang.String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**修改时间*/
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
/**修改人id*/
@Excel(name = "修改人id", width = 15)
private java.lang.String updateBy;
}

View File

@ -0,0 +1,50 @@
package org.jeecg.modules.demo.test.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.test.entity.JeecgDemo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* @Description: jeecg 测试demo
* @Author: jeecg-boot
* @Date: 2018-12-29
* @Version: V1.0
*/
public interface JeecgDemoMapper extends BaseMapper<JeecgDemo> {
/**
* 根据姓名查询demo列表数据
* @param name 姓名
* @return demo集合
*/
public List<JeecgDemo> getDemoByName(@Param("name") String name);
/**
* 查询列表数据 直接传数据权限的sql进行数据过滤
* @param page
* @param permissionSql
* @return
*/
public IPage<JeecgDemo> queryListWithPermission(Page<JeecgDemo> page,@Param("permissionSql")String permissionSql);
/**
* 根据前缀获取所有有效权限
* @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);
}

View File

@ -0,0 +1,34 @@
package org.jeecg.modules.demo.test.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 订单客户
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
public interface JeecgOrderCustomerMapper extends BaseMapper<JeecgOrderCustomer> {
/**
* 通过主表外键批量删除客户
* @param mainId
* @return
*/
@Delete("DELETE FROM JEECG_ORDER_CUSTOMER WHERE ORDER_ID = #{mainId}")
public boolean deleteCustomersByMainId(String mainId);
/**
* 通过主表订单外键查询客户
* @param mainId 订单id
* @return 订单客户集合
*/
@Select("SELECT * FROM JEECG_ORDER_CUSTOMER WHERE ORDER_ID = #{mainId}")
public List<JeecgOrderCustomer> selectCustomersByMainId(String mainId);
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.test.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.test.entity.JeecgOrderMain;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 订单
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
public interface JeecgOrderMainMapper extends BaseMapper<JeecgOrderMain> {
}

View File

@ -0,0 +1,33 @@
package org.jeecg.modules.demo.test.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 订单机票
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
public interface JeecgOrderTicketMapper extends BaseMapper<JeecgOrderTicket> {
/**
* 通过主表外键批量删除客户
* @param mainId
* @return
*/
@Delete("DELETE FROM JEECG_ORDER_TICKET WHERE ORDER_ID = #{mainId}")
public boolean deleteTicketsByMainId(String mainId);
/**
* 通过主表订单外键查询订单机票
* @param mainId 订单id
* @return 返回订单机票集合
*/
@Select("SELECT * FROM JEECG_ORDER_TICKET WHERE ORDER_ID = #{mainId}")
public List<JeecgOrderTicket> selectTicketsByMainId(String mainId);
}

View File

@ -0,0 +1,15 @@
package org.jeecg.modules.demo.test.mapper;
import org.jeecg.modules.demo.test.entity.JoaDemo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 流程测试
* @Author: jeecg-boot
* @Date: 2019-05-14
* @Version: V1.0
*/
public interface JoaDemoMapper extends BaseMapper<JoaDemo> {
}

View File

@ -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="org.jeecg.modules.demo.test.mapper.JeecgDemoMapper">
<!-- 根据用户名查询 -->
<select id="getDemoByName" resultType="org.jeecg.modules.demo.test.entity.JeecgDemo">
select * from demo where name = #{name}
</select>
<!-- 根据权限sql查询数据集 -->
<select id="queryListWithPermission" parameterType="Object" resultType="org.jeecg.modules.demo.test.entity.JeecgDemo">
select * from demo where 1=1 ${permissionSql}
</select>
<!-- 查询所有符合前缀且有效字段 -->
<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>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.test.mapper.JeecgOrderCustomerMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.test.mapper.JeecgOrderMainMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.test.mapper.JeecgOrderTicketMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.test.mapper.JoaDemoMapper">
</mapper>

View File

@ -0,0 +1,41 @@
package org.jeecg.modules.demo.test.service;
import org.jeecg.common.system.base.service.JeecgService;
import org.jeecg.modules.demo.test.entity.JeecgDemo;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
* @Description: jeecg 测试demo
* @Author: jeecg-boot
* @Date: 2018-12-29
* @Version: V1.0
*/
public interface IJeecgDemoService extends JeecgService<JeecgDemo> {
/**
* 测试事务
*/
public void testTran();
/**
* 通过id过去demo数据先读缓存在读数据库
* @param id 数据库id
* @return demo对象
*/
public JeecgDemo getByIdCacheable(String id);
/**
* 查询列表数据 在service中获取数据权限sql信息
* @param pageSize
* @param pageNo
* @return
*/
IPage<JeecgDemo> queryListWithPermission(int pageSize,int pageNo);
/**
* 根据用户权限获取导出字段
* @return
*/
String getExportFields();
}

View File

@ -0,0 +1,28 @@
package org.jeecg.modules.demo.test.service;
import org.jeecg.common.system.base.service.JeecgService;
import org.jeecg.modules.demo.test.entity.JeecgDemo;
import java.util.List;
/**
* @Description: 动态数据源测试
* @Author: zyf
* @Date:2020-04-21
*/
public interface IJeecgDynamicDataService extends JeecgService<JeecgDemo> {
/**
* 测试从header获取数据源
* @return
*/
public List<JeecgDemo> selectSpelByHeader();
/**
* 使用spel从参数获取
* @param dsName
* @return
*/
public List<JeecgDemo> selectSpelByKey(String dsName);
}

View File

@ -0,0 +1,23 @@
package org.jeecg.modules.demo.test.service;
import java.util.List;
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 订单客户
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
public interface IJeecgOrderCustomerService extends IService<JeecgOrderCustomer> {
/**
* 根据订单id获取订单客户数据
* @param mainId 订单id
* @return 订单顾客集合
*/
public List<JeecgOrderCustomer> selectCustomersByMainId(String mainId);
}

View File

@ -0,0 +1,56 @@
package org.jeecg.modules.demo.test.service;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
import org.jeecg.modules.demo.test.entity.JeecgOrderMain;
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 订单
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
public interface IJeecgOrderMainService extends IService<JeecgOrderMain> {
/**
* 添加一对多
* @param jeecgOrderMain 订单实体类
* @param jeecgOrderCustomerList 订单客户集合
* @param jeecgOrderTicketList 订单机票集合
*/
public void saveMain(JeecgOrderMain jeecgOrderMain,List<JeecgOrderCustomer> jeecgOrderCustomerList,List<JeecgOrderTicket> jeecgOrderTicketList) ;
/**
* 修改一对多
* @param jeecgOrderMain 订单实体类
* @param jeecgOrderCustomerList 订单客户集合
* @param jeecgOrderTicketList 订单机票集合
*/
public void updateMain(JeecgOrderMain jeecgOrderMain,List<JeecgOrderCustomer> jeecgOrderCustomerList,List<JeecgOrderTicket> jeecgOrderTicketList);
/**
* 删除一对多
* @param id 订单id
*/
public void delMain (String id);
/**
* 批量删除一对多
* @param idList 订单id集合
*/
public void delBatchMain (Collection<? extends Serializable> idList);
/**
* 修改一对多
* @param jeecgOrderMain 订单实体类
* @param jeecgOrderCustomerList 订单客户集合
* @param jeecgOrderTicketList 订单机票集合
*/
public void updateCopyMain(JeecgOrderMain jeecgOrderMain, List<JeecgOrderCustomer> jeecgOrderCustomerList, List<JeecgOrderTicket> jeecgOrderTicketList);
}

View File

@ -0,0 +1,23 @@
package org.jeecg.modules.demo.test.service;
import java.util.List;
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 订单机票
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
public interface IJeecgOrderTicketService extends IService<JeecgOrderTicket> {
/**
* 通过订单id查询订单机票
* @param mainId 订单id
* @return 订单机票集合
*/
public List<JeecgOrderTicket> selectTicketsByMainId(String mainId);
}

View File

@ -0,0 +1,15 @@
package org.jeecg.modules.demo.test.service;
import org.jeecg.modules.demo.test.entity.JoaDemo;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 流程测试
* @Author: jeecg-boot
* @Date: 2019-05-14
* @Version: V1.0
*/
public interface IJoaDemoService extends IService<JoaDemo> {
}

View File

@ -0,0 +1,111 @@
package org.jeecg.modules.demo.test.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.constant.CacheConstant;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.demo.test.entity.JeecgDemo;
import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @Description: jeecg 测试demo
* @Author: jeecg-boot
* @Date: 2018-12-29
* @Version: V1.0
*/
@Service
public class JeecgDemoServiceImpl extends ServiceImpl<JeecgDemoMapper, JeecgDemo> implements IJeecgDemoService {
@Autowired
JeecgDemoMapper jeecgDemoMapper;
/**
* 事务控制在service层面
* 加上注解:@Transactional声明的方法就是一个独立的事务有异常DB操作全部回滚
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void testTran() {
JeecgDemo pp = new JeecgDemo();
pp.setAge(1111);
pp.setName("测试事务 小白兔 1");
jeecgDemoMapper.insert(pp);
JeecgDemo pp2 = new JeecgDemo();
pp2.setAge(2222);
pp2.setName("测试事务 小白兔 2");
jeecgDemoMapper.insert(pp2);
//自定义异常
Integer.parseInt("hello");
JeecgDemo pp3 = new JeecgDemo();
pp3.setAge(3333);
pp3.setName("测试事务 小白兔 3");
jeecgDemoMapper.insert(pp3);
return ;
}
/**
* 缓存注解测试: redis
*/
@Override
@Cacheable(cacheNames = CacheConstant.TEST_DEMO_CACHE, key = "#id")
public JeecgDemo getByIdCacheable(String id) {
JeecgDemo t = jeecgDemoMapper.selectById(id);
System.err.println("---未读缓存,读取数据库---");
System.err.println(t);
return t;
}
@Override
public IPage<JeecgDemo> queryListWithPermission(int pageSize,int pageNo) {
Page<JeecgDemo> page = new Page<>(pageNo, pageSize);
//编程方式获取当前请求的数据权限规则SQL片段
String sql = QueryGenerator.installAuthJdbc(JeecgDemo.class);
return this.baseMapper.queryListWithPermission(page, sql);
}
@Override
public String getExportFields() {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//权限配置列导出示例
//1.配置前缀与菜单中配置的列前缀一致
List<String> noAuthList = new ArrayList<>();
List<String> exportFieldsList = new ArrayList<>();
String permsPrefix = "testdemo:";
//查询配置菜单有效字段
List<String> allAuth = this.jeecgDemoMapper.queryAllAuth(permsPrefix);
//查询已授权字段
List<String> userAuth = this.jeecgDemoMapper.queryUserAuth(sysUser.getId(),permsPrefix);
//列出未授权字段
for(String perms : allAuth){
if(!userAuth.contains(perms)){
noAuthList.add(perms.substring(permsPrefix.length()));
}
}
//实体类中字段与未授权字段比较,列出需导出字段
Field[] fileds = JeecgDemo.class.getDeclaredFields();
List<Field> list = new ArrayList(Arrays.asList(fileds));
for(Field field : list){
if(!noAuthList.contains(field.getName())){
exportFieldsList.add(field.getName());
}
}
return exportFieldsList != null && exportFieldsList.size()>0 ? String.join(",", exportFieldsList) : "";
}
}

View File

@ -0,0 +1,28 @@
package org.jeecg.modules.demo.test.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.demo.test.entity.JeecgDemo;
import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
import org.jeecg.modules.demo.test.service.IJeecgDynamicDataService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description: 动态数据源测试
* @Author: zyf
* @Date:2020-04-21
*/
@Service
public class JeecgDynamicDataServiceImpl extends ServiceImpl<JeecgDemoMapper, JeecgDemo> implements IJeecgDynamicDataService {
@Override
public List<JeecgDemo> selectSpelByHeader() {
return list();
}
@Override
public List<JeecgDemo> selectSpelByKey(String dsName) {
return list();
}
}

View File

@ -0,0 +1,30 @@
package org.jeecg.modules.demo.test.service.impl;
import java.util.List;
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
import org.jeecg.modules.demo.test.mapper.JeecgOrderCustomerMapper;
import org.jeecg.modules.demo.test.service.IJeecgOrderCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 订单客户
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
@Service
public class JeecgOrderCustomerServiceImpl extends ServiceImpl<JeecgOrderCustomerMapper, JeecgOrderCustomer> implements IJeecgOrderCustomerService {
@Autowired
private JeecgOrderCustomerMapper jeecgOrderCustomerMapper;
@Override
public List<JeecgOrderCustomer> selectCustomersByMainId(String mainId) {
return jeecgOrderCustomerMapper.selectCustomersByMainId(mainId);
}
}

View File

@ -0,0 +1,162 @@
package org.jeecg.modules.demo.test.service.impl;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
import org.jeecg.modules.demo.test.entity.JeecgOrderMain;
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
import org.jeecg.modules.demo.test.mapper.JeecgOrderCustomerMapper;
import org.jeecg.modules.demo.test.mapper.JeecgOrderMainMapper;
import org.jeecg.modules.demo.test.mapper.JeecgOrderTicketMapper;
import org.jeecg.modules.demo.test.service.IJeecgOrderMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 订单
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
@Service
public class JeecgOrderMainServiceImpl extends ServiceImpl<JeecgOrderMainMapper, JeecgOrderMain> implements IJeecgOrderMainService {
@Autowired
private JeecgOrderMainMapper jeecgOrderMainMapper;
@Autowired
private JeecgOrderCustomerMapper jeecgOrderCustomerMapper;
@Autowired
private JeecgOrderTicketMapper jeecgOrderTicketMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public void saveMain(JeecgOrderMain jeecgOrderMain, List<JeecgOrderCustomer> jeecgOrderCustomerList, List<JeecgOrderTicket> jeecgOrderTicketList) {
jeecgOrderMainMapper.insert(jeecgOrderMain);
if (jeecgOrderCustomerList != null) {
for (JeecgOrderCustomer entity : jeecgOrderCustomerList) {
entity.setOrderId(jeecgOrderMain.getId());
jeecgOrderCustomerMapper.insert(entity);
}
}
if (jeecgOrderTicketList != null) {
for (JeecgOrderTicket entity : jeecgOrderTicketList) {
entity.setOrderId(jeecgOrderMain.getId());
jeecgOrderTicketMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMain(JeecgOrderMain jeecgOrderMain, List<JeecgOrderCustomer> jeecgOrderCustomerList, List<JeecgOrderTicket> jeecgOrderTicketList) {
jeecgOrderMainMapper.updateById(jeecgOrderMain);
//1.先删除子表数据
jeecgOrderTicketMapper.deleteTicketsByMainId(jeecgOrderMain.getId());
jeecgOrderCustomerMapper.deleteCustomersByMainId(jeecgOrderMain.getId());
//2.子表数据重新插入
if (jeecgOrderCustomerList != null) {
for (JeecgOrderCustomer entity : jeecgOrderCustomerList) {
entity.setOrderId(jeecgOrderMain.getId());
jeecgOrderCustomerMapper.insert(entity);
}
}
if (jeecgOrderTicketList != null) {
for (JeecgOrderTicket entity : jeecgOrderTicketList) {
entity.setOrderId(jeecgOrderMain.getId());
jeecgOrderTicketMapper.insert(entity);
}
}
}
/**
* 一对多维护逻辑改造 LOWCOD-315
* @param jeecgOrderMain
* @param jeecgOrderCustomerList
* @param jeecgOrderTicketList
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateCopyMain(JeecgOrderMain jeecgOrderMain, List<JeecgOrderCustomer> jeecgOrderCustomerList, List<JeecgOrderTicket> jeecgOrderTicketList) {
jeecgOrderMainMapper.updateById(jeecgOrderMain);
// 循环前台传过来的数据
for (JeecgOrderTicket ticket:jeecgOrderTicketList){
// 先查询子表数据库
JeecgOrderTicket orderTicket = jeecgOrderTicketMapper.selectById(ticket.getId());
if(orderTicket == null){
// 当传过来的id数据库不存在时说明数据库没有走新增逻辑
ticket.setOrderId(jeecgOrderMain.getId());
jeecgOrderTicketMapper.insert(ticket);
break;
}
if(orderTicket.getId().equals(ticket.getId())){
// 传过来的id和数据库id一至时说明数据库存在该数据走更新逻辑
jeecgOrderTicketMapper.updateById(ticket);
}
}
for (JeecgOrderCustomer customer:jeecgOrderCustomerList){
// 先查询子表数据库
JeecgOrderCustomer customers = jeecgOrderCustomerMapper.selectById(customer.getId());
if(customers == null){
// 当传过来的id数据库不存在时说明数据库没有走新增逻辑
customer.setOrderId(jeecgOrderMain.getId());
jeecgOrderCustomerMapper.insert(customer);
break;
}
if(customers.getId().equals(customer.getId())){
//TODO 传过来的id和数据库id一至时说明数据库存在该数据走更新逻辑
jeecgOrderCustomerMapper.updateById(customer);
}
}
// 当跟新和删除之后取差集, 当传过来的id不存在而数据库存在时说明已删除走删除逻辑
List<JeecgOrderTicket> jeecgOrderTickets = jeecgOrderTicketMapper.selectTicketsByMainId(jeecgOrderMain.getId());
List<JeecgOrderTicket> collect = jeecgOrderTickets.stream()
.filter(item -> !jeecgOrderTicketList.stream()
.map(e -> e.getId())
.collect(Collectors.toList())
.contains(item.getId()))
.collect(Collectors.toList());
// for循环删除id
for (JeecgOrderTicket ticket:collect){
jeecgOrderTicketMapper.deleteById(ticket.getId());
}
List<JeecgOrderCustomer> jeecgOrderCustomers = jeecgOrderCustomerMapper.selectCustomersByMainId(jeecgOrderMain.getId());
List<JeecgOrderCustomer> customersCollect = jeecgOrderCustomers.stream()
.filter(item -> !jeecgOrderCustomerList.stream()
.map(e -> e.getId())
.collect(Collectors.toList())
.contains(item.getId()))
.collect(Collectors.toList());
//TODO for循环删除id
for (JeecgOrderCustomer c:customersCollect){
jeecgOrderCustomerMapper.deleteById(c.getId());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delMain(String id) {
jeecgOrderMainMapper.deleteById(id);
jeecgOrderTicketMapper.deleteTicketsByMainId(id);
jeecgOrderCustomerMapper.deleteCustomersByMainId(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delBatchMain(Collection<? extends Serializable> idList) {
for(Serializable id:idList) {
jeecgOrderMainMapper.deleteById(id);
jeecgOrderTicketMapper.deleteTicketsByMainId(id.toString());
jeecgOrderCustomerMapper.deleteCustomersByMainId(id.toString());
}
}
}

View File

@ -0,0 +1,29 @@
package org.jeecg.modules.demo.test.service.impl;
import java.util.List;
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
import org.jeecg.modules.demo.test.mapper.JeecgOrderTicketMapper;
import org.jeecg.modules.demo.test.service.IJeecgOrderTicketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 订单机票
* @Author: jeecg-boot
* @Date: 2019-02-15
* @Version: V1.0
*/
@Service
public class JeecgOrderTicketServiceImpl extends ServiceImpl<JeecgOrderTicketMapper, JeecgOrderTicket> implements IJeecgOrderTicketService {
@Autowired
private JeecgOrderTicketMapper jeecgOrderTicketMapper;
@Override
public List<JeecgOrderTicket> selectTicketsByMainId(String mainId) {
return jeecgOrderTicketMapper.selectTicketsByMainId(mainId);
}
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.test.service.impl;
import org.jeecg.modules.demo.test.entity.JoaDemo;
import org.jeecg.modules.demo.test.mapper.JoaDemoMapper;
import org.jeecg.modules.demo.test.service.IJoaDemoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 流程测试
* @Author: jeecg-boot
* @Date: 2019-05-14
* @Version: V1.0
*/
@Service
public class JoaDemoServiceImpl extends ServiceImpl<JoaDemoMapper, JoaDemo> implements IJoaDemoService {
}

View File

@ -0,0 +1,50 @@
package org.jeecg.modules.demo.test.vo;
import java.util.List;
import org.jeecg.modules.demo.test.entity.JeecgOrderCustomer;
import org.jeecg.modules.demo.test.entity.JeecgOrderTicket;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import lombok.Data;
/**
* @Description: 一对多示例
* @author: jeecg-boot
*/
@Data
public class JeecgOrderMainPage {
/**主键*/
private java.lang.String id;
/**订单号*/
@Excel(name="订单号",width=15)
private java.lang.String orderCode;
/**订单类型*/
private java.lang.String ctype;
/**订单日期*/
@Excel(name="订单日期",width=15,format = "yyyy-MM-dd")
private java.util.Date orderDate;
/**订单金额*/
@Excel(name="订单金额",width=15)
private java.lang.Double orderMoney;
/**订单备注*/
private java.lang.String content;
/**创建人*/
private java.lang.String createBy;
/**创建时间*/
private java.util.Date createTime;
/**修改人*/
private java.lang.String updateBy;
/**修改时间*/
private java.util.Date updateTime;
@ExcelCollection(name="客户")
private List<JeecgOrderCustomer> jeecgOrderCustomerList;
@ExcelCollection(name="机票")
private List<JeecgOrderTicket> jeecgOrderTicketList;
private String bpmStatus;
}

View File

@ -0,0 +1,74 @@
//
//package org.jeecg.modules.demo.xxljob;
//
//import com.xxl.job.core.biz.model.ReturnT;
//import com.xxl.job.core.handler.annotation.XxlJob;
//import lombok.extern.slf4j.Slf4j;
//import org.jeecg.common.config.mqtoken.UserTokenContext;
//import org.jeecg.common.constant.CommonConstant;
//import org.jeecg.common.system.api.ISysBaseAPI;
//import org.jeecg.common.system.util.JwtUtil;
//import org.jeecg.common.util.RedisUtil;
//import org.jeecg.common.util.SpringContextUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//
///**
// * xxl-job定时任务测试
// */
//@Component
//@Slf4j
//public class TestJobHandler {
// @Autowired
// ISysBaseAPI sysBaseApi;
//
// /**
// * 简单任务
// *
// * 测试无token调用feign接口
// *
// * @param params
// * @return
// */
//
// @XxlJob(value = "testJob")
// public ReturnT<String> demoJobHandler(String params) {
// //1.生成临时令牌Token到线程中
// UserTokenContext.setToken(getTemporaryToken());
//
// log.info("我是 jeecg-demo 服务里的定时任务 testJob , 我执行了...............................");
// log.info("我调用 jeecg-system 服务的字典接口:{}",sysBaseApi.queryAllDict());
// //。。。此处可以写多个feign接口调用
//
// //2.使用完删除临时令牌Token
// UserTokenContext.remove();
// return ReturnT.SUCCESS;
// }
//
// public void init() {
// log.info("init");
// }
//
// public void destroy() {
// log.info("destory");
// }
//
// /**
// * 获取临时令牌
// *
// * 模拟登陆接口,获取模拟 Token
// * @return
// */
// public static String getTemporaryToken() {
// RedisUtil redisUtil = SpringContextUtils.getBean(RedisUtil.class);
// // 模拟登录生成Token
// String token = JwtUtil.sign("??", "??");
// // 设置Token缓存有效时间为 5 分钟
// redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
// redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 5 * 60 * 1000);
// return token;
// }
//
//}
//

View File

@ -0,0 +1,412 @@
package org.jeecg.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 lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.MatchTypeEnum;
import org.jeecg.common.system.query.QueryCondition;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.constant.VxeSocketConst;
import org.jeecg.modules.demo.mock.vxe.websocket.VxeSocket;
import org.jeecg.modules.dlglong.entity.MockEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLDecoder;
import java.util.*;
/**
* @Description: DlMockController
* @author: jeecg-boot
*/
@Slf4j
@RestController
@RequestMapping("/mock/dlglong")
public class DlMockController {
/**
* 模拟更改状态
*
* @param id
* @param status
* @return
*/
@GetMapping("/change1")
public Result mockChange1(@RequestParam("id") String id, @RequestParam("status") String status) {
/* id 为 行的idrowId只要获取到rowId那么只需要调用 VXESocket.sendMessageToAll() 即可 */
// 封装行数据
JSONObject rowData = new JSONObject();
// 这个字段就是要更改的行数据ID
rowData.put("id", id);
// 这个字段就是要更改的列的key和具体的值
rowData.put("status", status);
// 模拟更改数据
this.mockChange(rowData);
return Result.ok();
}
/**
* 模拟更改拖轮状态
*
* @param id
* @param tugStatus
* @return
*/
@GetMapping("/change2")
public Result mockChange2(@RequestParam("id") String id, @RequestParam("tug_status") String tugStatus) {
/* id 为 行的idrowId只要获取到rowId那么只需要调用 VXESocket.sendMessageToAll() 即可 */
// 封装行数据
JSONObject rowData = new JSONObject();
// 这个字段就是要更改的行数据ID
rowData.put("id", id);
// 这个字段就是要更改的列的key和具体的值
JSONObject status = JSON.parseObject(tugStatus);
rowData.put("tug_status", status);
// 模拟更改数据
this.mockChange(rowData);
return Result.ok();
}
/**
* 模拟更改进度条状态
*
* @param id
* @param progress
* @return
*/
@GetMapping("/change3")
public Result mockChange3(@RequestParam("id") String id, @RequestParam("progress") String progress) {
/* id 为 行的idrowId只要获取到rowId那么只需要调用 VXESocket.sendMessageToAll() 即可 */
// 封装行数据
JSONObject rowData = new JSONObject();
// 这个字段就是要更改的行数据ID
rowData.put("id", id);
// 这个字段就是要更改的列的key和具体的值
rowData.put("progress", progress);
// 模拟更改数据
this.mockChange(rowData);
return Result.ok();
}
private void mockChange(JSONObject rowData) {
// 封装socket数据
JSONObject socketData = new JSONObject();
// 这里的 socketKey 必须要和调度计划页面上写的 socketKey 属性保持一致
socketData.put("socketKey", "page-dispatch");
// 这里的 args 必须得是一个数组下标0是行数据下标1是caseId一般不用传
socketData.put("args", new Object[]{rowData, ""});
// 封装消息字符串,这里的 type 必须是 VXESocketConst.TYPE_UVT
String message = VxeSocket.packageMessage(VxeSocketConst.TYPE_UVT, socketData);
// 调用 sendMessageToAll 发送给所有在线的用户
VxeSocket.sendMessageToAll(message);
}
/**
* 模拟更改【大船待审】状态
*
* @param status
* @return
*/
@GetMapping("/change4")
public Result mockChange4(@RequestParam("status") String status) {
// 封装socket数据
JSONObject socketData = new JSONObject();
// 这里的 key 是前端注册时使用的key必须保持一致
socketData.put("key", "dispatch-dcds-status");
// 这里的 args 必须得是一个数组,每一位都是注册方法的参数,按顺序传递
socketData.put("args", new Object[]{status});
// 封装消息字符串,这里的 type 必须是 VXESocketConst.TYPE_UVT
String message = VxeSocket.packageMessage(VxeSocketConst.TYPE_CSD, socketData);
// 调用 sendMessageToAll 发送给所有在线的用户
VxeSocket.sendMessageToAll(message);
return Result.ok();
}
/**
* 【模拟】即时保存单行数据
*
* @param rowData 行数据,实际使用时可以替换成一个实体类
*/
@PutMapping("/immediateSaveRow")
public Result mockImmediateSaveRow(@RequestBody JSONObject rowData) throws Exception {
System.out.println("即时保存.rowData" + rowData.toJSONString());
// 延时1.5秒,模拟网慢堵塞真实感
Thread.sleep(500);
return Result.ok();
}
/**
* 【模拟】即时保存整个表格的数据
*
* @param tableData 表格数据实际使用时可以替换成一个List实体类
*/
@PostMapping("/immediateSaveAll")
public Result mockImmediateSaveAll(@RequestBody JSONArray tableData) throws Exception {
// 【注】:
// 1、tableData里包含该页所有的数据
// 2、如果你实现了“即时保存”那么除了新增的数据其他的都是已经保存过的了
// 不需要再进行一次update操作了所以可以在前端传数据的时候就遍历判断一下
// 只传新增的数据给后台insert即可否者将会造成性能上的浪费。
// 3、新增的行是没有id的通过这一点就可以判断是否是新增的数据
System.out.println("即时保存.tableData" + tableData.toJSONString());
// 延时1.5秒,模拟网慢堵塞真实感
Thread.sleep(1000);
return Result.ok();
}
/**
* 获取模拟数据
*
* @param pageNo 页码
* @param pageSize 页大小
* @param parentId 父ID不传则查询顶级
* @return
*/
@GetMapping("/getData")
public Result getMockData(
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
// 父级id根据父级id查询子级如果为空则查询顶级
@RequestParam(name = "parentId", required = false) String parentId
) {
// 模拟JSON数据路径
String path = "classpath:org/jeecg/modules/dlglong/json/dlglong.json";
// 读取JSON数据
JSONArray dataList = readJsonData(path);
if (dataList == null) {
return Result.error("读取数据失败!");
}
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
return Result.ok(page);
}
/**
* 获取模拟“调度计划”页面的数据
*
* @param pageNo 页码
* @param pageSize 页大小
* @param parentId 父ID不传则查询顶级
* @return
*/
@GetMapping("/getDdjhData")
public Result getMockDdjhData(
// SpringMVC 会自动将参数注入到实体里
MockEntity mockEntity,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
// 父级id根据父级id查询子级如果为空则查询顶级
@RequestParam(name = "parentId", required = false) String parentId,
@RequestParam(name = "status", required = false) String status,
// 高级查询条件
@RequestParam(name = "superQueryParams", required = false) String superQueryParams,
// 高级查询模式
@RequestParam(name = "superQueryMatchType", required = false) String superQueryMatchType,
HttpServletRequest request
) {
// 获取查询条件(前台传递的查询参数)
Map<String, String[]> parameterMap = request.getParameterMap();
// 遍历输出到控制台
System.out.println("\ngetDdjhData - 普通查询条件:");
for (String key : parameterMap.keySet()) {
System.out.println("-- " + key + ": " + JSON.toJSONString(parameterMap.get(key)));
}
// 输出高级查询
try {
System.out.println("\ngetDdjhData - 高级查询条件:");
// 高级查询模式
MatchTypeEnum matchType = MatchTypeEnum.getByValue(superQueryMatchType);
if (matchType == null) {
System.out.println("-- 高级查询模式:不识别(" + superQueryMatchType + "");
} else {
System.out.println("-- 高级查询模式:" + matchType.getValue());
}
superQueryParams = URLDecoder.decode(superQueryParams, "UTF-8");
List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class);
if (conditions != null) {
for (QueryCondition condition : conditions) {
System.out.println("-- " + JSON.toJSONString(condition));
}
} else {
System.out.println("-- 没有传递任何高级查询条件");
}
System.out.println();
} catch (Exception e) {
log.error("-- 高级查询操作失败:" + superQueryParams, e);
e.printStackTrace();
}
/* 注:实际使用中不用写上面那种繁琐的代码,这里只是为了直观的输出到控制台里而写的示例,
使用下面这种写法更简洁方便 */
// 封装成 MyBatisPlus 能识别的 QueryWrapper可以直接使用这个对象进行SQL筛选条件拼接
// 这个方法也会自动封装高级查询条件但是高级查询参数名必须是superQueryParams和superQueryMatchType
QueryWrapper<MockEntity> queryWrapper = QueryGenerator.initQueryWrapper(mockEntity, parameterMap);
System.out.println("queryWrapper " + queryWrapper.getCustomSqlSegment());
// 模拟JSON数据路径
String path = "classpath:org/jeecg/modules/dlglong/json/ddjh.json";
String statusValue = "8";
if (statusValue.equals(status)) {
path = "classpath:org/jeecg/modules/dlglong/json/ddjh_s8.json";
}
// 读取JSON数据
JSONArray dataList = readJsonData(path);
if (dataList == null) {
return Result.error("读取数据失败!");
}
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
// 逐行查询子表数据,用于计算拖轮状态
List<JSONObject> records = page.getRecords();
for (JSONObject record : records) {
Map<String, Integer> tugStatusMap = new HashMap<>(5);
String id = record.getString("id");
// 查询出主表的拖轮
String tugMain = record.getString("tug");
// 判断是否有值
if (StringUtils.isNotBlank(tugMain)) {
// 拖轮根据分号分割
String[] tugs = tugMain.split(";");
// 查询子表数据
List<JSONObject> subRecords = this.queryDataPage(dataList, id, null, null).getRecords();
// 遍历子表和拖轮数据,找出进行计算反推拖轮状态
for (JSONObject subData : subRecords) {
String subTug = subData.getString("tug");
if (StringUtils.isNotBlank(subTug)) {
for (String tug : tugs) {
if (tug.equals(subTug)) {
// 计算拖轮状态逻辑
int statusCode = 0;
/* 如果有发船时间、作业开始时间、作业结束时间、回船时间,则主表中的拖轮列中的每个拖轮背景色要即时变色 */
// 有发船时间,状态 +1
String departureTime = subData.getString("departure_time");
if (StringUtils.isNotBlank(departureTime)) {
statusCode += 1;
}
// 有作业开始时间,状态 +1
String workBeginTime = subData.getString("work_begin_time");
if (StringUtils.isNotBlank(workBeginTime)) {
statusCode += 1;
}
// 有作业结束时间,状态 +1
String workEndTime = subData.getString("work_end_time");
if (StringUtils.isNotBlank(workEndTime)) {
statusCode += 1;
}
// 有回船时间,状态 +1
String returnTime = subData.getString("return_time");
if (StringUtils.isNotBlank(returnTime)) {
statusCode += 1;
}
// 保存拖轮状态key是拖轮的值value是状态前端根据不同的状态码显示不同的颜色这个颜色也可以后台计算完之后返回给前端直接使用
tugStatusMap.put(tug, statusCode);
break;
}
}
}
}
}
// 新加一个字段用于保存拖轮状态,不要直接覆盖原来的,这个字段可以不保存到数据库里
record.put("tug_status", tugStatusMap);
}
page.setRecords(records);
return Result.ok(page);
}
/**
* 模拟查询数据可以根据父ID查询可以分页
*
* @param dataList 数据列表
* @param parentId 父ID
* @param pageNo 页码
* @param pageSize 页大小
* @return
*/
private IPage<JSONObject> queryDataPage(JSONArray dataList, String parentId, Integer pageNo, Integer pageSize) {
// 根据父级id查询子级
JSONArray dataDb = dataList;
if (StringUtils.isNotBlank(parentId)) {
JSONArray results = new JSONArray();
List<String> parentIds = Arrays.asList(parentId.split(","));
this.queryByParentId(dataDb, parentIds, results);
dataDb = results;
}
// 模拟分页实际中应用SQL自带的分页
List<JSONObject> records = new ArrayList<>();
IPage<JSONObject> page;
long beginIndex, endIndex;
// 如果任意一个参数为null则不分页
if (pageNo == null || pageSize == null) {
page = new Page<>(0, dataDb.size());
beginIndex = 0;
endIndex = dataDb.size();
} else {
page = new Page<>(pageNo, pageSize);
beginIndex = page.offset();
endIndex = page.offset() + page.getSize();
}
for (long i = beginIndex; (i < endIndex && i < dataDb.size()); i++) {
JSONObject data = dataDb.getJSONObject((int) i);
data = JSON.parseObject(data.toJSONString());
// 不返回 children
data.remove("children");
records.add(data);
}
page.setRecords(records);
page.setTotal(dataDb.size());
return page;
}
private void queryByParentId(JSONArray dataList, List<String> parentIds, JSONArray results) {
for (int i = 0; i < dataList.size(); i++) {
JSONObject data = dataList.getJSONObject(i);
JSONArray children = data.getJSONArray("children");
// 找到了该父级
if (parentIds.contains(data.getString("id"))) {
if (children != null) {
// addAll 的目的是将多个子表的数据合并在一起
results.addAll(children);
}
} else {
if (children != null) {
queryByParentId(children, parentIds, results);
}
}
}
results.addAll(new JSONArray());
}
private JSONArray readJsonData(String path) {
try {
InputStream stream = getClass().getClassLoader().getResourceAsStream(path.replace("classpath:", ""));
if (stream != null) {
String json = IOUtils.toString(stream, "UTF-8");
return JSON.parseArray(json);
}
} catch (IOException e) {
log.error(e.getMessage(), e);
}
return null;
}
}

View File

@ -0,0 +1,27 @@
package org.jeecg.modules.dlglong.entity;
import lombok.Data;
/**
* 模拟实体
* @author: jeecg-boot
*/
@Data
public class MockEntity {
/**
* id
*/
private String id;
/**
* 父级ID
*/
private String parentId;
/**
* 状态
*/
private String status;
/* -- 省略其他字段 -- */
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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;}

View File

@ -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;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

View File

@ -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);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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]
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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();
});

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Some files were not shown because too many files have changed in this diff Show More