From c55207278e32d575b1bbae82c2d19642f5afbc86 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Fri, 6 Sep 2024 16:53:31 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E5=BA=9F=E5=89=8D=E7=AB=AF=E6=8C=89=E9=92=AE?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E4=BD=9C=E5=BA=9F=E5=89=8D=E6=8F=90?= =?UTF-8?q?=E9=86=92=E5=92=8C=E7=A1=AE=E8=AE=A4=E5=90=8E=E6=89=93=E5=BC=80?= =?UTF-8?q?=E4=BD=9C=E5=BA=9F=E9=A1=B5=E9=9D=A2=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=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=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E6=8A=A5=E4=BB=B7=E4=BD=9C=E5=BA=9F=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=20=E6=96=B0=E5=A2=9E=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E5=AF=B9=E8=B1=A1=E4=BD=9C?= =?UTF-8?q?=E5=BA=9F=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=20=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E4=BD=9C=E5=BA=9F=E5=A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.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SysCustomerQuoteController.java | 39 ++++++++++++++++--- .../service/ISysCustomerQuoteService.java | 5 +++ .../impl/SysCustomerQuoteServiceImpl.java | 31 +++++++++++++++ .../mapper/system/SysCustomerQuoteMapper.xml | 12 ++++-- .../system/customerQuote/cancel.html | 32 +++++++++++++++ .../system/customerQuote/customerQuote.html | 12 +++++- .../system/customerQuote/taskYwjlVerify.html | 30 ++++++++------ .../system/customerQuote/taskYwzgVerify.html | 6 +++ .../system/customerQuote/taskZozjVerify.html | 6 +++ 9 files changed, 150 insertions(+), 23 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/customerQuote/cancel.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java index 5f386507..b9bf6b13 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java @@ -295,17 +295,44 @@ public class SysCustomerQuoteController extends BaseController return success("任务已完成"); } + + + /** + * 加载作废客户信息弹窗 + */ + @GetMapping("/cancel/{id}") + public String cancel(@PathVariable("id") Long id, ModelMap mmap) { + SysCustomerQuote sysCustomerQuote = sysCustomerQuoteService.selectSysCustomerQuoteById(id); + mmap.put("sysCustomerQuote", sysCustomerQuote); + return prefix + "/cancel"; + } + + /** - * 作废客户报价 + * 作废客户信息 */ - // @RequiresPermissions("erp:material:cancel") - @Log(title = "客户报价信息", businessType = BusinessType.CANCEL) - @GetMapping( "/cancel/{id}") + @RequiresPermissions("system:customerQuote:cancel") + @Log(title = "客户信息", businessType = BusinessType.CANCEL) + @PostMapping( "/cancel") @ResponseBody - public AjaxResult cancel(@PathVariable("id") Long id){ - return AjaxResult.success(sysCustomerQuoteService.cancelSysCustomerById(id)); + public AjaxResult cancel(SysCustomerQuote sysCustomerQuote){ + return toAjax(sysCustomerQuoteService.cancelSysCustomerQuoteByObject(sysCustomerQuote)); + } + + +// /** +// * 作废客户报价 +// */ +// // @RequiresPermissions("erp:material:cancel") +// @Log(title = "客户报价信息", businessType = BusinessType.CANCEL) +// @GetMapping( "/cancel/{id}") +// @ResponseBody +// public AjaxResult cancel(@PathVariable("id") Long id){ +// return AjaxResult.success(sysCustomerQuoteService.cancelSysCustomerById(id)); +// } + /** * 恢复客户报价 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java index b8a592dc..1fd793f2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java @@ -117,4 +117,9 @@ public interface ISysCustomerQuoteService * 通过用户名找到业务登录名,重新给业务员赋值 * */ String convertName(SysCustomerQuoteVo sysCustomerQuoteVo); + + /** + * 根据客户报价对象作废客户报价 + * */ + int cancelSysCustomerQuoteByObject(SysCustomerQuote sysCustomerQuote); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java index 60276398..73c7ac00 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java @@ -312,6 +312,37 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { return processInstance; } + /** + * 根据客户报价对象作废客户报价 + * */ + @Override + public int cancelSysCustomerQuoteByObject(SysCustomerQuote sysCustomerQuote) { + SysCustomerQuoteVo sysCustomerQuoteVo = sysCustomerQuoteMapper.selectSysCustomerQuoteById(sysCustomerQuote.getId()); + // 审核状态-待审核 + sysCustomerQuoteVo.setAuditStatus("0"); + SysUser user = ShiroUtils.getSysUser(); + // 启动流程 + String applyTitle = user.getUserName()+"发起了客户报价信息作废审批-"+ DateUtils.dateTimeNow(); + String instanceType = "cancel"; + SysCustomerQuote tempSysCustomerQuote = new SysCustomerQuote(); + BeanUtils.copyProperties(sysCustomerQuoteVo,tempSysCustomerQuote); + ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,tempSysCustomerQuote, user); + String processInstanceId = processInstance.getProcessInstanceId(); + // 作废实例id + tempSysCustomerQuote.setCancelInstanceId(processInstanceId); + // 存在提交完就流程结束的情况 + boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId); + if(processIsFinish){ + // 审核状态-审核通过 + tempSysCustomerQuote.setAuditStatus("1"); + // 使用状态-已作废 + tempSysCustomerQuote.setUseStatus("2"); + } + tempSysCustomerQuote.setCancelRemark(sysCustomerQuote.getCancelRemark()); + return sysCustomerQuoteMapper.updateSysCustomerQuote(tempSysCustomerQuote); + + } + @Override public ProcessInstance restoreSysCustomerById(Long id) { SysCustomerQuoteVo sysCustomerVo = sysCustomerQuoteMapper.selectSysCustomerQuoteById(id); diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml index 85fd31a2..49adb652 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml @@ -46,11 +46,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id,supplierCode,customerCode,customerName,pricingDate,enterprise,enterpriseSum,common_currency, + select id,supplierCode,customerCode,customerName,pricingDate,enterprise,enterpriseSum,common_currency,cancel_remark, confirm_tax,rmbTax,usdTax,noRmb,noRmbSum,rmb,rmbSum,noUsd,noUsdSum,usd,usdSum,business_members, degin_flag,del_flag,create_by,create_time,update_by,update_time,remark,audit_status,use_status, instance_id,instance_type,submit_instance_id,cancel_instance_id,restore_instance_id,apply_title,apply_user,apply_time,del_flag @@ -175,7 +176,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" use_status, audit_status, create_time, - del_flag + del_flag, + cancel_remark, #{supplierCode}, @@ -212,7 +214,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{useStatus}, #{auditStatus}, #{createTime}, - #{delFlag} + #{delFlag}, + #{cancelRemark}, @@ -252,7 +255,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" apply_user = #{applyUser}, apply_time = #{applyTime}, update_time = #{updateTime}, - del_flag = #{delFlag} + del_flag = #{delFlag}, + cancel_remark = #{cancelRemark}, where id = #{id} diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/cancel.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/cancel.html new file mode 100644 index 00000000..838d0eb8 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/cancel.html @@ -0,0 +1,32 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html index c4b4c8a7..ba6cd6df 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html @@ -202,7 +202,7 @@ var actions = []; if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId){ // 作废 - actions.push(' 作废'); + actions.push(' 作废'); // 编辑 actions.push(' 编辑 '); }else{ @@ -246,6 +246,16 @@ }); + // 作废 + function cancel(id) { + + $.modal.confirm("确定作废该销售订单吗?", function() { + var url = prefix + "/cancel/" + id; + $.modal.open("作废", url); + }) + } + + // 导出 function exportExcel(formId) { diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html index a46dade4..9513938a 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html @@ -114,6 +114,12 @@ +
+ +
+ +
+
@@ -136,24 +142,24 @@

计算

- - + +
- - + +
- - + +
-
- - +
+ +
-
- - +
+ +
diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html index 45223d1e..af593ff7 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html @@ -115,6 +115,12 @@
+
+ +
+ +
+
diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html index 77481263..27a2cf90 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html @@ -116,6 +116,12 @@
+
+ +
+ +
+