Browse Source

[update:]客户表操作记录,修改。

erp、
zhangsiqi 10 months ago
parent
commit
99dc262349
  1. 1
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java
  2. 1
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java
  3. 1
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerOper.java
  4. 1
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java
  5. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerOperMapper.java
  6. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerOperService.java
  7. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java
  8. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerOperServiceImpl.java
  9. 17
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java
  10. 2
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml
  11. 1
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerOperMapper.xml
  12. 185
      ruoyi-admin/src/main/resources/templates/system/customer/customer.html

1
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java

@ -141,6 +141,7 @@ public class SysCustomerController extends BaseController
} }
/** /**
* 修改客户基本信息 * 修改客户基本信息
*/ */

1
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java

@ -240,6 +240,7 @@ public class SysCustomer extends BaseEntity
return customerOffice; return customerOffice;
} }
public void setCustomerOffice(String customerOffice) { public void setCustomerOffice(String customerOffice) {
this.customerOffice = customerOffice; this.customerOffice = customerOffice;
} }

1
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerOper.java

@ -19,6 +19,7 @@ public class SysCustomerOper {
public int getId() { public int getId() {
return id; return id;
} }
public void setId(int id) { public void setId(int id) {
this.id = id; this.id = id;

1
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java

@ -18,6 +18,7 @@ public interface SysCustomerMapper
* @param customerId 客户基本信息ID * @param customerId 客户基本信息ID
* @return 客户基本信息 * @return 客户基本信息
*/ */
public SysCustomer selectSysCustomerById(Long customerId); public SysCustomer selectSysCustomerById(Long customerId);
/** /**

2
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerOperMapper.java

@ -42,6 +42,8 @@ public interface SysCustomerOperMapper
* @param sysCustomerOper 客户基本信息 * @param sysCustomerOper 客户基本信息
* @return 结果 * @return 结果
*/ */
public int updateSysCustomerOper(SysCustomerOper sysCustomerOper); public int updateSysCustomerOper(SysCustomerOper sysCustomerOper);
} }

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerOperService.java

@ -1,11 +1,8 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import com.ruoyi.system.domain.SysCustomer;
import com.ruoyi.system.domain.SysCustomerOper; import com.ruoyi.system.domain.SysCustomerOper;
import org.activiti.engine.runtime.ProcessInstance;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 客户基本信息Service接口 * 客户基本信息Service接口
@ -44,6 +41,7 @@ public interface ISysCustomerOperService
* *
* @param sysCustomerOper 客户基本信息 * @param sysCustomerOper 客户基本信息
* @return 结果 * @return 结果
*
*/ */
public int updateSysCustomerOper(SysCustomerOper sysCustomerOper); public int updateSysCustomerOper(SysCustomerOper sysCustomerOper);
} }

5
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java

@ -1,10 +1,8 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import com.ruoyi.system.domain.SysCustomer; import com.ruoyi.system.domain.SysCustomer;
import org.activiti.engine.runtime.ProcessInstance;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 客户基本信息Service接口 * 客户基本信息Service接口
@ -12,7 +10,7 @@ import java.util.Map;
* @author ruoyi * @author ruoyi
* @date 2022-11-02 * @date 2022-11-02
*/ */
public interface ISysCustomerService public interface ISysCustomerService
{ {
/** /**
* 查询客户基本信息 * 查询客户基本信息
@ -22,6 +20,7 @@ public interface ISysCustomerService
*/ */
public SysCustomer selectSysCustomerById(Long customerId); public SysCustomer selectSysCustomerById(Long customerId);
/** /**
* 查询客户基本信息列表 * 查询客户基本信息列表
* *

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerOperServiceImpl.java

@ -5,6 +5,7 @@ import com.ruoyi.system.mapper.SysCustomerOperMapper;
import com.ruoyi.system.service.ISysCustomerOperService; import com.ruoyi.system.service.ISysCustomerOperService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -30,6 +31,7 @@ public class SysCustomerOperServiceImpl implements ISysCustomerOperService
return sysCustomerOperMapper.selectSysCustomerOperList(sysCustomerOper); return sysCustomerOperMapper.selectSysCustomerOperList(sysCustomerOper);
} }
@Override @Override
public int insertSysCustomerOper(SysCustomerOper sysCustomerOper) { public int insertSysCustomerOper(SysCustomerOper sysCustomerOper) {
return sysCustomerOperMapper.insertSysCustomerOper(sysCustomerOper); return sysCustomerOperMapper.insertSysCustomerOper(sysCustomerOper);

17
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java

@ -1,29 +1,13 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.flow.domain.BizRequestItem;
import com.ruoyi.flow.service.FlowService;
import com.ruoyi.process.leave.domain.BizLeaveVo;
import com.ruoyi.process.todoitem.domain.BizTodoItem;
import com.ruoyi.process.todoitem.service.IBizTodoItemService;
import com.ruoyi.system.domain.SysCustomer; import com.ruoyi.system.domain.SysCustomer;
import com.ruoyi.system.mapper.SysCustomerMapper; import com.ruoyi.system.mapper.SysCustomerMapper;
import com.ruoyi.system.service.ISysCustomerService; import com.ruoyi.system.service.ISysCustomerService;
import org.activiti.engine.IdentityService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.apache.commons.lang3.BooleanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.ui.ModelMap;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 客户基本信息Service业务层处理 * 客户基本信息Service业务层处理
@ -34,6 +18,7 @@ import java.util.Map;
@Service @Service
public class SysCustomerServiceImpl implements ISysCustomerService public class SysCustomerServiceImpl implements ISysCustomerService
{ {
@Autowired @Autowired
private SysCustomerMapper sysCustomerMapper; private SysCustomerMapper sysCustomerMapper;

2
ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml

@ -87,6 +87,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<insert id="insertSysCustomer" parameterType="SysCustomer" useGeneratedKeys="true" keyProperty="customerId"> <insert id="insertSysCustomer" parameterType="SysCustomer" useGeneratedKeys="true" keyProperty="customerId">
insert into sys_customer insert into sys_customer
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

1
ruoyi-admin/src/main/resources/mapper/system/SysCustomerOperMapper.xml

@ -33,6 +33,7 @@
<include refid="selectSysCustomerOperVo"/> <include refid="selectSysCustomerOperVo"/>
where id = #{id} where id = #{id}
</select> </select>
<update id="updateSysCustomerOper" parameterType="SysCustomerOper"> <update id="updateSysCustomerOper" parameterType="SysCustomerOper">
update sys_customer_oper set update sys_customer_oper set
<if test="purser != null and purser != ''">purser = #{purser},</if> <if test="purser != null and purser != ''">purser = #{purser},</if>

185
ruoyi-admin/src/main/resources/templates/system/customer/customer.html

@ -92,10 +92,10 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:customer:add"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:customer:add">
<i class="fa fa-plus"></i> 添加 <i class="fa fa-plus"></i> 添加
</a> </a>
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()"--> <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
<!-- shiro:hasPermission="system:customer:edit">--> shiro:hasPermission="system:customer:edit">
<!-- <i class="fa fa-edit"></i> 修改--> <i class="fa fa-edit"></i> 修改
<!-- </a>--> </a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="system:customer:remove"> shiro:hasPermission="system:customer:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
@ -116,8 +116,9 @@
<i class="fa fa-ambulance"></i> 添加送货地址 <i class="fa fa-ambulance"></i> 添加送货地址
</a> </a>
<a class="btn btn-primary" onclick="showCustomerAudit()" shiro:hasPermission="system:customer:audit"> <a class="btn btn-primary" onclick="showAudit()" shiro:hasPermission="system:customer:edit">
<i class="fa fa-edit"></i> 审核
<i class="fa fa-ambulance"></i> 审核
</a> </a>
<a class="btn btn-success" onclick="showdetails()" > <a class="btn btn-success" onclick="showdetails()" >
<i class="fa fa-file-text"></i> 详情列表 <i class="fa fa-file-text"></i> 详情列表
@ -659,9 +660,10 @@
</div> </div>
<div class="addressList sh"> <div class="addressList sh">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<div class="details" style="padding: 8px 0;font-size: 18px">操作记录</div> <div class="details" style="padding: 8px 0;font-size: 18px">操作历史</div>
<table id="oper-table"></table> <table id="oper-table"></table>
</div> </div>
</div> </div>
</div> </div>
@ -683,7 +685,7 @@
<div class="modal-body" style="height: 180px"> <div class="modal-body" style="height: 180px">
<form id="form-audit-edit"> <form id="form-audit-edit">
<div class="form-group" style="display: none"> <div class="form-group" style="display: none">
<label class="col-sm-3 control-label is-required">客户id:</label> <label class="col-sm-3 control-label is-required">客户id:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input id="customerId" name="customerId" class="form-control" type="text" <input id="customerId" name="customerId" class="form-control" type="text"
required required
@ -700,19 +702,28 @@
</select> </select>
</div> </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 id="operTime" name="operTime" class="form-control "
placeholder="yyyy-MM-dd HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">审核人:</label> <label class="col-sm-3 control-label">审核人:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input id="identifyingPeople" name="identifyingPeople" class="form-control" type="text" readonly> <input id="identifyingPeople" name="identifyingPeople" class="form-control" type="text">
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" onclick="AuditConfirmSubmit(1)" class="btn btn-danger" data-dismiss="modal">审核拒绝</button>
<button type="button" onclick="AuditConfirmSubmit(1)" class="btn btn-danger" data-dismiss="modal" editFlag>审核拒绝</button> <button type="button" onclick="AuditConfirmSubmit(2)" class="btn btn-success" data-dismiss="modal">审核通过</button>
<button type="button" onclick="AuditConfirmSubmit(2)" class="btn btn-success" data-dismiss="modal" editFlag>审核通过</button>
</div> </div>
</div> </div>
</div> </div>
@ -754,7 +765,7 @@
if (value == 0){ if (value == 0){
return "待审核"; return "待审核";
} }
if (value == 1){ if(value==1){
return "审核通过"; return "审核通过";
} }
if (value == 2){ if (value == 2){
@ -769,7 +780,7 @@
if (value == 0){ if (value == 0){
return "否"; return "否";
} }
if (value==1){ if(value==1){
return "是"; return "是";
} }
if (value == 2){ if (value == 2){
@ -1071,9 +1082,11 @@
function submitHandler() { function submitHandler() {
if ($.validate.form('form-contacts-add')) { if ($.validate.form('form-contacts-add')) {
$.operate.save(prefix + "/add", $('#form-contacts-add').serialize()); $.operate.save(prefix1 + "/add", $('#form-contacts-add').serialize());
$('#infoModal').modal("hide") $('#infoModal').modal("hide")
} }
} }
// 列表联系人明细 // 列表联系人明细
@ -1381,6 +1394,85 @@
}, },
] ]
}); });
$('#oper-table').bootstrapTable('destroy');
$('#oper-table').bootstrapTable({
url: '/system/customer/operList',
pagination: true,
pageNumber: 1,
pageSize: 10,
pageList: [10, 25, 50, 100],
showRefresh: false,
method: "post",
contentType: "application/x-www-form-urlencoded",
striped: true, // 是否显示行间隔色
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
clickToSelect: true, // 是否启用点击选中行
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮
singleSelect: true,
paginationDetailHAlign: ' hiddenDetailInfo',
height: 150,
queryParams: function (params) {
//console.log("123");
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
enterpriseCode: row.enterpriseCode
};
// console.log(data[0].enterpriseCode)
return curParams
},
columns: [
{
field: 'id',
title: '客户/企业代码',
visible: false
},
{
field: 'enterpriseCode',
title: '客户/企业代码',
visible: false
},
{
field: 'enterpriseName',
title: '客户/企业名称',
},
{
field: 'purser',
title: '事业部'
},
{
field: 'operPeople',
title: '操作人'
},
{
field: 'oper',
field: '操作'
},
{
field: 'createTime',
field: '操作时间'
},{
field: 'operStatus',
title: '操作状态',
formatter:function (value,index,row){
if (value == 0){
return '成功';
}else{
return '失败';
}
}
}
]
});
$("#detailsModal").modal("show"); $("#detailsModal").modal("show");
} else { } else {
$.modal.alert("请选择一条数据"); $.modal.alert("请选择一条数据");
@ -1458,7 +1550,7 @@
} }
// 联系人 // 联系人
$('#contacts-table').bootstrapTable('destroy'); $('#contacts-table').bootstrapTable('destroy');
$('#contacts-table').bootstrapTable({ $('#contacts-table').bootstrapTable({
url: '/system/contacts/list', url: '/system/contacts/list',
@ -1639,7 +1731,7 @@
] ]
}); });
//客户表操作记录
$('#oper-table').bootstrapTable('destroy'); $('#oper-table').bootstrapTable('destroy');
$('#oper-table').bootstrapTable({ $('#oper-table').bootstrapTable({
url: '/system/customer/operList', url: '/system/customer/operList',
@ -1668,9 +1760,8 @@
// 传递参数查询参数 // 传递参数查询参数
pageSize: params.limit, pageSize: params.limit,
pageNum: params.offset / params.limit + 1, pageNum: params.offset / params.limit + 1,
enterpriseCode: row.enterpriseCode, enterpriseCode: row.enterpriseCode
enterpriseName: row.enterpriseName,
purser: row.customerPurser
}; };
// console.log(data[0].enterpriseCode) // console.log(data[0].enterpriseCode)
return curParams return curParams
@ -1678,12 +1769,13 @@
columns: [ columns: [
{ {
field: 'id', field: 'id',
title: '操作id', title: '客户/企业代码',
visible: false visible: false
}, },
{ {
field: 'enterpriseCode', field: 'enterpriseCode',
title: '客户/代码', title: '客户/企业代码',
visible: false
}, },
{ {
field: 'enterpriseName', field: 'enterpriseName',
@ -1693,40 +1785,39 @@
field: 'purser', field: 'purser',
title: '事业部' title: '事业部'
}, },
{
field: 'oper',
title: '操作'
},
{ {
field: 'operPeople', field: 'operPeople',
title: '操作人' title: '操作人'
}, },
{ {
field: 'createTime', field: 'oper',
title: '操作时间' field: '操作'
}, },
{ {
field: 'createTime',
field: '操作时间'
},{
field: 'operStatus', field: 'operStatus',
title: '操作的状态', title: '操作状态',
formatter : function(value, row, index) { formatter:function (value,index,row){
if (value == 0){ if (value == 0){
return "成功"; return '成功';
}else{ }else{
return "失败" return '失败';
} }
} }
}, }
] ]
}); });
$("#detailsModal").modal("show"); $("#detailsModal").modal("show");
}) })
function showCustomerAudit() { function showAudit() {
let data = $("#bootstrap-table").bootstrapTable("getSelections"); let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]]; let userName = [[${@permission.getPrincipalProperty('userName')}]];
if (data.length === 1) { if (data.length === 1) {
$("#customerId").val(data[0].customerId) $("#customerIdId").val(data[0].customerId)
$("#deginflag").val(1).trigger("change") $("#deginflag").val(1).trigger("change")
$("#identifyingPeople").val(userName); $("#identifyingPeople").val(userName)
$("#AuditModel").modal("show"); $("#AuditModel").modal("show");
} else { } else {
$.modal.alert("请选择一条数据"); $.modal.alert("请选择一条数据");
@ -1734,27 +1825,23 @@
} }
function AuditConfirmSubmit(number) { function AuditConfirmSubmit(number) {
$("#deginflag").val(number).trigger("change"); var auditNo = $("deginflag").val()
var auditNo = $("#deginflag").val() + "";
var formData = $('#form-audit-edit').serialize();
formData = formData + "&" +"deginflag=" + auditNo;
console.log(auditNo);
$.ajax({ $.ajax({
url: prefix + "/edit", url: prefix + "/edit",
type: "post", type: "post",
resultType: "json", resultType: "json",
data: formData, data: $('#form-audit-edit').serialize(),
success: function (resp) { success: function (resp) {
console.log(resp); console.log(resp)
$("#bootstrap-table").bootstrapTable('refresh'); $("#bootstrap-table").bootstrapTable('refresh');
// $(".alert-success").addClass("show"); // $(".alert-success").addClass("show");
// window.setTimeout(function () { // window.setTimeout(function () {
// $(".alert-success").removeClass("show"); // $(".alert-success").removeClass("show");
// }, 1000);//显示的时间 // }, 1000);//显示的时间
if(resp.msg == 0){ if (resp.msg == 0) {
$.modal.msgSuccess("审核成功!") $.modal.msgSuccess("审核成功!")
}else{ } else {
$.modal.msgError("审核失败") $.modal.msgError("审核失败")
} }
}, },
error: function () { error: function () {

Loading…
Cancel
Save