|
@ -664,54 +664,134 @@ public class ExcelService implements IExcelService { |
|
|
if(ObjectUtil.isNull(row)){ |
|
|
if(ObjectUtil.isNull(row)){ |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
String task1="",task2="",description="",beginTime="",endTime="",label="",repeat="",subTaskCell="",subProject="",inputFiles=""; |
|
|
|
|
|
String deliver="",executorRole="",checkerRole="",money="",delay="",delayTime="",loopTo="",loopTimes="",input=""; |
|
|
|
|
|
if(map.get("任务(节点)")!=null){ |
|
|
//一级任务名称
|
|
|
//一级任务名称
|
|
|
String task1 = ExcelUtil.getCellValue(row.getCell(map.get("任务(节点)"))); |
|
|
task1 = ExcelUtil.getCellValue(row.getCell(map.get("任务(节点)"))); |
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("任务(节点)")); |
|
|
|
|
|
} |
|
|
|
|
|
if(map.get("二级任务(节点)")!=null){ |
|
|
//二级任务名称
|
|
|
//二级任务名称
|
|
|
String task2 = ExcelUtil.getCellValue(row.getCell(map.get("二级任务(节点)"))); |
|
|
task2 = ExcelUtil.getCellValue(row.getCell(map.get("二级任务(节点)"))); |
|
|
//详情
|
|
|
//详情
|
|
|
String description = ExcelUtil.getCellValue(row.getCell(map.get("任务描述/要求"))); |
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("二级任务(节点)")); |
|
|
|
|
|
} |
|
|
|
|
|
if(map.get("任务描述/要求")!=null){ |
|
|
|
|
|
description = ExcelUtil.getCellValue(row.getCell(map.get("任务描述/要求"))); |
|
|
//开始时间
|
|
|
//开始时间
|
|
|
String beginTime = StringUtil.replaceStrSpace(ExcelUtil.getCellValue(row.getCell(map.get("开始时间")))); |
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("任务描述/要求")); |
|
|
|
|
|
} |
|
|
|
|
|
if(map.get("开始时间")!=null){ |
|
|
|
|
|
beginTime = StringUtil.replaceStrSpace(ExcelUtil.getCellValue(row.getCell(map.get("开始时间")))); |
|
|
//结束时间
|
|
|
//结束时间
|
|
|
String endTime = StringUtil.replaceStrSpace(ExcelUtil.getCellValue(row.getCell(map.get("结束时间")))); |
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("开始时间")); |
|
|
|
|
|
} |
|
|
|
|
|
if(map.get("结束时间")!=null){ |
|
|
|
|
|
endTime = StringUtil.replaceStrSpace(ExcelUtil.getCellValue(row.getCell(map.get("结束时间")))); |
|
|
//标签
|
|
|
//标签
|
|
|
String label=StringUtil.replaceStrSpace(ExcelUtil.getCellValue(row.getCell(map.get("标签")))); |
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("结束时间")); |
|
|
|
|
|
} |
|
|
|
|
|
if(map.get("标签")!=null){ |
|
|
|
|
|
label=StringUtil.replaceStrSpace(ExcelUtil.getCellValue(row.getCell(map.get("标签")))); |
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("标签")); |
|
|
|
|
|
} |
|
|
//重复
|
|
|
//重复
|
|
|
String repeat = ExcelUtil.getCellValue(row.getCell(map.get("重复"))); |
|
|
if(map.get("重复")!=null){ |
|
|
|
|
|
repeat = ExcelUtil.getCellValue(row.getCell(map.get("重复"))); |
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("重复")); |
|
|
|
|
|
} |
|
|
//关联子日程表
|
|
|
//关联子日程表
|
|
|
String subTaskCell = ExcelUtil.getCellValue(row.getCell(map.get("关联子日程表"))); |
|
|
if(map.get("关联子日程表")!=null){ |
|
|
|
|
|
subTaskCell = ExcelUtil.getCellValue(row.getCell(map.get("关联子日程表"))); |
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("关联子日程表")); |
|
|
|
|
|
} |
|
|
//关联子项目表
|
|
|
//关联子项目表
|
|
|
String subProject = ExcelUtil.getCellValue(row.getCell(map.get("关联子项目表"))); |
|
|
if(map.get("关联子项目表")!=null){ |
|
|
|
|
|
subProject = ExcelUtil.getCellValue(row.getCell(map.get("关联子项目表"))); |
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("关联子项目表")); |
|
|
|
|
|
} |
|
|
//输入文档
|
|
|
//输入文档
|
|
|
String inputFiles=StringUtil.replaceStrSpace(ExcelUtil.getCellValue(row.getCell(map.get("输入文档")))); |
|
|
if(map.get("输入文档")!=null){ |
|
|
|
|
|
inputFiles=StringUtil.replaceStrSpace(ExcelUtil.getCellValue(row.getCell(map.get("输入文档")))); |
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("输入文档")); |
|
|
|
|
|
} |
|
|
//交付物
|
|
|
//交付物
|
|
|
String deliver = ExcelUtil.getCellValue(row.getCell(map.get("交付物/MVP项"))); |
|
|
if(map.get("交付物/MVP项")!=null){ |
|
|
|
|
|
deliver = ExcelUtil.getCellValue(row.getCell(map.get("交付物/MVP项"))); |
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("交付物/MVP项")); |
|
|
|
|
|
} |
|
|
//负责人
|
|
|
//负责人
|
|
|
String executorRole = ExcelUtil.getCellValue(row.getCell(map.get("负责人"))); |
|
|
if(map.get("负责人")!=null){ |
|
|
|
|
|
executorRole = ExcelUtil.getCellValue(row.getCell(map.get("负责人"))); |
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("负责人")); |
|
|
|
|
|
} |
|
|
//检查人
|
|
|
//检查人
|
|
|
String checkerRole = ExcelUtil.getCellValue(row.getCell(map.get("检查人"))); |
|
|
if(map.get("检查人")!=null){ |
|
|
|
|
|
checkerRole = ExcelUtil.getCellValue(row.getCell(map.get("检查人"))); |
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("检查人")); |
|
|
|
|
|
} |
|
|
//即时奖惩(元)
|
|
|
//即时奖惩(元)
|
|
|
String money = ExcelUtil.getCellValue(row.getCell(map.get("即时奖惩(元)"))); |
|
|
if(map.get("即时奖惩(元)")!=null){ |
|
|
|
|
|
money = ExcelUtil.getCellValue(row.getCell(map.get("即时奖惩(元)"))); |
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("即时奖惩(元)")); |
|
|
|
|
|
} |
|
|
//任务切换模式
|
|
|
//任务切换模式
|
|
|
String delay = ExcelUtil.getCellValue(row.getCell(map.get("任务切换模式"))); |
|
|
if(map.get("任务切换模式")!=null){ |
|
|
|
|
|
delay = ExcelUtil.getCellValue(row.getCell(map.get("任务切换模式"))); |
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("任务切换模式")); |
|
|
|
|
|
} |
|
|
//延迟时间
|
|
|
//延迟时间
|
|
|
//(自动延迟模式可用)
|
|
|
//(自动延迟模式可用)
|
|
|
String delayTime = ExcelUtil.getCellValue(row.getCell(map.get("延迟时间(自动延迟模式可用)"))); |
|
|
if(map.get("延迟时间(自动延迟模式可用)")!=null){ |
|
|
|
|
|
delayTime = ExcelUtil.getCellValue(row.getCell(map.get("延迟时间(自动延迟模式可用)"))); |
|
|
|
|
|
|
|
|
//TODO 跳转任务和跳转次数暂不处理
|
|
|
//TODO 跳转任务和跳转次数暂不处理
|
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("延迟时间(自动延迟模式可用)")); |
|
|
|
|
|
} |
|
|
//跳转任务
|
|
|
//跳转任务
|
|
|
String loopTo = ExcelUtil.getCellValue(row.getCell(16)); |
|
|
if(map.get("任务(节点)")!=null){ |
|
|
|
|
|
loopTo = ExcelUtil.getCellValue(row.getCell(16)); |
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
// throw new BaseException(CodeEnum.NOTNAME.addMsgLwb(""));
|
|
|
|
|
|
} |
|
|
//跳转次数
|
|
|
//跳转次数
|
|
|
String loopTimes = ExcelUtil.getCellValue(row.getCell(17)); |
|
|
if(map.get("任务(节点)")!=null){ |
|
|
|
|
|
loopTimes = ExcelUtil.getCellValue(row.getCell(17)); |
|
|
//这个不知道要不要先给你留着
|
|
|
//这个不知道要不要先给你留着
|
|
|
|
|
|
}else { |
|
|
|
|
|
throw new BaseException(CodeEnum.NOTNAME.addMsgLwb("")); |
|
|
|
|
|
} |
|
|
//输入文件
|
|
|
//输入文件
|
|
|
String input = ExcelUtil.getCellValue(row.getCell(18)); |
|
|
if(map.get("任务(节点)")!=null){ |
|
|
|
|
|
input = ExcelUtil.getCellValue(row.getCell(18)); |
|
|
//二级任务名不能为空
|
|
|
//二级任务名不能为空
|
|
|
// if(StrUtil.isEmpty(task2)){
|
|
|
// if(StrUtil.isEmpty(task2)){
|
|
|
// throw new BaseException(CodeEnum.WBS_NOT_TASK_NAME.addMsg(wbsSheet.getSheetName()+i));
|
|
|
// throw new BaseException(CodeEnum.WBS_NOT_TASK_NAME.addMsg(wbsSheet.getSheetName()+i));
|
|
|
// }
|
|
|
// }
|
|
|
//一级任务
|
|
|
//一级任务
|
|
|
|
|
|
}else { |
|
|
|
|
|
// throw new BaseException(CodeEnum.NOTNAME.addMsgLwb(""));
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(task1)) { |
|
|
if (StrUtil.isNotEmpty(task1)) { |
|
|
ProTaskDetail firstTaskDetail = new ProTaskDetail(); |
|
|
ProTaskDetail firstTaskDetail = new ProTaskDetail(); |
|
|
firstTaskDetail.setId(snowflake.nextId()); |
|
|
firstTaskDetail.setId(snowflake.nextId()); |
|
|