Commit 163c68c9 authored by zhkwei's avatar zhkwei

CIT数据处理及查看报表fixbug

parent 566191aa
...@@ -1244,33 +1244,35 @@ public class CitReportServiceImpl extends BaseService { ...@@ -1244,33 +1244,35 @@ public class CitReportServiceImpl extends BaseService {
cellData.setFormulaExp(data.getAmount().toString()); cellData.setFormulaExp(data.getAmount().toString());
} }
cellData.setData(sumValue); cellData.setData(sumValue);
periodCellDataMapper.updateByPrimaryKeySelective(cellData); cellData.setUpdateTime(new Date());
int i = periodCellDataMapper.updateByPrimaryKeySelective(cellData);
/*kevin insert */ // TODO: 3/21/2019 需要验证 /*kevin insert */ // TODO: 3/21/2019 需要验证
// PeriodCellTemplateConfigExample example = new PeriodCellTemplateConfigExample(); if(sumValue !=null){
// PeriodCellTemplateConfigExample.Criteria criteria = example.createCriteria(); PeriodCellTemplateConfigExample example = new PeriodCellTemplateConfigExample();
// criteria.andCellTemplateIdEqualTo(Long.parseLong(data.getCellTemplateId())); PeriodCellTemplateConfigExample.Criteria criteria = example.createCriteria();
// criteria.andProjectIdEqualTo(data.getProjectId()); criteria.andCellTemplateIdEqualTo(Long.parseLong(data.getCellTemplateId()));
// PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig(); criteria.andProjectIdEqualTo(data.getProjectId());
// periodCellTemplateConfig.setParsedFormula(sumValue); PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
// periodCellTemplateConfigMapper.updateByExampleSelective(periodCellTemplateConfig, example); periodCellTemplateConfig.setParsedFormula(sumValue);
// //更改选中行相关数据 periodCellTemplateConfigMapper.updateByExampleSelective(periodCellTemplateConfig, example);
// CitJournalEntryAdjust citJournalEntryAdjust = new CitJournalEntryAdjust(); //更改选中行相关数据
// citJournalEntryAdjust.setIsSelect("1"); CitJournalEntryAdjust citJournalEntryAdjust = new CitJournalEntryAdjust();
// CitJournalEntryAdjustExample example1 = new CitJournalEntryAdjustExample(); citJournalEntryAdjust.setIsSelect("1");
// CitJournalEntryAdjustExample.Criteria criteria1 = example1.createCriteria(); CitJournalEntryAdjustExample example1 = new CitJournalEntryAdjustExample();
// criteria1.andProjectIdEqualTo(data.getProjectId()); CitJournalEntryAdjustExample.Criteria criteria1 = example1.createCriteria();
// criteria1.andSubjectCodeEqualTo(data.getAccountCode()); criteria1.andProjectIdEqualTo(data.getProjectId());
// citJournalEntryAdjustMapper.updateByExample(citJournalEntryAdjust, example1); criteria1.andSubjectCodeEqualTo(data.getAccountCode());
// citJournalEntryAdjustMapper.updateByExampleSelective(citJournalEntryAdjust, example1);
// JournalEntry journalEntry = new JournalEntry();
// journalEntry.setIsSelect("1"); JournalEntry journalEntry = new JournalEntry();
// JournalEntryExample example2 = new JournalEntryExample(); journalEntry.setIsSelect("1");
// JournalEntryExample.Criteria criteria2 = example2.createCriteria(); JournalEntryExample example2 = new JournalEntryExample();
// criteria2.andProjectIdEqualTo(data.getProjectId()); JournalEntryExample.Criteria criteria2 = example2.createCriteria();
// criteria2.andSegment3EqualTo(data.getAccountCode()); criteria2.andProjectIdEqualTo(data.getProjectId());
// journalEntryMapper.updateByExample(journalEntry, example2); criteria2.andSegment3EqualTo(data.getAccountCode());
journalEntryMapper.updateByExampleSelective(journalEntry, example2);
}
} }
List<DataSourceExtendDto> dataSourceExtendDtos = periodDataSourceMapper.getManualDataSource(data.getCellId()); List<DataSourceExtendDto> dataSourceExtendDtos = periodDataSourceMapper.getManualDataSource(data.getCellId());
......
...@@ -923,6 +923,9 @@ ...@@ -923,6 +923,9 @@
<if test="record.updateTime != null"> <if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="record.isSelect != null">
is_select = #{record.isSelect,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
......
This source diff could not be displayed because it is too large. You can view the blob instead.
vatModule.controller('citCalculateDataController', ['$scope', '$log', '$timeout','$interval', '$q', '$translate', 'loginContext', vatModule.controller('citCalculateDataController', ['$scope', '$log', '$timeout', '$interval', '$q', '$translate', 'loginContext',
'apiInterceptor', 'Upload', 'dataImportService', 'SweetAlert', 'vatReductionService', 'vatSessionService', 'uiGridConstants', 'apiInterceptor', 'Upload', 'dataImportService', 'SweetAlert', 'vatReductionService', 'vatSessionService', 'uiGridConstants',
'enums', 'modelConfigurationService', 'citReportService', 'vatCommonService', 'BSPLService', 'vatOperationLogService', 'enums', 'modelConfigurationService', 'citReportService', 'vatCommonService', 'BSPLService', 'vatOperationLogService',
'vatWorkflowService', 'vatWorkflowService',
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
var initTasks = function () { var initTasks = function () {
var task = function (id, status, name,code) { var task = function (id, status, name, code) {
this.id = id; this.id = id;
this.name = _.isEmpty(name) ? $translate.instant(id) : name; this.name = _.isEmpty(name) ? $translate.instant(id) : name;
this.status = status; this.status = status;
...@@ -123,25 +123,25 @@ ...@@ -123,25 +123,25 @@
// $scope.isMergeManualDataSource ).success(function (data) { // $scope.isMergeManualDataSource ).success(function (data) {
// var data = {result: true}; // var data = {result: true};
// updateProgress(data, _this); // updateProgress(data, _this);
//citReportService.getTemplateReferences(vatSessionService.month).then(function (refData) { //citReportService.getTemplateReferences(vatSessionService.month).then(function (refData) {
// if (refData && refData.data) { // if (refData && refData.data) {
// // 初始化resolve列表 // // 初始化resolve列表
// var newRefData = _.chain(refData.data).reject(function (x) { // var newRefData = _.chain(refData.data).reject(function (x) {
// return _.isEmpty(x.referenceFromTemplateID) || _.isEmpty(x.referenceToTemplateID); // return _.isEmpty(x.referenceFromTemplateID) || _.isEmpty(x.referenceToTemplateID);
// }).map(function (x) { // }).map(function (x) {
// return { // return {
// referFrom: x.referenceFromTemplateID, // referFrom: x.referenceFromTemplateID,
// referTo: x.referenceToTemplateID, // referTo: x.referenceToTemplateID,
// resolved: x.isResolved // resolved: x.isResolved
// }; // };
// }).value(); // }).value();
// $scope.resolveRef.push.apply($scope.resolveRef, newRefData); // $scope.resolveRef.push.apply($scope.resolveRef, newRefData);
// } // }
// return $q.when(data); // return $q.when(data);
//}).then(function () { //}).then(function () {
// updateProgress(data, _this); // updateProgress(data, _this);
//}); //});
// }).error(function () { // }).error(function () {
// //
// taskError(_this); // taskError(_this);
...@@ -181,8 +181,7 @@ ...@@ -181,8 +181,7 @@
updateProgress(data, _this, false); updateProgress(data, _this, false);
}, 2000); }, 2000);
}); });
} } else {
else {
citReportService.generateAllCitReport(vatSessionService.project.id, true, vatSessionService.logUser.id ? vatSessionService.logUser.id : "").success(function (data) { citReportService.generateAllCitReport(vatSessionService.project.id, true, vatSessionService.logUser.id ? vatSessionService.logUser.id : "").success(function (data) {
updateProgress(data, _this); updateProgress(data, _this);
}).error(function () { }).error(function () {
...@@ -196,7 +195,7 @@ ...@@ -196,7 +195,7 @@
task.prototype.id = null; task.prototype.id = null;
task.prototype.status = null; task.prototype.status = null;
task.prototype.text = null; task.prototype.text = null;
task.prototype.code =null; task.prototype.code = null;
citReportService.getCitTemplate(vatSessionService.project.id, constant.serviceType.CIT).then(function (report) { citReportService.getCitTemplate(vatSessionService.project.id, constant.serviceType.CIT).then(function (report) {
...@@ -204,12 +203,17 @@ ...@@ -204,12 +203,17 @@
// result.push({ name: $translate.instant('ProcessData'), items: [new task('GenerateStdTb', 'unstarted')] }); // result.push({ name: $translate.instant('ProcessData'), items: [new task('GenerateStdTb', 'unstarted')] });
// result.push({ name: $translate.instant('ProcessData'), items: [new task('CompareUnbilled', 'unstarted')] }); // result.push({ name: $translate.instant('ProcessData'), items: [new task('CompareUnbilled', 'unstarted')] });
// result.push({ name: $translate.instant('ProcessData'), items: [new task('CaculateUnbilled', 'unstarted'), new task('UpdateReportConfig', 'unstarted'), new task('GenerateFinanceReport', 'unstarted')] }); // result.push({ name: $translate.instant('ProcessData'), items: [new task('CaculateUnbilled', 'unstarted'), new task('UpdateReportConfig', 'unstarted'), new task('GenerateFinanceReport', 'unstarted')] });
/* var dataValidateItems = [/!*"本期余额表累计数+导入调整表是否等于本期利润表累计数", "本期余额表本期数+导入调整表是否等于本期利润表本期数", "上期利润表本年累进+本期利润表本期数是否等于本期利润表本年累计",*!/ ""]; /* var dataValidateItems = [/!*"本期余额表累计数+导入调整表是否等于本期利润表累计数", "本期余额表本期数+导入调整表是否等于本期利润表本期数", "上期利润表本年累进+本期利润表本期数是否等于本期利润表本年累计",*!/ ""];
var dataValidateCode = [/!*'DA001', 'DA002', 'DA003',*!/ ''];*/ var dataValidateCode = [/!*'DA001', 'DA002', 'DA003',*!/ ''];*/
//数据配置 //数据配置
result.push({ name: $translate.instant('ProcessData'), items: [new task('UpdateReportConfig', 'unstarted',"","UpdateConfig")] }); result.push({
result[result.length - 1].items.forEach(function (t) { t.seqNo = result.length - 1 }); name: $translate.instant('ProcessData'),
items: [new task('UpdateReportConfig', 'unstarted', "", "UpdateConfig")]
});
result[result.length - 1].items.forEach(function (t) {
t.seqNo = result.length - 1
});
//数据校验 //数据校验
// var reItem = []; // var reItem = [];
...@@ -248,7 +252,7 @@ ...@@ -248,7 +252,7 @@
i++; i++;
taskList = taskList.concat(item.items); taskList = taskList.concat(item.items);
}); });
$scope.tasks = result; $scope.tasks = result;
getInitTaskStatus(); getInitTaskStatus();
}); });
...@@ -287,52 +291,52 @@ ...@@ -287,52 +291,52 @@
// }); // });
} }
function doStartCaculate2(isMergeManualDataSource) { function doStartCaculate2(isMergeManualDataSource) {
citReportService.generateAllCitReport(vatSessionService.project.id, isMergeManualDataSource, vatSessionService.logUser.id ? vatSessionService.logUser.id : "").success(function (data) { citReportService.generateAllCitReport(vatSessionService.project.id, isMergeManualDataSource, vatSessionService.logUser.id ? vatSessionService.logUser.id : "").success(function (data) {
$scope.readonly = true;
if(data && data.result)
updateTasksStatus(data.data);
if(data.data.jobStatus=='Begin'||data.data.jobStatus=='Running'){
if(!$scope.timer)
$scope.timer= $interval(function(){
citReportService.getJobStatus(vatSessionService.project.id,0,data.data.id).then(function(result){
if(result.data && result.status == 200){
updateTasksStatus(result.data);
}else{
if($scope.timer)
$interval.cancel($scope.timer);
}
});
},1000); $scope.readonly = true;
} if (data && data.result)
}).error(function (data,status,config,statusText) { updateTasksStatus(data.data);
if(status==412){ if (data.data.jobStatus == 'Begin' || data.data.jobStatus == 'Running') {
SweetAlert.error('报表提审中!'); if (!$scope.timer)
}else if(status == 409){ $scope.timer = $interval(function () {
SweetAlert.error('报表已在处理中!');
}
});
} citReportService.getJobStatus(vatSessionService.project.id, 0, data.data.id).then(function (result) {
function isAllEnd(stepCode,status){ if (result.data && result.status == 200) {
var statusList = JSON.parse(status); updateTasksStatus(result.data);
var stepCodes = stepCode.split(","); } else {
if ($scope.timer)
$interval.cancel($scope.timer);
}
});
} }, 1000);
}
}).error(function (data, status, config, statusText) {
if (status == 412) {
SweetAlert.error('报表提审中!');
} else if (status == 409) {
SweetAlert.error('报表已在处理中!');
}
});
}
function isAllEnd(stepCode, status) {
var statusList = JSON.parse(status);
var stepCodes = stepCode.split(",");
}
var startCaculate = function () { var startCaculate = function () {
debugger;
var a = vatSessionService.project.projectStatusList; var a = vatSessionService.project.projectStatusList;
if (vatSessionService.project.projectStatusList[0] >= constant.ProjectStatusEnum.Generated) { if (vatSessionService.project.projectStatusList[-1] >= constant.ProjectStatusEnum.Generated) {
swal({ swal({
title: "warning!", title: "warning!",
text: $translate.instant('IsConfirmReCalcuate').formatObj({status: vatCommonService.getProjectStautsEnumDesc(vatSessionService.project.projectStatusList[vatSessionService.month])}), text: $translate.instant('IsConfirmReCalcuate').formatObj({status: vatCommonService.getProjectStautsEnumDesc(vatSessionService.project.projectStatusList[-1])}),
type: "warning", type: "warning",
showCancelButton: true, showCancelButton: true,
confirmButtonColor: "#DD6B55", confirmButtonColor: "#DD6B55",
...@@ -378,60 +382,58 @@ ...@@ -378,60 +382,58 @@
} }
}; };
var startCaculate2 = function () { var startCaculate2 = function () {
debugger;
var a = vatSessionService.project.projectStatusList; var a = vatSessionService.project.projectStatusList;
if (vatSessionService.project.projectStatusList[vatSessionService.month] >= constant.ProjectStatusEnum.Generated) { if (vatSessionService.project.projectStatusList[-1] >= constant.ProjectStatusEnum.Generated) {
swal({ swal({
title: "warning!", title: "warning!",
text: $translate.instant('IsConfirmReCalcuate').formatObj({status: vatCommonService.getProjectStautsEnumDesc(vatSessionService.project.projectStatusList[vatSessionService.month])}), text: $translate.instant('IsConfirmReCalcuate').formatObj({status: vatCommonService.getProjectStautsEnumDesc(vatSessionService.project.projectStatusList[-1])}),
type: "warning", type: "warning",
showCancelButton: true, showCancelButton: true,
confirmButtonColor: "#dd6b55", confirmButtonColor: "#dd6b55",
confirmButtonText: $translate.instant('Yes'), confirmButtonText: $translate.instant('Yes'),
cancelButtonText: $translate.instant('No'), cancelButtonText: $translate.instant('No'),
closeOnConfirm: true, closeOnConfirm: true,
closeOnCancel: true closeOnCancel: true
}, },
function (isConfirm) { function (isConfirm) {
if (isConfirm) { if (isConfirm) {
citReportService.hasManualDataSource(vatSessionService.project.id, vatSessionService.month).then(function (hasManual) { citReportService.hasManualDataSource(vatSessionService.project.id, 0).then(function (hasManual) {
if (hasManual) { if (hasManual) {
setTimeout(function () { setTimeout(function () {
swal({ swal({
title: "warning!", title: "warning!",
text: "是否保留手工数据!", text: "是否保留手工数据!",
type: "warning", type: "warning",
showCancelButton: true, showCancelButton: true,
confirmButtonColor: "#DD6B55", confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Yes'), confirmButtonText: $translate.instant('Yes'),
cancelButtonText: $translate.instant('No'), cancelButtonText: $translate.instant('No'),
closeOnConfirm: true, closeOnConfirm: true,
closeOnCancel: true closeOnCancel: true
}, },
function (isConfirm) { function (isConfirm) {
if (isConfirm) { if (isConfirm) {
doStartCaculate2(true); doStartCaculate2(true);
} else { } else {
doStartCaculate2(false); doStartCaculate2(false);
} }
}); });
}, 500); }, 500);
} else { } else {
doStartCaculate2(false); doStartCaculate2(false);
}
});
}
else {
swal.close();
} }
}); });
} } else {
else { swal.close();
doStartCaculate2(false); }
} });
}; } else {
doStartCaculate2(false);
}
};
var caculateProgress = function (task) { var caculateProgress = function (task) {
...@@ -462,20 +464,19 @@ ...@@ -462,20 +464,19 @@
if (!_.isEmpty($scope.resolveRef)) { if (!_.isEmpty($scope.resolveRef)) {
readyTasks = _.reject($scope.tasks[task.seqNo + 1].items, function (t) { readyTasks = _.reject($scope.tasks[task.seqNo + 1].items, function (t) {
return _.some($scope.resolveRef, function (x) { return _.some($scope.resolveRef, function (x) {
if($scope.tasks[task.seqNo + 1].isReportTask)isReport=true; if ($scope.tasks[task.seqNo + 1].isReportTask) isReport = true;
return !x.resolved && x.referTo === t.id; return !x.resolved && x.referTo === t.id;
}); });
}); });
} } else {
else {
readyTasks = $scope.tasks[task.seqNo + 1].items; readyTasks = $scope.tasks[task.seqNo + 1].items;
if($scope.tasks[task.seqNo + 1].isReportTask)isReport=true; if ($scope.tasks[task.seqNo + 1].isReportTask) isReport = true;
} }
readyTasks.forEach(function (t) { readyTasks.forEach(function (t) {
if(isReport&&!isGenedAll){ if (isReport && !isGenedAll) {
t.doTask(); t.doTask();
isGenedAll=true; isGenedAll = true;
} }
t.status = 'processing'; t.status = 'processing';
...@@ -512,25 +513,24 @@ ...@@ -512,25 +513,24 @@
}); });
if (!$scope.readonly) { if (!$scope.readonly) {
vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Generated vatCommonService.setProjectStatus(vatSessionService.project.id, 0, constant.ProjectStatusEnum.Generated
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished); , constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
} }
}; };
var updateProgress = function (data, task, ifWriteLog) { var updateProgress = function (data, task, ifWriteLog) {
if (data && data.result) { if (data && data.result) {
if( $scope.tasks[task.seqNo].isReportTask){ if ($scope.tasks[task.seqNo].isReportTask) {
$scope.tasks[task.seqNo].items.forEach(function (t) { $scope.tasks[task.seqNo].items.forEach(function (t) {
t.status = 'completed'; t.status = 'completed';
t.text = $translate.instant(t.status); t.text = $translate.instant(t.status);
}); });
}else{ } else {
task.status = 'completed'; task.status = 'completed';
task.text = $translate.instant(task.status); task.text = $translate.instant(task.status);
} }
} } else {
else {
task.status = 'error'; task.status = 'error';
task.text = $translate.instant(task.status); task.text = $translate.instant(task.status);
//SweetAlert.error($translate.instant('PleaseContactAdministrator')); //SweetAlert.error($translate.instant('PleaseContactAdministrator'));
...@@ -560,8 +560,8 @@ ...@@ -560,8 +560,8 @@
logDto.ModuleID = $scope.moduleid; logDto.ModuleID = $scope.moduleid;
logDto.CreatorID = vatSessionService.logUser.ID; logDto.CreatorID = vatSessionService.logUser.ID;
logDto.OperationObject = $translate.instant('vatCaculateDataDesc'); logDto.OperationObject = $translate.instant('vatCaculateDataDesc');
logDto.Comment = vatSessionService.project.name + " " + vatSessionService.project.year + "年" + vatSessionService.month + "月"; logDto.Comment = vatSessionService.project.name + " " + vatSessionService.project.year + "年" + 0 + "月";
logDto.Period = vatSessionService.month; logDto.Period = 0;
logDto.ID = PWC.newGuid(); logDto.ID = PWC.newGuid();
logDto.CreateTime = new Date(); logDto.CreateTime = new Date();
...@@ -573,74 +573,74 @@ ...@@ -573,74 +573,74 @@
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
}; };
var updateTasksStatus = function(job){ var updateTasksStatus = function (job) {
var items = $scope.tasks; var items = $scope.tasks;
var tasks = JSON.parse(job.status); var tasks = JSON.parse(job.status);
if(job.jobStatus == 'End'){ if (job.jobStatus == 'End') {
items.forEach(function(item,index){ items.forEach(function (item, index) {
item.status = 'completed'; item.status = 'completed';
item.text = $translate.instant('completed'); item.text = $translate.instant('completed');
item.items.forEach(function (_task, index) { item.items.forEach(function (_task, index) {
tasks.forEach(function(task){ tasks.forEach(function (task) {
if(task.code==_task.code){ if (task.code == _task.code) {
_task.status = 'completed'; _task.status = 'completed';
_task.text = $translate.instant(_task.status); _task.text = $translate.instant(_task.status);
}
})
})
});
if ($scope.timer) {
$interval.cancel($scope.timer);
vatCommonService.setProjectStatus(vatSessionService.project.id, -1, constant.ProjectStatusEnum.Generated
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
}
} else if (job.jobStatus == 'Running' || job.jobStatus == 'Error') {
var updateConfig = tasks[0];
if (updateConfig.status == 'Error') {
$scope.tasks[0].items[0].status = 'error';
} else if (updateConfig.status == 'End') {
$scope.tasks[0].items[0].status = 'completed';
} else if (updateConfig.status == 'Begin') {
$scope.tasks[0].items[0].status = 'processing';
}
$scope.tasks[0].items[0].text = $translate.instant($scope.tasks[0].items[0].status);
/* items.forEach(function(item,index){
tasks.forEach(function(task){
if(task.code==item.code){
if(task.status == 'Error'){
item.status = 'error';
}else if(task.status == 'End'){
item.status = 'completed';
}else if(task.status == 'Begin'){
item.status = 'processing';
} }
}) item.text = $translate.instant(item.status);
})
});
if($scope.timer){
$interval.cancel($scope.timer);
vatCommonService.setProjectStatus(vatSessionService.project.id, -1, constant.ProjectStatusEnum.Generated
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
}
}else if(job.jobStatus=='Running'|| job.jobStatus=='Error'){
var updateConfig = tasks[0];
if(updateConfig.status == 'Error'){
$scope.tasks[0].items[0].status = 'error';
}else if(updateConfig.status == 'End'){
$scope.tasks[0].items[0].status = 'completed';
}else if(updateConfig.status == 'Begin'){
$scope.tasks[0].items[0].status = 'processing';
}
$scope.tasks[0].items[0].text= $translate.instant($scope.tasks[0].items[0].status);
/* items.forEach(function(item,index){
tasks.forEach(function(task){
if(task.code==item.code){
if(task.status == 'Error'){
item.status = 'error';
}else if(task.status == 'End'){
item.status = 'completed';
}else if(task.status == 'Begin'){
item.status = 'processing';
} }
item.text = $translate.instant(item.status); })
} });*/
}) if (job.jobStatus == 'Error') {
});*/ if ($scope.timer) $interval.cancel($scope.timer);
if(job.jobStatus == 'Error'){
if($scope.timer)$interval.cancel($scope.timer);
} }
} }
items.forEach(function (item, index) {
items.forEach(function(item,index){
item.items.forEach(function (_task, index) { item.items.forEach(function (_task, index) {
tasks.forEach(function(task){ tasks.forEach(function (task) {
if(task.code==_task.code){ if (task.code == _task.code) {
if(task.status == 'Error'){ if (task.status == 'Error') {
_task.status = 'error'; _task.status = 'error';
}else if(task.status == 'End'){ } else if (task.status == 'End') {
_task.status = 'completed'; _task.status = 'completed';
}else if(task.status == 'Begin'){ } else if (task.status == 'Begin') {
_task.status = 'processing'; _task.status = 'processing';
} }
_task.text = $translate.instant(_task.status); _task.text = $translate.instant(_task.status);
...@@ -650,34 +650,34 @@ ...@@ -650,34 +650,34 @@
}); });
} }
var getInitTaskStatus = function(){ var getInitTaskStatus = function () {
citReportService.getRunningJob(vatSessionService.project.id,0).then(function (result) { citReportService.getRunningJob(vatSessionService.project.id, 0).then(function (result) {
if(result.data && result.status == 200){ if (result.data && result.status == 200) {
updateTasksStatus(result.data); updateTasksStatus(result.data);
if(result.data.jobStatus=='Begin'||result.data.jobStatus=='Running'){ if (result.data.jobStatus == 'Begin' || result.data.jobStatus == 'Running') {
if(!$scope.timer) if (!$scope.timer)
$scope.timer= $interval(function(){ $scope.timer = $interval(function () {
citReportService.getJobStatus(vatSessionService.project.id,0,result.data.id) citReportService.getJobStatus(vatSessionService.project.id, 0, result.data.id)
.then(function(result){ .then(function (result) {
if(result.data && result.status == 200){ if (result.data && result.status == 200) {
updateTasksStatus(result.data); updateTasksStatus(result.data);
}else{ } else {
if($scope.timer) if ($scope.timer)
$interval.cancel($scope.timer); $interval.cancel($scope.timer);
} }
}); });
},1000); }, 1000);
} }
}else{ } else {
$log.debug("not running job"); $log.debug("not running job");
} }
}); });
} }
var sendMessage = function (task) { var sendMessage = function (task) {
...@@ -708,8 +708,8 @@ ...@@ -708,8 +708,8 @@
initTasks(); initTasks();
$scope.startCaculate = startCaculate; $scope.startCaculate = startCaculate;
$scope.startCaculate2 = startCaculate2; $scope.startCaculate2 = startCaculate2;
$scope.$on('$destroy',function(){ $scope.$on('$destroy', function () {
if($scope.timer)$interval.cancel($scope.timer); if ($scope.timer) $interval.cancel($scope.timer);
}); });
})(); })();
......
...@@ -897,7 +897,8 @@ ...@@ -897,7 +897,8 @@
}; };
$scope.exportReportTreeOptions = { $scope.exportReportTreeOptions = {
dataSource: [{id: '0', templateId: '0', name: '纳税申报表', items: [], expanded: true}], dataSource: [{id: '0', templateId: '0', name: '纳税申报表', items: [], expanded: true},
{id: '1', templateId: '1', name: '工作底稿', items: [], expanded: true}],
displayExpr: 'name', displayExpr: 'name',
keyExpr: 'id', keyExpr: 'id',
selectionMode: 'Multiple', selectionMode: 'Multiple',
...@@ -916,7 +917,7 @@ ...@@ -916,7 +917,7 @@
$scope.openExportPop = function (evenType) { $scope.openExportPop = function (evenType) {
$scope.evenType = evenType; $scope.evenType = evenType;
var grp = _.find($scope.$parent.$parent.groups, function (g) { var grp = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'TaxReturnType' || g.name == 'WorkingPaperType'; return g.name == 'TaxReturnType';
}); });
if (!grp || !grp.children) { if (!grp || !grp.children) {
...@@ -928,6 +929,19 @@ ...@@ -928,6 +929,19 @@
return {id: item.reportId, templateId: item.id, name: item.name, parentId: '0'}; return {id: item.reportId, templateId: item.id, name: item.name, parentId: '0'};
}); });
var grp2 = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'WorkingPaperType'
});
if (!grp2 || !grp2.children) {
return;
}
$scope.exportReportTreeOptions.dataSource[1].items = [];
$scope.exportReportTreeOptions.dataSource[1].items = _.map(grp2.children, function (item) {
return {id: item.reportId, templateId: item.id, name: item.name, parentId: '0'};
});
var parentElem = angular.element($('#exportReportFilesContainer')); var parentElem = angular.element($('#exportReportFilesContainer'));
$scope.exportReportInstance = $uibModal.open({ $scope.exportReportInstance = $uibModal.open({
ariaLabelledBy: 'modal-title', ariaLabelledBy: 'modal-title',
...@@ -958,7 +972,7 @@ ...@@ -958,7 +972,7 @@
//批量导出EXCEL //批量导出EXCEL
$scope.export = function () { $scope.export = function () {
debugger;
var grp = _.find($scope.$parent.$parent.groups, function (g) { var grp = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'TaxReturnType'; return g.name == 'TaxReturnType';
}); });
...@@ -967,6 +981,14 @@ ...@@ -967,6 +981,14 @@
return; return;
} }
var grp2 = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'WorkingPaperType'
});
if (!grp2 || !grp2.children) {
return;
}
if (!$scope.selectedReportIds || $scope.selectedReportIds.length == 0) { if (!$scope.selectedReportIds || $scope.selectedReportIds.length == 0) {
SweetAlert.warning($translate.instant('ExportReportRequiredCheck')); SweetAlert.warning($translate.instant('ExportReportRequiredCheck'));
return; return;
...@@ -978,6 +1000,10 @@ ...@@ -978,6 +1000,10 @@
item.orderIndex = orderIndex; item.orderIndex = orderIndex;
orderIndex++; orderIndex++;
}); });
_.each(grp2.children, function (item) {
item.orderIndex = orderIndex;
orderIndex++;
});
var reportArray = $scope.selectedReportIds; var reportArray = $scope.selectedReportIds;
...@@ -996,7 +1022,10 @@ ...@@ -996,7 +1022,10 @@
var node = _.first(_.where(grp.children, {reportId: currentVal})); var node = _.first(_.where(grp.children, {reportId: currentVal}));
if (!node) { if (!node) {
return; node = _.first(_.where(grp2.children, {reportId: currentVal}));
if (!node) {
return;
}
} }
var reportPromiss = citReportService.getReportData(node.reportId).success(function (reportData) { var reportPromiss = citReportService.getReportData(node.reportId).success(function (reportData) {
......
...@@ -1442,7 +1442,14 @@ constant.GroupTypeList = [ ...@@ -1442,7 +1442,14 @@ constant.GroupTypeList = [
{code: 4, type: "教育费附加"}, {code: 4, type: "教育费附加"},
{code: 5, type: "地方教育费附加"}, {code: 5, type: "地方教育费附加"},
{code: 6, type: "个人所得税"}, {code: 6, type: "个人所得税"},
{code: 7, type: "国际税"} {code: 7, type: "水利建设基金"},
{code: 8, type: "文化事业建设费"},
{code: 9, type: "房产税"},
{code: 10, type: "城建土地使用税"},
{code: 11, type: "工会经费"},
{code: 12, type: "残疾人就业保障基金"},
{code: 13, type: "代扣代缴税费"},
{code: 14, type: "国际税"}
]; ];
constant.InvoiceTypeList = [ constant.InvoiceTypeList = [
......
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