保存进度!

This commit is contained in:
unknown 2023-10-06 08:28:02 +08:00
parent fdb345176e
commit 8a64561471
7 changed files with 222 additions and 7 deletions

View File

@ -2,5 +2,7 @@
"java.configuration.updateBuildConfiguration": "automatic", "java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "automatic", "java.compile.nullAnalysis.mode": "automatic",
"vue.codeActions.enabled": false, "vue.codeActions.enabled": false,
"java.debug.settings.onBuildFailureProceed": true "java.debug.settings.onBuildFailureProceed": true,
"java.checkstyle.version": "10.12.4",
"java.checkstyle.configuration": "/D:/DevTools/vscode/代码格式化/eclipse-java-google-style.xml"
} }

View File

@ -0,0 +1,31 @@
/*
* @Author: Kane
* @Date: 2023-10-06 00:34:15
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/dataimport/ImportController.java
* @Description: 导入相关的controller
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.dataimport;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping( path = "/import", method = RequestMethod.POST )
public class ImportController
{
@PostMapping( path = "/import_telsalers" )
@ResponseBody
public ImportTelsalersResponse importTelsalers( @RequestParam ImportTelsalersRequest request )
{
ImportTelsalersResponse response = new ImportTelsalersResponse();
return response;
}
}

View File

@ -0,0 +1,98 @@
/*
* @Author: Kane
* @Date: 2023-10-06 00:44:14
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/dataimport/ImportTelsalersRequest.java
* @Description: 导入作息列表请求
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.dataimport;
import com.fasterxml.jackson.annotation.JsonProperty;
public class ImportTelsalersRequest
{
/**
* 构造函数
* @param fullImport 是否全量导入
* @param filePath 文件路径
*/
public ImportTelsalersRequest( boolean fullImport, String filePath )
{
this.fullImport = fullImport;
this.filePath = filePath;
}
public ImportTelsalersRequest()
{
this.fullImport = false;
this.filePath = "";
}
public boolean isFullImport()
{
return fullImport;
}
public void setFullImport( boolean fullImport )
{
this.fullImport = fullImport;
}
public String getFilePath()
{
return filePath;
}
public void setFilePath( String filePath )
{
this.filePath = filePath;
}
@Override
public String toString()
{
return "ImportTelsalersRequest [fullImport=" + fullImport + ", filePath=" + filePath + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + (fullImport ? 1231 : 1237);
result = prime * result + ((filePath == null) ? 0 : filePath.hashCode());
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
ImportTelsalersRequest other = (ImportTelsalersRequest) obj;
if ( fullImport != other.fullImport )
return false;
if ( filePath == null )
{
if ( other.filePath != null )
return false;
}
else if ( !filePath.equals( other.filePath ) )
return false;
return true;
}
// 是否全量导入
@JsonProperty( "fullImport" )
private boolean fullImport;
// 文件路径
@JsonProperty( "filePath" )
private String filePath;
}

View File

@ -0,0 +1,74 @@
/*
* @Author: Kane
* @Date: 2023-10-06 01:30:29
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/dataimport/ImportTelsalersResponse.java
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.dataimport;
import com.cpic.xim.web.controllers.QueryResponse;
import com.fasterxml.jackson.annotation.JsonProperty;
public class ImportTelsalersResponse extends QueryResponse
{
public ImportTelsalersResponse( boolean success, String message, int importedCount )
{
super( success, message );
this.importedCount = importedCount;
}
public ImportTelsalersResponse()
{
super();
importedCount = 0;
}
public int getImportedCount()
{
return importedCount;
}
public void setImportedCount( int importedCount )
{
this.importedCount = importedCount;
}
@Override
public String toString()
{
return "ImportTelsalersResponse [importedCount=" + importedCount + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = super.hashCode();
result = prime * result + importedCount;
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( !super.equals( obj ) )
return false;
if ( getClass() != obj.getClass() )
return false;
ImportTelsalersResponse other = (ImportTelsalersResponse) obj;
if ( importedCount != other.importedCount )
return false;
return true;
}
// 导入的结果数量
@JsonProperty( "importedCount" )
private int importedCount;
}

View File

@ -2,7 +2,7 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-22 23:11:26 * @Date: 2023-01-22 23:11:26
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-09-29 00:46:43 * @LastEditTime: 2023-10-06 01:48:39
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/FileUpload/FileUpload.java * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/FileUpload/FileUpload.java
* @Description: 用于接受上传文件的Controller * @Description: 用于接受上传文件的Controller
* *
@ -25,13 +25,17 @@ import org.springframework.web.multipart.MultipartFile;
@RequestMapping( path = "/file" ) @RequestMapping( path = "/file" )
public class FileUpload public class FileUpload
{ {
/***************************************************** /**
* 接收上传文件并保存到临时目录 * 接收上传文件并保存到临时目录
* 1临时目录下再用sessionID作为子目录保存文件 * 1临时目录下再用sessionID作为子目录保存文件
* 2保存时不更改文件名会覆盖同名文件 * 2保存时不更改文件名会覆盖同名文件
* 3MultipartFile参数形参名称必须和请求form中file标签的name属性一致否则值为null * 3MultipartFile参数形参名称必须和请求form中file标签的name属性一致否则值为null
* 4返回值为接收结果和文件保存绝对路径 * 4返回值为接收结果和文件保存绝对路径
*****************************************************/ * @param taskName 任务名称字符串
* @param files MultipartFile结构的文件对象
* @param request HttpServletRequest对象实例
* @return 返回一个FileUploadResult对象包含上传结果
*/
@RequestMapping( path = "/file-upload.do" ) @RequestMapping( path = "/file-upload.do" )
@ResponseBody @ResponseBody
public FileUploadResult getUploadFile( @RequestParam( "task-name" ) String taskName, public FileUploadResult getUploadFile( @RequestParam( "task-name" ) String taskName,

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-23 22:56:17 * @Date: 2023-01-23 22:56:17
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-09-27 16:28:41 * @LastEditTime: 2023-10-06 00:32:47
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/fileupload/FileUploadResult.java * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/FileUpload/FileUploadResult.java
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -23,6 +23,12 @@ public class FileUploadResult extends QueryResponse
super(); super();
} }
/**
* 构造函数
* @param success 是否上传成功
* @param message 消息字符串
* @param fileList 文件绝对路径字符串数组
*/
public FileUploadResult( boolean success, public FileUploadResult( boolean success,
String message, String message,
Vector<String> fileList ) Vector<String> fileList )

View File

@ -2,7 +2,7 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-09-21 11:35:57 * @Date: 2023-09-21 11:35:57
* @LastEditors: Kane * @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/AddTelsalerResponse.java * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/DeleteTelsalerResponse.java
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.