Commit f0b88d69 authored by chase's avatar chase

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

parents a8a6a5e8 b8857a0e
...@@ -10,6 +10,7 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -10,6 +10,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.nutz.lang.Strings;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -1463,7 +1464,7 @@ public class DataImportService extends BaseService { ...@@ -1463,7 +1464,7 @@ public class DataImportService extends BaseService {
//导入成功并将错误信息返回 //导入成功并将错误信息返回
OperationResultDto a=new OperationResultDto(); OperationResultDto a=new OperationResultDto();
a.setResult(true); a.setResult(true);
a.setResultMsg(JSONArray.toJSONString(errorDtos)); a.setResultMsg(reImportError(errorDtos));
return a; return a;
} catch (ServiceException e) { } catch (ServiceException e) {
throw e; throw e;
...@@ -1595,7 +1596,7 @@ public class DataImportService extends BaseService { ...@@ -1595,7 +1596,7 @@ public class DataImportService extends BaseService {
//导入成功并将错误信息返回 //导入成功并将错误信息返回
OperationResultDto a=new OperationResultDto(); OperationResultDto a=new OperationResultDto();
a.setResult(true); a.setResult(true);
a.setResultMsg(JSONArray.toJSONString(dataImportResponseDto1)); a.setResultMsg(reImportError(dataImportResponseDto1));
return a; return a;
} catch (ServiceException e) { } catch (ServiceException e) {
...@@ -1606,6 +1607,55 @@ public class DataImportService extends BaseService { ...@@ -1606,6 +1607,55 @@ public class DataImportService extends BaseService {
} }
} }
private String reImportError(List<DataImportErrorDto> errorDtos){
StringBuffer sb=new StringBuffer();
for(DataImportErrorDto row:errorDtos){
//Sheet
if(row.getSheet()!=null){
sb.append("第"+row.getSheet()+"Sheet,");
}
//行号
if(row.getCellLine()!=null){
sb.append("第"+ row.getCellLine() +"行,");
}
//发票类型
if(!Strings.isBlank(row.getInvoiceType())){
sb.append("发票类型"+row.getInvoiceType()+",");
}
//开票内容
if(!Strings.isBlank(row.getInvoiceDetail())){
sb.append("开票内容"+row.getInvoiceDetail()+",");
}
//开票主体
if(!Strings.isBlank(row.getOrg())){
sb.append("开票主体"+row.getOrg()+",");
}
//税率
if(!Strings.isBlank(row.getTaxRate())){
sb.append("税率"+row.getTaxRate()+",");
}
//税额
if(!Strings.isBlank(row.getAmountRate())){
sb.append("税额"+row.getAmountRate()+",");
}
//开票金额
if(!Strings.isBlank(row.getAmount())){
sb.append("开票金额"+row.getAmount()+",");
}
//确认/认证日期
if(!Strings.isBlank(row.getConfirmTime())){
sb.append("确认/认证日期"+row.getConfirmTime()+",");
}
//金额
if(!Strings.isBlank(row.getCilAmount())){
sb.append("金额"+row.getCilAmount()+",");
}
sb.append(";");
}
return sb.toString();
}
private void processIrs(String billingBody, List<InvoiceRecord> irs, List<String> orgIds, private void processIrs(String billingBody, List<InvoiceRecord> irs, List<String> orgIds,
Integer tmsPeriod, Integer importType, List<DataImportLog> dataImportLogs) { Integer tmsPeriod, Integer importType, List<DataImportLog> dataImportLogs) {
OrganizationExample organizationExample = new OrganizationExample(); OrganizationExample organizationExample = new OrganizationExample();
......
...@@ -623,6 +623,7 @@ ...@@ -623,6 +623,7 @@
"ImportOutputInvoice": "Import Output Invoices", "ImportOutputInvoice": "Import Output Invoices",
"ImportShipmentList": "Import Departure List", "ImportShipmentList": "Import Departure List",
"ImportShipmentListGd": "Import Departure List- GD", "ImportShipmentListGd": "Import Departure List- GD",
"ImportPartSuccess": "Part Import Success",
"ImportSuccess": "Import Success", "ImportSuccess": "Import Success",
"ImportTrialBalance": "Import TB", "ImportTrialBalance": "Import TB",
"ImportTypeTip": "Clear All Imported Financial Data for This Period, Proceed?", "ImportTypeTip": "Clear All Imported Financial Data for This Period, Proceed?",
...@@ -720,6 +721,7 @@ ...@@ -720,6 +721,7 @@
"IsConfirmCancelMap": "The System Has Reached the {status} State. Do You Confirm the Cancellation of Correspondence?", "IsConfirmCancelMap": "The System Has Reached the {status} State. Do You Confirm the Cancellation of Correspondence?",
"IsConfirmManualReClassify": "The System Has Reached the {status} State. Are You Sure to Save Manual Reclassification?", "IsConfirmManualReClassify": "The System Has Reached the {status} State. Are You Sure to Save Manual Reclassification?",
"IsConfirmReCalcuate": "The System Has Reached the {status} State. Do You Confirm Recalculation??", "IsConfirmReCalcuate": "The System Has Reached the {status} State. Do You Confirm Recalculation??",
"IsConfirmTimeNotSame": "数据处理期间非当前税款所属期,是否继续进行数据处理?",
"IsConfirmSaveReport": "The System Has Reached the {status} Status. Are You Sure to Save the Report?", "IsConfirmSaveReport": "The System Has Reached the {status} Status. Are You Sure to Save the Report?",
"IsConfirmToApproveReport": "Whether to Confirm the Approval?", "IsConfirmToApproveReport": "Whether to Confirm the Approval?",
"IsConfirmToCompleteDeclaration": "Whether to Confirm the Completion Of the Declaration?", "IsConfirmToCompleteDeclaration": "Whether to Confirm the Completion Of the Declaration?",
......
...@@ -779,6 +779,7 @@ ...@@ -779,6 +779,7 @@
"ImportOutputInvoice": "导入销项发票", "ImportOutputInvoice": "导入销项发票",
"ImportShipmentList": "导入发车清单", "ImportShipmentList": "导入发车清单",
"ImportShipmentListGd": "导入发车清单-GD", "ImportShipmentListGd": "导入发车清单-GD",
"ImportPartSuccess": "部分导入成功",
"ImportSuccess": "导入成功", "ImportSuccess": "导入成功",
"ImportSuccessCount": "导入成功,验证失败:", "ImportSuccessCount": "导入成功,验证失败:",
"ImportTrialBalance": "导入试算平衡表", "ImportTrialBalance": "导入试算平衡表",
...@@ -955,6 +956,7 @@ ...@@ -955,6 +956,7 @@
"IsConfirmCancelMap": "系统已到达{status}状态,是否确认取消对应?", "IsConfirmCancelMap": "系统已到达{status}状态,是否确认取消对应?",
"IsConfirmManualReClassify": "系统已到达{status}状态,是否确认保存手工重分类?", "IsConfirmManualReClassify": "系统已到达{status}状态,是否确认保存手工重分类?",
"IsConfirmReCalcuate": "系统已到达{status}状态,是否确认重新计算?", "IsConfirmReCalcuate": "系统已到达{status}状态,是否确认重新计算?",
"IsConfirmTimeNotSame": "数据处理期间非当前税款所属期,是否继续进行数据处理?",
"IsConfirmSaveReport": "系统已到达{status}状态,是否确认保存报表?", "IsConfirmSaveReport": "系统已到达{status}状态,是否确认保存报表?",
"IsConfirmToApproveReport": "是否确认通过审核?", "IsConfirmToApproveReport": "是否确认通过审核?",
"IsConfirmToApproveReportTitle": "是否确定审核通过?", "IsConfirmToApproveReportTitle": "是否确定审核通过?",
......
...@@ -191,8 +191,12 @@ ...@@ -191,8 +191,12 @@
if (ret.result) { if (ret.result) {
logDto.UpdateState = $translate.instant('ImportSuccess'); logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
if(ret.resultMsg){ //var errorObj=JSON.parse(ret.resultMsg);
swal($translate.instant('ImportSuccess'), ret.resultMsg, "warning"); if(ret.resultMsg!=""&&ret.resultMsg){
var reg = new RegExp(";","g");//g,表示全部替换
var error=ret.resultMsg.replace(reg,'\n');
swal($translate.instant('ImportPartSuccess'), error, "warning");
//swal($translate.instant('ImportSuccess'), ret.resultMsg, "warning");
//SweetAlert.warning(ret.resultMsg); //SweetAlert.warning(ret.resultMsg);
}else{ }else{
SweetAlert.success($translate.instant('ImportSuccess')); SweetAlert.success($translate.instant('ImportSuccess'));
......
...@@ -198,8 +198,12 @@ ...@@ -198,8 +198,12 @@
if (ret.result) { if (ret.result) {
logDto.UpdateState = $translate.instant('ImportSuccess'); logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
if(ret.resultMsg){ //var errorObj=JSON.parse(ret.resultMsg);
swal($translate.instant('ImportSuccess'), ret.resultMsg, "warning"); if(ret.resultMsg!=""&&ret.resultMsg){
var reg = new RegExp(";","g");//g,表示全部替换
var error=ret.resultMsg.replace(reg,'\n');
swal($translate.instant('ImportPartSuccess'), error, "warning");
//swal($translate.instant('ImportSuccess'), ret.resultMsg, "warning");
//SweetAlert.warning(ret.resultMsg); //SweetAlert.warning(ret.resultMsg);
}else{ }else{
SweetAlert.success($translate.instant('ImportSuccess')); SweetAlert.success($translate.instant('ImportSuccess'));
......
...@@ -375,6 +375,49 @@ ...@@ -375,6 +375,49 @@
} }
}; };
var checkYearMonthCaculate2 =function (){
var now=new Date();
var month=now.getMonth()+1;
var year=now.getFullYear();
var vatMonth=vatSessionService.month;
if(vatSessionService.year==year){
if(vatMonth<month-1){
return true;
}
}
if(vatSessionService.year==year-1&&vatMonth==12&&month==0){
return false;
}
return true;
}
var startCaculate3 = function () {
var bool=checkYearMonthCaculate2();
if(bool){
swal({
title: "warning!",
text: $translate.instant('IsConfirmTimeNotSame'),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#dd6b55",
confirmButtonText: $translate.instant('Yes'),
cancelButtonText: $translate.instant('No'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if(isConfirm){
startCaculate2();
}else{
return ;
}
})
}else{
startCaculate2();
}
}
var startCaculate2 = function () { var startCaculate2 = function () {
if (vatSessionService.project.projectStatusList[vatSessionService.month] >= constant.ProjectStatusEnum.Generated) { if (vatSessionService.project.projectStatusList[vatSessionService.month] >= constant.ProjectStatusEnum.Generated) {
swal({ swal({
...@@ -684,7 +727,7 @@ ...@@ -684,7 +727,7 @@
$scope.resolveRef = []; $scope.resolveRef = [];
initTasks(); initTasks();
$scope.startCaculate = startCaculate; $scope.startCaculate = startCaculate;
$scope.startCaculate2 = startCaculate2; $scope.startCaculate3 = startCaculate3;
$scope.$on('$destroy',function(){ $scope.$on('$destroy',function(){
if($scope.timer)$interval.cancel($scope.timer); if($scope.timer)$interval.cancel($scope.timer);
}); });
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="vat-caculate-data-title" ng-if="tasks.length > 0"> <div class="vat-caculate-data-title" ng-if="tasks.length > 0">
<!--<span translate="vatCaculateDataDesc"></span>--> <!--<span translate="vatCaculateDataDesc"></span>-->
<!--<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate()"></button>--> <!--<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate()"></button>-->
<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate2()"></button> <button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate3()"></button>
<span ng-click="showOperateLogPop()"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'Remarks' | translate}}</span> <span ng-click="showOperateLogPop()"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'Remarks' | translate}}</span>
</div> </div>
......
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