Пример #1
0
  public void onPrintTag(int palletId) {
    String printTagReportName = Utils.genReportName("_PrintTag");
    String partReport = "";
    PalletModel palletModel = null;
    List<PalletManagemengModelReport> reportViews = null;
    HashMap map = new HashMap<String, Object>();

    try {
      palletModel = palletDAO.findByID(palletId);
      if (!Utils.isNull(palletModel) && Utils.isZero(palletModel.getIsCombine())) {
        reportViews = palletDAO.genSQLReportPallet(palletId);
        partReport = pathPrintTagReport;
      } else if (!Utils.isNull(palletModel) && !Utils.isZero(palletModel.getIsCombine())) {
        partReport = pathPrintTagV2Report;
        map.put("path", FacesUtil.getRealPath(pathSubReport));
        map.put("MainPallet", palletDAO.findByIdToReport(palletModel.getId()));
        map.put("SubPallet", palletDAO.genSQLReportPalletV2(palletModel.getId()));
      }
    } catch (Exception e) {
      log.debug("Exception error onPrintTag : ", e);
    }

    try {
      reportService.exportPDF(partReport, map, printTagReportName, reportViews);
    } catch (Exception e) {
      log.debug("Exception Report : ", e);
    }
  }
Пример #2
0
  public void changeLocation(
      PalletTransferView palletManagementView,
      LocationItemView locationItemView,
      int stockInOutId) {
    log.debug("changeLocation().");
    try {
      MSLocationModel model = locationDAO.findByID(locationItemView.getId()); // toLocation
      PalletModel palletModel = palletDAO.findByID(palletManagementView.getId()); // fromPallet

      palletDAO.updateNewPalletTransferByChangeLocation(palletModel.getId(), model.getId());

      if (palletModel.getStatus() == 3) {
        // Print Tag
        palletDAO.updateLocationByStatusPrinted(palletModel.getMsLocationModel().getId());
      } else {
        // Find Location
        palletDAO.updateLocationByStatusLocated(model.getId());
      }

      // บวกของใหม่  ลบของเก่า
      palletDAO.updateLocationByOld(model.getId());
      //            palletDAO.updateLocationByNew(palletModel.getMsLocationModel().getId());

      saveOrUpdateStockInOutLine(palletModel, stockInOutId, model);

    } catch (Exception e) {
      log.debug("Exception : {}", e);
    }
  }
Пример #3
0
  public void onUpdateByPrintTag(PalletTransferView palletManagementView, String redirect) {
    log.debug("onSaveByPrintTag().");
    PalletModel palletModel = null;
    int staffModel = (int) FacesUtil.getSession(false).getAttribute(AttributeName.STAFF.getName());
    try {
      if (!Utils.isNull(palletManagementView)) {
        palletModel = palletDAO.findByID(palletManagementView.getId());

        if (palletModel.getStatus() == 2) {
          palletModel.setStatus(palletModel.getStatus() + 1);
        } else {
          palletModel.setStatus(palletModel.getStatus());
        }
        palletModel.setUpdateBy(staffModel);
        palletModel.setUpdateDate(new Date());
      }

      palletDAO.update(palletModel);
    } catch (Exception e) {
      log.debug("Exception : {}", e);
    }
  }
Пример #4
0
 public List<PalletTransferView> getPalletByStockID(int stockId) {
   return palletDAO.findByStockInOutId(stockId);
 }
Пример #5
0
 public List<PalletTransferView> search(
     String palletTag, String itemId, int locationId, int warehouseId) {
   return palletDAO.findBySearch(palletTag, itemId, locationId, warehouseId);
 }