From f9d10f44202b5304263db5a7400a7445d256296b Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 13 Jun 2024 17:32:06 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=20=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=97=B6=20=E6=97=B6=E9=97=B4=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=92=8C=E5=AD=97=E7=AC=A6=E4=B8=B2=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E4=B8=9A=E5=8A=A1=E4=B8=BB=E7=AE=A1?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E4=B8=8D=E5=90=8C=E6=84=8F=E7=9A=84=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=20=E4=BF=AE=E6=94=B9SysCustomerQuote=E7=9A=84tostring?= =?UTF-8?q?=EF=BC=88=EF=BC=89=E6=96=B9=E6=B3=95=20=E6=96=B0=E5=A2=9Ecreate?= =?UTF-8?q?Time=E5=92=8CcreateBy=E6=96=B9=E6=B3=95=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E5=88=97=E8=A1=A8=E4=B8=BA?= =?UTF-8?q?createTime=E5=80=92=E5=8F=99=E6=8E=92=E5=BA=8F=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=B8=9A=E5=8A=A1=E7=BB=8F=E7=90=86=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=E5=A4=9A=E4=B8=AAinstanceI?= =?UTF-8?q?d=E5=AD=97=E6=AE=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SysCustomerQuoteController.java | 5 +- .../ruoyi/system/domain/SysCustomerQuote.java | 73 ++++++++++--------- .../impl/SysCustomerQuoteServiceImpl.java | 10 ++- .../mapper/system/SysCustomerQuoteMapper.xml | 3 +- .../system/customerQuote/taskYwjlVerify.html | 1 - 5 files changed, 52 insertions(+), 40 deletions(-) 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 4a5154bb..58c49b5a 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 @@ -240,6 +240,7 @@ public class SysCustomerQuoteController extends BaseController String processInstanceId = task.getProcessInstanceId(); ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); SysCustomerQuoteVo sysCustomerQuoteVo = sysCustomerQuoteService.selectSysCustomerQuoteById(new Long(processInstance.getBusinessKey())); + sysCustomerQuoteVo.setTaskId(taskId); mmap.put("formData", sysCustomerQuoteVo); mmap.put("taskId", taskId); String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1); @@ -264,7 +265,9 @@ public class SysCustomerQuoteController extends BaseController @ModelAttribute("preloadObj") SysCustomerQuoteVo sysCustomerQuoteVo, HttpServletRequest request) { boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity); sysCustomerQuoteVo.setSysCustomerQuoteChildList(JSON.parseArray(customerQuoteChildList, SysCustomerQuoteChild.class)); + String instanceId = sysCustomerQuoteVo.getInstanceId(); + String instanceType = sysCustomerQuoteVo.getInstanceType(); boolean approvedFlag = processService.complete(taskId, instanceId, sysCustomerQuoteVo.getApplyTitle(), sysCustomerQuoteVo.getSupplierCode(), @@ -273,7 +276,7 @@ public class SysCustomerQuoteController extends BaseController // 审核状态-审核拒绝 sysCustomerQuoteVo.setAuditStatus("2"); } - // 如果任务已结束更新业务表状态 + // 如果任务已结束更新业务表状态 方法中传入的值为原来的instanceId,只是做了调整 boolean processIsFinish = processService.judgeProcessIsFinish(instanceId); if (processIsFinish) { // 审核通过 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java index a5145cc3..f10a8c6e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java @@ -379,40 +379,45 @@ public class SysCustomerQuote extends BaseEntity @Override public String toString() { - return Objects.toStringHelper(this) - .add("id", id) - .add("supplierCode", supplierCode) - .add("customerCode", customerCode) - .add("customerName", customerName) - .add("pricingDate", pricingDate) - .add("enterprise", enterprise) - .add("enterpriseSum", enterpriseSum) - .add("commonCurrency", commonCurrency) - .add("confirmFax", confirmFax) - .add("rmbTax", rmbTax) - .add("usdTax", usdTax) - .add("noRmbSum", noRmbSum) - .add("noRmb", noRmb) - .add("rmb", rmb) - .add("rmbSum", rmbSum) - .add("noUsd", noUsd) - .add("noUsdSum", noUsdSum) - .add("usd", usd) - .add("usdSum", usdSum) - .add("businessMembers", businessMembers) - .add("deginFlag", deginFlag) - .add("delFlag", delFlag) - .add("auditStatus", auditStatus) - .add("useStatus", useStatus) - .add("applyUser", applyUser) - .add("applyTime", applyTime) - .add("submitInstanceId", submitInstanceId) - .add("applyTitle", applyTitle) - .add("instanceId", instanceId) - .add("instanceType", instanceType) - .add("cancelInstanceId", cancelInstanceId) - .add("restoreInstanceId", restoreInstanceId) - .add("sysCustomerQuoteChildList", sysCustomerQuoteChildList) + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("supplierCode", getSupplierCode()) + .append("businessMembers", getBusinessMembers()) + .append("customerCode", getCustomerCode()) + .append("customerName", getCustomerName()) + .append("enterprise", getEnterprise()) + .append("pricingDate", getPricingDate()) + .append("enterpriseSum", getEnterpriseSum()) + .append("commonCurrency", getCommonCurrency()) + .append("usdTax", getUsdTax()) + .append("confirmFax", getConfirmFax()) + .append("noRmbSum", getNoRmbSum()) + .append("rmbTax", getRmbTax()) + .append("rmbSum", getRmbSum()) + .append("noUsdSum", getNoUsdSum()) + .append("usdSum", getUsdSum()) + .append("rmb", getRmb()) + .append("deginFlag", getDeginFlag()) + .append("noRmb", getNoRmb()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("noUsd", getNoUsd()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("usd", getUsd()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("useStatus", getUseStatus()) + .append("auditStatus", getAuditStatus()) + .append("instanceId", getInstanceId()) + .append("instanceType", getInstanceType()) + .append("submitInstanceId", getSubmitInstanceId()) + .append("cancelInstanceId", getCancelInstanceId()) + .append("restoreInstanceId", getRestoreInstanceId()) + .append("applyTitle", getApplyTitle()) + .append("applyUser", getApplyUser()) + .append("applyTime", getApplyTime()) + .append("sysCustomerQuoteChildList", getSysCustomerQuoteChildList()) .toString(); } } 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 9e6bffd4..4399a55d 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 @@ -141,11 +141,13 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { } for (SysCustomerQuoteChild sysCustomerQuoteChild : sysCustomerQuoteChildList) { sysCustomerQuoteChild.setQuoteId(sysCustomerQuote.getSupplierCode()); + sysCustomerQuoteChild.setCreateTime(new Date()); + sysCustomerQuoteChild.setCreateBy(loginName); sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild); } return result; } - + @Transactional(rollbackFor = Exception.class) @Override public int updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote) { String loginName = ShiroUtils.getLoginName(); @@ -279,6 +281,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { sysCustomerQuote.setApplyUser(user.getLoginName()); sysCustomerQuote.setApplyTime(DateUtils.getNowDate()); insertSysCustomerQuote(sysCustomerQuote); + System.out.println("sysCustomerQuote:"+sysCustomerQuote); // 启动流程 String applyTitle = user.getUserName()+"发起了客户报价信息提交审批-"+DateUtils.dateTimeNow(); String instanceType = "submit"; @@ -310,7 +313,8 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { buildAuthority(user, variables); sysCustomerQuote.setApplyTitle(applyTitle); // 启动流程 - ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, sysCustomerQuote.getSupplierCode(), key, variables); + ProcessInstance processInstance = processService.submitApply(user.getLoginName(), + businessKey, applyTitle, sysCustomerQuote.getSupplierCode(), key, variables); String processInstanceId = processInstance.getId(); sysCustomerQuote.setInstanceId(processInstanceId); // 建立双向关系 sysCustomerQuote.setInstanceType(instanceType); @@ -320,7 +324,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { private void buildAuthority(SysUser user, Map variables) { Set roleKeys = roleService.selectRoleKeys(user.getUserId()); // 角色不同审核人不同 - if(roleKeys.contains("zozjRole")){ + if(roleKeys.contains("zozjRole") || roleKeys.contains("admin") || roleKeys.contains("zjlRole")){ variables.put("authority",4); }else if(roleKeys.contains("ywzgRole")){ variables.put("authority",3); diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml index f187a262..737fa4cf 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml @@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and s.create_time between #{params.beginCreateTime} and #{params.endCreateTime} + order by s.create_time desc -