SpeechLittlePhaseAddDTO.java
2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package com.phase;
import lombok.*;
import org.springframework.util.StringUtils;
import java.util.HashMap;
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SpeechLittlePhaseAddDTO {
private int littlePhaseSerialNum;
private String littlePhaseName;
//触发条件状态(1 = 开, 2 = 关, 3 = 自定义条件开启)
private int triggerConditionSwitch;
//触发条件内容
private String triggerConditionContent;
// 环节类型(1 = 问答环节, 2 = 陈述环节, 3 = 文件初始环节, 4 = 证件初始环节, 5 = 通用环节, 6 = 人脸识别环节)
private int phaseType;
//肯定答复
private String sure;
//否定答复
private String no;
//文件出示环节---文件类型(1 = 通用文件)
private int fileType;
//证件出示环节---证件类型(1 = 身份证正面, 2 = 身份证反面, 3 = 执业证正面, 4 = 执业证反面)
private int identityType;
//身份证证件ocr(正/反)开关(1 = 开, 2 = 关)
private int idcardOcrSwitch;
// 环节展示标题
private String littlePhaseTitle;
//tts播报内容
private String ttsContent;
private int bindBefore;
private int bindAfter;
private String bindUnique;
public SpeechLittlePhaseEditDTO transToVO() {
return SpeechLittlePhaseEditDTO.builder().hintNum(this.littlePhaseSerialNum).hintName(this.littlePhaseName)
.hintTitle(this.littlePhaseTitle).tts(this.ttsContent).condition(getConditionMap()).hintType(getHintType()).
bindBefore(this.bindBefore).bindAfter(this.bindAfter).bindUnique(this.bindUnique).classIndex(0).build();
}
private HashMap<String, Object> getConditionMap() {
HashMap<String, Object> conditionMap = new HashMap<>();
conditionMap.put("conditionType", this.triggerConditionSwitch);
if (this.triggerConditionSwitch == 3) {
conditionMap.put("conditionContent", this.triggerConditionContent);
}
return conditionMap;
}
private HashMap<String, Object> getHintType() {
HashMap<String, Object> hintTypeMap = new HashMap<>();
hintTypeMap.put("hintType", this.phaseType);
if (this.phaseType == 1) {
if (!StringUtils.isEmpty(this.sure)) {
hintTypeMap.put("sure", this.sure);
}
if (!StringUtils.isEmpty(this.no)) {
hintTypeMap.put("no", this.no);
}
} else if (this.phaseType == 3) {
hintTypeMap.put("docType", this.fileType);
} else if (this.phaseType == 4) {
hintTypeMap.put("certificateType", this.identityType);
if (this.identityType == 1 || this.identityType == 2) {
hintTypeMap.put("ocr", this.idcardOcrSwitch);
}
}
return hintTypeMap;
}
}