Commit eb6ceae8 authored by kevin's avatar kevin

debug

parent 796e5d5b
...@@ -10,9 +10,12 @@ import pwc.taxtech.atms.dao.CitTbamMapper; ...@@ -10,9 +10,12 @@ import pwc.taxtech.atms.dao.CitTbamMapper;
import pwc.taxtech.atms.dpo.CitTbamDto; import pwc.taxtech.atms.dpo.CitTbamDto;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.entity.CitJournalEntryAdjust; import pwc.taxtech.atms.entity.CitJournalEntryAdjust;
import pwc.taxtech.atms.entity.CitTbam;
import pwc.taxtech.atms.vat.dao.JournalEntryMapper; import pwc.taxtech.atms.vat.dao.JournalEntryMapper;
import pwc.taxtech.atms.vat.dao.PeriodFormulaBlockMapper;
import pwc.taxtech.atms.vat.entity.CellComment; import pwc.taxtech.atms.vat.entity.CellComment;
import pwc.taxtech.atms.vat.entity.PeriodCellComment; import pwc.taxtech.atms.vat.entity.PeriodCellComment;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.service.impl.CellCommentServiceImpl; import pwc.taxtech.atms.vat.service.impl.CellCommentServiceImpl;
import java.util.List; import java.util.List;
...@@ -63,4 +66,19 @@ public class CellCommentController { ...@@ -63,4 +66,19 @@ public class CellCommentController {
operationResultDto.setResultMsg("success"); operationResultDto.setResultMsg("success");
return operationResultDto; return operationResultDto;
} }
@Autowired
private PeriodFormulaBlockMapper periodFormulaBlockMapper;
//更新调整后金额
@RequestMapping("updateAdjust")
public OperationResultDto updateAdjust(@RequestBody CitTbam[] citTbams){
OperationResultDto operationResultDto = new OperationResultDto();
CitTbam citTbam = new CitTbam();
for(CitTbam citTbam1 : citTbams){
citTbam.setId(citTbam1.getId());
citTbamMapper.updateByPrimaryKey(citTbam);
}
operationResultDto.setResultMsg("success");
return operationResultDto;
}
} }
...@@ -939,11 +939,16 @@ public class ReportServiceImpl extends BaseService { ...@@ -939,11 +939,16 @@ public class ReportServiceImpl extends BaseService {
cellDataExample.createCriteria().andPeriodEqualTo(report.getPeriod()).andProjectIdEqualTo(projectId).andReportIdEqualTo(reportId); cellDataExample.createCriteria().andPeriodEqualTo(report.getPeriod()).andProjectIdEqualTo(projectId).andReportIdEqualTo(reportId);
List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample); List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample);
PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample(); PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample();
periodFormulaBlockExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(report.getPeriod()) periodFormulaBlockExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(report.getPeriod())
.andReportIdEqualTo(reportId); .andReportIdEqualTo(reportId);
/* Map<String, Object> map = new HashMap<>();
map.put("projectId", projectId);
map.put("period", report.getPeriod());
map.put("reportId", reportId);
*/
List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample); List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample);
dataDto.setFormulaBlocks(formulaBlocks); dataDto.setFormulaBlocks(formulaBlocks);
//todo: 关键字数据源稍后再加 //todo: 关键字数据源稍后再加
// 获取通过KeyValueDataId关联的数据源,即公式数据源 // 获取通过KeyValueDataId关联的数据源,即公式数据源
......
...@@ -33,6 +33,15 @@ public class CitTbam extends BaseEntity implements Serializable { ...@@ -33,6 +33,15 @@ public class CitTbam extends BaseEntity implements Serializable {
* @mbg.generated * @mbg.generated
*/ */
private String organizationId; private String organizationId;
private Long adjustAccount;
public Long getAdjustAccount() {
return adjustAccount;
}
public void setAdjustAccount(Long adjustAccount) {
this.adjustAccount = adjustAccount;
}
/** /**
* Database Column Remarks: * Database Column Remarks:
...@@ -623,28 +632,25 @@ public class CitTbam extends BaseEntity implements Serializable { ...@@ -623,28 +632,25 @@ public class CitTbam extends BaseEntity implements Serializable {
*/ */
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); return "CitTbam{" +
sb.append(getClass().getSimpleName()); "id=" + id +
sb.append(" ["); ", organizationId='" + organizationId + '\'' +
sb.append("Hash = ").append(hashCode()); ", adjustAccount=" + adjustAccount +
sb.append(", id=").append(id); ", projectId='" + projectId + '\'' +
sb.append(", organizationId=").append(organizationId); ", date=" + date +
sb.append(", projectId=").append(projectId); ", source='" + source + '\'' +
sb.append(", date=").append(date); ", period=" + period +
sb.append(", source=").append(source); ", accountPeriod=" + accountPeriod +
sb.append(", period=").append(period); ", attribute='" + attribute + '\'' +
sb.append(", accountPeriod=").append(accountPeriod); ", accountCode='" + accountCode + '\'' +
sb.append(", attribute=").append(attribute); ", accountDescription='" + accountDescription + '\'' +
sb.append(", accountCode=").append(accountCode); ", debitAmount=" + debitAmount +
sb.append(", accountDescription=").append(accountDescription); ", creditAmount=" + creditAmount +
sb.append(", debitAmount=").append(debitAmount); ", beginningBalance=" + beginningBalance +
sb.append(", creditAmount=").append(creditAmount); ", endingBalance=" + endingBalance +
sb.append(", beginningBalance=").append(beginningBalance); ", createBy='" + createBy + '\'' +
sb.append(", endingBalance=").append(endingBalance); ", createTime=" + createTime +
sb.append(", createBy=").append(createBy); ", updateTime=" + updateTime +
sb.append(", createTime=").append(createTime); '}';
sb.append(", updateTime=").append(updateTime);
sb.append("]");
return sb.toString();
} }
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock; ...@@ -8,6 +8,7 @@ import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample; import pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample;
import java.util.List; import java.util.List;
import java.util.Map;
@Mapper @Mapper
public interface PeriodFormulaBlockMapper extends MyVatMapper { public interface PeriodFormulaBlockMapper extends MyVatMapper {
...@@ -109,4 +110,6 @@ public interface PeriodFormulaBlockMapper extends MyVatMapper { ...@@ -109,4 +110,6 @@ public interface PeriodFormulaBlockMapper extends MyVatMapper {
void updateReportId(@Param("reportId") Long reportId, @Param("cellTemplateConfigIds") List<Long> cellTemplateConfigIds, void updateReportId(@Param("reportId") Long reportId, @Param("cellTemplateConfigIds") List<Long> cellTemplateConfigIds,
@Param("period") Integer period, @Param("projectId") String projectId); @Param("period") Integer period, @Param("projectId") String projectId);
List<PeriodFormulaBlock> selectByWhere(Map<String,Object> map);
} }
\ No newline at end of file
...@@ -88,13 +88,12 @@ ...@@ -88,13 +88,12 @@
select select
id as id, id as id,
attribute attribute, attribute attribute,
account_code as accountCode, account_code as accountCode,
account_description accountDescription, account_description accountDescription,
debit_amount as debitAmount , debit_amount as debitAmount ,
credit_amount as creditAmount, credit_amount as creditAmount,
beginning_balance as beginningBalance, beginning_balance as beginningBalance,
ending_balance as endingBalance IFNULL(adjust_account, ending_balance) as endingBalance
<if test="sql != null and sql != '' "> <if test="sql != null and sql != '' ">
${sql} ${sql}
</if> </if>
......
citModule.controller('entryListModalController', ['$log', 'apiInterceptor', 'Upload', '$scope', '$q', '$translate', '$uibModal', '$document', '$rootScope', 'SweetAlert', 'enums', citModule.controller('entryListModalController', ['$log', 'apiInterceptor', 'Upload', '$scope', '$q', '$translate', '$uibModal', '$document', '$rootScope', 'SweetAlert', 'enums',
'vatReportService', 'loginContext', 'vatSessionService', 'stdAccountService', 'vatCommonService', 'formulaService', 'KeyValueConfigService', 'modelConfigurationService', '$timeout', 'cellCommentService', 'modifiedReportCellService', 'vatReportService', 'loginContext', 'vatSessionService', 'stdAccountService', 'vatCommonService', 'formulaService', 'KeyValueConfigService', 'modelConfigurationService', '$timeout', 'cellCommentService', 'modifiedReportCellService','commonWebService',
function ($log, apiInterceptor, Upload, $scope, $q, $translate, $uibModal, $document, $rootScope, SweetAlert, enums, vatReportService, loginContext, function ($log, apiInterceptor, Upload, $scope, $q, $translate, $uibModal, $document, $rootScope, SweetAlert, enums, vatReportService, loginContext,
vatSessionService, stdAccountService, vatCommonService, formulaService, KeyValueConfigService, modelConfigurationService, $timeout, cellCommentService, modifiedReportCellService) { vatSessionService, stdAccountService, vatCommonService, formulaService, KeyValueConfigService, modelConfigurationService, $timeout, cellCommentService, modifiedReportCellService,commonWebService) {
var entityInit = function () { var entityInit = function () {
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
QMYETotalend: "" QMYETotalend: ""
} }
} }
$scope.relObj.logs = [];
entityInit(); entityInit();
$scope.dataGridOptions = { $scope.dataGridOptions = {
bindingOptions: { bindingOptions: {
columns: 'entryListColumns', columns: 'entryListColumns',
...@@ -48,7 +51,8 @@ ...@@ -48,7 +51,8 @@
$log.debug($scope.selectedItems);*/ $log.debug($scope.selectedItems);*/
$scope.doCalcute(selectedItems.selectedRowsData); $scope.doCalcute(selectedItems.selectedRowsData);
//更新日志 //更新日志
$scope.relObj var _data = selectedItems.selectedRowsData;
$scope.relObj.logs = commonWebService._index(_data);
}, },
allowColumnResizing: true, allowColumnResizing: true,
...@@ -58,7 +62,6 @@ ...@@ -58,7 +62,6 @@
showColumnLines: true, showColumnLines: true,
}; };
//设置数据源表格的列 //设置数据源表格的列
var getEntryListColumns = function () { var getEntryListColumns = function () {
var dataGridColumns; var dataGridColumns;
...@@ -110,23 +113,21 @@ ...@@ -110,23 +113,21 @@
$scope.makeSure = function () { $scope.makeSure = function () {
$scope.relObj.checkRadio = $scope.checkRadio; $scope.relObj.checkRadio = $scope.checkRadio;
$('#entryListModal').modal('hide'); $('#entryListModal').modal('hide');
} }
$scope.cancel = function () { $scope.cancel = function () {
$('#entryListModal').modal('hide'); $('#entryListModal').modal('hide');
entityInit(); //entityInit();
} }
$scope.hideCellAttachmentModel = function () { $scope.hideCellAttachmentModel = function () {
$('#entryListModal').modal('hide'); $('#entryListModal').modal('hide');
entityInit(); //entityInit();
} }
// //
//配置计算公式进行计算 //配置计算公式进行计算
$scope.doCalcute = function (data) { $scope.doCalcute = function (data) {
debugger;
var v1 = 0;//借方发生额合计 var v1 = 0;//借方发生额合计
var v2 = 0//贷方发生额合计 var v2 = 0//贷方发生额合计
var _index = 0; var _index = 0;
...@@ -135,8 +136,8 @@ ...@@ -135,8 +136,8 @@
v1 = parseFloat(item.accountedDr); v1 = parseFloat(item.accountedDr);
v2 = parseFloat(item.accountedCr); v2 = parseFloat(item.accountedCr);
} else { } else {
v1 += v1 + parseFloat(item.accountedDr); v1 += parseFloat(item.accountedDr);
v2 += v2 + parseFloat(item.accountedCr); v2 += parseFloat(item.accountedCr);
} }
_index++; _index++;
}); });
...@@ -146,10 +147,5 @@ ...@@ -146,10 +147,5 @@
$scope.entry.QMYETotalend = v1 - v2; $scope.entry.QMYETotalend = v1 - v2;
} }
$scope.showLog = function () {
alert('查看日志');
}
} }
]); ]);
\ No newline at end of file
...@@ -4,7 +4,8 @@ function ($log) { ...@@ -4,7 +4,8 @@ function ($log) {
restrict: 'E', restrict: 'E',
templateUrl: '/app/cit/report/entryList-modal/entryList-modal.html' + '?_=' + Math.random(), templateUrl: '/app/cit/report/entryList-modal/entryList-modal.html' + '?_=' + Math.random(),
scope: { scope: {
relObj : '=' relObj : '=',
showLog :'&'
}, },
controller: 'entryListModalController', controller: 'entryListModalController',
link: function ($scope, $element, $attr) { link: function ($scope, $element, $attr) {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
$scope.dataGridOptions = { $scope.dataGridOptions = {
bindingOptions: { bindingOptions: {
columns: 'entryLogColumns', columns: 'entryLogColumns',
dataSource: 'relObj.entryLogSource' dataSource: 'relObj.logs'
}, },
loadPanel: { loadPanel: {
enabled: false enabled: false
...@@ -73,7 +73,9 @@ ...@@ -73,7 +73,9 @@
$scope.entryLogColumns = getEntryLogColumns(); $scope.entryLogColumns = getEntryLogColumns();
/* $scope.$watch('relObj.logs', function (n,o) {
});*/
$scope.hideCellAttachmentModel = function () { $scope.hideCellAttachmentModel = function () {
$('#entryListModal').modal('hide'); $('#entryListModal').modal('hide');
} }
......
<div class="modal fade" id="entryListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal fade" id="entryLogModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-lg" style="width: 1200px;"> <div class="modal-dialog modal-lg" style="width: 1200px;">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
......
...@@ -228,6 +228,24 @@ ...@@ -228,6 +228,24 @@
} }
$scope.hidePanel(); $scope.hidePanel();
vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, status, null, null); vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, status, null, null);
if($scope.detail.cellType == enums.formulaDataSourceType.CIT_TBAM){//
[$scope.detail.entryIndex].adjustBack
var updateAdjustDto = [];
$scope.detail.dataGridSourceBind.forEach(function(e, index){
if(e.adjustBack != undefined && e.adjustBack != null){
updateAdjustDto.push({
id : e.id,
adjustAccount :e.adjustBack
});
}
});
cellCommentService.updateAdjust(updateAdjustDto).success(function (res) {
}).error(function (error) {
if(error){
alert("调整金额数据更新失败");
}
});
}
}; };
...@@ -692,6 +710,7 @@ ...@@ -692,6 +710,7 @@
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition)); + '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition));
}else if($scope.selectedTabIndex === enums.formulaDataSourceType.CIT_TBAM){ }else if($scope.selectedTabIndex === enums.formulaDataSourceType.CIT_TBAM){
evalVal = _.reduce($scope.detail.dataGridSource, function (memo, x) { evalVal = _.reduce($scope.detail.dataGridSource, function (memo, x) {
debugger;
return memo + x.endBalance; return memo + x.endBalance;
}, 0); }, 0);
$("#dataGridFooterSummary").html($translate.instant('Conclusion') $("#dataGridFooterSummary").html($translate.instant('Conclusion')
...@@ -1524,17 +1543,33 @@ ...@@ -1524,17 +1543,33 @@
$scope.$watch('relObj.checkRadio', function (n, o) { $scope.$watch('relObj.checkRadio', function (n, o) {
if($scope.detail.entryIndex != undefined){ if($scope.detail.entryIndex != undefined){
$scope.detail.dataGridSourceBind[$scope.detail.entryIndex].adjustBack = n; $scope.detail.dataGridSourceBind[$scope.detail.entryIndex].adjustBack = n;
calculateSum(n);
} }
}); });
var loadAllDataForSum = function(){//加载合计值 //重新计算合计值
var calculateSum = function(n){
var precition = 2;
var evalVal = _.reduce($scope.detail.dataGridSourceBind, function (memo, x) {
if(x.accountCode == $scope.relObj.account){
memo + n;
}else{
return memo + x.endBalance;
}
}, 0);
$("#dataGridFooterSummary").html($translate.instant('Conclusion')
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition));
}
$scope.entryShowLog= function(){//显示日志
$('#entryLogModal').modal('show');
} }
//显示分录信息 同时加载数据 //显示分录信息 同时加载数据
$scope.loadEntryListDataList = function (e) { $scope.loadEntryListDataList = function (e) {
$scope.detail.entryIndex = e.dataIndex; $scope.detail.entryIndex = e.dataIndex;
debugger;
cellCommentService.loadEntryListDataList(e.data.accountCode).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") {
......
...@@ -303,7 +303,7 @@ ...@@ -303,7 +303,7 @@
<!--分录弹框--> <!--分录弹框-->
<entry-list-modal id ="entryListId" rel-obj = "relObj" ></entry-list-modal> <entry-list-modal id ="entryListId" rel-obj = "relObj" ></entry-list-modal>
<entry-Log id ="entryLogId" rel-obj = "relObj" ></entry-Log> <entry-Log id ="entryLogId" rel-obj = "relObj"show-log = "entryShowLog" ></entry-Log>
</div> </div>
......
...@@ -16,6 +16,9 @@ webservices.factory('cellCommentService', ['$http', 'apiConfig', function ($http ...@@ -16,6 +16,9 @@ webservices.factory('cellCommentService', ['$http', 'apiConfig', function ($http
}, },
loadEntryListDataList: function (code) { loadEntryListDataList: function (code) {
return $http.get('/CellComment/loadEntryListDataList?code=' + code, apiConfig.createVat()); return $http.get('/CellComment/loadEntryListDataList?code=' + code, apiConfig.createVat());
},
updateAdjust : function (data) {
return $http.post('/CellComment/updateAdjust', data, apiConfig.createVat());
} }
}; };
}]); }]);
\ No newline at end of file
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