|
|
@@ -9,6 +9,7 @@ use App\Events\CancelOrder;
|
|
|
use App\Events\WmsReceiveNewEvent;
|
|
|
use App\Http\Controllers\Api\thirdPart\flux\WaybillController;
|
|
|
use App\Logistic;
|
|
|
+use App\OracleActTransactionLog;
|
|
|
use App\Order;
|
|
|
use App\Package;
|
|
|
use App\Rejected;
|
|
|
@@ -22,7 +23,9 @@ use App\Waybill;
|
|
|
use App\OraccleBasCustomer;
|
|
|
use App\WMSReflectReceive;
|
|
|
use Carbon\Carbon;
|
|
|
+use Endroid\QrCode\QrCode;
|
|
|
use Endroid\QrCode\Response\QrCodeResponse;
|
|
|
+use Illuminate\Database\Query\JoinClause;
|
|
|
use Illuminate\Http\Request;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use function PHPSTORM_META\map;
|
|
|
@@ -135,87 +138,6 @@ class TestController extends Controller
|
|
|
$authority->delete();
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- public function test1(){
|
|
|
- $s="IXCM";
|
|
|
- $arr=str_split($s);
|
|
|
- $temp=["I"=>1,"V"=>5,"X"=>10,"L"=>50,"C"=>100,"D"=>500,"M"=>1000];
|
|
|
- $result=0;
|
|
|
- for($i=0;$i<count($arr);$i++){
|
|
|
- if($i!=count($arr)-1){
|
|
|
- if($arr[$i]=="I"){
|
|
|
- if($arr[$i+1]=="V" || $arr[$i+1]=="X"){
|
|
|
- $result-=$temp["I"];
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- if($arr[$i]=="X"){
|
|
|
- if($arr[$i+1]=="L" || $arr[$i+1]=="C"){
|
|
|
- if($i>0&&$arr[$i-1]=="I"){$result+=$temp[$arr[$i]];continue;}
|
|
|
- $result-=$temp["X"];
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- if($arr[$i]=="C"){
|
|
|
- if($arr[$i+1]=="D" || $arr[$i+1]=="M"){
|
|
|
- if($i>0&&$arr[$i-1]=="X"){
|
|
|
- if ($i>1&&$arr[$i-2]=="I"){
|
|
|
- $result-=$temp["C"];
|
|
|
- continue;
|
|
|
- }
|
|
|
- $result+=$temp[$arr[$i]];continue;
|
|
|
- }
|
|
|
- $result-=$temp["C"];
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- $result+=$temp[$arr[$i]];
|
|
|
- }
|
|
|
- if($result<1 || $result>3999)$result=0;
|
|
|
- return $result;
|
|
|
- }
|
|
|
- public function test2(){
|
|
|
- $s="VI";
|
|
|
- $arr=str_split($s);
|
|
|
- $temp=["I"=>1,"V"=>5,"X"=>10,"L"=>50,"C"=>100,"D"=>500,"M"=>1000];
|
|
|
- $result=0;
|
|
|
- $sign=false;
|
|
|
- for($i=0;$i<count($arr);$i++){
|
|
|
- if($i!=count($arr)-1){
|
|
|
- if($arr[$i]=="I"){
|
|
|
- if($arr[$i+1]=="V" || $arr[$i+1]=="X"){
|
|
|
- $result-=$temp["I"];
|
|
|
- $sign=true;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- if($arr[$i]=="X"){
|
|
|
- if($arr[$i+1]=="L" || $arr[$i+1]=="C"){
|
|
|
- if($sign){$result+=$temp[$arr[$i]];$sign=false;continue;}
|
|
|
- $result-=$temp["X"];
|
|
|
- $sign=true;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- if($arr[$i]=="C"){
|
|
|
- if($arr[$i+1]=="D" || $arr[$i+1]=="M"){
|
|
|
- if($sign){
|
|
|
- $sign=false;
|
|
|
- $result+=$temp[$arr[$i]];continue;
|
|
|
- }
|
|
|
- $result-=$temp["C"];
|
|
|
- $sign=true;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- $result+=$temp[$arr[$i]];
|
|
|
- if ($sign)$sign=false;
|
|
|
- }
|
|
|
- if($result<1 || $result>3999)$result=0;
|
|
|
- return $result;
|
|
|
- }
|
|
|
public function test3()
|
|
|
{
|
|
|
$strs=["auibh","aopk","bikon"];
|
|
|
@@ -271,39 +193,43 @@ class TestController extends Controller
|
|
|
//利用栈的先进后出 一个正确的括号组对应都为1对1或N对N
|
|
|
// 先进后出“([{”入栈,")]}"出栈,轮询到出栈元素去映射栈顶,符合出栈,不符合直接返回
|
|
|
//依次轮询 如果映射正确那么最后栈为空栈 否则返回false
|
|
|
-
|
|
|
- /*
|
|
|
- $r=[];
|
|
|
- $sTemp=["("=>1,"["=>2,"{"=>3,")"=>-1,"]"=>-2,"}"=>-3];
|
|
|
- for ($i=0;$i<strlen($s);$i++){
|
|
|
- if ($i!=strlen($s)-1){
|
|
|
- if (($sTemp[$s[$i]]+$sTemp[$s[$i+1]])==0){
|
|
|
- $i++;
|
|
|
- var_dump($s[$i],$i);
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- array_push($r,$sTemp[$s[$i]]);
|
|
|
- }
|
|
|
- $sum=count($r);
|
|
|
- if ($sum==0)return "a";
|
|
|
- if ($sum%2!=0)return "b";
|
|
|
- $svg=$sum/2;
|
|
|
- for ($i=0;$i<$svg;$i++){
|
|
|
- if ($r[$i]>0&&$r[$i]+$r[$sum-1-$i]!=0)return "b";
|
|
|
- }
|
|
|
- return "a";*/
|
|
|
}
|
|
|
function test5(){
|
|
|
-
|
|
|
- $x=10;
|
|
|
- $s=0;
|
|
|
- if ($x<0 || ($x%10 == 0 && $x!=0))dd(false);
|
|
|
- while($x>$s){
|
|
|
- $s=$s*10+($x%10);
|
|
|
- $x=intval($x/10);
|
|
|
- }
|
|
|
- dd($x==$s || $x==intval($s/10));
|
|
|
+ /*$sql='select customer.CUSTOMERID from BAS_Customer customer';
|
|
|
+ dd(DB::connection('oracle')->select($sql));*/
|
|
|
+ $sql=' select ';
|
|
|
+ $sql.=' customer.Descr_C 货主, 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码, ';
|
|
|
+ $sql.=' sku.Descr_C 商品名称, lot.LotAtt05 属性仓, lot.LotAtt08 质量状态, lot.LotAtt02 失效日期, ';
|
|
|
+ $sql.=' lot.LotAtt04 批号 ';
|
|
|
+ $sql.=' , sum(移出数量)移出数量, sum(移入数量)移入数量 ';
|
|
|
+ $sql.=' , storeStatus.QTY 在库数量, storeStatus.QtyAllocated 占用数量 from ';
|
|
|
+ $sql.=' (select FMLotNum,FMSKU,TOCustomerID,0 as 移出数量, sum(TOQty_Each) as 移入数量, TOLocation as 库位 ';
|
|
|
+ $sql.=" from ACT_Transaction_Log where TransactionType='PA' ";
|
|
|
+ $sql.=' group by TOCustomerID, TOLocation, TOCustomerID,FMSKU,FMLotNum union all ';
|
|
|
+ $sql.=' select FMLotNum,FMSKU,TOCustomerID,sum(FMQty_Each) as 移出数量, 0 as 移入数量, FMLOCATION as 库位 ';
|
|
|
+ $sql.=" from ACT_Transaction_Log where TransactionType='SO' ";
|
|
|
+ $sql.=' group by FMCustomerID, FMLocation, TOCustomerID,FMSKU,FMLotNum union all ';
|
|
|
+ $sql.=' select FMLotNum,FMSKU,TOCustomerID,sum(FMQty_Each) as 移出数量,0 as 移入数量, FMLocation as 库位 ';
|
|
|
+ $sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
|
|
|
+ $sql.=' group by FMLocation,TOCustomerID,FMSKU,FMLotNum union all ';
|
|
|
+ $sql.=' select FMLotNum,FMSKU,TOCustomerID,0 as 移出数量,sum(TOQty_Each)as 移入数量, TOLocation as 库位 ';
|
|
|
+ $sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
|
|
|
+ $sql.=' group by TOLocation,TOCustomerID,FMSKU,FMLotNum)stockLog ';
|
|
|
+ $sql.=' left join BAS_Customer customer on customer.CustomerID=stockLog.TOCUSTOMERID ';
|
|
|
+ $sql.=' left join BAS_SKU sku on sku.SKU=stockLog.FMSKU ';
|
|
|
+ $sql.=' left join INV_LOT_ATT lot on lot.LOTNUM=stockLog.FMLOTNUM ';
|
|
|
+ $sql.=' left join INV_LOT_LOC_ID storeStatus on storeStatus.LOTNUM=stockLog.FMLOTNUM ';
|
|
|
+ $sql.=' left join INV_LOT_LOC_ID storeStatus on storeStatus.LOTNUM=stockLog.FMLOTNUM ';
|
|
|
+ $sql.=' and storeStatus.LocationID=stockLog.库位 where rownum<=50 ';
|
|
|
+ $sql.=' group by 库位,customer.Descr_C,sku.SKU,sku.ALTERNATE_SKU1 ';
|
|
|
+ $sql.=' ,sku.Descr_C,FMLotNum,lot.LotAtt05,lot.LotAtt08,lot.LotAtt02,lot.LotAtt04 ';
|
|
|
+ $sql.=' , storeStatus.QTY, storeStatus.QtyAllocated';
|
|
|
+ $oracleActTransactingLogs=DB::connection('oracle')->select($sql);
|
|
|
+ dd($oracleActTransactingLogs);
|
|
|
+ /*dd(OracleActTransactionLog::with(['oracleBasCustomer','oracleInvLotAtt','oracleBasSku'])
|
|
|
+ ->leftJoin('INV_LOT_LOC_ID',function (JoinClause $join){
|
|
|
+ $join->on('INV_LOT_LOC_ID.LOCATIONID','=','ACT_TRANSACTION_LOG.TOLOCATIONID')
|
|
|
+ ->on('INV_LOT_LOC_ID.LOTNUM','=','ACT_TRANSACTION_LOG.FMLOTNUM');
|
|
|
+ })->paginate(5));*/
|
|
|
}
|
|
|
}
|