Merge branch 'develop'

master
eason.qian 7 years ago
commit be08073c17

@ -8,7 +8,7 @@ import java.util.Date;
* Created by yixian on 2016-11-08.
*/
public interface ClientRatesAnalysisService {
JSONObject listAnalysisOfBDUsers(JSONObject manager, String orgId,String orgIds, Date beginDate, Date endDate);
JSONObject listAnalysisOfBDUsers(JSONObject manager, String orgId,String orgId2, Date beginDate, Date endDate);
JSONObject listAllClientRates(Integer orgId, ClientRateQueryBean query);

@ -46,13 +46,13 @@ public class ClientRatesAnalysisServiceImpl implements ClientRatesAnalysisServic
private OrgManager orgManager;
@Override
public JSONObject listAnalysisOfBDUsers(JSONObject manager, String orgId, String orgIds,Date beginDate, Date endDate) {
public JSONObject listAnalysisOfBDUsers(JSONObject manager, String orgId, String orgId2,Date beginDate, Date endDate) {
JSONObject params = new JSONObject();
if (orgId != null) {
params.put("org_id", orgId);
}
if (StringUtils.isNotEmpty(orgIds)) {
params.put("org_ids", orgIds);
if (StringUtils.isNotEmpty(orgId2)) {
params.put("org_id2", orgId2);
}
if (ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) {

@ -35,7 +35,7 @@ public class ClientRatesController {
@RequestMapping("/bd_users")
public JSONObject listAnalysisOfBDUsers(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
@RequestParam(name = "org_id", required = false) String orgId,
@RequestParam(name = "org_ids", required = false) String orgIds,
@RequestParam(name = "org_id2", required = false) String orgId2,
@RequestParam String begin, @RequestParam String end) {
Date beginDate;
try {
@ -49,7 +49,7 @@ public class ClientRatesController {
} catch (ParseException e) {
throw new ParamInvalidException("end", "error.payment.valid.invalid_date_format");
}
return clientRatesAnalysisService.listAnalysisOfBDUsers(manager,orgId, orgIds, beginDate, endDate);
return clientRatesAnalysisService.listAnalysisOfBDUsers(manager,orgId, orgId2, beginDate, endDate);
}
@RequestMapping("/orgs/all")

@ -152,14 +152,21 @@ public class OrgManagerImpl implements OrgManager {
@Override
public JSONObject checkOrgIds(JSONObject manager, JSONObject params) {
if(params.getString("org_id") != null){
if(params.getString("org_ids") == null){
if(params.getString("org_id2") == null){
orgIds(params,manager);
}else {
params.put("org_id",params.getString("org_ids"));
params.remove("org_ids");
if (manager.getInteger("org_id")!=null){
List<JSONObject> orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id"));
List<Integer> orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList());
if (!orgIds.contains(params.getString("org_id2"))){
throw new ForbiddenException("You have no permission to query the org");
}
}
params.put("org_id",params.getString("org_id2"));
params.remove("org_id2");
}
}else {
if(params.getString("org_ids") == null){
if(params.getString("org_id2") == null){
if(manager.getIntValue("org_id") > 0){
List<JSONObject> orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id"));
if (orgs.size()>1){
@ -170,8 +177,15 @@ public class OrgManagerImpl implements OrgManager {
}
}
}else {
params.put("org_id",params.getString("org_ids"));
params.remove("org_ids");
if (manager.getInteger("org_id")!=null){
List<JSONObject> orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id"));
List<Integer> orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList());
if (!orgIds.contains(params.getString("org_id2"))){
throw new ForbiddenException("You have no permission to query the org");
}
}
params.put("org_id",params.getString("org_id2"));
params.remove("org_id2");
}
}
return params;

@ -37,7 +37,7 @@ public class TradeLogQuery {
private boolean onlyGroup = false;
private int group_bd;
private String org_id;
private String org_ids;
private String org_id2;
public JSONObject toParams(String timezone) {
JSONObject params = new JSONObject();
@ -97,8 +97,8 @@ public class TradeLogQuery {
params.put("org_id", org_id);
}
if (StringUtils.isNotEmpty(org_ids)) {
params.put("org_ids", org_ids);
if (StringUtils.isNotEmpty(org_id2)) {
params.put("org_id2", org_id2);
}
return params;
}
@ -232,11 +232,11 @@ public class TradeLogQuery {
this.org_id = org_id;
}
public String getOrg_ids() {
return org_ids;
public String getorg_id2() {
return org_id2;
}
public void setOrg_ids(String org_ids) {
this.org_ids = org_ids;
public void setorg_id2(String org_id2) {
this.org_id2 = org_id2;
}
}

@ -15,12 +15,12 @@
<a class="btn btn-default" ui-sref="analysis_monitoring.client_rates"><i class="fa fa-chevron-left"></i></a>
</div>
<div class="input-group" ng-if="('analysis_monitoring.client_rates'|isState) && !currentUser.org_id">
<select ng-model="params.org_id" ng-change="params.org_ids = '';loadBDUsers();loadOrgChild()" class="form-control" ng-options="org.org_id as org.name for org in orgs">
<select ng-model="params.org_id" ng-change="params.org_id2 = '';loadBDUsers();loadOrgChild()" class="form-control" ng-options="org.org_id as org.name for org in orgs">
<option value="">All</option>
</select>
</div>
<div class="input-group" ng-if="(('1000000000000'|withRole) && (orgs_child.length>1)) || (params.org_id && (orgs_child.length>1))">
<select ng-model="params.org_ids" ng-change="loadBDUsers()" class="form-control" ng-options="org.org_id as org.name for org in orgs_child">
<select ng-model="params.org_id2" ng-change="loadBDUsers()" class="form-control" ng-options="org.org_id as org.name for org in orgs_child">
<option value="">All</option>
</select>
</div>

@ -61,13 +61,13 @@
<div ng-if="orgs" class="col-sm-6">
<select id="org-clild" class="form-control" ng-model="params.org_id"
ng-options="org.org_id as org.name group by org.type for org in orgs"
ng-change="params.org_ids = '';loadOrgs();loadTradeLogs(1)">
ng-change="params.org_id2 = '';loadOrgs();loadTradeLogs(1)">
<option value="">All</option>
</select>
</div>
<div ng-if="((orgs_child.length > 1) && ('1000011'|withRole))&&params.org_id || ((orgs_child.length > 0) && ('1000000000000'|withRole))" class="col-sm-6">
<select id="org-select" class="form-control" ng-model="params.org_ids"
<select id="org-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="loadTradeLogs(1)">
<option value="">All</option>

Loading…
Cancel
Save