Package com.ufis_as.ek_if.aacs.uld.entities

Examples of com.ufis_as.ek_if.aacs.uld.entities.EntDbLoadUldSummary


    public void persist(EntDbLoadUldSummary entity){
      em.persist(entity);  
    }
   
    public EntDbLoadUldSummary merge(EntDbLoadUldSummary entity){
      EntDbLoadUldSummary loadUld = null;
      try{
        loadUld = em.merge(entity);
      }
      catch(Exception ex){
        LOG.error("ERROR to create new LOAD ULD !!! {}", ex.toString());
View Full Code Here


      }
      return loadUld;
    }
   
    public EntDbLoadUldSummary getUldMoveByIdFlightUldNum(BigDecimal idFlight, BigDecimal idConxFlight, String infoType){
      EntDbLoadUldSummary result  = null;
      try{
        Query query = getEntityManager().createNamedQuery("EntDbLoadUldSummary.getExisting");
        query.setParameter("idFlight", idFlight);
        query.setParameter("idConxFlight", idConxFlight);
        query.setParameter("infoType", infoType);
View Full Code Here

    if(!cmd.equalsIgnoreCase(IRT.name()) && !cmd.equalsIgnoreCase(DRT.name()) && !cmd.equalsIgnoreCase(URT.name())) {
      LOG.warn("LoadULDSummary record command is {} but not IRT/DRT/URT. The process won't be continued.", cmd);
      return;
    }
   
    EntDbLoadUldSummary updatedUldSummary = formNewLoadUldSummary(ufisMsgDTO);
    if(updatedUldSummary == null) {
      LOG.error("ULDSummary cannot be created with provided data. The process will not be performed.");
      return;
    }
   
    LOG.info("ID_FLIGHT : {}, ID_CONX_FLIGHT : {}", updatedUldSummary.getIdFlight(), updatedUldSummary.getIdConxFlight());
   
    //To process only when both id_flight and id_conx_flight have value.
    if(updatedUldSummary.getIdFlight() == null || updatedUldSummary.getIdConxFlight() == null ||
        updatedUldSummary.getIdFlight().equals(BigDecimal.ZERO) || updatedUldSummary.getIdConxFlight().equals(BigDecimal.ZERO) ||
        updatedUldSummary.getIdFlight().equals(updatedUldSummary.getIdConxFlight())) {
      LOG.error("ID_FLIGHT[{}] and ID_CONX_FLIGHT[{}] must be provided and not be the same. Otherwise the process will not be performed.", updatedUldSummary.getIdFlight(), updatedUldSummary.getIdConxFlight());
      return;
    }
   
    switch(cmd) {
      case "IRT": processConxStatForLoadULDSummaryIRT(updatedUldSummary);
            break;
      case "DRT": processConxStatForLoadULDSummaryDRT(updatedUldSummary);
            break;
      case "URT": EntDbLoadUldSummary oldUldSummary = formOldLoadUldSummary(ufisMsgDTO);
            if(oldUldSummary == null) {
              LOG.error("ULDSummary cannot be created with provided data. The process will not be performed.");
              return;
            }
            processConxStatForLoadULDSummaryURT(oldUldSummary, updatedUldSummary);
View Full Code Here

    if(fldList.size() != data.size()) {
      LOG.error("Field list size and data list size are not equal. The process will not be performed.");
      return null;
    }
   
    EntDbLoadUldSummary uldSummary = new EntDbLoadUldSummary();
   
    int i = 0;
    for (String fld : fldList) {
      switch(fld.toUpperCase()){
        case "ID_FLIGHT": uldSummary.setIdFlight(BigDecimal.valueOf(Long.parseLong(data.get(i).toString()))); break;
        case "ID_CONX_FLIGHT" : uldSummary.setIdConxFlight(BigDecimal.valueOf(Long.parseLong(data.get(i).toString()))); break;
        case "INFO_TYPE" : uldSummary.setInfoType(data.get(i).toString()); break;
        case "ULD_PCS" : uldSummary.setUldPcs(Float.parseFloat(data.get(i).toString())); break;
      }
      i++;
    }
   
    return uldSummary;
View Full Code Here

 
  //For all SubTypes including LOA insert/update to table
    private void processUldSummary(BigDecimal idFlightDecimal, BigDecimal conxIdFlight, String infoType)
        throws ParseException {
      //BigDecimal idConxFlight = (new BigDecimal(0).compareTo(conxIdFlight) == 0)? null : conxIdFlight;
      EntDbLoadUldSummary loadUldSum = clsDlLoadUldSummaryBean.getUldMoveByIdFlightUldNum(idFlightDecimal, conxIdFlight, infoType);
      //EntDbLoadUldSummary loadUldSum = null;
      if(loadUldSum == null){//not Existing?
        loadUldSum = new EntDbLoadUldSummary();
        loadUldSum.setCreatedDate(HpUfisCalendar.getCurrentUTCTime());
        loadUldSum.setCreatedUser(HpEKConstants.LOAD_SUMMARY);
      }else{
        loadUldSum.setUpdatedDate(HpUfisCalendar.getCurrentUTCTime());
        loadUldSum.setUpdatedUser(HpEKConstants.LOAD_SUMMARY);
      }
      UfisUldSummaryConfig uldSumObj = INFO_TYPE.LOA.name().equalsIgnoreCase(infoType) ? entuldLOA : entUld;
       
      loadUldSum.setIdFlight(idFlightDecimal);
      loadUldSum.setIdConxFlight(conxIdFlight);
     
      loadUldSum.setUldWeight(uldSumObj.getUld_weight());
      loadUldSum.setUldPcs(uldSumObj.getUld_pcs());
      loadUldSum.setCargoUldPcs(uldSumObj.getCargo_pcs());
      loadUldSum.setCargoUldWt(uldSumObj.getCargo_weight());
      loadUldSum.setBagUldPcs(uldSumObj.getBag_pcs());
      loadUldSum.setBagUldWt(uldSumObj.getBag_weight());

      loadUldSum.setBulkWeight(uldSumObj.getBulk_weight());
      loadUldSum.setBulkPcs(uldSumObj.getBulk_pcs());
      loadUldSum.setBulkBagUldPcs(uldSumObj.getBulkBag_pcs());
      loadUldSum.setBulkBagUldWt(uldSumObj.getBulkBag_weight());
      loadUldSum.setBulkCargoUldWt(uldSumObj.getBulkCargo_weight());
      loadUldSum.setBulkCargoUldPcs(uldSumObj.getBulkCargo_pcs());
   
      loadUldSum.setPalletUldWt(uldSumObj.getPallet_weight());
      loadUldSum.setPalletUldPcs(uldSumObj.getPallet_pcs());

      loadUldSum.setRecStatus(" ");
      loadUldSum.setInfoType(infoType);
      loadUldSum.setDataSource(HpEKConstants.SYS_SOURCE);
     
      clsDlLoadUldSummaryBean.merge(loadUldSum);
    }
View Full Code Here

TOP

Related Classes of com.ufis_as.ek_if.aacs.uld.entities.EntDbLoadUldSummary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.