Browse Source

[fix] 销售管理

修改客户资料数据表,新增作废理由字段
公共实体类新增作废理由字段
修改客户资料的作废前端按钮,新增作废前提醒和确认后打开作废页面
新增作废前端页面
新增 根据客户资料对象作废客户资料后端接口
新增 加载作废客户信息弹窗后端接口
修改 作废客户信息后端接口
修改驳回调整、总经理审批、业务经理审批、业务主管审批的前端页面:新增作废理由、对备注进行赋值、去掉是否作废字段
修改客户资料修改时间不显示问题
dev
liuxiaoxu 3 weeks ago
parent
commit
667215bffd
  1. 25
      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. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java
  5. 33
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java
  6. 17
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml
  7. 32
      ruoyi-admin/src/main/resources/templates/system/customer/cancel.html
  8. 14
      ruoyi-admin/src/main/resources/templates/system/customer/customer.html
  9. 18
      ruoyi-admin/src/main/resources/templates/system/customer/taskModifyApply.html
  10. 24
      ruoyi-admin/src/main/resources/templates/system/customer/taskYwjlVerify.html
  11. 18
      ruoyi-admin/src/main/resources/templates/system/customer/taskYwzgVerify.html
  12. 17
      ruoyi-admin/src/main/resources/templates/system/customer/taskZozjVerify.html
  13. 11
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java

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

@ -530,18 +530,33 @@ public class SysCustomerController extends BaseController
}
return new SysCustomerVo();
}
/**
* 作废物料信息
* 加载作废客户信息弹窗
*/
@GetMapping("/cancel/{id}")
public String cancel(@PathVariable("id") Long id, ModelMap mmap) {
SysCustomer sysCustomer = sysCustomerService.selectSysCustomerById(id);
mmap.put("sysCustomer", sysCustomer);
return prefix + "/cancel";
}
/**
* 作废客户信息
*/
@RequiresPermissions("system:customer:cancel")
@Log(title = "客户信息", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@PostMapping( "/cancel")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
sysCustomerService.cancelSysCustomerById(id);
return AjaxResult.success();
public AjaxResult cancel(SysCustomer sysCustomer){
return toAjax(sysCustomerService.cancelSysCustomerByObject(sysCustomer));
}
/**
* 恢复物料信息
*/

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

@ -759,6 +759,7 @@ public class SysCustomer extends BaseEntity
.append("customerId",getCustomerId())
.append("customerName",getCustomerName())
.append("createTime", getCreateTime())
.append("cancelRemark",getCancelRemark())
.toString();
}
}

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

@ -79,6 +79,11 @@ public interface SysCustomerMapper
int deleteSysCustomerByIds(String[] ids);
/**
* 根据客户资料对象作废客户资料
* */
int cancelSysCustomerByObject(SysCustomer sysCustomer);
List<SysCustomer> selectSysCustomerBycode();
SysCustomerVo selectSysCustomerByEnterpriseCode(String enterpriseCode);

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

@ -110,4 +110,9 @@ public interface ISysCustomerService
* 通过开票公司名称查询开票公司信息
* */
SysInvoice getSysInvoiceInfoByName(String invoiceCompanyName);
/**
* 根据客户资料对象作废客户资料
* */
int cancelSysCustomerByObject(SysCustomer sysCustomer);
}

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

@ -516,4 +516,37 @@ public class SysCustomerServiceImpl implements ISysCustomerService
}
/**
* 根据客户资料对象作废客户资料
* */
@Transactional(rollbackFor = Exception.class)
@Override
public int cancelSysCustomerByObject(SysCustomer sysCustomer) {
SysCustomerVo sysCustomerVo = sysCustomerMapper.selectSysCustomerById(sysCustomer.getId());
// 审核状态-待审核
sysCustomerVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了客户信息作废审批-"+ DateUtils.dateTimeNow();
String instanceType = "cancel";
SysCustomer tempSysCustomer = new SysCustomer();
BeanUtils.copyProperties(sysCustomerVo,tempSysCustomer);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,tempSysCustomer, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 作废实例id
tempSysCustomer.setCancelInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
tempSysCustomer.setAuditStatus("1");
// 使用状态-已作废
tempSysCustomer.setUseStatus("2");
}
tempSysCustomer.setCancelRemark(sysCustomer.getCancelRemark());
return sysCustomerMapper.updateSysCustomer(tempSysCustomer);
}
}

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

@ -62,6 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="rmbFlag" column="rmb_flag" />
<result property="usdFlag" column="usd_flag" />
<result property="cancelRemark" column="cancel_remark" />
</resultMap>
<sql id="selectSysCustomerVo">
select id,enterprise_code,enterprise_name,english_name,customer_abbreviation ,customer_purser ,
@ -71,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
customer_contact_id,customer_contact,customer_office,contact_number,customer_email,customer_fax,
delivery_address_id,delivery_customer_person,delivery_customer_phone,
delivery_address,delivery_customer_postal,delivery_customer_fax,business_members,
identifying_people,first_add_time,update_info_time, create_time ,audit_status,use_status,update_by,rmb_flag,usd_flag,
identifying_people,first_add_time,update_info_time, create_time ,audit_status,use_status,update_by,rmb_flag,usd_flag, cancel_remark,
apply_user,apply_time , instance_id , instance_type from sys_customer
</sql>
@ -220,6 +222,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="rmbFlag != null">rmb_flag,</if>
<if test="usdFlag != null">usd_flag</if>
<if test="cancelRemark != null">cancel_remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseCode!=null and enterpriseCode != ''">#{enterpriseCode},</if>
@ -274,6 +277,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null"> #{createTime},</if>
<if test="rmbFlag != null"> #{rmbFlag},</if>
<if test="usdFlag != null"> #{usdFlag} </if>
<if test="cancelRemark != null">#{cancelRemark},</if>
</trim>
</insert>
@ -323,6 +327,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="customerRemarks!=null">customer_remarks = #{customerRemarks},</if>
<if test="customerSign!=null">customer_sign = #{customer_sign},</if>
<if test="updateBy!=null">update_by = #{updateBy},</if>
<if test="updateTime!=null">update_time = #{updateTime},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if>
<if test="instanceType != null">instance_type = #{instanceType},</if>
<if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if>
@ -332,7 +337,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="rmbFlag != null">rmb_flag = #{rmbFlag},</if>
<if test="usdFlag != null">usd_flag = #{usdFlag} </if>
<if test="usdFlag != null">usd_flag = #{usdFlag},</if>
<if test="cancelRemark != null">cancel_remark = #{cancelRemark},</if>
</trim>
where id = #{id}
</update>
@ -346,6 +352,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<update id="cancelSysCustomerByObject" parameterType="SysCustomer">
update sys_customer set del_flag = '1', use_status = '2',cancel_remark = #{cancelRemark}
where enterprise_code = #{enterpriseCode}
</update>
<update id="cancelSysCustomerById" parameterType="Long">
update sys_customer set del_flag = '1' where id = #{id}
</update>

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

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('作废')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal" id="form-customer-cancel" th:object="${sysCustomer}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:field="*{cancelRemark}" class="form-control" required></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/customer";
$("#form-customer-cancel").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/cancel", $('#form-customer-cancel').serialize());
}
}
</script>
</body>
</html>

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

@ -546,14 +546,14 @@
if (value == null) {return " ";} else { return value;}
}
},
{title: '上次修改时间',field: 'updateInfoTime',},
{title: '上次修改时间',field: 'updateTime',},
{title: '操作',align: 'center',
formatter: function(value, row, index) {
var actions = [];
// 审核状态-审核通过 使用状态-是 未发起作废流程
if((row.auditStatus=="1" || row.auditStatus=="2") && !row.cancelInstanceId){
// 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>');
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
}else{
@ -638,6 +638,16 @@
});
});
//作废
function cancel(id) {
$.modal.confirm("确认要作废该客户资料吗?", function () {
var url = prefix + '/cancel/' + id;
$.modal.open("作废", url);
})
}
//导出
function exportCustomerInfo() {
// rows为选中行的id

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

@ -262,27 +262,27 @@
shiro:haspermission="customer:selectBusinessMembers"></select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">是否作废:</label>
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<label th:for="${'useStatus_' + dict.dictCode}" th:text="${dict.dictLabel}" th:field="*{useStatus}"></label>
<input type="radio" name="useStatus" th:value="${dict.dictValue}" th:checked="${dict.default}" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">客户标识:</label>
<div class="col-sm-6">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_customer_sign')}">
<label th:for="${'customerSign_' + dict.dictCode}" th:text="${dict.dictLabel}" th:field="*{customerSign}"></label>
<input type="radio" name="customerSign" th:value="${dict.dictValue}" th:checked="${dict.default}" disabled />
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">备注内容:</label>
<div class="col-sm-6">
<textarea th:field="*{customerRemarks}" name="customerRemarks" class="form-control"></textarea>
<textarea name="customerRemarks" th:text="*{customerRemarks}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">作废理由:</label>
<div class="col-sm-6">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control"></textarea>
</div>
</div>
<br/>
<div class="form-group">
<label class="col-sm-6 control-label is-required" for="reApply">是否继续申请:</label>
<div class="col-sm-6">

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

@ -270,28 +270,29 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">是否作废:</label>
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<label th:for="${'useStatus_' + dict.dictCode}" th:text="${dict.dictLabel}" th:field="*{useStatus}"></label>
<input type="radio" name="useStatus" th:value="${dict.dictValue}" th:checked="${dict.default}" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">客户标识:</label>
<label class="col-sm-6 control-label">客户标识:</label>
<div class="col-sm-6">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_customer_sign')}">
<label th:for="${'customerSign_' + dict.dictCode}" th:text="${dict.dictLabel}" th:field="*{customerSign}"></label>
<input type="radio" name="customerSign" th:value="${dict.dictValue}" th:checked="${dict.default}" disabled />
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">备注内容:</label>
<div class="col-sm-6">
<textarea name="customerRemarks" class="form-control" readonly></textarea>
<textarea name="customerRemarks" th:text="*{customerRemarks}" class="form-control" readonly></textarea>
</div>
</div>
<br/>
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="ywjlVerifyApproved">审批意见:</label>
<label class="col-sm-6 control-label">作废理由:</label>
<div class="col-sm-6">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label is-required" for="ywjlVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<select name="p_B_ywjlVerifyApproved" id="ywjlVerifyApproved" class="form-control" required>
<option value=""></option>
@ -306,6 +307,7 @@
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />

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

@ -269,27 +269,27 @@
<input name="businessMembers" class="form-control m-b" th:field="*{businessMembers}" readonly/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">是否作废:</label>
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<label th:for="${'useStatus_' + dict.dictCode}" th:text="${dict.dictLabel}" th:field="*{useStatus}"></label>
<input type="radio" name="useStatus" th:value="${dict.dictValue}" th:checked="${dict.default}" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">客户标识:</label>
<div class="col-sm-6">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_customer_sign')}">
<label th:for="${'customerSign_' + dict.dictCode}" th:text="${dict.dictLabel}" th:field="*{customerSign}"></label>
<input type="radio" name="customerSign" th:value="${dict.dictValue}" th:checked="${dict.default}" disabled />
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">备注内容:</label>
<div class="col-sm-6">
<textarea name="customerRemarks" class="form-control" readonly></textarea>
<textarea name="customerRemarks" th:text="*{customerRemarks}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">作废理由:</label>
<div class="col-sm-6">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea>
</div>
</div>
<br />
<div class="form-group">
<label class="col-sm-6 control-label" for="ywzgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-6">

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

@ -268,24 +268,25 @@
<input name="businessMembers" class="form-control m-b" th:field="*{businessMembers}" readonly />
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">是否作废:</label>
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<label th:for="${'useStatus_' + dict.dictCode}" th:text="${dict.dictLabel}" th:field="*{useStatus}"></label>
<input type="radio" name="useStatus" th:value="${dict.dictValue}" th:checked="${dict.default}" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">客户标识:</label>
<div class="col-sm-6">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_customer_sign')}">
<label th:for="${'customerSign_' + dict.dictCode}" th:text="${dict.dictLabel}" th:field="*{customerSign}"></label>
<input type="radio" name="customerSign" th:value="${dict.dictValue}" th:checked="${dict.default}" disabled />
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">备注内容:</label>
<div class="col-sm-6">
<textarea name="customerRemarks" class="form-control" readonly></textarea>
<textarea name="customerRemarks" th:text="*{customerRemarks}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">作废理由:</label>
<div class="col-sm-6">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group">

11
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java

@ -35,6 +35,9 @@ public class BaseEntity implements Serializable
/** 备注 */
private String remark;
/** 作废理由*/
private String cancelRemark;
/** 请求参数 */
private Map<String, Object> params;
@ -98,6 +101,14 @@ public class BaseEntity implements Serializable
this.remark = remark;
}
public String getCancelRemark() {
return cancelRemark;
}
public void setCancelRemark(String cancelRemark) {
this.cancelRemark = cancelRemark;
}
public Map<String, Object> getParams()
{
if (params == null)

Loading…
Cancel
Save