From bf8ec2214419ee2dde01e762a62325839587fbaf Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 4 Feb 2024 12:57:26 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20CRM=EF=BC=9Acode=20review=20?= =?UTF-8?q?=E5=90=88=E5=90=8C=E7=9A=84=E4=BB=A3=E7=A0=81=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/definition/BpmModelController.java | 11 -------- .../service/definition/BpmModelService.java | 8 ------ .../definition/BpmModelServiceImpl.java | 13 --------- .../admin/contract/vo/CrmContractExcelVO.java | 1 + .../admin/contract/vo/CrmContractRespVO.java | 5 ++++ .../dataobject/contract/CrmContractDO.java | 27 ++++++++++++++----- 6 files changed, 26 insertions(+), 39 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java index a789bd495..4e7195ccd 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java @@ -43,17 +43,6 @@ public class BpmModelController { return success(model); } - // TODO @puhui999:这个接口的目的是啥呀?业务表单预览流程🤣; - // TODO @puhui999:捉摸是不是搞成前端跳转过去,不另外做 bpmn 组件哈; - @GetMapping("/get-by-key") - @Operation(summary = "获得模型") - @Parameter(name = "key", description = "流程标识", required = true, example = "oa_leave") - @PreAuthorize("@ss.hasPermission('bpm:model:query')") - public CommonResult getModelByKey(@RequestParam("key") String key) { - BpmModelRespVO model = modelService.getBpmnModelByKey(key); - return success(model); - } - @PostMapping("/create") @Operation(summary = "新建模型") @PreAuthorize("@ss.hasPermission('bpm:model:create')") diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelService.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelService.java index 4c3b0ba10..bddd79081 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelService.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelService.java @@ -37,14 +37,6 @@ public interface BpmModelService { */ BpmModelRespVO getModel(String id); - /** - * 获得流程模块 - * - * @param key 流程标识 - * @return 流程模型 - */ - BpmModelRespVO getBpmnModelByKey(String key); - /** * 修改流程模型 * diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java index e23ac90e5..08f8acf6b 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java @@ -134,19 +134,6 @@ public class BpmModelServiceImpl implements BpmModelService { return modelRespVO; } - @Override - public BpmModelRespVO getBpmnModelByKey(String key) { - Model model = getModelByKey(key); - if (model == null) { - return null; - } - BpmModelRespVO modelRespVO = BpmModelConvert.INSTANCE.convert(model); - // 拼接 bpmn XML - byte[] bpmnBytes = repositoryService.getModelEditorSource(model.getId()); - modelRespVO.setBpmnXml(StrUtil.utf8Str(bpmnBytes)); - return modelRespVO; - } - @Override @Transactional(rollbackFor = Exception.class) // 因为进行多个操作,所以开启事务 public void updateModel(@Valid BpmModelUpdateReqVO updateReqVO) { diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractExcelVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractExcelVO.java index 72f9f3cfa..841e56426 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractExcelVO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractExcelVO.java @@ -5,6 +5,7 @@ import lombok.Data; import java.time.LocalDateTime; +// TODO @puhui999:合并到 RespVO 里哈; /** * CRM 合同 Excel VO * diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractRespVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractRespVO.java index 9de416257..6b60afc2a 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractRespVO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractRespVO.java @@ -116,6 +116,11 @@ public class CrmContractRespVO { @ExcelProperty("创建人名字") private String creatorName; + @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("更新时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime updateTime; + @Schema(description = "负责人", example = "test") @ExcelProperty("负责人") private String ownerUserName; diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/contract/CrmContractDO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/contract/CrmContractDO.java index e70e7a3cb..0c01a3394 100644 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/contract/CrmContractDO.java +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/contract/CrmContractDO.java @@ -1,6 +1,9 @@ package cn.iocoder.yudao.module.crm.dal.dataobject.contract; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; +import cn.iocoder.yudao.module.crm.dal.dataobject.contact.CrmContactDO; +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; import cn.iocoder.yudao.module.crm.enums.common.CrmAuditStatusEnum; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; @@ -30,30 +33,36 @@ public class CrmContractDO extends BaseDO { */ @TableId private Long id; + /** + * 合同编号 + */ + private String no; /** * 合同名称 */ private String name; /** * 客户编号 + * + * 关联 {@link CrmCustomerDO#getId()} */ private Long customerId; /** * 商机编号 + * + * 关联 {@link CrmBusinessDO#getId()} */ private Long businessId; /** * 工作流编号 + * + * 关联 ProcessInstance 的 id 属性 */ private String processInstanceId; /** * 下单日期 */ private LocalDateTime orderDate; - /** - * 合同编号 - */ - private String no; /** * 开始时间 */ @@ -63,7 +72,7 @@ public class CrmContractDO extends BaseDO { */ private LocalDateTime endTime; /** - * 合同金额 + * 合同金额,单位:分 */ private Integer price; /** @@ -71,15 +80,19 @@ public class CrmContractDO extends BaseDO { */ private Integer discountPercent; /** - * 产品总金额 + * 产品总金额,单位:分 */ private Integer productPrice; /** - * 联系人编号 + * 客户签约人 + * + * 关联 {@link CrmContactDO#getId()} */ private Long contactId; /** * 公司签约人 + * + * 关联 AdminUserDO 的 id 字段 */ private Long signUserId; /**