Пример #1
0
  /**
   * 受注伝票を更新します.
   *
   * @param dto 受注伝票DTO
   * @return ロック結果
   * @throws UnabledLockException
   * @throws ServiceException
   */
  @Override
  protected int updateRecord(ROrderSlipDto dto) throws UnabledLockException, ServiceException {

    RoSlipTrn entity =
        Beans.createAndCopy(RoSlipTrn.class, dto)
            .dateConverter(Constants.FORMAT.DATE, "roDate", "validDate")
            .dateConverter(Constants.FORMAT.DATE, "shipDate", "validDate")
            .dateConverter(Constants.FORMAT.DATE, "deliveryDate", "validDate")
            .dateConverter(Constants.FORMAT.TIMESTAMP, "updDatetm")
            .execute();

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

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

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

    int lockResult =
        this.lockRecord(
            RoSlipService.Param.RO_SLIP_ID,
            entity.roSlipId.toString(),
            entity.updDatetm,
            "rorder/LockSlip.sql");

    Map<String, Object> param = setEntityToParam(entity);
    this.updateBySqlFile("rorder/UpdateSlip.sql", param).execute();

    return lockResult;
  }
Пример #2
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();
  }