fix bugs update-flow
parent
c81a637bbd
commit
9b8343c270
@ -0,0 +1,68 @@
|
|||||||
|
package com.supervision.knowsub.dto.flow;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.supervision.knowsub.model.SystemFlowTypeRelation;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Tolerate;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程类型关联表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class SystemFlowTypeDTO {
|
||||||
|
|
||||||
|
@Schema(description = "数据id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "流程类型id")
|
||||||
|
private String flowId;
|
||||||
|
|
||||||
|
private Integer flowType;
|
||||||
|
|
||||||
|
@Schema(description = "子库id")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Tolerate
|
||||||
|
public SystemFlowTypeDTO() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static SystemFlowTypeDTO buildWithFlowTypeRelation(SystemFlowTypeRelation systemFlowTypeRelation){
|
||||||
|
if (Objects.isNull(systemFlowTypeRelation)){
|
||||||
|
return new SystemFlowTypeDTO();
|
||||||
|
}
|
||||||
|
return SystemFlowTypeDTO.builder()
|
||||||
|
.id(systemFlowTypeRelation.getId())
|
||||||
|
.flowId(systemFlowTypeRelation.getFlowId())
|
||||||
|
.flowType(systemFlowTypeRelation.getFlowType())
|
||||||
|
.baseId(systemFlowTypeRelation.getBaseId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public SystemFlowTypeRelation toSystemFlowTypeRelation(){
|
||||||
|
SystemFlowTypeRelation flowTypeRelation = new SystemFlowTypeRelation();
|
||||||
|
flowTypeRelation.setId(this.getId());
|
||||||
|
flowTypeRelation.setFlowType(this.getFlowType());
|
||||||
|
flowTypeRelation.setFlowId(this.getFlowId());
|
||||||
|
flowTypeRelation.setBaseId(this.getBaseId());
|
||||||
|
return flowTypeRelation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean contentEquals(SystemFlowTypeDTO systemFlowTypeDTO) {
|
||||||
|
|
||||||
|
if (StrUtil.isAllNotEmpty(this.getId(), systemFlowTypeDTO.getId())){
|
||||||
|
return StrUtil.equals(this.getId(), systemFlowTypeDTO.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return StrUtil.equals(this.getBaseId(), systemFlowTypeDTO.getBaseId())
|
||||||
|
&& NumberUtil.equals(this.getFlowType(), systemFlowTypeDTO.getFlowType())
|
||||||
|
&& StrUtil.equals(this.getFlowId(), systemFlowTypeDTO.getFlowId());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue