Commit cc25f5ca authored by kevin's avatar kevin

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

# Conflicts:
#	atms-web/src/main/webapp/app/common/webservices/common.svc.js
parent 2e1c2f4b
......@@ -494,12 +494,20 @@
<targetPath>${basedir}/target/classes/userTemplate</targetPath>
</resource>
<resource>
<directory>src/main/resources/vat_excel_template</directory>
<directory>src/main/resources/vat_excel_template</directory>
<includes>
<include>**/*.xls</include>
<include>**/*.xlsx</include>
</includes>
<targetPath>${basedir}/target/classes/vat_excel_template</targetPath>
</resource>
<resource>
<directory>src/main/resources/cit_excel_template</directory>
<includes>
<include>**/*.xls</include>
<include>**/*.xlsx</include>
</includes>
<targetPath>${basedir}/target/classes/vat_excel_template</targetPath>
<targetPath>${basedir}/target/classes/cit_excel_template</targetPath>
</resource>
</resources>
<plugins>
......
......@@ -9,17 +9,16 @@ import org.jxls.expression.JexlExpressionEvaluator;
import org.jxls.transform.Transformer;
import org.jxls.transform.poi.WritableCellValue;
import org.jxls.transform.poi.WritableHyperlink;
import org.jxls.util.JxlsHelper;
import org.jxls.util.TransformerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import pwc.taxtech.atms.dto.export.ExportDto;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.*;
/**
......@@ -46,9 +45,18 @@ public class JxlsUtils {
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static <T> void export(ExportDto exportDto){
toPackageOs(exportDto.getResponse(), exportDto.getFileName());
try {
exportExcel(exportDto.getList(), exportDto.getResponse().getOutputStream(), toPackageIn(exportDto.getTemplateUrl()), exportDto.getRelation());
} catch (IOException e) {
e.printStackTrace();
}
}
public static <T> void exportExcel(List<T> list, ServletOutputStream os ,
InputStream in, Object relation ){
......@@ -85,6 +93,8 @@ public class JxlsUtils {
os.close();
in.close();
long endExcel = System.currentTimeMillis();
log.warn("exportExcel begin: " + endExcel);
} catch (IOException e) {
e.printStackTrace();
}
......
......@@ -34,9 +34,10 @@ public final class Constant {
public static final String FILE_NAME = "filename";
public static final String TEMP_FILE_NAME = "tempFileName";
public static final String exportTemplateUrl = "vat_excel_template";
public static final String vatTemplateUrl = "vat_excel_template";
public static final String citTemplateUrl = "cit_excel_template";
public static final boolean DEFAULT_RESULT = true;
public static final int FIRST_OR_DEFAULT = 0;
......
......@@ -6,6 +6,8 @@ import pwc.taxtech.atms.entity.CitSalaryAdvance;
public class CitSalaryDataDto extends CitSalaryAdvance {
private CamelPagingDto pageInfo;
private Integer periodEnd;
private Integer periodStart;
public CamelPagingDto getPageInfo() {
return this.pageInfo;
......@@ -14,4 +16,21 @@ public class CitSalaryDataDto extends CitSalaryAdvance {
public void setPageInfo(CamelPagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
}
......@@ -9,32 +9,15 @@ import pwc.taxtech.atms.common.util.JxlsUtils;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dao.CitEAMAssetsDisposalMapper;
import pwc.taxtech.atms.dao.CitSalaryAdvanceMapper;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.export.ExportDto;
import pwc.taxtech.atms.dto.previewData.CitEAMAssetsDisposalDto;
import pwc.taxtech.atms.dto.previewData.CitEAMAssetsDisposalExport;
import pwc.taxtech.atms.dto.previewData.CitSalaryDataDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam;
import pwc.taxtech.atms.dto.vatdto.dd.BalanceSheetDto;
import pwc.taxtech.atms.dto.vatdto.dd.TrialBalanceExportDto;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposal;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposalExample;
import pwc.taxtech.atms.entity.CitSalaryAdvance;
import pwc.taxtech.atms.entity.CitSalaryAdvanceExample;
import pwc.taxtech.atms.thirdparty.ExcelUtil;
import pwc.taxtech.atms.vat.dpo.TrialBalanceCondition;
import pwc.taxtech.atms.vat.entity.TrialBalance;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import static pwc.taxtech.atms.common.util.SpringContextUtil.trialBalanceMapper;
import java.util.*;
@Service
public class CitPreviewDataServiceImpl extends BaseService {
......@@ -47,6 +30,23 @@ public class CitPreviewDataServiceImpl extends BaseService {
if(!"".equals(citSalaryDataDto.getPoSubjectName()) && citSalaryDataDto.getPoSubjectName() != null){//根据PO主体名称进行查询
criteria.andPoSubjectNameEqualTo(citSalaryDataDto.getPoSubjectName());
}
Integer periodStart = null;
Integer periodEnd = null;
if(citSalaryDataDto.getPeriodStart() != null && !"".equals(citSalaryDataDto.getPeriodStart())){
periodStart = citSalaryDataDto.getPeriodStart();
}
if(citSalaryDataDto.getPeriodEnd() != null &&!"".equals(citSalaryDataDto.getPeriodEnd())){
periodEnd = citSalaryDataDto.getPeriodEnd();
}
if(periodEnd != null && periodStart!= null){
criteria.andPeriodBetween(periodStart, periodEnd);
}
if(periodStart == null && periodEnd!= null){
criteria.andPeriodLessThanOrEqualTo(periodEnd);
}
if(periodStart != null && periodEnd == null ){
criteria.andPeriodGreaterThanOrEqualTo(periodStart);
}
Page page = PageHelper.startPage(citSalaryDataDto.getPageInfo().getPageIndex(), citSalaryDataDto.getPageInfo().getPageSize());
List<CitSalaryAdvance> citSalaryAdvances = citSalaryAdvanceMapper.selectByExample(example);
PageInfo<CitSalaryAdvance> pageInfo =new PageInfo<CitSalaryAdvance>(citSalaryAdvances);
......@@ -138,46 +138,29 @@ public class CitPreviewDataServiceImpl extends BaseService {
if(list.size()==0){
return 0;
}
String EXPORT_XLSX_CONFIG = Constant.exportTemplateUrl + "/eamDispoal.xlsx";
String EXPORT_XLSX_FILENAME = "资产处置金额";
ServletOutputStream out = null;
InputStream in = null;
try {
out = response.getOutputStream();
} catch (IOException e) {
e.printStackTrace();
}
JxlsUtils.toPackageOs(response, EXPORT_XLSX_FILENAME);
in = JxlsUtils.toPackageIn(EXPORT_XLSX_CONFIG);
JxlsUtils.exportExcel(list, out, in, null);
ExportDto exportDto = new ExportDto();
exportDto.setFileName("EAM资产处置金额");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/eamDispoal.xlsx");
exportDto.setResponse(response);
exportDto.setList(list);
exportDto.setRelation(null);
JxlsUtils.export(exportDto);
return 1;
}
public int exportDataSalaryAdvance(CitEAMAssetsDisposalDto citEAMAssetsDisposalDto, HttpServletResponse response) {
//第二种导出方式
CitEAMAssetsDisposalExample example = new CitEAMAssetsDisposalExample();
List<CitEAMAssetsDisposal> list = citEAMAssetsDisposalMapper.selectByCondition(citEAMAssetsDisposalDto);
if(list.size()==0){
return 0;
}
String EXPORT_XLSX_CONFIG = Constant.exportTemplateUrl + "/eamDispoal.xlsx";
String EXPORT_XLSX_FILENAME = "资产处置金额";
ServletOutputStream out = null;
InputStream in = null;
try {
out = response.getOutputStream();
} catch (IOException e) {
e.printStackTrace();
}
JxlsUtils.toPackageOs(response, EXPORT_XLSX_FILENAME);
in = JxlsUtils.toPackageIn(EXPORT_XLSX_CONFIG);
JxlsUtils.exportExcel(list, out, in, null);
ExportDto exportDto = new ExportDto();
exportDto.setFileName("预提重分类数据源");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/salaryAdvance.xlsx");
exportDto.setResponse(response);
exportDto.setList(list);
exportDto.setRelation(null);
JxlsUtils.export(exportDto);
return 1;
}
}
......@@ -10,7 +10,6 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.OrgKV;
import pwc.taxtech.atms.common.message.LogMessage;
......
......@@ -7,6 +7,7 @@ import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposal;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposalExample;
import pwc.taxtech.atms.entity.CitSalaryAdvance;
@Mapper
public interface CitEAMAssetsDisposalMapper extends MyMapper {
......@@ -109,4 +110,5 @@ public interface CitEAMAssetsDisposalMapper extends MyMapper {
int insertBatch(List<CitEAMAssetsDisposal> citEAMAssetsDisposalList);
List<CitEAMAssetsDisposal> selectByCondition(@Param("citEAMAssetsDisposal") CitEAMAssetsDisposal citEAMAssetsDisposal);
List<CitSalaryAdvance> selectByCondition(@Param("citPreviewSalaryAdvance") CitSalaryAdvance citEAMAssetsDisposal);
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.CitSalaryAdvanceMapper">
<sql id="QueryCondition">
1 = 1
<!-- <if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(citEAMAssetsDisposal.period)">
AND period= #{citEAMAssetsDisposal.period,jdbcType=VARCHAR}
</if>-->
<if test="citPreviewSalaryAdvance.compensationSaleAmount!=null and citPreviewSalaryAdvance.compensationSaleAmount != '' ">
AND compensation_sale_amount &gt;= #{citEAMAssetsDisposal.compensationSaleAmount,jdbcType=INTEGER}
</if>
<if test="citPreviewSalaryAdvance.assetLabelNumber!=null and citPreviewSalaryAdvance.assetLabelNumber!='' ">
AND asset_label_number &lt;= #{citEAMAssetsDisposal.assetLabelNumber,jdbcType=INTEGER}
</if>
<if test="citPreviewSalaryAdvance.periodStart!=null and citPreviewSalaryAdvance.periodStart!= '' and citPreviewSalaryAdvance.periodEnd!= null and citPreviewSalaryAdvance.periodEnd!= ''">
AND period between ${citEAMAssetsDisposal.periodStart} and ${citEAMAssetsDisposal.periodEnd}
</if>
<if test="citEAMAssetsDisposal.periodStart == null and citEAMAssetsDisposal.periodStart != '' and citEAMAssetsDisposal.periodEnd != null and citEAMAssetsDisposal.periodEnd != ''">
AND period &lt; ${citEAMAssetsDisposal.periodEnd} or period = ${citEAMAssetsDisposal.periodEnd}
</if>
<if test="citEAMAssetsDisposal.periodStart != null and citEAMAssetsDisposal.periodStart != '' and citEAMAssetsDisposal.periodEnd == null and citEAMAssetsDisposal.periodEnd != '' ">
AND period &gt; ${citEAMAssetsDisposal.periodStart} or period = ${citEAMAssetsDisposal.periodStart}
</if>
</sql>
<insert id="insertBatch" parameterType="java.util.List">
insert into cit_salary_advance
......@@ -69,4 +90,12 @@
SELECT 1 FROM DUAL;
</insert>
<select id ="selectByCondition" parameterType="pwc.taxtech.atms.entity.CitSalaryAdvance" resultType="pwc.taxtech.atms.entity.CitSalaryAdvance">
select
*
WHERE
<include refid="QueryCondition"/>
</select>
</mapper>
\ No newline at end of file
......@@ -24,32 +24,6 @@
$translate.instant('Month11'),
$translate.instant('Month12')
];
/* $scope.formOptions = {
formData: salaryData,
colCount: 2,
items: [{
dataField: "FirstName",
editorOptions: {
value: ""
}
},
{
itemType: "button",
horizontalAlignment: "left",
buttonOptions: {
text: "查询",
type: "success",
useSubmitBehavior: true
}
}]
};*/
/* $scope.onFormSubmit = function(e) {//执行查询
e.preventDefault();
};*/
//初始化dx控件
function initAssetResultDxGrid() {
var dupColumns = [
......@@ -69,7 +43,7 @@
},
editing: {
mode: "batch",
allowUpdating:true,
allowUpdating:false,
},
onInitialized: function (e) {
$scope.dataGridInstance = e.component;
......@@ -99,10 +73,10 @@
},
onRowUpdating: function (e) {
},
}/*,
onToolbarPreparing: function (e) {
}
}*/
}
}
......@@ -180,14 +154,6 @@
$scope.queryParams.periodStart = commonWebService._dateByPicker(start, end).start;
//结束月份
$scope.queryParams.periodEnd = commonWebService._dateByPicker(start, end).end;
/* $scope.startMonth = startMonth;
$scope.endMonth = endMonth;*/
/*$scope.queryParams.periodStart = vatSessionService.year * 100 + vatSessionService.month;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + vatSessionService.month;*/
// countTotal();
//$scope.queryParams.organizationId = vatSessionService.project.organizationID;
alert($scope.queryParams.periodStart + "---------------"+ $scope.queryParams.periodEnd);
$scope.refreshConfigGrid();
// loadCertifiedInvoicesListDataFromDB(1);
});
......@@ -199,9 +165,6 @@
totalItems: 0, //总数据
pageSize: 20, //每页多少条数据
};
/* $scope.$watch('queryParams.pagingOptions',function (newValue, oldValue) {
$scope.pagingOptions = newValue;
});*/
initAssetResultDxGrid();
initListData();
......
citModule.controller('citPreviewSalaryAdvanceController', ['$scope', '$log', '$translate', '$timeout', '$compile', '$uibModal', 'apiInterceptor',
'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatSessionService', 'citSessionService', 'vatImportService', 'loginContext',
'browserService', 'enums', 'vatOperationLogService', 'citPreviewDataService', 'vatCommonService', 'ackMessageBox','commonWebService',
'browserService', 'enums', 'vatOperationLogService', 'citPreviewDataService', 'vatCommonService', 'ackMessageBox','commonWebService','vatExportService',
function ($scope, $log, $translate, $timeout, $compile, $uibModal, apiInterceptor, SweetAlert, $q, uiGridConstants,
$interval, vatSessionService, citSessionService, vatImportService, loginContext, browserService, enums, vatOperationLogService, citPreviewDataService,
vatCommonService, ackMessageBox, commonWebService) {
vatCommonService, ackMessageBox, commonWebService, vatExportService) {
'use strict';
$scope.listData = [];
var minDate = [1, 2010];
// var minDate = moment().startOf('month').subtract(0, 'months');
var maxDate = [12, 2019];
var setDate = [[1, 2010], [12, 2019]];
$scope.monthList = [$translate.instant('Month01'),
$translate.instant('Month02'),
$translate.instant('Month03'),
$translate.instant('Month04'),
$translate.instant('Month05'),
$translate.instant('Month06'),
$translate.instant('Month07'),
$translate.instant('Month08'),
$translate.instant('Month09'),
$translate.instant('Month10'),
$translate.instant('Month11'),
$translate.instant('Month12')
];
//初始化dx控件
function initAssetResultDxGrid() {
var dupColumns = [
......@@ -29,7 +48,7 @@
},
editing: {
mode: "batch",
allowUpdating:true,
allowUpdating:false,
},
onInitialized: function (e) {
$scope.dataGridInstance = e.component;
......@@ -94,7 +113,7 @@
citPreviewDataService.getCitPreviewSalaryAdvanceDataList($scope).success(function (res) {
$scope.listData = commonWebService._index(res.list);
$scope.pagingOptions.totalItems = res.pageInfo.totalCount;
$scope.queryParams.pagingOptions.totalItems = res.pageInfo.totalCount;
//$scope.$apply();
}).error(function (error) {
swal({
......@@ -108,11 +127,11 @@
//刷新页面
$scope.refreshConfigGrid = function () {
citPreviewDataService.getCitPreviewSalaryAdvanceDataList($scope)
citPreviewDataService.getCitPreviewSalaryAdvanceDataList($scope.queryParams)
.success(function (res) {
if (res && res.list) {
$scope.listData =commonWebService._index(res.list);
$scope.pagingOptions.totalItems = res.pageInfo.totalCount;
$scope.queryParams.pagingOptions.totalItems = res.pageInfo.totalCount;
}else {
SweetAlert.error($translate.instant('SystemError'));
}
......@@ -122,9 +141,30 @@
//开始
(function initialize() {
$('#input-invoice-period-picker').focus(function () {
$('.filter-button').popover("hide");
});
//初始化month-picker
$('#input-invoice-period-picker').rangePicker({
minDate: minDate,
maxDate: maxDate,
setDate: setDate,
months: $scope.monthList,//['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
ConfirmBtnText: $translate.instant('Confirm'),
CancelBtnText: $translate.instant('ButtonCancel')
}) .on('datePicker.done', function (e, result) {
//对日期进行封装
var start = result[0][1].toString() + result[0][0];
var end =result[1][1].toString() + result[1][0];
commonWebService._dateByPicker(start, end);//转换日期
//开始月份
$scope.queryParams.periodStart = commonWebService._dateByPicker(start, end).start;
//结束月份
$scope.queryParams.periodEnd = commonWebService._dateByPicker(start, end).end;
$scope.refreshConfigGrid();
});
//分页的设置
$scope.pagingOptions = {
$scope.queryParams.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 20, //每页多少条数据
......
......@@ -8,13 +8,10 @@
data-templateurl="app/cit/preview/cit-preview-salaryAdvance-list/vat-preview-salaryAdvance-search.html">
<i class="fa fa-filter" aria-hidden="true"></i>
</button>
<!--<span translate="EAMDisposal" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>:-->
<!--<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px; width: 200px;" id="input-invoice-period-picker" />-->
<span ng-click="downloadTB()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
<div class="dx-viewport grid-container" style=" position: relative; top: -41px;">
<span translate="EAMDisposal" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>:-->
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px; width: 200px;" id="input-invoice-period-picker" />
<span ng-click="downloadTB()" style=" position: absolute; z-index: 99999999; top: 14px; right: 2%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
<div class="dt-init-wrapper" style=" position: relative; top: -20px;">
<div id="gridContainer" dx-data-grid="assetsResultGridOptions"></div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
......
......@@ -4,7 +4,7 @@ webservices.factory('citPreviewDataService', ['$http', 'apiConfig', function ($h
return {
//获取 预提分类数据源列表数据
getCitPreviewSalaryAdvanceDataList : function(params){
return $http.post('/citPreviewDataController/getSalaryAdvaceListData', {pageInfo: params.pagingOptions, poSubjectName : params.poSubjectName }, apiConfig.createVat());
return $http.post('/citPreviewDataController/getSalaryAdvaceListData',{pageInfo : params.pagingOptions, periodStart : params.periodStart, periodEnd : params.periodEnd, period : params.period}, apiConfig.createVat());
},
getCitPreviewEamDisposalDataList : function (params) {
return $http.post('/citPreviewDataController/getCitPreviewEamDisposalDataList', {pageInfo : params.pagingOptions, periodStart : params.periodStart, periodEnd : params.periodEnd, organizationId : params.organizationId, period : params.period, compensationSaleAmount: params.compensationSaleAmount, assetLabelNumber : params.assetLabelNumber}, apiConfig.createVat());
......
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