保存进度!
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.LoggerFactory;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.cpic.xim.mybatis.mapper.ImportBIArchievementDataMapper;
|
||||
import com.cpic.xim.mybatis.pojo.BIDepartmentArchievementRecord;
|
||||
@ -36,9 +36,9 @@ public class ImportBIDataController
|
||||
{
|
||||
private static Logger logger = LoggerFactory.getLogger( ImportBIDataRequest.class );
|
||||
|
||||
@RequestMapping( method = RequestMethod.POST, path = "" )
|
||||
@RequestMapping( method = RequestMethod.POST, path = "/excel.do" )
|
||||
@ResponseBody
|
||||
public static ImportBIDataResponse importBIData( @RequestParam ImportBIDataRequest request )
|
||||
public static ImportBIDataResponse importBIData( @RequestBody ImportBIDataRequest request )
|
||||
{
|
||||
ImportBIDataResponse response = new ImportBIDataResponse();
|
||||
String filePath = request.getFilePath();
|
||||
@ -63,26 +63,33 @@ public class ImportBIDataController
|
||||
}
|
||||
catch ( IOException error )
|
||||
{
|
||||
String message = "";
|
||||
String message = "加载文件错误,错误消息:" + error.getMessage();
|
||||
response.setSuccess( false );
|
||||
response.setMessage( message );
|
||||
|
||||
logger.error(message, error);
|
||||
}
|
||||
catch ( InvalidFormatException error )
|
||||
{
|
||||
String message = "";
|
||||
String message = "Excel文件格式错误,错误消息:" + error.getMessage();
|
||||
response.setSuccess( false );
|
||||
response.setMessage( message );
|
||||
|
||||
logger.error(message, error);
|
||||
}
|
||||
catch ( PersistenceException error )
|
||||
{
|
||||
String message = "";
|
||||
String message = "Mybatis执行错误,错误消息:" + error.getMessage();
|
||||
response.setSuccess( false );
|
||||
response.setMessage( message );
|
||||
|
||||
logger.error(message, error);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
private static void importBITelsalerAttachingRate( String filePath, int sheetIndex,
|
||||
boolean hasCaption ) throws PersistenceException, IOException, InvalidFormatException
|
||||
{
|
||||
@ -95,7 +102,7 @@ public class ImportBIDataController
|
||||
sheetIndex, hasCaption );
|
||||
|
||||
session = MybatisUtils.getSqlSessionBatch();
|
||||
ImportBIArchievementDataMapper mapper =
|
||||
ImportBIArchievementDataMapper mapper =
|
||||
session.getMapper( ImportBIArchievementDataMapper.class );
|
||||
|
||||
mapper.cleanTelsalerAttachingRateData();
|
||||
|
Loading…
x
Reference in New Issue
Block a user