| | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.framework.operatelog.core.util.OperateLogUtils; |
| | | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessTransferReqVO; |
| | | import cn.iocoder.yudao.module.crm.controller.admin.contact.vo.CrmContactTransferReqVO; |
| | | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractTransferReqVO; |
| | |
| | | } |
| | | |
| | | @Override |
| | | @LogRecord(type = CRM_CUSTOMER_TYPE, subType = CRM_CUSTOMER_IMPORT_SUB_TYPE, bizNo = "0", |
| | | success = CRM_CUSTOMER_IMPORT_SUCCESS) |
| | | public CrmCustomerImportRespVO importCustomerList(List<CrmCustomerImportExcelVO> importCustomers, |
| | | CrmCustomerImportReqVO importReqVO) { |
| | | // 校验非空 |
| | |
| | | permissionService.createPermission(new CrmPermissionCreateReqBO().setBizType(CrmBizTypeEnum.CRM_CUSTOMER.getType()) |
| | | .setBizId(customer.getId()).setUserId(importReqVO.getOwnerUserId()).setLevel(CrmPermissionLevelEnum.OWNER.getLevel())); |
| | | } |
| | | // 1.3 记录操作日志 |
| | | getSelf().importCustomerLog(customer, false); |
| | | return; |
| | | } |
| | | |
| | |
| | | .setId(existCustomer.getId()); |
| | | customerMapper.updateById(updateCustomer); |
| | | respVO.getUpdateCustomerNames().add(importCustomer.getName()); |
| | | // 2.2 记录操作日志 |
| | | getSelf().importCustomerLog(updateCustomer, true); |
| | | }); |
| | | // 记录导入结果汇总,供 @LogRecord 的 success 文案引用 |
| | | OperateLogUtils.putImportSummary(respVO.getCreateCustomerNames(), respVO.getUpdateCustomerNames(), |
| | | respVO.getFailureCustomerNames()); |
| | | return respVO; |
| | | } |
| | | |
| | | /** |
| | | * 记录导入客户时的操作日志 |
| | | * |
| | | * @param customer 客户信息 |
| | | * @param isUpdate 是否更新;true - 更新,false - 新增 |
| | | */ |
| | | @LogRecord(type = CRM_CUSTOMER_TYPE, subType = CRM_CUSTOMER_IMPORT_SUB_TYPE, bizNo = "{{#customer.id}}", |
| | | success = CRM_CUSTOMER_IMPORT_SUCCESS) |
| | | public void importCustomerLog(CrmCustomerDO customer, boolean isUpdate) { |
| | | LogRecordContext.putVariable("customer", customer); |
| | | LogRecordContext.putVariable("isUpdate", isUpdate); |
| | | } |
| | | |
| | | // ==================== 公海相关操作 ==================== |