Commit e1c0082b authored by gary's avatar gary

1、vatSession里添加了orgTree

2、补充了excel导入的四个机构选择
parent 403f81f9
......@@ -5,6 +5,8 @@ public class ErrorMessage {
public static final String SaveFileError = "SaveFileError";
public static final String SystemError = "SystemError";
public static final String NoFile = "NoFile";
public static final String DidntSelectedCompany = "Didn't Selected Company";
public static final String DidntSelectedPeriod = "Didn't Selected period";
public static final String NoSelectSheet = "NoSelectSheet";
public static final String DIDNOTSELECTPERIOD = "You should select period!";
......
......@@ -218,7 +218,7 @@ public class DataImportService extends BaseService {
* 1、存在非选择期间数据
* 2、未映射到主体
*/
public OperationResultDto importPLExcelFile(MultipartFile file, String periodDate, Integer importType) throws ServiceException {
public OperationResultDto importPLExcelFile(MultipartFile file,List<String> orgIds, String periodDate, Integer importType) throws ServiceException {
try {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -259,6 +259,12 @@ public class DataImportService extends BaseService {
dataImportLogs.add(dataImportLog);
continue;
}
if (!orgIds.contains(orgId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
dataImportLogs.add(dataImportLog);
continue;
}
// 所选期间与导入文件期间不相等 且非 所选期间12期导入文件为13期
boolean isThirteenPeriod = period / 1000 != 13 && tmsPeriod != 12;
if (!tmsPeriod.equals(period) && isThirteenPeriod) {
......@@ -372,7 +378,7 @@ public class DataImportService extends BaseService {
* 2、未映射到主体
* @author Gary J Li
*/
public OperationResultDto importBSExcelFile(MultipartFile file, String periodDate, Integer importType) throws ServiceException {
public OperationResultDto importBSExcelFile(MultipartFile file,List<String> orgIds, String periodDate, Integer importType) throws ServiceException {
try {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -414,6 +420,13 @@ public class DataImportService extends BaseService {
dataImportLogs.add(dataImportLog);
continue;
}
if (!orgIds.contains(orgId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
dataImportLogs.add(dataImportLog);
continue;
}
// 所选期间与导入文件期间不相等 且非 所选期间12期导入文件为13期
boolean isThirteenPeriod = period / 1000 != 13 && tmsPeriod != 12;
if (!tmsPeriod.equals(period) && isThirteenPeriod) {
......@@ -501,7 +514,7 @@ public class DataImportService extends BaseService {
* @author Gary J Li
* @return
*/
public OperationResultDto importCFExcelFile(MultipartFile file, String periodDate, Integer importType) throws ServiceException {
public OperationResultDto importCFExcelFile(MultipartFile file,List<String> orgIds, String periodDate, Integer importType) throws ServiceException {
try {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -544,6 +557,12 @@ public class DataImportService extends BaseService {
dataImportLogs.add(dataImportLog);
continue;
}
if (!orgIds.contains(orgId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
dataImportLogs.add(dataImportLog);
continue;
}
// 所选期间与导入文件期间不相等 且非 所选期间12期导入文件为13期
boolean isThirteenPeriod = period / 1000 != 13 && tmsPeriod != 12;
if (!tmsPeriod.equals(period) && isThirteenPeriod) {
......@@ -628,7 +647,7 @@ public class DataImportService extends BaseService {
* @author Gary J Li
* @return OperationResultDto
*/
public OperationResultDto importIDExcelFile(MultipartFile file, String periodDate, Integer importType) throws ServiceException{
public OperationResultDto importIDExcelFile(MultipartFile file,List<String> orgIds ,String periodDate, Integer importType) throws ServiceException{
try {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -674,6 +693,12 @@ public class DataImportService extends BaseService {
dataImportLogs.add(dataImportLog);
continue;
}
if (!orgIds.contains(orgId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
dataImportLogs.add(dataImportLog);
continue;
}
// 所选期间与导入文件期间不相等 且非 所选期间12期导入文件为13期
boolean isThirteenPeriod = period / 1000 != 13 && tmsPeriod != 12;
if (!tmsPeriod.equals(period) && isThirteenPeriod) {
......@@ -1095,7 +1120,7 @@ public class DataImportService extends BaseService {
* @author Gary J Li
* @return
*/
public OperationResultDto importCILExcelFile(MultipartFile file, String periodDate, Integer importType) throws ServiceException {
public OperationResultDto importCILExcelFile(MultipartFile file,List<String> orgIds, String periodDate, Integer importType) throws ServiceException {
try {
InputStream inputStream = file.getInputStream();
......@@ -1136,6 +1161,12 @@ public class DataImportService extends BaseService {
dataImportLogs.add(dataImportLog);
continue;
}
if (!orgIds.contains(orgId)) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
dataImportLogs.add(dataImportLog);
continue;
}
String companyName = organizations.get(0).getName();
dataImportLog.setCompanyName(companyName);
// 所选期间与导入文件期间不相等 且非 所选期间12期导入文件为13期
......
......@@ -68,8 +68,8 @@ public class DataInitTest extends CommonIT {
JSONObject object = JSONObject.parseObject(input);
Map<String, Object> orgs = object.getInnerMap();
Map<String, Object> failList = new HashMap<>();
StringBuilder failMsg = new StringBuilder();
orgs.forEach((orgK, orgV) -> {
try {
......@@ -317,17 +317,19 @@ public class DataInitTest extends CommonIT {
if (organizationExtraMapper.insertSelective(orgEx) < 0) {
failList.putIfAbsent(orgK, orgV);
}
if (orgEmp.getEmployeesNumEnd() > 0 && organizationEmployeeMapper.insertSelective(orgEmp) < 0) {
if (organizationEmployeeMapper.insertSelective(orgEmp) < 0) {
failList.putIfAbsent(orgK, orgV);
}
}
});
} catch (Exception e) {
failMsg.append(e.getMessage()+"\n");
failList.putIfAbsent(orgK, orgV);
}
});
String failedStr = JSON.toJSONString(failList);
FileWriter writer;
FileWriter writer1;
try {
writer = new FileWriter("C:\\Users\\Gary J Li\\Documents\\PwcDoc\\DD2018\\admin文档\\初始化\\company_info_failed.json");
writer.write(failedStr);
......@@ -336,6 +338,14 @@ public class DataInitTest extends CommonIT {
} catch (IOException e) {
e.printStackTrace();
}
try {
writer1 = new FileWriter("C:\\Users\\Gary J Li\\Documents\\PwcDoc\\DD2018\\admin文档\\初始化\\company_info_msg.txt");
writer1.write(failMsg.toString());
writer1.flush();
writer1.close();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(String.format("失败条数[%s]", failList.size()));
}
......
......@@ -2234,6 +2234,15 @@
if($scope.selectCompany.engageNationalProhibitIndustry!=null){
$scope.selectCompany.engageNationalProhibitIndustry = $scope.selectCompany.engageNationalProhibitIndustry?"是":"否";
}
if($scope.selectCompany.nationalEconomicIndustry!=null){
$scope.nationalEconomicIndustryList.map(function(value,index){
if (value.code === $scope.selectCompany.nationalEconomicIndustry) {
$scope.selectCompany.nationalEconomicIndustry = value.code+"-"+value.type;
return;
}
});
}
};
// 添加或者编辑机构成功之后,刷新当前页面的数据
......@@ -3156,6 +3165,7 @@
$scope.taxReturnBusinessTypeList = constant.TaxReturnBusinessTypeList;
$scope.trueFalse = constant.trueFalse;
$scope.regFinancialAccountingTypeList = constant.RegFinancialAccountingTypeList;
$scope.nationalEconomicIndustryList = constant.NationalEconomicIndustryList;
$scope.applicableAccountingRuleList = constant.ApplicableAccountingRuleList;
$scope.regStatusList = constant.RegStatusList;
$scope.lowValueConsumablesAmortizationMethodList = constant.LowValueConsumablesAmortizationMethodList;
......
commonModule.controller('importBSController', ['$scope', '$log', '$translate', '$timeout', '$q', '$interval'
, 'apiInterceptor', 'Upload', 'vatImportService', 'SweetAlert', 'uiGridConstants', '$uibModal'
, 'vatSessionService', 'enums', 'vatOperationLogService'
, 'projectService', 'vatCommonService','templateService',
, 'projectService', 'vatCommonService','templateService','orgService',
function ($scope, $log, $translate, $timeout, $q, $interval
, apiInterceptor, Upload, vatImportService, SweetAlert, uiGridConstants, $uibModal
, vatSessionService, enums, vatOperationLogService
, projectService, vatCommonService,templateService) {
, projectService, vatCommonService,templateService,orgService) {
'use strict';
var successCount = 0;
......@@ -33,6 +33,12 @@
$scope.selectedPeriod = null;
$scope.showTotalSecondRow = false;
$scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.companyList = [];
$scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
$scope.importBSExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/BSExcelFile';
......@@ -59,7 +65,6 @@
OperationType: '',
OperationContent: '',
OriginalState: '',
UpdateState: '',
CreatorID: vatSessionService.logUser.ID,
Comment: comment,
......@@ -708,10 +713,12 @@
}
var period = $scope.UploadPeriodTime;
var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({
url: $scope.importBSExcelFile,
data: {
orgIds : orgIds,
periodDate : period,
importType : importType
},
......@@ -1153,6 +1160,60 @@
$scope.setGridStyle = setGridStyle;
};
$scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1);
}
});
$scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.selectAll = function () {
if($scope.selectedAll) {
$scope.selectedOne = true;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i);
i.checked = true;
})
}else {
$scope.selectedOne = false;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
i.checked = false;
})
}
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
//开始
(function initialize() {
$log.debug('ImportTBController.ctor()...');
......@@ -1161,6 +1222,7 @@
initParam();
loadImportBSStatusInfoDatagrid();
initDatePicker();
initCompanyList();
$scope.$watch('importExcelFile', function (newValue, oldValue) {
if (newValue !== null && newValue !== oldValue) {
......
......@@ -11,6 +11,29 @@
<form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()">
<div class="import-wrapper">
<span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span>
</button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0;
overflow: hidden;background-color: #e5e5e5;"></li>
<li ng-repeat="i in companyList">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;text-align: left;float: left;">{{i.name}}</span>
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
commonModule.controller('importCFController', ['$scope', '$log', '$translate', '$timeout', '$q', '$interval'
, 'apiInterceptor', 'Upload', 'vatImportService', 'SweetAlert', 'uiGridConstants', '$uibModal'
, 'vatSessionService', 'enums', 'vatOperationLogService'
, 'projectService', 'vatCommonService','templateService',
, 'projectService', 'vatCommonService','templateService','orgService',
function ($scope, $log, $translate, $timeout, $q, $interval
, apiInterceptor, Upload, vatImportService, SweetAlert, uiGridConstants, $uibModal
, vatSessionService, enums, vatOperationLogService
, projectService, vatCommonService,templateService) {
, projectService, vatCommonService,templateService,orgService) {
'use strict';
var comment = vatSessionService.project.name + " " + vatSessionService.project.year + "年" + vatSessionService.month + "月";
......@@ -31,6 +31,11 @@
$scope.importCFExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/CFExcelFile';
$scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.companyList = [];
$scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
var date = new Date();
var year = date.getFullYear();
......@@ -712,10 +717,12 @@
}
var period = $scope.UploadPeriodTime;
var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({
url: $scope.importCFExcelFile,
data: {
orgIds : orgIds,
periodDate : period,
importType : importType
},
......@@ -900,6 +907,51 @@
$scope.pagingOptions.totalItems = totalItemsCount;
};
$scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1);
}
});
$scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.selectAll = function () {
if($scope.selectedAll) {
$scope.selectedOne = true;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i);
i.checked = true;
})
}else {
$scope.selectedOne = false;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
i.checked = false;
})
}
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
// 检查用户机构权限
var checkUserOrganizationPermissionList = function () {
......@@ -956,6 +1008,14 @@
ele1.datepicker("setDate", $scope.selectedDate);
};
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
var initParam = function () {
$scope.doUploadCF = doUploadCF;
$scope.downloadTemplate = downloadTemplate;
......@@ -973,6 +1033,7 @@
checkUserOrganizationPermissionList();
getUserPermission();
loadImportCFStatusInfoDatagrid();
initCompanyList();
initDatePicker();
$scope.$watch('importExcelFile', function (newValue, oldValue) {
......
......@@ -11,6 +11,29 @@
<form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()">
<div class="import-wrapper">
<span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span>
</button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0;
overflow: hidden;background-color: #e5e5e5;"></li>
<li ng-repeat="i in companyList">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;text-align: left;float: left;">{{i.name}}</span>
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
commonModule.controller('importCILController', ['$scope', '$log', '$translate', '$timeout', '$q', '$interval'
, 'apiInterceptor', 'Upload', 'vatImportService', 'SweetAlert', 'uiGridConstants', '$uibModal'
, 'vatSessionService', 'enums', 'vatOperationLogService'
, 'projectService', 'vatCommonService','templateService',
, 'projectService', 'vatCommonService','templateService','orgService',
function ($scope, $log, $translate, $timeout, $q, $interval
, apiInterceptor, Upload, vatImportService, SweetAlert, uiGridConstants, $uibModal
, vatSessionService, enums, vatOperationLogService
, projectService, vatCommonService,templateService) {
, projectService, vatCommonService,templateService,orgService) {
'use strict';
var comment = vatSessionService.project.name + " " + vatSessionService.project.year + "年" + vatSessionService.month + "月";
......@@ -31,6 +31,12 @@
$scope.importCILExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/CILExcelFile';
$scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.companyList = [];
$scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth();
......@@ -159,10 +165,12 @@
}
var period = $scope.UploadPeriodTime;
var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({
url: $scope.importCILExcelFile,
data: {
orgIds : orgIds,
periodDate : period,
importType : importType
},
......@@ -346,6 +354,51 @@
$scope.pagingOptions.totalItems = totalItemsCount;
};
$scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1);
}
});
$scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.selectAll = function () {
if($scope.selectedAll) {
$scope.selectedOne = true;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i);
i.checked = true;
})
}else {
$scope.selectedOne = false;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
i.checked = false;
})
}
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
// 检查用户机构权限
var checkUserOrganizationPermissionList = function () {
......@@ -403,6 +456,14 @@
ele1.datepicker("setDate", $scope.selectedDate);
};
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
var initParam = function () {
$scope.doUploadCIL = doUploadCIL;
$scope.downloadTemplate = downloadTemplate;
......@@ -425,6 +486,7 @@
initParam();
getUserPermission();
loadImportCILStatusInfoDatagrid();
initCompanyList();
initDatePicker();
$scope.$watch('importExcelFile', function (newValue, oldValue) {
......
......@@ -11,6 +11,29 @@
<form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()">
<div class="import-wrapper">
<span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span>
</button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0;
overflow: hidden;background-color: #e5e5e5;"></li>
<li ng-repeat="i in companyList">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;text-align: left;float: left;">{{i.name}}</span>
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
commonModule.controller('importInvoiceDataController', ['$scope', '$log', '$translate', '$timeout', '$q', '$interval'
, 'apiInterceptor', 'Upload', 'vatImportService', 'SweetAlert', 'uiGridConstants', '$uibModal'
, 'vatSessionService', 'enums', 'vatOperationLogService'
, 'projectService', 'vatCommonService','templateService',
, 'projectService', 'vatCommonService','templateService','orgService',
function ($scope, $log, $translate, $timeout, $q, $interval
, apiInterceptor, Upload, vatImportService, SweetAlert, uiGridConstants, $uibModal
, vatSessionService, enums, vatOperationLogService
, projectService, vatCommonService,templateService) {
, projectService, vatCommonService,templateService,orgService) {
'use strict';
var comment = vatSessionService.project.name + " " + vatSessionService.project.year + "年" + vatSessionService.month + "月";
......@@ -31,6 +31,11 @@
$scope.importIDExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/IDExcelFile';
$scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.companyList = [];
$scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
var date = new Date();
var year = date.getFullYear();
......@@ -133,10 +138,12 @@
}
var period = $scope.UploadPeriodTime;
var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({
url: $scope.importIDExcelFile,
data: {
orgIds : orgIds,
periodDate : period,
importType : importType
},
......@@ -355,6 +362,51 @@
$scope.pagingOptions.totalItems = totalItemsCount;
};
$scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1);
}
});
$scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.selectAll = function () {
if($scope.selectedAll) {
$scope.selectedOne = true;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i);
i.checked = true;
})
}else {
$scope.selectedOne = false;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
i.checked = false;
})
}
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
// 检查用户机构权限
var checkUserOrganizationPermissionList = function () {
......@@ -410,6 +462,14 @@
ele1.datepicker("setDate", $scope.selectedDate);
};
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
var initParam =function () {
$scope.doUploadID = doUploadID;
$scope.downloadTemplate = downloadTemplate;
......@@ -427,6 +487,7 @@
initParam();
getUserPermission();
loadImportIDStatusInfoDatagrid();
initCompanyList();
initDatePicker();
$scope.$watch('importExcelFile', function (newValue, oldValue) {
......
......@@ -11,6 +11,29 @@
<form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()">
<div class="import-wrapper">
<span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span>
</button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0;
overflow: hidden;background-color: #e5e5e5;"></li>
<li ng-repeat="i in companyList">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;text-align: left;float: left;">{{i.name}}</span>
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
commonModule.controller('importPLController', ['$scope', '$log', '$translate', '$timeout', '$q', '$interval'
, 'apiInterceptor', 'Upload', 'vatImportService', 'SweetAlert', 'uiGridConstants', '$uibModal'
, 'vatSessionService', 'enums', 'vatOperationLogService'
, 'projectService', 'vatCommonService','templateService',
, 'projectService', 'vatCommonService','templateService','orgService',
function ($scope, $log, $translate, $timeout, $q, $interval
, apiInterceptor, Upload, vatImportService, SweetAlert, uiGridConstants, $uibModal
, vatSessionService, enums, vatOperationLogService
, projectService, vatCommonService,templateService) {
, projectService, vatCommonService,templateService,orgService) {
'use strict';
var comment = vatSessionService.project.name + " " + vatSessionService.project.year + "年" + vatSessionService.month + "月";
......@@ -31,6 +31,11 @@
$scope.importPLExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/PLExcelFile';
$scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.companyList = [];
$scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
var date = new Date();
var year = date.getFullYear();
......@@ -162,10 +167,12 @@
}
var period = $scope.UploadPeriodTime;
var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({
url: $scope.importPLExcelFile,
data: {
orgIds : orgIds,
periodDate : period,
importType : importType
},
......@@ -422,6 +429,61 @@
$scope.setGridStyle = setGridStyle;
};
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
$scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1);
}
});
$scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.selectAll = function () {
if($scope.selectedAll) {
$scope.selectedOne = true;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i);
i.checked = true;
})
}else {
$scope.selectedOne = false;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
i.checked = false;
})
}
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
//开始
(function initialize() {
$log.debug('ImportTBController.ctor()...');
......@@ -430,6 +492,8 @@
getUserPermission();
loadImportPLStatusInfoDatagrid();
initDatePicker();
initCompanyList();
$scope.$watch('importExcelFile', function (newValue, oldValue) {
if (newValue !== null && newValue !== oldValue) {
......
......@@ -11,6 +11,29 @@
<form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()">
<div class="import-wrapper">
<span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span>
</button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0;
overflow: hidden;background-color: #e5e5e5;"></li>
<li ng-repeat="i in companyList">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;text-align: left;float: left;">{{i.name}}</span>
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
......@@ -1439,6 +1439,31 @@ constant.fileTypeList = [
{code:7,type:"所有者权益变动表和汇率表"}
];
constant.NationalEconomicIndustryList =[
{code:"A",type:"农、林、牧、渔业"},
{code:"B",type:"采矿业"},
{code:"C",type:"制造业"},
{code:"D",type:"电力、热力、燃气及水生产和供应业"},
{code:"E",type:"建筑业"},
{code:"F",type:"批发和零售业"},
{code:"G",type:"交通运输、仓储和邮政业"},
{code:"H",type:"住宿和餐饮业"},
{code:"I",type:"信息传输、软件和信息技术服务业"},
{code:"J",type:"金融业"},
{code:"K",type:"房地产业"},
{code:"L",type:"租赁和商务服务业"},
{code:"M",type:"科学研究和技术服务业"},
{code:"N",type:"水利、环境和公共设施管理业"},
{code:"O",type:"居民服务、修理和其他服务业"},
{code:"P",type:"教育"},
{code:"Q",type:"卫生和社会工作"},
{code:"R",type:"文化、体育和娱乐业"},
{code:"S",type:"公共管理、社会保障和社会组织"},
{code:"T",type:"国际组织"}
];
constant.maxButtonTitleLength = 20;
......
......@@ -42,7 +42,7 @@ webservices.factory('orgService', ['$http', 'apiConfig', function ($http, apiCon
return $http.get('/org/getProjectIndustrys', apiConfig.create());
},
enableOrgs: function (id) {
return $http.get('/org/enableOrgs?orgID=' + id, apiConfig.create());
return $http.get('/org/enableOrgs?orgId=' + id, apiConfig.create());
},
getOrgIvhTreeList: function (useType, orgSetID) {
return $http.get('/org/getOrgIvhTreeList?useType=' + useType + '&orgSetID=' + orgSetID, apiConfig.create());
......@@ -84,7 +84,7 @@ webservices.factory('orgService', ['$http', 'apiConfig', function ($http, apiCon
return $http.get('/org/getOrgCityAreaUserCountList?orgID=' + orgID, apiConfig.create({ ignoreLoadingBar: true }));
},
getGeneralInfo: function (orgID) {
return $http.get('/org/getGeneralInfo?orgID=' + orgID, apiConfig.create({ ignoreLoadingBar: true }));
return $http.get('/org/getGeneralInfo?orgId=' + orgID, apiConfig.create({ ignoreLoadingBar: true }));
},
getOrgBuAreaIndustryUser: function (userID) {
return $http.get('/org/getOrgBuAreaIndustryUser?userID=' + userID, apiConfig.create());
......
......@@ -1172,35 +1172,34 @@
},
getOrgData: function () {
orgService.getOrgListLevel().success(function (data) {
if (!data) {
data = [];
}
var data = vatSessionService.orgTree;
var result = [];
if (!data) {
data = [];
}
//如果是资产管理,则只获取资产管理类型的组织机构
if ($scope.serviceTypeId === enums.serviceType.AssetsManage) {
result = _.filter(data, function (item) {
return item.industryID == '10';
});
}
else {
for (var i = 0; i < data.length; i++) {
var item = data[i];
var result = [];
if (thisDataService.isHaveOrganizationPermission(item.id)) {
result.push(item);
}
//如果是资产管理,则只获取资产管理类型的组织机构
if ($scope.serviceTypeId === enums.serviceType.AssetsManage) {
result = _.filter(data, function (item) {
return item.industryID == '10';
});
} else {
for (var i = 0; i < data.length; i++) {
var item = data[i];
if (thisDataService.isHaveOrganizationPermission(item.id)) {
result.push(item);
}
}
}
orgDisplay.orgList = result;
orgDisplay.orgList = result;
//$scope.dimensionOrgShow('', 'orgName');
$scope.dimensionOrgShow(vatSessionService.queryDto.fieldId, vatSessionService.queryDto.filedName);
//$scope.dimensionOrgShow('', 'orgName');
$scope.dimensionOrgShow(vatSessionService.queryDto.fieldId, vatSessionService.queryDto.filedName);
});
// orgDisplay.orgList = testOrgList;
},
......@@ -1727,6 +1726,10 @@
initDatePickers();
$scope.updateStatus = false;
orgService.getOrgListLevel().success(function (data) {
vatSessionService.orgTree=data;
});
userService.getUserPermission(loginContext.userName).success(function (userPermission) {
thisData.userPermission = userPermission;
userPermission.permissionList.forEach(function (p) {
......@@ -1752,6 +1755,8 @@
}
});
$scope.$watch('productFileName', function (newValue, oldValue) {
if (newValue && newValue !== oldValue) {
doUploadProductFileName(newValue);
......
......@@ -16,6 +16,8 @@ webservices.factory('vatSessionService', ['$log', 'localStorageService', functio
var userPermission = {};
var orgTree = {};
var queryDto = {
searchKeyword: '',
fieldId: '',
......@@ -73,6 +75,7 @@ webservices.factory('vatSessionService', ['$log', 'localStorageService', functio
logUser: logUser,
reset: reset,
userPermission: userPermission,
orgTree:orgTree,
queryDto: queryDto,
setProperty: setProperty,
getProperty: getProperty,
......
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