Commit f98a3e53 authored by 吴琼's avatar 吴琼

xiugai

parent 375af6e6
......@@ -12,6 +12,7 @@ import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
......@@ -29,7 +30,7 @@ public class TransactionReceiptRecordRest {
@Autowired
private ITransactionReceiptRecordService transactionReceiptRecordService;
@Autowired
private IHttpService httpService;
private RedisTemplate<String, Object> redisTemplate;
/**
* 根据筛选条件进行查询
......@@ -95,4 +96,10 @@ public class TransactionReceiptRecordRest {
}
@RequestMapping(value = "/redis", method = RequestMethod.GET)
public JsonResult redisTest() {
transactionReceiptRecordService.deleteRedis("exportZipFile");
return JsonResult.buildSuccessResult("删除成功",null);
}
}
......@@ -163,7 +163,7 @@ public class TransactionReceiptRecordServiceImpl implements ITransactionReceiptR
log.info("redis delete TransactionReceiptRecordServiceImpl."+str+".userId", redisTemplate);
String obj = (String) redisTemplate.opsForValue().get("TransactionReceiptRecordServiceImpl."+str+".userId");
if(StringUtils.isNotBlank(obj)){
redisTemplate.opsForValue().set("TransactionReceiptRecordServiceImpl."+str+"..userId", "");
redisTemplate.opsForValue().set("TransactionReceiptRecordServiceImpl."+str+".userId", "");
}
}
......@@ -481,8 +481,9 @@ public class TransactionReceiptRecordServiceImpl implements ITransactionReceiptR
File file = ZipUtil.zip(downloadLocalPath, downloadLocalPath+".zip");//zip 包保存路径
FileInputStream is = null;
try {
is = new FileInputStream(file);
is = new FileInputStream(file);
byte[] fileData = new byte[is.available()];
is.read(fileData);
Map<String,Object> map = new HashMap<>();
map.put("base64",Base64.getEncoder().encodeToString(fileData));
int successCount = (int) jsonObject.get("successCount");
......@@ -494,6 +495,7 @@ public class TransactionReceiptRecordServiceImpl implements ITransactionReceiptR
deleteDirectory(deleteFile);
File deleteFile1 =new File(downloadLocalPath);
deleteDirectory(deleteFile1);
deleteRedis("exportZipFile");
return JsonResult.buildSuccessResult("ok",map);
} catch (Exception e) {
deleteRedis("exportZipFile");
......
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