示例#1
0
  /**
   * 受注伝票を登録します.
   *
   * @param dto 受注伝票DTO
   * @return 登録件数
   * @throws ServiceException
   */
  @Override
  protected int insertRecord(ROrderSlipDto dto) throws ServiceException {

    dto.roSlipId = Long.toString(seqMakerService.nextval(RoSlipService.Table.RO_SLIP_TRN));
    NumberConverter convUP = createUnitPriceConverter(dto.priceFractCategory);
    NumberConverter convTax = createUnitPriceConverter(dto.taxFractCategory);

    RoSlipTrn entity =
        Beans.createAndCopy(RoSlipTrn.class, dto)
            .converter(convUP, "retailPriceTotal", "priceTotal", "costTotal")
            .converter(convTax, "ctaxPriceTotal")
            .dateConverter(Constants.FORMAT.DATE, "roDate", "validDate")
            .dateConverter(Constants.FORMAT.DATE, "shipDate", "validDate")
            .dateConverter(Constants.FORMAT.DATE, "deliveryDate", "validDate")
            .execute();

    if (dto.cutoffGroupCategory != null && dto.cutoffGroupCategory.length() == 3) {

      entity.cutoffGroup = dto.cutoffGroupCategory.substring(0, 2);

      entity.paybackCycleCategory = dto.cutoffGroupCategory.substring(2, 3);
    }

    Map<String, Object> param = setEntityToParam(entity);

    return this.updateBySqlFile("rorder/InsertRoSlip.sql", param).execute();
  }
示例#2
0
  /**
   * 受注伝票番号を指定して、受注伝票情報を取得します.
   *
   * @param id 受注伝票番号
   * @return 受注伝票DTO
   * @throws ServiceException
   */
  @Override
  public ROrderSlipDto loadBySlipId(String id) throws ServiceException {
    if (id == null || id.equals("")) {
      return null;
    }

    RoSlipTrn record = getRoSlipTrn(id);

    if (record == null) {
      return null;
    }

    ROrderSlipDto trnDto =
        Beans.createAndCopy(ROrderSlipDto.class, record)
            .dateConverter(Constants.FORMAT.TIMESTAMP, "updDatetm")
            .execute();

    trnDto.cutoffGroupCategory = trnDto.cutoffGroup + trnDto.paybackCycleCategory;

    return trnDto;
  }