Commit 44ab1569 authored by Sun's avatar Sun
Browse files

no commit message

parent f0b37245
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.entity.onetomany;
import com.jeespring.modules.sys.entity.Area;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jeespring.common.persistence.AbstractBaseEntity;
import com.jeespring.common.utils.excel.annotation.ExcelField;
import com.jeespring.modules.sys.utils.DictUtils;
/**
* 订票Entity
* @author JeeSpring
* @version 2018-10-12
*/
public class TestDataChild3 extends AbstractBaseEntity<TestDataChild3> {
private static final long serialVersionUID = 1L;
private com.jeespring.modules.sys.entity.Area start; // 出发地
private com.jeespring.modules.sys.entity.Area end; // 目的地
private Double price; // 代理价格
private TestDataMain testDataMain; // 外键 父类testDataMain.id
public TestDataChild3() {
super();
}
public TestDataChild3(String id){
super(id);
}
public TestDataChild3(TestDataMain testDataMain){
this.testDataMain = testDataMain;
}
@NotNull(message="出发地不能为空")
@ExcelField(title="出发地", fieldType=Area.class, value="start.name", align=2, sort=1)
public Area getStart() {
return start;
}
public void setStart(Area start) {
this.start = start;
}
@NotNull(message="目的地不能为空")
@ExcelField(title="目的地", fieldType=Area.class, value="end.name", align=2, sort=2)
public Area getEnd() {
return end;
}
public void setEnd(Area end) {
this.end = end;
}
@ExcelField(title="代理价格", align=2, sort=3)
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
@Length(min=1, max=64, message="外键长度必须介于 1 和 64 之间")
@JsonIgnore
@JSONField(serialize=false)
public TestDataMain getTestDataMain() {
return testDataMain;
}
public void setTestDataMain(TestDataMain testDataMain) {
this.testDataMain = testDataMain;
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.entity.onetomany;
import com.jeespring.modules.sys.entity.User;
import javax.validation.constraints.NotNull;
import com.jeespring.modules.sys.entity.Office;
import com.jeespring.modules.sys.entity.Area;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
import com.google.common.collect.Lists;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jeespring.common.persistence.AbstractBaseEntity;
import com.jeespring.common.utils.excel.annotation.ExcelField;
import com.jeespring.modules.sys.utils.DictUtils;
/**
* 订票Entity
* @author JeeSpring
* @version 2018-10-12
*/
public class TestDataMain extends AbstractBaseEntity<TestDataMain> {
private static final long serialVersionUID = 1L;
private com.jeespring.modules.sys.entity.User user; // 归属用户
private com.jeespring.modules.sys.entity.Office office; // 归属部门
private com.jeespring.modules.sys.entity.Area area; // 归属区域
private String name; // 名称
private String sex; // 性别
private String sexLabel; // 性别Label
private String sexPicture; // 性别Picture
private java.util.Date inDate; // 加入日期
private java.util.Date beginInDate; // 开始 加入日期
private java.util.Date endInDate; // 结束 加入日期
private List<TestDataChild> testDataChildList = Lists.newArrayList(); // 子表列表
private List<TestDataChild2> testDataChild2List = Lists.newArrayList(); // 子表列表
private List<TestDataChild3> testDataChild3List = Lists.newArrayList(); // 子表列表
public TestDataMain() {
super();
}
public TestDataMain(String id){
super(id);
}
@NotNull(message="归属用户不能为空")
@ExcelField(title="归属用户", fieldType=User.class, value="user.name", align=2, sort=1)
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
@NotNull(message="归属部门不能为空")
@ExcelField(title="归属部门", fieldType=Office.class, value="office.name", align=2, sort=2)
public Office getOffice() {
return office;
}
public void setOffice(Office office) {
this.office = office;
}
@NotNull(message="归属区域不能为空")
@ExcelField(title="归属区域", fieldType=Area.class, value="area.name", align=2, sort=3)
public Area getArea() {
return area;
}
public void setArea(Area area) {
this.area = area;
}
@Length(min=1, max=100, message="名称长度必须介于 1 和 100 之间")
@ExcelField(title="名称", align=2, sort=4)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Length(min=1, max=1, message="性别长度必须介于 1 和 1 之间")
@ExcelField(title="性别", dictType="sex", align=2, sort=5)
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getSexLabel() {
return DictUtils.getDictLabel(sex,"sex","");
}
public String getSexPicture() {
return DictUtils.getDictPicture(sex,"sex","");
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@NotNull(message="加入日期不能为空")
@ExcelField(title="加入日期", align=2, sort=6)
public Date getInDate() {
return inDate;
}
public void setInDate(Date inDate) {
this.inDate = inDate;
}
public Date getBeginInDate() {
return beginInDate;
}
public void setBeginInDate(Date beginInDate) {
this.beginInDate = beginInDate;
}
public Date getEndInDate() {
return endInDate;
}
public void setEndInDate(Date endInDate) {
this.endInDate = endInDate;
}
public List<TestDataChild> getTestDataChildList() {
return testDataChildList;
}
public void setTestDataChildList(List<TestDataChild> testDataChildList) {
this.testDataChildList = testDataChildList;
}
public List<TestDataChild2> getTestDataChild2List() {
return testDataChild2List;
}
public void setTestDataChild2List(List<TestDataChild2> testDataChild2List) {
this.testDataChild2List = testDataChild2List;
}
public List<TestDataChild3> getTestDataChild3List() {
return testDataChild3List;
}
public void setTestDataChild3List(List<TestDataChild3> testDataChild3List) {
this.testDataChild3List = testDataChild3List;
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.entity.tree;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.jeespring.common.persistence.TreeEntity;
/**
* 树Entity
* @author JeeSpring
* @version 2018-10-11
*/
public class TestTree extends TreeEntity<TestTree> {
private static final long serialVersionUID = 1L;
private String name; // 名称
private Integer sort; // 排序
private TestTree parent; // 父级编号
private String parentIds; // 所有父级编号
public TestTree() {
super();
}
public TestTree(String id){
super(id);
}
@Override
@Length(min=1, max=100, message="名称长度必须介于 1 和 100 之间")
public String getName() {
return name;
}
@Override
public void setName(String name) {
this.name = name;
}
@Override
@NotNull(message="排序不能为空")
public Integer getSort() {
return sort;
}
@Override
public void setSort(Integer sort) {
this.sort = sort;
}
@Override
@JsonBackReference
@NotNull(message="父级编号不能为空")
public TestTree getParent() {
return parent;
}
@Override
public void setParent(TestTree parent) {
this.parent = parent;
}
@Override
@Length(min=1, max=2000, message="所有父级编号长度必须介于 1 和 2000 之间")
public String getParentIds() {
return parentIds;
}
@Override
public void setParentIds(String parentIds) {
this.parentIds = parentIds;
}
@Override
public String getParentId() {
return parent != null && parent.getId() != null ? parent.getId() : "0";
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.rest.one;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
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.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Lists;
import com.jeespring.common.utils.DateUtils;
import com.jeespring.common.config.Global;
import com.jeespring.common.persistence.Page;
import com.jeespring.common.web.AbstractBaseController;
import com.jeespring.common.utils.StringUtils;
import com.jeespring.common.utils.excel.ExportExcel;
import com.jeespring.common.utils.excel.ImportExcel;
import com.jeespring.modules.test.entity.one.FormLeave;
import com.jeespring.modules.test.service.one.IFormLeaveService;
import org.springframework.web.bind.annotation.RestController;
import com.jeespring.common.web.Result;
import com.jeespring.common.web.ResultFactory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
/**
* 请假Controller
* @author JeeSpring
* @version 2018-10-12
*/
@RestController
@RequestMapping(value = "/rest/test/one/formLeave")
@Api(value="请假接口", description="请假接口")
public class FormLeaveRestController extends AbstractBaseController {
@Autowired
private IFormLeaveService formLeaveService;
/**
* 请假信息
*/
@RequestMapping(value = {"get"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="请假信息(Content-Type为text/html)", notes="请假信息(Content-Type为text/html)")
@ApiImplicitParam(name = "id", value = "请假id", required = false, dataType = "String",paramType="query")
public Result getRequestParam(@RequestParam(required=false) String id) {
return get(id);
}
@RequestMapping(value = {"get/json"},method ={RequestMethod.POST})
@ApiOperation(value="请假信息(Content-Type为application/json)", notes="请假信息(Content-Type为application/json)")
@ApiImplicitParam(name = "id", value = "请假id", required = false, dataType = "String",paramType="body")
public Result getRequestBody(@RequestBody(required=false) String id) {
return get(id);
}
private Result get(String id) {
FormLeave entity = null;
if (StringUtils.isNotBlank(id)){
entity = formLeaveService.getCache(id);
//entity = formLeaveService.get(id);
}
if (entity == null){
entity = new FormLeave();
}
Result result = ResultFactory.getSuccessResult();
result.setResultObject(entity);
return result;
}
/**
* 请假列表(不包含页信息)
*/
//RequiresPermissions("test:one:formLeave:findList")
@RequestMapping(value = {"findList"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="请假列表(不包含页信息)(Content-Type为text/html)", notes="请假列表(不包含页信息)(Content-Type为text/html)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="query")
public Result findListRequestParam(FormLeave formLeave, HttpServletRequest request, HttpServletResponse response, Model model) {
return findList( formLeave,model);
}
@RequestMapping(value = {"findList/json"},method ={RequestMethod.POST})
@ApiOperation(value="请假列表(不包含页信息)(Content-Type为application/json)", notes="请假列表(不包含页信息)(Content-Type为application/json)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="body")
public Result findListRequestBody(@RequestBody FormLeave formLeave, Model model) {
return findList( formLeave,model);
}
private Result findList(FormLeave formLeave, Model model) {
List<FormLeave> list = formLeaveService.findListCache(formLeave);
//List<FormLeave> list = formLeaveService.findList(formLeave);
Result result = ResultFactory.getSuccessResult();
result.setResultObject(list);
return result;
}
/**
* 请假列表(包含页信息)
*/
//RequiresPermissions("test:one:formLeave:list")
@RequestMapping(value = {"list"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="请假列表(包含页信息)(Content-Type为text/html)", notes="请假列表(包含页信息)(Content-Type为text/html)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="query")
public Result listRequestParam(FormLeave formLeave, HttpServletRequest request, HttpServletResponse response, Model model) {
return list(formLeave,model);
}
@RequestMapping(value = {"list/json"},method ={RequestMethod.POST})
@ApiOperation(value="请假列表(包含页信息)(Content-Type为application/json)", notes="请假列表(包含页信息)(Content-Type为application/json)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="body")
public Result listRequestBody(@RequestBody FormLeave formLeave, Model model) {
return list(formLeave,model);
}
private Result list(FormLeave formLeave, Model model) {
Page<FormLeave> page = formLeaveService.findPageCache(new Page<FormLeave>(formLeave.getPageNo(),formLeave.getPageSize(),formLeave.getOrderBy()), formLeave);
//Page<FormLeave> page = formLeaveService.findPage(new Page<FormLeave>(formLeave.getPageNo(),formLeave.getPageSize(),formLeave.getOrderBy()), formLeave);
Result result = ResultFactory.getSuccessResult();
result.setResultObject(page);
return result;
}
/**
* 请假获取列表第一条记录
*/
//RequiresPermissions("test:one:formLeave:listFrist")
@RequestMapping(value = {"listFrist"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="请假获取列表第一条记录(Content-Type为text/html)", notes="请假获取列表第一条记录(Content-Type为text/html)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="query")
public Result listFristRequestParam(FormLeave formLeave, HttpServletRequest request, HttpServletResponse response, Model model) {
return listFrist(formLeave,model);
}
@RequestMapping(value = {"listFrist/json"},method ={RequestMethod.POST})
@ApiOperation(value="请假获取列表第一条记录(Content-Type为application/json)", notes="请假获取列表第一条记录(Content-Type为application/json)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="body")
public Result listFristRequestBody(@RequestBody FormLeave formLeave, Model model) {
return listFrist(formLeave,model);
}
private Result listFrist(FormLeave formLeave, Model model) {
Page<FormLeave> page = formLeaveService.findPageCache(new Page<FormLeave>(formLeave.getPageNo(),formLeave.getPageSize(),formLeave.getOrderBy()), formLeave);
//Page<FormLeave> page = formLeaveService.findPage(new Page<FormLeave>(formLeave.getPageNo(),formLeave.getPageSize(),formLeave.getOrderBy()), formLeave);
Result result = ResultFactory.getSuccessResult();
if(page.getList().size()>0){
result.setResultObject(page.getList().get(0));
}else{
result=ResultFactory.getErrorResult("没有记录!");
}
return result;
}
/**
* 保存请假
*/
//RequiresPermissions(value={"test:one:formLeave:add","test:one:formLeave:edit"},logical=Logical.OR)
@RequestMapping(value = "save",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="保存请假(Content-Type为text/html)", notes="保存请假(Content-Type为text/html)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="query")
public Result saveRequestParam(FormLeave formLeave, Model model, RedirectAttributes redirectAttributes) {
return save(formLeave,model,redirectAttributes);
}
@RequestMapping(value = "save/json",method ={RequestMethod.POST})
@ApiOperation(value="保存请假(Content-Type为application/json)", notes="保存请假(Content-Type为application/json)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="body")
public Result saveRequestBody(@RequestBody FormLeave formLeave, Model model, RedirectAttributes redirectAttributes) {
return save(formLeave,model,redirectAttributes);
}
private Result save(FormLeave formLeave, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, formLeave)){
Result result = ResultFactory.getErrorResult("数据验证失败");
}
formLeaveService.save(formLeave);
Result result = ResultFactory.getSuccessResult("保存请假成功");
return result;
}
/**
* 删除请假
*/
//RequiresPermissions("test:one:formLeave:del")
@RequestMapping(value = "delete",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="删除请假(Content-Type为text/html)", notes="删除请假(Content-Type为text/html)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="query")
public Result deleteRequestParam(FormLeave formLeave, RedirectAttributes redirectAttributes) {
return delete(formLeave,redirectAttributes);
}
@RequestMapping(value = "delete/json",method ={RequestMethod.POST})
@ApiOperation(value="删除请假(Content-Type为application/json)", notes="删除请假(Content-Type为application/json)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="body")
public Result deleteRequestBody(@RequestBody FormLeave formLeave, RedirectAttributes redirectAttributes) {
return delete(formLeave,redirectAttributes);
}
private Result delete(FormLeave formLeave, RedirectAttributes redirectAttributes) {
formLeaveService.delete(formLeave);
Result result = ResultFactory.getSuccessResult("删除请假成功");
return result;
}
/**
* 删除请假(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteByLogic",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="逻辑删除请假(Content-Type为text/html)", notes="逻辑删除请假(Content-Type为text/html)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="query")
public Result deleteByLogicRequestParam(FormLeave formLeave, RedirectAttributes redirectAttributes) {
return deleteByLogic(formLeave,redirectAttributes);
}
/**
* 删除请假(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteByLogic/json",method ={RequestMethod.POST})
@ApiOperation(value="逻辑删除请假(Content-Type为application/json)", notes="逻辑删除请假(Content-Type为application/json)")
@ApiImplicitParam(name = "formLeave", value = "请假", dataType = "FormLeave",paramType="body")
public Result deleteByLogicRequestBody(@RequestBody FormLeave formLeave, RedirectAttributes redirectAttributes) {
return deleteByLogic(formLeave,redirectAttributes);
}
private Result deleteByLogic(FormLeave formLeave, RedirectAttributes redirectAttributes) {
formLeaveService.deleteByLogic(formLeave);
Result result = ResultFactory.getSuccessResult("删除请假成功");
return result;
}
/**
* 批量删除请假
*/
//RequiresPermissions("test:one:formLeave:del")
@RequestMapping(value = "deleteAll",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="批量删除请假(Content-Type为text/html)", notes="批量删除请假(Content-Type为text/html)")
@ApiImplicitParam(name = "ids", value = "请假ids,用,隔开", required = false, dataType = "String",paramType="query")
public Result deleteAllRequestParam(String ids, RedirectAttributes redirectAttributes) {
return deleteAll(ids,redirectAttributes);
}
@RequestMapping(value = "deleteAll/json",method ={RequestMethod.POST})
@ApiOperation(value="批量删除请假(Content-Type为application/json)", notes="批量删除请假(Content-Type为application/json)")
@ApiImplicitParam(name = "ids", value = "请假ids,用,隔开", required = false, dataType = "String",paramType="body")
public Result deleteAllRequestBody(@RequestBody String ids, RedirectAttributes redirectAttributes) {
return deleteAll(ids,redirectAttributes);
}
private Result deleteAll(String ids, RedirectAttributes redirectAttributes) {
String[] idArray = ids.split(",");
for(String id : idArray){
formLeaveService.delete(formLeaveService.get(id));
}
Result result = ResultFactory.getSuccessResult("删除请假成功");
return result;
}
/**
* 批量删除请假(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteAllByLogic",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="逻辑批量删除请假(Content-Type为text/html)", notes="逻辑批量删除请假(Content-Type为text/html)")
@ApiImplicitParam(name = "ids", value = "请假ids,用,隔开", required = false, dataType = "String",paramType="query")
public Result deleteAllByLogicRequestParam(String ids, RedirectAttributes redirectAttributes) {
return deleteAllByLogic(ids,redirectAttributes);
}
/**
* 批量删除请假(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteAllByLogic/json",method ={RequestMethod.POST})
@ApiOperation(value="逻辑批量删除请假(Content-Type为application/json)", notes="逻辑批量删除请假(Content-Type为application/json)")
@ApiImplicitParam(name = "ids", value = "请假ids,用,隔开", required = false, dataType = "String",paramType="body")
public Result deleteAllByLogicRequestBody(@RequestBody String ids, RedirectAttributes redirectAttributes) {
return deleteAllByLogic(ids,redirectAttributes);
}
private Result deleteAllByLogic(String ids, RedirectAttributes redirectAttributes) {
String[] idArray = ids.split(",");
for(String id : idArray){
formLeaveService.deleteByLogic(formLeaveService.get(id));
}
Result result = ResultFactory.getSuccessResult("删除请假成功");
return result;
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.rest.onetomany;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
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.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Lists;
import com.jeespring.common.utils.DateUtils;
import com.jeespring.common.config.Global;
import com.jeespring.common.persistence.Page;
import com.jeespring.common.web.AbstractBaseController;
import com.jeespring.common.utils.StringUtils;
import com.jeespring.common.utils.excel.ExportExcel;
import com.jeespring.common.utils.excel.ImportExcel;
import com.jeespring.modules.test.entity.onetomany.TestDataMain;
import com.jeespring.modules.test.service.onetomany.ITestDataMainService;
import org.springframework.web.bind.annotation.RestController;
import com.jeespring.common.web.Result;
import com.jeespring.common.web.ResultFactory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
/**
* 订票Controller
* @author JeeSpring
* @version 2018-10-12
*/
@RestController
@RequestMapping(value = "/rest/test/onetomany/testDataMain")
@Api(value="订票接口", description="订票接口")
public class TestDataMainRestController extends AbstractBaseController {
@Autowired
private ITestDataMainService testDataMainService;
/**
* 订票信息
*/
@RequestMapping(value = {"get"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="订票信息(Content-Type为text/html)", notes="订票信息(Content-Type为text/html)")
@ApiImplicitParam(name = "id", value = "订票id", required = false, dataType = "String",paramType="query")
public Result getRequestParam(@RequestParam(required=false) String id) {
return get(id);
}
@RequestMapping(value = {"get/json"},method ={RequestMethod.POST})
@ApiOperation(value="订票信息(Content-Type为application/json)", notes="订票信息(Content-Type为application/json)")
@ApiImplicitParam(name = "id", value = "订票id", required = false, dataType = "String",paramType="body")
public Result getRequestBody(@RequestBody(required=false) String id) {
return get(id);
}
private Result get(String id) {
TestDataMain entity = null;
if (StringUtils.isNotBlank(id)){
entity = testDataMainService.getCache(id);
//entity = testDataMainService.get(id);
}
if (entity == null){
entity = new TestDataMain();
}
Result result = ResultFactory.getSuccessResult();
result.setResultObject(entity);
return result;
}
/**
* 订票列表(不包含页信息)
*/
//RequiresPermissions("test:onetomany:testDataMain:findList")
@RequestMapping(value = {"findList"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="订票列表(不包含页信息)(Content-Type为text/html)", notes="订票列表(不包含页信息)(Content-Type为text/html)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="query")
public Result findListRequestParam(TestDataMain testDataMain, HttpServletRequest request, HttpServletResponse response, Model model) {
return findList( testDataMain,model);
}
@RequestMapping(value = {"findList/json"},method ={RequestMethod.POST})
@ApiOperation(value="订票列表(不包含页信息)(Content-Type为application/json)", notes="订票列表(不包含页信息)(Content-Type为application/json)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="body")
public Result findListRequestBody(@RequestBody TestDataMain testDataMain, Model model) {
return findList( testDataMain,model);
}
private Result findList(TestDataMain testDataMain, Model model) {
List<TestDataMain> list = testDataMainService.findListCache(testDataMain);
//List<TestDataMain> list = testDataMainService.findList(testDataMain);
Result result = ResultFactory.getSuccessResult();
result.setResultObject(list);
return result;
}
/**
* 订票列表(包含页信息)
*/
//RequiresPermissions("test:onetomany:testDataMain:list")
@RequestMapping(value = {"list"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="订票列表(包含页信息)(Content-Type为text/html)", notes="订票列表(包含页信息)(Content-Type为text/html)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="query")
public Result listRequestParam(TestDataMain testDataMain, HttpServletRequest request, HttpServletResponse response, Model model) {
return list(testDataMain,model);
}
@RequestMapping(value = {"list/json"},method ={RequestMethod.POST})
@ApiOperation(value="订票列表(包含页信息)(Content-Type为application/json)", notes="订票列表(包含页信息)(Content-Type为application/json)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="body")
public Result listRequestBody(@RequestBody TestDataMain testDataMain, Model model) {
return list(testDataMain,model);
}
private Result list(TestDataMain testDataMain, Model model) {
Page<TestDataMain> page = testDataMainService.findPageCache(new Page<TestDataMain>(testDataMain.getPageNo(),testDataMain.getPageSize(),testDataMain.getOrderBy()), testDataMain);
//Page<TestDataMain> page = testDataMainService.findPage(new Page<TestDataMain>(testDataMain.getPageNo(),testDataMain.getPageSize(),testDataMain.getOrderBy()), testDataMain);
Result result = ResultFactory.getSuccessResult();
result.setResultObject(page);
return result;
}
/**
* 订票获取列表第一条记录
*/
//RequiresPermissions("test:onetomany:testDataMain:listFrist")
@RequestMapping(value = {"listFrist"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="订票获取列表第一条记录(Content-Type为text/html)", notes="订票获取列表第一条记录(Content-Type为text/html)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="query")
public Result listFristRequestParam(TestDataMain testDataMain, HttpServletRequest request, HttpServletResponse response, Model model) {
return listFrist(testDataMain,model);
}
@RequestMapping(value = {"listFrist/json"},method ={RequestMethod.POST})
@ApiOperation(value="订票获取列表第一条记录(Content-Type为application/json)", notes="订票获取列表第一条记录(Content-Type为application/json)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="body")
public Result listFristRequestBody(@RequestBody TestDataMain testDataMain, Model model) {
return listFrist(testDataMain,model);
}
private Result listFrist(TestDataMain testDataMain, Model model) {
Page<TestDataMain> page = testDataMainService.findPageCache(new Page<TestDataMain>(testDataMain.getPageNo(),testDataMain.getPageSize(),testDataMain.getOrderBy()), testDataMain);
//Page<TestDataMain> page = testDataMainService.findPage(new Page<TestDataMain>(testDataMain.getPageNo(),testDataMain.getPageSize(),testDataMain.getOrderBy()), testDataMain);
Result result = ResultFactory.getSuccessResult();
if(page.getList().size()>0){
result.setResultObject(page.getList().get(0));
}else{
result=ResultFactory.getErrorResult("没有记录!");
}
return result;
}
/**
* 保存订票
*/
//RequiresPermissions(value={"test:onetomany:testDataMain:add","test:onetomany:testDataMain:edit"},logical=Logical.OR)
@RequestMapping(value = "save",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="保存订票(Content-Type为text/html)", notes="保存订票(Content-Type为text/html)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="query")
public Result saveRequestParam(TestDataMain testDataMain, Model model, RedirectAttributes redirectAttributes) {
return save(testDataMain,model,redirectAttributes);
}
@RequestMapping(value = "save/json",method ={RequestMethod.POST})
@ApiOperation(value="保存订票(Content-Type为application/json)", notes="保存订票(Content-Type为application/json)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="body")
public Result saveRequestBody(@RequestBody TestDataMain testDataMain, Model model, RedirectAttributes redirectAttributes) {
return save(testDataMain,model,redirectAttributes);
}
private Result save(TestDataMain testDataMain, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, testDataMain)){
Result result = ResultFactory.getErrorResult("数据验证失败");
}
testDataMainService.save(testDataMain);
Result result = ResultFactory.getSuccessResult("保存订票成功");
return result;
}
/**
* 删除订票
*/
//RequiresPermissions("test:onetomany:testDataMain:del")
@RequestMapping(value = "delete",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="删除订票(Content-Type为text/html)", notes="删除订票(Content-Type为text/html)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="query")
public Result deleteRequestParam(TestDataMain testDataMain, RedirectAttributes redirectAttributes) {
return delete(testDataMain,redirectAttributes);
}
@RequestMapping(value = "delete/json",method ={RequestMethod.POST})
@ApiOperation(value="删除订票(Content-Type为application/json)", notes="删除订票(Content-Type为application/json)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="body")
public Result deleteRequestBody(@RequestBody TestDataMain testDataMain, RedirectAttributes redirectAttributes) {
return delete(testDataMain,redirectAttributes);
}
private Result delete(TestDataMain testDataMain, RedirectAttributes redirectAttributes) {
testDataMainService.delete(testDataMain);
Result result = ResultFactory.getSuccessResult("删除订票成功");
return result;
}
/**
* 删除订票(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteByLogic",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="逻辑删除订票(Content-Type为text/html)", notes="逻辑删除订票(Content-Type为text/html)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="query")
public Result deleteByLogicRequestParam(TestDataMain testDataMain, RedirectAttributes redirectAttributes) {
return deleteByLogic(testDataMain,redirectAttributes);
}
/**
* 删除订票(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteByLogic/json",method ={RequestMethod.POST})
@ApiOperation(value="逻辑删除订票(Content-Type为application/json)", notes="逻辑删除订票(Content-Type为application/json)")
@ApiImplicitParam(name = "testDataMain", value = "订票", dataType = "TestDataMain",paramType="body")
public Result deleteByLogicRequestBody(@RequestBody TestDataMain testDataMain, RedirectAttributes redirectAttributes) {
return deleteByLogic(testDataMain,redirectAttributes);
}
private Result deleteByLogic(TestDataMain testDataMain, RedirectAttributes redirectAttributes) {
testDataMainService.deleteByLogic(testDataMain);
Result result = ResultFactory.getSuccessResult("删除订票成功");
return result;
}
/**
* 批量删除订票
*/
//RequiresPermissions("test:onetomany:testDataMain:del")
@RequestMapping(value = "deleteAll",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="批量删除订票(Content-Type为text/html)", notes="批量删除订票(Content-Type为text/html)")
@ApiImplicitParam(name = "ids", value = "订票ids,用,隔开", required = false, dataType = "String",paramType="query")
public Result deleteAllRequestParam(String ids, RedirectAttributes redirectAttributes) {
return deleteAll(ids,redirectAttributes);
}
@RequestMapping(value = "deleteAll/json",method ={RequestMethod.POST})
@ApiOperation(value="批量删除订票(Content-Type为application/json)", notes="批量删除订票(Content-Type为application/json)")
@ApiImplicitParam(name = "ids", value = "订票ids,用,隔开", required = false, dataType = "String",paramType="body")
public Result deleteAllRequestBody(@RequestBody String ids, RedirectAttributes redirectAttributes) {
return deleteAll(ids,redirectAttributes);
}
private Result deleteAll(String ids, RedirectAttributes redirectAttributes) {
String[] idArray = ids.split(",");
for(String id : idArray){
testDataMainService.delete(testDataMainService.get(id));
}
Result result = ResultFactory.getSuccessResult("删除订票成功");
return result;
}
/**
* 批量删除订票(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteAllByLogic",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="逻辑批量删除订票(Content-Type为text/html)", notes="逻辑批量删除订票(Content-Type为text/html)")
@ApiImplicitParam(name = "ids", value = "订票ids,用,隔开", required = false, dataType = "String",paramType="query")
public Result deleteAllByLogicRequestParam(String ids, RedirectAttributes redirectAttributes) {
return deleteAllByLogic(ids,redirectAttributes);
}
/**
* 批量删除订票(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteAllByLogic/json",method ={RequestMethod.POST})
@ApiOperation(value="逻辑批量删除订票(Content-Type为application/json)", notes="逻辑批量删除订票(Content-Type为application/json)")
@ApiImplicitParam(name = "ids", value = "订票ids,用,隔开", required = false, dataType = "String",paramType="body")
public Result deleteAllByLogicRequestBody(@RequestBody String ids, RedirectAttributes redirectAttributes) {
return deleteAllByLogic(ids,redirectAttributes);
}
private Result deleteAllByLogic(String ids, RedirectAttributes redirectAttributes) {
String[] idArray = ids.split(",");
for(String id : idArray){
testDataMainService.deleteByLogic(testDataMainService.get(id));
}
Result result = ResultFactory.getSuccessResult("删除订票成功");
return result;
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.service.one;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import com.jeespring.common.persistence.Page;
import com.jeespring.common.service.AbstractBaseService;
import com.jeespring.modules.test.entity.one.FormLeave;
import com.jeespring.modules.test.dao.one.FormLeaveDao;
import com.jeespring.modules.test.service.one.IFormLeaveService;
import com.alibaba.fastjson.JSON;
import com.jeespring.common.redis.RedisUtils;
import com.jeespring.common.security.MD5Tools;
//import com.alibaba.dubbo.config.annotation.Service;
import com.jeespring.common.config.Global;
/**
* 请假Service
* @author JeeSpring
* @version 2018-10-12
*/
//启用dubbo服务器时,要去掉下面注解
//com.alibaba.dubbo.config.annotation.Service(interfaceClass = ISysServerService.class,version = "1.0.0", timeout = 60000)
@org.springframework.stereotype.Service
@Transactional(readOnly = true)
public class FormLeaveService extends AbstractBaseService<FormLeaveDao, FormLeave> implements IFormLeaveService{
/**
* redis caches
*/
@Autowired
private RedisUtils redisUtils;
@Override
public FormLeave get(String id) {
//获取数据库数据
FormLeave formLeave=super.get(id);
return formLeave;
}
@Override
public FormLeave getCache(String id) {
//获取缓存数据
FormLeave formLeave=(FormLeave)redisUtils.get(RedisUtils.getIdKey(FormLeaveService.class.getName(),id));
if( formLeave!=null) {
return formLeave;
}
//获取数据库数据
formLeave=super.get(id);
//设置缓存数据
redisUtils.set(RedisUtils.getIdKey(FormLeaveService.class.getName(),id),formLeave);
return formLeave;
}
@Override
public List<FormLeave> total(FormLeave formLeave) {
//获取数据库数据
List<FormLeave> formLeaveList=super.total(formLeave);
return formLeaveList;
}
@Override
public List<FormLeave> totalCache(FormLeave formLeave) {
//获取缓存数据
String totalKey = RedisUtils.getTotalKey(FormLeaveService.class.getName(),JSON.toJSONString(formLeave));
List<FormLeave> formLeaveList=(List<FormLeave>)redisUtils.get(totalKey);
if(formLeaveList!=null) {
return formLeaveList;
}
//获取数据库数据
formLeaveList=super.total(formLeave);
//设置缓存数据
redisUtils.set(totalKey,formLeaveList);
return formLeaveList;
}
@Override
public List<FormLeave> findList(FormLeave formLeave) {
//获取数据库数据
List<FormLeave> formLeaveList=super.findList(formLeave);
//设置缓存数据
return formLeaveList;
}
@Override
public List<FormLeave> findListCache(FormLeave formLeave) {
//获取缓存数据
String findListKey = RedisUtils.getFindListKey(FormLeaveService.class.getName(),JSON.toJSONString(formLeave));
List<FormLeave> formLeaveList=(List<FormLeave>)redisUtils.get(findListKey);
if(formLeaveList!=null) {
return formLeaveList;
}
//获取数据库数据
formLeaveList=super.findList(formLeave);
//设置缓存数据
redisUtils.set(findListKey,formLeaveList);
return formLeaveList;
}
public FormLeave findListFirst(FormLeave formLeave) {;
//获取数据库数据
List<FormLeave> formLeaveList=super.findList(formLeave);
if(formLeaveList.size()>0) {
formLeave = formLeaveList.get(0);
}
return formLeave;
}
public FormLeave findListFirstCache(FormLeave formLeave) {
//获取缓存数据
String findListFirstKey = RedisUtils.getFindListFirstKey(FormLeaveService.class.getName(),JSON.toJSONString(formLeave));
FormLeave formLeaveRedis=(FormLeave)redisUtils.get(findListFirstKey);
if(formLeaveRedis!=null) {
return formLeaveRedis;
}
//获取数据库数据
List<FormLeave> formLeaveList=super.findList(formLeave);
if(formLeaveList.size()>0) {
formLeave = formLeaveList.get(0);
} else {
formLeave = new FormLeave();
}
//设置缓存数据
redisUtils.set(findListFirstKey,formLeave);
return formLeave;
}
@Override
public Page<FormLeave> findPage(Page<FormLeave> page, FormLeave formLeave) {
//获取数据库数据
Page<FormLeave> pageReuslt=super.findPage(page, formLeave);
return pageReuslt;
}
@Override
public Page<FormLeave> findPageCache(Page<FormLeave> page, FormLeave formLeave) {
//获取缓存数据
String findPageKey = RedisUtils.getFindPageKey(FormLeaveService.class.getName(),JSON.toJSONString(page)+JSON.toJSONString(formLeave));
Page<FormLeave> pageReuslt=(Page<FormLeave>)redisUtils.get(findPageKey);
if(pageReuslt!=null) {
return pageReuslt;
}
//获取数据库数据
pageReuslt=super.findPage(page, formLeave);
//设置缓存数据
redisUtils.set(findPageKey,pageReuslt);
return pageReuslt;
}
@Override
@Transactional(readOnly = false)
public void save(FormLeave formLeave) {
//保存数据库记录
super.save(formLeave);
//设置清除缓存数据
redisUtils.remove(RedisUtils.getIdKey(FormLeaveService.class.getName(),formLeave.getId()));
//清除列表和页面缓存数据
redisUtils.removePattern(RedisUtils.getFindListKeyPattern(FormLeaveService.class.getName()));
redisUtils.removePattern(RedisUtils.getFinPageKeyPattern(FormLeaveService.class.getName()));
}
@Override
@Transactional(readOnly = false)
public void delete(FormLeave formLeave) {
//清除记录缓存数据
redisUtils.remove(RedisUtils.getIdKey(FormLeaveService.class.getName(),formLeave.getId()));
//删除数据库记录
super.delete(formLeave);
//清除列表和页面缓存数据
redisUtils.removePattern(RedisUtils.getFindListKeyPattern(FormLeaveService.class.getName()));
redisUtils.removePattern(RedisUtils.getFinPageKeyPattern(FormLeaveService.class.getName()));
}
@Override
@Transactional(readOnly = false)
public void deleteByLogic(FormLeave formLeave) {
//清除记录缓存数据
redisUtils.remove(RedisUtils.getIdKey(FormLeaveService.class.getName(),formLeave.getId()));
//逻辑删除数据库记录
super.deleteByLogic(formLeave);
//清除列表和页面缓存数据
redisUtils.removePattern(RedisUtils.getFindListKeyPattern(FormLeaveService.class.getName()));
redisUtils.removePattern(RedisUtils.getFinPageKeyPattern(FormLeaveService.class.getName()));
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.service.one;
import com.jeespring.common.persistence.InterfaceBaseService;
import com.jeespring.modules.server.entity.SysServer;
import com.jeespring.modules.test.entity.one.FormLeave;
/**
* I请假Service
* @author JeeSpring
* @version 2018-10-12
*/
public interface IFormLeaveService extends InterfaceBaseService<FormLeave> {
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.service.onetomany;
import com.jeespring.common.persistence.InterfaceBaseService;
import com.jeespring.modules.server.entity.SysServer;
import com.jeespring.modules.test.entity.onetomany.TestDataMain;
/**
* I订票Service
* @author JeeSpring
* @version 2018-10-12
*/
public interface ITestDataMainService extends InterfaceBaseService<TestDataMain> {
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.service.onetomany;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jeespring.common.persistence.Page;
import com.jeespring.common.service.AbstractBaseService;
import com.jeespring.common.utils.StringUtils;
import com.alibaba.fastjson.JSON;
import com.jeespring.common.redis.RedisUtils;
import com.jeespring.common.security.MD5Tools;
import com.jeespring.modules.test.entity.onetomany.TestDataMain;
import com.jeespring.modules.test.dao.onetomany.TestDataMainDao;
import com.jeespring.modules.test.entity.onetomany.TestDataChild;
import com.jeespring.modules.test.dao.onetomany.TestDataChildDao;
import com.jeespring.modules.test.entity.onetomany.TestDataChild2;
import com.jeespring.modules.test.dao.onetomany.TestDataChild2Dao;
import com.jeespring.modules.test.entity.onetomany.TestDataChild3;
import com.jeespring.modules.test.dao.onetomany.TestDataChild3Dao;
//import com.alibaba.dubbo.config.annotation.Service;
import com.jeespring.common.config.Global;
/**
* 订票Service
* @author JeeSpring
* @version 2018-10-12
*/
//com.alibaba.dubbo.config.annotation.Service(interfaceClass = ISysServerService.class,version = "1.0.0", timeout = 60000)
@org.springframework.stereotype.Service
@Transactional(readOnly = true)
public class TestDataMainService extends AbstractBaseService<TestDataMainDao, TestDataMain> implements ITestDataMainService{
/**
* redis caches
*/
@Autowired
private RedisUtils redisUtils;
@Autowired
private TestDataChildDao testDataChildDao;
@Autowired
private TestDataChild2Dao testDataChild2Dao;
@Autowired
private TestDataChild3Dao testDataChild3Dao;
@Override
public TestDataMain get(String id) {
//获取数据库数据
TestDataMain testDataMain = super.get(id);
if(testDataMain ==null) {
return new TestDataMain();
}
testDataMain.setTestDataChildList(testDataChildDao.findList(new TestDataChild(testDataMain)));
testDataMain.setTestDataChild2List(testDataChild2Dao.findList(new TestDataChild2(testDataMain)));
testDataMain.setTestDataChild3List(testDataChild3Dao.findList(new TestDataChild3(testDataMain)));
return testDataMain;
}
@Override
public TestDataMain getCache(String id) {
//获取缓存数据
TestDataMain testDataMain=(TestDataMain)redisUtils.get(RedisUtils.getIdKey(TestDataMainService.class.getName(),id));
if( testDataMain!=null) {
return testDataMain;
}
//获取数据库数据
testDataMain = super.get(id);
if(testDataMain ==null) {
return new TestDataMain();
}
testDataMain.setTestDataChildList(testDataChildDao.findList(new TestDataChild(testDataMain)));
testDataMain.setTestDataChild2List(testDataChild2Dao.findList(new TestDataChild2(testDataMain)));
testDataMain.setTestDataChild3List(testDataChild3Dao.findList(new TestDataChild3(testDataMain)));
//设置缓存数据
redisUtils.set(RedisUtils.getIdKey(TestDataMainService.class.getName(),id),testDataMain);
return testDataMain;
}
@Override
public List<TestDataMain> total(TestDataMain testDataMain) {
//获取数据库数据
List<TestDataMain> testDataMainList=super.total(testDataMain);
return testDataMainList;
}
@Override
public List<TestDataMain> totalCache(TestDataMain testDataMain) {
//获取缓存数据
String totalKey = RedisUtils.getTotalKey(TestDataMainService.class.getName(),JSON.toJSONString(testDataMain));
List<TestDataMain> testDataMainList=(List<TestDataMain>)redisUtils.get(totalKey);
if(testDataMainList!=null) {
return testDataMainList;
}
//获取数据库数据
testDataMainList=super.total(testDataMain);
//设置缓存数据
redisUtils.set(totalKey,testDataMainList);
return testDataMainList;
}
public TestDataMain findListFirst(TestDataMain testDataMain) {
//获取数据库数据
List<TestDataMain> testDataMainList=super.findList(testDataMain);
if(testDataMainList.size()>0) {
testDataMain = testDataMainList.get(0);
}
return testDataMain;
}
public TestDataMain findListFirstCache(TestDataMain testDataMain) {
//获取缓存数据
String findListFirstKey = RedisUtils.getFindListFirstKey(TestDataMainService.class.getName(),JSON.toJSONString(testDataMain));
TestDataMain testDataMainRedis=(TestDataMain)redisUtils.get(findListFirstKey);
if(testDataMainRedis!=null) {
return testDataMainRedis;
}
//获取数据库数据
List<TestDataMain> testDataMainList=super.findList(testDataMain);
if(testDataMainList.size()>0) {
testDataMain = testDataMainList.get(0);
} else {
testDataMain = new TestDataMain();
}
//设置缓存数据
redisUtils.set(findListFirstKey,testDataMain);
return testDataMain;
}
@Override
public List<TestDataMain> findList(TestDataMain testDataMain) {
//获取缓存数据
String findListKey = RedisUtils.getFindListKey(TestDataMainService.class.getName(),JSON.toJSONString(testDataMain));
List<TestDataMain> testDataMainList=(List<TestDataMain>)redisUtils.get(findListKey);
if(testDataMainList!=null) {
return testDataMainList;
}
//获取数据库数据
testDataMainList=super.findList(testDataMain);
//设置缓存数据
redisUtils.set(findListKey,testDataMainList);
return testDataMainList;
}
@Override
public List<TestDataMain> findListCache(TestDataMain testDataMain) {
//获取缓存数据
String findListKey = RedisUtils.getFindListKey(TestDataMainService.class.getName(),JSON.toJSONString(testDataMain));
List<TestDataMain> testDataMainList=(List<TestDataMain>)redisUtils.get(findListKey);
if(testDataMainList!=null) {
return testDataMainList;
}
//获取数据库数据
testDataMainList=super.findList(testDataMain);
//设置缓存数据
redisUtils.set(findListKey,testDataMainList);
return testDataMainList;
}
@Override
public Page<TestDataMain> findPage(Page<TestDataMain> page, TestDataMain testDataMain) {
//获取数据库数据
Page<TestDataMain> pageReuslt=super.findPage(page, testDataMain);
return pageReuslt;
}
@Override
public Page<TestDataMain> findPageCache(Page<TestDataMain> page, TestDataMain testDataMain) {
//获取缓存数据
String findPageKey = RedisUtils.getFindPageKey(TestDataMainService.class.getName(),JSON.toJSONString(page)+JSON.toJSONString(testDataMain));
Page<TestDataMain> pageReuslt=(Page<TestDataMain>)redisUtils.get(findPageKey);
if(pageReuslt!=null) {
return pageReuslt;
}
//获取数据库数据
pageReuslt=super.findPage(page, testDataMain);
//设置缓存数据
redisUtils.set(findPageKey,pageReuslt);
return pageReuslt;
}
@Override
@Transactional(readOnly = false)
public void save(TestDataMain testDataMain) {
//保存数据库记录
super.save(testDataMain);
for (TestDataChild testDataChild : testDataMain.getTestDataChildList()){
if (testDataChild.getId() == null){
continue;
}
if (TestDataChild.DEL_FLAG_NORMAL.equals(testDataChild.getDelFlag())){
if (StringUtils.isBlank(testDataChild.getId())){
testDataChild.setTestDataMain(testDataMain);
testDataChild.preInsert();
testDataChildDao.insert(testDataChild);
}else{
testDataChild.preUpdate();
testDataChildDao.update(testDataChild);
}
}else{
testDataChildDao.delete(testDataChild);
}
}
for (TestDataChild2 testDataChild2 : testDataMain.getTestDataChild2List()){
if (testDataChild2.getId() == null){
continue;
}
if (TestDataChild2.DEL_FLAG_NORMAL.equals(testDataChild2.getDelFlag())){
if (StringUtils.isBlank(testDataChild2.getId())){
testDataChild2.setTestDataMain(testDataMain);
testDataChild2.preInsert();
testDataChild2Dao.insert(testDataChild2);
}else{
testDataChild2.preUpdate();
testDataChild2Dao.update(testDataChild2);
}
}else{
testDataChild2Dao.delete(testDataChild2);
}
}
for (TestDataChild3 testDataChild3 : testDataMain.getTestDataChild3List()){
if (testDataChild3.getId() == null){
continue;
}
if (TestDataChild3.DEL_FLAG_NORMAL.equals(testDataChild3.getDelFlag())){
if (StringUtils.isBlank(testDataChild3.getId())){
testDataChild3.setTestDataMain(testDataMain);
testDataChild3.preInsert();
testDataChild3Dao.insert(testDataChild3);
}else{
testDataChild3.preUpdate();
testDataChild3Dao.update(testDataChild3);
}
}else{
testDataChild3Dao.delete(testDataChild3);
}
}
//设置清除缓存数据
redisUtils.remove(RedisUtils.getIdKey(TestDataMainService.class.getName(),testDataMain.getId()));
//清除列表和页面缓存数据
redisUtils.removePattern(RedisUtils.getFindListKeyPattern(TestDataMainService.class.getName()));
redisUtils.removePattern(RedisUtils.getFinPageKeyPattern(TestDataMainService.class.getName()));
}
@Override
@Transactional(readOnly = false)
public void delete(TestDataMain testDataMain) {
//清除记录缓存数据
redisUtils.remove(RedisUtils.getIdKey(TestDataMainService.class.getName(),testDataMain.getId()));
//删除数据库记录
super.delete(testDataMain);
testDataChildDao.delete(new TestDataChild(testDataMain));
testDataChild2Dao.delete(new TestDataChild2(testDataMain));
testDataChild3Dao.delete(new TestDataChild3(testDataMain));
//清除列表和页面缓存数据
redisUtils.removePattern(RedisUtils.getFindListKeyPattern(TestDataMainService.class.getName()));
redisUtils.removePattern(RedisUtils.getFinPageKeyPattern(TestDataMainService.class.getName()));
}
@Override
@Transactional(readOnly = false)
public void deleteByLogic(TestDataMain testDataMain) {
//清除记录缓存数据
redisUtils.remove(RedisUtils.getIdKey(TestDataMainService.class.getName(),testDataMain.getId()));
//逻辑删除数据库记录
super.deleteByLogic(testDataMain);
testDataChildDao.deleteByLogic(new TestDataChild(testDataMain));
testDataChild2Dao.deleteByLogic(new TestDataChild2(testDataMain));
testDataChild3Dao.deleteByLogic(new TestDataChild3(testDataMain));
//清除列表和页面缓存数据
redisUtils.removePattern(RedisUtils.getFindListKeyPattern(TestDataMainService.class.getName()));
redisUtils.removePattern(RedisUtils.getFinPageKeyPattern(TestDataMainService.class.getName()));
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.service.tree;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jeespring.common.service.TreeService;
import com.jeespring.common.utils.StringUtils;
import com.jeespring.modules.test.entity.tree.TestTree;
import com.jeespring.modules.test.dao.tree.TestTreeDao;
/**
* 树Service
* @author JeeSpring
* @version 2018-10-11
*/
@Service
@Transactional(readOnly = true)
public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
@Override
public TestTree get(String id) {
return super.get(id);
}
@Override
public List<TestTree> findList(TestTree testTree) {
if (StringUtils.isNotBlank(testTree.getParentIds())){
testTree.setParentIds(","+testTree.getParentIds()+",");
}
return super.findList(testTree);
}
@Override
@Transactional(readOnly = false)
public void save(TestTree testTree) {
super.save(testTree);
}
@Override
@Transactional(readOnly = false)
public void delete(TestTree testTree) {
super.delete(testTree);
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.web.one;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
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.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Lists;
import com.jeespring.common.utils.DateUtils;
import com.jeespring.common.config.Global;
import com.jeespring.common.persistence.Page;
import com.jeespring.common.web.AbstractBaseController;
import com.jeespring.common.utils.StringUtils;
import com.jeespring.common.utils.excel.ExportExcel;
import com.jeespring.common.utils.excel.ImportExcel;
import com.jeespring.modules.test.entity.one.FormLeave;
import com.jeespring.modules.test.service.one.FormLeaveService;
import com.jeespring.modules.test.service.one.IFormLeaveService;
import com.alibaba.dubbo.config.annotation.Reference;
/**
* 请假Controller
* @author JeeSpring
* @version 2018-10-12
*/
@Controller
@RequestMapping(value = "${adminPath}/test/one/formLeave")
public class FormLeaveController extends AbstractBaseController {
//调用dubbo服务器是,要去Reference注解,注解Autowired
//@Reference(version = "1.0.0")
@Autowired
private IFormLeaveService formLeaveService;
@ModelAttribute
public FormLeave get(@RequestParam(required=false) String id) {
FormLeave entity = null;
if (StringUtils.isNotBlank(id)){
entity = formLeaveService.getCache(id);
//entity = formLeaveService.get(id);
}
if (entity == null){
entity = new FormLeave();
}
return entity;
}
/**
* 请假统计页面
*/
@RequiresPermissions("test:one:formLeave:total")
@RequestMapping(value = {"total"})
public String totalView(FormLeave formLeave, HttpServletRequest request, HttpServletResponse response, Model model) {
total(formLeave,request,response,model);
return "modules/test/one/formLeaveTotal";
}
private void total(FormLeave formLeave, HttpServletRequest request, HttpServletResponse response, Model model) {
if(StringUtils.isEmpty(formLeave.getTotalType())){
formLeave.setTotalType("%Y-%m-%d");
}
//X轴的数据
List<String> xAxisData= new ArrayList<String>();
//Y轴的数据
Map<String,List<Double>> yAxisData = new HashMap<String,List<Double>>();
List<Double> countList = new ArrayList<Double>();
List<Double> sumList = new ArrayList<Double>();
if(formLeave.getOrderBy()==""){
formLeave.setOrderBy("totalDate");
}
List<FormLeave> list = formLeaveService.totalCache(formLeave);
//List<FormLeave> list = formLeaveService.total(formLeave);
model.addAttribute("list", list);
for(FormLeave formLeaveItem:list){
//x轴数据
xAxisData.add( formLeaveItem.getTotalDate());
countList.add(Double.valueOf(formLeaveItem.getTotalCount()));
}
yAxisData.put("数量", countList);
request.setAttribute("xAxisData", xAxisData);
request.setAttribute("yAxisData", yAxisData);
model.addAttribute("sumTotalCount", list.stream().mapToInt(FormLeave::getTotalCount).sum());
//饼图数据
Map<String,Object> orientData= new HashMap<String,Object>();
for(FormLeave formLeaveItem:list){
orientData.put(formLeaveItem.getTotalDate(), formLeaveItem.getTotalCount());
}
model.addAttribute("orientData", orientData);
}
@RequiresPermissions("test:one:formLeave:total")
@RequestMapping(value = {"totalMap"})
public String totalMap(FormLeave formLeave, HttpServletRequest request, HttpServletResponse response, Model model) {
if(StringUtils.isEmpty(formLeave.getTotalType())){
formLeave.setTotalType("%Y-%m-%d");
}
List<FormLeave> list = formLeaveService.totalCache(formLeave);
//List<FormLeave> list = formLeaveService.total(formLeave);
model.addAttribute("sumTotalCount", list.stream().mapToInt(FormLeave::getTotalCount).sum());
model.addAttribute("list", list);
return "modules/test/one/formLeaveTotalMap";
}
/**
* 请假列表页面
*/
@RequiresPermissions("test:one:formLeave:list")
@RequestMapping(value = {"list", ""})
public String list(FormLeave formLeave, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<FormLeave> page = formLeaveService.findPageCache(new Page<FormLeave>(request, response), formLeave);
//Page<FormLeave> page = formLeaveService.findPage(new Page<FormLeave>(request, response), formLeave);
model.addAttribute("page", page);
formLeave.setOrderBy("totalDate");
total(formLeave,request,response,model);
return "modules/test/one/formLeaveList";
}
/**
* 请假列表页面
*/
@RequiresPermissions("test:one:formLeave:list")
@RequestMapping(value = {"listVue"})
public String listVue(FormLeave formLeave, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<FormLeave> page = formLeaveService.findPageCache(new Page<FormLeave>(request, response), formLeave);
//Page<FormLeave> page = formLeaveService.findPage(new Page<FormLeave>(request, response), formLeave);
model.addAttribute("page", page);
return "modules/test/one/formLeaveListVue";
}
/**
* 请假列表页面
*/
//RequiresPermissions("test:one:formLeave:select")
@RequestMapping(value = {"select"})
public String select(FormLeave formLeave, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<FormLeave> page = formLeaveService.findPageCache(new Page<FormLeave>(request, response), formLeave);
//Page<FormLeave> page = formLeaveService.findPage(new Page<FormLeave>(request, response), formLeave);
model.addAttribute("page", page);
return "modules/test/one/formLeaveSelect";
}
/**
* 查看,增加,编辑请假表单页面
*/
@RequiresPermissions(value={"test:one:formLeave:view","test:one:formLeave:add","test:one:formLeave:edit"},logical=Logical.OR)
@RequestMapping(value = "form")
public String form(FormLeave formLeave, Model model, HttpServletRequest request, HttpServletResponse response) {
model.addAttribute("action", request.getParameter("action"));
model.addAttribute("formLeave", formLeave);
if(request.getParameter("ViewFormType")!=null && "FormTwo".equals(request.getParameter("ViewFormType"))) {
return "modules/test/one/formLeaveFormTwo";
}
return "modules/test/one/formLeaveForm";
}
/**
* 保存请假
*/
@RequiresPermissions(value={"test:one:formLeave:add","test:one:formLeave:edit"},logical=Logical.OR)
@RequestMapping(value = "save")
public String save(FormLeave formLeave, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request, HttpServletResponse response) {
if (!beanValidator(model, formLeave)){
return form(formLeave, model,request,response);
}
formLeaveService.save(formLeave);
addMessage(redirectAttributes, "保存请假成功");
return "redirect:"+Global.getAdminPath()+"/test/one/formLeave/?repage";
}
/**
* 删除请假
*/
@RequiresPermissions("test:one:formLeave:del")
@RequestMapping(value = "delete")
public String delete(FormLeave formLeave, RedirectAttributes redirectAttributes) {
formLeaveService.delete(formLeave);
addMessage(redirectAttributes, "删除请假成功");
return "redirect:"+Global.getAdminPath()+"/test/one/formLeave/?repage";
}
/**
* 删除请假(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequiresPermissions(value={"test:one:formLeave:del","test:one:formLeave:delByLogic"},logical=Logical.OR)
@RequestMapping(value = "deleteByLogic")
public String deleteByLogic(FormLeave formLeave, RedirectAttributes redirectAttributes) {
formLeaveService.deleteByLogic(formLeave);
addMessage(redirectAttributes, "逻辑删除请假成功");
return "redirect:"+Global.getAdminPath()+"/test/one/formLeave/?repage";
}
/**
* 批量删除请假
*/
@RequiresPermissions("test:one:formLeave:del")
@RequestMapping(value = "deleteAll")
public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
String[] idArray = ids.split(",");
for(String id : idArray){
formLeaveService.delete(formLeaveService.get(id));
}
addMessage(redirectAttributes, "删除请假成功");
return "redirect:"+Global.getAdminPath()+"/test/one/formLeave/?repage";
}
/**
* 批量删除请假(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequiresPermissions(value={"test:one:formLeave:del","test:one:formLeave:delByLogic"},logical=Logical.OR)
@RequestMapping(value = "deleteAllByLogic")
public String deleteAllByLogic(String ids, RedirectAttributes redirectAttributes) {
String[] idArray = ids.split(",");
for(String id : idArray){
formLeaveService.deleteByLogic(formLeaveService.get(id));
}
addMessage(redirectAttributes, "删除请假成功");
return "redirect:"+Global.getAdminPath()+"/test/one/formLeave/?repage";
}
/**
* 导出excel文件
*/
@RequiresPermissions("test:one:formLeave:export")
@RequestMapping(value = "export", method=RequestMethod.POST)
public String exportFile(FormLeave formLeave, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "请假"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
Page<FormLeave> page = formLeaveService.findPage(new Page<FormLeave>(request, response, -1), formLeave);
new ExportExcel("请假", FormLeave.class).setDataList(page.getList()).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导出请假记录失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/test/one/formLeave/?repage";
}
/**
* 导入Excel数据
*/
@RequiresPermissions("test:one:formLeave:import")
@RequestMapping(value = "import", method=RequestMethod.POST)
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
try {
int successNum = 0;
ImportExcel ei = new ImportExcel(file, 1, 0);
List<FormLeave> list = ei.getDataList(FormLeave.class);
for (FormLeave formLeave : list){
formLeaveService.save(formLeave);
}
addMessage(redirectAttributes, "已成功导入 "+successNum+" 条请假记录");
} catch (Exception e) {
addMessage(redirectAttributes, "导入请假失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/test/one/formLeave/?repage";
}
/**
* 下载导入请假数据模板
*/
@RequiresPermissions("test:one:formLeave:import")
@RequestMapping(value = "import/template")
public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "请假数据导入模板.xlsx";
List<FormLeave> list = Lists.newArrayList();
new ExportExcel("请假数据", FormLeave.class, 1).setDataList(list).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/test/one/formLeave/?repage";
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.web.onetomany;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
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.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Lists;
import com.jeespring.common.utils.DateUtils;
import com.jeespring.common.config.Global;
import com.jeespring.common.persistence.Page;
import com.jeespring.common.web.AbstractBaseController;
import com.jeespring.common.utils.StringUtils;
import com.jeespring.common.utils.excel.ExportExcel;
import com.jeespring.common.utils.excel.ImportExcel;
import com.jeespring.modules.test.entity.onetomany.TestDataMain;
import com.jeespring.modules.test.service.onetomany.TestDataMainService;
import com.jeespring.modules.test.service.onetomany.ITestDataMainService;
import com.alibaba.dubbo.config.annotation.Reference;
/**
* 订票Controller
* @author JeeSpring
* @version 2018-10-12
*/
@Controller
@RequestMapping(value = "${adminPath}/test/onetomany/testDataMain")
public class TestDataMainController extends AbstractBaseController {
//调用dubbo服务器是,要去Reference注解,注解Autowired
//@Reference(version = "1.0.0")
@Autowired
private ITestDataMainService testDataMainService;
@ModelAttribute
public TestDataMain get(@RequestParam(required=false) String id) {
TestDataMain entity = null;
if (StringUtils.isNotBlank(id)){
entity = testDataMainService.getCache(id);
//entity = testDataMainService.get(id);
}
if (entity == null){
entity = new TestDataMain();
}
return entity;
}
/**
* 订票统计页面
*/
@RequiresPermissions("test:onetomany:testDataMain:total")
@RequestMapping(value = {"total"})
public String totalView(TestDataMain testDataMain, HttpServletRequest request, HttpServletResponse response, Model model) {
total(testDataMain,request,response,model);
return "modules/test/onetomany/testDataMainTotal";
}
private void total(TestDataMain testDataMain, HttpServletRequest request, HttpServletResponse response, Model model) {
if(StringUtils.isEmpty(testDataMain.getTotalType())){
testDataMain.setTotalType("%Y-%m-%d");
}
//X轴的数据
List<String> xAxisData= new ArrayList<String>();
//Y轴的数据
Map<String,List<Double>> yAxisData = new HashMap<String,List<Double>>();
List<Double> countList = new ArrayList<Double>();
List<Double> sumList = new ArrayList<Double>();
if(testDataMain.getOrderBy()==""){
testDataMain.setOrderBy("totalDate");
}
List<TestDataMain> list = testDataMainService.totalCache(testDataMain);
//List<TestDataMain> list = testDataMainService.total(testDataMain);
model.addAttribute("list", list);
for(TestDataMain testDataMainItem:list){
//x轴数据
xAxisData.add( testDataMainItem.getTotalDate());
countList.add(Double.valueOf(testDataMainItem.getTotalCount()));
}
yAxisData.put("数量", countList);
request.setAttribute("xAxisData", xAxisData);
request.setAttribute("yAxisData", yAxisData);
model.addAttribute("sumTotalCount", list.stream().mapToInt(TestDataMain::getTotalCount).sum());
//饼图数据
Map<String,Object> orientData= new HashMap<String,Object>();
for(TestDataMain testDataMainItem:list){
orientData.put(testDataMainItem.getTotalDate(), testDataMainItem.getTotalCount());
}
model.addAttribute("orientData", orientData);
}
@RequiresPermissions("test:onetomany:testDataMain:total")
@RequestMapping(value = {"totalMap"})
public String totalMap(TestDataMain testDataMain, HttpServletRequest request, HttpServletResponse response, Model model) {
if(StringUtils.isEmpty(testDataMain.getTotalType())){
testDataMain.setTotalType("%Y-%m-%d");
}
List<TestDataMain> list = testDataMainService.totalCache(testDataMain);
//List<TestDataMain> list = testDataMainService.total(testDataMain);
model.addAttribute("sumTotalCount", list.stream().mapToInt(TestDataMain::getTotalCount).sum());
model.addAttribute("list", list);
return "modules/test/onetomany/testDataMainTotalMap";
}
/**
* 订票列表页面
*/
@RequiresPermissions("test:onetomany:testDataMain:list")
@RequestMapping(value = {"list", ""})
public String list(TestDataMain testDataMain, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<TestDataMain> page = testDataMainService.findPageCache(new Page<TestDataMain>(request, response), testDataMain);
//Page<TestDataMain> page = testDataMainService.findPage(new Page<TestDataMain>(request, response), testDataMain);
model.addAttribute("page", page);
testDataMain.setOrderBy("totalDate");
total(testDataMain,request,response,model);
return "modules/test/onetomany/testDataMainList";
}
/**
* 订票列表页面
*/
@RequiresPermissions("test:onetomany:testDataMain:list")
@RequestMapping(value = {"listVue"})
public String listVue(TestDataMain testDataMain, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<TestDataMain> page = testDataMainService.findPageCache(new Page<TestDataMain>(request, response), testDataMain);
//Page<TestDataMain> page = testDataMainService.findPage(new Page<TestDataMain>(request, response), testDataMain);
model.addAttribute("page", page);
return "modules/test/onetomany/testDataMainListVue";
}
/**
* 订票列表页面
*/
//RequiresPermissions("test:onetomany:testDataMain:select")
@RequestMapping(value = {"select"})
public String select(TestDataMain testDataMain, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<TestDataMain> page = testDataMainService.findPageCache(new Page<TestDataMain>(request, response), testDataMain);
//Page<TestDataMain> page = testDataMainService.findPage(new Page<TestDataMain>(request, response), testDataMain);
model.addAttribute("page", page);
return "modules/test/onetomany/testDataMainSelect";
}
/**
* 查看,增加,编辑订票表单页面
*/
@RequiresPermissions(value={"test:onetomany:testDataMain:view","test:onetomany:testDataMain:add","test:onetomany:testDataMain:edit"},logical=Logical.OR)
@RequestMapping(value = "form")
public String form(TestDataMain testDataMain, Model model, HttpServletRequest request, HttpServletResponse response) {
model.addAttribute("action", request.getParameter("action"));
model.addAttribute("testDataMain", testDataMain);
if(request.getParameter("ViewFormType")!=null && "FormTwo".equals(request.getParameter("ViewFormType"))) {
return "modules/test/onetomany/testDataMainFormTwo";
}
return "modules/test/onetomany/testDataMainForm";
}
/**
* 保存订票
*/
@RequiresPermissions(value={"test:onetomany:testDataMain:add","test:onetomany:testDataMain:edit"},logical=Logical.OR)
@RequestMapping(value = "save")
public String save(TestDataMain testDataMain, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request, HttpServletResponse response) {
if (!beanValidator(model, testDataMain)){
return form(testDataMain, model,request,response);
}
testDataMainService.save(testDataMain);
addMessage(redirectAttributes, "保存订票成功");
return "redirect:"+Global.getAdminPath()+"/test/onetomany/testDataMain/?repage";
}
/**
* 删除订票
*/
@RequiresPermissions("test:onetomany:testDataMain:del")
@RequestMapping(value = "delete")
public String delete(TestDataMain testDataMain, RedirectAttributes redirectAttributes) {
testDataMainService.delete(testDataMain);
addMessage(redirectAttributes, "删除订票成功");
return "redirect:"+Global.getAdminPath()+"/test/onetomany/testDataMain/?repage";
}
/**
* 删除订票(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequiresPermissions(value={"test:onetomany:testDataMain:del","test:onetomany:testDataMain:delByLogic"},logical=Logical.OR)
@RequestMapping(value = "deleteByLogic")
public String deleteByLogic(TestDataMain testDataMain, RedirectAttributes redirectAttributes) {
testDataMainService.deleteByLogic(testDataMain);
addMessage(redirectAttributes, "逻辑删除订票成功");
return "redirect:"+Global.getAdminPath()+"/test/onetomany/testDataMain/?repage";
}
/**
* 批量删除订票
*/
@RequiresPermissions("test:onetomany:testDataMain:del")
@RequestMapping(value = "deleteAll")
public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
String[] idArray = ids.split(",");
for(String id : idArray){
testDataMainService.delete(testDataMainService.get(id));
}
addMessage(redirectAttributes, "删除订票成功");
return "redirect:"+Global.getAdminPath()+"/test/onetomany/testDataMain/?repage";
}
/**
* 批量删除订票(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequiresPermissions(value={"test:onetomany:testDataMain:del","test:onetomany:testDataMain:delByLogic"},logical=Logical.OR)
@RequestMapping(value = "deleteAllByLogic")
public String deleteAllByLogic(String ids, RedirectAttributes redirectAttributes) {
String[] idArray = ids.split(",");
for(String id : idArray){
testDataMainService.deleteByLogic(testDataMainService.get(id));
}
addMessage(redirectAttributes, "删除订票成功");
return "redirect:"+Global.getAdminPath()+"/test/onetomany/testDataMain/?repage";
}
/**
* 导出excel文件
*/
@RequiresPermissions("test:onetomany:testDataMain:export")
@RequestMapping(value = "export", method=RequestMethod.POST)
public String exportFile(TestDataMain testDataMain, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "订票"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
Page<TestDataMain> page = testDataMainService.findPage(new Page<TestDataMain>(request, response, -1), testDataMain);
new ExportExcel("订票", TestDataMain.class).setDataList(page.getList()).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导出订票记录失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/test/onetomany/testDataMain/?repage";
}
/**
* 导入Excel数据
*/
@RequiresPermissions("test:onetomany:testDataMain:import")
@RequestMapping(value = "import", method=RequestMethod.POST)
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
try {
int successNum = 0;
ImportExcel ei = new ImportExcel(file, 1, 0);
List<TestDataMain> list = ei.getDataList(TestDataMain.class);
for (TestDataMain testDataMain : list){
testDataMainService.save(testDataMain);
}
addMessage(redirectAttributes, "已成功导入 "+successNum+" 条订票记录");
} catch (Exception e) {
addMessage(redirectAttributes, "导入订票失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/test/onetomany/testDataMain/?repage";
}
/**
* 下载导入订票数据模板
*/
@RequiresPermissions("test:onetomany:testDataMain:import")
@RequestMapping(value = "import/template")
public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "订票数据导入模板.xlsx";
List<TestDataMain> list = Lists.newArrayList();
new ExportExcel("订票数据", TestDataMain.class, 1).setDataList(list).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/test/onetomany/testDataMain/?repage";
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpringCloud</a> All rights reserved..
*/
package com.jeespring.modules.test.web.tree;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.jeespring.common.config.Global;
import com.jeespring.common.web.AbstractBaseController;
import com.jeespring.common.utils.StringUtils;
import com.jeespring.modules.test.entity.tree.TestTree;
import com.jeespring.modules.test.service.tree.TestTreeService;
/**
* 树Controller
* @author JeeSpring
* @version 2018-10-11
*/
@Controller
@RequestMapping(value = "${adminPath}/test/tree/testTree")
public class TestTreeController extends AbstractBaseController {
@Autowired
private TestTreeService testTreeService;
@ModelAttribute
public TestTree get(@RequestParam(required=false) String id) {
TestTree entity = null;
if (StringUtils.isNotBlank(id)){
entity = testTreeService.get(id);
}
if (entity == null){
entity = new TestTree();
}
return entity;
}
/**
* 树列表页面
*/
//@RequiresPermissions("test:tree:testTree:list")
@RequestMapping(value = {"list", ""})
public String list(TestTree testTree, HttpServletRequest request, HttpServletResponse response, Model model) {
List<TestTree> list = testTreeService.findList(testTree);
model.addAttribute("list", list);
return "modules/test/tree/testTreeList";
}
/**
* 查看,增加,编辑树表单页面
*/
//@RequiresPermissions(value={"test:tree:testTree:view","test:tree:testTree:add","test:tree:testTree:edit"},logical=Logical.OR)
@RequestMapping(value = "form")
public String form(TestTree testTree, Model model) {
if (testTree.getParent()!=null && StringUtils.isNotBlank(testTree.getParent().getId())){
testTree.setParent(testTreeService.get(testTree.getParent().getId()));
// 获取排序号,最末节点排序号+30
if (StringUtils.isBlank(testTree.getId())){
TestTree testTreeChild = new TestTree();
testTreeChild.setParent(new TestTree(testTree.getParent().getId()));
List<TestTree> list = testTreeService.findList(testTree);
if (list.size() > 0){
testTree.setSort(list.get(list.size()-1).getSort());
if (testTree.getSort() != null){
testTree.setSort(testTree.getSort() + 30);
}
}
}
}
if (testTree.getSort() == null){
testTree.setSort(30);
}
model.addAttribute("testTree", testTree);
return "modules/test/tree/testTreeForm";
}
/**
* 保存树
*/
//@RequiresPermissions(value={"test:tree:testTree:add","test:tree:testTree:edit"},logical=Logical.OR)
@RequestMapping(value = "save")
public String save(TestTree testTree, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, testTree)){
return form(testTree, model);
}
testTreeService.save(testTree);
addMessage(redirectAttributes, "保存树成功");
return "redirect:"+Global.getAdminPath()+"/test/tree/testTree/?repage";
}
/**
* 删除树
*/
//@RequiresPermissions("test:tree:testTree:del")
@RequestMapping(value = "delete")
public String delete(TestTree testTree, RedirectAttributes redirectAttributes) {
testTreeService.delete(testTree);
addMessage(redirectAttributes, "删除树成功");
return "redirect:"+Global.getAdminPath()+"/test/tree/testTree/?repage";
}
//@RequiresPermissions("user")
@ResponseBody
@RequestMapping(value = "treeData")
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId, HttpServletResponse response) {
List<Map<String, Object>> mapList = Lists.newArrayList();
List<TestTree> list = testTreeService.findList(new TestTree());
for (int i=0; i<list.size(); i++){
TestTree e = list.get(i);
if (StringUtils.isBlank(extId) || (extId!=null && !extId.equals(e.getId()) && e.getParentIds().indexOf(","+extId+",")==-1)){
Map<String, Object> map = Maps.newHashMap();
map.put("id", e.getId());
map.put("pId", e.getParentId());
map.put("name", e.getName());
mapList.add(map);
}
}
return mapList;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project name="act" default="welcome">
<!-- properties from key value -->
<property name="designs" value="designs" />
<property name="deployments" value="deployments" />
<!-- 显示欢迎信息以及操作提示 -->
<target name="welcome">
<echo>Activiti打包程序,请输入命令后操作!</echo>
</target>
<!-- 请假流程定义打包 -->
<target name="oa.leave">
<echo>打包流程定义:请假流程</echo>
<copy file="${designs}/oa/leave/leave.bpmn" tofile="${designs}/oa/leave/leave.bpmn20.xml" />
<zip destfile="${deployments}/oa/leave/leave.bar" basedir="${designs}/oa/leave" update="true" includes="*.xml,*.png" />
<delete file="${designs}/oa/leave/leave.bpmn20.xml" />
</target>
<!-- 请假流程定义打包-自定义表单 -->
<target name="oa.test_audit">
<echo>打包流程定义:测试审核流程</echo>
<copy file="${designs}/oa/test_audit/test_audit.bpmn" tofile="${designs}/oa/test_audit/test_audit.bpmn20.xml" />
<zip destfile="${deployments}/oa/test_audit/test_audit.bar" basedir="${designs}/oa/test_audit" update="true" includes="*.xml,*.png" />
<delete file="${designs}/oa/test_audit/test_audit.bpmn20.xml" />
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="com.thinkgem.jeesite.modules.oa.leave">
<process id="leave" name="请假流程" isExecutable="true">
<documentation>请假流程演示</documentation>
<startEvent id="startevent1" name="Start" activiti:initiator="applyUserId"></startEvent>
<userTask id="deptLeaderAudit" name="部门领导审批" activiti:candidateGroups="dept"></userTask>
<exclusiveGateway id="exclusivegateway5" name="Exclusive Gateway"></exclusiveGateway>
<userTask id="modifyApply" name="调整申请" activiti:assignee="${applyUserId}">
<extensionElements>
<activiti:taskListener event="complete" delegateExpression="${leaveModifyProcessor}"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="hrAudit" name="人事审批" activiti:candidateGroups="hr"></userTask>
<exclusiveGateway id="exclusivegateway6" name="Exclusive Gateway"></exclusiveGateway>
<userTask id="reportBack" name="销假" activiti:assignee="${applyUserId}">
<extensionElements>
<activiti:taskListener event="complete" delegateExpression="${leaveReportProcessor}"></activiti:taskListener>
</extensionElements>
</userTask>
<endEvent id="endevent1" name="End"></endEvent>
<exclusiveGateway id="exclusivegateway7" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow2" sourceRef="startevent1" targetRef="deptLeaderAudit"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="deptLeaderAudit" targetRef="exclusivegateway5"></sequenceFlow>
<sequenceFlow id="flow4" name="不同意" sourceRef="exclusivegateway5" targetRef="modifyApply">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!deptLeaderPass}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow5" name="同意" sourceRef="exclusivegateway5" targetRef="hrAudit">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${deptLeaderPass}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow6" sourceRef="hrAudit" targetRef="exclusivegateway6"></sequenceFlow>
<sequenceFlow id="flow7" name="同意" sourceRef="exclusivegateway6" targetRef="reportBack">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrPass}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow8" sourceRef="reportBack" targetRef="endevent1"></sequenceFlow>
<sequenceFlow id="flow9" name="不同意" sourceRef="exclusivegateway6" targetRef="modifyApply">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!hrPass}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow10" name="重新申请" sourceRef="exclusivegateway7" targetRef="deptLeaderAudit">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow11" sourceRef="modifyApply" targetRef="exclusivegateway7"></sequenceFlow>
<sequenceFlow id="flow12" name="结束流程" sourceRef="exclusivegateway7" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!reApply}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_leave">
<bpmndi:BPMNPlane bpmnElement="leave" id="BPMNPlane_leave">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="10.0" y="90.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="deptLeaderAudit" id="BPMNShape_deptLeaderAudit">
<omgdc:Bounds height="55.0" width="105.0" x="90.0" y="80.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway5" id="BPMNShape_exclusivegateway5">
<omgdc:Bounds height="40.0" width="40.0" x="250.0" y="87.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="modifyApply" id="BPMNShape_modifyApply">
<omgdc:Bounds height="55.0" width="105.0" x="218.0" y="190.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="hrAudit" id="BPMNShape_hrAudit">
<omgdc:Bounds height="55.0" width="105.0" x="358.0" y="80.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway6" id="BPMNShape_exclusivegateway6">
<omgdc:Bounds height="40.0" width="40.0" x="495.0" y="87.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reportBack" id="BPMNShape_reportBack">
<omgdc:Bounds height="55.0" width="105.0" x="590.0" y="80.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="625.0" y="283.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway7" id="BPMNShape_exclusivegateway7">
<omgdc:Bounds height="40.0" width="40.0" x="250.0" y="280.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="45.0" y="107.0"></omgdi:waypoint>
<omgdi:waypoint x="90.0" y="107.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="195.0" y="107.0"></omgdi:waypoint>
<omgdi:waypoint x="250.0" y="107.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="270.0" y="127.0"></omgdi:waypoint>
<omgdi:waypoint x="270.0" y="190.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="36.0" x="10.0" y="0.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="290.0" y="107.0"></omgdi:waypoint>
<omgdi:waypoint x="358.0" y="107.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="24.0" x="-24.0" y="-17.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="463.0" y="107.0"></omgdi:waypoint>
<omgdi:waypoint x="495.0" y="107.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="535.0" y="107.0"></omgdi:waypoint>
<omgdi:waypoint x="590.0" y="107.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="24.0" x="-22.0" y="-17.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
<omgdi:waypoint x="642.0" y="135.0"></omgdi:waypoint>
<omgdi:waypoint x="642.0" y="283.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="515.0" y="127.0"></omgdi:waypoint>
<omgdi:waypoint x="514.0" y="217.0"></omgdi:waypoint>
<omgdi:waypoint x="323.0" y="217.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="36.0" x="24.0" y="3.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="250.0" y="300.0"></omgdi:waypoint>
<omgdi:waypoint x="142.0" y="299.0"></omgdi:waypoint>
<omgdi:waypoint x="142.0" y="135.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="48.0" x="8.0" y="-1.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="270.0" y="245.0"></omgdi:waypoint>
<omgdi:waypoint x="270.0" y="280.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
<omgdi:waypoint x="290.0" y="300.0"></omgdi:waypoint>
<omgdi:waypoint x="625.0" y="300.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="48.0" x="-15.0" y="-20.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="test_audit" name="流程审批测试流程" isExecutable="true">
<startEvent id="start" name="启动审批" activiti:initiator="apply" activiti:formKey="/oa/testAudit/form"/>
<endEvent id="end" name="结束审批"/>
<userTask id="modify" name="员工薪酬档级修改" activiti:assignee="${apply}"/>
<userTask id="audit" name="薪酬主管初审" activiti:assignee="admin"/>
<exclusiveGateway id="sid-C28BB5F6-013D-4570-B432-61B380C1F46F"/>
<userTask id="audit2" name="集团人力资源部部长审核" activiti:assignee="admin"/>
<exclusiveGateway id="sid-ED46FE41-A0FD-496D-86DC-2C97AF5735F0"/>
<sequenceFlow id="sid-EF2F51BB-1D99-4F0B-ACF2-B6C1300A7D2B" sourceRef="audit2" targetRef="sid-ED46FE41-A0FD-496D-86DC-2C97AF5735F0"/>
<userTask id="audit3" name="集团人力资源部分管领导审核" activiti:assignee="admin"/>
<exclusiveGateway id="sid-FE485B2D-9A23-4236-BD0D-D788CA6E30E4"/>
<sequenceFlow id="sid-3DBCD661-5720-4480-8156-748BE0275FEF" sourceRef="audit3" targetRef="sid-FE485B2D-9A23-4236-BD0D-D788CA6E30E4"/>
<userTask id="audit4" name="集团总经理审批" activiti:assignee="admin"/>
<exclusiveGateway id="sid-3F53B6BD-F8F3-496B-AC08-50630BD11477"/>
<userTask id="apply_end" name="薪酬档级兑现" activiti:assignee="admin"/>
<sequenceFlow id="sid-02DB2AD9-1332-4198-AC8D-22A35169D15C" sourceRef="audit4" targetRef="sid-3F53B6BD-F8F3-496B-AC08-50630BD11477"/>
<sequenceFlow id="sid-2AB7C01A-50EE-4AAC-8C8F-F6E1935B3DA7" sourceRef="audit" targetRef="sid-C28BB5F6-013D-4570-B432-61B380C1F46F"/>
<sequenceFlow id="sid-36E50C8B-6C7C-4968-B02D-EBAA425BF4BE" sourceRef="start" targetRef="audit"/>
<sequenceFlow id="sid-7D723190-1432-411D-A4A4-774225E54CD9" name="是" sourceRef="sid-3F53B6BD-F8F3-496B-AC08-50630BD11477" targetRef="apply_end">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-D44CAD43-0271-4920-A524-9B8533E52550" name="是" sourceRef="sid-FE485B2D-9A23-4236-BD0D-D788CA6E30E4" targetRef="audit4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-53258502-43EE-4DE8-B1A4-DBD11922B8AF" name="否" sourceRef="sid-C28BB5F6-013D-4570-B432-61B380C1F46F" targetRef="modify">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass==0}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="sid-5FED02D6-C388-48C6-870E-097DB2131EA0"/>
<sequenceFlow id="sid-163DBC60-DBC9-438B-971A-67738FB7715A" sourceRef="modify" targetRef="sid-5FED02D6-C388-48C6-870E-097DB2131EA0"/>
<sequenceFlow id="sid-72258A41-203E-428C-B71D-CA3506252D73" name="是" sourceRef="sid-C28BB5F6-013D-4570-B432-61B380C1F46F" targetRef="audit2">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-8448EF4A-B62E-4899-ABC2-0E2DB2AE6838" name="重新申请" sourceRef="sid-5FED02D6-C388-48C6-870E-097DB2131EA0" targetRef="audit">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-A7589084-4623-4FEA-A774-00A70DDC1D20" name="是" sourceRef="sid-ED46FE41-A0FD-496D-86DC-2C97AF5735F0" targetRef="audit3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-FA618636-3708-4D0C-8514-29A4BB8BC926" name="否" sourceRef="sid-ED46FE41-A0FD-496D-86DC-2C97AF5735F0" targetRef="modify">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-1525BFF4-3E9D-4D8A-BF80-1F63AFE16289" name="否" sourceRef="sid-FE485B2D-9A23-4236-BD0D-D788CA6E30E4" targetRef="modify">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-35CC8C6C-1067-4398-991C-CCF955115965" name="否" sourceRef="sid-3F53B6BD-F8F3-496B-AC08-50630BD11477" targetRef="modify">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sid-BDB0AAB2-7E50-4D35-80EE-CE0BECDD9F57" sourceRef="apply_end" targetRef="end"/>
<sequenceFlow id="sid-44AFB9C1-4057-4C48-B1F2-1EC897A52CB7" name="销毁" sourceRef="sid-5FED02D6-C388-48C6-870E-097DB2131EA0" targetRef="end">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass==0}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_test_audit">
<bpmndi:BPMNPlane bpmnElement="test_audit" id="BPMNPlane_test_audit">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="30.0" width="30.0" x="30.0" y="245.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="28.0" width="28.0" x="975.0" y="356.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="modify" id="BPMNShape_modify">
<omgdc:Bounds height="58.0" width="102.0" x="209.0" y="135.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="audit" id="BPMNShape_audit">
<omgdc:Bounds height="57.0" width="96.0" x="105.0" y="231.5"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-C28BB5F6-013D-4570-B432-61B380C1F46F" id="BPMNShape_sid-C28BB5F6-013D-4570-B432-61B380C1F46F">
<omgdc:Bounds height="40.0" width="40.0" x="240.0" y="240.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="audit2" id="BPMNShape_audit2">
<omgdc:Bounds height="80.0" width="100.0" x="210.0" y="330.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-ED46FE41-A0FD-496D-86DC-2C97AF5735F0" id="BPMNShape_sid-ED46FE41-A0FD-496D-86DC-2C97AF5735F0">
<omgdc:Bounds height="40.0" width="40.0" x="345.0" y="350.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="audit3" id="BPMNShape_audit3">
<omgdc:Bounds height="80.0" width="100.0" x="420.0" y="330.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-FE485B2D-9A23-4236-BD0D-D788CA6E30E4" id="BPMNShape_sid-FE485B2D-9A23-4236-BD0D-D788CA6E30E4">
<omgdc:Bounds height="40.0" width="40.0" x="555.0" y="350.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="audit4" id="BPMNShape_audit4">
<omgdc:Bounds height="80.0" width="100.0" x="630.0" y="330.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-3F53B6BD-F8F3-496B-AC08-50630BD11477" id="BPMNShape_sid-3F53B6BD-F8F3-496B-AC08-50630BD11477">
<omgdc:Bounds height="40.0" width="40.0" x="765.0" y="350.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="apply_end" id="BPMNShape_apply_end">
<omgdc:Bounds height="80.0" width="100.0" x="840.0" y="330.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-5FED02D6-C388-48C6-870E-097DB2131EA0" id="BPMNShape_sid-5FED02D6-C388-48C6-870E-097DB2131EA0">
<omgdc:Bounds height="40.0" width="40.0" x="240.0" y="45.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-3DBCD661-5720-4480-8156-748BE0275FEF" id="BPMNEdge_sid-3DBCD661-5720-4480-8156-748BE0275FEF">
<omgdi:waypoint x="520.0" y="370.0"/>
<omgdi:waypoint x="555.0" y="370.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-44AFB9C1-4057-4C48-B1F2-1EC897A52CB7" id="BPMNEdge_sid-44AFB9C1-4057-4C48-B1F2-1EC897A52CB7">
<omgdi:waypoint x="280.0" y="65.0"/>
<omgdi:waypoint x="989.0" y="65.0"/>
<omgdi:waypoint x="989.0" y="356.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-8448EF4A-B62E-4899-ABC2-0E2DB2AE6838" id="BPMNEdge_sid-8448EF4A-B62E-4899-ABC2-0E2DB2AE6838">
<omgdi:waypoint x="240.0" y="65.0"/>
<omgdi:waypoint x="153.0" y="65.0"/>
<omgdi:waypoint x="153.0" y="231.5"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-A7589084-4623-4FEA-A774-00A70DDC1D20" id="BPMNEdge_sid-A7589084-4623-4FEA-A774-00A70DDC1D20">
<omgdi:waypoint x="385.0" y="370.0"/>
<omgdi:waypoint x="420.0" y="370.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-35CC8C6C-1067-4398-991C-CCF955115965" id="BPMNEdge_sid-35CC8C6C-1067-4398-991C-CCF955115965">
<omgdi:waypoint x="785.0" y="350.0"/>
<omgdi:waypoint x="785.0" y="164.0"/>
<omgdi:waypoint x="311.0" y="164.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-EF2F51BB-1D99-4F0B-ACF2-B6C1300A7D2B" id="BPMNEdge_sid-EF2F51BB-1D99-4F0B-ACF2-B6C1300A7D2B">
<omgdi:waypoint x="310.0" y="370.0"/>
<omgdi:waypoint x="345.0" y="370.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-7D723190-1432-411D-A4A4-774225E54CD9" id="BPMNEdge_sid-7D723190-1432-411D-A4A4-774225E54CD9">
<omgdi:waypoint x="805.0" y="370.0"/>
<omgdi:waypoint x="840.0" y="370.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-2AB7C01A-50EE-4AAC-8C8F-F6E1935B3DA7" id="BPMNEdge_sid-2AB7C01A-50EE-4AAC-8C8F-F6E1935B3DA7">
<omgdi:waypoint x="201.0" y="260.0"/>
<omgdi:waypoint x="240.0" y="260.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-D44CAD43-0271-4920-A524-9B8533E52550" id="BPMNEdge_sid-D44CAD43-0271-4920-A524-9B8533E52550">
<omgdi:waypoint x="595.0" y="370.0"/>
<omgdi:waypoint x="630.0" y="370.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-FA618636-3708-4D0C-8514-29A4BB8BC926" id="BPMNEdge_sid-FA618636-3708-4D0C-8514-29A4BB8BC926">
<omgdi:waypoint x="365.0" y="350.0"/>
<omgdi:waypoint x="365.0" y="164.0"/>
<omgdi:waypoint x="311.0" y="164.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-02DB2AD9-1332-4198-AC8D-22A35169D15C" id="BPMNEdge_sid-02DB2AD9-1332-4198-AC8D-22A35169D15C">
<omgdi:waypoint x="730.0" y="370.0"/>
<omgdi:waypoint x="765.0" y="370.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-36E50C8B-6C7C-4968-B02D-EBAA425BF4BE" id="BPMNEdge_sid-36E50C8B-6C7C-4968-B02D-EBAA425BF4BE">
<omgdi:waypoint x="60.0" y="260.0"/>
<omgdi:waypoint x="105.0" y="260.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-53258502-43EE-4DE8-B1A4-DBD11922B8AF" id="BPMNEdge_sid-53258502-43EE-4DE8-B1A4-DBD11922B8AF">
<omgdi:waypoint x="260.0" y="240.0"/>
<omgdi:waypoint x="260.0" y="193.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-163DBC60-DBC9-438B-971A-67738FB7715A" id="BPMNEdge_sid-163DBC60-DBC9-438B-971A-67738FB7715A">
<omgdi:waypoint x="260.0" y="135.0"/>
<omgdi:waypoint x="260.0" y="85.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-BDB0AAB2-7E50-4D35-80EE-CE0BECDD9F57" id="BPMNEdge_sid-BDB0AAB2-7E50-4D35-80EE-CE0BECDD9F57">
<omgdi:waypoint x="940.0" y="370.0"/>
<omgdi:waypoint x="975.0" y="370.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-1525BFF4-3E9D-4D8A-BF80-1F63AFE16289" id="BPMNEdge_sid-1525BFF4-3E9D-4D8A-BF80-1F63AFE16289">
<omgdi:waypoint x="575.0" y="350.0"/>
<omgdi:waypoint x="575.0" y="164.0"/>
<omgdi:waypoint x="311.0" y="164.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-72258A41-203E-428C-B71D-CA3506252D73" id="BPMNEdge_sid-72258A41-203E-428C-B71D-CA3506252D73">
<omgdi:waypoint x="260.0" y="280.0"/>
<omgdi:waypoint x="260.0" y="330.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
server:
port: 9996
tomcat:
uri-encoding: UTF-8
basedir: /data/jeespring/tomcat
max-threads: 2000
min-spare-threads: 10
accesslog:
pattern: common
enabled: true
directory: ../logs
prefix: jeespring_access_log
suffix: .log
request-attributes-enabled: true
rename-on-rotate: true
ssl:
key-store: classpath:keystore.p12
key-store-password: jeespring
keyStoreType: PKCS12
keyAlias: tomcat
#启动热部署
jsp-servlet.init-parameters.development: true
http:
port: 8886
logging:
level:
root: INFO
#WARN、DEBUG、INFO;DEBUG: 设置为DEBUG会打印SQL语句
com.jeespring: WARN
com.jeespring.modules.cms: DEBUG
com.company: DEBUG
org.apache.shiro.cache.ehcache.EhCacheManager: WARN
#如果不需要启用安全验证 spring boot admin
management:
security:
#enabled: false
info: #定义各种额外的详情给服务端显示
app:
name: "@project.name@" #从pom.xml中获取
description: "@project.description@"
version: "@project.version@"
spring-boot-version: "@project.parent.version@"
spring:
#dubbo的消费者和提供者配置,默认为消费者dubboConsumer。如果要启用提供者,请配置为dubboProvider。
#profiles:
#active: dubboConsumer
application:
name: jeeSpring
#spring boot admin
boot:
admin:
#client:
#prefer-ip: true # 解决windows下运行时无法识别主机名的问题
#url: http://localhost:8999
#数据库的配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
#mysql
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/jeespring?useUnicode=true&characterEncoding=utf-8
#oracle
#driverClassName: oracle.jdbc.driver.OracleDriver
#jdbc:oracle:thin:@127.0.0.1:1521:orcl
username: root
password: root
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
initialSize: 5
minIdle: 3
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 30000
validationQuery: SELECT 'x' FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,wall,slf4j
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 合并多个DruidDataSource的监控数据
useGlobalDataSourceStat: true
#springMvc的配置
mvc:
view:
prefix: /WEB-INF/views/
suffix: .jsp
servlet:
load-on-startup: 1
#spring-ehcache的配置
cache:
type: ehcache
ehcache:
config: classpath:ehcache.xml
#spring-redis的配置
redis:
hostName: 127.0.0.1
port: 6379
password: 123456
pool:
maxActive: 8
maxWait: -1
maxIdle: 8
minIdle: 0
timeout: 0
keyPrefix: JeeSpring_ #Redis key 前缀
run: true #Redis是否启动
listFlush: true #list记录根据添加修改删除自动清除
expireTime: 900 #缓存有效时间15分钟
expireTimeShiro: 1800 #缓存有效时间30分钟
######################################### 使用activemq队列是,取消下面注解
activemq:
broker-url: tcp://localhost:61616
in-memory: true # Specify if the default broker URL should be in memory. Ignored if an explicit broker has been specified.
password: admin # Login password of the broker.
user: admin # Login user of the broker.
packages:
trust-all: true # Trust all packages.
trusted: # Comma-separated list of specific packages to trust (when not trusting all packages).
pool:
configuration.*: # See PooledConnectionFactory.
enabled: true # Whether a PooledConnectionFactory should be created instead of a regular ConnectionFactory.
expiry-timeout: 0 # Connection expiration timeout in milliseconds.
idle-timeout: 30000 # Connection idle timeout in milliseconds.
max-connections: 1 # Maximum number of pooled connections.
#mybatis的配置
mybatis:
config-location: classpath:/mybatis-config.xml
mapper-locations: classpath*:/mappings/**/*.xml
type-aliases-package: com.jeespring,com.company
#admin页面管理Path
adminPath: /admin
frontPath: /cms
urlSuffix: .html
#分页配置
page:
pageSize: 10
#文件上传的路径
userfiles:
basedir: /data/jeespring/upload
#系统发生邮件服务账号密码
email:
from: 516821420@qq.com
fromName: jeespring
username: 516821420@qq.com
password: nxpnalicxljjcaec
job:
company:
companyScheduledTaskService:
run: 0 0/1 9-19 * * ? #朝九晚五工作时间内每半小时
#run: 0 0 10,14,16 * * ? 每天上午10点,下午2点,4点
#run: 0 0 12 * * ?" 每天中午12点触发
jeeSrping:
JeeSpringScheduledTaskService:
run: 5000
#run: 0 0 10,14,16 * * ? 每天上午10点,下午2点,4点
#run: 0 0 12 * * ?" 每天中午12点触发
demoMode: false
demoModeDescription: 演示版启用,为系统能正常演示,暂时不允许操作!系统配置可开启正式版!功能全开源!每周周一再更新!
# Shiro权限配置
shiro:
redis: false #启动shiro redis缓存,单点登录,##单点登录性能有带提升##
user:
# 登录地址
loginUrl: /admin/login
# 权限认证失败地址
unauthorizedUrl: /admin/login
cookie:
# 设置Cookie的域名 默认空,即当前访问的域名
domain:
# 设置cookie的有效访问路径
path: /
# 设置HttpOnly属性
httpOnly: true
# 设置Cookie的过期时间,天为单位
maxAge: 30
session:
# Session超时时间(默认30分钟)
expireTime: 30
# 同步session到数据库的周期(默认1分钟)
dbSyncPeriod: 1
# 相隔多久检查一次session的有效性,默认就是10分钟
validationInterval: 10
#dubbo客户端,使用dubbo时,请启动zookeeper
#dubbo:
# application:
# name: consumer
# registry:
# address: zookeeper://127.0.0.1:2181
# scan:
# base-packages: com.jeespring.modules.server.web
# run: true
#dubbo服务端
#dubbo:
application:
name: provider
registry:
address: zookeeper://127.0.0.1:2181
protocol:
name: dubbo
port: 20880
scan:
base-packages: com.jeespring.modules.server.service
run: true
security:
basic:
enabled: false
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment