Pre Merge pull request !383 from 袁阳/develop_yuanyang
This commit is contained in:
commit
d52e067db7
|
|
@ -0,0 +1,128 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
//package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.SysClient;
|
||||
import com.ruoyi.system.service.ISysClientService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 客户信息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-23
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/client")
|
||||
public class SysClientController extends BaseController
|
||||
{
|
||||
private String prefix = "system/client";
|
||||
|
||||
@Autowired
|
||||
private ISysClientService sysClientService;
|
||||
|
||||
@RequiresPermissions("system:client:view")
|
||||
@GetMapping()
|
||||
public String client()
|
||||
{
|
||||
return prefix + "/client";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*/
|
||||
@RequiresPermissions("system:client:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(SysClient sysClient)
|
||||
{
|
||||
startPage();
|
||||
List<SysClient> list = sysClientService.selectSysClientList(sysClient);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户信息列表
|
||||
*/
|
||||
@RequiresPermissions("system:client:export")
|
||||
@Log(title = "客户信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(SysClient sysClient)
|
||||
{
|
||||
List<SysClient> list = sysClientService.selectSysClientList(sysClient);
|
||||
ExcelUtil<SysClient> util = new ExcelUtil<SysClient>(SysClient.class);
|
||||
return util.exportExcel(list, "客户信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户信息
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存客户信息
|
||||
*/
|
||||
@RequiresPermissions("system:client:add")
|
||||
@Log(title = "客户信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(SysClient sysClient)
|
||||
{
|
||||
return toAjax(sysClientService.insertSysClient(sysClient));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户信息
|
||||
*/
|
||||
@RequiresPermissions("system:client:edit")
|
||||
@GetMapping("/edit/{clientId}")
|
||||
public String edit(@PathVariable("clientId") Long clientId, ModelMap mmap)
|
||||
{
|
||||
SysClient sysClient = sysClientService.selectSysClientByClientId(clientId);
|
||||
mmap.put("sysClient", sysClient);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存客户信息
|
||||
*/
|
||||
@RequiresPermissions("system:client:edit")
|
||||
@Log(title = "客户信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(SysClient sysClient)
|
||||
{
|
||||
return toAjax(sysClientService.updateSysClient(sysClient));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户信息
|
||||
*/
|
||||
@RequiresPermissions("system:client:remove")
|
||||
@Log(title = "客户信息", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(sysClientService.deleteSysClientByClientIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增客户信息')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-client-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="deptId" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">客户key:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="clientKey" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">客户昵称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="clientName" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手机号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="phonenumber" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">删除标志:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="delFlag" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">最后登录IP:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="loginIp" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">最后登录时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="loginDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">密码最后更新时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="pwdUpdateDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "system/client"
|
||||
$("#form-client-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-client-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='loginDate']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$("input[name='pwdUpdateDate']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('客户信息列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>部门ID:</label>
|
||||
<input type="text" name="deptId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>客户key:</label>
|
||||
<input type="text" name="clientKey"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>客户昵称:</label>
|
||||
<input type="text" name="clientName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>手机号码:</label>
|
||||
<input type="text" name="phonenumber"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>最后登录IP:</label>
|
||||
<input type="text" name="loginIp"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>最后登录时间:</label>
|
||||
<input type="text" class="time-input" placeholder="请选择最后登录时间" name="loginDate"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>密码最后更新时间:</label>
|
||||
<input type="text" class="time-input" placeholder="请选择密码最后更新时间" name="pwdUpdateDate"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:client:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:client:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:client:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:client:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('system:client:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:client:remove')}]];
|
||||
var prefix = ctx + "system/client";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "客户信息",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'clientId',
|
||||
title: '客户ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'deptId',
|
||||
title: '部门ID'
|
||||
},
|
||||
{
|
||||
field: 'clientKey',
|
||||
title: '客户key'
|
||||
},
|
||||
{
|
||||
field: 'clientName',
|
||||
title: '客户昵称'
|
||||
},
|
||||
{
|
||||
field: 'clientType',
|
||||
title: '客户类型'
|
||||
},
|
||||
{
|
||||
field: 'phonenumber',
|
||||
title: '手机号码'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '帐号状态'
|
||||
},
|
||||
{
|
||||
field: 'loginIp',
|
||||
title: '最后登录IP'
|
||||
},
|
||||
{
|
||||
field: 'loginDate',
|
||||
title: '最后登录时间'
|
||||
},
|
||||
{
|
||||
field: 'pwdUpdateDate',
|
||||
title: '密码最后更新时间'
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.clientId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.clientId + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改客户信息')" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-client-edit" th:object="${sysClient}">
|
||||
<input name="clientId" th:field="*{clientId}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">部门ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="deptId" th:field="*{deptId}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">客户key:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="clientKey" th:field="*{clientKey}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">客户昵称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="clientName" th:field="*{clientName}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手机号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="phonenumber" th:field="*{phonenumber}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">最后登录IP:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="loginIp" th:field="*{loginIp}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">最后登录时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="loginDate" th:value="${#dates.format(sysClient.loginDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">密码最后更新时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<input name="pwdUpdateDate" th:value="${#dates.format(sysClient.pwdUpdateDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "system/client";
|
||||
$("#form-client-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-client-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("input[name='loginDate']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$("input[name='pwdUpdateDate']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 客户信息对象 sys_client
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-23
|
||||
*/
|
||||
public class SysClient extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 客户ID */
|
||||
private Long clientId;
|
||||
|
||||
/** 部门ID */
|
||||
@Excel(name = "部门ID")
|
||||
private Long deptId;
|
||||
|
||||
/** 客户key */
|
||||
@Excel(name = "客户key")
|
||||
private Long clientKey;
|
||||
|
||||
/** 客户昵称 */
|
||||
@Excel(name = "客户昵称")
|
||||
private String clientName;
|
||||
|
||||
/** 客户类型(1-内部用户 2-外部用户) */
|
||||
@Excel(name = "客户类型", readConverterExp = "1=-内部用户,2=-外部用户")
|
||||
private String clientType;
|
||||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码")
|
||||
private String phonenumber;
|
||||
|
||||
/** 帐号状态(0正常 1停用) */
|
||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 最后登录IP */
|
||||
@Excel(name = "最后登录IP")
|
||||
private String loginIp;
|
||||
|
||||
/** 最后登录时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date loginDate;
|
||||
|
||||
/** 密码最后更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "密码最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date pwdUpdateDate;
|
||||
|
||||
public void setClientId(Long clientId)
|
||||
{
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public Long getClientId()
|
||||
{
|
||||
return clientId;
|
||||
}
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setClientKey(Long clientKey)
|
||||
{
|
||||
this.clientKey = clientKey;
|
||||
}
|
||||
|
||||
public Long getClientKey()
|
||||
{
|
||||
return clientKey;
|
||||
}
|
||||
public void setClientName(String clientName)
|
||||
{
|
||||
this.clientName = clientName;
|
||||
}
|
||||
|
||||
public String getClientName()
|
||||
{
|
||||
return clientName;
|
||||
}
|
||||
public void setClientType(String clientType)
|
||||
{
|
||||
this.clientType = clientType;
|
||||
}
|
||||
|
||||
public String getClientType()
|
||||
{
|
||||
return clientType;
|
||||
}
|
||||
public void setPhonenumber(String phonenumber)
|
||||
{
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
public String getPhonenumber()
|
||||
{
|
||||
return phonenumber;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
public void setLoginIp(String loginIp)
|
||||
{
|
||||
this.loginIp = loginIp;
|
||||
}
|
||||
|
||||
public String getLoginIp()
|
||||
{
|
||||
return loginIp;
|
||||
}
|
||||
public void setLoginDate(Date loginDate)
|
||||
{
|
||||
this.loginDate = loginDate;
|
||||
}
|
||||
|
||||
public Date getLoginDate()
|
||||
{
|
||||
return loginDate;
|
||||
}
|
||||
public void setPwdUpdateDate(Date pwdUpdateDate)
|
||||
{
|
||||
this.pwdUpdateDate = pwdUpdateDate;
|
||||
}
|
||||
|
||||
public Date getPwdUpdateDate()
|
||||
{
|
||||
return pwdUpdateDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("clientId", getClientId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("clientKey", getClientKey())
|
||||
.append("clientName", getClientName())
|
||||
.append("clientType", getClientType())
|
||||
.append("phonenumber", getPhonenumber())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("loginIp", getLoginIp())
|
||||
.append("loginDate", getLoginDate())
|
||||
.append("pwdUpdateDate", getPwdUpdateDate())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysClient;
|
||||
|
||||
/**
|
||||
* 客户信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-23
|
||||
*/
|
||||
public interface SysClientMapper
|
||||
{
|
||||
/**
|
||||
* 查询客户信息
|
||||
*
|
||||
* @param clientId 客户信息主键
|
||||
* @return 客户信息
|
||||
*/
|
||||
public SysClient selectSysClientByClientId(Long clientId);
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*
|
||||
* @param sysClient 客户信息
|
||||
* @return 客户信息集合
|
||||
*/
|
||||
public List<SysClient> selectSysClientList(SysClient sysClient);
|
||||
|
||||
/**
|
||||
* 新增客户信息
|
||||
*
|
||||
* @param sysClient 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysClient(SysClient sysClient);
|
||||
|
||||
/**
|
||||
* 修改客户信息
|
||||
*
|
||||
* @param sysClient 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysClient(SysClient sysClient);
|
||||
|
||||
/**
|
||||
* 删除客户信息
|
||||
*
|
||||
* @param clientId 客户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysClientByClientId(Long clientId);
|
||||
|
||||
/**
|
||||
* 批量删除客户信息
|
||||
*
|
||||
* @param clientIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysClientByClientIds(String[] clientIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysClient;
|
||||
|
||||
/**
|
||||
* 客户信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-23
|
||||
*/
|
||||
public interface ISysClientService
|
||||
{
|
||||
/**
|
||||
* 查询客户信息
|
||||
*
|
||||
* @param clientId 客户信息主键
|
||||
* @return 客户信息
|
||||
*/
|
||||
public SysClient selectSysClientByClientId(Long clientId);
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*
|
||||
* @param sysClient 客户信息
|
||||
* @return 客户信息集合
|
||||
*/
|
||||
public List<SysClient> selectSysClientList(SysClient sysClient);
|
||||
|
||||
/**
|
||||
* 新增客户信息
|
||||
*
|
||||
* @param sysClient 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysClient(SysClient sysClient);
|
||||
|
||||
/**
|
||||
* 修改客户信息
|
||||
*
|
||||
* @param sysClient 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysClient(SysClient sysClient);
|
||||
|
||||
/**
|
||||
* 批量删除客户信息
|
||||
*
|
||||
* @param clientIds 需要删除的客户信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysClientByClientIds(String clientIds);
|
||||
|
||||
/**
|
||||
* 删除客户信息信息
|
||||
*
|
||||
* @param clientId 客户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysClientByClientId(Long clientId);
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.SysClientMapper;
|
||||
import com.ruoyi.system.domain.SysClient;
|
||||
import com.ruoyi.system.service.ISysClientService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 客户信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-23
|
||||
*/
|
||||
@Service
|
||||
public class SysClientServiceImpl implements ISysClientService
|
||||
{
|
||||
@Autowired
|
||||
private SysClientMapper sysClientMapper;
|
||||
|
||||
/**
|
||||
* 查询客户信息
|
||||
*
|
||||
* @param clientId 客户信息主键
|
||||
* @return 客户信息
|
||||
*/
|
||||
@Override
|
||||
public SysClient selectSysClientByClientId(Long clientId)
|
||||
{
|
||||
return sysClientMapper.selectSysClientByClientId(clientId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*
|
||||
* @param sysClient 客户信息
|
||||
* @return 客户信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysClient> selectSysClientList(SysClient sysClient)
|
||||
{
|
||||
return sysClientMapper.selectSysClientList(sysClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户信息
|
||||
*
|
||||
* @param sysClient 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysClient(SysClient sysClient)
|
||||
{
|
||||
sysClient.setCreateTime(DateUtils.getNowDate());
|
||||
return sysClientMapper.insertSysClient(sysClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户信息
|
||||
*
|
||||
* @param sysClient 客户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysClient(SysClient sysClient)
|
||||
{
|
||||
sysClient.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysClientMapper.updateSysClient(sysClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户信息
|
||||
*
|
||||
* @param clientIds 需要删除的客户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysClientByClientIds(String clientIds)
|
||||
{
|
||||
return sysClientMapper.deleteSysClientByClientIds(Convert.toStrArray(clientIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户信息信息
|
||||
*
|
||||
* @param clientId 客户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysClientByClientId(Long clientId)
|
||||
{
|
||||
return sysClientMapper.deleteSysClientByClientId(clientId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.SysClientMapper">
|
||||
|
||||
<resultMap type="SysClient" id="SysClientResult">
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="clientKey" column="client_key" />
|
||||
<result property="clientName" column="client_name" />
|
||||
<result property="clientType" column="client_type" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="loginIp" column="login_ip" />
|
||||
<result property="loginDate" column="login_date" />
|
||||
<result property="pwdUpdateDate" column="pwd_update_date" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysClientVo">
|
||||
select client_id, dept_id, client_key, client_name, client_type, phonenumber, status, del_flag, login_ip, login_date, pwd_update_date, create_by, create_time, update_by, update_time, remark from sys_client
|
||||
</sql>
|
||||
|
||||
<select id="selectSysClientList" parameterType="SysClient" resultMap="SysClientResult">
|
||||
<include refid="selectSysClientVo"/>
|
||||
<where>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="clientKey != null "> and client_key = #{clientKey}</if>
|
||||
<if test="clientName != null and clientName != ''"> and client_name like concat('%', #{clientName}, '%')</if>
|
||||
<if test="clientType != null and clientType != ''"> and client_type = #{clientType}</if>
|
||||
<if test="phonenumber != null and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
|
||||
<if test="loginDate != null "> and login_date = #{loginDate}</if>
|
||||
<if test="pwdUpdateDate != null "> and pwd_update_date = #{pwdUpdateDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysClientByClientId" parameterType="Long" resultMap="SysClientResult">
|
||||
<include refid="selectSysClientVo"/>
|
||||
where client_id = #{clientId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysClient" parameterType="SysClient" useGeneratedKeys="true" keyProperty="clientId">
|
||||
insert into sys_client
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="clientKey != null">client_key,</if>
|
||||
<if test="clientName != null">client_name,</if>
|
||||
<if test="clientType != null">client_type,</if>
|
||||
<if test="phonenumber != null">phonenumber,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="loginIp != null">login_ip,</if>
|
||||
<if test="loginDate != null">login_date,</if>
|
||||
<if test="pwdUpdateDate != null">pwd_update_date,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="clientKey != null">#{clientKey},</if>
|
||||
<if test="clientName != null">#{clientName},</if>
|
||||
<if test="clientType != null">#{clientType},</if>
|
||||
<if test="phonenumber != null">#{phonenumber},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="loginIp != null">#{loginIp},</if>
|
||||
<if test="loginDate != null">#{loginDate},</if>
|
||||
<if test="pwdUpdateDate != null">#{pwdUpdateDate},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysClient" parameterType="SysClient">
|
||||
update sys_client
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="clientKey != null">client_key = #{clientKey},</if>
|
||||
<if test="clientName != null">client_name = #{clientName},</if>
|
||||
<if test="clientType != null">client_type = #{clientType},</if>
|
||||
<if test="phonenumber != null">phonenumber = #{phonenumber},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="loginIp != null">login_ip = #{loginIp},</if>
|
||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||
<if test="pwdUpdateDate != null">pwd_update_date = #{pwdUpdateDate},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where client_id = #{clientId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysClientByClientId" parameterType="Long">
|
||||
delete from sys_client where client_id = #{clientId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysClientByClientIds" parameterType="String">
|
||||
delete from sys_client where client_id in
|
||||
<foreach item="clientId" collection="array" open="(" separator="," close=")">
|
||||
#{clientId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
-- 生成客户表
|
||||
drop table if exists sys_client;
|
||||
create table sys_client (
|
||||
client_id bigint(20) not null auto_increment comment '客户ID',
|
||||
dept_id bigint(20) default null comment '部门ID',
|
||||
client_key bigint(20) default null comment '客户key',
|
||||
client_name varchar(30) default '' comment '客户昵称',
|
||||
client_type varchar(2) default '00' comment '客户类型(1-内部用户 2-外部用户)',
|
||||
phonenumber varchar(11) default '' comment '手机号码',
|
||||
status char(1) default '0' comment '帐号状态(0正常 1停用)',
|
||||
del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)',
|
||||
login_ip varchar(128) default '' comment '最后登录IP',
|
||||
login_date datetime comment '最后登录时间',
|
||||
pwd_update_date datetime comment '密码最后更新时间',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(500) default null comment '备注',
|
||||
primary key (client_id)
|
||||
) engine=innodb auto_increment=100 comment = '客户信息表';
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户信息', '3', '1', '/system/client', 'C', '0', 'system:client:view', '#', 'admin', sysdate(), '', null, '客户信息菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户信息查询', @parentId, '1', '#', 'F', '0', 'system:client:list', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户信息新增', @parentId, '2', '#', 'F', '0', 'system:client:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户信息修改', @parentId, '3', '#', 'F', '0', 'system:client:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户信息删除', @parentId, '4', '#', 'F', '0', 'system:client:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户信息导出', @parentId, '5', '#', 'F', '0', 'system:client:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
update sys_menu set parent_id = '1' , order_num = '10' where menu_id = '1062' and menu_name = '客户信息';
|
||||
Loading…
Reference in New Issue