本文整理汇总了PHP中Workflow::doNext方法的典型用法代码示例。如果您正苦于以下问题:PHP Workflow::doNext方法的具体用法?PHP Workflow::doNext怎么用?PHP Workflow::doNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Workflow
的用法示例。
在下文中一共展示了Workflow::doNext方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insert
public function insert()
{
$id = parent::insert(true);
import("@.Workflow.Workflow");
$workflow = new Workflow($this->workflowAlias);
$rs = $workflow->doNext($id, null, false, false);
}
示例2: run
public function run()
{
$bomModel = D("ProduceBoms");
$stockoutModel = D("Stockout");
$stockoutDetailModel = D("StockoutDetail");
$theBoms = $bomModel->where("plan_id=" . $this->mainrowId)->select();
$stockoutModel->startTrans();
$theStockout = array("bill_id" => makeBillCode("CK"), "source_id" => $this->mainrowId, "source_model" => "ProducePlan", "dateline" => CTS, "total_num" => 0, "stock_manager" => 0, "shipment_id" => 0, "status" => 0, "memo" => "ProducePlan #" . $this->mainrowId);
$stockoutId = $stockoutModel->add($theStockout);
if (!$stockoutId) {
Log::write("SQL Error:" . $stockoutModel->getLastSql(), Log::SQL);
$stockoutModel->rollback();
$this->response(array("type" => "message", "msg" => "Server Error.", "error" => 1));
}
$totalNum = 0;
foreach ($theBoms as $k => $v) {
$totalNum += $v["num"];
$theDetail = array("stockout_id" => $stockoutId, "factory_code_all" => $v["factory_code_all"], "goods_id" => $v["goods_id"], "stock_id" => 0, "num" => $v["num"]);
if (!$stockoutDetailModel->add($theDetail)) {
//@todo
Log::write("SQL Error:" . $stockoutModel->getLastSql(), Log::SQL);
$stockoutModel->rollback();
$this->response(array("type" => "message", "msg" => "Server Error.", "error" => 1));
}
}
$stockoutModel->where("id=" . $stockoutId)->save(array("total_num" => $totalNum));
// echo $stockoutModel->getLastSql();exit;
$stockoutModel->commit();
$workflow = new Workflow("stockout");
$workflow->doNext($stockoutId, false, true, false);
// print_r($theBoms);exit;
}
示例3: newPlan
public function newPlan($data)
{
$rows = $data["rows"];
unset($data["rows"]);
$this->startTrans();
$id = $this->add($data);
if (!$id) {
Log::write("SQL Error:" . $this->getLastSql(), Log::SQL);
$this->rollback();
return false;
}
$detailModel = D("ProducePlanDetail");
foreach ($rows as $row) {
$row["plan_id"] = $id;
$rs = $detailModel->add($row);
if (!$rs) {
Log::write("SQL Error:" . $this->getLastSql(), Log::SQL);
$this->rollback();
return false;
}
}
$this->commit();
$workflow = new Workflow($this->workflowAlias);
$workflow->doNext($id, "", true);
return $id;
}
示例4: newBill
public function newBill($data)
{
if (!$data["rows"]) {
return;
}
if (!$this->checkFactoryCodeAll($data["rows"])) {
$this->error = "factory_code_not_full";
return false;
}
$this->startTrans();
$purchaseId = $this->add($data);
if (!$purchaseId) {
$this->error = "insert purchase bill failed";
Log::write("SQL Error:" . $this->getLastSql(), Log::SQL);
$this->rollback();
return false;
}
$detailModel = D("PurchaseDetail");
foreach ($data["rows"] as $row) {
$row["purchase_id"] = $purchaseId;
$row["price"] = $row["amount"];
if (!$detailModel->add($row)) {
$this->error = "insert purchase bill detail failed";
Log::write("SQL Error:" . $detailModel->getLastSql(), Log::SQL);
$this->rollback();
return false;
}
}
$this->commit();
$workflow = new Workflow($this->workflowAlias);
$workflow->doNext($purchaseId, "", true);
return $purchaseId;
}
示例5: run
public function run()
{
$stockin = D("Stockin");
$stockin->where("id=" . $this->mainrowId)->save(array("status" => 2));
$theStockin = $stockin->find($this->mainrowId);
if ($theStockin["source_model"]) {
//若外部生成,走外部下一流程
$workflow = new Workflow(lcfirst($theStockin["source_model"]), $this->action);
$workflow->doNext($theStockin["source_id"], "", true, 3);
}
}
示例6: run
public function run()
{
$model = D("Stockout");
$theStockout = $model->find($this->mainrowId);
$model->where("id=" . $this->mainrowId)->save(array("status" => 2));
if ($this->context["sourceModel"]) {
$sourceNode = $this->getNodeByAlias(lcfirst($this->context["sourceModel"]), "Complete");
$workflow = new Workflow($this->context["sourceWorkflow"], $this->context);
$workflow->doNext($theStockout["source_id"], $sourceNode["id"], true, 3);
}
}
示例7: record
public function record($data)
{
$data["create_dateline"] = CTS;
$data["status"] = 0;
$data["user_id"] = getCurrentUid();
$lastId = $this->add($data);
if (!$lastId) {
Log::write($this->getLastSql(), Log::SQL);
return false;
}
$workflow = new Workflow("financePay");
$workflow->doNext($lastId, "", true);
return $lastId;
}
示例8: run
public function run()
{
$stockout = D("Stockout");
$stockoutId = $stockout->makeStockoutPaper("Orders", $this->mainrowId, "saler_id", "order_id");
//流程上下文
$this->context = array("sourceModel" => "Orders", "sourceWorkflow" => "orders", "sourceId" => $this->mainrowId, "sourceMainrowField" => "order_id");
$this->updateStatus("Orders", $this->mainrowId, 1);
// $orderModel = D("Orders");
// $orderModel->where("id=".$this->mainrowId)->save(array("status" => 1));
// print_r($this->context);exit;
//新建出库工作流
import("@.Workflow.Workflow");
$workflow = new Workflow("stockout", $this->context);
$workflow->doNext($stockoutId, "", true, true);
}
示例9: run
public function run()
{
$this->updateStatus("Returns", $this->mainrowId, 2);
//财务
if (isModuleEnabled("Finance")) {
$returns = D("Returns");
$theReturns = $returns->find($this->mainrowId);
$financeModel = D("FinancePayPlan");
$data = array("source_model" => "Returns", "source_id" => $this->mainrowId, "subject" => $theReturns["subject"], "supplier_id" => $theReturns["customer_id"], "amount" => $theReturns["total_price_real"], "create_dateline" => CTS, "status" => 0, "type_id" => getTypeIdByAlias("pay", "returns"), "user_id" => getCurrentUid());
$lastId = $financeModel->add($data);
// echo $lastId;exit;
// echo $financeModel->getLastSql();exit;
import("@.Workflow.Workflow");
$workflow = new Workflow("financePay");
$node = $workflow->doNext($lastId, "", true);
// var_dump($node);
}
}
示例10: newBill
/**
* 创建新单据
*/
public function newBill($billData, $billItems)
{
if (!$billItems) {
$this->error = "fillTheForm";
return false;
}
/*
* 预检测factory_code_all
* **/
if (!$this->checkFactoryCodeAll($billItems)) {
$this->error = "factory_code_not_full";
return false;
}
$this->startTrans();
$billData["bill_id"] = makeBillCode("RK");
$billId = $this->add($billData);
if (!$billId) {
$this->rollback();
$this->error = "insert_error";
return false;
}
$itemsModel = D("StockinDetail");
foreach ($billItems as $billItem) {
$billItem["stockin_id"] = $billId;
$id = $itemsModel->add($billItem);
if (!$id) {
$this->rollback();
return false;
}
}
$this->commit();
//单据进入初始工作流程
import("@.Workflow.Workflow");
$workflow = new Workflow($this->workflowAlias);
$node = $workflow->doNext($billId, "", true);
return $billId;
}
示例11: newBill
public function newBill($data)
{
$data = $this->formatData($data);
$rows = $data["rows"];
if (!$rows) {
$this->error = "fillTheForm";
return false;
}
unset($data["rows"]);
if (!$this->checkFactoryCodeAll($rows)) {
$this->error = "factory_code_not_full";
return false;
}
$this->startTrans();
$stockOutId = $this->add($data);
if (!$stockOutId) {
$this->error = "save stockout failed";
$this->rollback();
Log::write($this->getLastSql(), Log::SQL);
return false;
}
$detailModel = D("StockoutDetail");
foreach ($rows as $row) {
$row["stockout_id"] = $stockOutId;
unset($row["id"]);
// if(isset($row["store_num"]) && $row["store_num"] < $row["num"]) {
// $this->error = "_unicode_|".$row["goods_id_label"].lang("messages.store_num_not_full");
// return false;
// }
if (!$detailModel->add($row)) {
$this->rollback();
Log::write($this->getLastSql(), Log::SQL);
$this->error = "save stockout detail failed";
return false;
}
}
$this->commit();
import("@.Workflow.Workflow");
$workflow = new Workflow($this->workflowAlias);
$node = $workflow->doNext($stockOutId, "", true);
return $stockOutId;
}
示例12: insert
/**
*
*/
public function insert()
{
$data = $_POST;
foreach ($data["rows"] as $k => $row) {
if (!$row or !$row["goods_id"]) {
unset($data["rows"][$k]);
continue;
}
list($fcCode, $goods_id, $catid) = explode("_", $row["goods_id"]);
$data["rows"][$k]["goods_id"] = $goods_id;
$data["rows"][$k]["factory_code_all"] = makeFactoryCode($row, $fcCode);
unset($data["rows"][$k]["standard"]);
unset($data["rows"][$k]["version"]);
}
$data["bill_id"] = makeBillCode("ST");
$data["dateline"] = strtotime($data["inputTime"]);
$data["saler_id"] = $this->user["id"];
unset($data["customerInfo"]);
unset($data["discount"]);
unset($data["inputTime"]);
$model = D("Returns");
$returnsId = $model->newReturns($data);
// var_dump($returnsId);exit;
if (!$returnsId) {
$this->error($model->getError());
return;
}
import("@.Workflow.Workflow");
$workflow = new Workflow($this->workflowAlias);
$node = $workflow->doNext($returnsId, "", true);
// $this->redirect("/JXC/Orders/editDetail/id/".$id);
// $this->success(L("operate_success"));
}
示例13: doWorkflow
/**
* 执行工作流节点
*/
protected function doWorkflow()
{
$mainRowid = $_GET["id"] ? abs(intval($_GET['id'])) : abs(intval($_POST['id']));
$nodeId = $_GET["node_id"] ? abs(intval($_GET["node_id"])) : abs(intval($_POST["node_id"]));
if (!$this->workflowAlias or !$mainRowid or !$nodeId) {
Log::write("workflow error: something is wrong : {$this->workflowAlias},{$mainRowid},{$nodeId}");
$this->error("not_allowed1");
return;
}
$workflow = new Workflow($this->workflowAlias);
$rs = $workflow->doNext($mainRowid, $nodeId, false, false);
if (false === $rs) {
Log::write("workflow error when execute node: " . $nodeId . "," . $mainRowid);
$this->error("not_allowed");
return;
}
// 结束信息返回true、或者没有任何返回值时跳转
if (true === $rs or empty($rs)) {
$this->success("Success");
}
}
示例14: insert
/**
*
*/
public function insert()
{
if ($_REQUEST["workflow"]) {
return $this->doWorkflow();
}
$model = D("Orders");
$data = $model->formatData($_POST);
$orderId = $model->newOrder($data);
if (false === $orderId) {
$this->error($model->getError());
return;
}
import("@.Workflow.Workflow");
$workflow = new Workflow($this->workflowAlias);
$node = $workflow->doNext($orderId, "", true);
}