MoneyMarketSecurity GET filter
This commit is contained in:
parent
17b298b5a4
commit
a5320f36f3
3 changed files with 14 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ import ru.spcex.clearing.backendapi.service.IOperator;
|
|||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
||||
import ru.spcex.platform.enumeration.Status;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
|
@ -75,7 +76,9 @@ public class CudMoneyMarketSecurityController extends AbstractQueueController {
|
|||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonGetAllResponse getAll() {
|
||||
Collection<Map<String, Object>> all = stateLoader.getAllMetaTransform(IMDGDistributedNames.Map_MoneyMarketSecurity, MoneyMarketSecurity.class);
|
||||
Collection<Map<String, Object>> all = stateLoader.getAllMetaTransform(IMDGDistributedNames.Map_MoneyMarketSecurity,
|
||||
MoneyMarketSecurity.class,
|
||||
Map.of("workflowStatus", Status.Active.getKey()));
|
||||
CommonGetAllResponse response = new CommonGetAllResponse();
|
||||
response.fromEntity(all);
|
||||
return response;
|
||||
|
|
|
|||
|
|
@ -13,4 +13,5 @@ public interface IStateLoader {
|
|||
<T extends SpcexObjectBase> Optional<T> getById(Long id, String mapName, Class<T> clazz);
|
||||
<T extends SpcexObjectBase> Collection<T> getAll(String mapName, Class<T> clazz);
|
||||
<T extends SpcexObjectBase> Collection<Map<String, Object>> getAllMetaTransform(String mapName, Class<T> clazz);
|
||||
<T extends SpcexObjectBase> Collection<Map<String, Object>> getAllMetaTransform(String mapName, Class<T> clazz, Map<String, ? extends Comparable<?>> conditions);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,15 @@ public class StateLoaderImpl implements IStateLoader {
|
|||
return responseFactory.responseFromObjectCollection(all);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends SpcexObjectBase> Collection<Map<String, Object>> getAllMetaTransform(String mapName,
|
||||
Class<T> clazz,
|
||||
Map<String, ? extends Comparable<?>> conditions) {
|
||||
Imdg<T> imdg = getImdg(mapName, clazz);
|
||||
Collection<T> all = imdg.getCollectionObjectsByFieldValues(conditions);
|
||||
return responseFactory.responseFromObjectCollection(all);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T extends SpcexObjectBase> Imdg<T> getImdg(String mapName, Class<T> clazz) {
|
||||
return (Imdg<T>) allImdgMaps.computeIfAbsent(mapName, (mapName1) -> imdgProvider.getImdg(mapName, clazz));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue