Переглянути джерело

Merge branch 'Haozi'

# Conflicts:
#	app/Http/Controllers/TestController.php
zhouzhendong 4 роки тому
батько
коміт
ee0fd8ed5e

+ 23 - 7
app/Services/HandInStorageService.php

@@ -39,14 +39,23 @@ class HandInStorageService
     public function getAsnQty($asnno)
     {
         $asnQty=OracleDOCASNDetail::query()
-            ->select('expectedqty','receivedqty')
+            ->select('expectedqty','receivedqty','receivedqty_each','expectedqty_each')
             ->where('asnno',$asnno)
             ->get();
         $expectedqty=0;
         $receivedqty=0;
         foreach ($asnQty as $qty){
-            $expectedqty+=$qty->expectedqty;
-            $receivedqty+=$qty->receivedqty;
+            if ($qty->expectedqty) {
+                $expectedqty+=$qty->expectedqty;
+            }else{
+                $expectedqty+=$qty->expectedqty_each??0;
+            }
+            if ($qty->receivedqty){
+                $receivedqty+=$qty->receivedqty;
+            }else{
+                $receivedqty+=$qty->receivedqty_each??0;
+            }
+
         }
         return (object)array('expectedqty'=>$expectedqty,'receivedqty'=>$receivedqty);
     }
@@ -342,7 +351,7 @@ sql;
     public function getTsk($trackNumber,$barCode): array
     {
         $sql = <<<sql
-select t.*, DOC_ASN_DETAILS.RECEIVEDQTY
+select t.*, DOC_ASN_DETAILS.RECEIVEDQTY,DOC_ASN_DETAILS.ReceivedQty_Each
 from (select TSK_TASKLISTS.CustomerID,
              TSK_TASKLISTS.DOCNO,
              TSK_TASKLISTS.Sku,
@@ -350,6 +359,12 @@ from (select TSK_TASKLISTS.CustomerID,
              TSK_TASKLISTS.PlanToID,
              DOC_ASN_DETAILS.SKUDESCRC,
              TSK_TASKLISTS.DOCLINENO,
+             TSK_TASKLISTS.LOTATT01,
+             TSK_TASKLISTS.LOTATT02,
+             TSK_TASKLISTS.LOTATT03,
+             TSK_TASKLISTS.LOTATT04,
+             TSK_TASKLISTS.LOTATT05,
+             TSK_TASKLISTS.LOTATT08,
              sum(TSK_TASKLISTS.PlanToQty) as qty
       from TSK_TASKLISTS
                LEFT JOIN DOC_ASN_DETAILS ON DOC_ASN_DETAILS.ASNNO = TSK_TASKLISTS.DOCNO AND
@@ -391,8 +406,8 @@ sql;
                                     select SKU from BAS_SKU where ALTERNATE_SKU3='".$barCode."' union
                                     select SKU from BAS_SKU where SKU='".$barCode."' )";
 
-        $sql.=' group by TSK_TASKLISTS.CustomerID, TSK_TASKLISTS.DOCNO, TSK_TASKLISTS.Sku, TSK_TASKLISTS.PlanToLotNum,
-               TSK_TASKLISTS.PlanToID, DOC_ASN_DETAILS.SKUDESCRC, TSK_TASKLISTS.DOCLINENO) t
+        $sql.=' group by TSK_TASKLISTS.CustomerID, TSK_TASKLISTS.DOCNO, TSK_TASKLISTS.Sku, TSK_TASKLISTS.PlanToLotNum, TSK_TASKLISTS.PlanToID, DOC_ASN_DETAILS.SKUDESCRC,
+         TSK_TASKLISTS.DOCLINENO, TSK_TASKLISTS.LOTATT01, TSK_TASKLISTS.LOTATT02, TSK_TASKLISTS.LOTATT03, TSK_TASKLISTS.LOTATT04, TSK_TASKLISTS.LOTATT05, TSK_TASKLISTS.LOTATT08) t
          left join DOC_ASN_DETAILS on t.DOCLINENO = DOC_ASN_DETAILS.ASNLINENO and t.DOCNO = DOC_ASN_DETAILS.ASNNO';
         if ($trackNumber){
             if ($this->checkUserOwnerAuth($trackNumber))$tasks = DB::connection("oracle")->select(DB::raw($sql), [strtoupper($trackNumber)]);
@@ -578,7 +593,8 @@ sql;
                     [$time, $who, $info['asnno']]);
             } elseif ($receiveAsn && (int)$receiveAsn['receivedqty'] + (int)$info['amount'] == (int)$receiveAsn['expectedqty']) {
                 //asn_detail 收货数量+已收数量=预期数量
-                $db->update(DB::raw("UPDATE DOC_ASN_DETAILS SET receivedqty=receivedqty+?,receivedqty_each=receivedqty_each+?,linestatus = '40',
+                $db->update(DB::raw("UPDATE DOC_ASN_DETAILS SET receivedqty=receivedqty+?,receivedqty_each=
+                +?,linestatus = '40',
                 edittime = TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),receivedtime = TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),editwho = ?,holdrejectcode='OK',
                 reserve_flag='Y',lotatt01=?,lotatt02=?,lotatt03=?,lotatt04=?,lotatt05=?,lotatt06=?,lotatt07=?,lotatt08=? WHERE asnno = ? and asnlineno = ?"),
                     [(int)$info['amount'], (int)$info['amount'], $time, $time, $who, $invlotatt['lotatt01'], $invlotatt['lotatt02'], $invlotatt['lotatt03'], $invlotatt['lotatt04'],

+ 15 - 1
resources/views/store/handInStorage/putaway.blade.php

@@ -76,8 +76,22 @@
                                         <span class="text-right float-right" v-show="info.barCode">选中:<input type="checkbox" :id="'task_'+i"
                                                                                        @click="checked($event,task)"></span>
                                         <span><span class="text-lowercase h5">待上架/总量:</span><span
-                                                class="text-lowercase text-info font-weight-bold h5">@{{ task.qty}}/@{{ task.receivedqty }}</span> <span>&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
+                                                class="text-lowercase text-info font-weight-bold h5">@{{ task.qty}}/@{{ task.receivedqty?task.receivedqty:task.receivedqty_each }}</span> <span>&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
                                         <span><span class="h5">容器号:</span><span class="h5">@{{ task.plantoid }} </span></span>
+
+                                        <span v-if="task.lotatt01"><span class="text-black h5">生产日期:</span><span
+                                                class="text-black font-weight-bold h5">@{{ task.lotatt01 }}</span> <span>&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
+                                        <span v-if="task.lotatt02"><span class="text-black h5">失效日期:</span><span
+                                                class="text-black font-weight-bold h5">@{{ task.lotatt02 }}</span> <span>&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
+                                        <span v-if="task.lotatt03"><span class="text-black h5">入库日期:</span><span
+                                                class="text-black font-weight-bold h5">@{{ task.lotatt03 }}</span> <span>&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
+                                        <span v-if="task.lotatt04"><span class="text-black h5">批号:</span><span
+                                                class="text-black font-weight-bold h5">@{{ task.lotatt04 }}</span> <span>&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
+                                        <span v-if="task.lotatt05"><span class="text-black h5">属性仓:</span><span
+                                                class="text-black font-weight-bold h5">@{{ task.lotatt05 }}</span> <span>&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
+                                        <span v-if="task.lotatt08"><span class="text-black h5">质量状态:</span><span
+                                                class="text-black font-weight-bold h5">@{{ task.lotatt08 }}</span> <span>&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
+
                                     </div>
                                 </div>
                             </td>

+ 1 - 1
tests/Services/LogisticAliJiSuApiService/QueryTest.php

@@ -30,7 +30,7 @@ class QueryTest extends TestCase
      */
     public function prod_test()
     {
-//       $response = $this->service->query('9883840347518');
+//       $response = $this->service->query('KYE900000391232');
 //       dd($response);
 //       if ($response->status==0){
 //           $this->assertNotEmpty($response->result);