@Test
 public void createTest() {
   CashAccountLoginResult result = new CashAccountLoginResult();
   result.setBroker("haitong");
   result.setCashAccountId("12345678");
   result.setResult("³É¹¦");
   result.setLogin_time(SystemTime.asDate());
   accountLoginResultDao.recordLoginResult(result);
 }
예제 #2
0
 public List<Qtsl> getQtsls(Date date) throws xBaseJException, IOException {
   List<String> names = getNames("qtsl", SystemTime.asDate());
   List<Qtsl> qtsls = new ArrayList<Qtsl>();
   for (String name : names) {
     String pathName = path + "/" + name;
     qtslDbf.setPath(pathName);
     qtsls.addAll(qtslDbf.read(name));
   }
   return qtsls;
 }
예제 #3
0
 public List<Zqye> getZqyes(Date date) throws xBaseJException, IOException {
   List<String> names = getNames("zqye", SystemTime.asDate());
   List<Zqye> zqyes = new ArrayList<Zqye>();
   for (String name : names) {
     String pathName = path + "/" + name;
     zqyeDbf.setPath(pathName);
     zqyes.addAll(zqyeDbf.read(name));
   }
   return zqyes;
 }
예제 #4
0
 private List<String> getNames(String prefix, Date date) {
   String dateStr = getDateStr(SystemTime.asDate());
   List<String> fileNames = new ArrayList<String>();
   File dir = new File(path);
   String[] names = dir.list();
   if (names == null) {
     return fileNames;
   }
   for (String name : names) {
     if (name.startsWith(prefix) && name.endsWith(dateStr)) {
       fileNames.add(name);
     }
   }
   return fileNames;
 }
예제 #5
0
  public void create(ProgramOrderCreateRequest request) {
    programOrder.setProgramOrderId(request.getProgramOrderId());
    programOrder.setPortfolioId(request.getPortfolioId());
    programOrder.setOrderQty(request.getOrderQty());
    programOrder.setOrderAmount(request.getOrderAmount());
    programOrder.setStartDate(request.getStartDate());
    programOrder.setEndDate(request.getEndDate());
    programOrder.setFundManager(request.getFundManager());
    programOrder.setCreateTime(SystemTime.asDate());
    programOrder.setNotes(request.getNotes());

    programOrder.setDayPlacementQty(BigDecimal.ZERO);
    programOrder.setDayPlacementAmount(BigDecimal.ZERO);
    programOrder.setDayExecQty(BigDecimal.ZERO);
    programOrder.setDayExecAmount(BigDecimal.ZERO);
    programOrder.setAccumulatedPlacementQty(BigDecimal.ZERO);
    programOrder.setAccumulatedPlacementAmount(BigDecimal.ZERO);
    programOrder.setAccumulatedExecQty(BigDecimal.ZERO);
    programOrder.setAccumulatedExecAmount(BigDecimal.ZERO);
    programOrderDao.create(programOrder);
  }
예제 #6
0
  public String 提示() throws ParseException {
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd-HH:mm:ss");
    simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));

    final Date current = simpleDateFormat.parse(当前时间);
    SystemTime.setTimeSource(
        new TimeSource() {
          @Override
          public long millis() {
            return current.getTime();
          }
        });

    Date start = simpleDateFormat.parse(开始时间);
    Date end = simpleDateFormat.parse("20130201-07:00:00");

    AlgoPlacementTimeValidate algoPlacementTimeValidate = new AlgoPlacementTimeValidate();
    try {
      algoPlacementTimeValidate.validate(start, end);
      return FitResult.success();
    } catch (AlgoPlacementException e) {
      return e.getMessage();
    }
  }