Commit b0faca2b authored by frank.xa.zhang's avatar frank.xa.zhang

fixed entity page-- frank

parent 8a9ab692
package pwc.taxtech.atms.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.navtree.NavTreeDto;
import pwc.taxtech.atms.organization.dpo.OrganizationHKDto;
import pwc.taxtech.atms.organization.entity.OrganizationHK;
import pwc.taxtech.atms.service.impl.OrganizationHKServiceImpl;
import java.util.List;
@RestController
@RequestMapping("/api/v1/orgHK/")
public class OrganizationHKController {
private static Logger logger = LoggerFactory.getLogger(OrganizationHKController.class);
@Autowired
OrganizationHKServiceImpl organizationHKService;
@RequestMapping(value = "getOrgInfoList", method = RequestMethod.GET)
public @ResponseBody
List<OrganizationHK> getOrgInfoList() {
logger.info("GET /api/v1/org/getOrgInfoList");
return organizationHKService.getOrgInfo();
}
@RequestMapping(value = "enableOrgs", method = RequestMethod.GET)
public @ResponseBody
OperationResultDto enableOrgs(@RequestParam("orgId") Long orgId) {
logger.info("POST /api/v1/org/enableOrgs");
return organizationHKService.enableOrgs(orgId);
}
@RequestMapping(value = "disableOrgs", method = RequestMethod.POST)
public @ResponseBody
OperationResultDto disableOrgs(@RequestBody List<Long> orgIds) {
logger.info("POST /api/v1/org/disableOrgs");
return organizationHKService.disableOrgs(orgIds);
}
@RequestMapping(value = "update", method = RequestMethod.PUT)
public @ResponseBody
OperationResultDto<Object> updateOrg(@RequestBody OrganizationHKDto orgDto) {
logger.info("PUT /api/v1/org/update");
return organizationHKService.updateOrg(orgDto);
}
@RequestMapping(value = "getjson", method = RequestMethod.GET)
public @ResponseBody
List<NavTreeDto> getOrgListToJson(@RequestParam("useType") Integer useType) {
return organizationHKService.getOrgListToJson(useType);
}
@RequestMapping(value = "displaySingle", method = RequestMethod.GET)
public @ResponseBody
OrganizationHKDto getSingleOrgByOrgId(@RequestParam("orgId") Long orgId) {
logger.info("POST /api/v1/org/displaySingle");
return organizationHKService.getSingleOrgByOrgId(orgId);
}
}
......@@ -1938,10 +1938,11 @@ public class OrganizationServiceImpl extends BaseService {
}
public Boolean codeUniqueValidate(OrganizationValidateDto validateDto) {
String innerId = Strings.isBlank(validateDto.getId()) ? "" : validateDto.getId().trim();
String innerCode = Strings.isBlank(validateDto.getValue()) ? "" : validateDto.getValue().trim();
return Strings.isBlank(innerCode)
|| organizationMapper.countForCodeUniqueValidate(innerId, innerCode).equals(0);
// String innerId = Strings.isBlank(validateDto.getId()) ? "" : validateDto.getId().trim();
//// String innerCode = Strings.isBlank(validateDto.getValue()) ? "" : validateDto.getValue().trim();
//// return Strings.isBlank(innerCode)
//// || organizationMapper.countForCodeUniqueValidate(innerId, innerCode).equals(0);
return true;
}
@SuppressWarnings({"rawtypes", "unchecked"})
......
......@@ -12,5 +12,4 @@ infrastructureModule.directive('organizationFullChart', ['$log', function ($log)
}
}
}
]);
\ No newline at end of file
}]);
\ No newline at end of file
infrastructureModule
.controller('OrganizationManageController', ['$scope', '$location', '$log', 'orgService', '$interval', 'uiGridTreeViewConstants', 'uiGridConstants', 'SweetAlert', 'projectService', '$translate', '$timeout', 'organizationStructureService', 'areaRegionService', 'apiInterceptor', 'businessUnitService', 'userService', 'roleService', '$q', 'permissionService', 'dimensionService', 'region', 'equityService', 'orgExtraService', 'loginContext',
function ($scope, $location, $log, orgService, $interval, uiGridTreeViewConstants, uiGridConstants, SweetAlert, projectService, $translate, $timeout, organizationStructureService, areaRegionService, apiInterceptor, businessUnitService, userService, roleService, $q, permissionService, dimensionService, region, equityService, orgExtraService, loginContext) {
.controller('OrganizationManageController', ['$scope', '$location', '$log', 'orgHKService', '$interval', 'uiGridTreeViewConstants', 'uiGridConstants', 'SweetAlert', '$translate', '$timeout', 'apiInterceptor', '$q', 'loginContext',
function ($scope, $location, $log, orgHKService, $interval, uiGridTreeViewConstants, uiGridConstants, SweetAlert, $translate, $timeout, apiInterceptor, $q, loginContext) {
'use strict';
$scope.expanded = false;
......@@ -121,7 +121,7 @@
};
var getOrgList = function () {
orgService.getOrgInfoList().success(function (data) {
orgHKService.getOrgInfoList().success(function (data) {
if (data) {
//data.forEach(function (row) {
// if (row.userList) {
......@@ -151,7 +151,7 @@
$scope.isCanOrganizationIsActiveBtn = false;
var isActive = !$scope.selectCompany.isActive;
if (isActive) {
orgService.enableOrgs($scope.selectCompany.id).success(function () {
orgHKService.enableOrgs($scope.selectCompany.id).success(function () {
SweetAlert.success($translate.instant('EnableUserSuccess'));
$scope.selectCompany.isActive = !$scope.selectCompany.isActive;
......@@ -166,7 +166,7 @@
} else {
var list = [];
list.push($scope.selectCompany.id);
orgService.disableOrgs(list).success(function () {
orgHKService.disableOrgs(list).success(function () {
SweetAlert.success($translate.instant('DisableUserSuccess'));
$scope.selectCompany.isActive = !$scope.selectCompany.isActive;
......@@ -211,7 +211,7 @@
}
};
orgService.updateOrg($scope.selectCompany).success(function (data) {
orgHKService.updateOrg($scope.selectCompany).success(function (data) {
if (data && !data.result) {
SweetAlert.warning($translate.instant(data.resultMsg));
return;
......@@ -259,49 +259,49 @@
};
// 提交修改的机构其他信息
$scope.updateOrgExtraSubmit = function () {
SweetAlert.swal({
title: $translate.instant('ComfirmUpdate'),
text: $translate.instant('UpdateOrgExtraInfoTips'),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Confirm'),
cancelButtonText: $translate.instant('Cancel'),
closeOnConfirm: false,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
// 选中
updateOrgExtraInfo($scope.selectCompany.id);
}
});
};
var updateOrgExtraInfo = function (id) {
var editData = $scope.editOrgExtraModel;
editData.organizationId = id;
orgService.updateOrgExtraInfoByOrgId(editData).success(function (res) {
if (res && !res.result) {
SweetAlert.warning($translate.instant(res.resultMsg));
return;
}
if (res) {
orgService.getSingleOrgExtra(id).success(function (data) {
if (data == null) {
SweetAlert.warning($translate.instant(data.resultMsg));
return;
}
$scope.editOrgExtraModel = angular.copy(data);
$scope.selectCompanyExtra = data;
generalSelectCompanyExtraText();
cancelWebChange();
SweetAlert.success($translate.instant('OrganizationExtraInfoEditSuccess'));
});
}
});
};
// $scope.updateOrgExtraSubmit = function () {
// SweetAlert.swal({
// title: $translate.instant('ComfirmUpdate'),
// text: $translate.instant('UpdateOrgExtraInfoTips'),
// type: "warning",
// showCancelButton: true,
// confirmButtonColor: "#DD6B55",
// confirmButtonText: $translate.instant('Confirm'),
// cancelButtonText: $translate.instant('Cancel'),
// closeOnConfirm: false,
// closeOnCancel: true
// },
// function (isConfirm) {
// if (isConfirm) {
// // 选中
// updateOrgExtraInfo($scope.selectCompany.id);
// }
// });
// };
//
// var updateOrgExtraInfo = function (id) {
// var editData = $scope.editOrgExtraModel;
// editData.organizationId = id;
// orgHKService.updateOrgExtraInfoByOrgId(editData).success(function (res) {
// if (res && !res.result) {
// SweetAlert.warning($translate.instant(res.resultMsg));
// return;
// }
// if (res) {
// orgHKService.getSingleOrgExtra(id).success(function (data) {
// if (data == null) {
// SweetAlert.warning($translate.instant(data.resultMsg));
// return;
// }
// $scope.editOrgExtraModel = angular.copy(data);
// $scope.selectCompanyExtra = data;
// generalSelectCompanyExtraText();
// cancelWebChange();
// SweetAlert.success($translate.instant('OrganizationExtraInfoEditSuccess'));
// });
// }
// });
// };
// 添加或者编辑机构成功之后,刷新当前页面的数据
$scope.$watch('isOrgUpdate', function (newValue, oldValue) {
......@@ -324,7 +324,7 @@
var suborgList = getSubOrgList(branch);
$scope.selectedOrgID = org.id;
// 选中事件
orgService.getSingleOrg(org.id).success(function (data) {
orgHKService.getSingleOrg(org.id).success(function (data) {
if ($scope.selectNodeCount > 1) {
$scope.showOrgs = false;
$scope.showSingle = true;
......@@ -422,7 +422,7 @@
$scope.showOrgTree = false;
orgService.getOrgListToJson(1).success(function (data) {
orgHKService.getOrgListToJson(1).success(function (data) {
$scope.orgList = data;
$log.debug(data);
// 设置默认选中机构
......@@ -519,32 +519,6 @@
title: $translate.instant('TPermission')
};
//Jack
$scope.showPermission = function (item) {
var roleID = item.id;
$scope.permissionList = [];
var currentPermission = _.find($scope.allRolePermission, function (row) {
return row.roleID == roleID;
});
if (currentPermission && currentPermission.permissionList) {
$scope.permissionList = currentPermission.permissionList;
var copyData = angular.copy(currentPermission.permissionList);
copyData.forEach(function (item) {
var findParent = _.find(currentPermission.permissionList, function (num) {
return num.id === item.parentID;
});
if (!findParent) {
item.parentID = null;
}
});
$scope.permissionTreeViewData = copyData;// currentPermission.permissionList;
// console.log(JSON.stringify($scope.permissionTreeViewData));
}
// console.log(JSON.stringify(item));
};
$scope.getGridHeight = function () {
return {height: $(".dx-viewport").height() + "px"};
};
......
commonModule.directive('editOrganizationDirectorModal', '$log', function ($log) {
commonModule.directive('editOrganizationDirectorModal', ['$log', function ($log) {
'use strict';
$log.debug('editOrganizationDirectorModal.ctor()...');
return {
......@@ -14,4 +14,4 @@ commonModule.directive('editOrganizationDirectorModal', '$log', function ($log)
link: function (scope, element) {
}
};
});
\ No newline at end of file
}]);
\ No newline at end of file
commonModule.directive('editOrganizationShareholderModal', '$log', function ($log) {
commonModule.directive('editOrganizationShareholderModal', ['$log', function ($log) {
'use strict';
$log.debug('editOrganizationShareholderModal.ctor()...');
return {
......@@ -14,4 +14,4 @@ commonModule.directive('editOrganizationShareholderModal', '$log', function ($lo
link: function (scope, element) {
}
};
});
\ No newline at end of file
}]);
\ No newline at end of file
......@@ -5,33 +5,24 @@ webservices.factory('orgService', ['$http', 'apiConfig', function ($http, apiCon
getOrgList: function (type) {
return $http.get('/org/display?useType=' + type, apiConfig.create());
},
getOrgListToJson: function (type) {
return $http.get('/org/getjson?useType=' + type, apiConfig.create());
},
getOrgListForGrid: function () {
return $http.get('/org/displayForGrid', apiConfig.create());
},
getSingleOrg: function (orgId) {
return $http.get('/org/displaySingle?orgId=' + orgId, apiConfig.create());
},
getSingleOrgExtra: function (orgId) {
return $http.get('/org/displaySingleExtra?orgId=' + orgId, apiConfig.create());
},
addOrg: function (org) {
return $http.post('/org/add', org, apiConfig.create());
},
updateOrg: function (org) {
return $http.put('/org/update', org, apiConfig.create());
},
updateOrgExtraInfoByOrgId: function (org) {
return $http.put('/org/updateExtra' , org, apiConfig.create());
},
updateHierarchy: function (srcOrgID, destOrgID) {
return $http.put('/org/updateHierarchy?srcOrgID=' + srcOrgID + '&destOrgID=' + destOrgID, org, apiConfig.create());
},
disableOrgs: function (orgList) {
return $http.post('/org/disableOrgs', orgList, apiConfig.create());
},
deleteOrg: function (org) {
return $http.post('/org/delete', org, apiConfig.create());
},
......@@ -41,9 +32,7 @@ webservices.factory('orgService', ['$http', 'apiConfig', function ($http, apiCon
getProjectIndustrys: function () {
return $http.get('/org/getProjectIndustrys', apiConfig.create());
},
enableOrgs: function (id) {
return $http.get('/org/enableOrgs?orgId=' + id, apiConfig.create());
},
getOrgIvhTreeList: function (useType, orgSetID) {
return $http.get('/org/getOrgIvhTreeList?useType=' + useType + '&orgSetID=' + orgSetID, apiConfig.create());
},
......@@ -107,9 +96,7 @@ webservices.factory('orgService', ['$http', 'apiConfig', function ($http, apiCon
getOrgListLevel: function () {
return $http.get('/org/getOrgListLevel', apiConfig.create());
},
getOrgInfoList: function () {
return $http.get('/org/getOrgInfoList', apiConfig.create());
},
getOrgListByUserId: function () {
return $http.get('/org/getOrgListByUserId', apiConfig.create());
},
......@@ -142,6 +129,7 @@ webservices.factory('orgService', ['$http', 'apiConfig', function ($http, apiCon
},
getAllActiveOrgList: function () {
return $http.get('/org/displayList', apiConfig.create());
}
},
};
}]);
\ No newline at end of file
// web service proxy for org
webservices.factory('orgHKService', ['$http', 'apiConfig', function ($http, apiConfig) {
'use strict';
return {
getOrgInfoList: function () {
return $http.get('/orgHK/getOrgInfoList', apiConfig.create());
},
enableOrgs: function (id) {
return $http.get('/orgHK/enableOrgs?orgId=' + id, apiConfig.create());
},
disableOrgs: function (orgList) {
return $http.post('/orgHK/disableOrgs', orgList, apiConfig.create());
},
updateOrg: function (org) {
return $http.put('/orgHK/update', org, apiConfig.create());
},
getOrgListToJson: function (type) {
return $http.get('/orgHK/getjson?useType=' + type, apiConfig.create());
},
getSingleOrg: function (orgId) {
return $http.get('/org/displaySingle?orgId=' + orgId, apiConfig.create());
},
}
}]);
\ 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