master
kira 6 years ago
parent d1b3de8b87
commit 6de18d4324

@ -42,6 +42,10 @@ public interface OrgMapper {
@AdvanceSelect(addonWhereClause = "is_valid=1 AND parent_org_id is null") @AdvanceSelect(addonWhereClause = "is_valid=1 AND parent_org_id is null")
List<JSONObject> listAllOrgs(); List<JSONObject> listAllOrgs();
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1 AND senior_parent_org_id=0")
List<JSONObject> listSeniorOrgs();
JSONObject findOrgByBDId(@Param("bd_id") String bd_id); JSONObject findOrgByBDId(@Param("bd_id") String bd_id);
PageList<JSONObject> listOrgWithPages(JSONObject paraams, PageBounds order); PageList<JSONObject> listOrgWithPages(JSONObject paraams, PageBounds order);

@ -42,6 +42,7 @@ public class OrgInfo {
private Double min_jd_rate; private Double min_jd_rate;
private Double min_alipayonline_rate; private Double min_alipayonline_rate;
private Double min_hf_rate; private Double min_hf_rate;
private String senior_parent_org_id;
public JSONObject toJsonParam() { public JSONObject toJsonParam() {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
@ -54,15 +55,19 @@ public class OrgInfo {
if (StringUtils.isNotBlank(search_text)) { if (StringUtils.isNotBlank(search_text)) {
param.put("search_text", search_text); param.put("search_text", search_text);
} }
if (type != null){ if (type != null) {
param.put("type", type); param.put("type", type);
} }
if (StringUtils.isNotBlank(parent_org_id)){ if (StringUtils.isNotBlank(parent_org_id)) {
param.put("parent_org_id", parent_org_id); param.put("parent_org_id", parent_org_id);
} }
if (StringUtils.isNotBlank(org_id)){ if (StringUtils.isNotBlank(org_id)) {
param.put("org_id", org_id); param.put("org_id", org_id);
} }
if (StringUtils.isNotBlank(senior_parent_org_id)) {
param.put("senior_parent_org_id", senior_parent_org_id);
}
return param; return param;
} }
@ -301,4 +306,12 @@ public class OrgInfo {
public void setMin_hf_rate(Double min_hf_rate) { public void setMin_hf_rate(Double min_hf_rate) {
this.min_hf_rate = min_hf_rate; this.min_hf_rate = min_hf_rate;
} }
public String getSenior_parent_org_id() {
return senior_parent_org_id;
}
public void setSenior_parent_org_id(String senior_parent_org_id) {
this.senior_parent_org_id = senior_parent_org_id;
}
} }

@ -11,6 +11,8 @@ import java.util.List;
public interface OrgManager { public interface OrgManager {
List<JSONObject> listOrgs(boolean detail); List<JSONObject> listOrgs(boolean detail);
List<JSONObject> listSeniorOrgs();
List<JSONObject> listOrgsWithChid(JSONObject manager,OrgInfo orgInfo); List<JSONObject> listOrgsWithChid(JSONObject manager,OrgInfo orgInfo);
List<JSONObject> listOrgAndChild(JSONObject manager); List<JSONObject> listOrgAndChild(JSONObject manager);

@ -3,25 +3,25 @@ package au.com.royalpay.payment.manage.organizations.core.impls;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper; import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.organizations.beans.OrgInfo; import au.com.royalpay.payment.manage.organizations.beans.OrgInfo;
import au.com.royalpay.payment.manage.organizations.core.OrgManager; import au.com.royalpay.payment.manage.organizations.core.OrgManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils; import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order; import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Resource;
/** /**
* Created by yixian on 2016-10-18. * Created by yixian on 2016-10-18.
*/ */
@ -36,6 +36,11 @@ public class OrgManagerImpl implements OrgManager {
return orgMapper.listOrgs(0,sort); return orgMapper.listOrgs(0,sort);
} }
@Override
public List<JSONObject> listSeniorOrgs() {
return orgMapper.listSeniorOrgs();
}
@Override @Override
public List<JSONObject> listOrgsWithChid(JSONObject manager,OrgInfo orgInfo) { public List<JSONObject> listOrgsWithChid(JSONObject manager,OrgInfo orgInfo) {
JSONObject params = new JSONObject(); JSONObject params = new JSONObject();

@ -3,18 +3,26 @@ package au.com.royalpay.payment.manage.organizations.web;
import au.com.royalpay.payment.manage.organizations.beans.OrgInfo; import au.com.royalpay.payment.manage.organizations.beans.OrgInfo;
import au.com.royalpay.payment.manage.organizations.core.OrgManager; import au.com.royalpay.payment.manage.organizations.core.OrgManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.permission.manager.RequireManager; import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.http.HttpUtils;
import com.alibaba.fastjson.JSONArray; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List;
/** /**
* Created by yixian on 2016-10-18. * Created by yixian on 2016-10-18.
@ -31,6 +39,12 @@ public class OrgManageController {
return orgManager.listOrgs(detail); return orgManager.listOrgs(detail);
} }
@RequestMapping(value = "/senior",method = RequestMethod.GET)
@RequireManager
public List<JSONObject> listSeniorOrgs() {
return orgManager.listSeniorOrgs();
}
@RequestMapping(value = "/orgChild",method = RequestMethod.GET) @RequestMapping(value = "/orgChild",method = RequestMethod.GET)
@RequireManager @RequireManager
public List<JSONObject> listOrgsWithChid(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,OrgInfo orgInfo) { public List<JSONObject> listOrgsWithChid(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,OrgInfo orgInfo) {

@ -92,6 +92,17 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
if (($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id) { if (($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id) {
$scope.org.type = 0; $scope.org.type = 0;
} }
$scope.loadSeniorOrg = function () {
$http.get('/sys/orgs/senior').then(function (resp) {
$scope.seniorOrgs = resp.data;
var senior = {org_id:0,name:'I\'m Senior'}
var noop = {org_id:-1,name:'noop'}
$scope.seniorOrgs.unshift(noop);
$scope.seniorOrgs.unshift(senior);
})
};
$scope.loadSeniorOrg(1);
$scope.uploadLogo = function (file) { $scope.uploadLogo = function (file) {
if (file == null) { if (file == null) {
return; return;
@ -292,6 +303,16 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
app.controller('newOrgCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', function ($scope, $http, $state, Upload, commonDialog) { app.controller('newOrgCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', function ($scope, $http, $state, Upload, commonDialog) {
$scope.types = angular.copy(types); $scope.types = angular.copy(types);
$scope.commission_types = angular.copy(commission_types); $scope.commission_types = angular.copy(commission_types);
$scope.loadSeniorOrg = function () {
$http.get('/sys/orgs/senior').then(function (resp) {
$scope.seniorOrgs = resp.data;
var senior = {org_id:0,name:'I\'m Senior'}
var noop = {org_id:-1,name:'noop'}
$scope.seniorOrgs.unshift(noop);
$scope.seniorOrgs.unshift(senior);
})
};
$scope.loadSeniorOrg(1);
$scope.uploadLogo = function (file) { $scope.uploadLogo = function (file) {
if (file == null) { if (file == null) {
return; return;

@ -55,6 +55,16 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-sm-2" for="senior_parent_org_id">Senior Partner </label>
<div class="col-sm-8">
<select class="form-control" name="senior_parent_org_id" ng-model="org.senior_parent_org_id" id="senior_parent_org_id"
ng-options="seniorOrg.org_id as seniorOrg.name for seniorOrg in seniorOrgs">
</select>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.commission_type_0.$invalid && org_form.commission_type_0.$dirty}" <div class="form-group" ng-class="{'has-error':org_form.commission_type_0.$invalid && org_form.commission_type_0.$dirty}"
ng-show="org.type == 0 || ('1000000000000'|withRole)"> ng-show="org.type == 0 || ('1000000000000'|withRole)">
<label class="control-label col-sm-2" for="commission_type_0">Commission Type *</label> <label class="control-label col-sm-2" for="commission_type_0">Commission Type *</label>
@ -66,6 +76,9 @@
</select> </select>
</div> </div>
</div> </div>
<div ng-if="org.type == 1"> <div ng-if="org.type == 1">
<div class="form-group" <div class="form-group"
ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}"> ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}">

@ -71,7 +71,15 @@
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" name="commission_type_0" required ng-model="org.commission_type" id="commission_type_0" <select class="form-control" name="commission_type_0" required ng-model="org.commission_type" id="commission_type_0"
ng-options="commission_type.value as commission_type.label for commission_type in commission_types"> ng-options="commission_type.value as commission_type.label for commission_type in commission_types">
<option value="">Please Choose</option> </select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="senior_parent_org_id">Senior Partner </label>
<div class="col-sm-8">
<select class="form-control" name="senior_parent_org_id" ng-model="org.senior_parent_org_id" id="senior_parent_org_id"
ng-options="seniorOrg.org_id as seniorOrg.name for seniorOrg in seniorOrgs">
<option value="-1">noop</option>
</select> </select>
</div> </div>
</div> </div>

Loading…
Cancel
Save