团队作业8——第二次项目冲刺(Beta阶段)5.20
1、当天站立式会议照片
会议内容:
本次会议为第二次会议
本次会议在陆大楼2楼召开,本次会议内容:
①:检查第一次任务完成情况
②:做第二次任务的详细分工
③:规定完成时间是在第三次任务之前
④:遇到困难,及时群里反馈
2. 每个人的工作 (有work item 的ID)
工作中遇到的困难:
新成员对于加入的项目了解还不够深,还需要再加强,但已经比上次任务完成得好了。
3. 发布项目燃尽图;请用专业的工具完成
4. 代码签入记录:
https://coding.net/u/hts-technology/p/CodeManagement/git/tree/master
@RequestMapping("/uploadJavaSingleFile.html")
public String uploadJavaSingleFile(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
//UploadFile.upfile(request, response);//将上传的压缩包文件放到/username/tempProjectFile下
String userDirectory = LocalPath.getLoalPath()+request.getSession().getAttribute("userName")+"//";
String savePath = userDirectory+"singleFile";
String userName=(String) request.getSession().getAttribute("userName");
String message = UploadFile.upfile(request, response,savePath);
String []uploadSingleFileName=message.split("/");
String simpleFileName=uploadSingleFileName[1].substring(0, uploadSingleFileName[1].lastIndexOf("."));
String uploadMessage=null;
if(message.contains("文件上传成功!")){
String fileName=message.substring(message.lastIndexOf("/")+1);
String fileType = fileName.substring(fileName.lastIndexOf(".") + 1); //待修改
if(!fileType.equals("java")){
request.setAttribute("uploadMessage", "文件非java文件!");
return "user/index";
}
request.setAttribute("uploadMessage", "文件上传成功!");
uploadMessage=new UserDaoImpl().areAlreadyUploadSingleFileName(uploadSingleFileName[1], userName);
}
else{
request.setAttribute("uploadMessage", "文件上传失败!");
return "user/index";
}
if(uploadMessage.equals("false")){
Thread t =new Thread(new Runnable() {
@Override
public void run() {
//压缩包文件上传成功!
if(message.contains("文件上传成功!")){
String projectName=null;
String fileName=message.substring(message.lastIndexOf("/")+1);
String fileType = fileName.substring(fileName.lastIndexOf(".") + 1); //待修改
//解压文件名
int singleFileCodeNumber=SingleFileCodeAnalysis.numberOfCode(savePath+"/"+fileName);
JavaSingleFile singleFile=new JavaSingleFile();
singleFile.setFileType(fileType);
singleFile.setCodeNumber(singleFileCodeNumber);
singleFile.setPath(savePath+"/"+fileName);
singleFile.setFileName(fileName);
singleFile.setUserName(userName);
String timeStamp=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()).toString();
singleFile.setTimeStamp(timeStamp);
String saveSingleFileMessage=new UserDaoImpl().saveSingleFileMessage(singleFile);
UserChangeCodeNumber uccn=new UserDaoImpl().getUserTotalCodeNumber(userName);
if(uccn!=null){
uccn.setUserName(userName);
uccn.setCodeNumber(uccn.getCodeNumber()+singleFile.getCodeNumber());
uccn.setTimeStamp(singleFile.getTimeStamp());
String message=new UserDaoImpl().saveUserTotalCodeNumber(uccn);
if(!message.equals("success")){
System.out.println("singleFile saveUserTotalCodeNumber failed!");
}
}else{
uccn=new UserChangeCodeNumber(userName, singleFile.getTimeStamp(), singleFile.getCodeNumber());
String message=new UserDaoImpl().saveUserTotalCodeNumber(uccn);
if(!message.equals("success")){
System.out.println("singleFile saveUserTotalCodeNumber failed!and UserTotalCodeNumber is null where username='...'");
}
}
if(saveSingleFileMessage.equals("success")){
System.out.println(singleFile.getPath());
int fileId=new UserDaoImpl().getSingleFileId(singleFile.getPath());
SingleFileCodeAnalysis.statisticsJavaSingleFileClass(singleFile.getPath(), fileId);
}
}
}
});
t.start();
//文件上传不成功!
}
else{
request.setAttribute("uploadMessage", "文件已存在");
}
return "user/index";
}