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

This commit is contained in:
YunaiV 2024-02-04 12:57:26 +08:00
parent 3347d3320d
commit bf8ec22144
6 changed files with 26 additions and 39 deletions

View File

@ -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')")

View File

@ -37,14 +37,6 @@ public interface BpmModelService {
*/
BpmModelRespVO getModel(String id);
/**
* 获得流程模块
*
* @param key 流程标识
* @return 流程模型
*/
BpmModelRespVO getBpmnModelByKey(String key);
/**
* 修改流程模型
*

View File

@ -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) {

View File

@ -5,6 +5,7 @@ import lombok.Data;
import java.time.LocalDateTime;
// TODO @puhui999合并到 RespVO 里哈
/**
* CRM 合同 Excel VO
*

View File

@ -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;

View File

@ -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;
/**