修正终版备货æ单
This commit is contained in:
@@ -15,6 +15,7 @@ use support\Db;
|
|||||||
use support\Model;
|
use support\Model;
|
||||||
use app\common\model\ApprovalInstances;
|
use app\common\model\ApprovalInstances;
|
||||||
use app\common\model\ApprovalRecords;
|
use app\common\model\ApprovalRecords;
|
||||||
|
use support\exception\BusinessException;
|
||||||
|
|
||||||
class StockOrdersService
|
class StockOrdersService
|
||||||
{
|
{
|
||||||
@@ -112,6 +113,22 @@ class StockOrdersService
|
|||||||
$data['pick_up_date'] = $data['pick_up_date'] ? strtotime($data['pick_up_date']) : 0;
|
$data['pick_up_date'] = $data['pick_up_date'] ? strtotime($data['pick_up_date']) : 0;
|
||||||
$data['collect_all_date'] = $data['collect_all_date'] ? strtotime($data['collect_all_date']) : 0;
|
$data['collect_all_date'] = $data['collect_all_date'] ? strtotime($data['collect_all_date']) : 0;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if ($data['is_final'] == 1) {
|
||||||
|
// 检查是否至少有一个车辆填写了vin
|
||||||
|
$hasVin = false;
|
||||||
|
foreach ($data['veh_list'] as $k => $v) {
|
||||||
|
if ($v['vin'] != '') {
|
||||||
|
$hasVin = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果没有任何车辆填写vin,则抛出异常
|
||||||
|
if (!$hasVin) {
|
||||||
|
throw new BusinessException('至少需要为一辆车辆填写vin,才能提交审核');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,18 +99,32 @@ class IndexController
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单迁移
|
||||||
|
*/
|
||||||
|
public function doMenu()
|
||||||
|
{
|
||||||
|
// 菜单迁移 (部分)
|
||||||
|
$where[] = ['id', '>', 239];
|
||||||
|
(new \app\common\utils\MigrationResources())->do('resources', 'resources_20251012_bak', $where);
|
||||||
|
|
||||||
|
// 整体
|
||||||
|
// $list = (new \app\common\utils\MigrationResources())->getFullResourceTreeOptimized('resources_20250916_bak', []);
|
||||||
|
// var_dump($list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function test(Request $request)
|
public function test(Request $request)
|
||||||
{
|
{
|
||||||
// $chain = \app\common\service\MenuBadgeService::buildBadgeChain(menuId: 226, leafCount: rand(1, 10));
|
// $chain = \app\common\service\MenuBadgeService::buildBadgeChain(menuId: 226, leafCount: rand(1, 10));
|
||||||
// (new \app\common\utils\WsEvents())->pushWebsocket('approval.todo.counts', 74, $chain);
|
// (new \app\common\utils\WsEvents())->pushWebsocket('approval.todo.counts', 74, $chain);
|
||||||
|
|
||||||
$data = [
|
// $data = [
|
||||||
'event' => 'approval.todo.counts',
|
// 'event' => 'approval.todo.counts',
|
||||||
'user_id' => 74,
|
// 'user_id' => 74,
|
||||||
'num' => rand(1, 10),
|
// 'num' => rand(1, 10),
|
||||||
];
|
// ];
|
||||||
\Webman\RedisQueue\Redis::send('ws-msg', $data);
|
// \Webman\RedisQueue\Redis::send('ws-msg', $data);
|
||||||
|
|
||||||
return json(['code' => 0, 'msg' => 'success']);
|
return json(['code' => 0, 'msg' => 'success']);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user