Commit 5bf8d219 authored by zhkwei's avatar zhkwei

CIT导入及预览优化

parent 2f69a0c6
...@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.constant.enums.EnumCitImportType; import pwc.taxtech.atms.constant.enums.EnumCitImportType;
import pwc.taxtech.atms.dto.ApiResultDto; import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.CitJournalAdjustDto;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.service.impl.CitImportExcelServiceImpl; import pwc.taxtech.atms.service.impl.CitImportExcelServiceImpl;
...@@ -128,5 +129,21 @@ public class CitImportExcelController { ...@@ -128,5 +129,21 @@ public class CitImportExcelController {
return apiResultDto; return apiResultDto;
} }
@RequestMapping(value = "/generateTb", method = RequestMethod.POST)
public OperationResultDto generateTb(@RequestBody CitJournalAdjustDto citJournalAdjustDto){
logger.info("处理日记账并生成TB");
OperationResultDto operationResultDto = new OperationResultDto();
try{
operationResultDto.setResult(true);
citImportExcelService.generateTb(citJournalAdjustDto.getProjectId());
operationResultDto.setResultMsg("Success");
return operationResultDto;
}catch (Exception e){
operationResultDto.setResult(false);
operationResultDto.setResultMsg("Fail");
return operationResultDto;
}
}
} }
...@@ -1400,21 +1400,36 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -1400,21 +1400,36 @@ public class CitImportExcelServiceImpl extends BaseService {
} }
} }
public void generateTb(String projectId){
Project project = projectMapper.selectByPrimaryKey(projectId);
//删除自动生成的试算平衡表相关数据
CitTrialBalanceExample citTbExample = new CitTrialBalanceExample();
citTbExample.createCriteria().andPeriodEqualTo(project.getYear()).andCreateByEqualTo(authUserHelper.getCurrentAuditor().get()).andProjectIdEqualTo(projectId);
int deleteByExample = citTrialBalanceMapper.deleteByExample(citTbExample);
logger.info("删除符合条件的试算平衡表数据");
CitTbamExample citTbamExample = new CitTbamExample();
citTbamExample.createCriteria().andPeriodEqualTo(project.getYear()).andCreateByEqualTo(authUserHelper.getCurrentAuditor().get()).andProjectIdEqualTo(projectId);
logger.info("删除符合条件的试算平衡表Mapping数据");
citTbamMapper.deleteByExample(citTbamExample);
updateImportLog(EnumCitImportType.JournalAdjust.getCode());
autoGeneTB(project.getYear(), project.getOrganizationId(), new ArrayList<>(), projectId);
}
/** /**
* 自动生成试算平衡表和join出Mapping版的attribute mapping TB * 自动生成试算平衡表和join出Mapping版的attribute mapping TB
* @param period * @param period
* @param orgList * @param orgList
* @return * @return
*/ */
public OperationResultDto autoGeneTB(Integer period, String orgId, List<String> orgList,String projectId){ public void autoGeneTB(Integer period, String orgId, List<String> orgList,String projectId){
List<String> orgListTemp = new ArrayList<>();
OperationResultDto autoGeneResult = new OperationResultDto(); orgListTemp.add(orgId);
//第一步,根据合并日记账计算出借方发生额,贷方发生额,科目代码等相关信息 //第一步,根据合并日记账计算出借方发生额,贷方发生额,科目代码等相关信息
StringBuilder periodSb = new StringBuilder(); StringBuilder periodSb = new StringBuilder();
periodSb.append(period); periodSb.append(period);
periodSb.append("%"); periodSb.append("%");
//第二步,查出cit_journal_entry_adjust该期间的调整日记账, //第二步,查出cit_journal_entry_adjust该期间的调整日记账,
List<CitJournalEntryAdjust> citJournalEntryAdjustList = citJournalEntryAdjustMapper.sumAmountByCondition(periodSb.toString(), orgList); List<CitJournalEntryAdjust> citJournalEntryAdjustList = citJournalEntryAdjustMapper.sumAmountByCondition(periodSb.toString(), orgListTemp);
List<CitTrialBalance> trialBalanceList = new ArrayList<>(); List<CitTrialBalance> trialBalanceList = new ArrayList<>();
//存放TB与Mapping结合的实体 //存放TB与Mapping结合的实体
...@@ -1477,11 +1492,9 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -1477,11 +1492,9 @@ public class CitImportExcelServiceImpl extends BaseService {
trialBalanceList.add(trialBalance); trialBalanceList.add(trialBalance);
} }
int insertBatch = citTrialBalanceMapper.insertBatch(trialBalanceList); citTrialBalanceMapper.insertBatch(trialBalanceList);
int insertBatch1 = citTbamMapper.insertBatch(citTbamList); citTbamMapper.insertBatch(citTbamList);
autoGeneResult.setResult(true); logger.info("自动生成TB成功");
autoGeneResult.setResultMsg("自动生成TB成功");
return autoGeneResult;
} }
} }
...@@ -1151,5 +1151,8 @@ ...@@ -1151,5 +1151,8 @@
"Subtotal": "Total", "Subtotal": "Total",
"AssetEamMapping": "Asset Eam Mapping", "AssetEamMapping": "Asset Eam Mapping",
"ItemData": "Item Data", "ItemData": "Item Data",
"GenerateJournalMergeAndTB": "Handle Journal" "GenerateJournalMergeAndTB": "Handle Journal",
"ProcessSuccess": "Process Success",
"ProcessFail": "Process Fail"
} }
\ No newline at end of file
...@@ -1204,7 +1204,9 @@ ...@@ -1204,7 +1204,9 @@
"DistributionAmount": "分配税额", "DistributionAmount": "分配税额",
"AssetEamMapping": "固资损失计算", "AssetEamMapping": "固资损失计算",
"ItemData": "条数据", "ItemData": "条数据",
"GenerateJournalMergeAndTB": "处理日记账" "GenerateJournalMergeAndTB": "处理日记账",
"ProcessSuccess": "处理成功",
"ProcessFail": "处理失败"
......
...@@ -259,12 +259,17 @@ ...@@ -259,12 +259,17 @@
}; };
var handleJournal = function () { var handleJournal = function () {
citPreviewService.initExportJMData($scope.queryParams).success(function (data, status, headers) { citPreviewService.generateTb(vatSessionService.project.id).success(function (resp) {
if(status===204){ if (resp.result) {
SweetAlert.warning("没有数据可以下载"); SweetAlert.success($translate.instant('ProcessSuccess'));
return; }else {
debugger;
if (resp.resultMsg && resp.resultMsg.length > 0) {
SweetAlert.warning(resp.resultMsg);
}else{
SweetAlert.error($translate.instant('ProcessFail'));
}
} }
vatExportService.exportToExcel(data, status, headers, '日记账信息.xlsx');
}).error(function () { }).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator')); SweetAlert.error($translate.instant('PleaseContactAdministrator'));
}); });
...@@ -370,11 +375,11 @@ ...@@ -370,11 +375,11 @@
$scope.queryParams.periodStart = vatSessionService.year * 100 + vatSessionService.month; $scope.queryParams.periodStart = vatSessionService.year * 100 + vatSessionService.month;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + 12; $scope.queryParams.periodEnd = vatSessionService.year * 100 + 12;
$scope.queryParams.organizationId = vatSessionService.project.organizationID; $scope.queryParams.organizationId = vatSessionService.project.organizationID;
if($rootScope.currentLanguage === 'en-us'){ // if($rootScope.currentLanguage === 'en-us'){
$('.periodInput')[0].style.left = "280px"; // $('.periodInput')[0].style.left = "280px";
}else{ // }else{
$('.periodInput')[0].style.left = "250px"; // $('.periodInput')[0].style.left = "250px";
} // }
loadJournalEntryDataFromDB(1); loadJournalEntryDataFromDB(1);
})(); })();
} }
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<span translate="JournalTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp; <span translate="JournalTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;
<span class="text-bold" translate="AccountPeriod"></span> <span class="text-bold" translate="AccountPeriod"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;" id="input-invoice-period-picker" /> <input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;" id="input-invoice-period-picker" />
<button translate="GenerateJournalMergeAndTB" ng-click="handleJournal()"></button> <span ng-click="handleJournal()" style="position: relative; left: 90%; top: -61px; cursor: pointer">{{'GenerateJournalMergeAndTB' | translate}}</span>&nbsp;&nbsp;
<span ng-click="downloadJE()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span> <span ng-click="downloadJE()" style="position: relative; left: 90%; top: -61px; cursor: pointer"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div> </div>
<!--<div style="margin-bottom: 8px;margin-left: 30px">--> <!--<div style="margin-bottom: 8px;margin-left: 30px">-->
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</span> </span>
</div> </div>
<div id="mainAreaDiv" class="main-area"> <div id="mainAreaDiv" class="main-area" style="padding-top: 10px">
<div class="inputInvoiceGrid" ui-grid="gridOptions"> <div class="inputInvoiceGrid" ui-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span></div> <div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span></div>
</div> </div>
......
...@@ -4,6 +4,57 @@ ...@@ -4,6 +4,57 @@
background-color: white; background-color: white;
height: 100%; height: 100%;
.row {
margin-left: 0px;
margin-bottom:10px;
&>span {
float: right;
margin-right: 15px;
cursor: pointer;
}
}
.nav-wrapper {
padding-bottom: 10px;
border-bottom: 1px solid #DBD8D3;
.nav-header {
height: 54px;
line-height: 54px;
font-family: "Microsoft YaHei Bold", "Microsoft YaHei Regular", "Microsoft YaHei";
font-weight: 700;
font-style: normal;
font-size: 15px;
color: #333;
}
.nav-tab {
/*display: inline-block;*/
span {
display: inline-block;
height: 34px;
width: 80px;
text-align: center;
line-height: 34px;
padding: 0 10px;
background-color: #B90808;
color: #FFF;
font-family: "Microsoft YaHei";
font-weight: 400;
font-style: normal;
font-size: 14px;
cursor: pointer;
}
.active {
background-color: #F91000;
}
}
}
.numAmount { .numAmount {
padding: 0 3px; padding: 0 3px;
height: 21px; height: 21px;
...@@ -164,3 +215,6 @@ ...@@ -164,3 +215,6 @@
width: 217px; width: 217px;
} }
} }
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<span translate="TrialBalanceGeneVer" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp; <span translate="TrialBalanceGeneVer" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;
<span class="text-bold" translate="InvoiceQJ" style="display: none"></span> <span class="text-bold" translate="InvoiceQJ" style="display: none"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;display: none;" id="input-invoice-period-picker" /> <input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;display: none;" id="input-invoice-period-picker" />
<span ng-click="downloadJE()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span> <span ng-click="downloadJE()" style="position: relative; left: 85%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div> </div>
<!--<div style="margin-bottom: 8px;margin-left: 30px">--> <!--<div style="margin-bottom: 8px;margin-left: 30px">-->
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<span translate="TrialBalanceMappingVer" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp; <span translate="TrialBalanceMappingVer" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;
<span class="text-bold" translate="InvoiceQJ" style="display: none"></span> <span class="text-bold" translate="InvoiceQJ" style="display: none"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;display: none" id="input-invoice-period-picker" /> <input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;display: none" id="input-invoice-period-picker" />
<span ng-click="downloadJE()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span> <span ng-click="downloadJE()" style="position: relative; left: 80%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div> </div>
<!--<div style="margin-bottom: 8px;margin-left: 30px">--> <!--<div style="margin-bottom: 8px;margin-left: 30px">-->
......
...@@ -23,6 +23,9 @@ webservices.factory('citPreviewService', ['$http', 'apiConfig','FileSaver', func ...@@ -23,6 +23,9 @@ webservices.factory('citPreviewService', ['$http', 'apiConfig','FileSaver', func
initExportJMData: function (citJournalAdjustDto) { initExportJMData: function (citJournalAdjustDto) {
return $http.post('/citDataPreview/exportJournalMergeData', citJournalAdjustDto, apiConfig.create({ responseType: 'arraybuffer' })); return $http.post('/citDataPreview/exportJournalMergeData', citJournalAdjustDto, apiConfig.create({ responseType: 'arraybuffer' }));
}, },
generateTb: function (projectId) {
return $http.post('/citImport/generateTb', {projectId : projectId}, apiConfig.create());
},
/** /**
根据条件获取试算平衡表生成版 根据条件获取试算平衡表生成版
*/ */
......
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