コード例 #1
0
ファイル: ExactusRPGEJB.java プロジェクト: Jannievzyl/TestGit
  /**
   * Loans (and legacy insurance) disbursement data submit routine<br>
   * Disburses one account at a time to a specific folder
   *
   * @return returns the loans xml as a string
   */
  public BaseServiceResponse disburse(LoansXML request, BaseServiceResponse response)
      throws ServiceException {
    // use this to get a handle on the IFS share stored inside the connection element
    initialize(BayServConstants.rpgService, response);
    // initialise the XML context
    try {
      if (disbursementCtx == null) disbursementCtx = JAXBContext.newInstance(LoansXML.class);
      if (errorCtx == null) errorCtx = JAXBContext.newInstance(ERRORSXML.class);
    } catch (JAXBException e) {
      throw new ServiceException(ErrorCodes.RPG006, e);
    }

    // put the result into exactus filesystem via AS400
    String loanReference = saveDisbursementFile(request, PATH_LOAN);

    // sleep
    DateUtils.sleep(1);

    // call the RPG to read the result and throw an error if there is one
    try {
      disburseRPG.execute(EProductType.LOAN, loanReference);
    } catch (ServiceException e) {
      // see if there's an error file
      response.setError(true);
      response.getErrors().addAll(findErrorXML(request, PATH_LOAN));
    }

    response.setXmlData(new XMLData());
    response.getXmlData().setXml(renderDisbursementXML(request));

    return response;
  }
コード例 #2
0
  public CreditApplication save(FinalAssessmentDTO data) throws ServiceException {
    unMask(data);
    data.unmaskFAFields();
    // saved changed quote data first
    super.save(data);
    // now save the new DC1 data
    entity = capDAO.read(data.getId());
    entity.fromDTO(data);
    // associate applicant data
    entity = applicantDAO.associate(entity, data);
    // and save
    entity.setUpdatedBy(data.getUserLink().getUserName());
    entity.setUpdatedOn(DateUtils.now());
    entity = capDAO.save(entity);

    // update the bankaccount too
    updateMainBankAccount(data);

    // let descendants implement their own note saves
    if (!this.getClass().getSimpleName().equals(DAO)) return entity;
    Long pid = entity.getPid();
    // save exceptions
    saveExceptions(data.getErrors(), pid, data.getTid(), TASK);
    // save notes
    saveNotes(data.getNotes(), pid, data.getTid(), TASK);
    return entity;
  }
コード例 #3
0
ファイル: ExactusRPGEJB.java プロジェクト: Jannievzyl/TestGit
  /**
   * Medical loans use the same XML as loans, is saved to the same IFS target, but does NOT call the
   * RPG.<br>
   */
  public BaseServiceResponse disburseMedical(
      LoansXML request, LoanDisburseRPGRequest data, BaseServiceResponse response)
      throws ServiceException {
    // use this to get a handle on the IFS share stored inside the connection element
    initialize(BayServConstants.rpgService, response);

    // initialise the XML context
    try {
      if (disbursementCtx == null) disbursementCtx = JAXBContext.newInstance(LoansXML.class);
      if (errorCtx == null) errorCtx = JAXBContext.newInstance(ERRORSXML.class);
    } catch (JAXBException e) {
      throw new ServiceException(ErrorCodes.RPG006, e);
    }

    // put the result into exactus filesystem via AS400
    saveDisbursementFile(request, PATH_LOAN);

    // sleep
    DateUtils.sleep(1);

    return response;
  }
コード例 #4
0
/**
 * Base Log data entity, entry point for all services persistence
 *
 * @author Ernst Mocke
 */
@Entity
@Table(name = "View_SrvLog")
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
// @formatter:off
@NamedNativeQueries({
  @NamedNativeQuery(
      name = ViewServiceLog.findOnFK1,
      query = "select * from View_SrvLog l where l.fk1 = :par1",
      resultClass = ViewServiceLog.class),
})
// @formatter:on
public class ViewServiceLog implements Serializable {

  public static final String findOnFK1 = "ServiceLogView.FindOnFK1";

  static final long serialVersionUID = -3884167396351336621L;

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  protected Long oid;

  @Column(length = 64)
  protected String uid = "";

  @Column protected Long batchId = 0L;

  @Column(length = 23)
  @Temporal(TemporalType.TIMESTAMP)
  protected Date createdOn = DateUtils.now();

  @Column(length = 23)
  @Temporal(TemporalType.TIMESTAMP)
  protected Date finishedOn;

  @Column(length = 40)
  @Enumerated(EnumType.STRING)
  protected ELogStatus status = ELogStatus.NEW;

  @Column(length = 40)
  @Enumerated(EnumType.STRING)
  protected EEnvironment environment = EEnvironment.NOT_SPECIFIED;

  @Column(length = 40)
  @Enumerated(EnumType.STRING)
  protected EProcessType processType = EProcessType.NO_ACTION;

  @Column(length = 50)
  protected String service = "";

  @Column(length = 100)
  protected String method = "";

  @Column(length = 20)
  protected String version = "";

  @Column(length = 20)
  protected String userId = "";

  @Column(length = 100)
  protected String fk1 = "";

  @Column(length = 100)
  protected String fk2 = "";

  @Column(length = 100)
  protected String fk3 = "";

  @Column(length = 100)
  protected String reference = "";

  @Column(length = 40)
  @Enumerated(EnumType.STRING)
  protected ELogStrategy logType = ELogStrategy.NOT_SPECIFIED;

  @Column(length = 40)
  @Enumerated(EnumType.STRING)
  protected EPersistenceStrategy persistenceType = EPersistenceStrategy.NOT_SPECIFIED;

  @Column(length = 256)
  protected String logRoot = "";

  @Column(length = 50)
  protected String authenticationToken = "";

  @Column(length = 50)
  protected String srcIPAddress = "";

  @Column(name = "request_oid")
  protected Long request;

  @Column(name = "response_oid")
  protected Long response;

  @Column(name = "error_oid")
  protected Long error;

  /** Default constructor */
  public ViewServiceLog() {}

  // start properties
  public Long getOid() {
    return oid;
  }

  public void setOid(Long oid) {
    this.oid = oid;
  }

  public String getUid() {
    return uid;
  }

  public void setUid(String uid) {
    this.uid = uid;
  }

  public Long getBatchId() {
    return batchId;
  }

  public void setBatchId(Long batchId) {
    this.batchId = batchId;
  }

  public Date getCreatedOn() {
    return createdOn;
  }

  public void setCreatedOn(Date createdOn) {
    this.createdOn = createdOn;
  }

  public Date getFinishedOn() {
    return finishedOn;
  }

  public void setFinishedOn(Date finishedOn) {
    this.finishedOn = finishedOn;
  }

  public ELogStatus getStatus() {
    return status;
  }

  public void setStatus(ELogStatus status) {
    this.status = status;
  }

  public EEnvironment getEnvironment() {
    return environment;
  }

  public void setEnvironment(EEnvironment environment) {
    this.environment = environment;
  }

  public EProcessType getProcessType() {
    return processType;
  }

  public void setProcessType(EProcessType processType) {
    this.processType = processType;
  }

  public String getService() {
    return service;
  }

  public void setService(String service) {
    this.service = service;
  }

  public String getMethod() {
    return method;
  }

  public void setMethod(String method) {
    this.method = method;
  }

  public String getVersion() {
    return version;
  }

  public void setVersion(String version) {
    this.version = version;
  }

  public String getUserId() {
    return userId;
  }

  public void setUserId(String userId) {
    this.userId = userId;
  }

  public String getFk1() {
    return fk1;
  }

  public void setFk1(String fk1) {
    this.fk1 = fk1;
  }

  public String getFk2() {
    return fk2;
  }

  public void setFk2(String fk2) {
    this.fk2 = fk2;
  }

  public String getFk3() {
    return fk3;
  }

  public void setFk3(String fk3) {
    this.fk3 = fk3;
  }

  public String getReference() {
    return reference;
  }

  public void setReference(String reference) {
    this.reference = reference;
  }

  public ELogStrategy getLogType() {
    return logType;
  }

  public void setLogType(ELogStrategy logType) {
    this.logType = logType;
  }

  public EPersistenceStrategy getPersistenceType() {
    return persistenceType;
  }

  public void setPersistenceType(EPersistenceStrategy persistenceType) {
    this.persistenceType = persistenceType;
  }

  public String getLogRoot() {
    return logRoot;
  }

  public void setLogRoot(String logRoot) {
    this.logRoot = logRoot;
  }

  public String getAuthenticationToken() {
    return authenticationToken;
  }

  public void setAuthenticationToken(String authenticationToken) {
    this.authenticationToken = authenticationToken;
  }

  public String getSrcIPAddress() {
    return srcIPAddress;
  }

  public void setSrcIPAddress(String srcIPAddress) {
    this.srcIPAddress = srcIPAddress;
  }

  public Long getRequest() {
    return request;
  }

  public void setRequest(Long request) {
    this.request = request;
  }

  public Long getResponse() {
    return response;
  }

  public void setResponse(Long response) {
    this.response = response;
  }

  public Long getError() {
    return error;
  }

  public void setError(Long error) {
    this.error = error;
  }
  // end

}