5111bf20 by sunchenjie

create:excel导入增加popup字段

1 parent a65a31ce
......@@ -21,7 +21,8 @@ public enum ColDesc {
COL_NO("no", "否定答复"),
COL_DOCTYPE("fileType", "文件识别类别(1=通用文件)"),
COL_CERTIFICATE_TYPE("identityType", "证件类别(1=身份证信息面,2=身份证国徽面,3=执业证正面,4=执业正反面)"),
COL_OCR("idcardOcrSwitch", "OCR开启(1=开启,2=关闭)");
COL_OCR("idcardOcrSwitch", "OCR开启(1=开启,2=关闭)"),
COL_POPUP("popup", "文件弹出(1=开启,2=关闭)");
private String attr;
private String col;
......
......@@ -23,11 +23,11 @@ public class PhaseUtil {
SpeechPhaseDTO speechPhaseDTO = SpeechPhaseDTO.builder().phaseList(bigPhaseList).speechName(speechName).stlId(0L).build();
String phaseJson = JSON.toJSONString(speechPhaseDTO);
System.out.println(phaseJson);
putOutFile(phaseJson,currentDir,speechName);
putOutFile(phaseJson, currentDir, speechName);
}
private static void putOutFile(String phaseJson, String currentDir, String speechName) {
String filePath = currentDir + File.separator + speechName + ".txt";
String filePath = currentDir + File.separator + speechName + ".txt";
FileOutputStream out = null;
try {
out = new FileOutputStream(new File(filePath));
......@@ -36,7 +36,7 @@ public class PhaseUtil {
e.printStackTrace();
} finally {
try {
if (out != null){
if (out != null) {
out.close();
}
} catch (IOException e) {
......@@ -52,14 +52,15 @@ public class PhaseUtil {
int rowNum = 2;
for (Map<String, String> orgPhase : orgPhaseList) {
if (!StringUtils.isEmpty(orgPhase.get(ColDesc.COL_HINT_NUM.getCol()))) {
System.out.println("当前处理excel行号:" + rowNum);
//获取大环节对象
SpeechBigPhaseEditDTO bigPhaseEditDTO = fetchBigPhase(bigPhaseNumMap, bigPhaseList, orgPhase);
//生成小环节对象
SpeechLittlePhaseAddDTO littlePhaseAddDTO;
try {
littlePhaseAddDTO = fetchLittlePhase(orgPhase);
} catch (Exception e){
throw new RuntimeException("请检查第"+rowNum+"行的数据是否存在参数缺失,或者数据格式问题!");
} catch (Exception e) {
throw new RuntimeException("请检查第" + rowNum + "行的数据是否存在参数缺失,或者数据格式问题!");
}
//将小环节封装入大环节对象的hintList属性中
bigPhaseEditDTO.getHintsList().add(littlePhaseAddDTO.transToVO());
......@@ -73,7 +74,7 @@ public class PhaseUtil {
private static void sortHintList(ArrayList<SpeechBigPhaseEditDTO> bigPhaseList) {
//将大环节列表按小环节序号排序
bigPhaseList.sort(Comparator.comparingInt(SpeechBigPhaseEditDTO::getPhaseNum));
for (SpeechBigPhaseEditDTO speechBigPhaseEditDTO : bigPhaseList){
for (SpeechBigPhaseEditDTO speechBigPhaseEditDTO : bigPhaseList) {
List<SpeechLittlePhaseEditDTO> hintsList = speechBigPhaseEditDTO.getHintsList();
//将小环节列表按小环节序号排序
hintsList.sort(Comparator.comparingInt(SpeechLittlePhaseEditDTO::getHintNum));
......@@ -89,6 +90,7 @@ public class PhaseUtil {
int fileType = 0;
int identityType = 0;
int idcardOcrSwitch = 0;
int popup = 2;
try {
fileType = Integer.parseInt(orgPhase.get(ColDesc.COL_DOCTYPE.getCol()));
} catch (NumberFormatException e) {
......@@ -101,6 +103,10 @@ public class PhaseUtil {
idcardOcrSwitch = Integer.parseInt(orgPhase.get(ColDesc.COL_OCR.getCol()));
} catch (NumberFormatException e) {
}
try {
popup = Integer.parseInt(orgPhase.get(ColDesc.COL_POPUP.getCol()));
} catch (NumberFormatException e) {
}
String ttsContent = orgPhase.get(ColDesc.COL_TTS.getCol());
String littlePhaseTitle = orgPhase.get(ColDesc.COL_HINT_TITLE.getCol());
String sure = orgPhase.get(ColDesc.COL_SURE.getCol());
......@@ -119,6 +125,7 @@ public class PhaseUtil {
.ttsContent(ttsContent)
.littlePhaseTitle(littlePhaseTitle)
.bindUnique("")
.popup(popup)
.build();
}
......
......@@ -52,10 +52,13 @@ public class SpeechLittlePhaseAddDTO {
private String bindUnique;
private Integer popup;
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();
.hintTitle(this.littlePhaseTitle).tts(this.ttsContent).condition(getConditionMap()).hintType(getHintType())
.bindBefore(this.bindBefore).bindAfter(this.bindAfter).bindUnique(this.bindUnique)
.classIndex(0).popup(this.popup).build();
}
private HashMap<String, Object> getConditionMap() {
......
......@@ -33,4 +33,6 @@ public class SpeechLittlePhaseEditDTO {
private Integer classIndex;
private Integer popup;
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!