本文整理汇总了PHP中DaoFactory::ZaikoChouseiD方法的典型用法代码示例。如果您正苦于以下问题:PHP DaoFactory::ZaikoChouseiD方法的具体用法?PHP DaoFactory::ZaikoChouseiD怎么用?PHP DaoFactory::ZaikoChouseiD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DaoFactory
的用法示例。
在下文中一共展示了DaoFactory::ZaikoChouseiD方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform
/**
* 棚卸調整マスタの保存が成功したかJSON形式で返す
* @access public
* @see Admin_ActionClass::perform()
*/
function perform()
{
// get request params
$chousei_date = $this->af->get('chousei_date');
$chousei = $this->af->get('chousei');
$biko = $this->af->get('biko');
// get session params
$company_id = $this->session->get('company_id');
$s_user_id = $this->session->get('user_id');
// dao
$zaikoChoseiDDao = DaoFactory::ZaikoChouseiD();
$zaikoChouseiMDDao = DaoFactory::ZaikoChouseiMD();
$warehouseDao = DaoFactory::WarehouseMst();
$productDao = DaoFactory::ProductMst();
try {
// begin
$zaikoChoseiDDao->BeginTransaction();
// print_r($chousei);
if (!empty($chousei)) {
foreach ($chousei as $warehouseId => $val) {
// shop_cd 存在チェック
$warehouse = $warehouseDao->Retrieve(' company_id = ? AND warehouse_id = ? ', array('company_id' => $company_id, 'warehouse_id' => $warehouseId));
if (empty($warehouse)) {
throw new Exception("入力された 倉庫ID: {$warehouseId} は登録されていません");
}
// 枝番号初期化
$edaban = 0;
foreach ($val as $product_id => $chousei_num) {
// chousei_num 空、0チェック
if (!$chousei_num) {
continue;
}
// ゼロ、空文字であればスルー
// 調整NOの最大値を取得
$chousei_no = intval($zaikoChoseiDDao->maxByColumn('CHOUSEI_NO', " company_id = ? AND terminal_id = '-' AND warehouse_id = ? ", array('company_id' => $company_id, 'warehouse_id' => $warehouseId)));
$chousei_no += 1;
// D に insert
$params = array('company_id' => $company_id, 'terminal_id' => '-', 'chousei_no' => $chousei_no, 'bc_bunrui' => '0', 'warehouse_id' => $warehouseId, 'chousei_date' => array('value' => $chousei_date, 'type' => 'date'), 'nyushutsu_kbn' => '1', 'soshin_flg' => '0', 'zaiko_koshin_flg' => '0', 'biko' => $biko, 'UID' => $s_user_id, 'PGM' => get_class());
// print_r($params);
$zaikoChoseiDDao->Insert($params);
// MD に insert
$edaban += 1;
$params = array('company_id' => $company_id, 'terminal_id' => '-', 'chousei_no' => $chousei_no, 'warehouse_id' => $warehouseId, 'edaban' => $edaban, 'bc_1' => '', 'stock_update_flg' => '0', 'product_id' => $product_id, 'suryo' => $chousei_num, 'UID' => $s_user_id, 'PGM' => get_class());
$zaikoChouseiMDDao->Insert($params);
}
}
}
DaoFactory::ZaikoBatchPkg()->batch_zaiko_chousei_d(array('company_id' => $company_id, 'upd_uid' => $s_user_id, 'upd_pgm' => get_class()));
// commit
$zaikoChoseiDDao->CommitTransaction();
} catch (Exception $e) {
// rollback
// print_r($e);
$zaikoChoseiDDao->AbortTransaction();
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array(500, $e->getMessage());
}
exit;
}