|
@@ -24,6 +24,8 @@ public class ProjectFileService {
|
|
@Autowired
|
|
@Autowired
|
|
private UserAuthoricationService userAuthoricationService;
|
|
private UserAuthoricationService userAuthoricationService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private AttachmentService attachmentService;
|
|
/**
|
|
/**
|
|
*
|
|
*
|
|
* @Title: queryProjectFileInformation
|
|
* @Title: queryProjectFileInformation
|
|
@@ -84,13 +86,13 @@ public class ProjectFileService {
|
|
@Transactional(rollbackFor=Exception.class)
|
|
@Transactional(rollbackFor=Exception.class)
|
|
public void insertInformationIntoTable(Map<String, Object> map) {
|
|
public void insertInformationIntoTable(Map<String, Object> map) {
|
|
long currentTime = System.currentTimeMillis(); //获取当前时间
|
|
long currentTime = System.currentTimeMillis(); //获取当前时间
|
|
- int attachmentId = (Integer)(int)(Math.random()*1000000); //附件id不能用随机数,这里到时候要改的================>>待定TODO
|
|
|
|
|
|
+ int attachmentId = attachmentService.generateAtachmentId(); //附件id写活♥
|
|
UserDetail userDetail = (UserDetail) map.get("userDetail"); //获取controller传过来的UserDetail对象
|
|
UserDetail userDetail = (UserDetail) map.get("userDetail"); //获取controller传过来的UserDetail对象
|
|
//将数据封装到mapToDaoForProjectFile,并插入【项目文档表】
|
|
//将数据封装到mapToDaoForProjectFile,并插入【项目文档表】
|
|
Map<String, Object> mapToDaoForProjectFile = new LinkedHashMap<String,Object>();
|
|
Map<String, Object> mapToDaoForProjectFile = new LinkedHashMap<String,Object>();
|
|
mapToDaoForProjectFile.put("projectId", map.get("projectId"));
|
|
mapToDaoForProjectFile.put("projectId", map.get("projectId"));
|
|
mapToDaoForProjectFile.put("projectName", map.get("projectName"));
|
|
mapToDaoForProjectFile.put("projectName", map.get("projectName"));
|
|
- mapToDaoForProjectFile.put("attachmentId", attachmentId); //附件id不能用随机数,这里到时候要改的================>>待定TODO
|
|
|
|
|
|
+ mapToDaoForProjectFile.put("attachmentId", attachmentId); //附件id不能用随机数,这里到时候要改的
|
|
mapToDaoForProjectFile.put("updateTime", currentTime); //上传文件的更新时间为当前时间
|
|
mapToDaoForProjectFile.put("updateTime", currentTime); //上传文件的更新时间为当前时间
|
|
mapToDaoForProjectFile.put("hash", map.get("hash")); //将算好的hash值放入mapToDaoForProjectFile中
|
|
mapToDaoForProjectFile.put("hash", map.get("hash")); //将算好的hash值放入mapToDaoForProjectFile中
|
|
projectFileDao.insertInformationIntoTable(mapToDaoForProjectFile); //将以上的数据直接添加到数据库中【项目文档表】去
|
|
projectFileDao.insertInformationIntoTable(mapToDaoForProjectFile); //将以上的数据直接添加到数据库中【项目文档表】去
|