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

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
-1
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.commons:commons-compress:1.18" 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="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" />
-5
View File
@@ -31,11 +31,6 @@
<artifactId>system</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.cwhelp.modules</groupId>
<artifactId>business</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.cwhelp.component</groupId>
<artifactId>shiro</artifactId>
@@ -27,6 +27,7 @@ import java.util.List;
* @author yan.y
* @date 2019/07/29
*/
@Controller
@RequestMapping("/bss/dept")
public class BssDeptController {
@@ -64,24 +65,24 @@ public class BssDeptController {
@GetMapping("/add")
@RequiresPermissions("bss:dept:add")
public String toAdd(Model model,BssPlatform bssPlatform) {
Sort sort = new Sort(Sort.Direction.DESC, "createDate");
ExampleMatcher matcher = ExampleMatcher.matching();
Example<BssPlatform> example = Example.of(bssPlatform, matcher);
List<BssPlatform> list = bssPlatformService.getListByExample(example, sort);
List<BssPlatform> list = getBssPlatforms(bssPlatform);
model.addAttribute("bssPlatforms",list);
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}")
@RequiresPermissions("bss:dept:edit")
public String toEdit(@PathVariable("id") BssDept bssDept, Model model) {
Sort sort = new Sort(Sort.Direction.DESC, "createDate");
ExampleMatcher matcher = ExampleMatcher.matching();
Example<BssPlatform> example = Example.of(new BssPlatform(), matcher);
List<BssPlatform> list = bssPlatformService.getListByExample(example, sort);
List<BssPlatform> list = getBssPlatforms(new BssPlatform());
model.addAttribute("bssPlatforms",list);
model.addAttribute("dept", bssDept);
return "/business/dept/add";
@@ -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() + "失败,请重新操作");
}
}
}
@@ -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;
}
@@ -17,6 +17,8 @@ import com.cwhelp.component.actionLog.annotation.EntityParam;
import com.cwhelp.component.excel.ExcelUtil;
import com.cwhelp.component.fileUpload.config.properties.UploadProjectProperties;
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.User;
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.core.io.ClassPathResource;
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.Sort;
import org.springframework.stereotype.Controller;
@@ -56,13 +60,16 @@ public class UserController {
@Autowired
private RoleService roleService;
@Autowired
private BssPlatformService bssPlatformService;
/**
* 列表页面
*/
@GetMapping("/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);
@@ -78,7 +85,10 @@ public class UserController {
*/
@GetMapping("/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";
}
@@ -88,10 +98,27 @@ public class UserController {
@GetMapping("/edit/{id}")
@RequiresPermissions("system:user:edit")
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);
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 验证对象
@@ -25,4 +25,6 @@ public class UserValid implements Serializable {
private String phone;
@NotNull(message = "所在部门不能为空")
private Dept dept;
@NotEmpty(message = "类型不能为空")
private String type;
}
@@ -1,2 +1,2 @@
/** 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
@@ -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>
@@ -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>
@@ -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>
@@ -31,7 +31,7 @@
</tr>
<tr>
<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>
<th>创建者</th>
@@ -32,12 +32,20 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">所属</label>
<label class="layui-form-label required">系统</label>
<div class="layui-input-inline">
<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}">
</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">
<label class="layui-form-label">电话号码</label>
<div class="layui-input-inline">
@@ -50,7 +58,12 @@
<input class="layui-input" type="text" name="email" placeholder="请输入邮箱" th:value="${user?.email}">
</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">
<label class="layui-form-label">选择性别</label>
<div class="layui-input-inline">
@@ -20,9 +20,15 @@
<th>用户性别</th>
<td th:text="${#dicts.keyValue('USER_SEX', user.sex)}"></td>
</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>
<th>所属</th>
<td colspan="4" th:text="${user.dept?.title}"></td>
<td th:text="${user.bssPlatform.name}" colspan="4"></td>
</tr>
<tr>
<th>电话号码</th>
@@ -20,12 +20,6 @@
<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 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">
<label class="layui-form-label">用户名</label>
<div class="layui-input-block">
@@ -75,8 +69,9 @@
</th>
<th class="sortable" data-field="username">用户名</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="type">类型</th>
<th class="sortable" data-field="phone">电话</th>
<th class="sortable" data-field="email">邮箱</th>
<th class="sortable" data-field="createDate">创建时间</th>
@@ -90,8 +85,9 @@
<i class="layui-icon layui-icon-ok"></i></label></td>
<td th:text="${item.username}">用户名</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_TYPE', item.type)}">类型</td>
<td th:text="${item.phone}">电话</td>
<td th:text="${item.email}">邮箱</td>
<td th:text="${#dates.format(item.createDate, 'yyyy-MM-dd HH:mm:ss')}">创建时间</td>