保存进度!
This commit is contained in:
parent
636ae55b43
commit
16df86e3a7
@ -18,9 +18,9 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.cpic.xim.mybatis.mapper.ImportBIArchievementDataMapper;
|
import com.cpic.xim.mybatis.mapper.ImportBIArchievementDataMapper;
|
||||||
import com.cpic.xim.mybatis.pojo.BIDepartmentArchievementRecord;
|
import com.cpic.xim.mybatis.pojo.BIDepartmentArchievementRecord;
|
||||||
@ -36,9 +36,9 @@ public class ImportBIDataController
|
|||||||
{
|
{
|
||||||
private static Logger logger = LoggerFactory.getLogger( ImportBIDataRequest.class );
|
private static Logger logger = LoggerFactory.getLogger( ImportBIDataRequest.class );
|
||||||
|
|
||||||
@RequestMapping( method = RequestMethod.POST, path = "" )
|
@RequestMapping( method = RequestMethod.POST, path = "/excel.do" )
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public static ImportBIDataResponse importBIData( @RequestParam ImportBIDataRequest request )
|
public static ImportBIDataResponse importBIData( @RequestBody ImportBIDataRequest request )
|
||||||
{
|
{
|
||||||
ImportBIDataResponse response = new ImportBIDataResponse();
|
ImportBIDataResponse response = new ImportBIDataResponse();
|
||||||
String filePath = request.getFilePath();
|
String filePath = request.getFilePath();
|
||||||
@ -63,26 +63,33 @@ public class ImportBIDataController
|
|||||||
}
|
}
|
||||||
catch ( IOException error )
|
catch ( IOException error )
|
||||||
{
|
{
|
||||||
String message = "";
|
String message = "加载文件错误,错误消息:" + error.getMessage();
|
||||||
response.setSuccess( false );
|
response.setSuccess( false );
|
||||||
response.setMessage( message );
|
response.setMessage( message );
|
||||||
|
|
||||||
|
logger.error(message, error);
|
||||||
}
|
}
|
||||||
catch ( InvalidFormatException error )
|
catch ( InvalidFormatException error )
|
||||||
{
|
{
|
||||||
String message = "";
|
String message = "Excel文件格式错误,错误消息:" + error.getMessage();
|
||||||
response.setSuccess( false );
|
response.setSuccess( false );
|
||||||
response.setMessage( message );
|
response.setMessage( message );
|
||||||
|
|
||||||
|
logger.error(message, error);
|
||||||
}
|
}
|
||||||
catch ( PersistenceException error )
|
catch ( PersistenceException error )
|
||||||
{
|
{
|
||||||
String message = "";
|
String message = "Mybatis执行错误,错误消息:" + error.getMessage();
|
||||||
response.setSuccess( false );
|
response.setSuccess( false );
|
||||||
response.setMessage( message );
|
response.setMessage( message );
|
||||||
|
|
||||||
|
logger.error(message, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void importBITelsalerAttachingRate( String filePath, int sheetIndex,
|
private static void importBITelsalerAttachingRate( String filePath, int sheetIndex,
|
||||||
boolean hasCaption ) throws PersistenceException, IOException, InvalidFormatException
|
boolean hasCaption ) throws PersistenceException, IOException, InvalidFormatException
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user