backend-api http://jira.mfd.msk:8088/browse/CLS-544
This commit is contained in:
parent
488adfa605
commit
3ba0611852
7 changed files with 186 additions and 4 deletions
|
|
@ -10,10 +10,7 @@ import org.springframework.stereotype.Controller;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
import ru.clearing.classes.statics.data.registry.Registry;
|
||||
import ru.spcex.clearing.backendapi.controller.queue.AbstractQueueController;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.registry.ChangeRefundDateActionNew;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.registry.ChangeStatusExtractActionNew;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.registry.RSplitDepositActionNew;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.registry.ReturnDepositActionNew;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.registry.*;
|
||||
import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
|
||||
import ru.spcex.clearing.backendapi.controller.response.cud.CudResponse;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
||||
|
|
@ -71,6 +68,19 @@ public class RegistryController extends AbstractQueueController {
|
|||
return processRequest(Consts.REGISTRY_RETURN_DEPOSIT_ACTION, returnDepositAction);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "Отметить средства на возврат депозита")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)})
|
||||
@RequestMapping(value = "/identificationFunds/{id}", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
public CudResponse identificationFundsAction(
|
||||
@ApiParam(value = "Идентификатор изменяемого объекта.", required = true, example = "1234")
|
||||
@PathVariable("id") Long id,
|
||||
@ApiParam(value = "Параметры команды в JSON формате.", required = true)
|
||||
@RequestBody IdentificationFundsActionNew identificationFundsActionNew) throws ExecutionException, InterruptedException {
|
||||
identificationFundsActionNew.setId(id);
|
||||
return processRequest(Consts.REGISTRY_IDENTIFICATION_FUNDS, identificationFundsActionNew);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "Изменение даты возврата депозита")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)})
|
||||
@RequestMapping(value = "/changeRefundDate/{groupId}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
package ru.spcex.clearing.backendapi.controller.request.cud.registry;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.spcex.clearing.backendapi.domain.actions.IAction;
|
||||
import ru.spcex.clearing.backendapi.errors.BackEndError;
|
||||
import ru.spcex.clearing.platform.messaging.domain.ActionType;
|
||||
import ru.spcex.clearing.platform.messaging.domain.cud.registry.IdentificationFundsRequest;
|
||||
import ru.spcex.platform.classes.base.interfaces.WithId;
|
||||
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class IdentificationFundsActionNew implements IAction<IdentificationFundsRequest>, WithId {
|
||||
|
||||
@JsonIgnore
|
||||
public Long id;
|
||||
@ApiModelProperty(value = "Сумма", example = "1600.20")
|
||||
@JsonProperty
|
||||
public BigDecimal balance;
|
||||
@ApiModelProperty(value = "Торгово-клиринговый регистр", example = "1234")
|
||||
@JsonProperty
|
||||
public Long tradingClearingRegistryId;
|
||||
|
||||
@Override
|
||||
public IdentificationFundsRequest toRequest() {
|
||||
var req = new IdentificationFundsRequest();
|
||||
req.setId(id);
|
||||
req.setBalance(balance);
|
||||
req.setTradingClearingRegistryId(tradingClearingRegistryId);
|
||||
return req;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<EnumMessage> validate() {
|
||||
List<EnumMessage> errors = new ArrayList<>();
|
||||
if (id == null) {
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "url parameter 'id'"));
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.NEW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public BigDecimal getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(BigDecimal balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public Long getTradingClearingRegistryId() {
|
||||
return tradingClearingRegistryId;
|
||||
}
|
||||
|
||||
public void setTradingClearingRegistryId(Long tradingClearingRegistryId) {
|
||||
this.tradingClearingRegistryId = tradingClearingRegistryId;
|
||||
}
|
||||
}
|
||||
|
|
@ -4111,6 +4111,31 @@
|
|||
{"code": "balance",
|
||||
"type": 10,"name": "Сумма","shortname": "Сумма","required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
{"method":"post",
|
||||
|
||||
"name": "Идентификация неразмеченных средств",
|
||||
|
||||
"destination": "registries/identificationFunds",
|
||||
|
||||
"confirmation": "balance,tradingClearingRegistryId",
|
||||
|
||||
"class": "ru.spcex.clearing.backendapi.controller.request.cud.registry.IdentificationFundsActionNew",
|
||||
|
||||
"fields": [
|
||||
{"code": "id",
|
||||
"type": 1,"name": "Идентификатор записи","shortname": "ID","link": "registry","linkCode": "id","required": true
|
||||
}
|
||||
,
|
||||
{"code": "balance",
|
||||
"type": 10,"name": "Сумма","shortname": "Сумма","required": true
|
||||
}
|
||||
,
|
||||
{"code": "tradingClearingRegistryId",
|
||||
"type": 1,"name": "Торгово-клиринговый регистр","shortname": "Торгово-клиринговый регистр","link": "tradingClearingRegistry","linkCode": "code","required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
|
|
|
|||
|
|
@ -956,6 +956,11 @@
|
|||
<id type="1" name="Регистр требований" shortname="Регистр требований" required="true" enabled="false" visible="false"/>
|
||||
<balance type="10" name="Сумма" shortname="Сумма" required="true"/>
|
||||
</post>
|
||||
<post name="Идентификация неразмеченных средств" destination="registries/identificationFunds" confirmation="balance,tradingClearingRegistryId" class="ru.spcex.clearing.backendapi.controller.request.cud.registry.IdentificationFundsActionNew">
|
||||
<id type="1" name="Идентификатор записи" shortname="ID" link="registry" linkCode="id" required="true"/>
|
||||
<balance type="10" name="Сумма" shortname="Сумма" required="true"/>
|
||||
<tradingClearingRegistryId type="1" name="Торгово-клиринговый регистр" shortname="Торгово-клиринговый регистр" link="tradingClearingRegistry" linkCode="code" required="true"/>
|
||||
</post>
|
||||
<put name="Изменение даты возврата депозита" destination="registries/changeRefundDate" confirmation="contact,contract,refundDate" class="ru.spcex.clearing.backendapi.controller.request.cud.registry.ChangeRefundDateActionNew">
|
||||
<groupId type="1" dbname="Идентификатор группы связанных регистров" name="Идентификатор группы" required="true" enabled="false" visible="false"/>
|
||||
<contract type="2" length="255" name="Договор" shortname="Номер договора" required="true" enabled="false"/>
|
||||
|
|
|
|||
|
|
@ -4111,6 +4111,31 @@
|
|||
{"code": "balance",
|
||||
"type": 10,"name": "Сумма","shortname": "Сумма","required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
{"method":"post",
|
||||
|
||||
"name": "Идентификация неразмеченных средств",
|
||||
|
||||
"destination": "registries/identificationFunds",
|
||||
|
||||
"confirmation": "balance,tradingClearingRegistryId",
|
||||
|
||||
"class": "ru.spcex.clearing.backendapi.controller.request.cud.registry.IdentificationFundsActionNew",
|
||||
|
||||
"fields": [
|
||||
{"code": "id",
|
||||
"type": 1,"name": "Идентификатор записи","shortname": "ID","link": "registry","linkCode": "id","required": true
|
||||
}
|
||||
,
|
||||
{"code": "balance",
|
||||
"type": 10,"name": "Сумма","shortname": "Сумма","required": true
|
||||
}
|
||||
,
|
||||
{"code": "tradingClearingRegistryId",
|
||||
"type": 1,"name": "Торгово-клиринговый регистр","shortname": "Торгово-клиринговый регистр","link": "tradingClearingRegistry","linkCode": "code","required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ public interface Consts {
|
|||
String REGISTRY_LIABILITIES_REGISTER_NEW = "registry-liabilities-register-new";
|
||||
String REGISTRY_EXECUTION_REGISTER_ON_SAVE = "registry-execution-register-on-save";
|
||||
String REGISTRY_EXECUTION_REGISTER_UPDATE = "registry-execution-register-update";
|
||||
String REGISTRY_IDENTIFICATION_FUNDS = "registry-identification-funds";
|
||||
|
||||
//TODO IS IT NEEDED RIGHT HERE?
|
||||
String REGISTRY_CONTRACT_REGISTER_NEW = "registry-contract-register-new";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package ru.spcex.clearing.platform.messaging.domain.cud.registry;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import ru.spcex.platform.classes.base.interfaces.WithId;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class IdentificationFundsRequest implements WithId {
|
||||
@JsonProperty
|
||||
private Long id;
|
||||
@JsonProperty
|
||||
private BigDecimal balance;
|
||||
@JsonProperty
|
||||
private Long tradingClearingRegistryId;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public BigDecimal getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(BigDecimal balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public Long getTradingClearingRegistryId() {
|
||||
return tradingClearingRegistryId;
|
||||
}
|
||||
|
||||
public void setTradingClearingRegistryId(Long tradingClearingRegistryId) {
|
||||
this.tradingClearingRegistryId = tradingClearingRegistryId;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue