Commit 4020adf1 authored by zhkwei's avatar zhkwei

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

parents 53c3e1aa 85734248
...@@ -2555,8 +2555,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -2555,8 +2555,7 @@ public class ReportServiceImpl extends BaseService {
/* if (j <= 36) /* if (j <= 36)
continue;*/ continue;*/
for (int k = 1; k < sheet.getRow(0).getLastCellNum(); k++) { for (int k = 1; k < sheet.getRow(0).getLastCellNum(); k++) {
if (k != 1 || k != 2)//这里只保存两列 if (k ==1 || k == 2){
continue;
EbitCellData ebitCellData1 = new EbitCellData(); EbitCellData ebitCellData1 = new EbitCellData();
ebitCellData1.setId(idService.nextId()); ebitCellData1.setId(idService.nextId());
ebitCellData1.setOrganizationId(orgId); ebitCellData1.setOrganizationId(orgId);
...@@ -2564,8 +2563,9 @@ public class ReportServiceImpl extends BaseService { ...@@ -2564,8 +2563,9 @@ public class ReportServiceImpl extends BaseService {
ebitCellData1.setCreateTime(new Date()); ebitCellData1.setCreateTime(new Date());
ebitCellData1.setCol(k); ebitCellData1.setCol(k);
ebitCellData1.setRow(j); ebitCellData1.setRow(j);
ebitCellData1.setData(getCellStringValue(sheet.getRow(j).getCell(j))); ebitCellData1.setData(getCellStringValue(sheet.getRow(j).getCell(k)));
ebitCellDataList.add(ebitCellData1); ebitCellDataList.add(ebitCellData1);
}//这里只保存两列{}
} }
} }
if (ebitCellDataList.size() == 0) { if (ebitCellDataList.size() == 0) {
...@@ -2687,6 +2687,9 @@ public class ReportServiceImpl extends BaseService { ...@@ -2687,6 +2687,9 @@ public class ReportServiceImpl extends BaseService {
sheetAt.createRow(i).createCell(0).setCellValue(ebitTitle.get(i - 37)); sheetAt.createRow(i).createCell(0).setCellValue(ebitTitle.get(i - 37));
} }
List<EbitDataDto> ebitCellDataList = new ArrayList<>(); List<EbitDataDto> ebitCellDataList = new ArrayList<>();
if (finalMap.size() == 0)
throw new Exception("没有利润表模板,无法批量导出,请上传模板");
for (Map.Entry<String, List<EbitCellData>> entry : finalMap.entrySet()) { for (Map.Entry<String, List<EbitCellData>> entry : finalMap.entrySet()) {
//加载计算ebit数据 //加载计算ebit数据
...@@ -2716,12 +2719,13 @@ public class ReportServiceImpl extends BaseService { ...@@ -2716,12 +2719,13 @@ public class ReportServiceImpl extends BaseService {
break; break;
if (sheetAt.getRow(m) != null && sheetAt.getRow(m).getCell(_index + 1) != null) { if (sheetAt.getRow(m) != null && sheetAt.getRow(m).getCell(_index + 1) != null) {
for (EbitCellData ebitCellData : entry.getValue()) { for (EbitCellData ebitCellData : entry.getValue()) {
if (m == ebitCellData.getRow() && ebitCellData.getCol() == (_index + 1)) { if (m == ebitCellData.getRow()) {
try { try {
sheetAt.getRow(m).getCell(_index + 1).setCellValue(ebitCellData.getData()); sheetAt.getRow(m).getCell(_index + 1).setCellValue(ebitCellData.getData());
} catch (Exception e) { } catch (Exception e) {
sheetAt.getRow(m).createCell(_index + 1).setCellValue(ebitCellData.getData()); sheetAt.getRow(m).createCell(_index + 1).setCellValue(ebitCellData.getData());
} }
System.out.println(ebitCellData.getData());
} }
} }
} }
......
...@@ -1121,7 +1121,7 @@ ...@@ -1121,7 +1121,7 @@
}); });
}; };
var loadCellData = function (period, orgId) { var loadCellData = function (period) {
//period = Number(period); //period = Number(period);
if ($scope.templateId !== undefined) { if ($scope.templateId !== undefined) {
//todo: according to templateId and period get reportId //todo: according to templateId and period get reportId
...@@ -2841,11 +2841,9 @@ ...@@ -2841,11 +2841,9 @@
} }
var _date = tempYear.toString() + tempMonth; var _date = tempYear.toString() + tempMonth;
_date = Number(_date); _date = Number(_date);
if ($scope.relation.orgId != null) {
$scope.relation.period = _date; $scope.relation.period = _date;
loadCellData(_date, $scope.relation.orgId);//默认当前月 loadCellData(_date, $scope.relation.orgId);//默认当前月
} }
}
}; };
var initDatePicker = function () { var initDatePicker = function () {
...@@ -3089,7 +3087,7 @@ ...@@ -3089,7 +3087,7 @@
$scope.relation.lockCell($scope.spread); $scope.relation.lockCell($scope.spread);
//关闭弹出层 //关闭弹出层
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
spreadTODb();
}, function (e) { }, function (e) {
alert(e.errorMessage); alert(e.errorMessage);
if (e.errorCode === 2/*noPassword*/ || e.errorCode === 3 /*invalidPassword*/) { if (e.errorCode === 2/*noPassword*/ || e.errorCode === 3 /*invalidPassword*/) {
...@@ -3144,7 +3142,7 @@ ...@@ -3144,7 +3142,7 @@
sheet.setValue(42, 2, $scope._ebitResult.sixAddtax); sheet.setValue(42, 2, $scope._ebitResult.sixAddtax);
sheet.setValue(43, 2, $scope._ebitResult.klzcjsz); sheet.setValue(43, 2, $scope._ebitResult.klzcjsz);
} }
setTimeout(function(){spreadTODb();}, 1000)
} }
$scope.singleExport = function () { $scope.singleExport = function () {
......
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