Commit 6be55cd5947718fe3f4a8baa3b4ac83a45775eab
Merge branch 'master-jdk17' of https://github.com/YunaiV/ruoyi-vue-pro into master-jdk17
Showing
2 changed files
with
7 additions
and
2 deletions
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/enums/LogRecordConstants.java
| ... | ... | @@ -144,7 +144,9 @@ public interface LogRecordConstants { |
| 144 | 144 | String CRM_RECEIVABLE_CREATE_SUB_TYPE = "创建回款"; |
| 145 | 145 | String CRM_RECEIVABLE_CREATE_SUCCESS = "创建了合同【{getContractById{#receivable.contractId}}】的{{#period != null ? '【第'+ #period +'期】' : '编号为【'+ #receivable.no +'】的'}}回款"; |
| 146 | 146 | String CRM_RECEIVABLE_UPDATE_SUB_TYPE = "更新回款"; |
| 147 | - String CRM_RECEIVABLE_UPDATE_SUCCESS = "更新了合同【{getContractById{#receivable.contractId}}】的{{#period != null ? '【第'+ #period +'期】' : '编号为【'+ #receivable.no +'】的'}}回款: {_DIFF{#updateReqVO}}"; | |
| 147 | + // 注意:updateReceivable 绑定的上下文变量名是 oldReceivable(更新前的回款), | |
| 148 | + // 模板必须与变量名一致,否则后置相取值为 null 抛 SpelEvaluationException | |
| 149 | + String CRM_RECEIVABLE_UPDATE_SUCCESS = "更新了合同【{getContractById{#oldReceivable.contractId}}】的{{#period != null ? '【第'+ #period +'期】' : '编号为【'+ #oldReceivable.no +'】的'}}回款: {_DIFF{#updateReqVO}}"; | |
| 148 | 150 | String CRM_RECEIVABLE_DELETE_SUB_TYPE = "删除回款"; |
| 149 | 151 | String CRM_RECEIVABLE_DELETE_SUCCESS = "删除了合同【{getContractById{#receivable.contractId}}】的{{#period != null ? '【第'+ #period +'期】' : '编号为【'+ #receivable.no +'】的'}}回款"; |
| 150 | 152 | String CRM_RECEIVABLE_SUBMIT_SUB_TYPE = "提交回款审批"; | ... | ... |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/framework/operatelog/core/CrmContractParseFunction.java
| ... | ... | @@ -24,7 +24,10 @@ public class CrmContractParseFunction implements IParseFunction { |
| 24 | 24 | |
| 25 | 25 | @Override |
| 26 | 26 | public boolean executeBefore() { |
| 27 | - return true; // 先转换值后对比 | |
| 27 | + // 必须在方法执行后(后置相)取值:模板引用的是 LogRecordContext 变量 | |
| 28 | + // (如 #receivablePlan.contractId),这些变量在方法内部末尾才绑定, | |
| 29 | + // 创建前(前置相)取值为 null,会抛 SpelEvaluationException EL1007E | |
| 30 | + return false; | |
| 28 | 31 | } |
| 29 | 32 | |
| 30 | 33 | @Override | ... | ... |