This commit is contained in:
王泽斌 2021-04-06 15:19:19 +08:00
parent 5f0a45d3bb
commit 2dc534389c
12 changed files with 1117 additions and 15 deletions

View File

@ -0,0 +1,126 @@
package com.ruoyi.web.controller.system;
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.WkCrmContacts;
import com.ruoyi.system.service.IWkCrmContactsService;
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 2021-04-06
*/
@Controller
@RequestMapping("/system/contacts")
public class WkCrmContactsController extends BaseController
{
private String prefix = "system/contacts";
@Autowired
private IWkCrmContactsService wkCrmContactsService;
@RequiresPermissions("system:contacts:view")
@GetMapping()
public String contacts()
{
return prefix + "/contacts";
}
/**
* 查询联系人列表
*/
@RequiresPermissions("system:contacts:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(WkCrmContacts wkCrmContacts)
{
startPage();
List<WkCrmContacts> list = wkCrmContactsService.selectWkCrmContactsList(wkCrmContacts);
return getDataTable(list);
}
/**
* 导出联系人列表
*/
@RequiresPermissions("system:contacts:export")
@Log(title = "联系人", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(WkCrmContacts wkCrmContacts)
{
List<WkCrmContacts> list = wkCrmContactsService.selectWkCrmContactsList(wkCrmContacts);
ExcelUtil<WkCrmContacts> util = new ExcelUtil<WkCrmContacts>(WkCrmContacts.class);
return util.exportExcel(list, "contacts");
}
/**
* 新增联系人
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存联系人
*/
@RequiresPermissions("system:contacts:add")
@Log(title = "联系人", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(WkCrmContacts wkCrmContacts)
{
return toAjax(wkCrmContactsService.insertWkCrmContacts(wkCrmContacts));
}
/**
* 修改联系人
*/
@GetMapping("/edit/{contactsId}")
public String edit(@PathVariable("contactsId") Long contactsId, ModelMap mmap)
{
WkCrmContacts wkCrmContacts = wkCrmContactsService.selectWkCrmContactsById(contactsId);
mmap.put("wkCrmContacts", wkCrmContacts);
return prefix + "/edit";
}
/**
* 修改保存联系人
*/
@RequiresPermissions("system:contacts:edit")
@Log(title = "联系人", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(WkCrmContacts wkCrmContacts)
{
return toAjax(wkCrmContactsService.updateWkCrmContacts(wkCrmContacts));
}
/**
* 删除联系人
*/
@RequiresPermissions("system:contacts:remove")
@Log(title = "联系人", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(wkCrmContactsService.deleteWkCrmContactsByIds(ids));
}
}

View File

@ -0,0 +1,123 @@
<!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-contacts-add">
<div class="form-group">
<label class="col-sm-3 control-label">联系人名称:</label>
<div class="col-sm-8">
<input name="name" 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="nextTime" 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">
<input name="mobile" 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="telephone" 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="email" 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="post" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户ID</label>
<div class="col-sm-8">
<input name="customerId" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">地址:</label>
<div class="col-sm-8">
<textarea name="address" class="form-control"></textarea>
</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>
<div class="form-group">
<label class="col-sm-3 control-label">创建人ID</label>
<div class="col-sm-8">
<input name="createUserId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">负责人ID</label>
<div class="col-sm-8">
<input name="ownerUserId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">批次:</label>
<div class="col-sm-8">
<input name="batchId" class="form-control" type="text" required>
</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="lastTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</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/contacts"
$("#form-contacts-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-contacts-add').serialize());
}
}
$("input[name='nextTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='lastTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

View File

@ -0,0 +1,174 @@
<!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>联系人名称:</label>
<input type="text" name="name"/>
</li>
<!--<li>
<label>下次联系时间:</label>
<input type="text" class="time-input" placeholder="请选择下次联系时间" name="nextTime"/>
</li>-->
<li>
<label>手机:</label>
<input type="text" name="mobile"/>
</li>
<li>
<label>电话:</label>
<input type="text" name="telephone"/>
</li>
<!--<li>
<label>电子邮箱:</label>
<input type="text" name="email"/>
</li>
<li>
<label>职务:</label>
<input type="text" name="post"/>
</li>
<li>
<label>客户ID</label>
<input type="text" name="customerId"/>
</li>
<li>
<label>创建人ID</label>
<input type="text" name="createUserId"/>
</li>
<li>
<label>负责人ID</label>
<input type="text" name="ownerUserId"/>
</li>
<li>
<label>批次:</label>
<input type="text" name="batchId"/>
</li>
<li>
<label>最后跟进时间:</label>
<input type="text" class="time-input" placeholder="请选择最后跟进时间" name="lastTime"/>
</li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</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:contacts:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:contacts:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:contacts:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:contacts: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:contacts:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:contacts:remove')}]];
var prefix = ctx + "system/contacts";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "联系人",
columns: [{
checkbox: true
},
{
field: 'contactsId',
title: '',
visible: false
},
{
field: 'name',
title: '联系人名称'
},
{
field: 'nextTime',
title: '下次联系时间'
},
{
field: 'mobile',
title: '手机'
},
{
field: 'telephone',
title: '电话'
},
{
field: 'email',
title: '电子邮箱'
},
{
field: 'post',
title: '职务'
},
{
field: 'customerId',
title: '客户ID'
},
{
field: 'address',
title: '地址'
},
{
field: 'remark',
title: '备注'
},
{
field: 'createUserId',
title: '创建人ID'
},
{
field: 'ownerUserId',
title: '负责人ID'
},
{
field: 'batchId',
title: '批次'
},
{
field: 'lastTime',
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.contactsId + '\')"><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.contactsId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,124 @@
<!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-contacts-edit" th:object="${wkCrmContacts}">
<input name="contactsId" th:field="*{contactsId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">联系人名称:</label>
<div class="col-sm-8">
<input name="name" th:field="*{name}" 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="nextTime" th:value="${#dates.format(wkCrmContacts.nextTime, '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">
<input name="mobile" th:field="*{mobile}" 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="telephone" th:field="*{telephone}" 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="email" th:field="*{email}" 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="post" th:field="*{post}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户ID</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">地址:</label>
<div class="col-sm-8">
<textarea name="address" class="form-control">[[*{address}]]</textarea>
</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>
<div class="form-group">
<label class="col-sm-3 control-label">创建人ID</label>
<div class="col-sm-8">
<input name="createUserId" th:field="*{createUserId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">负责人ID</label>
<div class="col-sm-8">
<input name="ownerUserId" th:field="*{ownerUserId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">批次:</label>
<div class="col-sm-8">
<input name="batchId" th:field="*{batchId}" class="form-control" type="text" required>
</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="lastTime" th:value="${#dates.format(wkCrmContacts.lastTime, '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>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/contacts";
$("#form-contacts-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-contacts-edit').serialize());
}
}
$("input[name='nextTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='lastTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

View File

@ -25,10 +25,10 @@
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>-->
<li>
<!--<li>
<label>成交时间:</label>
<input type="text" class="time-input" placeholder="请选择成交时间" name="dealTime"/>
</li>
</li>-->
<li>
<label>手机:</label>
<input type="text" name="mobile"/>
@ -37,7 +37,7 @@
<label>电话:</label>
<input type="text" name="telephone"/>
</li>
<li>
<!-- <li>
<label>邮箱:</label>
<input type="text" name="email"/>
</li>
@ -52,7 +52,7 @@
<li>
<label>详细地址:</label>
<input type="text" name="detailAddress"/>
</li>
</li>-->
<!--<li>
<label>批次 比如附件批次:</label>
<input type="text" name="batchId"/>

View File

@ -9,7 +9,7 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-leads-edit" th:object="${wkCrmLeads}">
<input name="leadsId" th:field="*{leadsId}" type="hidden">
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">跟进状态 0未跟进1已跟进</label>
<div class="col-sm-8">
<input name="followup" th:field="*{followup}" class="form-control" type="text">
@ -48,7 +48,7 @@
<input name="email" th:field="*{email}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">地址:</label>
<div class="col-sm-8">
<input name="address" th:field="*{address}" class="form-control" type="text">
@ -72,7 +72,7 @@
<input name="ownerUserId" th:field="*{ownerUserId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">最后跟进时间:</label>
<div class="col-sm-8">
<div class="input-group date">

View File

@ -10,18 +10,18 @@
<form id="formId">
<div class="select-list">
<ul>
<li>
<!-- <li>
<label>跟进状态 0未跟进1已跟进</label>
<input type="text" name="followup"/>
</li>
</li>-->
<li>
<label>线索名称:</label>
<input type="text" name="leadsName"/>
</li>
<li>
<!--<li>
<label>下次联系时间:</label>
<input type="text" class="time-input" placeholder="请选择下次联系时间" name="nextTime"/>
</li>
</li>-->
<li>
<label>电话:</label>
<input type="text" name="telephone"/>
@ -30,15 +30,15 @@
<label>手机号:</label>
<input type="text" name="mobile"/>
</li>
<li>
<!--<li>
<label>邮箱:</label>
<input type="text" name="email"/>
</li>
</li>-->
<li>
<label>地址:</label>
<input type="text" name="address"/>
</li>
<li>
<!--<li>
<label>创建人ID</label>
<input type="text" name="createUserId"/>
</li>
@ -49,7 +49,7 @@
<li>
<label>最后跟进时间:</label>
<input type="text" class="time-input" placeholder="请选择最后跟进时间" name="lastTime"/>
</li>
</li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>

View File

@ -0,0 +1,212 @@
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;
/**
* 联系人对象 wk_crm_contacts
*
* @author ruoyi
* @date 2021-04-06
*/
public class WkCrmContacts extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Long contactsId;
/** 联系人名称 */
@Excel(name = "联系人名称")
private String name;
/** 下次联系时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下次联系时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date nextTime;
/** 手机 */
@Excel(name = "手机")
private String mobile;
/** 电话 */
@Excel(name = "电话")
private String telephone;
/** 电子邮箱 */
@Excel(name = "电子邮箱")
private String email;
/** 职务 */
@Excel(name = "职务")
private String post;
/** 客户ID */
@Excel(name = "客户ID")
private Long customerId;
/** 地址 */
@Excel(name = "地址")
private String address;
/** 创建人ID */
@Excel(name = "创建人ID")
private Long createUserId;
/** 负责人ID */
@Excel(name = "负责人ID")
private Long ownerUserId;
/** 批次 */
@Excel(name = "批次")
private String batchId;
/** 最后跟进时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后跟进时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastTime;
public void setContactsId(Long contactsId)
{
this.contactsId = contactsId;
}
public Long getContactsId()
{
return contactsId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setNextTime(Date nextTime)
{
this.nextTime = nextTime;
}
public Date getNextTime()
{
return nextTime;
}
public void setMobile(String mobile)
{
this.mobile = mobile;
}
public String getMobile()
{
return mobile;
}
public void setTelephone(String telephone)
{
this.telephone = telephone;
}
public String getTelephone()
{
return telephone;
}
public void setEmail(String email)
{
this.email = email;
}
public String getEmail()
{
return email;
}
public void setPost(String post)
{
this.post = post;
}
public String getPost()
{
return post;
}
public void setCustomerId(Long customerId)
{
this.customerId = customerId;
}
public Long getCustomerId()
{
return customerId;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setCreateUserId(Long createUserId)
{
this.createUserId = createUserId;
}
public Long getCreateUserId()
{
return createUserId;
}
public void setOwnerUserId(Long ownerUserId)
{
this.ownerUserId = ownerUserId;
}
public Long getOwnerUserId()
{
return ownerUserId;
}
public void setBatchId(String batchId)
{
this.batchId = batchId;
}
public String getBatchId()
{
return batchId;
}
public void setLastTime(Date lastTime)
{
this.lastTime = lastTime;
}
public Date getLastTime()
{
return lastTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("contactsId", getContactsId())
.append("name", getName())
.append("nextTime", getNextTime())
.append("mobile", getMobile())
.append("telephone", getTelephone())
.append("email", getEmail())
.append("post", getPost())
.append("customerId", getCustomerId())
.append("address", getAddress())
.append("remark", getRemark())
.append("createUserId", getCreateUserId())
.append("ownerUserId", getOwnerUserId())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("batchId", getBatchId())
.append("lastTime", getLastTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.WkCrmContacts;
/**
* 联系人Mapper接口
*
* @author ruoyi
* @date 2021-04-06
*/
public interface WkCrmContactsMapper
{
/**
* 查询联系人
*
* @param contactsId 联系人ID
* @return 联系人
*/
public WkCrmContacts selectWkCrmContactsById(Long contactsId);
/**
* 查询联系人列表
*
* @param wkCrmContacts 联系人
* @return 联系人集合
*/
public List<WkCrmContacts> selectWkCrmContactsList(WkCrmContacts wkCrmContacts);
/**
* 新增联系人
*
* @param wkCrmContacts 联系人
* @return 结果
*/
public int insertWkCrmContacts(WkCrmContacts wkCrmContacts);
/**
* 修改联系人
*
* @param wkCrmContacts 联系人
* @return 结果
*/
public int updateWkCrmContacts(WkCrmContacts wkCrmContacts);
/**
* 删除联系人
*
* @param contactsId 联系人ID
* @return 结果
*/
public int deleteWkCrmContactsById(Long contactsId);
/**
* 批量删除联系人
*
* @param contactsIds 需要删除的数据ID
* @return 结果
*/
public int deleteWkCrmContactsByIds(String[] contactsIds);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.WkCrmContacts;
/**
* 联系人Service接口
*
* @author ruoyi
* @date 2021-04-06
*/
public interface IWkCrmContactsService
{
/**
* 查询联系人
*
* @param contactsId 联系人ID
* @return 联系人
*/
public WkCrmContacts selectWkCrmContactsById(Long contactsId);
/**
* 查询联系人列表
*
* @param wkCrmContacts 联系人
* @return 联系人集合
*/
public List<WkCrmContacts> selectWkCrmContactsList(WkCrmContacts wkCrmContacts);
/**
* 新增联系人
*
* @param wkCrmContacts 联系人
* @return 结果
*/
public int insertWkCrmContacts(WkCrmContacts wkCrmContacts);
/**
* 修改联系人
*
* @param wkCrmContacts 联系人
* @return 结果
*/
public int updateWkCrmContacts(WkCrmContacts wkCrmContacts);
/**
* 批量删除联系人
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWkCrmContactsByIds(String ids);
/**
* 删除联系人信息
*
* @param contactsId 联系人ID
* @return 结果
*/
public int deleteWkCrmContactsById(Long contactsId);
}

View File

@ -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.WkCrmContactsMapper;
import com.ruoyi.system.domain.WkCrmContacts;
import com.ruoyi.system.service.IWkCrmContactsService;
import com.ruoyi.common.core.text.Convert;
/**
* 联系人Service业务层处理
*
* @author ruoyi
* @date 2021-04-06
*/
@Service
public class WkCrmContactsServiceImpl implements IWkCrmContactsService
{
@Autowired
private WkCrmContactsMapper wkCrmContactsMapper;
/**
* 查询联系人
*
* @param contactsId 联系人ID
* @return 联系人
*/
@Override
public WkCrmContacts selectWkCrmContactsById(Long contactsId)
{
return wkCrmContactsMapper.selectWkCrmContactsById(contactsId);
}
/**
* 查询联系人列表
*
* @param wkCrmContacts 联系人
* @return 联系人
*/
@Override
public List<WkCrmContacts> selectWkCrmContactsList(WkCrmContacts wkCrmContacts)
{
return wkCrmContactsMapper.selectWkCrmContactsList(wkCrmContacts);
}
/**
* 新增联系人
*
* @param wkCrmContacts 联系人
* @return 结果
*/
@Override
public int insertWkCrmContacts(WkCrmContacts wkCrmContacts)
{
wkCrmContacts.setCreateTime(DateUtils.getNowDate());
return wkCrmContactsMapper.insertWkCrmContacts(wkCrmContacts);
}
/**
* 修改联系人
*
* @param wkCrmContacts 联系人
* @return 结果
*/
@Override
public int updateWkCrmContacts(WkCrmContacts wkCrmContacts)
{
wkCrmContacts.setUpdateTime(DateUtils.getNowDate());
return wkCrmContactsMapper.updateWkCrmContacts(wkCrmContacts);
}
/**
* 删除联系人对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteWkCrmContactsByIds(String ids)
{
return wkCrmContactsMapper.deleteWkCrmContactsByIds(Convert.toStrArray(ids));
}
/**
* 删除联系人信息
*
* @param contactsId 联系人ID
* @return 结果
*/
@Override
public int deleteWkCrmContactsById(Long contactsId)
{
return wkCrmContactsMapper.deleteWkCrmContactsById(contactsId);
}
}

View File

@ -0,0 +1,124 @@
<?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.WkCrmContactsMapper">
<resultMap type="WkCrmContacts" id="WkCrmContactsResult">
<result property="contactsId" column="contacts_id" />
<result property="name" column="name" />
<result property="nextTime" column="next_time" />
<result property="mobile" column="mobile" />
<result property="telephone" column="telephone" />
<result property="email" column="email" />
<result property="post" column="post" />
<result property="customerId" column="customer_id" />
<result property="address" column="address" />
<result property="remark" column="remark" />
<result property="createUserId" column="create_user_id" />
<result property="ownerUserId" column="owner_user_id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="batchId" column="batch_id" />
<result property="lastTime" column="last_time" />
</resultMap>
<sql id="selectWkCrmContactsVo">
select contacts_id, name, next_time, mobile, telephone, email, post, customer_id, address, remark, create_user_id, owner_user_id, create_time, update_time, batch_id, last_time from wk_crm_contacts
</sql>
<select id="selectWkCrmContactsList" parameterType="WkCrmContacts" resultMap="WkCrmContactsResult">
<include refid="selectWkCrmContactsVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="nextTime != null "> and next_time = #{nextTime}</if>
<if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
<if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
<if test="email != null and email != ''"> and email = #{email}</if>
<if test="post != null and post != ''"> and post = #{post}</if>
<if test="customerId != null "> and customer_id = #{customerId}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="createUserId != null "> and create_user_id = #{createUserId}</if>
<if test="ownerUserId != null "> and owner_user_id = #{ownerUserId}</if>
<if test="batchId != null and batchId != ''"> and batch_id = #{batchId}</if>
<if test="lastTime != null "> and last_time = #{lastTime}</if>
</where>
</select>
<select id="selectWkCrmContactsById" parameterType="Long" resultMap="WkCrmContactsResult">
<include refid="selectWkCrmContactsVo"/>
where contacts_id = #{contactsId}
</select>
<insert id="insertWkCrmContacts" parameterType="WkCrmContacts" useGeneratedKeys="true" keyProperty="contactsId">
insert into wk_crm_contacts
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="nextTime != null">next_time,</if>
<if test="mobile != null">mobile,</if>
<if test="telephone != null">telephone,</if>
<if test="email != null">email,</if>
<if test="post != null">post,</if>
<if test="customerId != null">customer_id,</if>
<if test="address != null">address,</if>
<if test="remark != null">remark,</if>
<if test="createUserId != null">create_user_id,</if>
<if test="ownerUserId != null">owner_user_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="batchId != null and batchId != ''">batch_id,</if>
<if test="lastTime != null">last_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="nextTime != null">#{nextTime},</if>
<if test="mobile != null">#{mobile},</if>
<if test="telephone != null">#{telephone},</if>
<if test="email != null">#{email},</if>
<if test="post != null">#{post},</if>
<if test="customerId != null">#{customerId},</if>
<if test="address != null">#{address},</if>
<if test="remark != null">#{remark},</if>
<if test="createUserId != null">#{createUserId},</if>
<if test="ownerUserId != null">#{ownerUserId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="batchId != null and batchId != ''">#{batchId},</if>
<if test="lastTime != null">#{lastTime},</if>
</trim>
</insert>
<update id="updateWkCrmContacts" parameterType="WkCrmContacts">
update wk_crm_contacts
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="nextTime != null">next_time = #{nextTime},</if>
<if test="mobile != null">mobile = #{mobile},</if>
<if test="telephone != null">telephone = #{telephone},</if>
<if test="email != null">email = #{email},</if>
<if test="post != null">post = #{post},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="address != null">address = #{address},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createUserId != null">create_user_id = #{createUserId},</if>
<if test="ownerUserId != null">owner_user_id = #{ownerUserId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="batchId != null and batchId != ''">batch_id = #{batchId},</if>
<if test="lastTime != null">last_time = #{lastTime},</if>
</trim>
where contacts_id = #{contactsId}
</update>
<delete id="deleteWkCrmContactsById" parameterType="Long">
delete from wk_crm_contacts where contacts_id = #{contactsId}
</delete>
<delete id="deleteWkCrmContactsByIds" parameterType="String">
delete from wk_crm_contacts where contacts_id in
<foreach item="contactsId" collection="array" open="(" separator="," close=")">
#{contactsId}
</foreach>
</delete>
</mapper>