| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace App\Http\Controllers;
- use App\Components\AsyncResponse;
- use App\OracleDOCASNHeader;
- use App\Services\HandInStorageService;
- use Illuminate\Http\Request;
- class HandInStorageController extends Controller
- {
- use AsyncResponse;
- /**
- * 搜索查詢asn
- */
- public function selectAsn(Request $request)
- {
- /** @var HandInStorageService $handInStorageService */
- $handInStorageService=app('HandInStorageService');
- $asnno= $request->input('asnno');
- $asns =$handInStorageService->selectAsn($asnno);
- if ($asns->count()>0){
- $this->success($asns);
- }else{
- $this->error('未搜索到ASN单');
- }
- }
- /**
- * @param $asnno
- * 跳转到收货明细页面
- */
- public function receiveDetailPage($asnno,$customerid)
- {
- /** @var HandInStorageService $handInStorageService */
- $handInStorageService=app('HandInStorageService');
- if (!$customerid||$customerid=='undefined')
- $customerid=OracleDOCASNHeader::query()->where('asnno',$asnno)->value('customerid');
- $qualityStatus=$handInStorageService->getQualityStatus();
- $attributeLocations=$handInStorageService->getAttributeLocation();
- return view('store.handInStorage.receiveDetailPage')
- ->with(['asnno'=>$asnno,'customerid'=>$customerid,'qualityStatus'=>$qualityStatus,'attributeLocations'=>$attributeLocations]);
- }
- /**
- * @param Request $request
- * 查询富勒asn_detail(集合)
- */
- public function selectAsnDetails(Request $request)
- {
- $asnno= $request->input('asnno');
- $asnDetails =app('HandInStorageService')->selectAsnDetails($asnno);
- if ($asnDetails->count()>0)$this->success($asnDetails);
- else $this->error('未搜索到ASN详情单');
- }
- /**
- * @param Request $request
- * 查询富勒bas_sku 并关联 bas_lotid
- */
- public function getBasSkuWithLot(Request $request): array
- {
- $customerid= $request->input('customerid');
- $sku= $request->input('sku');
- $asnno= $request->input('asnno');
- $asnDetail=app('HandInStorageService')->getAsnDetail($asnno,$sku);
- $basSku =app('HandInStorageService')->getBasSkuLotId($customerid,$sku);
- if (isset($basSku)&&isset($asnDetail))return ['success'=>true,'basSku'=>$basSku,'asnDetail'=>$asnDetail];
- else $this->error('无效条码');
- }
- public function fluxHandIn(Request $request)
- {
- $info=$request->input('info');
- // dd($info);
- if (!$info['customerid']||!$info['sku']||!$info['asnno']) $this->error('参数错误');
- if ($info['amount']+$info['receivedqty']>$info['expectedqty'])$this->error('收货数大于预期数');
- /** @var HandInStorageService $handInStorageService */
- $handInStorageService=app('HandInStorageService');
- $handInStorageService->fluxHandIn($info);
- // dd($result,"111");
- }
- }
|