Commit d81b7f14 authored by 周健威's avatar 周健威

gtdata路径处理

parent e0760405
...@@ -95,50 +95,6 @@ public class AdminDataTempcacheController extends BaseController<DataTempcacheBi ...@@ -95,50 +95,6 @@ public class AdminDataTempcacheController extends BaseController<DataTempcacheBi
return ObjectRestResponse.succ(resultUrl); return ObjectRestResponse.succ(resultUrl);
} }
@RequestMapping(value = "/app/unauth/dealGtdataPath", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse dealGtdataPath(DataTempcache dataTempcache) throws Exception {
//查询dataTempcache 的上传方式
DataTempcache dataTempcacheDB = baseBiz.selectById(dataTempcache.getId());
String resultPath = "";
//判断是否存在处理GTDATA
if(null == dataTempcacheDB.getGtdataPath() || DataTempcache.HASGTDATA_FIN != dataTempcacheDB.getHasGtdata()) {
if(StrUtil.isBlank(dataTempcacheDB.getGtdataPath())) {
//生成gtdataPath
//根据id创建gtdata目录
String gtdataPath = "/rscloudmart"+ tempcachePath + "/" + dataTempcacheDB.getId();
gtDataRestClient.mkdirs(gtdataPath);
//上传文件
String fileGtdataPath = gtdataPath + "/" + dataTempcacheDB.getFilename();
String filepath = dataTempcacheDB.getFilepath();
// if(StrUtil.isBlank(filepath)) {
// //下载文件
// }
if(!gtDataRestClient.isExist(fileGtdataPath).get("exist").toString().equals("true")){
Map<String, Object> responseMap = gtDataRestClient.createLarge(filepath, fileGtdataPath);
if (responseMap == null || 200 != (Integer) responseMap.get("HttpStatusCode")) {
log.error(JSONUtil.toJsonStr(responseMap), responseMap);
}
}
baseBiz.updateSelectiveById(new DataTempcache() {{
setId(dataTempcache.getId());
setGtdataPath(fileGtdataPath);
setHasGtdata(HASGTDATA_FIN);
}});
dataTempcacheDB.setGtdataPath(fileGtdataPath);
}
}
resultPath = dataTempcacheDB.getGtdataPath();
return ObjectRestResponse.succ(resultPath);
}
@RequestMapping(value = "/getPageList",method = RequestMethod.GET) @RequestMapping(value = "/getPageList",method = RequestMethod.GET)
public ObjectRestResponse<List<GainData>> getPageList(DataTempcacheDTO dto) { public ObjectRestResponse<List<GainData>> getPageList(DataTempcacheDTO dto) {
PageDataVO pageDataVO = PageDataVO.pageInfo(dto.getPage(), dto.getLimit(), ()->baseBiz.pageList(dto)); PageDataVO pageDataVO = PageDataVO.pageInfo(dto.getPage(), dto.getLimit(), ()->baseBiz.pageList(dto));
......
...@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert; ...@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
...@@ -19,6 +20,7 @@ import com.upyuns.platform.rs.website.entity.FileData; ...@@ -19,6 +20,7 @@ import com.upyuns.platform.rs.website.entity.FileData;
import com.upyuns.platform.rs.website.entity.GainData; import com.upyuns.platform.rs.website.entity.GainData;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -31,6 +33,7 @@ import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TR ...@@ -31,6 +33,7 @@ import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TR
@RestController @RestController
@RequestMapping("dataTempcache/web") @RequestMapping("dataTempcache/web")
@Slf4j
public class DataTempcacheController extends BaseController<DataTempcacheBiz,DataTempcache> { public class DataTempcacheController extends BaseController<DataTempcacheBiz,DataTempcache> {
@Autowired @Autowired
...@@ -48,6 +51,49 @@ public class DataTempcacheController extends BaseController<DataTempcacheBiz,Dat ...@@ -48,6 +51,49 @@ public class DataTempcacheController extends BaseController<DataTempcacheBiz,Dat
//BaseController.baseLogicPages //BaseController.baseLogicPages
//BaseController.del //BaseController.del
@RequestMapping(value = "/app/unauth/dealGtdataPath", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse dealGtdataPath(DataTempcache dataTempcache) throws Exception {
//查询dataTempcache 的上传方式
DataTempcache dataTempcacheDB = baseBiz.selectById(dataTempcache.getId());
String resultPath = "";
//判断是否存在处理GTDATA
if(null == dataTempcacheDB.getGtdataPath() || DataTempcache.HASGTDATA_FIN != dataTempcacheDB.getHasGtdata()) {
if(StrUtil.isBlank(dataTempcacheDB.getGtdataPath())) {
//生成gtdataPath
//根据id创建gtdata目录
String gtdataPath = "/rscloudmart"+ tempcachePath + "/" + dataTempcacheDB.getId();
gtDataRestClient.mkdirs(gtdataPath);
//上传文件
String fileGtdataPath = gtdataPath + "/" + dataTempcacheDB.getFilename();
String filepath = dataTempcacheDB.getFilepath();
// if(StrUtil.isBlank(filepath)) {
// //下载文件
// }
if(!gtDataRestClient.isExist(fileGtdataPath).get("exist").toString().equals("true")){
Map<String, Object> responseMap = gtDataRestClient.createLarge(filepath, fileGtdataPath);
if (responseMap == null || 200 != (Integer) responseMap.get("HttpStatusCode")) {
log.error(JSONUtil.toJsonStr(responseMap), responseMap);
}
}
baseBiz.updateSelectiveById(new DataTempcache() {{
setId(dataTempcache.getId());
setGtdataPath(fileGtdataPath);
setHasGtdata(HASGTDATA_FIN);
}});
dataTempcacheDB.setGtdataPath(fileGtdataPath);
}
}
resultPath = dataTempcacheDB.getGtdataPath();
return ObjectRestResponse.succ(resultPath);
}
@ApiOperation("查询分页-ObjectRestResponse") @ApiOperation("查询分页-ObjectRestResponse")
@RequestMapping(value = "/app/unauth/logicPages",method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/logicPages",method = RequestMethod.GET)
@IgnoreUserToken @IgnoreUserToken
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment