韦忠喜提交

master
weizhongxi 3 years ago
parent ae6d6aab78
commit e2d06c4944

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

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

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

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

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

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

Loading…
Cancel
Save