更新添加联营物料

parent 97ad74d3
......@@ -11,6 +11,7 @@ use App\Model\ExportModel;
use App\Model\GoodsAuditModel;
use App\Model\Server\ServerFinanceModel;
use App\Model\Server\ServerFoostoneModel;
use App\Model\Server\ServerMicModel;
use App\Model\Server\ServerPurModel;
use App\Model\SupplierAccountModel;
use App\Model\UploadLogModel;
......@@ -135,9 +136,11 @@ class ApiController extends Controller
private function ApiUploadChangePrice($request,$id){
Export((new UploadLogModel())->uploadFile($request->supplier_name));
}
//商品列表
private function ApiSkuList($request){
ExportLayui2((new ServerFoostoneModel($request->appid,$request->key))->SkuList($request->input(),2));
//联营商品列表
private function ApiGoodsComList($request){
$input = $request->input();
$input['supplier_com_code'] = $request->supplier_com_code;
ExportLayui2((new ServerMicModel())->getSkuList($input));
}
//商品列表导出
private function ApiGoodsListExport($request, $id){
......@@ -168,10 +171,7 @@ class ApiController extends Controller
}
//批量上传联营物料
private function ApiUploadSkuList($request,$id){
print_r($request);
die();
$res = (new UploadLogModel())->uploadSkuFile($request->supplier_com_name);
Export($res);
}
}
......@@ -20,7 +20,10 @@ use App\Model\PurchaseDeliveryModel;
use App\Model\PurchaseItemsModel;
use App\Model\PurchaseModel;
use App\Model\PutawayItemsModel;
use App\Model\Server\EsModel;
use App\Model\Server\FoostoneModel;
use App\Model\Server\ServerEsModel;
use App\Model\Server\ServerMicModel;
use App\Model\SnModel;
use Illuminate\Http\Request;
......@@ -45,6 +48,28 @@ class HandleController extends Controller
}
private function a(){
#查询商品数据
$p = [
'goods_id'=>['1155781458425246471']
];
$res = (new ServerMicModel())->synchronization($p);
print_r($res);
die();
#查询es数据
$s = [
'p'=>1,
'offset'=>30,
'supplier_id'=>17,
// 'goods_name/condition'=>'',
// 'band_name/condition'=>'',
// 'goods_stastus/condition'=>'',
'canal/condition'=>'L0000226',
];
$res = (new ServerEsModel())->searchSku($s);
print_r($res);
die();
#商品sku列表
// $info=[
// 'p'=>'1',
......
......@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Model\Server\ServerMicModel;
use Config;
use Illuminate\Http\Request;
use App\Http\Requests;
......@@ -27,13 +28,20 @@ class PureController extends Controller
$data['errinfo']='访问路径错误';
return view('errors.error',$data);
}
//价格明细弹框
//自营价格明细弹框
private function PurePrice($request,$data,$id){
$data['title']='欢迎使用云芯系统';
$data['time']=time();
return view('pure',$data);
}
//联营价格明细弹框
private function PureComPrice($request,$data,$id){
$data['title']='自营价格明细';
$data['time']=time();
$res = (new ServerMicModel())->synchronization(['goods_id'=>[$request->input("goods_id")]]);
$data['']
return view('pure',$data);
}
}
......@@ -22,6 +22,7 @@ class WebController extends Controller
$data['_DOMAIN_'] = config("website.domain");
$data['mobile'] = $request->mobile;
$data['time']=time();
$data['supplier_id'] = $request->supplier_id;
$data['supplier_com_id'] = $request->supplier_com_id;
return $this->$id($request,$data,$id);
}
......
......@@ -19,15 +19,15 @@ function curl($url, $params = false, $ispost = 0, $https = 0,$cookie='')
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // 对认证证书来源的检查
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // 从证书中检查SSL加密算法是否存在
}
if (is_array($params)) {
$params = http_build_query($params);
}
if ($ispost) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, $url);
} else {
if ($params) {
if (is_array($params)) {
$params = http_build_query($params);
}
curl_setopt($ch, CURLOPT_URL, $url . '?' . $params);
} else {
curl_setopt($ch, CURLOPT_URL, $url);
......@@ -1174,4 +1174,14 @@ function getHostUrl($sys,$current_domain='')
{
return Config('yunxin_conf.'.$sys.'.sz');
}
}
\ No newline at end of file
}
/*
* 科学计数转数字
*/
function sctonum($num, $double = 5){
if(false !== stripos($num, "e")){
$a = explode("e",strtolower($num));
return bcmul($a[0], bcpow(10, $a[1], $double), $double);
}
}
<?php
namespace App\Model\Server;
use ClassPreloader\Config;
use Request;
use DB;
//跟Es接口通讯模型
class ServerEsModel
{
private $_url ; //网址
const IS_DEBUG = 0; //是否调试
public function __construct()
{
$this->_url = Config("website.URL_ES");
}
//发送请求
public function push($url,$data,$type = 1){
$urls = $this->_url.$url;
$datas = self::ApiRequest($data);
$res = curl($urls,$datas,true);
if (self::IS_DEBUG){
print_r($urls);
print_r("<br/>");
print_r($datas);
print_r("<br/>");
print_r($res);
die();
}
return json_decode($res,true);
}
/*
* 获取skuid
*/
public function searchSku($input,$type=1){
return $this->push('/search/Es/searchSku',$input,$type);
}
/*
* 密钥
*/
function ApiRequest($data){
$data['k1']=time();
$data['k2']=MD5(MD5($data['k1']).Config('website.UploadKey'));
return $data;
}
}
\ No newline at end of file
<?php
namespace App\Model\Server;
use Request;
use DB;
//微服务接口
class ServerMicModel
{
private $url_imc_footstone ; //网址1
const IS_DEBUG = 0; //是否调试
public function __construct()
{
$this->url_imc_footstone = config("website.URL_MIC_FOOTSTONE"); //微服务基石网址
}
//发送请求
public function push($url,$data,$type = 1){
$urls = $this->url_imc_footstone.$url;
$datas = $data;
// print_r($datas);
// die();
$res = curl($urls,$datas,true);
if (self::IS_DEBUG){
print_r($urls);
print_r("<br/>");
print_r($datas);
print_r("<br/>");
print_r( json_decode($res,true));
die();
}
$p = json_decode($res,true);
$p['code'] = $p['errcode'];
unset($p['errcode']);
if ($type == 1){
echo json_encode($p);
}else{
return $p;
}
}
//获取自营、联营商品信息
public function synchronization($input,$type=1){
return $this->push('/synchronization',$input,$type);
}
/*
* 渠道编码获取联营商品列表详情
* @param array $queryParam 查询参数
*/
public function getSkuList($param){
#查询es数据
$s = [
'p'=>$param['p'],
'offset'=>$param['limit'],
'supplier_id'=>17,
'canal/condition'=>$param['supplier_com_code'],
];
if (@$param['goods_status']) $s['goods_status/condition'] = $param['goods_status'];
if (@$param['band_name']) $s['band_name/condition'] = $param['band_name'];
if (@$param['goods_name']) $s['goods_name/condition'] = $param['goods_name'];
$searchArr = (new ServerEsModel())->searchSku($s);
if ($searchArr['error_code'] > 0) return ["code"=>10001,"msg"=>"没有数据"];
#查询商品数据
$p = [
// 'goods_id'=>$searchArr['data']['goods_id']
'goods_id'=>['1155781458425246471']
];
$res = $this->synchronization($p,2);
foreach ($res['data'] as $k=>&$v){
$v['goods_id'] = $k;
$v['update_time'] = timeToDate($v['update_time']);
}
$res['count'] = @$searchArr['data']['total'];
return $res;
}
}
\ No newline at end of file
......@@ -54,11 +54,11 @@ class SupplierAccountModel extends Model
$info = [
'supplier_id'=>$account['supplier_id'],
'supplier_name'=>$supplierInfo['supplier_name'],
'supplier_code'=>$supplierInfo['supplier_code'],
'supplier_name'=>$account['supplier_name'],
'supplier_code'=>$account['supplier_code'],
'supplier_com_id'=>$account['supplier_com_id'],
'supplier_com_name'=>$supplierInfo['supplier_com_name'],
'supplier_com_code'=>$supplierInfo['supplier_com_code'],
'supplier_com_name'=>$account['supplier_com_name'],
'supplier_com_code'=>$account['supplier_com_code'],
'mobile'=>$account['mobile'],
'account_id'=>$account['id'],
'appid'=>$account['appid'],
......
......@@ -6,6 +6,11 @@ return [
"URL_FINANCE" => "http://finance.liexin.com",
"URL_FOOTSTONE" => "http://foostone.liexin.com",
"URL_PUR" => "http://pur.liexin.com",
"URL_ES"=>"http://soso12.ichunt.com",//测试Es地址
// "URL_ES"=>"http://szso.ichunt.com",//测试Es地址
//"URL_ES"=>"http://soso12.ichunt.com/search/Es/searchSku",//Es地址
"URL_MIC_FOOTSTONE"=>"http://192.168.1.232:60004",//基石微服务
'UploadKey'=>'fh6y5t4rr351d2c3bryi',//Es密钥
"domain" => "liexin.com", //根域名
......@@ -17,4 +22,5 @@ return [
'API_DOMAIN' => "http://api.ichunt.com" //Api接口地址
];
......@@ -18,4 +18,5 @@ return [
'sz'=>'http://szpur.ichunt.net',
'release'=>'http://pur.ichunt.net'
],
];
......@@ -19,19 +19,37 @@
意思是此账号可以看到云芯所有菜单。
```
- 3、涉及接口:
```
一:批量导入联营物料 接口(明星提供)
参数: 渠道维护员编码、渠道标签(对应供应商编码)、上传oss后的csv地址
一:批量 导入 联营物料 接口
post:
类型:(导入物料\修改物料)
渠道维护员编码
渠道标签(对应供应商编码)
上传oss后的csv地址
return: {"errcode":0,"msg":"成功"}
二:查询导入的联营物料导入日志 接口 (明星提供)
三:查询联营物料列表 (供应商编码查询所有sku列表)接口 (明星提供)
四:模糊查询联营供应商 接口 (明星提供)
二:查询导入的联营物料导入日志 接口
post(批量):up_id1,up_id2
return:对应批量日志信息
三:查询联营物料列表 (供应商编码查询所有sku列表)接口
先调es接口:
post:
supplier_id =17
goods_name/condition=lm358
band_name/condition=ADI
goods_stastus/condition=1 商品状态 0:待审核 1:审核通过(上架)2:审核不通过 3:下架 4:删除
canal/condition=L0000023
正式:http://soso12.ichunt.com/search/Es/searchSku
测试:http://szso.ichunt.com/search/Es/searchSku
post:联营供应商id,商品编码,型号,品牌,状态
return(分页返回):SKUID,型号,制造商,包装方式,封装,MPQ,MOQ,简述,批次,状态,当前库存,修改时间,阶梯数量1,国内含税价1(¥),香港交货价1,阶梯数量2,国内含税价2(¥),香港交货价3,阶梯数量3,国内含税价3(¥),香港交货价3
五:模糊查询自营供应商接口 (采购提供)
```
四:价格变化明细接口:
post:supplier_com_id,skuid
return(分页返回) :修改时间,阶梯数量1,国内含税价1(¥),香港交货价1,阶梯数量2,国内含税价2(¥),香港交货价3,阶梯数量3,国内含税价3(¥),香港交货价3
#db设计
数据库:liexin_yunxin
环境:正式+测试
......@@ -55,4 +73,29 @@ MODIFY COLUMN `type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1: 批量
ADD COLUMN `create_name` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人名称' AFTER `create_uid`;
原因:添加联营账号
\ No newline at end of file
原因:添加联营账号
......@@ -26,7 +26,7 @@
tableList:function () {
layui.table.render({
elem: '#list'
,url:'/api/ApiSkuList'
,url:'/api/ApiGoodsComList'
,method:'post'
,cellMinWidth: 100 //全局定义常规单元格的最小宽度
,request: {
......@@ -38,7 +38,9 @@
,first: true //不显示首页
,last: false //不显示尾页
,cols: [[
{field:'goods_id', title: 'SKUID',align:'center'},
{field:'goods_id', title: '商品ID',width:120,align:'center',templet: function(d){
return d.goods_id
}},
{field:'old_goods_id', title: '原ID',align:'center'},
{field:'goods_name', title: 'SKU型号',align:'center'},
{field:'type_name', title: '商品类别',align:'center'},
......@@ -52,6 +54,7 @@
{field:'status_name', title: '状态',align:'center'},
{field:'is_expire', title: '是否过期',align:'center'},
{field:'update_time', title: '更新时间',align:'center'},
{field:'cahe', title: '操作',templet:'#cahe',width:100,align:'center', fixed: 'right'}
]]
,id:'Abnormal'
,page:{
......@@ -120,3 +123,49 @@
app.init();
})
}();
/*
sku价格明细弹框
*/
function purePrice(goods_id) {
console.log($("#s"+goods_id).attr('data'))
return
$("input[name='id2']").val(id)
$("input[name='mobile2']").val(mobile)
$("input[name='fixed_amount2']").val(fixed_amount)
layer.open({
type:1,
title: '调整固定额度',
shadeClose: true,
shade: 0.8,
area: ['380px', '280px'],
content: $("#box2"),
btn: ['取消', '确定'],
success: function(layero){ //按钮居中
layero.find('.layui-layer-btn').css('text-align', 'center')
},
end:function () {
$('#form3')[0].reset()
},
btn1: function(index) {
layer.close(index);
},
btn2: function() {
var fixed_amount_new = $("input[name='fixed_amount_new']").val()
if(!num_int_two.test(fixed_amount_new)){
alert_err("固定额度填写不正确")
return false;
}
alert_confirm("你确定要修改固定额度吗?确定后交提交上级审核!",function () {
var res = ajax("/api/ApiChangeUserAmount",{
"id":id,
"type":1,
"change_amount":fixed_amount_new,
"effect_time":0
})
res.err_code > 0 ? alert_err(res.err_msg) : alert_succ(res.err_msg,function () {
window.location.reload()
})
})
}
});
}
\ No newline at end of file
......@@ -131,14 +131,46 @@
/*
sku价格明细弹框
*/
function purePrice(sku_id) {
function purePrice(goods_id) {
$("input[name='id2']").val(id)
$("input[name='mobile2']").val(mobile)
$("input[name='fixed_amount2']").val(fixed_amount)
layer.open({
type: 2
, scrollbar: false
, area: ['700px', '570px']
, maxmin: true
, title: '价格变化明细'
, content: '/pure/PurePrice?sku_id='+sku_id
type:1,
title: '调整固定额度',
shadeClose: true,
shade: 0.8,
area: ['380px', '280px'],
content: $("#box2"),
btn: ['取消', '确定'],
success: function(layero){ //按钮居中
layero.find('.layui-layer-btn').css('text-align', 'center')
},
end:function () {
$('#form3')[0].reset()
},
btn1: function(index) {
layer.close(index);
},
btn2: function() {
var fixed_amount_new = $("input[name='fixed_amount_new']").val()
if(!num_int_two.test(fixed_amount_new)){
alert_err("固定额度填写不正确")
return false;
}
alert_confirm("你确定要修改固定额度吗?确定后交提交上级审核!",function () {
var res = ajax("/api/ApiChangeUserAmount",{
"id":id,
"type":1,
"change_amount":fixed_amount_new,
"effect_time":0
})
res.err_code > 0 ? alert_err(res.err_msg) : alert_succ(res.err_msg,function () {
window.location.reload()
})
})
}
});
}
/*
......
;!function () {
var ids = []; //选择的ids
var table_data = [];
window.app = {
init: function () {
app.tableList();
//刷新列表
$("#search").click(function () {
app.tableList()
})
},
tableList:function () {
layui.table.render({
elem: '#list'
,url:'/api/PurePrice'
,method:'post'
,cellMinWidth: 100 //全局定义常规单元格的最小宽度
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
}
,where: {'goods_id':$("#goods_id").val()}
,loading:true
,first: true //不显示首页
,last: false //不显示尾页
,cols: [[
{field:'add_time', title: '修改时间',align:'center'}
,{field:'cost', title: '价格',align:'center'}
]]
,id:'Abnormal'
,page:{
}
,done: function(res, curr, count) {
}
});
},
}, $(function () {
app.init();
})
}();
......@@ -88,6 +88,7 @@
</dd>
</dl>
</li>
<?Php if($supplier_id || $supplier_com_id) { ?>
<li class="<?php if( in_array($id,['GoodsAuditList','GoodsList','GoodsDetail','UploadLogList','GoodsComList','GoodsComImportLogList']) !== false ) echo "curr" ?>">
<a href="javascript:;" class="bx">
<i class="iconfont icon-shangpinguanli- va-m"></i>
......@@ -95,10 +96,12 @@
<b class="iconfont icon-xiala-"></b>
</a>
<dl >
<?Php if($supplier_id) { ?>
<dd class="<?php if( in_array($id,['GoodsList','GoodsDetail']) !== false ) echo "curr" ?>">
<i class="line"></i>
<a href="/web/GoodsList">自营商品列表</a>
</dd>
<?php } ?>
<?Php if($supplier_com_id) { ?>
<dd class="<?php if( in_array($id,['GoodsComList']) !== false ) echo "curr" ?>">
<i class="line"></i>
......@@ -111,6 +114,8 @@
<?php } ?>
</dl>
</li>
<?PHP } ?>
<?Php if(!$supplier_id) { ?>
<li class="<?php if( in_array($id,['OrderList','OrderDetail','AbnormalList','AbnormalDetail','PutawayList','PutawayDetail']) !== false ) echo "curr" ?>">
<a href="javascript:;" class="bx">
<i class="iconfont icon-dingdanguanli- va-m"></i>
......@@ -132,6 +137,7 @@
</dd>
</dl>
</li>
<?php } ?>
<!--
{{--<li >--}}
{{--<a href="javascript:;" class="bx">--}}
......
<div class="table-list" id="shopList" style="width: 95%">
<table class="layui-table" lay-filter="test" id="list"></table>
</div>
<input type="hidden" value="<?= $_GET['sku_id'] ?>" id="goods_id">
\ 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