业务部门信息
This commit is contained in:
@@ -27,7 +27,6 @@ import java.util.List;
|
||||
* @author yan.y
|
||||
* @date 2019/07/29
|
||||
*/
|
||||
@Controller("bssDeptController")
|
||||
@RequestMapping("/bss/dept")
|
||||
public class BssDeptController {
|
||||
|
||||
|
||||
+16
-18
@@ -1,6 +1,7 @@
|
||||
package com.cwhelp.admin.business.controller;
|
||||
|
||||
import com.cwhelp.admin.business.validator.BssPlatformValid;
|
||||
import com.cwhelp.common.enums.ResultEnum;
|
||||
import com.cwhelp.common.enums.StatusEnum;
|
||||
import com.cwhelp.common.utils.EntityBeanUtil;
|
||||
import com.cwhelp.common.utils.ResultVoUtil;
|
||||
@@ -58,24 +59,6 @@ public class BssPlatformController {
|
||||
return "/business/platform/index";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 部门数据列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions(value = {"bss:platform:index", "bss:dept:index"}, logical = Logical.OR)
|
||||
@ResponseBody
|
||||
public ResultVo list(BssPlatform bssPlatform) {
|
||||
// 创建匹配器,进行动态查询匹配
|
||||
ExampleMatcher matcher = ExampleMatcher.matching()
|
||||
.withMatcher("name", match -> match.contains());
|
||||
// 获取部门列表
|
||||
Example<BssPlatform> example = Example.of(bssPlatform, matcher);
|
||||
Sort sort = new Sort(Sort.Direction.DESC, "createDate");
|
||||
List<BssPlatform> list = bssPlatformService.getListByExample(example, sort);
|
||||
return ResultVoUtil.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到添加页面
|
||||
*/
|
||||
@@ -108,6 +91,21 @@ public class BssPlatformController {
|
||||
BssPlatform beBssPlatform = bssPlatformService.getById(bssPlatform.getId());
|
||||
EntityBeanUtil.copyProperties(beBssPlatform, bssPlatform);
|
||||
}
|
||||
// 校验手机号
|
||||
boolean repeatByContactTel = bssPlatformService.repeatByContactTel(bssPlatform);
|
||||
if (repeatByContactTel) {
|
||||
return ResultVoUtil.error(ResultEnum.PLATFORM_EXIST_CONTACT_TEL.getCode(),ResultEnum.PLATFORM_EXIST_CONTACT_TEL.getMessage());
|
||||
}
|
||||
// 校验身份证号
|
||||
boolean repeatByContactCard = bssPlatformService.repeatByContactCard(bssPlatform);
|
||||
if (repeatByContactCard) {
|
||||
return ResultVoUtil.error(ResultEnum.PLATFORM_EXIST_CONTACT_CARD.getCode(),ResultEnum.PLATFORM_EXIST_CONTACT_CARD.getMessage());
|
||||
}
|
||||
// 校验邮箱
|
||||
boolean repeatByEmail = bssPlatformService.repeatByEmail(bssPlatform);
|
||||
if (repeatByEmail) {
|
||||
return ResultVoUtil.error(ResultEnum.PLATFORM_EXIST_EMAIL.getCode(),ResultEnum.PLATFORM_EXIST_EMAIL.getMessage());
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
bssPlatformService.save(bssPlatform);
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -19,6 +20,9 @@ public class UserValid implements Serializable {
|
||||
@Size(min = 2, message = "用户昵称:请输入至少2个字符")
|
||||
private String nickname;
|
||||
private String confirm;
|
||||
@Pattern(regexp = "^((17[0-9])|(14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$", message = "手机号码格式不正确")
|
||||
@NotEmpty(message = "联系人电话不能为空")
|
||||
private String phone;
|
||||
@NotNull(message = "所在部门不能为空")
|
||||
private Dept dept;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<label class="timo-checkbox"><input type="checkbox">
|
||||
<i class="layui-icon layui-icon-ok"></i></label>
|
||||
</th>
|
||||
<th>主键ID</th>
|
||||
<th>名称</th>
|
||||
<th>所属</th>
|
||||
<th class="sortable" data-field="createDate">创建时间</th>
|
||||
@@ -57,7 +56,6 @@
|
||||
<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.id}">主键ID</td>
|
||||
<td th:text="${item.name}">名称</td>
|
||||
<td th:text="${item.bssPlatform.name}">所属平台</td>
|
||||
<td th:text="${#dates.format(item.createDate, 'yyyy-MM-dd HH:mm:ss')}">创建时间</td>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">类型</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="type" mo:dict="BSS_PLATFORM_TYPE" mo-selected="${menu?.type}" mo-empty="" lay-verify="type"></select>
|
||||
<select name="type" mo:dict="BSS_PLATFORM_TYPE" mo-selected="${platform?.type}" mo-empty="" lay-verify="type"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
|
||||
Reference in New Issue
Block a user