Commit bf8ec2214419ee2dde01e762a62325839587fbaf
1 parent
3347d332
📖 CRM:code review 合同的代码实现
Showing
6 changed files
with
26 additions
and
39 deletions
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 { |
| 43 | 43 | return success(model); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - // TODO @puhui999:这个接口的目的是啥呀?业务表单预览流程🤣; | |
| 47 | - // TODO @puhui999:捉摸是不是搞成前端跳转过去,不另外做 bpmn 组件哈; | |
| 48 | - @GetMapping("/get-by-key") | |
| 49 | - @Operation(summary = "获得模型") | |
| 50 | - @Parameter(name = "key", description = "流程标识", required = true, example = "oa_leave") | |
| 51 | - @PreAuthorize("@ss.hasPermission('bpm:model:query')") | |
| 52 | - public CommonResult<BpmModelRespVO> getModelByKey(@RequestParam("key") String key) { | |
| 53 | - BpmModelRespVO model = modelService.getBpmnModelByKey(key); | |
| 54 | - return success(model); | |
| 55 | - } | |
| 56 | - | |
| 57 | 46 | @PostMapping("/create") |
| 58 | 47 | @Operation(summary = "新建模型") |
| 59 | 48 | @PreAuthorize("@ss.hasPermission('bpm:model:create')") | ... | ... |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelService.java
| ... | ... | @@ -38,14 +38,6 @@ public interface BpmModelService { |
| 38 | 38 | BpmModelRespVO getModel(String id); |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | - * 获得流程模块 | |
| 42 | - * | |
| 43 | - * @param key 流程标识 | |
| 44 | - * @return 流程模型 | |
| 45 | - */ | |
| 46 | - BpmModelRespVO getBpmnModelByKey(String key); | |
| 47 | - | |
| 48 | - /** | |
| 49 | 41 | * 修改流程模型 |
| 50 | 42 | * |
| 51 | 43 | * @param updateReqVO 更新信息 | ... | ... |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java
| ... | ... | @@ -135,19 +135,6 @@ public class BpmModelServiceImpl implements BpmModelService { |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | @Override |
| 138 | - public BpmModelRespVO getBpmnModelByKey(String key) { | |
| 139 | - Model model = getModelByKey(key); | |
| 140 | - if (model == null) { | |
| 141 | - return null; | |
| 142 | - } | |
| 143 | - BpmModelRespVO modelRespVO = BpmModelConvert.INSTANCE.convert(model); | |
| 144 | - // 拼接 bpmn XML | |
| 145 | - byte[] bpmnBytes = repositoryService.getModelEditorSource(model.getId()); | |
| 146 | - modelRespVO.setBpmnXml(StrUtil.utf8Str(bpmnBytes)); | |
| 147 | - return modelRespVO; | |
| 148 | - } | |
| 149 | - | |
| 150 | - @Override | |
| 151 | 138 | @Transactional(rollbackFor = Exception.class) // 因为进行多个操作,所以开启事务 |
| 152 | 139 | public void updateModel(@Valid BpmModelUpdateReqVO updateReqVO) { |
| 153 | 140 | // 校验流程模型存在 | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/CrmContractExcelVO.java
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 { |
| 116 | 116 | @ExcelProperty("创建人名字") |
| 117 | 117 | private String creatorName; |
| 118 | 118 | |
| 119 | + @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 120 | + @ExcelProperty("更新时间") | |
| 121 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 122 | + private LocalDateTime updateTime; | |
| 123 | + | |
| 119 | 124 | @Schema(description = "负责人", example = "test") |
| 120 | 125 | @ExcelProperty("负责人") |
| 121 | 126 | private String ownerUserName; | ... | ... |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/contract/CrmContractDO.java
| 1 | 1 | package cn.iocoder.yudao.module.crm.dal.dataobject.contract; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | +import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO; | |
| 5 | +import cn.iocoder.yudao.module.crm.dal.dataobject.contact.CrmContactDO; | |
| 6 | +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; | |
| 4 | 7 | import cn.iocoder.yudao.module.crm.enums.common.CrmAuditStatusEnum; |
| 5 | 8 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 6 | 9 | import com.baomidou.mybatisplus.annotation.TableId; |
| ... | ... | @@ -31,19 +34,29 @@ public class CrmContractDO extends BaseDO { |
| 31 | 34 | @TableId |
| 32 | 35 | private Long id; |
| 33 | 36 | /** |
| 37 | + * 合同编号 | |
| 38 | + */ | |
| 39 | + private String no; | |
| 40 | + /** | |
| 34 | 41 | * 合同名称 |
| 35 | 42 | */ |
| 36 | 43 | private String name; |
| 37 | 44 | /** |
| 38 | 45 | * 客户编号 |
| 46 | + * | |
| 47 | + * 关联 {@link CrmCustomerDO#getId()} | |
| 39 | 48 | */ |
| 40 | 49 | private Long customerId; |
| 41 | 50 | /** |
| 42 | 51 | * 商机编号 |
| 52 | + * | |
| 53 | + * 关联 {@link CrmBusinessDO#getId()} | |
| 43 | 54 | */ |
| 44 | 55 | private Long businessId; |
| 45 | 56 | /** |
| 46 | 57 | * 工作流编号 |
| 58 | + * | |
| 59 | + * 关联 ProcessInstance 的 id 属性 | |
| 47 | 60 | */ |
| 48 | 61 | private String processInstanceId; |
| 49 | 62 | /** |
| ... | ... | @@ -51,10 +64,6 @@ public class CrmContractDO extends BaseDO { |
| 51 | 64 | */ |
| 52 | 65 | private LocalDateTime orderDate; |
| 53 | 66 | /** |
| 54 | - * 合同编号 | |
| 55 | - */ | |
| 56 | - private String no; | |
| 57 | - /** | |
| 58 | 67 | * 开始时间 |
| 59 | 68 | */ |
| 60 | 69 | private LocalDateTime startTime; |
| ... | ... | @@ -63,7 +72,7 @@ public class CrmContractDO extends BaseDO { |
| 63 | 72 | */ |
| 64 | 73 | private LocalDateTime endTime; |
| 65 | 74 | /** |
| 66 | - * 合同金额 | |
| 75 | + * 合同金额,单位:分 | |
| 67 | 76 | */ |
| 68 | 77 | private Integer price; |
| 69 | 78 | /** |
| ... | ... | @@ -71,15 +80,19 @@ public class CrmContractDO extends BaseDO { |
| 71 | 80 | */ |
| 72 | 81 | private Integer discountPercent; |
| 73 | 82 | /** |
| 74 | - * 产品总金额 | |
| 83 | + * 产品总金额,单位:分 | |
| 75 | 84 | */ |
| 76 | 85 | private Integer productPrice; |
| 77 | 86 | /** |
| 78 | - * 联系人编号 | |
| 87 | + * 客户签约人 | |
| 88 | + * | |
| 89 | + * 关联 {@link CrmContactDO#getId()} | |
| 79 | 90 | */ |
| 80 | 91 | private Long contactId; |
| 81 | 92 | /** |
| 82 | 93 | * 公司签约人 |
| 94 | + * | |
| 95 | + * 关联 AdminUserDO 的 id 字段 | |
| 83 | 96 | */ |
| 84 | 97 | private Long signUserId; |
| 85 | 98 | /** | ... | ... |