Revert "backend-api http://jira.mfd.msk:8088/browse/CLS-525 выдача некоторых Account по meta (составное поле)"
This reverts commit 8e73a2eced.
This commit is contained in:
parent
d4b9ee6ec5
commit
2da6edd976
3 changed files with 8 additions and 73 deletions
|
|
@ -8,16 +8,11 @@ import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import ru.clearing.classes.statics.data.account.Account;
|
|
||||||
import ru.clearing.classes.statics.data.account.ClearingAccount;
|
import ru.clearing.classes.statics.data.account.ClearingAccount;
|
||||||
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
||||||
import ru.spcex.clearing.backendapi.meta.GetResponseFactory;
|
|
||||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||||
import ru.spcex.platform.imdg.api.Imdg;
|
|
||||||
import ru.spcex.platform.imdg.api.ImdgProvider;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
@ -25,16 +20,10 @@ import java.util.Map;
|
||||||
@RequestMapping("/accounting/clearing-accounts")
|
@RequestMapping("/accounting/clearing-accounts")
|
||||||
public class ClearingAccountController {
|
public class ClearingAccountController {
|
||||||
private final IStateLoader stateLoader;
|
private final IStateLoader stateLoader;
|
||||||
private final GetResponseFactory responseFactory;
|
|
||||||
private final Imdg<Account> accountImdg;
|
|
||||||
private final Imdg<ClearingAccount> clearingAccountImdg;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public ClearingAccountController(IStateLoader stateLoader, GetResponseFactory responseFactory, ImdgProvider imdgProvider) {
|
public ClearingAccountController(IStateLoader stateLoader) {
|
||||||
this.stateLoader = stateLoader;
|
this.stateLoader = stateLoader;
|
||||||
this.responseFactory = responseFactory;
|
|
||||||
accountImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_Account, Account.class);
|
|
||||||
clearingAccountImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_ClearingAccount, ClearingAccount.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "get all clearing account.")
|
@ApiOperation(value = "get all clearing account.")
|
||||||
|
|
@ -42,18 +31,7 @@ public class ClearingAccountController {
|
||||||
@RequestMapping(method = RequestMethod.GET)
|
@RequestMapping(method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public CommonGetAllResponse getAll() {
|
public CommonGetAllResponse getAll() {
|
||||||
Collection<ClearingAccount> accounts = clearingAccountImdg.getAllValues();
|
Collection<Map<String, Object>> all = stateLoader.getAllMetaTransform(IMDGDistributedNames.Map_ClearingAccount, ClearingAccount.class);
|
||||||
|
|
||||||
Collection<Map<String, Object>> all = new ArrayList<>(accounts.size());
|
|
||||||
for (ClearingAccount cAcc : accounts) {
|
|
||||||
Map<String, Object> fieldMap = responseFactory.responseFromObject(cAcc);
|
|
||||||
Account baseAccount = accountImdg.getSingleObjectByID(cAcc.getAccountId());
|
|
||||||
if (baseAccount != null) {
|
|
||||||
fieldMap.put("serviceStatus", baseAccount.getStatus());
|
|
||||||
}
|
|
||||||
all.add(fieldMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
CommonGetAllResponse response = new CommonGetAllResponse();
|
CommonGetAllResponse response = new CommonGetAllResponse();
|
||||||
response.fromEntity(all);
|
response.fromEntity(all);
|
||||||
return response;
|
return response;
|
||||||
|
|
|
||||||
|
|
@ -8,16 +8,11 @@ import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import ru.clearing.classes.statics.data.account.Account;
|
|
||||||
import ru.clearing.classes.statics.data.account.DepoAccount;
|
import ru.clearing.classes.statics.data.account.DepoAccount;
|
||||||
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
||||||
import ru.spcex.clearing.backendapi.meta.GetResponseFactory;
|
|
||||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||||
import ru.spcex.platform.imdg.api.Imdg;
|
|
||||||
import ru.spcex.platform.imdg.api.ImdgProvider;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
@ -25,16 +20,10 @@ import java.util.Map;
|
||||||
@RequestMapping("/accounting/depo-accounts")
|
@RequestMapping("/accounting/depo-accounts")
|
||||||
public class DepoAccountController {
|
public class DepoAccountController {
|
||||||
private final IStateLoader stateLoader;
|
private final IStateLoader stateLoader;
|
||||||
private final GetResponseFactory responseFactory;
|
|
||||||
private final Imdg<Account> accountImdg;
|
|
||||||
private final Imdg<DepoAccount> depoAccountImdg;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DepoAccountController(IStateLoader stateLoader, GetResponseFactory responseFactory, ImdgProvider imdgProvider) {
|
public DepoAccountController(IStateLoader stateLoader) {
|
||||||
this.stateLoader = stateLoader;
|
this.stateLoader = stateLoader;
|
||||||
this.responseFactory = responseFactory;
|
|
||||||
accountImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_Account, Account.class);
|
|
||||||
depoAccountImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_DepoAccount, DepoAccount.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "get all depo account.")
|
@ApiOperation(value = "get all depo account.")
|
||||||
|
|
@ -42,18 +31,7 @@ public class DepoAccountController {
|
||||||
@RequestMapping(method = RequestMethod.GET)
|
@RequestMapping(method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public CommonGetAllResponse getAll() {
|
public CommonGetAllResponse getAll() {
|
||||||
Collection<DepoAccount> accounts = depoAccountImdg.getAllValues();
|
Collection<Map<String, Object>> all = stateLoader.getAllMetaTransform(IMDGDistributedNames.Map_DepoAccount, DepoAccount.class);
|
||||||
|
|
||||||
Collection<Map<String, Object>> all = new ArrayList<>(accounts.size());
|
|
||||||
for (DepoAccount dAcc : accounts) {
|
|
||||||
Map<String, Object> fieldMap = responseFactory.responseFromObject(dAcc);
|
|
||||||
Account baseAccount = accountImdg.getSingleObjectByID(dAcc.getAccountId());
|
|
||||||
if (baseAccount != null) {
|
|
||||||
fieldMap.put("serviceStatus", baseAccount.getStatus());
|
|
||||||
}
|
|
||||||
all.add(fieldMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
CommonGetAllResponse response = new CommonGetAllResponse();
|
CommonGetAllResponse response = new CommonGetAllResponse();
|
||||||
response.fromEntity(all);
|
response.fromEntity(all);
|
||||||
return response;
|
return response;
|
||||||
|
|
|
||||||
|
|
@ -11,22 +11,18 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import ru.clearing.classes.statics.data.account.Account;
|
|
||||||
import ru.clearing.classes.statics.data.account.InformationAccount;
|
import ru.clearing.classes.statics.data.account.InformationAccount;
|
||||||
import ru.spcex.clearing.backendapi.controller.queue.AbstractQueueController;
|
import ru.spcex.clearing.backendapi.controller.queue.AbstractQueueController;
|
||||||
import ru.spcex.clearing.backendapi.controller.request.cud.account.AccountInformationNewAction;
|
import ru.spcex.clearing.backendapi.controller.request.cud.account.AccountInformationNewAction;
|
||||||
|
import ru.spcex.clearing.backendapi.controller.request.cud.account.BankAccountNewAction;
|
||||||
import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
|
import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
|
||||||
import ru.spcex.clearing.backendapi.controller.response.cud.CudResponse;
|
import ru.spcex.clearing.backendapi.controller.response.cud.CudResponse;
|
||||||
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
||||||
import ru.spcex.clearing.backendapi.meta.GetResponseFactory;
|
|
||||||
import ru.spcex.clearing.backendapi.service.IOperator;
|
import ru.spcex.clearing.backendapi.service.IOperator;
|
||||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
||||||
import ru.spcex.platform.imdg.api.Imdg;
|
|
||||||
import ru.spcex.platform.imdg.api.ImdgProvider;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
@ -35,18 +31,11 @@ import java.util.concurrent.ExecutionException;
|
||||||
@RequestMapping("/accounting/information-accounts")
|
@RequestMapping("/accounting/information-accounts")
|
||||||
public class InformationAccountController extends AbstractQueueController {
|
public class InformationAccountController extends AbstractQueueController {
|
||||||
private final IStateLoader stateLoader;
|
private final IStateLoader stateLoader;
|
||||||
private final GetResponseFactory responseFactory;
|
|
||||||
private final Imdg<Account> accountImdg;
|
|
||||||
private final Imdg<InformationAccount> informationAccountImdg;
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public InformationAccountController(IOperator operator, IStateLoader stateLoader, GetResponseFactory responseFactory, ImdgProvider imdgProvider) {
|
public InformationAccountController(IOperator operator, IStateLoader stateLoader) {
|
||||||
super(operator);
|
super(operator);
|
||||||
this.stateLoader = stateLoader;
|
this.stateLoader = stateLoader;
|
||||||
this.responseFactory = responseFactory;
|
|
||||||
accountImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_Account, Account.class);
|
|
||||||
informationAccountImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_InformationAccount, InformationAccount.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "get all information accounts.")
|
@ApiOperation(value = "get all information accounts.")
|
||||||
|
|
@ -54,18 +43,8 @@ public class InformationAccountController extends AbstractQueueController {
|
||||||
@RequestMapping(method = RequestMethod.GET)
|
@RequestMapping(method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public CommonGetAllResponse getAll() {
|
public CommonGetAllResponse getAll() {
|
||||||
Collection<InformationAccount> accounts = informationAccountImdg.getAllValues();
|
Collection<Map<String, Object>> all = stateLoader.getAllMetaTransform(IMDGDistributedNames.Map_InformationAccount,
|
||||||
|
InformationAccount.class);
|
||||||
Collection<Map<String, Object>> all = new ArrayList<>(accounts.size());
|
|
||||||
for (InformationAccount iAcc : accounts) {
|
|
||||||
Map<String, Object> fieldMap = responseFactory.responseFromObject(iAcc);
|
|
||||||
Account baseAccount = accountImdg.getSingleObjectByID(iAcc.getAccountId());
|
|
||||||
if (baseAccount != null) {
|
|
||||||
fieldMap.put("serviceStatus", baseAccount.getStatus());
|
|
||||||
}
|
|
||||||
all.add(fieldMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
CommonGetAllResponse response = new CommonGetAllResponse();
|
CommonGetAllResponse response = new CommonGetAllResponse();
|
||||||
response.fromEntity(all);
|
response.fromEntity(all);
|
||||||
return response;
|
return response;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue