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