From 667215bffdb34cf0219af40fcda47e900d5a4c86 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Tue, 3 Sep 2024 18:17:58 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7=E8=B5=84=E6=96=99=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=A1=A8=EF=BC=8C=E6=96=B0=E5=A2=9E=E4=BD=9C=E5=BA=9F?= =?UTF-8?q?=E7=90=86=E7=94=B1=E5=AD=97=E6=AE=B5=20=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB=E6=96=B0=E5=A2=9E=E4=BD=9C=E5=BA=9F?= =?UTF-8?q?=E7=90=86=E7=94=B1=E5=AD=97=E6=AE=B5=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=B5=84=E6=96=99=E7=9A=84=E4=BD=9C=E5=BA=9F?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=8C=89=E9=92=AE=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BD=9C=E5=BA=9F=E5=89=8D=E6=8F=90=E9=86=92=E5=92=8C=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E5=90=8E=E6=89=93=E5=BC=80=E4=BD=9C=E5=BA=9F=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20=E6=96=B0=E5=A2=9E=E4=BD=9C=E5=BA=9F=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E9=A1=B5=E9=9D=A2=20=E6=96=B0=E5=A2=9E=20=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=AE=A2=E6=88=B7=E8=B5=84=E6=96=99=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E4=BD=9C=E5=BA=9F=E5=AE=A2=E6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B6=E9=97=B4=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysCustomerController.java | 25 +++++++++++--- .../com/ruoyi/system/domain/SysCustomer.java | 1 + .../system/mapper/SysCustomerMapper.java | 5 +++ .../system/service/ISysCustomerService.java | 5 +++ .../service/impl/SysCustomerServiceImpl.java | 33 +++++++++++++++++++ .../mapper/system/SysCustomerMapper.xml | 17 ++++++++-- .../templates/system/customer/cancel.html | 32 ++++++++++++++++++ .../templates/system/customer/customer.html | 14 ++++++-- .../system/customer/taskModifyApply.html | 18 +++++----- .../system/customer/taskYwjlVerify.html | 26 ++++++++------- .../system/customer/taskYwzgVerify.html | 18 +++++----- .../system/customer/taskZozjVerify.html | 17 +++++----- .../ruoyi/common/core/domain/BaseEntity.java | 11 +++++++ 13 files changed, 175 insertions(+), 47 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/customer/cancel.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java index 728b4184..7b73d17d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java +++ b/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)); + } + + /** * 恢复物料信息 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java index 2c5352db..ea8c5197 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java +++ b/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(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java index 3760c194..6530d657 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java +++ b/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 selectSysCustomerBycode(); SysCustomerVo selectSysCustomerByEnterpriseCode(String enterpriseCode); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java index 11073831..b60804a3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java +++ b/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); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java index 14fc4b51..58b5f2cb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java +++ b/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); + } } diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml index 641783ee..1130948c 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml @@ -62,6 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + 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 @@ -220,6 +222,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, rmb_flag, usd_flag + cancel_remark, #{enterpriseCode}, @@ -274,6 +277,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createTime}, #{rmbFlag}, #{usdFlag} + #{cancelRemark}, @@ -323,6 +327,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" customer_remarks = #{customerRemarks}, customer_sign = #{customer_sign}, update_by = #{updateBy}, + update_time = #{updateTime}, instance_id = #{instanceId}, instance_type = #{instanceType}, submit_instance_id = #{submitInstanceId}, @@ -332,7 +337,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" apply_user = #{applyUser}, apply_time = #{applyTime}, rmb_flag = #{rmbFlag}, - usd_flag = #{usdFlag} + usd_flag = #{usdFlag}, + cancel_remark = #{cancelRemark}, where id = #{id} @@ -346,6 +352,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + + update sys_customer set del_flag = '1', use_status = '2',cancel_remark = #{cancelRemark} + where enterprise_code = #{enterpriseCode} + + + update sys_customer set del_flag = '1' where id = #{id} diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/cancel.html b/ruoyi-admin/src/main/resources/templates/system/customer/cancel.html new file mode 100644 index 00000000..baa06c43 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/customer/cancel.html @@ -0,0 +1,32 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/customer.html b/ruoyi-admin/src/main/resources/templates/system/customer/customer.html index c7f3a1e0..d46c1720 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/customer.html +++ b/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(' 作废'); + actions.push(' 作废'); // 编辑 actions.push(' 编辑 '); }else{ @@ -638,6 +638,16 @@ }); }); + + //作废 + function cancel(id) { + $.modal.confirm("确认要作废该客户资料吗?", function () { + var url = prefix + '/cancel/' + id; + $.modal.open("作废", url); + }) + } + + //导出 function exportCustomerInfo() { // rows为选中行的id diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/taskModifyApply.html b/ruoyi-admin/src/main/resources/templates/system/customer/taskModifyApply.html index 95eceb4d..01f512f5 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/taskModifyApply.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/taskModifyApply.html @@ -262,27 +262,27 @@ shiro:haspermission="customer:selectBusinessMembers"> -
- -
- - -
-
+
+
- + +
+
+
+ +
+
-
diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/taskYwjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/customer/taskYwjlVerify.html index e06deacc..83d03a2e 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/taskYwjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/taskYwjlVerify.html @@ -270,28 +270,29 @@
- -
- - + +
+
+ + +
+
- -
- - + +
+
- +
- +
-
- +
+
diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/taskYwzgVerify.html b/ruoyi-admin/src/main/resources/templates/system/customer/taskYwzgVerify.html index 42745cf2..ae9b18e1 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/taskYwzgVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/taskYwzgVerify.html @@ -269,27 +269,27 @@
-
- -
- - -
-
+
+
- + +
+
+
+ +
+
-
diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/taskZozjVerify.html b/ruoyi-admin/src/main/resources/templates/system/customer/taskZozjVerify.html index 6fc47c7c..e903e0cf 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/taskZozjVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/taskZozjVerify.html @@ -268,24 +268,25 @@
-
- -
- - -
-
+
+
- + +
+
+
+ +
+
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java index f7d5bf46..fd5c45e0 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java +++ b/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 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 getParams() { if (params == null)