Commit 42353df0 authored by chase's avatar chase

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents 22cfc79b 1b07739f
......@@ -70,10 +70,11 @@ public class CellCommentController {
//加载分录表格数据
@RequestMapping("loadEntryListDataList")
public OperationResultDto loadEntryListDataList(String code) {
public OperationResultDto loadEntryListDataList(String code, String projectId) {
OperationResultDto operationResultDto = new OperationResultDto();
CitJournalEntryAdjust citJournalEntryAdjust = new CitJournalEntryAdjust();
citJournalEntryAdjust.setSubjectCode(code);
citJournalEntryAdjust.setProjectId(projectId);
List<CitJournalEntryAdjust> journalMerge = citJournalEntryAdjustMapper.getJournalMerge(citJournalEntryAdjust);
operationResultDto.setData(journalMerge);
operationResultDto.setResultMsg("success");
......
......@@ -187,7 +187,7 @@ public class FormulaAgent {
if(getSql){
tableName = tableName.toLowerCase();
sql = "select * from " + tableName + " where 1=1 and " + filter + filterValue;
return sql;
return sql + " and project_id = '" + formulaContext.getProjectId() + "'";
}else{
sql = "select sum(" + getField + ") as " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
}
......@@ -210,6 +210,7 @@ public class FormulaAgent {
}
if (bool)
sql += " and period = " + year;
sql += " and project_id = '" + formulaContext.getProjectId() + "'";
return sql;
}
......
......@@ -92,7 +92,8 @@
credit_amount as creditAmount,
beginning_balance as beginningBalance,
adjust_account as adjustAccount,
ending_balance as endingBalance
ending_balance as endingBalance,
project_id as projectId
<if test="sql != null and sql != '' ">
${sql}
</if>
......
......@@ -86,9 +86,11 @@
}
};
var loadSheet = function (templateId) {
var loadSheet = function (templateId, update) {
var prokjectId = vatSessionService.project.id;
var period = 0;
setData();
return templateService.getPeriodTemplateJson(templateId,period,prokjectId).then(function (reportSpread) {
var spreadCtrl = getSpreadControl();
if (spreadCtrl) {
......@@ -98,7 +100,7 @@
spreadCtrl = null;
if (!_.isEmpty(reportSpread)) {
initSpreadExcel(reportSpread).then(function (spread) {
initSpreadExcel(reportSpread, update).then(function (spread) {
return locateCell(spread, true);
});
}
......@@ -107,7 +109,7 @@
});
};
var initSpreadExcel = function (reportSpread) {
var initSpreadExcel = function (reportSpread, update) {
var spread = new GC.Spread.Sheets.Workbook(getSpreadControlElement());
spread.suspendPaint();
......@@ -233,11 +235,67 @@
// spread.isPaintSuspended(false);
scope.spread = spread;
scope.hasLoadSpread = true;
if(update){
updateData();
}else
{
scope.hasLoadSpread = true;
}
return $q.when(spread);
};
var updateData = function(){
setData();
var sheet = getSpreadControl().sheets[0];
sheet.suspendPaint();
var cells = [];
var reportDataSources = _.chain(scope.reportSource)
.pluck('dataSourceList')
.flatten(true).value();
angular.forEach(scope.reportSource, function (x) {
// 比较刷新前后报表中的值的变化
// 优先将单元格转换成数值比较,如果不能则转换为字符串比较
var cell = sheet.getCell(x.rowIndex, x.columnIndex);
var newVal = 100;//cell.value();
newVal = PWC.tryParseStringToNum(newVal);
if (_.isBoolean(newVal)) {
newVal = newVal.toString();
}
else if (_.isNumber(newVal) && !isNaN(newVal)) {
newVal = newVal.toFixed(4);
}
if(x.keyinData){
sheet.setValue(x.rowIndex, x.columnIndex, x.keyinData);
}
var oldVal = x.value;
oldVal = PWC.tryParseStringToNum(oldVal);
if (_.isBoolean(oldVal)) {
oldVal = oldVal.toString();
}
else if (_.isNumber(oldVal) && !isNaN(oldVal)) {
oldVal = oldVal.toFixed(4);
}
if (newVal !== oldVal) {
cells.push({id: x.cellID, oldVal: oldVal, newVal: newVal});
x.value = newVal;
x.isDirty = true;
var dirtyDataSources = _.filter(reportDataSources, {
cellDataID: x.cellID,
name: 'ReportDataSource'
});
angular.forEach(dirtyDataSources, function (ds) {
newVal = PWC.tryParseStringToNum(newVal);
ds.amount = newVal;
});
sheet.setTag(x.rowIndex, x.columnIndex, JSON.stringify(x));
}
sheet.resumePaint();
});
}
var setEditable = function (spread, isReadOnly, ifSuspend) {
//todo:注册之后这里去掉注释
......@@ -595,54 +653,7 @@
// 更新数据源后,通过调用该方法计算所有当前sheet单元格,并通过比较原数据列表与spreadJS计算的新值列表,获取保存时需要修改库中Value的单元格信息列表
var updateCells = function () {
setData();
var sheet = getSpreadControl().sheets[0];
var cells = [];
var reportDataSources = _.chain(scope.reportSource)
.pluck('dataSourceList')
.flatten(true).value();
angular.forEach(scope.reportSource, function (x) {
// 比较刷新前后报表中的值的变化
// 优先将单元格转换成数值比较,如果不能则转换为字符串比较
var cell = sheet.getCell(x.rowIndex, x.columnIndex);
var newVal = cell.value();
newVal = PWC.tryParseStringToNum(newVal);
if (_.isBoolean(newVal)) {
newVal = newVal.toString();
}
else if (_.isNumber(newVal) && !isNaN(newVal)) {
newVal = newVal.toFixed(4);
}
if(x.keyinData){
sheet.setValue(x.rowIndex, x.columnIndex, x.keyinData);
}
var oldVal = x.value;
oldVal = PWC.tryParseStringToNum(oldVal);
if (_.isBoolean(oldVal)) {
oldVal = oldVal.toString();
}
else if (_.isNumber(oldVal) && !isNaN(oldVal)) {
oldVal = oldVal.toFixed(4);
}
if (newVal !== oldVal) {
cells.push({id: x.cellID, oldVal: oldVal, newVal: newVal});
x.value = newVal;
x.isDirty = true;
var dirtyDataSources = _.filter(reportDataSources, {
cellDataID: x.cellID,
name: 'ReportDataSource'
});
angular.forEach(dirtyDataSources, function (ds) {
newVal = PWC.tryParseStringToNum(newVal);
ds.amount = newVal;
});
sheet.setTag(x.rowIndex, x.columnIndex, JSON.stringify(x));
}
});
loadSheet(scope.templateId);
loadSheet(scope.templateId, true);
return cells;
};
......
......@@ -1602,7 +1602,7 @@
// 前端保存数据
return citReportService.addCellManualData($scope.handInputModel, logDto).then(function (manualData) {
var obj = manualData.data.data;
obj.dataSourceType = manualData.dataSourceType;
obj.dataSourceType = manualData.dataSourceType ;
$scope.updateCellByManualChange(obj);
return $q.when();
});
......
......@@ -4,6 +4,7 @@
vatSessionService, stdAccountService, vatCommonService, formulaService, KeyValueConfigService, modelConfigurationService, $timeout, cellCommentService, modifiedReportCellService, commonWebService) {
var _ra = null;
var priorities = ["Low", "Normal", "Urgent", "High"];
var entityInit = function () {
//初始化值
$scope.entry = {
......@@ -31,7 +32,8 @@
mode: "standard"
},
selection: {
mode: "multiple"
mode: "multiple",
deferred: true
},
sorting: {
mode: 'single'
......@@ -76,6 +78,10 @@
showBorders: true,
showRowLines: true,
showColumnLines: true,
filterRow: {
visible: true
},
selectionFilter: ["Task_Status", "=", "Completed"]
};
//设置数据源表格的列
......
......@@ -234,7 +234,7 @@
$scope.detail.dataGridSourceBind.forEach(function (e, index) {
if (e.adjustAccount != undefined && e.adjustAccount != null) {
updateAdjustDto.push({
"id": e.id,
"id": $scope.detail.entryLogIdById,
"adjustAccount": Number(e.adjustAccount)
});
}
......@@ -1616,8 +1616,7 @@
$scope.detail.entryIndex = e.dataIndex;
$scope.detail.entryLogIdByCode = e.data.accountCode;
$scope.detail.entryLogIdById = e.data.id;
$scope.relObj.entryLogIdByCode = e.data.accountCode;
cellCommentService.loadEntryListDataList(e.data.accountCode).success(function (res) {
cellCommentService.loadEntryListDataList(e.data.accountCode, e.data.projectId).success(function (res) {
$scope.relObj.account = e.data.accountCode;
if (res.resultMsg == "success") {
$scope.relObj.entryDataSource = commonWebService._index(res.data);
......
......@@ -14,8 +14,8 @@ webservices.factory('cellCommentService', ['$http', 'apiConfig', function ($http
getCellInformation: function (data) {
return $http.get('/CellComment/getCellInformation?sql=' + data.relSql, apiConfig.createVat());
},
loadEntryListDataList: function (code) {
return $http.get('/CellComment/loadEntryListDataList?code=' + code, apiConfig.createVat());
loadEntryListDataList: function (code, projectId) {
return $http.get('/CellComment/loadEntryListDataList?code=' + code + "&projectId=" + projectId, apiConfig.createVat());
},
updateAdjust : function (data) {
return $http.post('/CellComment/updateAdjust', JSON.stringify(data), apiConfig.createVat({contentType: 'application/json;charset=UTF-8'}));
......
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