Commit 269816446ac964b7dc409a68eed8ac387436ed77
1 parent
a1c17b9b
CRM-客户:日志表达式调整
Showing
3 changed files
with
5 additions
and
5 deletions
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/LogRecordConstants.java
| ... | ... | @@ -23,8 +23,8 @@ public interface LogRecordConstants { |
| 23 | 23 | String CRM_CUSTOMER_DELETE_SUCCESS = "删除了客户【{{#customerName}}】"; |
| 24 | 24 | String CRM_CUSTOMER_TRANSFER_SUB_TYPE = "转移客户"; |
| 25 | 25 | String CRM_CUSTOMER_TRANSFER_SUCCESS = "将客户【{{#crmCustomer.name}}】的负责人从【{getAdminUserById{#crmCustomer.ownerUserId}}】变更为了【{getAdminUserById{#reqVO.newOwnerUserId}}】"; |
| 26 | - String CRM_CUSTOMER_LOCK_SUB_TYPE = "{{#crmCustomer.lockStatus ? '锁定客户' : '解锁客户'}}"; | |
| 27 | - String CRM_CUSTOMER_LOCK_SUCCESS = "{{#crmCustomer.lockStatus ? '将客户【' + #crmCustomer.name + '】锁定' : '将客户【' + #crmCustomer.name + '】解锁'}}"; | |
| 26 | + String CRM_CUSTOMER_LOCK_SUB_TYPE = "{{#crmCustomer.lockStatus ? '解锁客户' : '锁定客户'}}"; | |
| 27 | + String CRM_CUSTOMER_LOCK_SUCCESS = "{{#crmCustomer.lockStatus ? '将客户【' + #crmCustomer.name + '】解锁' : '将客户【' + #crmCustomer.name + '】锁定'}}"; | |
| 28 | 28 | String CRM_CUSTOMER_POOL_SUB_TYPE = "客户放入公海"; |
| 29 | 29 | String CRM_CUSTOMER_POOL_SUCCESS = "将客户【{{#customerName}}】放入了公海"; |
| 30 | 30 | String CRM_CUSTOMER_RECEIVE_SUB_TYPE = "{{#ownerUserName != null ? '分配客户' : '领取客户'}}"; | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java
| ... | ... | @@ -116,7 +116,7 @@ public class CrmCustomerController { |
| 116 | 116 | return success(CrmCustomerConvert.INSTANCE.convertPage(pageResult, userMap, deptMap)); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - @GetMapping(value = {"/list-all-simple"}) | |
| 119 | + @GetMapping(value = "/list-all-simple") | |
| 120 | 120 | @Operation(summary = "获取客户精简信息列表", description = "只包含有读权限的客户,主要用于前端的下拉选项") |
| 121 | 121 | public CommonResult<List<CrmCustomerSimpleRespVO>> getSimpleDeptList() { |
| 122 | 122 | CrmCustomerPageReqVO reqVO = new CrmCustomerPageReqVO(); | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImpl.java
| ... | ... | @@ -165,7 +165,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { |
| 165 | 165 | // 2. 更新锁定状态 |
| 166 | 166 | customerMapper.updateById(BeanUtils.toBean(lockReqVO, CrmCustomerDO.class)); |
| 167 | 167 | |
| 168 | - // 3. 记录操作日志上下文 | |
| 168 | + // 3. 记录操作日志上下文. tips: 因为这里使用的是老的状态所以记录时反着记录,也就是 lockStatus 为 true 那么就是解锁反之为锁定 | |
| 169 | 169 | LogRecordContext.putVariable("crmCustomer", customer); |
| 170 | 170 | } |
| 171 | 171 | |
| ... | ... | @@ -301,7 +301,7 @@ public class CrmCustomerServiceImpl implements CrmCustomerService { |
| 301 | 301 | throw exception(CUSTOMER_IN_POOL, customer.getName()); |
| 302 | 302 | } |
| 303 | 303 | // 负责人已存在 |
| 304 | - if (customer.getOwnerUserId() != null) { | |
| 304 | + if (!pool && customer.getOwnerUserId() != null) { | |
| 305 | 305 | throw exception(CUSTOMER_OWNER_EXISTS, customer.getName()); |
| 306 | 306 | } |
| 307 | 307 | } | ... | ... |