Package org.openswing.swing.message.receive.java

Examples of org.openswing.swing.message.receive.java.Response


  public final Response executeCommand(Object inputPar,UserSessionParameters userSessionPars,HttpServletRequest request, HttpServletResponse response,HttpSession userSession,ServletContext context) {
    String companyCode = (String)inputPar;
    try {

      Companies bean = (Companies)JAIOBeanFactory.getInstance().getBean(Companies.class);
      Response answer = bean.loadCompany(companyCode,((JAIOUserSessionParameters)userSessionPars).getServerLanguageId(),userSessionPars.getUsername());

      return answer;
    }
    catch (Throwable ex) {
      Logger.error(userSessionPars.getUsername(),this.getClass().getName(),"executeCommand","Error while processing request",ex);
View Full Code Here


      values.add(pk.getDocYearDOC08());
      values.add(pk.getDocNumberDOC08());
      values.add(serverLanguageId);

      // read from DOC08 table...
      Response res = QueryUtil.getQuery(
          conn,
          new UserSessionParameters(username),
          baseSQL,
          values,
          attribute2dbField,
          DetailDeliveryNoteVO.class,
          "Y",
          "N",
          null,
          true
      );

      Response answer = res;
      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOResponse)answer;
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while fetching an existing out delivery note",ex);
      try {
        if (this.conn==null && conn!=null)
View Full Code Here

      int blockSize = 50;
      if (pars.getOtherGridParams().get(ApplicationConsts.BLOCK_SIZE)!=null)
        blockSize = Integer.parseInt(pars.getOtherGridParams().get(ApplicationConsts.BLOCK_SIZE).toString());

      // read from DOC08 table...
      Response answer = QueryUtil.getQuery(
          conn,
          new UserSessionParameters(username),
          sql,
          values,
          attribute2dbField,
          GridDeliveryNoteVO.class,
          "Y",
          "N",
          null,
          pars,
          blockSize,
          true
      );



      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOListResponse)answer;

    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while fetching out delivery notes list",ex);
      try {
View Full Code Here

      try {
        conn = ConnectionManager.getConnection(null);
        bean.setConn(conn);

        GridParams gridParams = new GridParams();
        Response answer = bean.loadETLProcesses(gridParams,"",null);
        if (!answer.isError()) {
          java.util.List list = ((VOListResponse)answer).getRows();
          ETLProcessVO vo = null;
          for(int i=0;i<list.size();i++) {
            vo = (ETLProcessVO)list.get(i);
            if (!vo.getSchedulingTypeSYS23().equals(ApplicationConsts.SCHEDULING_TYPE_NO_SCHED)) {
View Full Code Here

      pkAttributes.add("docTypeDOC08");
      pkAttributes.add("docYearDOC08");
      pkAttributes.add("docNumberDOC08");

      // update DOC08 table...
      Response res = org.jallinone.commons.server.QueryUtilExtension.updateTable(
          conn,
          new UserSessionParameters(username),
          pkAttributes,
          oldVO,
          newVO,
          "DOC08_DELIVERY_NOTES",
          attribute2dbField,
          "Y",
          "N",
          null,
          true
      );

      Response answer = res;
      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOResponse)answer;
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while updating an existing out delivery note",ex);
      try {
        if (this.conn==null && conn!=null)
View Full Code Here

      bean.setConn(conn);

      GridOutDeliveryNoteRowVO oldVO = null;
      GridOutDeliveryNoteRowVO newVO = null;

      Response res = null;
      for(int i=0;i<newRows.size();i++) {
        oldVO = (GridOutDeliveryNoteRowVO)oldRows.get(i);
        newVO = (GridOutDeliveryNoteRowVO)newRows.get(i);

        Map attribute2dbField = new HashMap();
        attribute2dbField.put("companyCodeSys01DOC10","COMPANY_CODE_SYS01");
        attribute2dbField.put("docTypeDOC10","DOC_TYPE");
        attribute2dbField.put("docYearDOC10","DOC_YEAR");
        attribute2dbField.put("docNumberDOC10","DOC_NUMBER");
        attribute2dbField.put("docTypeDoc01DOC10","DOC_TYPE_DOC01");
        attribute2dbField.put("docYearDoc01DOC10","DOC_YEAR_DOC01");
        attribute2dbField.put("docNumberDoc01DOC10","DOC_NUMBER_DOC01");
        attribute2dbField.put("rowNumberDOC10","ROW_NUMBER");
        attribute2dbField.put("itemCodeItm01DOC10","ITEM_CODE_ITM01");
        attribute2dbField.put("qtyDOC10","QTY");
        attribute2dbField.put("progressiveHie02DOC10","PROGRESSIVE_HIE02");
        attribute2dbField.put("progressiveHie01DOC10","PROGRESSIVE_HIE01");
        attribute2dbField.put("invoiceQtyDOC10","INVOICE_QTY");

        attribute2dbField.put("progressiveDOC10","PROGRESSIVE");
        attribute2dbField.put("variantTypeItm06DOC10","VARIANT_TYPE_ITM06");
        attribute2dbField.put("variantCodeItm11DOC10","VARIANT_CODE_ITM11");
        attribute2dbField.put("variantTypeItm07DOC10","VARIANT_TYPE_ITM07");
        attribute2dbField.put("variantCodeItm12DOC10","VARIANT_CODE_ITM12");
        attribute2dbField.put("variantTypeItm08DOC10","VARIANT_TYPE_ITM08");
        attribute2dbField.put("variantCodeItm13DOC10","VARIANT_CODE_ITM13");
        attribute2dbField.put("variantTypeItm09DOC10","VARIANT_TYPE_ITM09");
        attribute2dbField.put("variantCodeItm14DOC10","VARIANT_CODE_ITM14");
        attribute2dbField.put("variantTypeItm10DOC10","VARIANT_TYPE_ITM10");
        attribute2dbField.put("variantCodeItm15DOC10","VARIANT_CODE_ITM15");

        HashSet pkAttributes = new HashSet();
        pkAttributes.add("progressiveDOC10");

        // update DOC10 table...
        res = org.jallinone.commons.server.QueryUtilExtension.updateTable(
            conn,
            new UserSessionParameters(username),
            pkAttributes,
            oldVO,
            newVO,
            "DOC10_OUT_DELIVERY_NOTE_ITEMS",
            attribute2dbField,
            "Y",
            "N",
            null,
            true
        );

        if (res.isError()) {
          throw new Exception(res.getErrorMessage());
        }

        // insert serial numbers...
        res = bean.reinsertOutSerialNumbers(newVO,serverLanguageId,username);
        if (res.isError())
          throw new Exception(res.getErrorMessage());

      }

      return new VOListResponse(newRows,false,newRows.size());
    }
View Full Code Here

      pstmt2 = conn.prepareStatement(
       "delete from DOC12_OUT_SERIAL_NUMBERS where PROGRESSIVE_DOC10=?"
      );

      Response res = null;
      for(int i=0;i<list.size();i++) {
        rowPK = (OutDeliveryNoteRowPK)list.get(i);

        // delete previous serial numbers from DOC11...
        pstmt2.setBigDecimal(1,rowPK.getProgressiveDOC10());
        pstmt2.execute();
        pstmt2.close();

        // phisically delete the record in DOC10...
        pstmt.setBigDecimal(1,rowPK.getProgressiveDOC10());
        pstmt.execute();
      }

      Response answer =  new VOResponse(new Boolean(true));
      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOResponse)answer;
    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while deleting existing out delivery note rows",ex);
      try {
        if (this.conn==null && conn!=null)
View Full Code Here

    // - add all item types
    Domain dit = new Domain("DATA_IMPORT_TYPE");
    int pos = 0;
    DataImportType ditVO = null;
    java.util.List itemTypesList = null;
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    if (!res.isError()) {
      ItemTypeVO vo = null;
      itemTypesList = ((VOListResponse)res).getRows();
      for(int i=0;i<itemTypesList.size();i++) {
        vo = (ItemTypeVO)itemTypesList.get(i);
        ditVO = new DataImportType();
        ditVO.comboItemIndex = pos++;
        ditVO.progressiveHIE02 = vo.getProgressiveHie02ITM02();
        ditVO.subTypeCode = vo.getProgressiveHie02ITM02();
        ditVO.className = ImportItemsDescriptorVO.class.getName();
        ditVO.companyCodeSys01 = vo.getCompanyCodeSys01ITM02();

        dit.addDomainPair(
          ditVO,
          ClientSettings.getInstance().getResources().getResource("import")+" "+vo.getDescriptionSYS10()
        );
      }
    }

    // add to the domain about data import type:
    // - customers
    ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
    ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
    ArrayList companiesList = bca.getCompaniesList("SAL07");
    for(int i=0;i<companiesList.size();i++) {
      if (applet.getAuthorizations().getCompanyBa().isInsertEnabled("SAL07",companiesList.get(i).toString())) {
        ditVO = new DataImportType();
        ditVO.comboItemIndex = pos++;
        ditVO.className = ImportCustomersDescriptorVO.class.getName();
        ditVO.companyCodeSys01 = companiesList.get(i).toString();
        dit.addDomainPair(
          ditVO,
          ClientSettings.getInstance().getResources().getResource("import")+" "+ClientSettings.getInstance().getResources().getResource("customers")+" "+companiesList.get(i).toString()
        );
      }
    }


    // add to the domain about data import type:
    // - sale pricelists
    res = ClientUtils.getData("loadPricelists",new GridParams());
    if (!res.isError()) {
      PricelistVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (PricelistVO)list.get(i);
        ditVO = new DataImportType();
        ditVO.comboItemIndex = pos++;
        ditVO.subTypeCode = vo.getPricelistCodeSAL01();
        ditVO.className = ImportSalePricesDescriptorVO.class.getName();
        ditVO.companyCodeSys01 = vo.getCompanyCodeSys01SAL01();

        dit.addDomainPair(
          ditVO,
          ClientSettings.getInstance().getResources().getResource("import sale prices")+" "+
          ClientSettings.getInstance().getResources().getResource("for pricelist")+" "+vo.getDescriptionSYS10()
        );
      }
    }

    // add to the domain about data import type:
    // - supplier items
    res = ClientUtils.getData("loadSuppliers",new GridParams());
    if (!res.isError()) {
      GridSupplierVO vo = null;
      ItemTypeVO itemTypeVO = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (GridSupplierVO)list.get(i);
        for(int j=0;j<itemTypesList.size();j++) {
          itemTypeVO = (ItemTypeVO)itemTypesList.get(j);
          ditVO = new DataImportType();
          ditVO.comboItemIndex = pos++;
          ditVO.subTypeCode = vo.getProgressiveREG04();
          ditVO.subTypeCode2 = itemTypeVO.getProgressiveHie02ITM02();
          ditVO.progressiveHIE02 = itemTypeVO.getProgressiveHie02ITM02();
          ditVO.className = ImportSupplierItemsDescriptorVO.class.getName();
          ditVO.companyCodeSys01 = vo.getCompanyCodeSys01REG04();

          dit.addDomainPair(
            ditVO,
            ClientSettings.getInstance().getResources().getResource("import")+" "+
            itemTypeVO.getDescriptionSYS10()+" "+
            ClientSettings.getInstance().getResources().getResource("for supplier")+" "+
            vo.getName_1REG04()
          );
        }
      }
    }

    // add to the domain about data import type:
    // - supplier prices
    res = ClientUtils.getData("loadSupplierPricelists",new GridParams());
    if (!res.isError()) {
      SupplierPricelistVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (SupplierPricelistVO)list.get(i);
        ditVO = new DataImportType();
View Full Code Here

      bean.setConn(conn);

      // retrieve all out delivery note rows...
      GridParams pars = new GridParams();
      pars.getOtherGridParams().put(ApplicationConsts.DELIVERY_NOTE_PK,pk);
      Response res = bean.loadOutDeliveryNoteRows(variant1Descriptions,variant2Descriptions,variant3Descriptions,variant4Descriptions,variant5Descriptions,pars,serverLanguageId,username);
      if (res.isError())
        throw new Exception(res.getErrorMessage());

      String sql1 =
          "select QTY,OUT_QTY from DOC02_SELLING_ITEMS where "+
          "COMPANY_CODE_SYS01=? and DOC_TYPE=? and DOC_YEAR=? and DOC_NUMBER=? and ITEM_CODE_ITM01=? and "+
          "VARIANT_TYPE_ITM06=? and VARIANT_CODE_ITM11=? and "+
          "VARIANT_TYPE_ITM07=? and VARIANT_CODE_ITM12=? and "+
          "VARIANT_TYPE_ITM08=? and VARIANT_CODE_ITM13=? and "+
          "VARIANT_TYPE_ITM09=? and VARIANT_CODE_ITM14=? and "+
          "VARIANT_TYPE_ITM10=? and VARIANT_CODE_ITM15=? ";

      String sql2 =
          "update DOC02_SELLING_ITEMS set OUT_QTY=?,LAST_UPDATE_USER=?,LAST_UPDATE_DATE=?  where "+
          "COMPANY_CODE_SYS01=? and DOC_TYPE=? and DOC_YEAR=? and DOC_NUMBER=? and ITEM_CODE_ITM01=? and OUT_QTY=? and "+
          "VARIANT_TYPE_ITM06=? and VARIANT_CODE_ITM11=? and "+
          "VARIANT_TYPE_ITM07=? and VARIANT_CODE_ITM12=? and "+
          "VARIANT_TYPE_ITM08=? and VARIANT_CODE_ITM13=? and "+
          "VARIANT_TYPE_ITM09=? and VARIANT_CODE_ITM14=? and "+
          "VARIANT_TYPE_ITM10=? and VARIANT_CODE_ITM15=? ";

      pstmt1 = conn.prepareStatement(sql1);
      pstmt2 = conn.prepareStatement(sql2);

      // for each item row, the related sale order row will be updated and available quantities in warehouse...
      GridOutDeliveryNoteRowVO vo = null;
      ResultSet rset1 = null;
      BigDecimal qtyDOC02 = null;
      BigDecimal outQtyDOC02 = null;
      BigDecimal qtyToAdd = null;
      Response innerResponse = null;
      for(int i=0;i<((VOListResponse)res).getRows().size();i++) {
        vo = (GridOutDeliveryNoteRowVO)((VOListResponse)res).getRows().get(i);
        pstmt1.setString(1,vo.getCompanyCodeSys01DOC10());
        pstmt1.setString(2,vo.getDocTypeDoc01DOC10());
        pstmt1.setBigDecimal(3,vo.getDocYearDoc01DOC10());
        pstmt1.setBigDecimal(4,vo.getDocNumberDoc01DOC10());
        pstmt1.setString(5,vo.getItemCodeItm01DOC10());

        pstmt1.setString(6,vo.getVariantTypeItm06DOC10());
        pstmt1.setString(7,vo.getVariantCodeItm11DOC10());
        pstmt1.setString(8,vo.getVariantTypeItm07DOC10());
        pstmt1.setString(9,vo.getVariantCodeItm12DOC10());
        pstmt1.setString(10,vo.getVariantTypeItm08DOC10());
        pstmt1.setString(11,vo.getVariantCodeItm13DOC10());
        pstmt1.setString(12,vo.getVariantTypeItm09DOC10());
        pstmt1.setString(13,vo.getVariantCodeItm14DOC10());
        pstmt1.setString(14,vo.getVariantTypeItm10DOC10());
        pstmt1.setString(15,vo.getVariantCodeItm15DOC10());

        rset1 = pstmt1.executeQuery();
        if(rset1.next()) {
          qtyDOC02 = rset1.getBigDecimal(1);
          outQtyDOC02 = rset1.getBigDecimal(2);
          rset1.close();
/*
          // update out qty in the sale document row...
          if (vo.getSupplierQtyDOC10().doubleValue()<qtyDOC02.subtract(outQtyDOC02).doubleValue())
            qtyToAdd = vo.getSupplierQtyDOC10();
          else
            qtyToAdd = qtyDOC02.subtract(outQtyDOC02);
          pstmt2.setBigDecimal(1,outQtyDOC02.add(qtyToAdd).setScale(vo.getSupplierQtyDecimalsREG02().intValue(),BigDecimal.ROUND_HALF_UP));
          pstmt2.setString(2,vo.getCompanyCodeSys01DOC10());
          pstmt2.setString(3,vo.getDocTypeDoc01DOC10());
          pstmt2.setBigDecimal(4,vo.getDocYearDoc01DOC10());
          pstmt2.setBigDecimal(5,vo.getDocNumberDoc01DOC10());
          pstmt2.setString(6,vo.getItemCodeItm01DOC10());
          pstmt2.setBigDecimal(7,outQtyDOC02);
*/

          if (pstmt2.executeUpdate()==0)
            throw new Exception("Updating not performed: the record was previously updated.");
        }
        else
          rset1.close();

        // update warehouse available qty..
        WarehouseMovementVO movVO = new WarehouseMovementVO(
            vo.getProgressiveHie01DOC10(),
            vo.getQtyDOC10(),
            vo.getCompanyCodeSys01DOC10(),
            vo.getWarehouseCodeWar01DOC08(),
            vo.getItemCodeItm01DOC10(),
            ApplicationConsts.WAREHOUSE_MOTIVE_UNLOAD_BY_ORDER,
            ApplicationConsts.ITEM_GOOD,
            t1+" "+vo.getDocNumberDoc01DOC10()+"/"+vo.getDocYearDoc01DOC10(),
            vo.getSerialNumbers(),

            vo.getVariantCodeItm11DOC10(),
            vo.getVariantCodeItm12DOC10(),
            vo.getVariantCodeItm13DOC10(),
            vo.getVariantCodeItm14DOC10(),
            vo.getVariantCodeItm15DOC10(),
            vo.getVariantTypeItm06DOC10(),
            vo.getVariantTypeItm07DOC10(),
            vo.getVariantTypeItm08DOC10(),
            vo.getVariantTypeItm09DOC10(),
            vo.getVariantTypeItm10DOC10()

        );
        innerResponse = movBean.addWarehouseMovement(movVO,t2,serverLanguageId,username);

        if (innerResponse.isError())
          throw new Exception(innerResponse.getErrorMessage());
      }


      return  new VOResponse(Boolean.TRUE);
    }
View Full Code Here

  void buttonRemoteFile_actionPerformed(ActionEvent e) {
    final ListControl list = new ListControl();
    Domain model = new Domain("FILES");
    final JDialog d = new JDialog(MDIFrame.getInstance(),"File",true);
    d.getContentPane().add(new JScrollPane(list),BorderLayout.CENTER);
    Response res = ClientUtils.getData("getFolderContent",new Object[]{controlFormat.getValue(),null});
    if (!res.isError()) {
      java.util.List rows = ((VOListResponse)res).getRows();
      File f = null;
      for(int i=0;i<rows.size();i++) {
        f = (File) rows.get(i);
        model.addDomainPair(f,f.getAbsolutePath());
      }
    }
    list.setDomain(model);
    list.addMouseListener(new MouseAdapter() {

      public void mouseClicked(MouseEvent e) {
        if (e.getClickCount()==2) {
          ArrayList fff = (ArrayList)list.getValue();
          File f = (File)fff.get(0);
          if (f.isDirectory()) {
            Response res = ClientUtils.getData("getFolderContent",new Object[]{controlFormat.getValue(),f});
            if (!res.isError()) {
              java.util.List rows = ((VOListResponse)res).getRows();
              Domain model = new Domain("FILES");
              File ff = null;
              for(int i=0;i<rows.size();i++) {
                ff = (File) rows.get(i);
View Full Code Here

TOP

Related Classes of org.openswing.swing.message.receive.java.Response

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.