Merge branch 'develop'

master
eason.qian 7 years ago
commit 54e8c5bb6e

@ -272,4 +272,5 @@ public class ManagerInfo {
public void setOrgmanager(boolean orgmanager) {
this.orgmanager = orgmanager;
}
}

@ -9,7 +9,7 @@ import java.util.List;
* Created by yixian on 2016-07-05.
*/
public interface ManagerAccountsService {
List<JSONObject> listManagers(JSONObject loginManager);
List<JSONObject> listManagers(JSONObject loginManager,JSONObject params);
void saveManager(ManagerInfo manager, JSONObject loginManager);

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.signin.core.impls;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.organizations.core.OrgManager;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.signin.beans.ManagerInfo;
import au.com.royalpay.payment.manage.signin.core.ManagerAccountsService;
@ -30,12 +31,15 @@ public class ManagerAccountServiceImpl implements ManagerAccountsService {
@Resource
private FinancialBDConfigMapper financialBDConfigMapper;
@Resource
private OrgManager orgManager;
@Override
public List<JSONObject> listManagers(JSONObject loginManager) {
JSONObject params = new JSONObject();
if (loginManager.getInteger("org_id") != null) {
public List<JSONObject> listManagers(JSONObject loginManager,JSONObject params) {
/* if (loginManager.getInteger("org_id") != null) {
params.put("org_id", loginManager.getIntValue("org_id"));
}
}*/
orgManager.checkOrgIds(loginManager,params);
List<JSONObject> managers = managerMapper.listAvailable(params, new PageBounds(Order.formString("create_time.desc")));
for (JSONObject manager : managers) {
int role = manager.getIntValue("role");

@ -10,6 +10,7 @@ import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.http.HttpUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*;
@ -37,9 +38,15 @@ public class ManagerAccountsController {
@RequestMapping(method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.ACCOUNT_MANAGER})
public List<JSONObject> listManagerss(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager, @RequestParam Map<String, Object> map) {
loginManager.putAll(map);
return managerAccountsService.listManagers(loginManager);
public List<JSONObject> listManagerss(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager, @RequestParam(required = false) String org_id,@RequestParam(required = false) String org_id2) {
JSONObject params = new JSONObject();
if(org_id != null){
params.put("org_id",org_id);
}
if (StringUtils.isNotEmpty(org_id2)) {
params.put("org_id2", org_id2);
}
return managerAccountsService.listManagers(loginManager,params);
}
@RequestMapping(method = RequestMethod.POST)

@ -50,7 +50,7 @@
<select id="listRoyalPayUsers" resultType="com.alibaba.fastjson.JSONObject">
SELECT m.*
FROM sys_managers m
WHERE m.org_id IS NULL OR m.org_id = 1
WHERE (m.org_id IS NULL OR m.org_id = 1) AND m.is_valid=1
</select>
<select id="getOnlyCompliance" resultType="com.alibaba.fastjson.JSONObject">
@ -68,7 +68,7 @@
</select>
<select id="listRiskManagers" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
select wx_openid from sys_managers WHERE role & 10000000000 and wx_openid is not null
select wx_openid from sys_managers WHERE role & 10000000000 and wx_openid is not null AND is_valid = 1
]]>
</select>
@ -77,6 +77,7 @@
<foreach collection="list" separator="," close=")" open="(" item="item">
#{item}
</foreach>
AND is_valid = 1
</select>
<select id="listOpenIdByRole" resultType="com.alibaba.fastjson.JSONObject">

@ -15,7 +15,8 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
$scope.search = {role:'111111111111'};
$scope.params = {};
$scope.listManagers = function () {
$http.get('/sys/manager_accounts').then(function (resp) {
var params = angular.copy($scope.params);
$http.get('/sys/manager_accounts',{params: params}).then(function (resp) {
$scope.managers = resp.data;
})
};
@ -35,8 +36,6 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
})
};
$scope.listManagers();
$scope.modifyManager = function (manager) {
$uibModal.open({
@ -75,7 +74,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
app.controller('modifyManagerDialogCtrl', ['$scope', '$http', 'manager', function ($scope, $http, manager) {
$scope.manager = manager;
$scope.params = {};
$scope.loadOrgs = function () {
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
$scope.isModifyOrgManage = true;
}
/*$scope.loadOrgs = function () {
$http.get('/sys/orgs').then(function (resp) {
$scope.orgs = resp.data;
})
@ -83,7 +85,6 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
$scope.loadOrgs();
$scope.loadOrgsChild= function (org_id) {
$scope.is_org2 = 'not_is';
$scope.choose_org = org_id;
var params = angular.copy($scope.params);
params.org_id = org_id;
@ -91,15 +92,19 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
$scope.orgs_child = resp.data;
})
};
if(!$scope.manager.parent_org_id){
$scope.is_org2 = 'not_is'
}else {
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
var params = angular.copy($scope.params);
params.org_id = $scope.currentUser.org_id;
$http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) {
$scope.orgs_child = resp.data;
})
$scope.manager.org_id2 = $scope.manager.org_id;
}
if($scope.manager.parent_org_id){
$scope.manager.org_id2 = $scope.manager.org_id;
$scope.manager.org_id = $scope.manager.parent_org_id;
$scope.loadOrgsChild($scope.manager.org_id);
$scope.is_org2 = 'is';
};
}*/
$scope.modify = function () {
$scope.errmsg = null;
if($scope.manager.password && $scope.manager.password.length < 8){
@ -111,9 +116,9 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
// $scope.errmsg = 'The password needs to consist of 8-16 digits and letters !';
// return;
// }
if($scope.manager.org_id2 != null && $scope.manager.org_id2 != 'null') {
/* if($scope.manager.org_id2 != null && $scope.manager.org_id2 != 'null') {
$scope.manager.org_id = $scope.manager.org_id2;
}
}*/
$http.put('/sys/manager_accounts/' + manager.manager_id, $scope.manager).then(function () {
$scope.$close();
}, function (resp) {
@ -121,20 +126,16 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
})
};
$scope.changeIsOrg2 = function (choose_org2) {
if($scope.choose_org != choose_org2){
$scope.is_org2 = 'is';
}else {
$scope.is_org2 = 'not_is'
}
}
}]);
app.controller('newManagerDialogCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.params = {};
$scope.is_org2 = 'not_is';
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
var params = angular.copy($scope.params);
params.org_id = $scope.currentUser.org_id;
$http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) {
$scope.orgs_child = resp.data;
})
}
$scope.save = function (form) {
$scope.errmsg = null;
if (form.$invalid) {
@ -154,6 +155,9 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
// $scope.errmsg = 'The password needs to consist of 8-16 digits and letters !';
// return;
// }
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
$scope.manager.bd = true;
}
if($scope.manager.org_id2 != "null") {
$scope.manager.org_id = $scope.manager.org_id2;
}
@ -172,7 +176,6 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
$scope.loadOrgs();
$scope.loadOrgsChild= function (org_id) {
$scope.is_org2 = 'not_is';
$scope.choose_org = org_id;
var params = angular.copy($scope.params);
params.org_id = org_id;
@ -180,14 +183,6 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
$scope.orgs_child = resp.data;
})
};
$scope.changeIsOrg2 = function (choose_org2) {
if($scope.choose_org != choose_org2){
$scope.is_org2 = 'is';
}else {
$scope.is_org2 = 'not_is'
}
}
}]);
app.filter('managersFilter', [function () {
return function (arr, filterObj) {

@ -17,7 +17,7 @@
<label class="control-label" for="username-filter-input">Username</label>
<input type="text" class="form-control" ng-model="search.username" placeholder="Username" id="username-filter-input">
</div>
<div class="form-group" ng-if="'1'|withRole">
<div class="form-group" ng-if="('1'|withRole)">
<label class="control-label" for="role-filter-select">Role</label>
<select class="form-control" id="role-filter-select" ng-model="search.role">
<option value="111111111111">All</option>
@ -36,17 +36,18 @@
<option value="1000000000000">Org Manager</option>
</select>
</div>
<div class="form-group" ng-if="'1'|withRole">
<select id="org-select" class="form-control" ng-model="search.org_id"
<div class="form-group" ng-if="('1'|withRole)">
<select id="org-select" class="form-control" ng-model="params.org_id"
ng-options="org.org_id as org.name group by org.org_type for org in orgs"
ng-change="loadOrgsChild(search.org_id)">
ng-change="params.org_id2 = '';listManagers();loadOrgsChild(params.org_id)">
<option value="">All Organizations</option>
</select>
</div>
<div ng-if="((orgs_child.length > 1)&&( '1'|withRole))">
<select id="org-child-select" class="form-control" ng-model="search.org_id"
ng-options="org.org_id as org.name group by org.org_type for org in orgs_child">
<div ng-if="(orgs_child.length > 1)&&('1'|withRole)&&params.org_id">
<select id="org-child-select" class="form-control" ng-model="params.org_id2"
ng-options="org.org_id as org.name group by org.org_type for org in orgs_child"
ng-change="listManagers()">
<option value="">Sub Organizations</option>
</select>
</div>

@ -45,7 +45,7 @@
<input class="form-control" type="text" id="wechat-input" name="wechat"
ng-model="manager.wechat">
</div>
<div class="form-group" ng-if="is_org2=='not_is'">
<div class="form-group" ng-if="!isOrgModify&&!isModifyOrgManage">
<label class="control-label">Roles</label>
<p class="checkbox-inline checkbox">
<label ng-if="('00001'|withRole)">
@ -86,15 +86,18 @@
</label>
</p>
</div>
<div class="form-group" ng-if="!currentUser.org_id && is_org2=='is'">
<div class="form-group" ng-if="isOrgModify&&!isModifyOrgManage">
<label class="control-label">Roles</label>
<p class="checkbox checkbox-inline">
<p class="checkbox-inline checkbox">
<label ng-if="!manager.admin && !manager.operator">
<input type="checkbox" ng-model="manager.bd" name="bd">BD User
</label>
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.orgmanager" name="orgmanager">Org Manager
</label>
</p>
</div>
<div class="form-group" ng-if="('1'|withRole) && !manager.admin && !manager.operator && !manager.sitemanager && orgs!=null">
<!-- <div class="form-group" ng-if="('1'|withRole) && !manager.admin && !manager.operator && !manager.sitemanager && orgs!=null">
<label class="control-label" for="org-select">Organization</label>
<select class="form-control" ng-model="manager.org_id" id="org-select"
ng-options="org.org_id as org.name for org in orgs"
@ -103,14 +106,13 @@
</select>
</div>
<div class="form-group" ng-if="('1'|withRole) && !manager.admin && !manager.operator && orgs_child.length > 1">
<div class="form-group" ng-if="(('1'|withRole)||('1000000000000'|withRole)) && !manager.admin && !manager.operator && !manager.sitemanager && orgs_child.length > 1">
<label class="control-label" for="org-select">Sub Organization</label>
<select class="form-control" ng-model="manager.org_id2" id="org-child-select"
ng-options="org.org_id as org.name group by org.org_type for org in orgs_child"
ng-change="changeIsOrg2(manager.org_id2)">
ng-options="org.org_id as org.name group by org.org_type for org in orgs_child">
<option value="">Choose</option>
</select>
</div>
</div>-->
</form>
</div>
</div>

@ -51,7 +51,7 @@
<input class="form-control" type="text" id="wechat-input" name="wechat"
ng-model="manager.wechat">
</div>
<div class="form-group" ng-if="!currentUser.org_id && is_org2=='not_is'">
<div class="form-group" ng-if="!currentUser.org_id&&!isOrg">
<label class="control-label">Roles</label>
<p class="checkbox checkbox-inline">
<label ng-if="('00001'|withRole)">
@ -95,13 +95,15 @@
</label>
</p>
</div>
<div class="form-group" ng-if="!currentUser.org_id && is_org2=='is'">
<div class="form-group" ng-if="!currentUser.org_id &&isOrg">
<label class="control-label">Roles</label>
<p class="checkbox checkbox-inline">
<label ng-if="!manager.admin && !manager.operator">
<input type="checkbox" ng-model="manager.bd" name="bd">BD User
</label>
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.orgmanager" name="guest">Org Manager
</label>
</p>
</div>
@ -114,11 +116,10 @@
</select>
</div>
<div class="form-group" ng-if="('1'|withRole) && !manager.admin && !manager.operator && orgs_child.length > 1">
<div class="form-group" ng-if="(('1'|withRole)||('1000000000000'|withRole)) && !manager.admin && !manager.operator && orgs_child.length > 1">
<label class="control-label" for="org-select">Sub Organization</label>
<select class="form-control" ng-model="manager.org_id2" id="org-child-select"
ng-options="org.org_id as org.name group by org.org_type for org in orgs_child"
ng-change="changeIsOrg2(manager.org_id2)">
ng-options="org.org_id as org.name group by org.org_type for org in orgs_child">
<option value="">Choose</option>
</select>
</div>

@ -336,7 +336,41 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
app.controller('modifyManagerCtrl', ['$scope', '$http', 'manager', function ($scope, $http, manager) {
$scope.manager = manager;
$scope.isOrgModify = true;
$scope.params = {};
/* $scope.loadOrgs = function () {
$http.get('/sys/orgs').then(function (resp) {
$scope.orgs = resp.data;
})
};
$scope.loadOrgs();
$scope.loadOrgsChild= function (org_id) {
$scope.choose_org = org_id;
var params = angular.copy($scope.params);
params.org_id = org_id;
$http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) {
$scope.orgs_child = resp.data;
})
};
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
$scope.loadOrgsChild($scope.currentUser.org_id);
}
if($scope.manager.parent_org_id){
$scope.manager.org_id2 = $scope.manager.org_id;
$scope.manager.org_id = $scope.manager.parent_org_id;
$scope.loadOrgsChild($scope.manager.org_id);
};*/
$scope.modify = function () {
/*if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
if($scope.manager.org_id2 != "null") {
$scope.manager.parent_org_id = $scope.manager.org_id2;
}
delete $scope.manager.org_id2;
}*/
/* if($scope.manager.org_id2 != null && $scope.manager.org_id2 != 'null') {
$scope.manager.org_id = $scope.manager.org_id2;
}*/
$scope.errmsg = null;
$http.put('/sys/manager_accounts/' + manager.manager_id, $scope.manager).then(function () {
$scope.$close();
@ -352,9 +386,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
$scope.loadOrgs();
}]);
app.controller('newManagerCtrl', ['$scope', '$http','org',function ($scope, $http,org) {
$scope.isOrg = true;
$scope.org = angular.copy(org);
$scope.save = function (form) {
$scope.manager.org_id = org.org_id;
$scope.manager.org_id = $scope.org.org_id;
$scope.errmsg = null;
if (form.$invalid) {
angular.forEach(form, function (item, key) {
@ -364,8 +399,12 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
});
return;
}
if(currentUser.org_id != null && !currentUser.parent_org_id){
$scope.manager.bd=true;
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id){
$scope.manager.bd = true;
/* if($scope.manager.org_id2 != "null") {
$scope.manager.org_id = $scope.manager.org_id2;
}
delete $scope.manager.org_id2;*/
}
$http.post('/sys/manager_accounts', $scope.manager).then(function () {

Loading…
Cancel
Save