韦忠喜提交

master
weizhongxi 3 years ago
parent ae6d6aab78
commit e2d06c4944

@ -106,7 +106,7 @@ public class TbTemplateController {
@ApiOperation("接收短信内容和url")
// @PreAuthorize("@el.check('taskRecord:list')")
@PostMapping(value = "/getSmsInfo")
// @AnonymousAccess // fixme 需要测试完成后进行去除和使用上面的权限注解
@AnonymousAccess // fixme 需要测试完成后进行去除和使用上面的权限注解
public ResponseEntity<Object> getSmsInfo(@RequestBody SendNewVo sendVo){
log.info("========== [TbTemplateController|getSmsInfo ========== SmsContent"+sendVo.getSmsContent()+" LinkUrl:"+sendVo.getLinkUrl());
if (sendVo == null){

@ -7,8 +7,6 @@ import lombok.Data;
public class SendNewVo {
@ApiModelProperty("发送链接")
private String linkUrl;
@ApiModelProperty("模板id")
private String sendMessage;
@ApiModelProperty("短信内容")
private String smsContent;

@ -137,6 +137,7 @@ public class TbUploadFileNewController {
String token = "";
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
Cookie[] cookies = httpServletRequest.getCookies();
if (cookies != null){
for(Cookie cookie : cookies) {
//获取cookie的名字
String cookieName = cookie.getName();
@ -144,6 +145,7 @@ public class TbUploadFileNewController {
System.out.println(cookieName);
System.out.println(cookieName+" : "+ cookie.getValue() );
}
}
keyName = token+"==="+name;
Object keyValue = redisTemplate.opsForValue().get(keyName);
//防止用户多次提交

@ -176,7 +176,8 @@ public class TbUploadFileNewServiceImpl implements TbUploadFileNewService {
try {
if(nameStr.equals(".xlsx")||nameStr.equals(".xls")){
fileFormat = "excel文件";
list = FileUtil.readLines(eachFilePath, "UTF-8");
ExcelUtils excelUtils = new ExcelUtils();
list = excelUtils.excelParseList(file.getInputStream());
}else if (nameStr.equals(".txt")){
fileFormat = "txt文件";

@ -148,7 +148,8 @@ public class SaveToFileNewTask {
List<String> list = null;
try {
if("excel文件".equals(tbUploadFileNewDto.getFileFormat())){
list = ExcelUtils.excelParseListByUrl(filePath);
ExcelUtils excelUtils = new ExcelUtils();
list = excelUtils.excelParseListByUrl(filePath);
}else if ("txt文件".equals(tbUploadFileNewDto.getFileFormat())){
list = TxtUtils.txtParseListVyUrl(filePath);
}else if ("csv文件".equals(tbUploadFileNewDto.getFileFormat())){

@ -22,7 +22,7 @@ public class ExcelUtils {
* @return
* @throws IOException
*/
public static List<String> excelParseList(InputStream inputStream) throws IOException {
public List<String> excelParseList(InputStream inputStream) throws IOException {
List<String> list = new ArrayList<>();
try {
Workbook workbook = new XSSFWorkbook(inputStream);
@ -58,7 +58,7 @@ public class ExcelUtils {
* @return
* @throws IOException
*/
public static List<String> excelParseListByUrl(String url) throws IOException {
public List<String> excelParseListByUrl(String url) throws IOException {
List<String> list = new ArrayList<>();
InputStream inputStream = new FileInputStream(new File(url)) ;
try {

Loading…
Cancel
Save