|
@@ -7,10 +7,7 @@ import com.example.fms.common.core.base.RedisConf;
|
|
|
import com.example.fms.common.model.dto.UploadChuckDTO;
|
|
|
import com.example.fms.common.model.vo.ConfigSettingVO;
|
|
|
import com.example.fms.common.model.vo.UploadChuckVO;
|
|
|
-import com.example.fms.common.utils.ExcuteConfigUtils;
|
|
|
-import com.example.fms.common.utils.FileUtils;
|
|
|
-import com.example.fms.common.utils.JsonUtils;
|
|
|
-import com.example.fms.common.utils.RedisUtil;
|
|
|
+import com.example.fms.common.utils.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -22,10 +19,12 @@ public class FileChuckService {
|
|
|
private final RedisUtil redisUtil;
|
|
|
|
|
|
public Boolean startChunks(UploadChuckDTO uploadChuckDTO) {
|
|
|
- String md5 = uploadChuckDTO.getMd5();
|
|
|
- if (md5 == null) {
|
|
|
+ String orMd5 = uploadChuckDTO.getMd5();
|
|
|
+ Long time =uploadChuckDTO.getTime();
|
|
|
+ if (orMd5 == null||time==null) {
|
|
|
return false;
|
|
|
}
|
|
|
+ String md5 = Md5Util.getTimeMd5(orMd5,time);
|
|
|
UploadChuckVO uploadChuckVO = new UploadChuckVO();
|
|
|
uploadChuckVO.setOrginName(uploadChuckDTO.getFileName());
|
|
|
String exrName = FileUtil.extName(uploadChuckDTO.getFileName());
|
|
@@ -41,7 +40,7 @@ public class FileChuckService {
|
|
|
String filePath = FileUtils.getDateFilePath(configSettingVO.getFilePath());
|
|
|
uploadChuckVO.setFilePath(filePath);
|
|
|
|
|
|
- String key = this.getTemFileMessageKey(uploadChuckDTO.getMd5());
|
|
|
+ String key = this.getTemFileMessageKey(md5);
|
|
|
String jsons = JSONObject.toJSONString(uploadChuckVO);
|
|
|
redisUtil.set(key, jsons);
|
|
|
return true;
|