Commit caad06da authored by kevin's avatar kevin

Merge branch 'dev_mysql' of https://gitee.com/Memorydoc/atms into dev_mysql

parents 41515c6b c12993fb
...@@ -48,6 +48,7 @@ import pwc.taxtech.atms.vat.entity.*; ...@@ -48,6 +48,7 @@ import pwc.taxtech.atms.vat.entity.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
...@@ -962,7 +963,7 @@ public class DataImportService extends BaseService { ...@@ -962,7 +963,7 @@ public class DataImportService extends BaseService {
rlits.stream().collect(Collectors.groupingBy(RedLetterInfoTable::getSubjectNum)); rlits.stream().collect(Collectors.groupingBy(RedLetterInfoTable::getSubjectNum));
atsGroupRes.forEach((k, v) -> processRlits(k, v, orgIds, tmsPeriod, importType, dataImportLogs)); atsGroupRes.forEach((k, v) -> processRlits(k, v, orgIds, tmsPeriod, importType, dataImportLogs));
} }
if(dataImportLogs.size() == 0) if (dataImportLogs.size() == 0)
return OperationResultDto.error(ErrorMessage.NoData); return OperationResultDto.error(ErrorMessage.NoData);
addDataImportLog(dataImportLogs); addDataImportLog(dataImportLogs);
...@@ -1071,7 +1072,7 @@ public class DataImportService extends BaseService { ...@@ -1071,7 +1072,7 @@ public class DataImportService extends BaseService {
atsGroupRes.forEach((k, v) -> processAts(k, v, orgIds, tmsPeriod, importType, dataImportLogs)); atsGroupRes.forEach((k, v) -> processAts(k, v, orgIds, tmsPeriod, importType, dataImportLogs));
} }
addDataImportLog(dataImportLogs); addDataImportLog(dataImportLogs);
if(dataImportLogs.size() == 0) if (dataImportLogs.size() == 0)
return OperationResultDto.error(ErrorMessage.NoData); return OperationResultDto.error(ErrorMessage.NoData);
int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count(); int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count();
if (isSuccess < 1) { if (isSuccess < 1) {
...@@ -1177,7 +1178,7 @@ public class DataImportService extends BaseService { ...@@ -1177,7 +1178,7 @@ public class DataImportService extends BaseService {
atsGroupRes.forEach((k, v) -> processCprs(k, v, orgIds, tmsPeriod, importType, dataImportLogs)); atsGroupRes.forEach((k, v) -> processCprs(k, v, orgIds, tmsPeriod, importType, dataImportLogs));
} }
int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count(); int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count();
if(dataImportLogs.size() == 0) if (dataImportLogs.size() == 0)
return OperationResultDto.error(ErrorMessage.NoData); return OperationResultDto.error(ErrorMessage.NoData);
addDataImportLog(dataImportLogs); addDataImportLog(dataImportLogs);
...@@ -1466,7 +1467,7 @@ public class DataImportService extends BaseService { ...@@ -1466,7 +1467,7 @@ public class DataImportService extends BaseService {
irs.stream().collect(Collectors.groupingBy(InvoiceRecord::getBillingBody)); irs.stream().collect(Collectors.groupingBy(InvoiceRecord::getBillingBody));
atsGroupRes.forEach((k, v) -> processIrs(k, v, orgIds, tmsPeriod, importType, dataImportLogs)); atsGroupRes.forEach((k, v) -> processIrs(k, v, orgIds, tmsPeriod, importType, dataImportLogs));
} }
if(dataImportLogs.size() == 0) if (dataImportLogs.size() == 0)
return OperationResultDto.error(ErrorMessage.NoData); return OperationResultDto.error(ErrorMessage.NoData);
int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count(); int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count();
addDataImportLog(dataImportLogs); addDataImportLog(dataImportLogs);
...@@ -1851,7 +1852,7 @@ public class DataImportService extends BaseService { ...@@ -1851,7 +1852,7 @@ public class DataImportService extends BaseService {
private int addDataImportLog(List<DataImportLog> dataImportLogs) { private int addDataImportLog(List<DataImportLog> dataImportLogs) {
if(dataImportLogs.size() == 0) return 0; if (dataImportLogs.size() == 0) return 0;
dataImportLogMapper.displayOld(dataImportLogs.get(0).getType()); dataImportLogMapper.displayOld(dataImportLogs.get(0).getType());
int res = 0; int res = 0;
for (DataImportLog dataImportLog : dataImportLogs) { for (DataImportLog dataImportLog : dataImportLogs) {
...@@ -1899,20 +1900,28 @@ public class DataImportService extends BaseService { ...@@ -1899,20 +1900,28 @@ public class DataImportService extends BaseService {
* @author Gary J Li * @author Gary J Li
*/ */
public PageInfo<DataImportLogDto> displayImportLogAll(DataImportAllParam param) { public PageInfo<DataImportLogDto> displayImportLogAll(DataImportAllParam param) {
String startStr=param.getStartDate();
Date strDate = DateUtils.strToDate2(param.getStartDate()); Date strDate = DateUtils.strToDate2(startStr);
String endStr=param.getEndDate();
Date endDateO = DateUtils.strToDate2(endStr);
long endDateLong =endDateO.getTime()+86399000;
Date endDate=new Date(endDateLong);
/*Date strDate = DateUtils.strToDate2(param.getStartDate());
Date endDate = DateUtils.strToDate2(param.getEndDate()); Date endDate = DateUtils.strToDate2(param.getEndDate());
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
try {
strDate = format.parse(format.format(strDate) + "00:00:00");
endDate = format.parse(format.format(endDate) + "23:59:59");
} catch (ParseException e) {
e.printStackTrace();
}*/
DataImportLogExample example = new DataImportLogExample(); DataImportLogExample example = new DataImportLogExample();
DataImportLogExample.Criteria criteria = example.createCriteria(); DataImportLogExample.Criteria criteria = example.createCriteria();
Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize()); Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
List<String> orgIds = organizationService.getMyOrgList().stream().map(OrgSelectDto::getId).collect(Collectors.toList()); List<String> orgIds = organizationService.getMyOrgList().stream().map(OrgSelectDto::getId).collect(Collectors.toList());
criteria.andOrganizationIdIn(orgIds).andCreateTimeBetween(strDate, endDate); criteria.andOrganizationIdIn(orgIds).andCreateTimeBetween(strDate, endDate);
example.setOrderByClause("update_time desc"); example.setOrderByClause("update_time desc");
PageInfo<DataImportLogDto> pageInfo = new PageInfo<>(dataImportLogMapper.selectByExample(example).stream() PageInfo<DataImportLogDto> pageInfo = new PageInfo<>(dataImportLogMapper.selectByExample(example).stream()
.map(o -> beanUtil.copyProperties(o, new DataImportLogDto())).collect(Collectors.toList())); .map(o -> beanUtil.copyProperties(o, new DataImportLogDto())).collect(Collectors.toList()));
pageInfo.setTotal(page.getTotal()); pageInfo.setTotal(page.getTotal());
...@@ -1929,9 +1938,16 @@ public class DataImportService extends BaseService { ...@@ -1929,9 +1938,16 @@ public class DataImportService extends BaseService {
* @author Gary J Li * @author Gary J Li
*/ */
public PageInfo<DataValidateLogDto> displayProcessLog(DataProcessParam param) { public PageInfo<DataValidateLogDto> displayProcessLog(DataProcessParam param) {
/*
Date strDate = DateUtils.strToDate2(param.getStartDate()); Date strDate = DateUtils.strToDate2(param.getStartDate());
Date endDate = DateUtils.strToDate2(param.getEndDate()); Date endDate = DateUtils.strToDate2(param.getEndDate());*/
String startStr=param.getStartDate();
Date strDate = DateUtils.strToDate2(startStr);
String endStr=param.getEndDate();
Date endDateO = DateUtils.strToDate2(endStr);
long endDateLong =endDateO.getTime()+86399000;
Date endDate=new Date(endDateLong);
DataValidateLogExample example = new DataValidateLogExample(); DataValidateLogExample example = new DataValidateLogExample();
...@@ -1945,11 +1961,9 @@ public class DataImportService extends BaseService { ...@@ -1945,11 +1961,9 @@ public class DataImportService extends BaseService {
orgIds.add(Constant.ALL); orgIds.add(Constant.ALL);
criteria.andOrganizationIdIn(orgIds).andCreateTimeBetween(strDate, endDate); criteria.andOrganizationIdIn(orgIds).andCreateTimeBetween(strDate, endDate);
example.setOrderByClause("update_time desc"); example.setOrderByClause("update_time desc");
PageInfo<DataValidateLogDto> pageInfo = new PageInfo<>(dataValidateLogMapper.selectByExample(example).stream() PageInfo<DataValidateLogDto> pageInfo = new PageInfo<>(dataValidateLogMapper.selectByExample(example).stream()
.map(o -> beanUtil.copyProperties(o, new DataValidateLogDto())).collect(Collectors.toList())); .map(o -> beanUtil.copyProperties(o, new DataValidateLogDto())).collect(Collectors.toList()));
pageInfo.setTotal(page.getTotal()); pageInfo.setTotal(page.getTotal());
return pageInfo; return pageInfo;
} }
...@@ -1979,7 +1993,7 @@ public class DataImportService extends BaseService { ...@@ -1979,7 +1993,7 @@ public class DataImportService extends BaseService {
List<Organization> tmpOrgList = Collections.emptyList(); List<Organization> tmpOrgList = Collections.emptyList();
if (type == EbsExtractTypeConstant.RATE) { if (type == EbsExtractTypeConstant.RATE) {
tmpOrgList = orgs.stream().limit(1).collect(Collectors.toList()); tmpOrgList = orgs.stream().limit(1).collect(Collectors.toList());
}else { } else {
tmpOrgList = orgs; tmpOrgList = orgs;
} }
tmpOrgList.forEach(o -> { tmpOrgList.forEach(o -> {
......
...@@ -2704,12 +2704,16 @@ public class ReportServiceImpl extends BaseService { ...@@ -2704,12 +2704,16 @@ public class ReportServiceImpl extends BaseService {
Map<String, List<ProfitLossStatementPrc>> newMap = new HashMap<>(); Map<String, List<ProfitLossStatementPrc>> newMap = new HashMap<>();
///如果ebitCellData 中已经存在当前机构的数,将取 ebit中,否则取利润表中 ///如果ebitCellData 中已经存在当前机构的数,将取 ebit中,否则取利润表中
for (Map.Entry<String, List<EbitCellData>> entry1 : collect1.entrySet()) { if(collect1.isEmpty()){
for (Map.Entry<String, List<ProfitLossStatementPrc>> entry2 : collect2.entrySet()) { newMap = collect2;
/*System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());*/ }else{
if (entry2.getKey() == entry1.getKey()) for (Map.Entry<String, List<EbitCellData>> entry1 : collect1.entrySet()) {
continue; for (Map.Entry<String, List<ProfitLossStatementPrc>> entry2 : collect2.entrySet()) {
newMap.put(entry2.getKey(), entry2.getValue()); /*System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());*/
if (entry2.getKey() == entry1.getKey())
continue;
newMap.put(entry2.getKey(), entry2.getValue());
}
} }
} }
Map<String, List<EbitCellData>> _newMap = new HashMap<>(); Map<String, List<EbitCellData>> _newMap = new HashMap<>();
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
$scope.startRowNum = 2; $scope.startRowNum = 2;
var date = new Date(); var date = new Date();
var year = date.getFullYear(); var year = date.getFullYear();
var month = date.getMonth()+1; var month = date.getMonth() + 1;
var day = date.getDate(); var day = date.getDate();
$scope.dateFormat = $translate.instant('dateFormat4YearMonth'); $scope.dateFormat = $translate.instant('dateFormat4YearMonth');
...@@ -51,9 +51,9 @@ ...@@ -51,9 +51,9 @@
nextPage: $translate.instant('PagingNextPage'), nextPage: $translate.instant('PagingNextPage'),
lastPage: $translate.instant('PagingLastPage') lastPage: $translate.instant('PagingLastPage')
}, },
type : constant.importFileType.undefined, type: constant.importFileType.undefined,
startDate: year+'/'+month+'/'+day, startDate: year + '/' + month + '/' + day,
endDate : year+'/'+month+'/'+day endDate: year + '/' + month + '/' + day
}; };
var loadImportLogInfoDatagrid = function () { var loadImportLogInfoDatagrid = function () {
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
if (data && data.list) { if (data && data.list) {
$scope.ImportLogGridSource = data.list; $scope.ImportLogGridSource = data.list;
$scope.pagingOptions.totalItems = data.pageInfo.totalCount; $scope.pagingOptions.totalItems = data.pageInfo.totalCount;
}else { } else {
SweetAlert.error($translate.instant('SystemError')); SweetAlert.error($translate.instant('SystemError'));
} }
}); });
...@@ -191,34 +191,41 @@ ...@@ -191,34 +191,41 @@
var setButtonWrapStyle = function () { var setButtonWrapStyle = function () {
if ($scope.fileName) { if ($scope.fileName) {
return { width: "100%" }; return {width: "100%"};
} }
}; };
var setGridStyle = function () { var setGridStyle = function () {
if ($scope.showTotalSecondRow) { if ($scope.showTotalSecondRow) {
return { 'margin-top': '60px' } return {'margin-top': '60px'}
} }
else { else {
return { 'margin-top': '55px' } return {'margin-top': '55px'}
} }
}; };
var initDatePicker = function () { var initDatePicker = function () {
var ele = $(".startDatepicker"); var _ele1 = $("#startDate");
ele.datepicker({ var _ele2 = $("#endDate");
_ele1.datepicker({
startDate: $scope.startDate, startDate: $scope.startDate,
endDate: $scope.endDate, endDate: $scope.queryParams.endDate,
viewMode: $scope.viewMode, viewMode: $scope.viewMode,
minViewMode: $scope.viewMode, minViewMode: $scope.viewMode,
autoclose: true, //选中之后自动隐藏日期选择框 autoclose: true, //选中之后自动隐藏日期选择框
clearBtn: true, //清除按钮 clearBtn: true, //清除按钮
todayBtn: false, //今日按钮 todayBtn: false, //今日按钮
format: 'yyyy/mm/dd' //日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format format: 'yyyy/mm/dd' //日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
}).on('changeDate', function (ev) {
if (ev.date != undefined) {
_ele2.datepicker('setStartDate', ev.date);
_ele1.datepicker('setFormat', 'yyyy/mm/dd');
}
}); });
ele.datepicker("setDate", new Date().formatDateTime('yyyy/mm/dd')); _ele1.datepicker("setDate", new Date().formatDateTime('yyyy/mm/dd'));
var ele2 = $(".endDatepicker"); _ele2.datepicker({
ele2.datepicker({
startDate: $scope.startDate, startDate: $scope.startDate,
endDate: $scope.endDate, endDate: $scope.endDate,
viewMode: $scope.viewMode, viewMode: $scope.viewMode,
...@@ -227,8 +234,15 @@ ...@@ -227,8 +234,15 @@
clearBtn: true, //清除按钮 clearBtn: true, //清除按钮
todayBtn: false, //今日按钮 todayBtn: false, //今日按钮
format: 'yyyy/mm/dd' //日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format format: 'yyyy/mm/dd' //日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
}).on('changeDate', function (ev) {
if (ev.date != undefined) {
_ele1.datepicker('setEndDate', ev.date);
_ele1.datepicker('setFormat', 'yyyy/mm/dd');
$('.datepicker').css('display', 'none');
}
}); });
ele2.datepicker("setDate", new Date().formatDateTime('yyyy/mm/dd')); _ele2.datepicker("setDate", new Date().formatDateTime('yyyy/mm/dd'));
}; };
var initParam = function () { var initParam = function () {
...@@ -237,6 +251,7 @@ ...@@ -237,6 +251,7 @@
$scope.setGridStyle = setGridStyle; $scope.setGridStyle = setGridStyle;
$scope.$watch('queryParams.startDate', function (newValue, oldValue) { $scope.$watch('queryParams.startDate', function (newValue, oldValue) {
getImportLog(); getImportLog();
}); });
$scope.$watch('queryParams.endDate', function (newValue, oldValue) { $scope.$watch('queryParams.endDate', function (newValue, oldValue) {
getImportLog(); getImportLog();
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div id="tab_total"> <div id="tab_total">
<div class="select-period" style="height: 10px;"> <div class="select-period" style="height: 10px;">
<span class="text-bold"style="float: left; margin-top: 5px;">{{'StartDateMao'|translate}}</span> <span class="text-bold"style="float: left; margin-top: 5px;">{{'StartDateMao'|translate}}</span>
<div class="input-daterange input-group startDatepicker" style="float: left;width: 10%;"> <div class="input-daterange input-group " style="float: left;width: 10%;">
<input type="text" id="startDate" class="input-sm form-control" name="startDate" <input type="text" id="startDate" class="input-sm form-control" name="startDate"
ng-model="queryParams.startDate" style="width: 120px;margin-left: 50px;"/> ng-model="queryParams.startDate" style="width: 120px;margin-left: 50px;"/>
</div> </div>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
$scope.startRowNum = 2; $scope.startRowNum = 2;
var date = new Date(); var date = new Date();
var year = date.getFullYear(); var year = date.getFullYear();
var month = date.getMonth()+1; var month = date.getMonth() + 1;
var day = date.getDate(); var day = date.getDate();
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
...@@ -53,8 +53,8 @@ ...@@ -53,8 +53,8 @@
nextPage: $translate.instant('PagingNextPage'), nextPage: $translate.instant('PagingNextPage'),
lastPage: $translate.instant('PagingLastPage') lastPage: $translate.instant('PagingLastPage')
}, },
startDate: year+'/'+month+'/'+day, startDate: year + '/' + month + '/' + day,
endDate : year+'/'+month+'/'+day endDate: year + '/' + month + '/' + day
}; };
var loadProcessLogInfoDatagrid = function () { var loadProcessLogInfoDatagrid = function () {
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
}, { }, {
dataField: "createTime", dataField: "createTime",
allowHeaderFiltering: false, allowHeaderFiltering: false,
dataType : "date", dataType: "date",
width: '10%', width: '10%',
caption: $translate.instant('OperateTime') caption: $translate.instant('OperateTime')
} }
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
if (data && data.list) { if (data && data.list) {
$scope.ProcessLogGridSource = data.list; $scope.ProcessLogGridSource = data.list;
$scope.pagingOptions.totalItems = data.pageInfo.totalCount; $scope.pagingOptions.totalItems = data.pageInfo.totalCount;
}else { } else {
SweetAlert.error($translate.instant('SystemError')); SweetAlert.error($translate.instant('SystemError'));
} }
}); });
...@@ -198,42 +198,55 @@ ...@@ -198,42 +198,55 @@
var setButtonWrapStyle = function () { var setButtonWrapStyle = function () {
if ($scope.fileName) { if ($scope.fileName) {
return { width: "100%" }; return {width: "100%"};
} }
}; };
var setGridStyle = function () { var setGridStyle = function () {
if ($scope.showTotalSecondRow) { if ($scope.showTotalSecondRow) {
return { 'margin-top': '60px' } return {'margin-top': '60px'}
} }
else { else {
return { 'margin-top': '55px' } return {'margin-top': '55px'}
} }
}; };
var initDatePicker = function () { var initDatePicker = function () {
var ele = $(".startDatepicker"); var ele = $("#startDate");
ele.datepicker({ ele.datepicker({
startDate: $scope.startDate, //startDate: $scope.startDate,
endDate: $scope.endDate, endDate: $scope.queryParams.endDate,
viewMode: $scope.viewMode, viewMode: $scope.viewMode,
minViewMode: $scope.viewMode, minViewMode: $scope.viewMode,
autoclose: true, //选中之后自动隐藏日期选择框 autoclose: true, //选中之后自动隐藏日期选择框
clearBtn: true, //清除按钮 clearBtn: true, //清除按钮
todayBtn: false, //今日按钮 todayBtn: false, //今日按钮
format: 'yyyy/mm/dd' //日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format format: 'yyyy/mm/dd' //日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
}).on('changeDate', function (ev) {
if (ev.date != undefined) {
ele.datepicker('setStartDate', ev.date);
ele.datepicker('setFormat', 'yyyy/mm/dd');
}
}); });
;
ele.datepicker("setDate", new Date().formatDateTime('yyyy/mm/dd')); ele.datepicker("setDate", new Date().formatDateTime('yyyy/mm/dd'));
var ele2 = $(".endDatepicker"); var ele2 = $("#endDate");
ele2.datepicker({ ele2.datepicker({
startDate: $scope.startDate, //startDate: $scope.startDate,
endDate: $scope.endDate, //endDate: $scope.endDate,
viewMode: $scope.viewMode, viewMode: $scope.viewMode,
minViewMode: $scope.viewMode, minViewMode: $scope.viewMode,
autoclose: true, //选中之后自动隐藏日期选择框 autoclose: true, //选中之后自动隐藏日期选择框
clearBtn: true, //清除按钮 clearBtn: true, //清除按钮
todayBtn: false, //今日按钮 todayBtn: false, //今日按钮
format: 'yyyy/mm/dd' //日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format format: 'yyyy/mm/dd' //日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
}).on('changeDate', function (ev) {
if (ev.date != undefined) {
ele2.datepicker('setEndDate', ev.date);
ele2.datepicker('setFormat', 'yyyy/mm/dd');
$('.datepicker').css('display', 'none');
}
}); });
;
ele2.datepicker("setDate", new Date().formatDateTime('yyyy/mm/dd')); ele2.datepicker("setDate", new Date().formatDateTime('yyyy/mm/dd'));
}; };
......
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