Commit df8996da authored by kevin's avatar kevin

#数据穿透

parent 86a8faee
......@@ -5,9 +5,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dao.CitJournalEntryAdjustMapper;
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.vat.dao.JournalEntryMapper;
import pwc.taxtech.atms.vat.entity.CellComment;
import pwc.taxtech.atms.vat.entity.PeriodCellComment;
import pwc.taxtech.atms.vat.service.impl.CellCommentServiceImpl;
......@@ -32,6 +35,8 @@ public class CellCommentController {
}
@Autowired
private CitTbamMapper citTbamMapper;
@Autowired
private CitJournalEntryAdjustMapper citJournalEntryAdjustMapper;
@Autowired
private JdbcTemplate jdbcTemplate;
......@@ -40,8 +45,22 @@ public class CellCommentController {
@RequestMapping(value = "getCellInformation")
public OperationResultDto getCellInformation(String sql){
OperationResultDto operationResultDto = new OperationResultDto();
operationResultDto.setResultMsg("success");
int from = sql.indexOf("from");
sql = sql.substring(from);
operationResultDto.setData(citTbamMapper.selectBySql(sql));
operationResultDto.setResultMsg("success");
return operationResultDto;
}
//加载分录表格数据
@RequestMapping("loadEntryListDataList")
public OperationResultDto loadEntryListDataList(String code){
OperationResultDto operationResultDto = new OperationResultDto();
CitJournalEntryAdjust citJournalEntryAdjust = new CitJournalEntryAdjust();
citJournalEntryAdjust.setSubjectCode(code);
List<CitJournalEntryAdjust> journalMerge = citJournalEntryAdjustMapper.getJournalMerge(citJournalEntryAdjust);
operationResultDto.setData(journalMerge);
operationResultDto.setResultMsg("success");
return operationResultDto;
}
}
......@@ -350,7 +350,7 @@
and org_code = #{orgCode,jdbcType=VARCHAR}
</if>
<if test="subjectCode != null">
and subject_code = #{record.subjectCode,jdbcType=VARCHAR}
and subject_code = #{subjectCode,jdbcType=VARCHAR}
</if>
<if test="orgName != null">
and org_name = #{orgName,jdbcType=VARCHAR}
......
......@@ -2,89 +2,102 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.CitTbamMapper">
<insert id="insertBatch" parameterType="java.util.List">
insert into cit_tbam
(<include refid="Base_Column_List"/>)
values
<foreach collection="list" item="item" index="index" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<choose>
<when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.date != null">#{item.date,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.accountPeriod != null">#{item.accountPeriod,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.attribute != null">#{item.attribute,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.accountCode != null">#{item.accountCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.accountDescription != null">#{item.accountDescription,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.debitAmount != null">#{item.debitAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.creditAmount != null">#{item.creditAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.beginningBalance != null">#{item.beginningBalance,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.endingBalance != null">#{item.endingBalance,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.createBy != null">#{item.createBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
</trim>
</foreach>;
SELECT 1 FROM DUAL;
</insert>
<insert id="insertBatch" parameterType="java.util.List">
insert into cit_tbam
(<include refid="Base_Column_List"/>)
values
<foreach collection="list" item="item" index="index" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<choose>
<when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.date != null">#{item.date,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.accountPeriod != null">#{item.accountPeriod,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.attribute != null">#{item.attribute,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.accountCode != null">#{item.accountCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.accountDescription != null">#{item.accountDescription,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.debitAmount != null">#{item.debitAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.creditAmount != null">#{item.creditAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.beginningBalance != null">#{item.beginningBalance,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.endingBalance != null">#{item.endingBalance,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.createBy != null">#{item.createBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
</trim>
</foreach>
;
SELECT 1 FROM DUAL;
</insert>
<select id ="selectBySql" parameterType="java.lang.String" resultType="pwc.taxtech.atms.dpo.CitTbamDto">
<if test ="sql != null and sql != '' ">
${sql}
</if>
</select>
<select id="selectBySql" parameterType="java.lang.String" resultType="pwc.taxtech.atms.dpo.CitTbamDto">
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
<if test="sql != null and sql != '' ">
${sql}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -1178,10 +1178,11 @@
"remitTime" : "汇款时间",
"remitAmount" : "汇款金额",
"gatheringCompanyName" : "收款公司名称",
"gatheringCompanyAccount":"收款公司账号"
"gatheringCompanyAccount":"收款公司账号",
"checkBox": "勾选",
"QMYETotalFirst" : "期末余额合计(借-贷)",
"QMYETotalend" : "期末余额合计(贷-借)",
"Backfill any adjusted total value back to the adjusted amount" : "单选任意合计值回填至调整后金额",
"BackAdjustAmount" : "调整后金额"
}
\ No newline at end of file
......@@ -24,12 +24,13 @@
</cit-report-sheet>
</div>
<cell-detail-panel detail="cellDetail" id="cell-detail" source-type="isBSPLSpecial"></cell-detail-panel>
<tax-report-cell-detail-modal on-confirm="confirm()" detail="taxCellDetail" id="tax-cell-detail" active-sheet = "activeSheet"
<cit-tax-report-cell-detail-modal on-confirm="confirm()" detail="taxCellDetail" id="tax-cell-detail" active-sheet = "activeSheet"
<!--service-type="serviceType"
on-update-data-source="updateCellByManualChange(manualData)"
on-delete-data-source="updateCellByManualSourceDelete(dataSourceId, cellId)"
on-delete-data-source-detail="updateCellBySourceDetailDelete(dataSource, detailId, opType)"-->>
</tax-report-cell-detail-modal>
</cit-tax-report-cell-detail-modal>
<vat-operate-log period="period" module-type="moduleid" is-show="isShowLog"></vat-operate-log>
<div class='export-container hidden'></div>
<div id="export" class="hidden"></div>
......
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',
function ($log, apiInterceptor, Upload, $scope, $q, $translate, $uibModal, $document, $rootScope, SweetAlert, enums, vatReportService, loginContext,
vatSessionService, stdAccountService, vatCommonService, formulaService, KeyValueConfigService, modelConfigurationService, $timeout, cellCommentService, modifiedReportCellService) {
var entityInit = function () {
//初始化值
$scope.entry = {
JFFSETotal: "",
DFFSETotal: "",
QMYETotalFirst: "",
QMYETotalend: ""
}
}
entityInit();
$scope.dataGridOptions = {
bindingOptions: {
columns: 'entryListColumns',
dataSource: 'relObj.entryDataSource'
},
loadPanel: {
enabled: false
},
scrolling: {
mode: "standard"
},
selection: {
mode: "multiple"
},
sorting: {
mode: 'single'
},
filterRow: {
visible: true
},
searchPanel: {
visible: true,
width: 240,
placeholder: $translate.instant('SearchPlaceholder')
},
onSelectionChanged: function (selectedItems) {
/* $scope.selectedItems = $.map(selectedItems.selectedRowsData, function (data) {
$scope.selectedAddDatasourceItems = selectedItems.selectedRowsData;
return data.id;
});
$log.debug($scope.selectedItems);*/
$scope.doCalcute(selectedItems.selectedRowsData);
},
allowColumnResizing: true,
hoverStateEnabled: true,
showBorders: true,
showRowLines: true,
showColumnLines: true,
};
//设置数据源表格的列
var getEntryListColumns = function () {
var dataGridColumns;
dataGridColumns = [
{
dataField: 'index',
caption: $translate.instant('ImportErrorPopUpNoCol'),
alignment: 'center'
},
{
dataField: 'accountingDate',
caption: $translate.instant('JournalPZRQ'),
alignment: 'left',
dataType: 'date',
customizeText: function (cellInfo) {
if (cellInfo && cellInfo.value) {
return new Date(cellInfo.value).dateTimeToString('yyyyMMdd');
}
return "";
}
},
{
dataField: 'voucherNum',
caption: $translate.instant('AccountVoucher_DataGrid_ColVID'),
alignment: 'center'
},
{
dataField: 'description',
caption: $translate.instant('JournalZY'),
alignment: 'center'
},
{
dataField: 'accountedDr',//借方发生额
caption: $translate.instant('DebitAmount'),
alignment: 'right'
},
{
dataField: 'accountedCr',//贷方发生额
caption: $translate.instant('CreditAmount'),
alignment: 'right'
},
];
return dataGridColumns;
};
$scope.entryListColumns = getEntryListColumns();
//确定
$scope.makeSure = function () {
$scope.relObj.checkRadio = $scope.checkRadio;
$('#entryListModal').modal('hide');
}
$scope.cancel = function () {
$('#entryListModal').modal('hide');
entityInit();
}
$scope.hideCellAttachmentModel = function () {
$('#entryListModal').modal('hide');
}
//
//配置计算公式进行计算
$scope.doCalcute = function (data) {
debugger;
var v1 = 0;//借方发生额合计
var v2 = 0//贷方发生额合计
var _index = 0;
data.forEach(function (item) {
if (_index == 0) {
v1 = parseFloat(item.accountedDr);
v2 = parseFloat(item.accountedCr);
} else {
v1 += v1 + parseFloat(item.accountedDr);
v2 += v2 + parseFloat(item.accountedCr);
}
});
$scope.entry.JFFSETotal = v1;
$scope.entry.DFFSETotal = v2;
$scope.entry.QMYETotalFirst = v2 - v1;
$scope.entry.QMYETotalend = v1 - v2;
}
$scope.showLog = function () {
alert('查看日志');
}
}
]);
\ No newline at end of file
<div class="modal fade" id="entryListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-lg" style="width: 1200px;" >
<div class="modal-content">
<div class="modal-header">
<span class="close" data-dismiss="modal" aria-hidden="true"
ng-click="hideCellAttachmentModel()">×</span>
<h4 class="modal-title" translate="AccountVoucher_AccountVoucher"></h4>
</div>
<div class="row" style="margin-top: 10px;">
<div class="col-sm-8">
<span translate="EntempriseAccount"></span>
<input type="text" readonly ng-model="relObj.account"><!--会计科目-->
</div>
<div class="col-sm-4">
<div class="row">
<div class="menu-log" style="display: inline-block">
<a class="btn btn-not-important" href="javascript:void(0)" ng-click="showLog()"> <i class="material-icons" style = "margin-bottom: 9px;">description</i><span>日志</span></a>
</div>
<div class="button" style="display: inline-block">
<button type="button" class="btn btn-primary" ng-click="makeSure()">确定</button>
<button type="button" class="btn btn-third" ng-click="cancel()">取消</button>
</div>
</div>
</div>
</div>
<div class="dx-viewport">
<div id="dataSourceGrid" dx-data-grid="dataGridOptions"></div>
</div>
<div class="row backColor" style="margin-right: 0px;">
<div class="col-sm-3 ">
<input type="radio" name ="checkRadio" ng-model = "checkRadio" ng-value="entry.JFFSETotal" > <h4 translate="JFFSETotal"></h4>:{{entry.JFFSETotal}}
</div>
<div class="col-sm-3 ">
<span><input type="radio" name ="checkRadio" ng-model = "checkRadio" ng-value="entry.DFFSETotal" > <h4 translate="DFFSETotal"></h4>:{{entry.DFFSETotal}}</span>
</div>
<div class="col-sm-3 ">
<input type="radio" name ="checkRadio" ng-model = "checkRadio" ng-value="entry.QMYETotalFirst" > <h4 translate="QMYETotalFirst"></h4>:{{entry.QMYETotalFirst}}
</div>
<div class="col-sm-3 ">
<input type="radio" name ="checkRadio" ng-model = "checkRadio" ng-value="entry.QMYETotalend" > <h4 translate="QMYETotalend"></h4>:{{entry.QMYETotalend}}
</div>
</div>
<div class="row">
<div class="col-sm-6">
<span translate="Backfill any adjusted total value back to the adjusted amount"></span>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
citModule.directive('entryListModal', ['$log',
function ($log) {
return {
restrict: 'E',
templateUrl: '/app/cit/report/entryList-modal/entryList-modal.html' + '?_=' + Math.random(),
scope: {
relObj : '='
},
controller: 'entryListModalController',
link: function ($scope, $element, $attr) {
}
}
}]);
\ No newline at end of file
@small-panel-height: 40px;
@small-panel-margin: 10px;
@small-panel-border-color: #E4E4E4;
@tab-not-selected: #bababa;
@focus: #c00;
@btn-color: white;
@btn-not-focus: #777;
#entryListModal{
.backColor{
background-color: #a09595b3;
}
.backColor{
h4 {
display: inline-block;
}
}
}
\ No newline at end of file
<div class="add-voucher-range-propover">
<div class="propover-header">
<span class="left-title">{{'VoucherRange' | translate}}</span>
<span ng-click="closePropover();" class="right-close-btn">x</span>
</div>
<div class="propover-content">
<div class="filter-way-pan">
<input type="radio" name="filter-name" ng-model="voucherRange.filterWay" value="1" />科目
&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="filter-name" ng-model="voucherRange.filterWay" value="2" />摘要
</div>
<div class="add-account-content" ng-show="voucherRange.filterWay!=2">
<div class="add-voucher-range-btn" ng-click="showSelectAccountPop();">
<i class="material-icons add-icon">add_circle</i>{{'AddAccount' | translate}}
</div>
<div dx-data-grid="voucherRangeOptions"></div>
</div>
<div class="add-remark-content" ng-show="voucherRange.filterWay==2">
<input type="text" ng-model="voucherRange.voucherKeyword" placeholder="请输入摘要关键词" />
</div>
</div>
<div class="propover-footer">
<button ng-click="voucherRangeConfirm();" class="btn btn-default btn-focus">{{'Confirm' | translate}}</button>
<button ng-click="closePropover();" class="btn btn-default btn-second">{{'ButtonCancel' | translate}}</button>
</div>
</div>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
citModule.directive('citTaxReportCellDetailModal', ['$log',
function ($log) {
return {
restrict: 'E',
templateUrl: '/app/cit/report/tax-report-cell-detail-modal/tax-report-cell-detail-modal.html' + '?_=' + Math.random(),
scope: {
detail: '=',
onConfirm: '&',
activeSheet : '='
},
controller: 'citTaxReportCellDetailModalController',
link: function ($scope, $element, $attr) {
$("#taxReportCellDetailModal").resizable({
minHeight: 700,
maxHeight: 700,
minWidth: 650
});
$($element).draggable({
scroll: true,
cancel: '#dataSourceGrid,.hand-input-container,.add-voucher-range-propover,.add-invoice,.tab-type,.dx-texteditor-input,input,.btn,#remark-input-textarea,.tax-report-analyze-report'
});
}
}
}]);
\ No newline at end of file
......@@ -884,6 +884,8 @@
onInitialized: function (e) {
dxDataGridService.registerRowDbClick(e.component);
},
onRowDbClick: function (e) {
$scope.vouchersAndEntriesModal.openModal(e, 2);
}
......
......@@ -277,7 +277,7 @@
<div class="attach-upload" ng-show="tabType===5" style="">
<button style="margin-bottom:20px;" class="btn btn-primary" ng-click="openAddCellAttachmentDialog();">上传文档
<button style="margin-bottom:20px;margin-left: 24px;" class="btn btn-primary" ng-click="openAddCellAttachmentDialog();">上传文档
</button>
<div class="dt-init-wrapper">
<div id="cellAttachmentDataGrid" dx-data-grid="cellAttachmentDataGirdOptions"
......
......@@ -11,8 +11,11 @@ webservices.factory('cellCommentService', ['$http', 'apiConfig', function ($http
deleteCellComment: function (commentId) {
return $http.post('/CellComment/Delete/' + commentId, {}, apiConfig.createVat());
},
getCellInformation: function(data){
getCellInformation: function (data) {
return $http.get('/CellComment/getCellInformation?sql=' + data.relSql, apiConfig.createVat());
},
loadEntryListDataList: function (code) {
return $http.get('/CellComment/loadEntryListDataList?code=' + code, 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