Merge branch 'develop'

master
eason.qian 7 years ago
commit a9fdea18c2

@ -39,7 +39,7 @@ public interface OrgMapper {
void updateOrg(JSONObject org); void updateOrg(JSONObject org);
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1") @AdvanceSelect(addonWhereClause = "is_valid=1 AND parent_org_id is null")
List<JSONObject> listAllOrgs(); List<JSONObject> listAllOrgs();
JSONObject findOrgByBDId(@Param("bd_id") int bd_id); JSONObject findOrgByBDId(@Param("bd_id") int bd_id);

@ -2051,16 +2051,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
if (!StringUtils.isNotBlank(master_merchant)) { if (!StringUtils.isNotBlank(master_merchant)) {
throw new NotFoundException("Invalid Input"); //throw new NotFoundException("Invalid Input");
} JSONObject master_client = getClientInfoByMoniker(master_merchant);
JSONObject master_client = getClientInfoByMoniker(master_merchant); if (master_client == null) {
if (master_client == null) { throw new InvalidShortIdException();
throw new InvalidShortIdException(); }
} if (StringUtils.isNotBlank(master_client.getString("parent_client_id"))) {
if (StringUtils.isNotBlank(master_client.getString("parent_client_id"))) { throw new BadRequestException("Master Merchant is not valid");
throw new BadRequestException("Master Merchant is not valid"); }
client.put("parent_client_id", master_client.getIntValue("client_id"));
}else {
client.put("parent_client_id", null);
} }
client.put("parent_client_id", master_client.getIntValue("client_id"));
clientMapper.update(client); clientMapper.update(client);
} }

@ -589,25 +589,15 @@
</select> </select>
<select id="listExchangeRates" resultType="com.alibaba.fastjson.JSONObject"> <select id="listExchangeRates" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT SELECT max(t.transaction_time) mx,t.exchange_rate,date(t.transaction_time) `date`
t.exchange_rate,
date(t.transaction_time) `date`
FROM
pmt_transactions t
INNER JOIN (
SELECT max(t.transaction_time) mx
FROM FROM
pmt_transactions t pmt_transactions t
WHERE date(t.transaction_time) >= #{begin} AND date(t.transaction_time) <= #{end} AND WHERE date(t.transaction_time) >= #{begin} #AND date(t.transaction_time) <= #{end} AND
t.transaction_type = 'Credit'AND t.channel = #{channel} and t.transaction_type ='Credit' AND t.channel =#{channel}
GROUP BY GROUP BY
date(t.transaction_time) date(t.transaction_time)
) o order by `date` asc
ON
t.transaction_time = o.mx
ORDER BY
`date` ASC
]]> ]]>
</select> </select>

@ -17,7 +17,8 @@
username,role,m.is_valid,m.create_time,last_login,o.name org_name, username,role,m.is_valid,m.create_time,last_login,o.name org_name,
email,phone,wechat, email,phone,wechat,
o.headimg, o.headimg,
o.nickname o.nickname,
o.parent_org_id
FROM FROM
sys_managers m sys_managers m
LEFT JOIN sys_org o ON o.org_id=m.org_id LEFT JOIN sys_org o ON o.org_id=m.org_id

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.OrgMapper"> <mapper namespace="au.com.royalpay.payment.manage.mappers.system.OrgMapper">
<select id="listOrgs" resultType="com.alibaba.fastjson.JSONObject"> <select id="listOrgs" resultType="com.alibaba.fastjson.JSONObject">
SELECT name,org_id,sort_no FROM sys_org WHERE is_valid=1 SELECT name,org_id,sort_no FROM sys_org WHERE is_valid=1 AND parent_org_id is null
<if test="type!=null"> <if test="type!=null">
and type=#{type} and type=#{type}
</if> </if>

@ -13,6 +13,7 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}]); }]);
app.controller('managerListCtrl', ['$scope', '$http', '$filter','$uibModal', 'commonDialog', function ($scope, $http,$filter, $uibModal, commonDialog) { app.controller('managerListCtrl', ['$scope', '$http', '$filter','$uibModal', 'commonDialog', function ($scope, $http,$filter, $uibModal, commonDialog) {
$scope.search = {role:'111111111111'}; $scope.search = {role:'111111111111'};
$scope.params = {};
$scope.listManagers = function () { $scope.listManagers = function () {
$http.get('/sys/manager_accounts').then(function (resp) { $http.get('/sys/manager_accounts').then(function (resp) {
$scope.managers = resp.data; $scope.managers = resp.data;
@ -26,6 +27,14 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}; };
$scope.listOrgs(); $scope.listOrgs();
} }
$scope.loadOrgsChild= function (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;
})
};
$scope.listManagers(); $scope.listManagers();
@ -65,6 +74,32 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}]); }]);
app.controller('modifyManagerDialogCtrl', ['$scope', '$http', 'manager', function ($scope, $http, manager) { app.controller('modifyManagerDialogCtrl', ['$scope', '$http', 'manager', function ($scope, $http, manager) {
$scope.manager = manager; $scope.manager = manager;
$scope.params = {};
$scope.loadOrgs = function () {
$http.get('/sys/orgs').then(function (resp) {
$scope.orgs = resp.data;
})
};
$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;
$http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) {
$scope.orgs_child = resp.data;
})
};
if(!$scope.manager.parent_org_id){
$scope.is_org2 = 'not_is'
}else {
$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.modify = function () {
$scope.errmsg = null; $scope.errmsg = null;
if($scope.manager.password && $scope.manager.password.length < 8){ if($scope.manager.password && $scope.manager.password.length < 8){
@ -76,20 +111,30 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
// $scope.errmsg = 'The password needs to consist of 8-16 digits and letters !'; // $scope.errmsg = 'The password needs to consist of 8-16 digits and letters !';
// return; // return;
// } // }
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 () { $http.put('/sys/manager_accounts/' + manager.manager_id, $scope.manager).then(function () {
$scope.$close(); $scope.$close();
}, function (resp) { }, function (resp) {
$scope.errmsg = resp.data.message; $scope.errmsg = resp.data.message;
}) })
}; };
$scope.loadOrgs = function () {
$http.get('/sys/orgs').then(function (resp) {
$scope.orgs = resp.data;
}) $scope.changeIsOrg2 = function (choose_org2) {
}; if($scope.choose_org != choose_org2){
$scope.loadOrgs(); $scope.is_org2 = 'is';
}else {
$scope.is_org2 = 'not_is'
}
}
}]); }]);
app.controller('newManagerDialogCtrl', ['$scope', '$http', function ($scope, $http) { app.controller('newManagerDialogCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.params = {};
$scope.is_org2 = 'not_is';
$scope.save = function (form) { $scope.save = function (form) {
$scope.errmsg = null; $scope.errmsg = null;
if (form.$invalid) { if (form.$invalid) {
@ -109,6 +154,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
// $scope.errmsg = 'The password needs to consist of 8-16 digits and letters !'; // $scope.errmsg = 'The password needs to consist of 8-16 digits and letters !';
// return; // return;
// } // }
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 () { $http.post('/sys/manager_accounts', $scope.manager).then(function () {
$scope.$close(); $scope.$close();
}, function (resp) { }, function (resp) {
@ -121,6 +170,24 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}) })
}; };
$scope.loadOrgs(); $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;
$http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) {
$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 () { app.filter('managersFilter', [function () {
return function (arr, filterObj) { return function (arr, filterObj) {
@ -128,7 +195,7 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
return arr; return arr;
} }
return arr.filter(function (item) { return arr.filter(function (item) {
return (filterObj.username==null || item.username.indexOf(filterObj.username) >= 0) && (item.role & parseInt(filterObj.role, 2)) > 0 && (!filterObj.org_id || item.org_id==filterObj.org_id) return (filterObj.username==null || item.username.indexOf(filterObj.username) >= 0) && (item.role & parseInt(filterObj.role, 2)) > 0 && (!filterObj.org_id || (item.org_id==filterObj.org_id))
}) })
} }
}]); }]);

@ -38,10 +38,18 @@
</div> </div>
<div class="form-group" ng-if="'1'|withRole"> <div class="form-group" ng-if="'1'|withRole">
<select id="org-select" class="form-control" ng-model="search.org_id" <select id="org-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"> ng-options="org.org_id as org.name group by org.org_type for org in orgs"
ng-change="loadOrgsChild(search.org_id)">
<option value="">All Organizations</option> <option value="">All Organizations</option>
</select> </select>
</div> </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">
<option value="">Sub Organizations</option>
</select>
</div>
<!--<div class="form-group" ng-if="'1'|withRole"> <!--<div class="form-group" ng-if="'1'|withRole">
<label class="control-label" for="org-select">Organizations</label> <label class="control-label" for="org-select">Organizations</label>
<select class="form-control" id="org-select" ng-model="search.org_id" ng-options="o.org_id as o.name for o in orgs"> <select class="form-control" id="org-select" ng-model="search.org_id" ng-options="o.org_id as o.name for o in orgs">

@ -45,7 +45,7 @@
<input class="form-control" type="text" id="wechat-input" name="wechat" <input class="form-control" type="text" id="wechat-input" name="wechat"
ng-model="manager.wechat"> ng-model="manager.wechat">
</div> </div>
<div class="form-group"> <div class="form-group" ng-if="is_org2=='not_is'">
<label class="control-label">Roles</label> <label class="control-label">Roles</label>
<p class="checkbox-inline checkbox"> <p class="checkbox-inline checkbox">
<label ng-if="('00001'|withRole)"> <label ng-if="('00001'|withRole)">
@ -86,13 +86,31 @@
</label> </label>
</p> </p>
</div> </div>
<div class="form-group" ng-if="!currentUser.org_id && is_org2=='is'">
<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>
</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> <label class="control-label" for="org-select">Organization</label>
<select class="form-control" ng-model="manager.org_id" id="org-select" <select class="form-control" ng-model="manager.org_id" id="org-select"
ng-options="org.org_id as org.name for org in orgs"> ng-options="org.org_id as org.name for org in orgs"
ng-change="manager.org_id2 = 'null';loadOrgsChild(manager.org_id)">
<option value="">Global</option> <option value="">Global</option>
</select> </select>
</div> </div>
<div class="form-group" ng-if="('1'|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)">
<option value="">Choose</option>
</select>
</div>
</form> </form>
</div> </div>
</div> </div>

@ -51,7 +51,7 @@
<input class="form-control" type="text" id="wechat-input" name="wechat" <input class="form-control" type="text" id="wechat-input" name="wechat"
ng-model="manager.wechat"> ng-model="manager.wechat">
</div> </div>
<div class="form-group" ng-if="!currentUser.org_id"> <div class="form-group" ng-if="!currentUser.org_id && is_org2=='not_is'">
<label class="control-label">Roles</label> <label class="control-label">Roles</label>
<p class="checkbox checkbox-inline"> <p class="checkbox checkbox-inline">
<label ng-if="('00001'|withRole)"> <label ng-if="('00001'|withRole)">
@ -95,13 +95,33 @@
</label> </label>
</p> </p>
</div> </div>
<div class="form-group" ng-if="!currentUser.org_id && is_org2=='is'">
<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>
</p>
</div>
<div class="form-group" ng-if="('1'|withRole) && !manager.admin && !manager.operator && orgs != null"> <div class="form-group" ng-if="('1'|withRole) && !manager.admin && !manager.operator && orgs != null">
<label class="control-label" for="org-select">Organization</label> <label class="control-label" for="org-select">Organization</label>
<select class="form-control" ng-model="manager.org_id" id="org-select" <select class="form-control" ng-model="manager.org_id" id="org-select"
ng-options="org.org_id as org.name for org in orgs"> ng-options="org.org_id as org.name for org in orgs"
ng-change="manager.org_id2 = 'null';loadOrgsChild(manager.org_id)">
<option value="">Global</option> <option value="">Global</option>
</select> </select>
</div> </div>
<div class="form-group" ng-if="('1'|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)">
<option value="">Choose</option>
</select>
</div>
</form> </form>
</div> </div>
</div> </div>

Loading…
Cancel
Save