Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
32765cbf
Commit
32765cbf
authored
May 07, 2021
by
linboxuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lin add productType
parent
5040f82b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
43 deletions
+85
-43
center-channel/app/base/api/impl/action/product.js
+12
-3
center-channel/app/base/api/impl/auth/accessAuth.js
+1
-1
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
+2
-2
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
+70
-37
No files found.
center-channel/app/base/api/impl/action/product.js
View file @
32765cbf
...
...
@@ -36,10 +36,10 @@ class ProductAPI extends WEBBase {
opResult
=
await
this
.
utilsProductSve
.
getProductDetail
(
pobj
,
pobj
.
actionBody
);
break
;
case
"getProductPrice"
:
opResult
=
await
this
.
utilsProductSve
.
getProductPrice
(
pobj
,
pobj
.
actionBody
)
opResult
=
await
this
.
utilsProductSve
.
getProductPrice
(
pobj
,
pobj
.
actionBody
)
break
;
case
"getProductRecommend"
:
opResult
=
await
this
.
utilsProductSve
.
getProductRecommend
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsProductSve
.
getProductRecommend
(
pobj
,
pobj
.
actionBody
);
break
;
// case "updateProductPrice":
// opResult = await this.utilsProductSve.updateProductPrice(pobj,pobj.actionBody);
...
...
@@ -48,11 +48,20 @@ class ProductAPI extends WEBBase {
opResult
=
await
this
.
utils360Sve
.
getGoodsLowestPrice
(
pobj
.
actionBody
);
break
;
case
"getRegProducePrice"
:
opResult
=
await
this
.
utilsProductSve
.
getRegProducePrice
(
pobj
,
pobj
.
actionBody
)
opResult
=
await
this
.
utilsProductSve
.
getRegProducePrice
(
pobj
,
pobj
.
actionBody
)
break
;
case
"getAllProducts"
:
opResult
=
await
this
.
utilsProductSve
.
getAllProducts
(
pobj
);
break
;
case
"getAllProductType"
:
// 获取产品大类
opResult
=
await
this
.
utilsProductSve
.
getAllProductType
(
pobj
);
break
;
case
"submitProductType"
:
// 创建产品大类
opResult
=
await
this
.
utilsProductSve
.
submitProductType
(
pobj
);
break
;
case
"editProductType"
:
// 修改产品大类
opResult
=
await
this
.
utilsProductSve
.
editProductType
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
}
...
...
center-channel/app/base/api/impl/auth/accessAuth.js
View file @
32765cbf
...
...
@@ -121,7 +121,7 @@ class AccessAuthAPI extends WEBBase {
case
"submitService"
:
//创建渠道(app)
opResult
=
await
this
.
utilsAuthSve
.
submitService
(
pobj
);
break
;
case
"editService"
:
//
创建
渠道(app)
case
"editService"
:
//
修改
渠道(app)
opResult
=
await
this
.
utilsAuthSve
.
editService
(
pobj
);
break
;
default
:
...
...
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
View file @
32765cbf
...
...
@@ -314,7 +314,7 @@ class UtilsAuthService extends AppServiceBase {
}
/**
* 创建渠道
(信息更全一些)
* 创建渠道
* @returns {Promise<void>}
*/
async
submitService
(
pobj
)
{
...
...
@@ -324,7 +324,7 @@ class UtilsAuthService extends AppServiceBase {
}
/**
* 修改渠道
(信息更全一些)
* 修改渠道
* @returns {Promise<void>}
*/
async
editService
(
pobj
)
{
...
...
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
View file @
32765cbf
...
...
@@ -19,7 +19,7 @@ class UtilsProductService extends AppServiceBase {
if
(
!
actionBody
.
pathCode
)
{
return
system
.
getResult
(
null
,
"actionBody.pathCode can not be empty,100330"
);
}
if
(
actionBody
.
name
)
{
if
(
actionBody
.
name
)
{
pobj
.
actionBody
.
productName
=
actionBody
.
name
;
}
pobj
.
actionBody
.
pathCode
=
"/"
+
actionBody
.
pathCode
+
"/"
;
...
...
@@ -41,15 +41,15 @@ class UtilsProductService extends AppServiceBase {
pobj
.
actionBody
.
pathCode
=
"/"
+
actionBody
.
pathCode
+
"/"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
let
list
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
!
list
.
data
)
{
return
system
.
getResult
(
null
,
'product data is empty'
)
if
(
!
list
.
data
)
{
return
system
.
getResult
(
null
,
'product data is empty'
)
}
for
(
let
item
of
list
.
data
)
{
for
(
let
item
of
list
.
data
)
{
pobj
.
actionType
=
'getMinPrice'
;
pobj
.
actionBody
=
{
product_id
:
item
.
product_id
product_id
:
item
.
product_id
}
let
re
=
await
this
.
restPostUrl
(
pobj
,
url
);
let
re
=
await
this
.
restPostUrl
(
pobj
,
url
);
item
.
price
=
re
.
data
?
re
.
data
.
price
:
0
;
}
return
list
;
...
...
@@ -75,7 +75,7 @@ class UtilsProductService extends AppServiceBase {
* @param actionBody
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}>}
*/
async
getProductPrice
(
pobj
,
actionBody
)
{
async
getProductPrice
(
pobj
,
actionBody
)
{
pobj
.
actionType
=
'getProductPrice'
let
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
...
...
@@ -87,7 +87,7 @@ class UtilsProductService extends AppServiceBase {
* @param actionBody
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}>}
*/
async
getRegProducePrice
(
pobj
,
actionBody
)
{
async
getRegProducePrice
(
pobj
,
actionBody
)
{
pobj
.
actionType
=
'getRegProducePrice'
let
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
...
...
@@ -98,35 +98,35 @@ class UtilsProductService extends AppServiceBase {
* @param actionBody
* @returns {Promise<void>}
*/
async
getProductRecommend
(
pobj
,
actionBody
)
{
async
getProductRecommend
(
pobj
,
actionBody
)
{
const
type
=
actionBody
.
type
;
if
(
!
type
)
{
return
system
.
getResult
(
-
1
,
'type can be not empty'
)
if
(
!
type
)
{
return
system
.
getResult
(
-
1
,
'type can be not empty'
)
}
switch
(
type
)
{
case
1
:
if
(
!
actionBody
.
companyName
)
{
return
system
.
getResultFail
(
-
1
,
'companyName can be not empty'
)
if
(
!
actionBody
.
companyName
)
{
return
system
.
getResultFail
(
-
1
,
'companyName can be not empty'
)
}
break
;
case
2
:
if
(
!
actionBody
.
companyName
)
{
return
system
.
getResultFail
(
-
1
,
'companyName can be not empty'
)
if
(
!
actionBody
.
companyName
)
{
return
system
.
getResultFail
(
-
1
,
'companyName can be not empty'
)
}
if
(
!
actionBody
.
productCode
)
{
return
system
.
getResultFail
(
-
1
,
'productCode can be not empty'
)
if
(
!
actionBody
.
productCode
)
{
return
system
.
getResultFail
(
-
1
,
'productCode can be not empty'
)
}
break
;
case
3
:
if
(
!
actionBody
.
productCode
)
{
return
system
.
getResultFail
(
-
1
,
'productCode can be not empty'
)
if
(
!
actionBody
.
productCode
)
{
return
system
.
getResultFail
(
-
1
,
'productCode can be not empty'
)
}
break
;
default
:
return
system
.
getResultFail
(
-
1
,
'type 参数错误'
);
return
system
.
getResultFail
(
-
1
,
'type 参数错误'
);
}
let
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
return
await
this
.
restPostUrl
(
pobj
,
url
);
}
/**
...
...
@@ -135,22 +135,55 @@ class UtilsProductService extends AppServiceBase {
* @param actionBody
* @returns {Promise<void>}
*/
async
updateProductPrice
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
data
||
actionBody
.
data
.
length
==
0
)
{
return
system
.
getResultFail
(
-
1
,
'data is empty!'
);
async
updateProductPrice
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
data
||
actionBody
.
data
.
length
==
0
)
{
return
system
.
getResultFail
(
-
1
,
'data is empty!'
);
}
let
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
return
await
this
.
restPostUrl
(
pobj
,
url
);
}
/**
* 获取全部产品
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async
getAllProducts
(
pobj
){
async
getAllProducts
(
pobj
)
{
let
url
=
settings
.
centerAppUrl
()
+
'action/opProduct/springBoard'
;
pobj
.
actionType
=
'getAllProducts'
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
return
result
;
}
/**
* 获取全部产品大类
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async
getAllProductType
(
pobj
)
{
let
url
=
settings
.
centerAppUrl
()
+
'action/opProduct/springBoard'
;
pobj
.
actionType
=
'getAllProductType'
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
return
result
;
}
/**
* 创建产品大类
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async
submitProductType
(
pobj
)
{
let
url
=
settings
.
centerAppUrl
()
+
'action/opProduct/springBoard'
;
pobj
.
actionType
=
'submitProductType'
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
return
result
;
}
/**
* 修改产品大类
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async
editProductType
(
pobj
)
{
let
url
=
settings
.
centerAppUrl
()
+
'action/opProduct/springBoard'
;
pobj
.
actionType
=
'editProductType'
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
return
result
;
}
...
...
@@ -159,32 +192,32 @@ class UtilsProductService extends AppServiceBase {
* @param pobj
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async
getAllPathName
(
pobj
){
async
getAllPathName
(
pobj
)
{
let
url
=
settings
.
centerAppUrl
()
+
'action/opProduct/springBoard'
;
pobj
.
actionType
=
'getAllPathName'
;
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
result
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
1
,
'获取数据失败,请稍后再试!'
);
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
result
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
1
,
'获取数据失败,请稍后再试!'
);
}
let
data
=
result
.
data
;
let
map
=
new
Map
();
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
let
item
=
data
[
i
];
let
strs
=
item
.
path_name
.
split
(
'/'
);
let
classOne
=
strs
[
1
];
let
classTwo
=
strs
[
2
];
if
(
map
.
has
(
classOne
))
{
if
(
map
.
has
(
classOne
))
{
let
val
=
map
.
get
(
classOne
);
val
.
push
(
classTwo
)
map
.
set
(
classOne
,
val
);
}
else
{
map
.
set
(
classOne
,
val
);
}
else
{
let
arr
=
[];
arr
.
push
(
classTwo
)
map
.
set
(
classOne
,
arr
);
map
.
set
(
classOne
,
arr
);
}
}
let
resultData
=
[];
map
.
forEach
((
v
,
k
)
=>
{
map
.
forEach
((
v
,
k
)
=>
{
let
obj
=
{};
obj
[
'key'
]
=
k
;
obj
[
'data'
]
=
v
;
...
...
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