Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
yunxin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
aeb7b252
authored
Jul 03, 2019
by
PRY5YKGJ82EZEPX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
更新云芯
parent
b3884141
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
266 additions
and
42 deletions
app/Http/Controllers/ApiController.php
app/Http/Controllers/HandleController.php
app/Http/Controllers/ServerController.php
app/Jobs/JopExportAbnormlList.php → app/Jobs/JopExportAbnormlList.php-old
app/Jobs/JopExportGoodsComList.php → app/Jobs/JopExportGoodsComList.php-old
app/Jobs/JopExportGoodsList.php → app/Jobs/JopExportGoodsList.php-old
app/Model/ExportModel.php
app/Model/Server/ServerExportModel.php
app/Model/Server/ServerFoostoneModel.php
app/Model/Server/ServerMicModel.php
config/website.php
public/index.php
public/pc/js/controller/GoodsList.js
public/pc/js/public.js
app/Http/Controllers/ApiController.php
View file @
aeb7b252
...
...
@@ -57,10 +57,7 @@ class ApiController extends Controller
private
function
ApiOrderListExport
(
$request
,
$id
){
$data
=
$request
->
input
();
$data
[
'is_consign'
]
=
1
;
//供应商代发
$id
=
(
new
UploadLogModel
())
->
addLog
(
$request
->
account_id
,
1
,
$data
);
if
(
!
$id
)
return
Export
(
20003
,
'任务推送失败'
);
dispatch
(
new
JopExportOrderList
(
$id
));
Export
(
0
,
$id
);
(
new
ServerExportModel
())
->
OrderExport
(
$data
,
$request
->
account_id
,
$request
->
mobile
);
}
//订单列表
private
function
ApiOrderDetail
(
$request
,
$id
){
...
...
@@ -95,10 +92,7 @@ class ApiController extends Controller
private
function
ApiPutawayListExport
(
$request
,
$id
){
$data
=
$request
->
input
();
$data
[
'picking_type'
]
=
2
;
//寄售
$id
=
(
new
UploadLogModel
())
->
addLog
(
$request
->
account_id
,
3
,
$data
);
if
(
!
$id
)
return
Export
(
20003
,
'任务推送失败'
);
dispatch
(
new
JopExportPutawayList
(
$id
));
Export
(
0
,
$id
);
(
new
ServerExportModel
())
->
PutawayExport
(
$data
,
$request
->
account_id
,
$request
->
mobile
);
}
//获取对账单列表
private
function
ApiReconcilePurList
(
$request
,
$id
){
...
...
@@ -138,12 +132,14 @@ class ApiController extends Controller
$input
[
'supplier_com_code'
]
=
$request
->
supplier_com_code
;
ExportLayui2
((
new
ServerMicModel
())
->
getSkuList
(
$input
));
}
//自营商品列表
private
function
ApiGoodsList
(
$request
){
ExportLayui2
((
new
ServerFoostoneModel
(
$request
->
appid
,
$request
->
key
))
->
SkuList
(
$request
->
input
(),
2
));
}
//自营商品列表导出
private
function
ApiGoodsListExport
(
$request
,
$id
){
$id
=
(
new
UploadLogModel
())
->
addLog
(
$request
->
account_id
,
4
,
$request
->
input
());
if
(
!
$id
)
return
Export
(
20003
,
'任务推送失败'
);
dispatch
(
new
JopExportGoodsList
(
$id
));
Export
(
0
,
$id
);
$data
=
$request
->
input
();
(
new
ServerExportModel
())
->
GoodsExport
(
$data
,
$request
->
account_id
,
$request
->
mobile
);
}
//联营商品导出(改成后台导出)
private
function
ApiGoodsComListExport
(
$request
,
$id
){
...
...
@@ -173,10 +169,7 @@ class ApiController extends Controller
$client
=
new
\Hprose\Http\Client
(
"http://export.liexin.com/getDownPath"
,
false
);
echo
$client
->
getDownPath
(
\GuzzleHttp\json_encode
(
$input
));
}
//商品列表
private
function
ApiSkuList
(
$request
){
ExportLayui2
((
new
ServerFoostoneModel
(
$request
->
appid
,
$request
->
key
))
->
SkuList
(
$request
->
input
(),
2
));
}
//批量上传联营物料
private
function
ApiUploadSkuList
(
$request
,
$id
){
$res
=
(
new
UploadLogModel
())
->
uploadSkuFile
(
$request
->
appid
,
$request
->
key
,
$request
->
mobile
,
$request
->
account_id
);
...
...
app/Http/Controllers/HandleController.php
View file @
aeb7b252
...
...
@@ -137,6 +137,20 @@ class HandleController extends Controller
}
private
function
e
(){
$input
[
'create_uid2'
]
=
1
;
//用户id
$input
[
'status'
]
=
'-10,2'
;
//状态
$client
=
new
\Hprose\Http\Client
(
"http://yunxin.liexin.com/server/abnormlList"
,
false
);
$d
=
$client
->
abnormlListServer
(
\GuzzleHttp\json_encode
(
$input
));
print_r
(
$d
);
die
;
#联营列表导出
$input
[
'create_uid2'
]
=
1
;
//用户id
$client
=
new
\Hprose\Http\Client
(
"http://yunxin.liexin.com/server/goodsList"
,
false
);
$d
=
$client
->
goodsListServer
(
\GuzzleHttp\json_encode
(
$input
));
print_r
(
$d
);
die
();
#联营列表导出
$input
[
'supplier_com_code'
]
=
'L0000008'
;
//用户id
$input
[
'is_scroll'
]
=
1
;
//状态
...
...
app/Http/Controllers/ServerController.php
View file @
aeb7b252
...
...
@@ -14,20 +14,21 @@ class ServerController extends Controller
set_time_limit
(
0
);
$this
->
$id
(
$request
,
$id
);
}
##########################
/*
* 异常列表导出
*/
public
function
exportA
bnormlList
(){
public
function
a
bnormlList
(){
$server
=
new
Hprose\Http\Service
();
$server
->
addMethod
(
'
exportA
bnormlListServer'
,
$this
);
$server
->
addMethod
(
'
a
bnormlListServer'
,
$this
);
$server
->
handle
();
}
//异常列表导出服务
public
function
exportA
bnormlListServer
(
$info
){
$res
=
ExportModel
::
A
piA
bnormalListExport
(
json_decode
(
$info
,
true
));
return
$res
;
public
function
a
bnormlListServer
(
$info
){
$res
=
ExportModel
::
AbnormalListExport
(
json_decode
(
$info
,
true
));
return
json_encode
(
$res
)
;
}
##########################
/*
* 联营数据导出
*/
...
...
@@ -36,10 +37,55 @@ class ServerController extends Controller
$server
->
addMethod
(
'goodsComListServer'
,
$this
);
$server
->
handle
();
}
//
异常列表
导出服务
//
联营数据
导出服务
public
function
goodsComListServer
(
$info
){
$res
=
ExportModel
::
GoodsComListExport
(
json_decode
(
$info
,
true
));
return
$res
;
}
##########################
/*
* 自营数据导出
*/
public
function
goodsList
(){
$server
=
new
Hprose\Http\Service
();
$server
->
addMethod
(
'goodsListServer'
,
$this
);
$server
->
handle
();
}
//自营数据导出服务
public
function
goodsListServer
(
$info
){
$res
=
ExportModel
::
GoodsListExport
(
json_decode
(
$info
,
true
));
return
$res
;
}
##########################
/*
* 订单数据导出
*/
public
function
orderList
(){
$server
=
new
Hprose\Http\Service
();
$server
->
addMethod
(
'orderListServer'
,
$this
);
$server
->
handle
();
}
//自营数据导出服务
public
function
orderListServer
(
$info
){
$res
=
ExportModel
::
OrderListExport
(
json_decode
(
$info
,
true
));
return
$res
;
}
##########################
/*
* 入库数据导出
*/
public
function
putawayList
(){
$server
=
new
Hprose\Http\Service
();
$server
->
addMethod
(
'putawayListServer'
,
$this
);
$server
->
handle
();
}
//自营数据导出服务
public
function
putawayListServer
(
$info
){
$res
=
ExportModel
::
PutawayListExport
(
json_decode
(
$info
,
true
));
return
$res
;
}
}
app/Jobs/JopExportAbnormlList.php
→
app/Jobs/JopExportAbnormlList.php
-old
View file @
aeb7b252
File moved
app/Jobs/JopExportGoodsComList.php
→
app/Jobs/JopExportGoodsComList.php
-old
View file @
aeb7b252
File moved
app/Jobs/JopExportGoodsList.php
→
app/Jobs/JopExportGoodsList.php
-old
View file @
aeb7b252
File moved
app/Model/ExportModel.php
View file @
aeb7b252
...
...
@@ -26,7 +26,7 @@ class ExportModel
if
(
!
$account
)
return
[
1001
,
'不存在此用户id'
];
$res
=
(
new
ServerPurModel
(
$account
->
appid
,
$account
->
key
))
->
AbnormalDetail
(
$input
,
2
);
if
(
!
count
(
$res
[
'data'
])
){
if
(
!
$res
||
empty
(
@
$res
[
'data'
])
||
!
count
(
$res
[
'data'
])
){
#数据为空
return
$res
;
}
$out
=
[];
...
...
@@ -47,7 +47,6 @@ class ExportModel
'initial_price'
=>
$v
[
'initial_price'
],
]);
}
$res
[
'data'
]
=
$out
;
return
$res
;
}
...
...
@@ -106,9 +105,106 @@ class ExportModel
$res
[
'data'
]
=
$out
;
$res
[
'scroll_id'
]
=
$searchArr
[
'data'
][
'scroll_id'
];
#游标回传
return
$res
;
}
/*
* 商品数据导出
* 对外提供导出接口
*/
static
function
GoodsListExport
(
$input
){
if
(
!@
$input
[
'create_uid2'
])
return
[
1002
,
'用户id不得为空'
];
$account
=
(
new
SupplierAccountModel
())
->
select
(
"appid"
,
"key"
)
->
where
(
"id"
,
$input
[
'create_uid2'
])
->
first
();
if
(
!
$account
)
return
[
1001
,
'不存在此用户id'
];
$res
=
(
new
ServerFoostoneModel
(
$account
->
appid
,
$account
->
key
))
->
SkuList
(
$input
,
2
);
if
(
empty
(
@
$res
[
'data'
])
||
!
count
(
$res
[
'data'
])
){
return
$res
;
}
$out
=
[];
foreach
(
$res
[
'data'
]
as
$k
=>
$v
){
array_push
(
$out
,[
'encoded'
=>
$v
[
'encoded'
],
'goods_type_name'
=>
$v
[
'goods_type_name'
],
'goods_name'
=>
$v
[
'goods_name'
],
'brand_name'
=>
$v
[
'brand_name'
],
'packing_name'
=>
$v
[
'packing_name'
],
'encap'
=>
$v
[
'encap'
],
'mpq'
=>
$v
[
'mpq'
],
'status_name'
=>
$v
[
'status_name'
],
'new_cost'
=>
$v
[
'new_cost'
],
'商家实际库存'
=>
""
,
'LockStock'
=>
$v
[
'LockStock'
],
'stock'
=>
$v
[
'stock'
],
]);
}
$res
[
'data'
]
=
$out
;
return
$res
;
}
/*
* 订单数据导出
* 对外提供导出接口
*/
static
function
OrderListExport
(
$input
){
if
(
!@
$input
[
'create_uid2'
])
return
[
1002
,
'用户id不得为空'
];
$account
=
(
new
SupplierAccountModel
())
->
select
(
"appid"
,
"key"
)
->
where
(
"id"
,
$input
[
'create_uid2'
])
->
first
();
if
(
!
$account
)
return
[
1001
,
'不存在此用户id'
];
$res
=
(
new
ServerPurModel
(
$account
->
appid
,
$account
->
key
))
->
OrderList
(
$input
,
2
);
if
(
empty
(
@
$res
[
'data'
])
||
!
count
(
$res
[
'data'
])
){
return
$res
;
}
$out
=
[];
foreach
(
$res
[
'data'
]
as
$k
=>
$v
){
array_push
(
$out
,[
'order_sn'
=>
$v
[
'order_sn'
],
'create_time'
=>
$v
[
'create_time'
],
'picking_amount'
=>
$v
[
'picking_amount'
],
'currency'
=>
$v
[
'currency'
],
'pay_type'
=>
$v
[
'pay_type'
],
'status'
=>
$v
[
'status'
],
]);
}
$res
[
'data'
]
=
$out
;
return
$res
;
}
/*
* 入库数据导出
* 对外提供导出接口
*/
static
function
PutawayListExport
(
$input
){
if
(
!@
$input
[
'create_uid2'
])
return
[
1002
,
'用户id不得为空'
];
$account
=
(
new
SupplierAccountModel
())
->
select
(
"appid"
,
"key"
)
->
where
(
"id"
,
$input
[
'create_uid2'
])
->
first
();
if
(
!
$account
)
return
[
1001
,
'不存在此用户id'
];
$res
=
(
new
ServerFoostoneModel
(
$account
->
appid
,
$account
->
key
))
->
SkuList
(
$input
,
2
);
if
(
empty
(
@
$res
[
'data'
])
||
!
count
(
$res
[
'data'
])
){
return
$res
;
}
$out
=
[];
foreach
(
$res
[
'data'
]
as
$k
=>
$v
){
array_push
(
$out
,[
'encoded'
=>
$v
[
'encoded'
],
'goods_type_name'
=>
$v
[
'goods_type_name'
],
'goods_name'
=>
$v
[
'goods_name'
],
'brand_name'
=>
$v
[
'brand_name'
],
'packing_name'
=>
$v
[
'packing_name'
],
'encap'
=>
$v
[
'encap'
],
'mpq'
=>
$v
[
'mpq'
],
'status_name'
=>
$v
[
'status_name'
],
'new_cost'
=>
$v
[
'new_cost'
],
'商家实际库存'
=>
""
,
'LockStock'
=>
$v
[
'LockStock'
],
'stock'
=>
$v
[
'stock'
],
]);
}
$res
[
'data'
]
=
$out
;
return
$res
;
}
}
\ No newline at end of file
app/Model/Server/ServerExportModel.php
View file @
aeb7b252
...
...
@@ -6,7 +6,7 @@ use App\Model\OperationLogModel;
use
Request
;
use
DB
;
//通用导出模型
//通用导出模型
推送队列
class
ServerExportModel
{
private
$yunxinUrl
;
//云芯网址
...
...
@@ -49,12 +49,13 @@ class ServerExportModel
'退货单号'
,
'创建单时间'
,
'金额'
,
'状态'
,
'币种'
,
'商品编码'
,
'型号'
,
'品牌'
,
'封装'
,
'包装方式'
,
'MPQ'
,
'数量'
,
'单价'
],
"query_param"
=>
$input
,
#查询参数
"callbackurl"
=>
$this
->
yunxinUrl
.
"/server/
exportA
bnormlList"
,
#rpc回调网址
"callbackfuc"
=>
"
exportA
bnormlListServer"
,
#rpc回调函数
"callbackurl"
=>
$this
->
yunxinUrl
.
"/server/
a
bnormlList"
,
#rpc回调网址
"callbackfuc"
=>
"
a
bnormlListServer"
,
#rpc回调函数
"create_uid"
=>
0
,
#创建人id
"create_uid2"
=>
$create_uid
,
#前台创建人id
"create_name"
=>
$create_name
];
echo
self
::
push
(
$data
);
}
/*
...
...
@@ -79,6 +80,71 @@ class ServerExportModel
];
echo
self
::
push
(
$data
);
}
/*
* 自营商品列表推送任务
*/
public
function
GoodsExport
(
$input
,
$create_uid
,
$create_name
){
$input
[
'create_uid2'
]
=
$create_uid
;
//用户id
$data
=
[
"type"
=>
2
,
# 类型 1:模板调用 2: api回调
"source_items_id"
=>
6
,
#来源明细id,必填
"file_name"
=>
"自营列表导出"
,
"excel_suf"
=>
"csv"
,
#导出文件格式 csv,xls
"header"
=>
[
#导出头部
"商品编码"
,
"类型"
,
"型号"
,
"品牌"
,
"包装方式"
,
"封装"
,
"MPQ"
,
"状态"
,
"价格"
,
"商家实际库存"
,
"预占库存"
,
"可用库存"
],
"query_param"
=>
$input
,
#查询参数
"callbackurl"
=>
"http://yunxin.liexin.com/server/goodsList"
,
#rpc回调网址
"callbackfuc"
=>
"goodsListServer"
,
#rpc回调函数
"create_uid"
=>
0
,
"create_uid2"
=>
$create_uid
,
#前台创建人id
"create_name"
=>
$create_name
];
echo
self
::
push
(
$data
);
}
/*
* 订单列表导出
*/
public
function
OrderExport
(
$input
,
$create_uid
,
$create_name
){
$input
[
'create_uid2'
]
=
$create_uid
;
//用户id
$data
=
[
"type"
=>
2
,
# 类型 1:模板调用 2: api回调
"source_items_id"
=>
7
,
#来源明细id,必填
"file_name"
=>
"订单列表导出"
,
"excel_suf"
=>
"csv"
,
#导出文件格式 csv,xls
"header"
=>
[
#导出头部
"订单号"
,
"创建时间"
,
"订单金额"
,
"结算币种"
,
"结算方式"
,
"状态"
],
"query_param"
=>
$input
,
#查询参数
"callbackurl"
=>
"http://yunxin.liexin.com/server/orderList"
,
#rpc回调网址
"callbackfuc"
=>
"orderListServer"
,
#rpc回调函数
"create_uid"
=>
0
,
"create_uid2"
=>
$create_uid
,
#前台创建人id
"create_name"
=>
$create_name
];
echo
self
::
push
(
$data
);
}
/*
* 入库列表导出
*/
public
function
PutawayExport
(
$input
,
$create_uid
,
$create_name
){
$input
[
'create_uid2'
]
=
$create_uid
;
//用户id
$data
=
[
"type"
=>
2
,
# 类型 1:模板调用 2: api回调
"source_items_id"
=>
8
,
#来源明细id,必填
"file_name"
=>
"入库列表导出"
,
"excel_suf"
=>
"csv"
,
#导出文件格式 csv,xls
"header"
=>
[
#导出头部
"入库单号"
,
"采购单号"
,
"入库单金额"
,
"结算币种"
,
"结算方式"
,
"创建时间"
],
"query_param"
=>
$input
,
#查询参数
"callbackurl"
=>
"http://yunxin.liexin.com/server/putawayList"
,
#rpc回调网址
"callbackfuc"
=>
"putawayListServer"
,
#rpc回调函数
"create_uid"
=>
0
,
"create_uid2"
=>
$create_uid
,
#前台创建人id
"create_name"
=>
$create_name
];
echo
self
::
push
(
$data
);
}
}
\ No newline at end of file
app/Model/Server/ServerFoostoneModel.php
View file @
aeb7b252
...
...
@@ -14,7 +14,7 @@ class ServerFoostoneModel
const
IS_DEBUG
=
0
;
//是否调试
public
function
__construct
(
$appid
,
$key
,
$domain
=
""
)
{
$this
->
_url
=
getHostUrl
(
'footstone_domain'
,
$domain
);
$this
->
_url
=
config
(
'website.URL_FOOTSTONE'
);
$this
->
appid
=
$appid
;
$this
->
key
=
$key
;
}
...
...
@@ -23,6 +23,7 @@ class ServerFoostoneModel
$datas
=
ExcessEncryption
(
$data
,
$this
->
appid
,
$this
->
key
);
$urls
=
$this
->
_url
.
$url
;
$res
=
(
curl
(
$urls
,
$datas
));
if
(
!
$res
)
return
[
'code'
=>
0
,
'errmsg'
=>
'没有数据,接口出错'
,
'data'
=>
""
];
//没有数据
if
(
self
::
IS_DEBUG
){
print_r
(
$urls
);
print_r
(
"<br/>"
);
...
...
app/Model/Server/ServerMicModel.php
View file @
aeb7b252
...
...
@@ -58,6 +58,7 @@ class ServerMicModel
if
(
@
$param
[
'brand_id'
])
$s
[
'brand_id/condition'
]
=
$param
[
'brand_id'
];
if
(
@
$param
[
'goods_name'
])
$s
[
'goods_name/condition'
]
=
$param
[
'goods_name'
];
$searchArr
=
(
new
ServerEsModel
())
->
searchSku
(
$s
);
$total
=
@
$searchArr
[
'data'
][
'total'
];
if
(
$searchArr
[
'error_code'
]
>
0
)
return
[
"code"
=>
10001
,
"errmsg"
=>
"没有数据"
];
#查询商品数据
...
...
config/website.php
View file @
aeb7b252
...
...
@@ -6,7 +6,7 @@ return [
"URL_ICHUNT"
=>
"https://www.ichunt.com"
,
"URL_YUNXIN"
=>
"http://yunxin.liexin.com"
,
"URL_FINANCE"
=>
"http://finance.liexin.com"
,
"URL_FOOTSTONE"
=>
"http://foostone.liexin.
com
"
,
"URL_FOOTSTONE"
=>
"http://foostone.liexin.
net
"
,
"URL_PUR"
=>
"http://pur.liexin.com"
,
"URL_ES"
=>
"http://soso12.ichunt.com"
,
//测试Es地址
// "URL_ES"=>"http://szso.ichunt.com",//测试Es地址
...
...
public/index.php
View file @
aeb7b252
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
...
...
public/pc/js/controller/GoodsList.js
View file @
aeb7b252
...
...
@@ -34,7 +34,7 @@
tableList
:
function
()
{
layui
.
table
.
render
({
elem
:
'#list'
,
url
:
'/api/Api
Sku
List'
,
url
:
'/api/Api
Goods
List'
,
method
:
'post'
,
cellMinWidth
:
100
//全局定义常规单元格的最小宽度
,
request
:
{
...
...
public/pc/js/public.js
View file @
aeb7b252
...
...
@@ -79,15 +79,21 @@ function common_export(url,data) {
var
logid
=
res
.
other
//导出id
var
t2
=
window
.
setInterval
(
function
()
{
var
res
=
ajax_push2
(
'/api/ApiExportResult'
,{
"id"
:
logid
})
if
(
res
.
err_code
==
0
){
layer
.
closeAll
();
window
.
location
.
href
=
res
.
err_msg
window
.
clearInterval
(
t2
)
}
if
(
res
.
err_code
==
1
){
layer
.
closeAll
();
window
.
clearInterval
(
t2
)
alert_err
(
res
.
err_msg
)
switch
(
res
.
err_code
){
case
0
:
//已完成
layer
.
closeAll
();
window
.
location
.
href
=
res
.
err_msg
window
.
clearInterval
(
t2
)
break
;
case
3
:
//无数据
case
-
1
:
//处理失败
layer
.
closeAll
();
window
.
clearInterval
(
t2
)
alert_err
(
res
.
err_msg
)
break
;
case
2
:
break
;
}
},
3000
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment