コード例 #1
0
ファイル: CreateAlgoMasterFill.java プロジェクト: thoslin/ELF
/**
 * @author YangT
 * @description
 * @create 13-5-30 ÏÂÎç3:36
 */
public class CreateAlgoMasterFill extends ColumnFixture {
	public String ĸµ¥Id;
	public String ĸµ¥×´Ì¬;

	private final AlgorithmPlacementFillProcessor placementProcess = InterfaceFactory.getBean(AlgorithmPlacementFillProcessor.class);
	private final OrderFillFactory orderFillFactory = new OrderFillFactory();

	public String ´´½¨() throws FieldNotFound, AlgoPlacementException {
		ĸµ¥Id = AlgoTrade.composition(ĸµ¥Id);
		String parentStatus = InputConvert.getId(ĸµ¥×´Ì¬);
		if ("9".equals(parentStatus)) {
			OrderCancelReject orderCancelReject = new OrderCancelReject();
			orderCancelReject.set(new OrdStatus(parentStatus.charAt(0)));
			orderCancelReject.set(new ClOrdID(ĸµ¥Id));
			orderCancelReject.set(new OrigClOrdID(ĸµ¥Id));
			orderCancelReject.set(new CxlRejReason(CxlRejReason.OTHER));
			AlgoTradeOrderCancelReject cancelReject = orderFillFactory.createCancelReject(orderCancelReject);
			placementProcess.processReport(cancelReject);
		} else {
			ExecutionReport message = new ExecutionReport();
			message.set(new OrdStatus(parentStatus.charAt(0)));
			message.set(new ClOrdID(ĸµ¥Id));
			message.set(new OrigClOrdID(ĸµ¥Id));
			message.set(new Text());
			if ("S".equals(parentStatus)) {
				message.setField(new CharField(Provider.STRATEGY_STATUS_FIELD, '3'));
			}
			AlgoTradeOrderFill algoTradeOrderFill = orderFillFactory.createAlgoTradeOrderFill(message);
			placementProcess.processReport(algoTradeOrderFill);
		}
		return FitResult.success();
	}
コード例 #2
0
ファイル: CreateExecutionFill.java プロジェクト: thoslin/ELF
public class CreateExecutionFill extends ColumnFixture {

  private FillCreateService fillCreateService = InterfaceFactory.getBean(FillCreateService.class);

  public String 执行Id;
  public String 证券系统内部代码;
  public String 回报类型Id;
  public String 成交价格;
  public String 成交数量;
  public String 错误原因代码;
  public String 错误原因信息;

  public String 创建() {
    ExecutionFillCreateEvent executionFillCreateEvent = new ExecutionFillCreateEvent();
    executionFillCreateEvent.setExecutionId(执行Id);
    executionFillCreateEvent.setExecutionIndex(1);
    executionFillCreateEvent.setInternalSecurityId(证券系统内部代码);
    executionFillCreateEvent.setReportType(InputConvert.getId(回报类型Id));
    executionFillCreateEvent.setFillPrice(InputConvert.getNumber(成交价格));
    executionFillCreateEvent.setFillQty(InputConvert.getNumber(成交数量));
    executionFillCreateEvent.setReason(错误原因代码);
    executionFillCreateEvent.setErrorMessage(错误原因信息);
    fillCreateService.CreateExecutionFill(executionFillCreateEvent);
    return FitResult.success();
  }
}
コード例 #3
0
ファイル: UpdateFeeRate.java プロジェクト: thoslin/ELF
public class UpdateFeeRate extends ColumnFixture {

  private final FeeRateConfigService feeRateConfigService =
      InterfaceFactory.getBean(FeeRateConfigService.class);

  public String 收费比例Id;
  public String 收费比例;
  public String 最高费用;
  public String 最低费用;

  public String 修改() {
    try {
      FeeRateUpdateEvent updateEvent = new FeeRateUpdateEvent();
      updateEvent.setId(收费比例Id);
      BigDecimal feeRate = new BigDecimal(收费比例);
      updateEvent.setFeeRate(feeRate.divide(new BigDecimal(100)));
      updateEvent.setFeeDownLimit(最低费用 == null ? BigDecimal.ZERO : new BigDecimal(最低费用));
      updateEvent.setFeeUpLimit(最高费用 == null ? BigDecimal.ZERO : new BigDecimal(最高费用));
      feeRateConfigService.update(updateEvent);
      return "成功";
    } catch (FeeException e) {
      return "失败";
    }
  }
}