Ver código fonte

📖 CRM:code review 合同的代码实现

YunaiV 1 ano atrás
pai
commit
bf8ec22144

+ 0 - 11
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<BpmModelRespVO> getModelByKey(@RequestParam("key") String key) {
-        BpmModelRespVO model = modelService.getBpmnModelByKey(key);
-        return success(model);
-    }
-
     @PostMapping("/create")
     @Operation(summary = "新建模型")
     @PreAuthorize("@ss.hasPermission('bpm:model:create')")

+ 0 - 8
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);
-
     /**
      * 修改流程模型
      *

+ 0 - 13
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) {

+ 1 - 0
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
  *

+ 5 - 0
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;

+ 20 - 7
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;
     /**