|
|
@@ -69,7 +69,7 @@ class WorkController extends BaseController
|
|
|
$id = $get['id'] ?? 0;
|
|
|
$work = WorkClass::getById($id, true);
|
|
|
WorkClass::valid($work, $this->mainId);
|
|
|
- WorkClass::print($work, $this->shop);
|
|
|
+ WorkClass::print($work, $this->shop, true);
|
|
|
util::complete();
|
|
|
}
|
|
|
|
|
|
@@ -277,17 +277,6 @@ class WorkController extends BaseController
|
|
|
if ($work->status == 2) {
|
|
|
util::fail('制作单已取消');
|
|
|
}
|
|
|
- //花材未锁定,需要锁定并扣库存
|
|
|
- if ($work->stockLock == 0) {
|
|
|
- $itemList = $post['itemList'] ?? '';
|
|
|
- if (!empty($itemList)) {
|
|
|
- $product = json_decode($itemList, true);
|
|
|
- if (!empty($product)) {
|
|
|
- WorkItemClass::modifyItem($work, $product);
|
|
|
- WorkItemClass::lock($work);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
$staffId = $post['staffId'] ?? 0;
|
|
|
if (empty($staffId)) {
|
|
|
util::fail('请选择制作人');
|
|
|
@@ -303,38 +292,6 @@ class WorkController extends BaseController
|
|
|
}
|
|
|
|
|
|
$msg = '已完成';
|
|
|
-
|
|
|
- $orderId = $work->orderId ?? 0;
|
|
|
- if (!empty($orderId) && $work->fromType == dict::getDict('fromType', 'mt')) {
|
|
|
- $allWork = WorkClass::getAllByCondition(['orderId' => $orderId], null, '*', null, true);
|
|
|
- //订单下如果还有制作单未完成,则不通知美图已经完成拣货
|
|
|
- $allComplete = true;
|
|
|
- if (!empty($allWork)) {
|
|
|
- foreach ($allWork as $current) {
|
|
|
- if ($current->status != 1) {
|
|
|
- $allComplete = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if ($allComplete) {
|
|
|
- $order = OrderClass::getById($orderId, true);
|
|
|
- $thirdOrderId = $order->thirdOrderId ?? '';
|
|
|
- $fromType = $order->fromType ?? 0;
|
|
|
- if (!empty($thirdOrderId) && $fromType == dict::getDict('fromType', 'mt')) {
|
|
|
-// $shopId = $order->shopId ?? 0;
|
|
|
-// $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
|
|
|
-// $config = dict::getDict('mtConfig');
|
|
|
-// $app = new Application($config);
|
|
|
-// $accessToken = mtUtil::getAccessToken($ext);
|
|
|
-// $params = ['order_id' => $thirdOrderId, 'access_token' => $accessToken];
|
|
|
-// $mtRes = $app->order->logisticsPush($params);
|
|
|
-// $mtRes = json_decode($mtRes, true);
|
|
|
-// if (isset($mtRes['data']) && $mtRes['data'] == 'ok') {
|
|
|
-// $msg = '已完成,已通知骑手';
|
|
|
-// }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
util::complete($msg);
|
|
|
} catch (\Exception $e) {
|
|
|
$transaction->rollBack();
|