新增员工业务逻辑,优化登录账号权限,更新设计文档

This commit is contained in:
易焱 2019-08-01 01:15:16 +08:00
parent db4e6b237a
commit 8740a34a4a
37 changed files with 726 additions and 202 deletions

View File

@ -52,7 +52,6 @@
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.0.1" level="project" /> <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.18" level="project" /> <orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.18" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" /> <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
<orderEntry type="module" module-name="business" />
<orderEntry type="module" module-name="shiro" /> <orderEntry type="module" module-name="shiro" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.4.0" level="project" /> <orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.4.0" level="project" /> <orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.4.0" level="project" />

View File

@ -31,11 +31,6 @@
<artifactId>system</artifactId> <artifactId>system</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.cwhelp.modules</groupId>
<artifactId>business</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>com.cwhelp.component</groupId> <groupId>com.cwhelp.component</groupId>
<artifactId>shiro</artifactId> <artifactId>shiro</artifactId>

View File

@ -27,6 +27,7 @@ import java.util.List;
* @author yan.y * @author yan.y
* @date 2019/07/29 * @date 2019/07/29
*/ */
@Controller
@RequestMapping("/bss/dept") @RequestMapping("/bss/dept")
public class BssDeptController { public class BssDeptController {
@ -64,24 +65,24 @@ public class BssDeptController {
@GetMapping("/add") @GetMapping("/add")
@RequiresPermissions("bss:dept:add") @RequiresPermissions("bss:dept:add")
public String toAdd(Model model,BssPlatform bssPlatform) { public String toAdd(Model model,BssPlatform bssPlatform) {
Sort sort = new Sort(Sort.Direction.DESC, "createDate"); List<BssPlatform> list = getBssPlatforms(bssPlatform);
ExampleMatcher matcher = ExampleMatcher.matching();
Example<BssPlatform> example = Example.of(bssPlatform, matcher);
List<BssPlatform> list = bssPlatformService.getListByExample(example, sort);
model.addAttribute("bssPlatforms",list); model.addAttribute("bssPlatforms",list);
return "/business/dept/add"; return "/business/dept/add";
} }
private List<BssPlatform> getBssPlatforms(BssPlatform bssPlatform) {
Sort sort = new Sort(Sort.Direction.DESC, "createDate");
Example<BssPlatform> example = Example.of(bssPlatform, ExampleMatcher.matching());
return bssPlatformService.getListByExample(example, sort);
}
/** /**
* 跳转到编辑页面 * 跳转到编辑页面
*/ */
@GetMapping("/edit/{id}") @GetMapping("/edit/{id}")
@RequiresPermissions("bss:dept:edit") @RequiresPermissions("bss:dept:edit")
public String toEdit(@PathVariable("id") BssDept bssDept, Model model) { public String toEdit(@PathVariable("id") BssDept bssDept, Model model) {
Sort sort = new Sort(Sort.Direction.DESC, "createDate"); List<BssPlatform> list = getBssPlatforms(new BssPlatform());
ExampleMatcher matcher = ExampleMatcher.matching();
Example<BssPlatform> example = Example.of(new BssPlatform(), matcher);
List<BssPlatform> list = bssPlatformService.getListByExample(example, sort);
model.addAttribute("bssPlatforms",list); model.addAttribute("bssPlatforms",list);
model.addAttribute("dept", bssDept); model.addAttribute("dept", bssDept);
return "/business/dept/add"; return "/business/dept/add";

View File

@ -0,0 +1,121 @@
package com.cwhelp.admin.business.controller;
import com.cwhelp.admin.business.validator.BssEmployeeValid;
import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.common.utils.EntityBeanUtil;
import com.cwhelp.common.utils.ResultVoUtil;
import com.cwhelp.common.utils.StatusUtil;
import com.cwhelp.common.vo.ResultVo;
import com.cwhelp.modules.business.domain.BssEmployee;
import com.cwhelp.modules.business.service.BssEmployeeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.ExampleMatcher;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author yan.y
* @date 2019/07/31
*/
@Controller
@RequestMapping("/bss/employee")
public class BssEmployeeController {
@Autowired
private BssEmployeeService bssEmployeeService;
/**
* 列表页面
*/
@GetMapping("/index")
@RequiresPermissions("bss:employee:index")
public String index(Model model, BssEmployee bssEmployee) {
// 创建匹配器进行动态查询匹配
ExampleMatcher matcher = ExampleMatcher.matching()
.withMatcher("name", match -> match.contains());
// 获取数据列表
Example<BssEmployee> example = Example.of(bssEmployee, matcher);
Page<BssEmployee> list = bssEmployeeService.getPageList(example);
// 封装数据
model.addAttribute("list", list.getContent());
model.addAttribute("page", list);
return "/business/employee/index";
}
/**
* 跳转到添加页面
*/
@GetMapping("/add")
@RequiresPermissions("bss:employee:add")
public String toAdd() {
return "/business/employee/add";
}
/**
* 跳转到编辑页面
*/
@GetMapping("/edit/{id}")
@RequiresPermissions("bss:employee:edit")
public String toEdit(@PathVariable("id") BssEmployee bssEmployee, Model model) {
model.addAttribute("bssEmployee", bssEmployee);
return "/business/employee/add";
}
/**
* 保存添加/修改的数据
* @param valid 验证对象
*/
@PostMapping({"/add","/edit"})
@RequiresPermissions({"bss:employee::add","bss:employee:edit"})
@ResponseBody
public ResultVo save(@Validated BssEmployeeValid valid, BssEmployee bssEmployee) {
// 复制保留无需修改的数据
if (bssEmployee.getId() != null) {
BssEmployee beBssEmployee = bssEmployeeService.getById(bssEmployee.getId());
EntityBeanUtil.copyProperties(beBssEmployee, bssEmployee);
}
// 保存数据
bssEmployeeService.save(bssEmployee);
return ResultVoUtil.SAVE_SUCCESS;
}
/**
* 跳转到详细页面
*/
@GetMapping("/detail/{id}")
@RequiresPermissions("bss:employee:detail")
public String toDetail(@PathVariable("id") BssEmployee bssEmployee, Model model) {
model.addAttribute("bssEmployee",bssEmployee);
return "/business/employee/detail";
}
/**
* 设置一条或者多条数据的状态
*/
@RequestMapping("/status/{param}")
@RequiresPermissions("bss:employee:status")
@ResponseBody
public ResultVo status(
@PathVariable("param") String param,
@RequestParam(value = "ids", required = false) List<Long> ids) {
// 更新状态
StatusEnum statusEnum = StatusUtil.getStatusEnum(param);
if (bssEmployeeService.updateStatus(statusEnum, ids)) {
return ResultVoUtil.success(statusEnum.getMessage() + "成功");
} else {
return ResultVoUtil.error(statusEnum.getMessage() + "失败,请重新操作");
}
}
}

View File

@ -0,0 +1,36 @@
package com.cwhelp.admin.business.validator;
import lombok.Data;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
/**
* @author yan.y
* @date 2019/07/31
*/
@Data
public class BssEmployeeValid implements Serializable {
@NotEmpty(message = "名称不能为空")
private String name;
@NotNull(message = "部门不能为空")
private Long dept_id;
@NotEmpty(message = "职位不能为空")
private String position;
@NotEmpty(message = "手机号码不能为空")
@Pattern(regexp = "^((17[0-9])|(14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$", message = "手机号码格式不正确")
private String phone_num;
@NotEmpty(message = "身份证号码不能为空")
@Pattern(regexp = "(^(\\d{14}|\\d{17})(\\d|[xX])$)?", message = "身份证号码错误")
private String card;
@NotEmpty(message = "邮箱不能为空")
@Email(message = "邮箱格式不正确")
private String email;
@NotEmpty(message = "员工状态不能为空")
private String employee_status;
@NotEmpty(message = "学历不能为空")
private String education;
}

View File

@ -17,6 +17,8 @@ import com.cwhelp.component.actionLog.annotation.EntityParam;
import com.cwhelp.component.excel.ExcelUtil; import com.cwhelp.component.excel.ExcelUtil;
import com.cwhelp.component.fileUpload.config.properties.UploadProjectProperties; import com.cwhelp.component.fileUpload.config.properties.UploadProjectProperties;
import com.cwhelp.component.shiro.ShiroUtil; import com.cwhelp.component.shiro.ShiroUtil;
import com.cwhelp.modules.business.domain.BssPlatform;
import com.cwhelp.modules.business.service.BssPlatformService;
import com.cwhelp.modules.system.domain.Role; import com.cwhelp.modules.system.domain.Role;
import com.cwhelp.modules.system.domain.User; import com.cwhelp.modules.system.domain.User;
import com.cwhelp.modules.system.repository.UserRepository; import com.cwhelp.modules.system.repository.UserRepository;
@ -26,6 +28,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.ExampleMatcher;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -56,13 +60,16 @@ public class UserController {
@Autowired @Autowired
private RoleService roleService; private RoleService roleService;
@Autowired
private BssPlatformService bssPlatformService;
/** /**
* 列表页面 * 列表页面
*/ */
@GetMapping("/index") @GetMapping("/index")
@RequiresPermissions("system:user:index") @RequiresPermissions("system:user:index")
public String index(Model model, User user) { public String index(Model model) {
User user = ShiroUtil.getSubject();
// 获取用户列表 // 获取用户列表
Page<User> list = userService.getPageList(user); Page<User> list = userService.getPageList(user);
@ -78,7 +85,10 @@ public class UserController {
*/ */
@GetMapping("/add") @GetMapping("/add")
@RequiresPermissions("system:user:add") @RequiresPermissions("system:user:add")
public String toAdd() { public String toAdd(Model model) {
User user = ShiroUtil.getSubject();
List<BssPlatform> list = getBssPlatforms(user);
model.addAttribute("bssPlatforms",list);
return "/system/user/add"; return "/system/user/add";
} }
@ -88,10 +98,27 @@ public class UserController {
@GetMapping("/edit/{id}") @GetMapping("/edit/{id}")
@RequiresPermissions("system:user:edit") @RequiresPermissions("system:user:edit")
public String toEdit(@PathVariable("id") User user, Model model) { public String toEdit(@PathVariable("id") User user, Model model) {
User subjectUser = ShiroUtil.getSubject();
List<BssPlatform> list = getBssPlatforms(subjectUser);
model.addAttribute("bssPlatforms",list);
model.addAttribute("user", user); model.addAttribute("user", user);
return "/system/user/add"; return "/system/user/add";
} }
private List<BssPlatform> getBssPlatforms(@PathVariable("id") User user) {
Long platformId = user.getBssPlatform().getId();
List<BssPlatform> list = null;
//当前账号属于财务帮 查询出所有平台
if (platformId == 1) {
list = bssPlatformService.getListByExample(Example.of(new BssPlatform(), ExampleMatcher.matching()), new Sort(Sort.Direction.DESC, "createDate"));
} else {
BssPlatform bssPlatform = new BssPlatform();
bssPlatform.setId(platformId);
list = bssPlatformService.getListByExample(Example.of(bssPlatform, ExampleMatcher.matching()), new Sort(Sort.Direction.DESC, "createDate"));
}
return list;
}
/** /**
* 保存添加/修改的数据 * 保存添加/修改的数据
* @param valid 验证对象 * @param valid 验证对象

View File

@ -25,4 +25,6 @@ public class UserValid implements Serializable {
private String phone; private String phone;
@NotNull(message = "所在部门不能为空") @NotNull(message = "所在部门不能为空")
private Dept dept; private Dept dept;
@NotEmpty(message = "类型不能为空")
private String type;
} }

View File

@ -1,2 +1,2 @@
/** layui-v2.3.0 MIT License By https://www.layui.com */ /** layui-v2.3.0 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"&#xe619;":"&#xe603;")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"&#xe61a;":"&#xe602;")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("templates.business.dept.add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e, i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)}); ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"&#xe619;":"&#xe603;")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"&#xe61a;":"&#xe602;")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("templates.business.employee.add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e, i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
<div class="layui-form timo-compile">
<form th:action="@{/bss/employee/add}">
<input type="hidden" name="id" th:if="${bssEmployee}" th:value="${bssEmployee.id}">
<div class="layui-form-item">
<label class="layui-form-label required">名称</label>
<div class="layui-input-inline">
<input class="layui-input" type="text" name="name" placeholder="请输入名称" th:value="${bssEmployee?.name}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">部门</label>
<div class="layui-input-inline">
<input class="layui-input" type="text" name="dept_id" placeholder="请输入部门" th:value="${bssEmployee?.dept_id}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">职位</label>
<div class="layui-input-inline">
<input class="layui-input" type="text" name="position" placeholder="请输入职位" th:value="${bssEmployee?.position}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">手机号码</label>
<div class="layui-input-inline">
<input class="layui-input" type="text" name="phone_num" placeholder="请输入手机号码" th:value="${bssEmployee?.phone_num}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">身份证号码</label>
<div class="layui-input-inline">
<input class="layui-input" type="text" name="card" placeholder="请输入身份证号码" th:value="${bssEmployee?.card}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">邮箱</label>
<div class="layui-input-inline">
<input class="layui-input" type="text" name="email" placeholder="请输入邮箱" th:value="${bssEmployee?.email}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">员工状态</label>
<div class="layui-input-inline">
<select name="employeeStatus" mo:dict="EMPLOYEE_TYPE" mo-selected="${bssEmployee?.employeeStatus}" mo-empty="" lay-verify="employeeStatus"></select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">学历</label>
<div class="layui-input-inline">
<select name="education" mo:dict="EDUCATION" mo-selected="${bssEmployee?.education}" mo-empty="" lay-verify="education"></select>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea placeholder="请输入内容" class="layui-textarea" name="remark">[[${bssEmployee?.remark}]]</textarea>
</div>
</div>
<div class="layui-form-item timo-finally">
<button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
<button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
</div>
</form>
</div>
<script th:replace="/common/template :: script"></script>
</body>
</html>

View File

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
<div class="timo-detail-page">
<div class="timo-detail-title">基本信息</div>
<table class="layui-table timo-detail-table">
<colgroup>
<col width="100px"><col>
<col width="100px"><col>
</colgroup>
<tbody>
<tr>
<th>主键ID</th>
<td th:text="${bssEmployee.id}"></td>
<th>名称</th>
<td th:text="${bssEmployee.name}"></td>
</tr>
<tr>
<th>部门</th>
<td th:text="${bssEmployee.bssDept?.name}"></td>
<th>职位</th>
<td th:text="${bssEmployee.position}"></td>
</tr>
<tr>
<th>手机号码</th>
<td th:text="${bssEmployee.phoneNum}"></td>
<th>身份证号码</th>
<td th:text="${bssEmployee.card}"></td>
</tr>
<tr>
<th>邮箱</th>
<td th:text="${bssEmployee.email}"></td>
<th>员工状态</th>
<td th:text="${#dicts.keyValue('EMPLOYEE_TYPE', bssEmployee.employeeStatus)}"></td>
</tr>
<tr>
<th>学历</th>
<td th:text="${#dicts.keyValue('EDUCATION', bssEmployee.education)}" colspan="3"></td>
</tr>
<tr>
<th>创建者</th>
<td th:text="${bssEmployee.createBy?.nickname}"></td>
<th>更新者</th>
<td th:text="${bssEmployee.updateBy?.nickname}"></td>
</tr>
<tr>
<th>创建时间</th>
<td th:text="${#dates.format(bssEmployee.createDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
<th>更新时间</th>
<td th:text="${#dates.format(bssEmployee.updateDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
</tr>
<tr>
<th>备注</th>
<td th:text="${bssEmployee.remark}" colspan="3"></td>
</tr>
</tbody>
</table>
</div>
<script th:replace="/common/template :: script"></script>
</body>
</html>

View File

@ -0,0 +1,102 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body class="timo-layout-page">
<div class="layui-card">
<div class="layui-card-header timo-card-header">
<span><i class="fa fa-bars"></i> 员工管理</span>
<i class="layui-icon layui-icon-refresh refresh-btn"></i>
</div>
<div class="layui-card-body">
<div class="layui-row timo-card-screen">
<div class="pull-left layui-form-pane timo-search-box">
<div class="layui-inline">
<label class="layui-form-label">状态</label>
<div class="layui-input-block timo-search-status">
<select class="timo-search-select" name="status" mo:dict="SEARCH_STATUS" mo-selected="${param.status}"></select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">名称</label>
<div class="layui-input-block">
<input type="text" name="name" th:value="${param.name}" placeholder="请输入名称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">手机号码</label>
<div class="layui-input-block">
<input type="text" name="phone_num" th:value="${param.phoneNum}" placeholder="请输入手机号码" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<button class="layui-btn timo-search-btn">
<i class="fa fa-search"></i>
</button>
</div>
</div>
<div class="pull-right screen-btn-group">
<button class="layui-btn open-popup" data-title="添加员工" th:attr="data-url=@{/bss/employee/add}" data-size="auto">
<i class="fa fa-plus"></i> 添加</button>
<div class="btn-group">
<button class="layui-btn">操作<span class="caret"></span></button>
<dl class="layui-nav-child layui-anim layui-anim-upbit">
<dd><a class="ajax-status" th:href="@{/bss/employee/status/ok}">启用</a></dd>
<dd><a class="ajax-status" th:href="@{/bss/employee/status/freezed}">冻结</a></dd>
<dd><a class="ajax-status" th:href="@{/bss/employee/status/delete}">删除</a></dd>
</dl>
</div>
</div>
</div>
<div class="timo-table-wrap">
<table class="layui-table timo-table">
<thead>
<tr>
<th class="timo-table-checkbox">
<label class="timo-checkbox"><input type="checkbox">
<i class="layui-icon layui-icon-ok"></i></label>
</th>
<th>名称</th>
<th>部门</th>
<th>职位</th>
<th>手机号码</th>
<th>身份证号码</th>
<th>邮箱</th>
<th>员工状态</th>
<th>学历</th>
<th>创建时间</th>
<th>更新时间</th>
<th>数据状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr th:each="item:${list}">
<td><label class="timo-checkbox"><input type="checkbox" th:value="${item.id}">
<i class="layui-icon layui-icon-ok"></i></label></td>
<td th:text="${item.name}">名称</td>
<td th:text="${item.bssDept.name}">部门</td>
<td th:text="${item.position}">职位</td>
<td th:text="${item.phoneNum}">手机号码</td>
<td th:text="${item.card}">身份证号码</td>
<td th:text="${item.email}">邮箱</td>
<td th:text="${#dicts.keyValue('EMPLOYEE_TYPE', item.type)}">员工状态</td>
<td th:text="${#dicts.keyValue('EDUCATION', item.type)}">学历</td>
<td th:text="${#dates.format(item.createDate, 'yyyy-MM-dd HH:mm:ss')}">创建时间</td>
<td th:text="${#dates.format(item.updateDate, 'yyyy-MM-dd HH:mm:ss')}">更新时间</td>
<td th:text="${#dicts.dataStatus(item.status)}">数据状态</td>
<td>
<a class="open-popup" data-title="编辑员工" th:attr="data-url=@{'/bss/employee/edit/'+${item.id}}" data-size="auto" href="#">编辑</a>
<a class="open-popup" data-title="详细信息" th:attr="data-url=@{'/bss/employee/detail/'+${item.id}}" data-size="800,600" href="#">详细</a>
<a class="ajax-get" data-msg="您是否确认删除" th:href="@{/bss/employee/status/delete(ids=${item.id})}">删除</a>
</td>
</tr>
</tbody>
</table>
</div>
<div th:replace="/common/fragment :: page"></div>
</div>
</div>
<script th:replace="/common/template :: script"></script>
</body>
</html>

View File

@ -31,7 +31,7 @@
</tr> </tr>
<tr> <tr>
<th>类型</th> <th>类型</th>
<td th:text="${platform.type}" colspan="3"></td> <td th:text="${#dicts.keyValue('BSS_PLATFORM_TYPE', platform.type)}" colspan="3"></td>
</tr> </tr>
<tr> <tr>
<th>创建者</th> <th>创建者</th>

View File

@ -32,12 +32,20 @@
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label required">所属</label> <label class="layui-form-label required">系统</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input class="layui-input select-tree" th:attr="data-url=@{/system/dept/list}, data-value=${user?.dept?.id}" <input class="layui-input select-tree" th:attr="data-url=@{/system/dept/list}, data-value=${user?.dept?.id}"
type="text" name="dept" placeholder="请选择" th:value="${user?.dept?.title}"> type="text" name="dept" placeholder="请选择" th:value="${user?.dept?.title}">
</div> </div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label required">所属</label>
<div class="layui-input-inline">
<select name="bssPlatform" mo-selected="${user?.bssPlatform?.id}" mo-empty="" lay-verify="bssPlatform">
<option th:each="bssPlatform,userStat:${bssPlatforms}" th:value="${bssPlatform.id}" th:text="${bssPlatform.name}" th:selected="${bssPlatform.id == dept?.bssPlatform?.id}"></option>
</select>
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">电话号码</label> <label class="layui-form-label">电话号码</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
@ -50,7 +58,12 @@
<input class="layui-input" type="text" name="email" placeholder="请输入邮箱" th:value="${user?.email}"> <input class="layui-input" type="text" name="email" placeholder="请输入邮箱" th:value="${user?.email}">
</div> </div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label required">类型</label>
<div class="layui-input-inline">
<select name="type" mo:dict="USER_TYPE" mo-selected="${user?.type}" mo-empty="" lay-verify="type"></select>
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">选择性别</label> <label class="layui-form-label">选择性别</label>
<div class="layui-input-inline"> <div class="layui-input-inline">

View File

@ -20,9 +20,15 @@
<th>用户性别</th> <th>用户性别</th>
<td th:text="${#dicts.keyValue('USER_SEX', user.sex)}"></td> <td th:text="${#dicts.keyValue('USER_SEX', user.sex)}"></td>
</tr> </tr>
<tr>
<th>系统</th>
<td th:text="${user.dept?.title}"></td>
<th>类型</th>
<td th:text="${#dicts.keyValue('USER_TYPE', user.type)}"></td>
</tr>
<tr> <tr>
<th>所属</th> <th>所属</th>
<td colspan="4" th:text="${user.dept?.title}"></td> <td th:text="${user.bssPlatform.name}" colspan="4"></td>
</tr> </tr>
<tr> <tr>
<th>电话号码</th> <th>电话号码</th>

View File

@ -20,12 +20,6 @@
<select class="timo-search-select" name="status" mo:dict="SEARCH_STATUS" mo-selected="${param.status}"></select> <select class="timo-search-select" name="status" mo:dict="SEARCH_STATUS" mo-selected="${param.status}"></select>
</div> </div>
</div> </div>
<div class="layui-inline">
<label class="layui-form-label">所属</label>
<div class="layui-input-block">
<input class="layui-input select-tree" th:attr="data-url=@{/system/dept/list}, data-value=${dept?.id}" th:value="${dept?.title}" type="text" name="dept" placeholder="请选择部门">
</div>
</div>
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">用户名</label> <label class="layui-form-label">用户名</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -75,8 +69,9 @@
</th> </th>
<th class="sortable" data-field="username">用户名</th> <th class="sortable" data-field="username">用户名</th>
<th class="sortable" data-field="nickname">用户昵称</th> <th class="sortable" data-field="nickname">用户昵称</th>
<th class="sortable" data-field="dept">所属</th> <th class="sortable" data-field="bssPlatform">所属</th>
<th class="sortable" data-field="sex">性别</th> <th class="sortable" data-field="sex">性别</th>
<th class="sortable" data-field="type">类型</th>
<th class="sortable" data-field="phone">电话</th> <th class="sortable" data-field="phone">电话</th>
<th class="sortable" data-field="email">邮箱</th> <th class="sortable" data-field="email">邮箱</th>
<th class="sortable" data-field="createDate">创建时间</th> <th class="sortable" data-field="createDate">创建时间</th>
@ -90,8 +85,9 @@
<i class="layui-icon layui-icon-ok"></i></label></td> <i class="layui-icon layui-icon-ok"></i></label></td>
<td th:text="${item.username}">用户名</td> <td th:text="${item.username}">用户名</td>
<td th:text="${item.nickname}">用户昵称</td> <td th:text="${item.nickname}">用户昵称</td>
<td th:text="${item.dept?.title}">用户昵称</td> <td th:text="${item.bssPlatform?.name}">所属</td>
<td th:text="${#dicts.keyValue('USER_SEX', item.sex)}">性别</td> <td th:text="${#dicts.keyValue('USER_SEX', item.sex)}">性别</td>
<td th:text="${#dicts.keyValue('USER_TYPE', item.type)}">类型</td>
<td th:text="${item.phone}">电话</td> <td th:text="${item.phone}">电话</td>
<td th:text="${item.email}">邮箱</td> <td th:text="${item.email}">邮箱</td>
<td th:text="${#dates.format(item.createDate, 'yyyy-MM-dd HH:mm:ss')}">创建时间</td> <td th:text="${#dates.format(item.createDate, 'yyyy-MM-dd HH:mm:ss')}">创建时间</td>

View File

@ -1,124 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
<sourceRoots>
<root url="file://$MODULE_DIR$/src/main/java" />
<root url="file://$MODULE_DIR$/src/main/resources" />
</sourceRoots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="common" />
<orderEntry type="module" module-name="system" />
<orderEntry type="module" module-name="excel" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.0.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:4.0.0" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.0.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.18" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.26" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.8" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.17" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.16.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.2.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.3" level="project" />
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-core:5.3.9.Final" level="project" />
<orderEntry type="library" name="Maven: javax.persistence:javax.persistence-api:2.2" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.23.1-GA" level="project" />
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.9.12" level="project" />
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.jboss:jandex:2.0.5.Final" level="project" />
<orderEntry type="library" name="Maven: org.dom4j:dom4j:2.1.1" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:5.0.4.Final" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-jpa:2.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-orm:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aspects:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.1.6.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.springframework.boot:spring-boot-devtools:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.4.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.1.4.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.1.4.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.1.4.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.11.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.23.4" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.9.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.1.6.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.1.6.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.6.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:5.1.46" level="project" />
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.2" level="project" />
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.10.5" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
</component>
</module>

View File

@ -1,36 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.cwhelp.modules</groupId>
<artifactId>business</artifactId>
<packaging>jar</packaging>
<name>业务</name>
<parent>
<groupId>com.cwhelp</groupId>
<artifactId>modules</artifactId>
<version>2.0.1</version>
</parent>
<dependencies>
<dependency>
<groupId>com.cwhelp</groupId>
<artifactId>common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.cwhelp.modules</groupId>
<artifactId>system</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.cwhelp.component</groupId>
<artifactId>excel</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -16,6 +16,5 @@
<modules> <modules>
<module>system</module> <module>system</module>
<module>business</module>
</modules> </modules>
</project> </project>

View File

@ -0,0 +1,81 @@
package com.cwhelp.modules.business.domain;
import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.common.utils.StatusUtil;
import com.cwhelp.modules.system.domain.User;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* @author yan.y
* @date 2019/07/31
*/
@Data
@Entity
@Table(name="bss_employee")
@EntityListeners(AuditingEntityListener.class)
@Where(clause = StatusUtil.notDelete)
public class BssEmployee implements Serializable {
// 主键ID
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
private String name;
// 部门
@ManyToOne(fetch=FetchType.LAZY)
@NotFound(action=NotFoundAction.IGNORE)
@JoinColumn(name="dept_id")
@JsonIgnore
private BssDept bssDept;
// 职位
private String position;
// 手机号码
@Column(name = "phone_num")
private String phoneNum;
// 身份证号码
private String card;
// 邮箱
private String email;
// 员工状态
@Column(name = "employee_status")
private String employeeStatus;
// 学历
private String education;
// 备注
private String remark;
// 创建时间
@CreatedDate
private Date createDate;
// 更新时间
@LastModifiedDate
private Date updateDate;
// 创建者
@CreatedBy
@ManyToOne(fetch=FetchType.LAZY)
@NotFound(action=NotFoundAction.IGNORE)
@JoinColumn(name="create_by")
@JsonIgnore
private User createBy;
// 更新者
@LastModifiedBy
@ManyToOne(fetch=FetchType.LAZY)
@NotFound(action=NotFoundAction.IGNORE)
@JoinColumn(name="update_by")
@JsonIgnore
private User updateBy;
// 数据状态
private Byte status = StatusEnum.OK.getCode();
}

View File

@ -0,0 +1,12 @@
package com.cwhelp.modules.business.repository;
import com.cwhelp.modules.business.domain.BssEmployee;
import com.cwhelp.modules.system.repository.BaseRepository;
/**
* @author yan.y
* @date 2019/07/31
*/
public interface BssEmployeeRepository extends BaseRepository<BssEmployee, Long> {
}

View File

@ -10,7 +10,27 @@ import com.cwhelp.modules.system.repository.BaseRepository;
*/ */
public interface BssPlatformRepository extends BaseRepository<BssPlatform, Long>{ public interface BssPlatformRepository extends BaseRepository<BssPlatform, Long>{
/**
* 查询联系人手机号码 排除当前ID
* @param contactTel 手机号码
* @param id ID
* @return
*/
BssPlatform findByContactTelAndIdNot(String contactTel,Long id); BssPlatform findByContactTelAndIdNot(String contactTel,Long id);
/**
* 查询联系人身份证号码 排除当前ID
* @param contactCard 身份号码
* @param id ID
* @return
*/
BssPlatform findByContactCardAndIdNot(String contactCard,Long id); BssPlatform findByContactCardAndIdNot(String contactCard,Long id);
/**
* 查询企业邮箱 排除当前ID
* @param email 企业邮箱
* @param id ID
* @return
*/
BssPlatform findByEmailAndIdNot(String email,Long id); BssPlatform findByEmailAndIdNot(String email,Long id);
} }

View File

@ -0,0 +1,42 @@
package com.cwhelp.modules.business.service;
import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.modules.business.domain.BssEmployee;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author yan.y
* @date 2019/07/31
*/
public interface BssEmployeeService {
/**
* 获取分页列表数据
* @param example 查询实例
* @return 返回分页数据
*/
Page<BssEmployee> getPageList(Example<BssEmployee> example);
/**
* 根据ID查询数据
* @param id 主键ID
*/
BssEmployee getById(Long id);
/**
* 保存数据
* @param bssEmployee 实体对象
*/
BssEmployee save(BssEmployee bssEmployee);
/**
* 状态(启用冻结删除)/批量状态处理
*/
@Transactional
Boolean updateStatus(StatusEnum statusEnum, List<Long> idList);
}

View File

@ -0,0 +1,66 @@
package com.cwhelp.modules.business.service.impl;
import com.cwhelp.common.data.PageSort;
import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.modules.business.domain.BssEmployee;
import com.cwhelp.modules.business.repository.BssEmployeeRepository;
import com.cwhelp.modules.business.service.BssEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author yan.y
* @date 2019/07/31
*/
@Service
public class BssEmployeeServiceImpl implements BssEmployeeService {
@Autowired
private BssEmployeeRepository bssEmployeeRepository;
/**
* 根据ID查询数据
* @param id 主键ID
*/
@Override
@Transactional
public BssEmployee getById(Long id) {
return bssEmployeeRepository.findById(id).orElse(null);
}
/**
* 获取分页列表数据
* @param example 查询实例
* @return 返回分页数据
*/
@Override
public Page<BssEmployee> getPageList(Example<BssEmployee> example) {
// 创建分页对象
PageRequest page = PageSort.pageRequest();
return bssEmployeeRepository.findAll(example, page);
}
/**
* 保存数据
* @param bssEmployee 实体对象
*/
@Override
public BssEmployee save(BssEmployee bssEmployee) {
return bssEmployeeRepository.save(bssEmployee);
}
/**
* 状态(启用冻结删除)/批量状态处理
*/
@Override
@Transactional
public Boolean updateStatus(StatusEnum statusEnum, List<Long> idList) {
return bssEmployeeRepository.updateStatus(statusEnum.getCode(), idList) > 0;
}
}

View File

@ -1,9 +1,10 @@
package com.cwhelp.modules.system.domain; package com.cwhelp.modules.system.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.cwhelp.common.enums.StatusEnum; import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.common.utils.StatusUtil; import com.cwhelp.common.utils.StatusUtil;
import lombok.Data; import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction; import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where; import org.hibernate.annotations.Where;
@ -20,7 +21,8 @@ import java.util.Date;
/** /**
* @author yan.y * @author yan.y
*/ */
@Data @Getter
@Setter
@Entity @Entity
@Table(name="sys_dept") @Table(name="sys_dept")
@EntityListeners(AuditingEntityListener.class) @EntityListeners(AuditingEntityListener.class)

View File

@ -1,12 +1,11 @@
package com.cwhelp.modules.system.domain; package com.cwhelp.modules.system.domain;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.cwhelp.common.enums.StatusEnum; import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.common.utils.StatusUtil; import com.cwhelp.common.utils.StatusUtil;
import com.cwhelp.component.excel.annotation.Excel; import com.cwhelp.component.excel.annotation.Excel;
import com.cwhelp.component.excel.enums.ExcelType; import com.cwhelp.component.excel.enums.ExcelType;
import com.fasterxml.jackson.annotation.ObjectIdGenerators; import com.cwhelp.modules.business.domain.BssPlatform;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.SQLDelete;
@ -46,6 +45,7 @@ public class User implements Serializable {
private String picture; private String picture;
@Excel(value = "性别", dict = "USER_SEX") @Excel(value = "性别", dict = "USER_SEX")
private String sex; private String sex;
private String type;
@Excel("手机号码") @Excel("手机号码")
private String phone; private String phone;
@Excel("电子邮箱") @Excel("电子邮箱")
@ -66,6 +66,12 @@ public class User implements Serializable {
@JsonIgnore @JsonIgnore
private Dept dept; private Dept dept;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="bss_platform_id")
@JsonIgnore
private BssPlatform bssPlatform;
@ManyToMany(fetch = FetchType.LAZY) @ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "sys_user_role", @JoinTable(name = "sys_user_role",
joinColumns = @JoinColumn(name="user_id"), joinColumns = @JoinColumn(name="user_id"),

View File

@ -2,6 +2,8 @@ package com.cwhelp.modules.system.service.impl;
import com.cwhelp.common.data.PageSort; import com.cwhelp.common.data.PageSort;
import com.cwhelp.common.enums.StatusEnum; import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.modules.business.domain.BssPlatform;
import com.cwhelp.modules.business.repository.BssPlatformRepository;
import com.cwhelp.modules.system.domain.Dept; import com.cwhelp.modules.system.domain.Dept;
import com.cwhelp.modules.system.domain.User; import com.cwhelp.modules.system.domain.User;
import com.cwhelp.modules.system.repository.UserRepository; import com.cwhelp.modules.system.repository.UserRepository;
@ -31,6 +33,9 @@ public class UserServiceImpl implements UserService {
@Autowired @Autowired
private DeptService deptService; private DeptService deptService;
@Autowired
private BssPlatformRepository bssPlatformRepository;
/** /**
* 根据用户名查询用户数据 * 根据用户名查询用户数据
* @param username 用户名 * @param username 用户名
@ -71,7 +76,6 @@ public class UserServiceImpl implements UserService {
public Page<User> getPageList(User user) { public Page<User> getPageList(User user) {
// 创建分页对象 // 创建分页对象
PageRequest page = PageSort.pageRequest(Sort.Direction.ASC); PageRequest page = PageSort.pageRequest(Sort.Direction.ASC);
// 使用Specification复杂查询 // 使用Specification复杂查询
return userRepository.findAll(new Specification<User>(){ return userRepository.findAll(new Specification<User>(){
@ -100,6 +104,26 @@ public class UserServiceImpl implements UserService {
deptIn.forEach(in::value); deptIn.forEach(in::value);
preList.add(in); preList.add(in);
} }
// 1 为财务帮平台超级账号
if (1 == user.getBssPlatform().getId()) {
// 查询所有平台的账号
BssPlatform bssPlatform = user.getBssPlatform();
List<Long> bssPlatformIn = new ArrayList<>();
bssPlatformIn.add(bssPlatform.getId());
List<BssPlatform> bssPlatforms = bssPlatformRepository.findAll();
bssPlatforms.forEach(item -> bssPlatformIn.add(item.getId()));
Join<User, BssPlatform> join = root.join("bssPlatform", JoinType.INNER);
CriteriaBuilder.In<Long> in = cb.in(join.get("id").as(Long.class));
bssPlatformIn.forEach(in::value);
preList.add(in);
} else {
// 查询所有平台的账号
BssPlatform bssPlatform = user.getBssPlatform();
Join<User, BssPlatform> join = root.join("bssPlatform", JoinType.INNER);
Predicate eq = cb.equal(join.get("id").as(Long.class),bssPlatform.getId());
preList.add(eq);
}
// 数据状态 // 数据状态
if(user.getStatus() != null){ if(user.getStatus() != null){

Binary file not shown.