Commit 90e1800a by Joneq

修改拣货任务错误

parent 28540bff
......@@ -76,7 +76,7 @@ class PicktaskController extends Controller
$outStoreDetailIdArr = OutStoreDetailModel::where('pick_task_id',$pickTaskId)->where('box_id',$outStoreDetailIdArr)->pluck('out_store_detail_id');
break;
default:
$outStoreDetailIdArr = GoodsModel::where('goods_sn',$data['goods_sn'])->value('goods_id');
$outStoreDetailIdArr = GoodsModel::where('goods_name',$data['goods_sn'])->value('goods_id');
$outStoreDetailIdArr = OutStoreDetailModel::where('pick_task_id',$pickTaskId)->where('goods_id',$outStoreDetailIdArr)->pluck('out_store_detail_id');
break;
}
......@@ -99,6 +99,7 @@ class PicktaskController extends Controller
{
$data = $request->all();
try{
//获取所有的out_store_detail_id
$outStoreDetailIdArr = PickTaskDetailModel::where('pick_task_detail_id',$data['pick_task_detail_id'])->pluck('out_store_detail_id');
......@@ -106,6 +107,7 @@ class PicktaskController extends Controller
throw new \Exception('该任务下没有这个型号');
}
$data['out_store_detail_id_arr'] = $outStoreDetailIdArr;
$returnData = (new PickTaskLogic())->cancelPick($data);
}catch (\Exception $exception){
if (empty(self::$errCode))self::$errCode=101;
......
......@@ -12,10 +12,13 @@ namespace App\Http\Model\Logic;
use App\Http\Controllers\Controller;
use App\Http\Model\OutStoreDetailModel;
use App\Http\Model\OutStoreModel;
use App\Http\Model\StoreModel;
use Bschmitt\Amqp\Facades\Amqp;
use Illuminate\Support\Facades\DB;
class CommonLogic
{
static public $deliverType = [1=>'送货',2=>'自提',3=>'快递',4=>'陆运',5=>'空运',6=>'提货',7=>'转仓',8=>'海运'];
//检测值是否为空
static public function checkEmpty($key,$data)
......@@ -42,8 +45,7 @@ class CommonLogic
static public function getHaveKeyCn($value)
{
foreach ($value as $key=>$keyId){
$cn = self::getSqlKeyCn($key,$keyId);
if (is_string($cn)){
if ( ($cn = self::getSqlKeyCn($key,$keyId)) !== false){
$value[$key."_cn"] = $cn;
}
}
......@@ -53,17 +55,14 @@ class CommonLogic
//获取sqlid的中文
static public function getSqlKeyCn($key,$value)
{
$title = '';
switch ($key){
case 'delivery_id'://发货人员
case 'admin_id'://根据id获取人员姓名
case 'pick_user_id'://拣货人
case 'confirm_user_id'://确认人
$title='该人暂未录入';
$value = 0;break;
$value = '暂未录入';break;
case 'store_id'://根据仓库IDid获取名称
$title='该仓库暂未录入';
$value = 0;break;
$value = StoreModel::where('store_id',$value)->value("store_name");break;
case 'out_store_status':
$value = OutStoreLogic::getOutStoreStatus($value);break;
case 'receive_status':
......@@ -73,26 +72,21 @@ class CommonLogic
case 'pack_status':
$value = PackCheckLogic::getStatus($value);break;
case 'goods_id'://根据物料id获取物料编码
$title='该物料暂未录入';
$value = 0;break;
$value = DB::table('goods')->where('goods_id',$value)->value('goods_name');break;
case 'delivery_type'://根据发货方式ID获取名称
$title='该发货方式暂未录入';
$value = 0;break;
case 'goods_name'://获取型号方式
$title='该型号暂未录入';
$value = 0;break;
case 'brand_name'://根据品牌IDid获取名称
$title='该品牌暂未录入';
$value = 0;break;
$value = array_get(self::$deliverType,$value,'暂无该种发货方式');break;
case 'customer_id':
$value = DB::table('customer')->where('customer_id',$value)->value('customer_name');break;
case 'brand_id'://根据品牌IDid获取名称
$value = DB::table('brand')->where('brand_id',$value)->value('brand_name');;break;
case 'pallet_id'://根据卡板IDid获取名称box_id
$title='该卡板暂未录入';
$value = 0;break;
$value = DB::table('pallet')->where('pallet_id',$value)->value('pallet_sn');break;
case 'box_id'://根据卡板IDid获取名称
$title='该箱号暂未录入';
$value = 0;break;
$value = DB::table('box')->where('box_id',$value)->value('box_sn');break;
case 'location_id'://根据货位id获取名称
$title='该货位暂未录入';
$value = 0;break;
$value = DB::table('location')->where('location_id',$value)->value('location_sn');break;
case 'country_code'://国家编码
$value = DB::table('country')->where('country_id',$value)->value('country');break;
case 'add_time':
case 'last_update_time':
case 'delivery_time':
......@@ -101,16 +95,15 @@ class CommonLogic
$value = self::getDataTime($value);break;
case 'is_apply_customs':
case 'is_need_pallet':
case 'is_insp':
$value = $value?'是':'否';break;
case 'is_confirm':
$value = $value?'已确认':'未确认';break;
default:
$value = false;
break;
}
if ($title){
return $title;
}
return $value;
}
......
......@@ -99,7 +99,7 @@ class OutStoreLogic
//获取erp的goodsid
if (empty($stockInfo = StockModel::where('goods_id',$goodsInfo->goods_id)->orderBy('stock_id','desc')->first())){
if (empty($stockInfo = StockModel::where('goods_id',$goodsInfo->goods_id)->where('warehousing_sn',$outStoreData['warehousing_sn'])->orderBy('stock_id','desc')->first())){
Controller::$level = 5;
Controller::$errCode = 4;
throw new \Exception('goods_id查询不到商品库存信息'.$goodsInfo->goods_id);
......
......@@ -66,7 +66,7 @@ class PackCheckLogic
$outStoreDetailIdArr = OutStoreDetailModel::where('pick_task_id',$pickTaskId)->where('box_id',$outStoreDetailIdArr)->pluck('out_store_detail_id');
break;
default:
$outStoreDetailIdArr = GoodsModel::where('goods_sn',$data['goods_name_box_id'])->value('goods_id');
$outStoreDetailIdArr = GoodsModel::where('goods_name',$data['goods_name_box_id'])->value('goods_id');
$outStoreDetailIdArr = OutStoreDetailModel::where('pick_task_id',$pickTaskId)->where('goods_id',$outStoreDetailIdArr)->pluck('out_store_detail_id');
break;
}
......
......@@ -24,6 +24,7 @@ class PalletLogic
public function palletBoxList($data)
{
if (empty($palletInfo = PalletModel::getWhereObj([])->where('pallet_sn',$data['pallet_sn'])->first())){
throw new \Exception('暂未找到该卡板');
}
......
......@@ -223,6 +223,7 @@ class PickTaskLogic
{
$outStoreDetailIdArr = $data['out_store_detail_id_arr'];
//获取可以拣货的数据
if (empty($pickTaskDetail = PickTaskDetailModel::whereIn('out_store_detail_id',$outStoreDetailIdArr)->where('pick_status','=',3)->get()->toArray())){
throw new \Exception('当前出库号没有可以取消的拣货任务: ');
......@@ -232,6 +233,7 @@ class PickTaskLogic
DB::beginTransaction();
try{
foreach ($pickTaskDetail as $value){
......@@ -247,7 +249,7 @@ class PickTaskLogic
throw new \Exception('当前库存详情没有数据: '.$outStoreDetailInfo['goods_id']);
}
StockFrozenModel::getWhereObj([])->where('pick_task_detail_id',$value['pick_task_detail_id'])->update(['number'=>0]);
StockFrozenModel::where('pick_task_detail_id',$value['pick_task_detail_id'])->update(['number'=>0]);
//取消拣货
PickTaskDetailModel::where('pick_task_detail_id',$outStoreDetailIdArr)->update(['pick_status'=>4]);
}
......
{"server":{"listen_ip":"0.0.0.0","listen_port":"40003","socket_type":1,"enable_coroutine_runtime":false,"server":"LaravelS","handle_static":false,"laravel_base_path":"/usr/local/var/www/ichunt/scm_wms_outstore_service","inotify_reload":{"enable":false,"watch_path":"/usr/local/var/www/ichunt/scm_wms_outstore_service","file_types":[".php"],"excluded_dirs":[],"log":true},"event_handlers":[],"websocket":{"enable":false},"sockets":[],"processes":[],"timer":{"enable":false,"jobs":[],"pid_file":"/usr/local/var/www/ichunt/scm_wms_outstore_service/storage/laravels-timer.pid","max_wait_time":5},"events":[],"swoole_tables":[],"register_providers":[],"cleaners":[],"swoole":{"daemonize":false,"dispatch_mode":2,"reactor_num":4,"worker_num":"3","task_ipc_mode":1,"task_max_request":8000,"task_tmpdir":"/tmp","max_request":8000,"open_tcp_nodelay":true,"pid_file":"/usr/local/var/www/ichunt/scm_wms_outstore_service/storage/laravels.pid","log_file":"/usr/local/var/www/ichunt/scm_wms_outstore_service/storage/logs/swoole-2020-05.log","log_level":4,"document_root":"/usr/local/var/www/ichunt/scm_wms_outstore_service/public","buffer_output_size":2097152,"socket_buffer_size":134217728,"package_max_length":4194304,"reload_async":true,"max_wait_time":60,"enable_reuse_port":true,"enable_coroutine":false,"http_compression":false},"enable_gzip":false,"process_prefix":"/usr/local/var/www/ichunt/scm_wms_outstore_service","ignore_check_pid":false},"laravel":{"root_path":"/usr/local/var/www/ichunt/scm_wms_outstore_service","static_path":"/usr/local/var/www/ichunt/scm_wms_outstore_service/public","cleaners":[],"register_providers":[],"is_lumen":true,"_SERVER":{"SHELL":"/bin/bash","TERM":"xterm-256color","HOMEBREW_BOTTLE_DOMAIN":"https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles","TMPDIR":"/var/folders/vd/95yw3kdx65n1qw9ggmkkkp7c0000gn/T/","Apple_PubSub_Socket_Render":"/private/tmp/com.apple.launchd.wWtj0v7Agw/Render","USER":"gongyang","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.tXmktxiIKD/Listeners","__CF_USER_TEXT_ENCODING":"0x1F5:0x19:0x34","PATH":"/usr/local/opt/mysql@5.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin","_":"/usr/bin/php","PWD":"/usr/local/var/www/ichunt/scm_wms_outstore_service","XPC_FLAGS":"0x0","XPC_SERVICE_NAME":"0","HOME":"/Users/gongyang","SHLVL":"2","LOGNAME":"gongyang","LC_CTYPE":"zh_CN.UTF-8","PHP_SELF":"/usr/local/var/www/ichunt/scm_wms_outstore_service/artisan","SCRIPT_NAME":"/usr/local/var/www/ichunt/scm_wms_outstore_service/artisan","SCRIPT_FILENAME":"/usr/local/var/www/ichunt/scm_wms_outstore_service/artisan","PATH_TRANSLATED":"/usr/local/var/www/ichunt/scm_wms_outstore_service/artisan","DOCUMENT_ROOT":"","REQUEST_TIME_FLOAT":1589364498.708194,"REQUEST_TIME":1589364498,"argv":["/usr/local/var/www/ichunt/scm_wms_outstore_service/artisan","laravels","config"],"argc":3,"APP_ENV":"local","APP_DEBUG":"true","APP_KEY":"","APP_TIMEZONE":"PRC","DB_TIMEZONE":"+08:00","SYSTEM_CODE":"01","SYSTEM_NAME":"服务初始服务(开发环境)","LARAVELS_LISTEN_IP":"0.0.0.0","LARAVELS_LISTEN_PORT":"40003","worker_num":"3","DB_CONNECTION":"mysql","DB_HOST":"192.168.2.232","DB_USERNAME":"liexin_scm_wms","DB_PASSWORD":"liexin_scm_wms#zsyM","DB_PORT":"3306","DB_DATABASE":"liexin_scm_wms","DB_PREFIX":"lie_","REDIS_HOST":"192.168.1.235","REDIS_PASSWORD":"icDb29mLy2s","REDIS_PORT":"6379","REDIS_READ_HOST":"192.168.1.237","REDIS_READ_PASSWORD":"icDb29mLy2s","REDIS_READ_PORT":"6379","CACHE_DRIVER":"file","QUEUE_DRIVER":"sync","RABBIT_IP":"192.168.1.237","RABBIT_PORT":"5672","RABBIT_USER":"huntadmin","RABBIT_PASS":"jy2y2900","SHELL_VERBOSITY":0},"_ENV":{"APP_ENV":"local","APP_DEBUG":"true","APP_KEY":"","APP_TIMEZONE":"PRC","DB_TIMEZONE":"+08:00","SYSTEM_CODE":"01","SYSTEM_NAME":"服务初始服务(开发环境)","LARAVELS_LISTEN_IP":"0.0.0.0","LARAVELS_LISTEN_PORT":"40003","worker_num":"3","DB_CONNECTION":"mysql","DB_HOST":"192.168.2.232","DB_USERNAME":"liexin_scm_wms","DB_PASSWORD":"liexin_scm_wms#zsyM","DB_PORT":"3306","DB_DATABASE":"liexin_scm_wms","DB_PREFIX":"lie_","REDIS_HOST":"192.168.1.235","REDIS_PASSWORD":"icDb29mLy2s","REDIS_PORT":"6379","REDIS_READ_HOST":"192.168.1.237","REDIS_READ_PASSWORD":"icDb29mLy2s","REDIS_READ_PORT":"6379","CACHE_DRIVER":"file","QUEUE_DRIVER":"sync","RABBIT_IP":"192.168.1.237","RABBIT_PORT":"5672","RABBIT_USER":"huntadmin","RABBIT_PASS":"jy2y2900","SHELL_VERBOSITY":0}}}
\ No newline at end of file
{"server":{"listen_ip":"0.0.0.0","listen_port":"40003","socket_type":1,"enable_coroutine_runtime":false,"server":"LaravelS","handle_static":false,"laravel_base_path":"/usr/local/var/www/ichunt/scm_wms_outstore_service","inotify_reload":{"enable":false,"watch_path":"/usr/local/var/www/ichunt/scm_wms_outstore_service","file_types":[".php"],"excluded_dirs":[],"log":true},"event_handlers":[],"websocket":{"enable":false},"sockets":[],"processes":[],"timer":{"enable":false,"jobs":[],"pid_file":"/usr/local/var/www/ichunt/scm_wms_outstore_service/storage/laravels-timer.pid","max_wait_time":5},"events":[],"swoole_tables":[],"register_providers":[],"cleaners":[],"swoole":{"daemonize":false,"dispatch_mode":2,"reactor_num":4,"worker_num":"3","task_ipc_mode":1,"task_max_request":8000,"task_tmpdir":"/tmp","max_request":8000,"open_tcp_nodelay":true,"pid_file":"/usr/local/var/www/ichunt/scm_wms_outstore_service/storage/laravels.pid","log_file":"/usr/local/var/www/ichunt/scm_wms_outstore_service/storage/logs/swoole-2020-05.log","log_level":4,"document_root":"/usr/local/var/www/ichunt/scm_wms_outstore_service/public","buffer_output_size":2097152,"socket_buffer_size":134217728,"package_max_length":4194304,"reload_async":true,"max_wait_time":60,"enable_reuse_port":true,"enable_coroutine":false,"http_compression":false},"enable_gzip":false,"process_prefix":"/usr/local/var/www/ichunt/scm_wms_outstore_service","ignore_check_pid":false},"laravel":{"root_path":"/usr/local/var/www/ichunt/scm_wms_outstore_service","static_path":"/usr/local/var/www/ichunt/scm_wms_outstore_service/public","cleaners":[],"register_providers":[],"is_lumen":true,"_SERVER":{"SHELL":"/bin/bash","TERM":"xterm-256color","HOMEBREW_BOTTLE_DOMAIN":"https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles","TMPDIR":"/var/folders/vd/95yw3kdx65n1qw9ggmkkkp7c0000gn/T/","Apple_PubSub_Socket_Render":"/private/tmp/com.apple.launchd.wWtj0v7Agw/Render","USER":"gongyang","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.tXmktxiIKD/Listeners","__CF_USER_TEXT_ENCODING":"0x1F5:0x19:0x34","PATH":"/usr/local/opt/mysql@5.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin","_":"/usr/bin/php","PWD":"/usr/local/var/www/ichunt/scm_wms_outstore_service","XPC_FLAGS":"0x0","XPC_SERVICE_NAME":"0","HOME":"/Users/gongyang","SHLVL":"2","LOGNAME":"gongyang","LC_CTYPE":"zh_CN.UTF-8","PHP_SELF":"/usr/local/var/www/ichunt/scm_wms_outstore_service/artisan","SCRIPT_NAME":"/usr/local/var/www/ichunt/scm_wms_outstore_service/artisan","SCRIPT_FILENAME":"/usr/local/var/www/ichunt/scm_wms_outstore_service/artisan","PATH_TRANSLATED":"/usr/local/var/www/ichunt/scm_wms_outstore_service/artisan","DOCUMENT_ROOT":"","REQUEST_TIME_FLOAT":1589423019.89932,"REQUEST_TIME":1589423019,"argv":["/usr/local/var/www/ichunt/scm_wms_outstore_service/artisan","laravels","config"],"argc":3,"APP_ENV":"local","APP_DEBUG":"true","APP_KEY":"","APP_TIMEZONE":"PRC","DB_TIMEZONE":"+08:00","SYSTEM_CODE":"01","SYSTEM_NAME":"服务初始服务(开发环境)","LARAVELS_LISTEN_IP":"0.0.0.0","LARAVELS_LISTEN_PORT":"40003","worker_num":"3","DB_CONNECTION":"mysql","DB_HOST":"192.168.2.232","DB_USERNAME":"liexin_scm_wms","DB_PASSWORD":"liexin_scm_wms#zsyM","DB_PORT":"3306","DB_DATABASE":"liexin_scm_wms","DB_PREFIX":"lie_","REDIS_HOST":"192.168.1.235","REDIS_PASSWORD":"icDb29mLy2s","REDIS_PORT":"6379","REDIS_READ_HOST":"192.168.1.237","REDIS_READ_PASSWORD":"icDb29mLy2s","REDIS_READ_PORT":"6379","CACHE_DRIVER":"file","QUEUE_DRIVER":"sync","RABBIT_IP":"192.168.1.237","RABBIT_PORT":"5672","RABBIT_USER":"huntadmin","RABBIT_PASS":"jy2y2900","SHELL_VERBOSITY":0},"_ENV":{"APP_ENV":"local","APP_DEBUG":"true","APP_KEY":"","APP_TIMEZONE":"PRC","DB_TIMEZONE":"+08:00","SYSTEM_CODE":"01","SYSTEM_NAME":"服务初始服务(开发环境)","LARAVELS_LISTEN_IP":"0.0.0.0","LARAVELS_LISTEN_PORT":"40003","worker_num":"3","DB_CONNECTION":"mysql","DB_HOST":"192.168.2.232","DB_USERNAME":"liexin_scm_wms","DB_PASSWORD":"liexin_scm_wms#zsyM","DB_PORT":"3306","DB_DATABASE":"liexin_scm_wms","DB_PREFIX":"lie_","REDIS_HOST":"192.168.1.235","REDIS_PASSWORD":"icDb29mLy2s","REDIS_PORT":"6379","REDIS_READ_HOST":"192.168.1.237","REDIS_READ_PASSWORD":"icDb29mLy2s","REDIS_READ_PORT":"6379","CACHE_DRIVER":"file","QUEUE_DRIVER":"sync","RABBIT_IP":"192.168.1.237","RABBIT_PORT":"5672","RABBIT_USER":"huntadmin","RABBIT_PASS":"jy2y2900","SHELL_VERBOSITY":0}}}
\ No newline at end of file
26738
\ No newline at end of file
65845
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment