Commit 76f36f33 authored by eddie.woo's avatar eddie.woo

Merge remote-tracking branch 'origin/dev_mysql' into uat_didi

parents eb2d9409 624c28bc
......@@ -179,4 +179,5 @@ public final class Constant {
}
}
\ No newline at end of file
......@@ -23,6 +23,7 @@ import static javax.servlet.http.HttpServletResponse.SC_OK;
/**
* CIT数据预览功能模块Controller
*
* @author zhikai.z.wei
*/
@RestController
......@@ -34,6 +35,7 @@ public class CitDataPreviewController extends BaseController {
/**
* 日记账合并版数据的获取
*
* @param citJournalAdjustDto
* @return
*/
......@@ -45,12 +47,15 @@ public class CitDataPreviewController extends BaseController {
/**
* 日记账合并版导出
*
* @param paras
* @param response
*/
@RequestMapping(value = "exportJournalMergeData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportJournalMergeData(@RequestBody CitJournalAdjustDto paras, HttpServletResponse response) {
int count = citDataPreviewService.exportJournalMergeData2(paras, response);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
} else {
......@@ -61,6 +66,7 @@ public class CitDataPreviewController extends BaseController {
/**
* 试算平衡表生成版的数据获取
*
* @param citTrialBalanceDto
* @return
*/
......@@ -72,6 +78,7 @@ public class CitDataPreviewController extends BaseController {
/**
* 试算平衡表生成版的导出
*
* @param paras
* @param response
*/
......@@ -108,6 +115,7 @@ public class CitDataPreviewController extends BaseController {
/**
* 试算平衡表Mapping版的数据获取
*
* @param citTrialBalanceDto
* @return
*/
......@@ -120,6 +128,7 @@ public class CitDataPreviewController extends BaseController {
/**
* 试算平衡表Mapping版的导出
*
* @param paras
* @param response
*/
......
......@@ -25,6 +25,7 @@ import pwc.taxtech.atms.vat.service.impl.ReportServiceImpl;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Optional;
......@@ -251,6 +252,34 @@ public class CitReportController {
return ResponseEntity.ok(reportService.addCellManualDataSource(data, from));
}
@RequestMapping(value = "exportReportData/{projectId}/{period}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public void exportReportData(HttpServletResponse response, @RequestBody PeriodReportDataParam param,
@PathVariable(name = "period", required = false) Integer period,
@PathVariable(name = "projectId", required = false) String projectId) {
OutputStream ouputStream = null;
try {
Workbook tWorkbook = citReportService.generateReportData(param.getReportIds(), projectId, period);
response.setContentType("multipart/form-data");
// response.setHeader("Content-Disposition", "attachment;fileName=" + new String(param.getFileName().getBytes("GB2312"), "ISO-8859-1"));
ouputStream = response.getOutputStream();
tWorkbook.write(ouputStream);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (ouputStream != null) {
ouputStream.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@RequestMapping(value = "uploadReportData/{projectId}/{period}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
......
......@@ -203,12 +203,19 @@ public class AnalysisJobServiceImpl extends BaseService {
String regionMeg = regionMap.get(o.getRegionId());
List<String> regionMs = Lists.newArrayList();
if (StringUtils.isNotEmpty(regionMeg)) {
regionMs = Arrays.asList(regionMeg.split("."));
regionMs = Arrays.asList(regionMeg.split(","));
}
if (!regionMs.isEmpty()) {
am.setProvince(regionMs.get(1) != null ? regionMs.get(1) : "");
am.setCity(regionMs.get(2) != null ? regionMs.get(2) : "");
am.setDistrict(regionMs.get(3) != null ? regionMs.get(4) : "");
if(regionMs.size() == 4){
am.setProvince(regionMs.get(1) != null ? regionMs.get(1) : "");
am.setCity(regionMs.get(2) != null ? regionMs.get(2) : "");
am.setDistrict(regionMs.get(3) != null ? regionMs.get(3) : "");
}else if(regionMs.size() == 3){
am.setProvince(regionMs.get(1) != null ? regionMs.get(1) : "");
am.setCity(regionMs.get(2) != null ? regionMs.get(2) : "");
}else if(regionMs.size() == 2){
am.setProvince(regionMs.get(1) != null ? regionMs.get(1) : "");
}
}
am.setBusinessLine(buMap.get(o.getBusinessUnitId()));
am.setCode(o.getCode());
......@@ -223,7 +230,8 @@ public class AnalysisJobServiceImpl extends BaseService {
}
analysisMasterMapper.insertSelective(am);
} catch (Exception e) {
logger.error(String.format("公司:[%s]生成机构分析数据失败!", o.getName()), e);
e.printStackTrace();
logger.error(String.format("生成机构分析数据失败!", e.getMessage()));
}
}
......
......@@ -932,7 +932,7 @@ public class AnalysisServiceImpl extends BaseService {
.andCompanyNameEqualTo(getCellValue(sheetAt.getRow(i).getCell(3), false).toString())
.andPeriodEqualTo(period);
List<AnalysisMaster> analysisMasters = analysisMasterMapper.selectByExample(example);
if (breakFlag > 3) {
if (breakFlag > 20) {
logger.info("大于三条数据不匹配,直接停止进程");
break;
}
......@@ -962,8 +962,14 @@ public class AnalysisServiceImpl extends BaseService {
salesList.add(sales);
}
}
int salesInt = analysisSalesMapper.insertBatch(salesList);
int taxInt = analysisTaxMapper.insertBatch(taxList);
int salesInt = 0;
if (salesList.size() != 0) {
salesInt = analysisSalesMapper.insertBatch(salesList);
}
int taxInt = 0;
if (taxList.size() != 0) {
taxInt = analysisTaxMapper.insertBatch(taxList);
}
logger.info("analysis_salesInt 更新数据条数" + salesInt);
logger.info("analysis_tax 更新数据条数" + taxInt);
System.out.println("数据初始化消耗: " + (System.currentTimeMillis() - now));
......
......@@ -1047,7 +1047,7 @@ public class DataImportService extends BaseService {
}
if (validateRes && EnumTbImportType.CoverImport.getCode().equals(importType)) {
RedLetterInfoTableExample redLetterInfoTableExample = new RedLetterInfoTableExample();
redLetterInfoTableExample.createCriteria().andSubjectNumEqualTo(companyCode).andFillInDateEqualTo(rlits.get(0).getFillInDate());
redLetterInfoTableExample.createCriteria().andSubjectNumEqualTo(companyCode).andPeriodEqualTo(rlits.get(0).getPeriod());
redLetterInfoTableMapper.deleteByExample(redLetterInfoTableExample);
}
redLetterInfoTableMapper.insertBatch(rlits);
......
......@@ -10,6 +10,7 @@ import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.OrganizationExample;
import pwc.taxtech.atms.vat.entity.EbitCellData;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
......
......@@ -62,7 +62,7 @@
</choose>
<choose>
<when test="item.disposedDate != null">#{item.disposedDate,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
<otherwise>null,</otherwise>
</choose>
<choose>
<when test="item.residualRate != null">#{item.residualRate,jdbcType=DECIMAL},</when>
......
......@@ -46,7 +46,7 @@
"TotalYearDifferenceAmount": "Total Year Difference Amount:",
"AdjustmentValue": "Adjustment Value",
"DisposedDate": "Disposed Date",
"ResidualRate": "Residual Rate",
"ResidualRate": "Residual Amount",
"ResidualValue": "Residual Value",
"TaxMonthDepreciationAmount": "Monthly Depreciation Amount(Tax)",
"TaxToCurrentYearDepreciationAmount": "Up To Current Year Depreciation Amount(Tax)",
......@@ -1158,6 +1158,14 @@
"BeginOfNextYear": "Begin Of Next Year",
"PreClassified": "Pre Classified",
"AssetType": "Asset Type",
"TaxGroupName": "TaxGroupName"
"TaxGroupName": "TaxGroupName",
"ProjectDescription": "Project Description",
"ProductDescription": "Product Description",
"Company":"Company",
"CompanyDescription": "Company Description",
"Segment1":"Segment1",
"Segment1Description": "Segment1 Description",
"Segment2":"Segment2",
"Segment2Description": "Segment2 Description"
}
\ No newline at end of file
......@@ -896,11 +896,11 @@
"InternationalDataImport":"国际税数据",
"TBEBITForm":"TP EBIT 表格",
"ClickEnsureTip": "请点击确定按钮!",
"MenuUnreturnedTax": "未返还税金分析",
"MenuTaxComparison": "未返还/返还后税金比较",
"MenuUnreturnedTax": "税负分析",
"MenuTaxComparison": "返还情况",
"MenuCostAnalysis": "费用分析",
"MenuProfitAndLoss": "利润/亏损分析",
"MenuOtherDomesticData": "其他国内数据",
"MenuProfitAndLoss": "利润分析",
"MenuOtherDomesticData": "个税分析",
"MenuDocSituation": "档案归档情况",
"MenuGlobalOverview": "全球概览",
"MenuMexicanTax": "墨西哥税务分析",
......
......@@ -46,7 +46,7 @@
"TotalYearDifferenceAmount": "差异额:",
"AdjustmentValue": "原值调整值",
"DisposedDate": "报废日期",
"ResidualRate": "残值",
"ResidualRate": "残值",
"ResidualValue": "残值",
"TaxMonthDepreciationAmount": "每月折旧额(税务)",
"TaxToCurrentYearDepreciationAmount": "截止本年累计折旧额(税务)",
......@@ -1212,8 +1212,13 @@
"PreClassified": "预提重分类",
"AssetType": "资产类型",
"TaxGroupName": "税务资产分类",
"ImportNotMatch" : "导入文件与选择机构或期间不匹配"
}
\ No newline at end of file
"ImportNotMatch" : "导入文件与选择机构或期间不匹配",
"ProjectDescription": "项目描述",
"ProductDescription": "产品描述",
"Company":"公司间",
"CompanyDescription": "公司间描述",
"Segment1":"备用段",
"Segment1Description": "备用段描述",
"Segment2":"备用段",
"Segment2Description": "备用段描述"
}
\ No newline at end of file
......@@ -896,6 +896,7 @@
onValueChanged: function (data) {
$scope.citAssetsListDto.taxAccountCompare = data.value;
$scope.taxAccountDifferenceOptions.value = data.value;
getAssetResultList($scope.displayType - 1);
}
};
......
......@@ -53,13 +53,24 @@
{ caption: $translate.instant('usableInvoiceAmount'), dataField: "usableInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('usableBalance'), dataField: "usableBalance", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('advanceWriteOff'), dataField: "advanceWriteOff", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('checkOne'), dataField: "checkOne", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('reclassifyAmount'), dataField: "reclassifyAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('exchangeRate'), dataField: "exchangeRate", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('ledgerId'), dataField: "ledgerId", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('debitAdvanceGene'), dataField: "debitAdvanceGene", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('creditPrepaidAccounts'), dataField: "creditPrepaidAccounts", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('remark'), dataField: "remark", allowEditing: false, fixed: true ,width: 150}
{ caption: $translate.instant('Account'), dataField: "subjectCode", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('AccountDescription'), dataField: "subjectDescription", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('AuxiliarySubject'), dataField: "auxiliarySubject", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('AuxiliarySubjectDescription'), dataField: "auxiliarySubjectDescription", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('RevSearchProfitCenterCode'), dataField: "profitCenter", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('RevSearchProfitCenterName'), dataField: "profitCenterDescription", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('RevDetailProduct'), dataField: "product", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('ProductDescription'), dataField: "productDescription", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('c_projectID'), dataField: "project", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('ProjectDescription'), dataField: "projectDescription", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('Company'), dataField: "company", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('CompanyDescription'), dataField: "companyDescription", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('Segment1'), dataField: "segment1", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('Segment1Description'), dataField: "segment1Description", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('Segment2'), dataField: "segment2", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('Segment2Description'), dataField: "segment2Description", allowEditing: false, fixed: true ,width: 150},
];
$scope.assetsResultGridOptions = {
......
......@@ -245,8 +245,8 @@
{caption: $translate.instant('AssetName'), dataField: "assetDescription",width: 200},
{caption: $translate.instant('BuyDate'), dataField: "buyDate", dataType: "date", format: "yyyy-MM-dd",width: 100},
{
caption: $translate.instant('DepreciationDate2'),
dataField: "depreciationDate",
caption: $translate.instant('DisposedDate'),
dataField: "disposedDate",
dataType: "date",
format: "yyyy-MM-dd",
width: 100
......
......@@ -1013,6 +1013,24 @@ debugger;
}
}
});
if ('export' == $scope.evenType) {
var xhr = new XMLHttpRequest();
xhr.onload = function (e) {
var arraybuffer = xhr.response;
exportToExcel(arraybuffer, vatSessionService.project.name + '-' + vatSessionService.month + '-纳税申报.xlsx');
$('#busy-indicator-container').hide();
};
xhr.open("POST", apiInterceptor.webApiHostUrl + '/citReport/exportReportData/' + vatSessionService.project.id + '/' + 0, true);
xhr.setRequestHeader("Authorization", apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken());
xhr.setRequestHeader("Content-Type", 'application/json;charset=UTF-8');
xhr.responseType = "arraybuffer";
xhr.send(JSON.stringify({
reportIds: reportIds
}));
return;
}
if ('upload' == $scope.evenType) {
var xhr = new XMLHttpRequest();
xhr.onload = function (e) {
......@@ -1105,6 +1123,105 @@ debugger;
return;
};
var exportToExcel = function (data, filename) {
var defer = $q.defer();
// var octetStreamMime = 'application/vnd.ms-excel';
var success = false;
// Get the headers
// headers = headers();
// Get the filename from the x-filename header or default to "download.bin"
// var filename = decodeURI(headers['x-file-name']) + defaultFileName;
// Determine the content type from the header or default to "application/octet-stream"
// var contentType = headers['content-type'] || octetStreamMime;
try {
// Try using msSaveBlob if supported
//console.log("Trying saveBlob method ...");
var blob = new Blob([data], {type: "arraybuffer"});
if (navigator.msSaveBlob)
navigator.msSaveBlob(blob, filename);
else {
// Try using other saveBlob implementations, if available
var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
if (saveBlob === undefined) throw "Not supported";
saveBlob(blob, filename);
}
//console.log("saveBlob succeeded");
success = true;
} catch (ex) {
$log.debug("saveBlob method failed with the following exception:");
$log.debug(ex);
}
if (!success) {
// Get the blob url creator
var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
if (urlCreator) {
// Try to use a download link
var link = document.createElement('a');
if ('download' in link) {
// Try to simulate a click
try {
// Prepare a blob URL
//console.log("Trying download link method with simulated click ...");
var blobdownload = new Blob([data], {type: "arraybuffer"});
var urldownload = urlCreator.createObjectURL(blobdownload);
link.setAttribute('href', urldownload);
// Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
link.setAttribute("download", filename);
// Simulate clicking the download link
var event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
link.dispatchEvent(event);
//console.log("Download link method with simulated click succeeded");
success = true;
} catch (ex) {
$log.debug("Download link method with simulated click failed with the following exception:");
$log.debug(ex);
$q.reject();
}
}
if (!success) {
// Fallback to window.location method
try {
// Prepare a blob URL
// Use application/octet-stream when using window.location to force download
//console.log("Trying download link method with window.location ...");
var blobsuccess = new Blob([data], {type: "arraybuffer"});
var urlsuccess = urlCreator.createObjectURL(blobsuccess);
window.location = urlsuccess;
//console.log("Download link method with window.location succeeded");
success = true;
} catch (ex) {
//console.log("Download link method with window.location failed with the following exception:");
$log.debug(ex);
$q.reject();
}
}
}
}
if (!success) {
// Fallback to window.open method
$log.debug("No methods worked for saving the arraybuffer, using last resort window.open");
window.open(httpPath, '_blank', '');
}
//Delete the file
// deleteFile(encodeURI(filename));
defer.resolve('success');
return defer.promise;
};
var timeOutCount = 0;
function timeOutExportSpread(exportReportData) {
......
......@@ -185,6 +185,7 @@
withCredentials: true
}).then(function(resp) {
var ret = resp.data;
$scope.fileName='';
$('#busy-indicator-container').hide();
deferred.resolve();
if (ret.result) {
......
......@@ -171,6 +171,7 @@
__RequestVerificationToken: token,
withCredentials: true
}).then(function(data) {
$scope.fileName='';
$('#busy-indicator-container').hide();
var resp = data.data;
deferred.resolve();
......
......@@ -18,7 +18,7 @@
if (noExtendFileName) {
filename = defaultFileName+ "_" +vatSessionService.project.name+'.xls'
} else {
filename = defaultFileName+"_"+decodeURI(headers['x-file-name']+ "_" +vatSessionService.project.name+'.xls')
filename = defaultFileName+"_"+decodeURI(headers['x-file-name']).replace('???','').replace(',','')+ "_" +vatSessionService.project.name+'.xls'
}
......
......@@ -195,7 +195,7 @@
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportCFData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+queryParm.periodStart+'-'+vatSessionService.year+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
FileSaver.saveAs(data,fileName + '_'+queryParm.periodStart+'-'+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
});
},
getPLDataForDisplay: function (queryParams) {
......@@ -224,7 +224,7 @@
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportIRData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+queryParm.periodStart+'-'+vatSessionService.year+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+(queryParm.periodStart<10?'0'+queryParm.periodStart:queryParm.periodStart)+'-'+vatSessionService.year+(queryParm.periodEnd<10?'0'+queryParm.periodEnd:queryParm.periodEnd)+'_'+vatSessionService.project.name+'.xlsx');
});
},
getCPRDataForDisplay: function (queryParams) {
......@@ -235,7 +235,7 @@
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportCPRData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+queryParm.periodStart+'-'+vatSessionService.year+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
FileSaver.saveAs(data,fileName + '_'+queryParm.periodStart+'-'+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
});
},
getRLITDataForDisplay: function (queryParams) {
......@@ -246,7 +246,7 @@
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportRLITData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+queryParm.periodStart+'-'+vatSessionService.year+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
FileSaver.saveAs(data,fileName + '_'+queryParm.periodStart+'-'+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
});
},
getCILDataForDisplay: function (queryParams) {
......@@ -268,7 +268,7 @@
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportIDData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+queryParm.periodStart+'-'+vatSessionService.year+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
FileSaver.saveAs(data,fileName + '_'+queryParm.periodStart+'-'+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
});
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment