📄 shipmentworkefforttasksprepare.bsh
字号:
/* * $Id: ShipmentWorkEffortTasksPrepare.bsh 6476 2006-01-08 16:48:51Z jacopo $ * * Copyright (c) 2003 The Open For Business Project - www.ofbiz.org * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */import org.ofbiz.entity.*;import org.ofbiz.base.util.*;import org.ofbiz.order.order.*;import org.ofbiz.content.report.*;delegator = request.getAttribute("delegator");dispatcher = request.getAttribute("dispatcher");userLogin = request.getSession().getAttribute("userLogin");jrParameters = new HashMap();shipmentId = request.getParameter("shipmentId");shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId));jrParameters.put("shipmentIdPar", shipment.getString("shipmentId"));jrParameters.put("date", new Date());if (shipment != null) { shipmentPlans = delegator.findByAnd("OrderShipment", UtilMisc.toMap("shipmentId", shipmentId)); shipmentPlansIt = shipmentPlans.iterator(); records = new ArrayList(); while(shipmentPlansIt.hasNext()) { shipmentPlan = shipmentPlansIt.next(); productionRuns = delegator.findByAnd("WorkOrderItemFulfillment", UtilMisc.toMap("orderId", shipmentPlan.getString("orderId"), "orderItemSeqId", shipmentPlan.getString("orderItemSeqId")), UtilMisc.toList("workEffortId")); // TODO: add shipmentId if (productionRuns != null && productionRuns.size() > 0) { productionRunsIt = productionRuns.iterator(); while (productionRunsIt.hasNext()) { productionRun = productionRunsIt.next(); productionRunProduct = null; productionRunProducts = delegator.findByAnd("WorkEffortGoodStandard", UtilMisc.toMap("workEffortId", productionRun.getString("workEffortId"), "workEffortGoodStdTypeId", "PRUN_PROD_DELIV", "statusId", "WEGS_CREATED")); if (productionRunProducts != null && productionRunProducts.size() > 0) { //productionRunProduct = ((GenericValue)productionRunProducts.get(0)).getString("productId"); productionRunProduct = ((GenericValue)productionRunProducts.get(0)).getRelatedOne("Product"); } tasks = delegator.findByAnd("WorkEffort", UtilMisc.toMap("workEffortParentId", productionRun.getString("workEffortId"), "workEffortTypeId", "PROD_ORDER_TASK")); tasksIt = tasks.iterator(); while (tasksIt.hasNext()) { task = tasksIt.next(); record = new HashMap(); record.put("productId", productionRunProduct.getString("productId")); record.put("productName", productionRunProduct.getString("internalName")); record.put("fixedAssetId", task.getString("fixedAssetId")); record.put("priority", task.getLong("priority")); record.put("workEffortId", productionRun.getString("workEffortId")); record.put("taskId", task.getString("workEffortId")); record.put("taskName", task.getString("workEffortName")); record.put("taskDescription", task.getString("description")); record.put("taskEstimatedTime", task.getDouble("estimatedMilliSeconds")); record.put("taskEstimatedSetup", task.getDouble("estimatedSetupMillis")); records.add(record); } } } } jrDataSource = new JRMapCollectionDataSource(records); request.setAttribute("jrDataSource", jrDataSource); request.setAttribute("jrParameters", jrParameters);}return "success";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -