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); } }
public void onFind() { log.debug("changeOn : {}, findKeyItemDescription : {}", statusOnShow, findKeyItemDescription); log.debug("{},{},{}", warehouseMode.getId(), workingAreaModel.getId(), msLocationModel.getId()); int warehouseId = 0; int waokingAreaId = 0; int locationId = 0; int combine = 0; int foil = 0; palletMeanegementView = new PalletManagementView(); if (!Utils.isNull(warehouseMode.getId())) { msLocationModelList = locationService.getLocationByWarehouse(warehouseMode.getId()); warehouseId = warehouseMode.getId(); } if (!Utils.isNull(workingAreaModel.getId())) { waokingAreaId = workingAreaModel.getId(); } if (!Utils.isNull(msLocationModel.getId())) { locationId = msLocationModel.getId(); } log.debug("isCombine : {}", isCombine); if (isCombine == true) { combine = 1; } if (isFoil == true) { foil = 1; } palletManegamentViewList = palletService.findByChang( statusOnShow, warehouseId, waokingAreaId, locationId, findKeyItemDescription, combine, foil); }
private void saveOrUpdateStockInOutLine( PalletModel palletModel, int stockInOutId, MSLocationModel toLocationId) { // jowjo StockInOutLineModel stockInOutLineModel = null; stockInOutLineModel = stockInOutLineDAO.findByPalletIdAndStockInOutId(palletModel.getId(), stockInOutId); int staffModel = (int) FacesUtil.getSession(false).getAttribute(AttributeName.STAFF.getName()); try { if (!Utils.isNull(stockInOutLineModel) && !Utils.isZero(stockInOutLineModel.getId())) { log.debug("Update Stock In Out Line"); stockInOutLineModel.setUpdateBy(staffModel); stockInOutLineModel.setUpdateDate(Utils.currentDate()); stockInOutLineModel.setMsItemModel(palletModel.getMsItemModel()); stockInOutLineModel.setPalletModel(palletModel); stockInOutLineModel.setMsLocationModel(toLocationId); stockInOutLineModel.setBarcode(palletModel.getPalletBarcode()); stockInOutLineModel.setPreviousLocationId(palletModel.getMsLocationModel().getId()); stockInOutLineDAO.update(stockInOutLineModel); } else { log.debug("Prsist Stock In Out Line"); stockInOutLineModel = new StockInOutLineModel(); stockInOutLineModel.setCreateBy(staffModel); stockInOutLineModel.setCreateDate(Utils.currentDate()); stockInOutLineModel.setUpdateBy(staffModel); stockInOutLineModel.setUpdateDate(Utils.currentDate()); stockInOutLineModel.setMsItemModel(palletModel.getMsItemModel()); stockInOutLineModel.setPalletModel(palletModel); stockInOutLineModel.setMsLocationModel(toLocationId); stockInOutLineModel.setBarcode(palletModel.getPalletBarcode()); stockInOutLineModel.setStockInOutModel(stockInOutDAO.findByID(stockInOutId)); stockInOutLineModel.setPreviousLocationId(palletModel.getMsLocationModel().getId()); stockInOutLineModel.setIsValid(1); stockInOutLineModel.setVersion(1); // stockInOutLineModel.setQty(0); stockInOutLineDAO.persist(stockInOutLineModel); } } catch (Exception e) { log.debug("Exception error saveOrUpdateStockInOutLine : ", e); } }
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); } }
public void onClickButtonNew() { if (mode) { loadingOrderModel = new LoadingOrderModel(); loadingOrderModel.setDocNo(Utils.getDocumentOverSeaLoad()); } }