Commit eb6ceae8 authored by kevin's avatar kevin

debug

parent 796e5d5b
......@@ -10,9 +10,12 @@ import pwc.taxtech.atms.dao.CitTbamMapper;
import pwc.taxtech.atms.dpo.CitTbamDto;
import pwc.taxtech.atms.dto.OperationResultDto;
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.PeriodFormulaBlockMapper;
import pwc.taxtech.atms.vat.entity.CellComment;
import pwc.taxtech.atms.vat.entity.PeriodCellComment;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.service.impl.CellCommentServiceImpl;
import java.util.List;
......@@ -63,4 +66,19 @@ public class CellCommentController {
operationResultDto.setResultMsg("success");
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 {
cellDataExample.createCriteria().andPeriodEqualTo(report.getPeriod()).andProjectIdEqualTo(projectId).andReportIdEqualTo(reportId);
List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample);
PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample();
periodFormulaBlockExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(report.getPeriod())
.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);
dataDto.setFormulaBlocks(formulaBlocks);
//todo: 关键字数据源稍后再加
// 获取通过KeyValueDataId关联的数据源,即公式数据源
......
......@@ -33,6 +33,15 @@ public class CitTbam extends BaseEntity implements Serializable {
* @mbg.generated
*/
private String organizationId;
private Long adjustAccount;
public Long getAdjustAccount() {
return adjustAccount;
}
public void setAdjustAccount(Long adjustAccount) {
this.adjustAccount = adjustAccount;
}
/**
* Database Column Remarks:
......@@ -623,28 +632,25 @@ public class CitTbam extends BaseEntity implements Serializable {
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId);
sb.append(", projectId=").append(projectId);
sb.append(", date=").append(date);
sb.append(", source=").append(source);
sb.append(", period=").append(period);
sb.append(", accountPeriod=").append(accountPeriod);
sb.append(", attribute=").append(attribute);
sb.append(", accountCode=").append(accountCode);
sb.append(", accountDescription=").append(accountDescription);
sb.append(", debitAmount=").append(debitAmount);
sb.append(", creditAmount=").append(creditAmount);
sb.append(", beginningBalance=").append(beginningBalance);
sb.append(", endingBalance=").append(endingBalance);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append("]");
return sb.toString();
return "CitTbam{" +
"id=" + id +
", organizationId='" + organizationId + '\'' +
", adjustAccount=" + adjustAccount +
", projectId='" + projectId + '\'' +
", date=" + date +
", source='" + source + '\'' +
", period=" + period +
", accountPeriod=" + accountPeriod +
", attribute='" + attribute + '\'' +
", accountCode='" + accountCode + '\'' +
", accountDescription='" + accountDescription + '\'' +
", debitAmount=" + debitAmount +
", creditAmount=" + creditAmount +
", beginningBalance=" + beginningBalance +
", endingBalance=" + endingBalance +
", createBy='" + createBy + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
}
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample;
import java.util.List;
import java.util.Map;
@Mapper
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,
@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 @@
select
id as id,
attribute attribute,
account_code as accountCode,
account_description accountDescription,
debit_amount as debitAmount ,
credit_amount as creditAmount,
beginning_balance as beginningBalance,
ending_balance as endingBalance
IFNULL(adjust_account, ending_balance) as endingBalance
<if test="sql != null and sql != '' ">
${sql}
</if>
......
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,
vatSessionService, stdAccountService, vatCommonService, formulaService, KeyValueConfigService, modelConfigurationService, $timeout, cellCommentService, modifiedReportCellService) {
vatSessionService, stdAccountService, vatCommonService, formulaService, KeyValueConfigService, modelConfigurationService, $timeout, cellCommentService, modifiedReportCellService,commonWebService) {
var entityInit = function () {
......@@ -13,7 +13,10 @@
QMYETotalend: ""
}
}
$scope.relObj.logs = [];
entityInit();
$scope.dataGridOptions = {
bindingOptions: {
columns: 'entryListColumns',
......@@ -48,7 +51,8 @@
$log.debug($scope.selectedItems);*/
$scope.doCalcute(selectedItems.selectedRowsData);
//更新日志
$scope.relObj
var _data = selectedItems.selectedRowsData;
$scope.relObj.logs = commonWebService._index(_data);
},
allowColumnResizing: true,
......@@ -58,7 +62,6 @@
showColumnLines: true,
};
//设置数据源表格的列
var getEntryListColumns = function () {
var dataGridColumns;
......@@ -110,23 +113,21 @@
$scope.makeSure = function () {
$scope.relObj.checkRadio = $scope.checkRadio;
$('#entryListModal').modal('hide');
}
$scope.cancel = function () {
$('#entryListModal').modal('hide');
entityInit();
//entityInit();
}
$scope.hideCellAttachmentModel = function () {
$('#entryListModal').modal('hide');
entityInit();
//entityInit();
}
//
//配置计算公式进行计算
$scope.doCalcute = function (data) {
debugger;
var v1 = 0;//借方发生额合计
var v2 = 0//贷方发生额合计
var _index = 0;
......@@ -135,8 +136,8 @@
v1 = parseFloat(item.accountedDr);
v2 = parseFloat(item.accountedCr);
} else {
v1 += v1 + parseFloat(item.accountedDr);
v2 += v2 + parseFloat(item.accountedCr);
v1 += parseFloat(item.accountedDr);
v2 += parseFloat(item.accountedCr);
}
_index++;
});
......@@ -146,10 +147,5 @@
$scope.entry.QMYETotalend = v1 - v2;
}
$scope.showLog = function () {
alert('查看日志');
}
}
]);
\ No newline at end of file
......@@ -4,7 +4,8 @@ function ($log) {
restrict: 'E',
templateUrl: '/app/cit/report/entryList-modal/entryList-modal.html' + '?_=' + Math.random(),
scope: {
relObj : '='
relObj : '=',
showLog :'&'
},
controller: 'entryListModalController',
link: function ($scope, $element, $attr) {
......
......@@ -6,7 +6,7 @@
$scope.dataGridOptions = {
bindingOptions: {
columns: 'entryLogColumns',
dataSource: 'relObj.entryLogSource'
dataSource: 'relObj.logs'
},
loadPanel: {
enabled: false
......@@ -73,7 +73,9 @@
$scope.entryLogColumns = getEntryLogColumns();
/* $scope.$watch('relObj.logs', function (n,o) {
});*/
$scope.hideCellAttachmentModel = function () {
$('#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-content">
<div class="modal-header">
......
......@@ -228,6 +228,24 @@
}
$scope.hidePanel();
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 @@
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition));
}else if($scope.selectedTabIndex === enums.formulaDataSourceType.CIT_TBAM){
evalVal = _.reduce($scope.detail.dataGridSource, function (memo, x) {
debugger;
return memo + x.endBalance;
}, 0);
$("#dataGridFooterSummary").html($translate.instant('Conclusion')
......@@ -1524,17 +1543,33 @@
$scope.$watch('relObj.checkRadio', function (n, o) {
if($scope.detail.entryIndex != undefined){
$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.detail.entryIndex = e.dataIndex;
debugger;
cellCommentService.loadEntryListDataList(e.data.accountCode).success(function (res) {
$scope.relObj.account = e.data.accountCode;
if (res.resultMsg == "success") {
......
......@@ -303,7 +303,7 @@
<!--分录弹框-->
<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>
......
......@@ -16,6 +16,9 @@ webservices.factory('cellCommentService', ['$http', 'apiConfig', function ($http
},
loadEntryListDataList: function (code) {
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