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