Commit 0b0830f445f7aeca1977954e0439e69a170aebed
1 parent
616ae8ea
✨ CRM:增加合同配置表
Showing
18 changed files
with
255 additions
and
27 deletions
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/LogRecordConstants.java
| @@ -96,6 +96,12 @@ public interface LogRecordConstants { | @@ -96,6 +96,12 @@ public interface LogRecordConstants { | ||
| 96 | String CRM_BUSINESS_UPDATE_STATUS_SUB_TYPE = "更新商机状态"; | 96 | String CRM_BUSINESS_UPDATE_STATUS_SUB_TYPE = "更新商机状态"; |
| 97 | String CRM_BUSINESS_UPDATE_STATUS_SUCCESS = "更新了商机【{{#businessName}}】的状态从【{{#oldStatusName}}】变更为了【{{#newStatusName}}】"; | 97 | String CRM_BUSINESS_UPDATE_STATUS_SUCCESS = "更新了商机【{{#businessName}}】的状态从【{{#oldStatusName}}】变更为了【{{#newStatusName}}】"; |
| 98 | 98 | ||
| 99 | + // ======================= CRM_CONTRACT_CONFIG 合同配置 ======================= | ||
| 100 | + | ||
| 101 | + String CRM_CONTRACT_CONFIG_TYPE = "CRM 合同配置"; | ||
| 102 | + String CRM_CONTRACT_CONFIG_SUB_TYPE = "{{#isPoolConfigUpdate ? '更新合同配置' : '创建合同配置'}}"; | ||
| 103 | + String CRM_CONTRACT_CONFIG_SUCCESS = "{{#isPoolConfigUpdate ? '更新了合同配置' : '创建了合同配置'}}"; | ||
| 104 | + | ||
| 99 | // ======================= CRM_CONTRACT 合同 ======================= | 105 | // ======================= CRM_CONTRACT 合同 ======================= |
| 100 | 106 | ||
| 101 | String CRM_CONTRACT_TYPE = "CRM 合同"; | 107 | String CRM_CONTRACT_TYPE = "CRM 合同"; |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/CrmContractConfigController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.controller.admin.contract; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 4 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.config.CrmContractConfigRespVO; | ||
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.config.CrmContractConfigSaveReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractConfigDO; | ||
| 8 | +import cn.iocoder.yudao.module.crm.service.contract.CrmContractConfigService; | ||
| 9 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 10 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 11 | +import jakarta.annotation.Resource; | ||
| 12 | +import jakarta.validation.Valid; | ||
| 13 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 14 | +import org.springframework.validation.annotation.Validated; | ||
| 15 | +import org.springframework.web.bind.annotation.*; | ||
| 16 | + | ||
| 17 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 18 | + | ||
| 19 | +@Tag(name = "管理后台 - CRM 合同配置") | ||
| 20 | +@RestController | ||
| 21 | +@RequestMapping("/crm/contract-config") | ||
| 22 | +@Validated | ||
| 23 | +public class CrmContractConfigController { | ||
| 24 | + | ||
| 25 | + @Resource | ||
| 26 | + private CrmContractConfigService contractConfigService; | ||
| 27 | + | ||
| 28 | + @GetMapping("/get") | ||
| 29 | + @Operation(summary = "获取合同配置") | ||
| 30 | + @PreAuthorize("@ss.hasPermission('crm:contract-config:query')") | ||
| 31 | + public CommonResult<CrmContractConfigRespVO> getCustomerPoolConfig() { | ||
| 32 | + CrmContractConfigDO config = contractConfigService.getContractConfig(); | ||
| 33 | + return success(BeanUtils.toBean(config, CrmContractConfigRespVO.class)); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + @PutMapping("/save") | ||
| 37 | + @Operation(summary = "更新合同配置") | ||
| 38 | + @PreAuthorize("@ss.hasPermission('crm:contract-config:update')") | ||
| 39 | + public CommonResult<Boolean> saveCustomerPoolConfig(@Valid @RequestBody CrmContractConfigSaveReqVO updateReqVO) { | ||
| 40 | + contractConfigService.saveContractConfig(updateReqVO); | ||
| 41 | + return success(true); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | +} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/CrmContractController.java
| @@ -9,10 +9,10 @@ import cn.iocoder.yudao.framework.common.util.number.NumberUtils; | @@ -9,10 +9,10 @@ import cn.iocoder.yudao.framework.common.util.number.NumberUtils; | ||
| 9 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 9 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 10 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | 10 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| 11 | import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | 11 | import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; |
| 12 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; | ||
| 13 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractRespVO; | ||
| 14 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractSaveReqVO; | ||
| 15 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractTransferReqVO; | 12 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractPageReqVO; |
| 13 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractRespVO; | ||
| 14 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractSaveReqVO; | ||
| 15 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractTransferReqVO; | ||
| 16 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | 16 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; |
| 17 | import cn.iocoder.yudao.module.crm.dal.dataobject.contact.CrmContactDO; | 17 | import cn.iocoder.yudao.module.crm.dal.dataobject.contact.CrmContactDO; |
| 18 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; | 18 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/config/CrmContractConfigRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo.config; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +@Schema(description = "管理后台 - CRM 合同配置 Response VO") | ||
| 7 | +@Data | ||
| 8 | +public class CrmContractConfigRespVO { | ||
| 9 | + | ||
| 10 | + @Schema(description = "是否开启提前提醒", example = "true") | ||
| 11 | + private Boolean notifyEnabled; | ||
| 12 | + | ||
| 13 | + @Schema(description = "提前提醒天数", example = "2") | ||
| 14 | + private Integer notifyDays; | ||
| 15 | + | ||
| 16 | +} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/config/CrmContractConfigSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo.config; | ||
| 2 | + | ||
| 3 | +import cn.hutool.core.util.BooleanUtil; | ||
| 4 | +import com.fasterxml.jackson.annotation.JsonIgnore; | ||
| 5 | +import com.mzt.logapi.starter.annotation.DiffLogField; | ||
| 6 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 7 | +import jakarta.validation.constraints.AssertTrue; | ||
| 8 | +import lombok.Data; | ||
| 9 | + | ||
| 10 | +import java.util.Objects; | ||
| 11 | + | ||
| 12 | +@Schema(description = "管理后台 - CRM 合同配置 Request VO") | ||
| 13 | +@Data | ||
| 14 | +public class CrmContractConfigSaveReqVO { | ||
| 15 | + | ||
| 16 | + @Schema(description = "是否开启提前提醒", example = "true") | ||
| 17 | + @DiffLogField(name = "是否开启提前提醒") | ||
| 18 | + private Boolean notifyEnabled; | ||
| 19 | + | ||
| 20 | + @Schema(description = "提前提醒天数", example = "2") | ||
| 21 | + @DiffLogField(name = "提前提醒天数") | ||
| 22 | + private Integer notifyDays; | ||
| 23 | + | ||
| 24 | + @AssertTrue(message = "提前提醒天数不能为空") | ||
| 25 | + @JsonIgnore | ||
| 26 | + public boolean isNotifyDaysValid() { | ||
| 27 | + if (!BooleanUtil.isTrue(getNotifyEnabled())) { | ||
| 28 | + return true; | ||
| 29 | + } | ||
| 30 | + return Objects.nonNull(getNotifyDays()); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | +} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractPageReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/contract/CrmContractPageReqVO.java
| 1 | -package cn.iocoder.yudao.module.crm.controller.admin.contract.vo; | 1 | +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; | 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractRespVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/contract/CrmContractRespVO.java
| 1 | -package cn.iocoder.yudao.module.crm.controller.admin.contract.vo; | 1 | +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract; |
| 2 | 2 | ||
| 3 | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | 3 | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | import com.alibaba.excel.annotation.ExcelProperty; | 4 | import com.alibaba.excel.annotation.ExcelProperty; |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractSaveReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/contract/CrmContractSaveReqVO.java
| 1 | -package cn.iocoder.yudao.module.crm.controller.admin.contract.vo; | 1 | +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.crm.framework.operatelog.core.CrmBusinessParseFunction; | 3 | import cn.iocoder.yudao.module.crm.framework.operatelog.core.CrmBusinessParseFunction; |
| 4 | import cn.iocoder.yudao.module.crm.framework.operatelog.core.CrmContactParseFunction; | 4 | import cn.iocoder.yudao.module.crm.framework.operatelog.core.CrmContactParseFunction; |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractTransferReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/contract/CrmContractTransferReqVO.java
| 1 | -package cn.iocoder.yudao.module.crm.controller.admin.contract.vo; | 1 | +package cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.validation.InEnum; | 3 | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| 4 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; | 4 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/permission/CrmPermissionConvert.java
| @@ -20,6 +20,7 @@ import java.util.Map; | @@ -20,6 +20,7 @@ import java.util.Map; | ||
| 20 | 20 | ||
| 21 | import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen; | 21 | import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen; |
| 22 | 22 | ||
| 23 | +// TODO @芋艿:要干掉 | ||
| 23 | /** | 24 | /** |
| 24 | * Crm 数据权限 Convert | 25 | * Crm 数据权限 Convert |
| 25 | * | 26 | * |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/contract/CrmContractConfigDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.dataobject.contract; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.*; | ||
| 5 | +import lombok.*; | ||
| 6 | + | ||
| 7 | +@TableName("crm_contract_config") | ||
| 8 | +@KeySequence("crm_contract_config_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||
| 9 | +@Data | ||
| 10 | +@EqualsAndHashCode(callSuper = true) | ||
| 11 | +@ToString(callSuper = true) | ||
| 12 | +@Builder | ||
| 13 | +@NoArgsConstructor | ||
| 14 | +@AllArgsConstructor | ||
| 15 | +public class CrmContractConfigDO extends BaseDO { | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 编号 | ||
| 19 | + */ | ||
| 20 | + @TableId | ||
| 21 | + private Long id; | ||
| 22 | + /** | ||
| 23 | + * 是否开启提前提醒 | ||
| 24 | + */ | ||
| 25 | + @TableField(updateStrategy = FieldStrategy.ALWAYS) | ||
| 26 | + private Boolean notifyEnabled; | ||
| 27 | + /** | ||
| 28 | + * 提前提醒天数 | ||
| 29 | + */ | ||
| 30 | + @TableField(updateStrategy = FieldStrategy.ALWAYS) | ||
| 31 | + private Integer notifyDays; | ||
| 32 | + | ||
| 33 | +} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/CrmContractConfigMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.dal.mysql.contract; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | ||
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractConfigDO; | ||
| 6 | +import org.apache.ibatis.annotations.Mapper; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 合同配置 Mapper | ||
| 10 | + * | ||
| 11 | + * @author Wanwan | ||
| 12 | + */ | ||
| 13 | +@Mapper | ||
| 14 | +public interface CrmContractConfigMapper extends BaseMapperX<CrmContractConfigDO> { | ||
| 15 | + | ||
| 16 | + default CrmContractConfigDO selectOne() { | ||
| 17 | + return selectOne(new QueryWrapperX<CrmContractConfigDO>().limitN(1)); | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | +} | ||
| 0 | \ No newline at end of file | 21 | \ No newline at end of file |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/contract/CrmContractMapper.java
| @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 5 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 5 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 6 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 6 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX; | 7 | import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX; |
| 8 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; | 8 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractPageReqVO; |
| 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; | 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; |
| 10 | import cn.iocoder.yudao.module.crm.enums.common.CrmAuditStatusEnum; | 10 | import cn.iocoder.yudao.module.crm.enums.common.CrmAuditStatusEnum; |
| 11 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; | 11 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractConfigService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.contract; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.config.CrmContractConfigSaveReqVO; | ||
| 4 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractConfigDO; | ||
| 5 | +import jakarta.validation.Valid; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 合同配置 Service 接口 | ||
| 9 | + * | ||
| 10 | + * @author 芋道源码 | ||
| 11 | + */ | ||
| 12 | +public interface CrmContractConfigService { | ||
| 13 | + | ||
| 14 | + /** | ||
| 15 | + * 获得合同配置 | ||
| 16 | + * | ||
| 17 | + * @return 合同配置 | ||
| 18 | + */ | ||
| 19 | + CrmContractConfigDO getContractConfig(); | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 保存合同配置 | ||
| 23 | + * | ||
| 24 | + * @param saveReqVO 更新信息 | ||
| 25 | + */ | ||
| 26 | + void saveContractConfig(@Valid CrmContractConfigSaveReqVO saveReqVO); | ||
| 27 | + | ||
| 28 | +} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractConfigServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.crm.service.contract; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 4 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.config.CrmContractConfigSaveReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractConfigDO; | ||
| 6 | +import cn.iocoder.yudao.module.crm.dal.mysql.contract.CrmContractConfigMapper; | ||
| 7 | +import com.mzt.logapi.context.LogRecordContext; | ||
| 8 | +import com.mzt.logapi.starter.annotation.LogRecord; | ||
| 9 | +import jakarta.annotation.Resource; | ||
| 10 | +import org.springframework.stereotype.Service; | ||
| 11 | +import org.springframework.validation.annotation.Validated; | ||
| 12 | + | ||
| 13 | +import java.util.Objects; | ||
| 14 | + | ||
| 15 | +import static cn.iocoder.yudao.module.crm.enums.LogRecordConstants.*; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 合同配置 Service 实现类 | ||
| 19 | + * | ||
| 20 | + * @author 芋道源码 | ||
| 21 | + */ | ||
| 22 | +@Service | ||
| 23 | +@Validated | ||
| 24 | +public class CrmContractConfigServiceImpl implements CrmContractConfigService { | ||
| 25 | + | ||
| 26 | + @Resource | ||
| 27 | + private CrmContractConfigMapper contractConfigMapper; | ||
| 28 | + | ||
| 29 | + @Override | ||
| 30 | + public CrmContractConfigDO getContractConfig() { | ||
| 31 | + return contractConfigMapper.selectOne(); | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + @Override | ||
| 35 | + @LogRecord(type = CRM_CONTRACT_CONFIG_TYPE, subType = CRM_CONTRACT_CONFIG_SUB_TYPE, bizNo = "{{#configId}}", | ||
| 36 | + success = CRM_CONTRACT_CONFIG_SUCCESS) | ||
| 37 | + public void saveContractConfig(CrmContractConfigSaveReqVO saveReqVO) { | ||
| 38 | + // 1. 存在,则进行更新 | ||
| 39 | + CrmContractConfigDO dbConfig = getContractConfig(); | ||
| 40 | + CrmContractConfigDO config = BeanUtils.toBean(saveReqVO, CrmContractConfigDO.class); | ||
| 41 | + if (Objects.nonNull(dbConfig)) { | ||
| 42 | + contractConfigMapper.updateById(config.setId(dbConfig.getId())); | ||
| 43 | + // 记录操作日志上下文 | ||
| 44 | + LogRecordContext.putVariable("isConfigUpdate", Boolean.TRUE); | ||
| 45 | + LogRecordContext.putVariable("configId", config.getId()); | ||
| 46 | + return; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + // 2. 不存在,则进行插入 | ||
| 50 | + contractConfigMapper.insert(config); | ||
| 51 | + // 记录操作日志上下文 | ||
| 52 | + LogRecordContext.putVariable("isConfigUpdate", Boolean.FALSE); | ||
| 53 | + LogRecordContext.putVariable("configId", config.getId()); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | +} |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractService.java
| 1 | package cn.iocoder.yudao.module.crm.service.contract; | 1 | package cn.iocoder.yudao.module.crm.service.contract; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; | ||
| 5 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractSaveReqVO; | ||
| 6 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractTransferReqVO; | 4 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractPageReqVO; |
| 5 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractSaveReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractTransferReqVO; | ||
| 7 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | 7 | import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; |
| 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; | 8 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; |
| 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractProductDO; | 9 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractProductDO; |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractServiceImpl.java
| @@ -10,9 +10,9 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | @@ -10,9 +10,9 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 10 | import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; | 10 | import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; |
| 11 | import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi; | 11 | import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi; |
| 12 | import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; | 12 | import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; |
| 13 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractPageReqVO; | ||
| 14 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractSaveReqVO; | ||
| 15 | -import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.CrmContractTransferReqVO; | 13 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractPageReqVO; |
| 14 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractSaveReqVO; | ||
| 15 | +import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractTransferReqVO; | ||
| 16 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; | 16 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; |
| 17 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractProductDO; | 17 | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractProductDO; |
| 18 | import cn.iocoder.yudao.module.crm.dal.mysql.contract.CrmContractMapper; | 18 | import cn.iocoder.yudao.module.crm.dal.mysql.contract.CrmContractMapper; |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerPoolConfigServiceImpl.java
| @@ -26,26 +26,16 @@ public class CrmCustomerPoolConfigServiceImpl implements CrmCustomerPoolConfigSe | @@ -26,26 +26,16 @@ public class CrmCustomerPoolConfigServiceImpl implements CrmCustomerPoolConfigSe | ||
| 26 | @Resource | 26 | @Resource |
| 27 | private CrmCustomerPoolConfigMapper customerPoolConfigMapper; | 27 | private CrmCustomerPoolConfigMapper customerPoolConfigMapper; |
| 28 | 28 | ||
| 29 | - /** | ||
| 30 | - * 获得客户公海配置 | ||
| 31 | - * | ||
| 32 | - * @return 客户公海配置 | ||
| 33 | - */ | ||
| 34 | @Override | 29 | @Override |
| 35 | public CrmCustomerPoolConfigDO getCustomerPoolConfig() { | 30 | public CrmCustomerPoolConfigDO getCustomerPoolConfig() { |
| 36 | return customerPoolConfigMapper.selectOne(); | 31 | return customerPoolConfigMapper.selectOne(); |
| 37 | } | 32 | } |
| 38 | 33 | ||
| 39 | - /** | ||
| 40 | - * 保存客户公海配置 | ||
| 41 | - * | ||
| 42 | - * @param saveReqVO 更新信息 | ||
| 43 | - */ | ||
| 44 | @Override | 34 | @Override |
| 45 | @LogRecord(type = CRM_CUSTOMER_POOL_CONFIG_TYPE, subType = CRM_CUSTOMER_POOL_CONFIG_SUB_TYPE, bizNo = "{{#poolConfigId}}", | 35 | @LogRecord(type = CRM_CUSTOMER_POOL_CONFIG_TYPE, subType = CRM_CUSTOMER_POOL_CONFIG_SUB_TYPE, bizNo = "{{#poolConfigId}}", |
| 46 | success = CRM_CUSTOMER_POOL_CONFIG_SUCCESS) | 36 | success = CRM_CUSTOMER_POOL_CONFIG_SUCCESS) |
| 47 | public void saveCustomerPoolConfig(CrmCustomerPoolConfigSaveReqVO saveReqVO) { | 37 | public void saveCustomerPoolConfig(CrmCustomerPoolConfigSaveReqVO saveReqVO) { |
| 48 | - // 存在,则进行更新 | 38 | + // 1. 存在,则进行更新 |
| 49 | CrmCustomerPoolConfigDO dbConfig = getCustomerPoolConfig(); | 39 | CrmCustomerPoolConfigDO dbConfig = getCustomerPoolConfig(); |
| 50 | CrmCustomerPoolConfigDO poolConfig = BeanUtils.toBean(saveReqVO, CrmCustomerPoolConfigDO.class); | 40 | CrmCustomerPoolConfigDO poolConfig = BeanUtils.toBean(saveReqVO, CrmCustomerPoolConfigDO.class); |
| 51 | if (Objects.nonNull(dbConfig)) { | 41 | if (Objects.nonNull(dbConfig)) { |
| @@ -55,7 +45,8 @@ public class CrmCustomerPoolConfigServiceImpl implements CrmCustomerPoolConfigSe | @@ -55,7 +45,8 @@ public class CrmCustomerPoolConfigServiceImpl implements CrmCustomerPoolConfigSe | ||
| 55 | LogRecordContext.putVariable("poolConfigId", poolConfig.getId()); | 45 | LogRecordContext.putVariable("poolConfigId", poolConfig.getId()); |
| 56 | return; | 46 | return; |
| 57 | } | 47 | } |
| 58 | - // 不存在,则进行插入 | 48 | + |
| 49 | + // 2. 不存在,则进行插入 | ||
| 59 | customerPoolConfigMapper.insert(poolConfig); | 50 | customerPoolConfigMapper.insert(poolConfig); |
| 60 | // 记录操作日志上下文 | 51 | // 记录操作日志上下文 |
| 61 | LogRecordContext.putVariable("isPoolConfigUpdate", Boolean.FALSE); | 52 | LogRecordContext.putVariable("isPoolConfigUpdate", Boolean.FALSE); |