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
14782c26
Commit
14782c26
authored
May 07, 2021
by
linboxuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lin add productType
parent
29588d1c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
9 deletions
+59
-9
center-app/app/base/api/impl/action/opProduct.js
+14
-5
center-app/app/base/service/impl/dbproduct/producttypeSve.js
+45
-4
No files found.
center-app/app/base/api/impl/action/opProduct.js
View file @
14782c26
...
@@ -39,10 +39,10 @@ class OpProductAPI extends APIBase {
...
@@ -39,10 +39,10 @@ class OpProductAPI extends APIBase {
opResult
=
await
this
.
productSve
.
getaliicProduce
(
pobj
.
actionBody
);
opResult
=
await
this
.
productSve
.
getaliicProduce
(
pobj
.
actionBody
);
break
;
break
;
case
"getaliicpProduce"
:
//阿里icp获取产品信息
case
"getaliicpProduce"
:
//阿里icp获取产品信息
opResult
=
await
this
.
productSve
.
getaliicpProduce
(
pobj
.
actionBody
,
pobj
.
appInfo
);
opResult
=
await
this
.
productSve
.
getaliicpProduce
(
pobj
.
actionBody
,
pobj
.
appInfo
);
break
;
break
;
case
"getIcpProduce"
:
//获取ICP产品信息
case
"getIcpProduce"
:
//获取ICP产品信息
opResult
=
await
this
.
productSve
.
getIcpProduce
(
pobj
.
actionBody
,
pobj
.
appInfo
);
opResult
=
await
this
.
productSve
.
getIcpProduce
(
pobj
.
actionBody
,
pobj
.
appInfo
);
break
;
break
;
case
"getProductTypeInfo"
:
//阿里工商获取需求類型
case
"getProductTypeInfo"
:
//阿里工商获取需求類型
opResult
=
await
this
.
producttypeSve
.
getProductTypeInfo
(
pobj
.
actionBody
,
pobj
.
appInfo
);
opResult
=
await
this
.
producttypeSve
.
getProductTypeInfo
(
pobj
.
actionBody
,
pobj
.
appInfo
);
...
@@ -54,10 +54,10 @@ class OpProductAPI extends APIBase {
...
@@ -54,10 +54,10 @@ class OpProductAPI extends APIBase {
opResult
=
await
this
.
productSve
.
getMinPrice
(
pobj
);
opResult
=
await
this
.
productSve
.
getMinPrice
(
pobj
);
break
;
break
;
case
"getProductRecommend"
:
case
"getProductRecommend"
:
opResult
=
await
this
.
productSve
.
getProductRecommend
(
pobj
.
actionBody
,
pobj
.
appInfo
);
opResult
=
await
this
.
productSve
.
getProductRecommend
(
pobj
.
actionBody
,
pobj
.
appInfo
);
break
;
break
;
case
"updateProductPrice"
:
case
"updateProductPrice"
:
opResult
=
await
this
.
productSve
.
updateProductPrice
(
pobj
.
actionBody
,
pobj
.
appInfo
);
opResult
=
await
this
.
productSve
.
updateProductPrice
(
pobj
.
actionBody
,
pobj
.
appInfo
);
break
;
break
;
//2020-12-17 baidu reg start -----------------
//2020-12-17 baidu reg start -----------------
case
"getRegProducePrice"
:
//获取reg产品price
case
"getRegProducePrice"
:
//获取reg产品price
...
@@ -72,11 +72,20 @@ class OpProductAPI extends APIBase {
...
@@ -72,11 +72,20 @@ class OpProductAPI extends APIBase {
opResult
=
await
this
.
productSve
.
getProductByWhere
(
pobj
.
actionBody
);
opResult
=
await
this
.
productSve
.
getProductByWhere
(
pobj
.
actionBody
);
break
;
break
;
case
"getymicpProduce"
:
//易名icp获取产品信息
case
"getymicpProduce"
:
//易名icp获取产品信息
opResult
=
await
this
.
productSve
.
getymicpProduce
(
pobj
.
actionBody
,
pobj
.
appInfo
);
opResult
=
await
this
.
productSve
.
getymicpProduce
(
pobj
.
actionBody
,
pobj
.
appInfo
);
break
;
break
;
case
"getAllPathName"
:
case
"getAllPathName"
:
opResult
=
await
this
.
productSve
.
getAllPathName
();
opResult
=
await
this
.
productSve
.
getAllPathName
();
break
;
break
;
case
"getAllProductType"
:
// 获取全部产品大类
opResult
=
await
this
.
producttypeSve
.
getAllProductType
(
pobj
.
actionBody
);
break
;
case
"submitProductType"
:
// 创建产品大类
opResult
=
await
this
.
producttypeSve
.
submitProductType
(
pobj
.
actionBody
);
break
;
case
"editProductType"
:
// 修改产品大类
opResult
=
await
this
.
producttypeSve
.
editProductType
(
pobj
.
actionBody
);
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
...
...
center-app/app/base/service/impl/dbproduct/producttypeSve.js
View file @
14782c26
...
@@ -7,16 +7,57 @@ class ProductTypeService extends ServiceBase {
...
@@ -7,16 +7,57 @@ class ProductTypeService extends ServiceBase {
super
(
"dbproduct"
,
ServiceBase
.
getDaoName
(
ProductTypeService
));
super
(
"dbproduct"
,
ServiceBase
.
getDaoName
(
ProductTypeService
));
}
}
async
getProductTypeInfo
(
actionBody
,
appInfo
)
{
async
getProductTypeInfo
(
actionBody
,
appInfo
)
{
if
(
!
actionBody
.
type
)
{
if
(
!
actionBody
.
type
)
{
return
system
.
getResult
(
null
,
"channelCode item is data empty !"
);
return
system
.
getResult
(
null
,
"channelCode item is data empty !"
);
}
}
if
(
!
appInfo
)
{
if
(
!
appInfo
)
{
return
system
.
getResult
(
null
,
"appInfo item is data empty !"
);
return
system
.
getResult
(
null
,
"appInfo item is data empty !"
);
}
}
var
producttypeinfo
=
await
this
.
findOne
({
"channel_type_code"
:
actionBody
.
type
,
"uapp_id"
:
appInfo
.
uapp_id
});
var
producttypeinfo
=
await
this
.
findOne
({
"channel_type_code"
:
actionBody
.
type
,
"uapp_id"
:
appInfo
.
uapp_id
});
return
system
.
getResultSuccess
(
producttypeinfo
);
return
system
.
getResultSuccess
(
producttypeinfo
);
}
}
/**
* 获取全部产品大类
* @returns {Promise<void>}
*/
async
getAllProductType
(
actionBody
)
{
var
tmpWhere
=
{
pageInfo
:
{}
};
if
(
actionBody
)
{
if
(
actionBody
.
pageSize
)
{
tmpWhere
.
limit
=
actionBody
.
pageSize
;
}
if
(
actionBody
.
current
)
{
let
current
=
actionBody
.
current
;
tmpWhere
.
offset
=
(
current
-
1
)
*
actionBody
.
pageSize
;
}
}
let
result
=
await
this
.
dao
.
model
.
findAndCountAll
(
tmpWhere
)
return
system
.
getResultSuccess
(
result
);
}
/**
* 创建产品大类
* @returns {Promise<void>}
*/
async
submitProductType
(
actionBody
)
{
let
result
=
await
this
.
dao
.
model
.
create
(
actionBody
)
return
system
.
getResultSuccess
(
result
);
}
/**
* 修改产品大类
* @returns {Promise<void>}
*/
async
editProductType
(
actionBody
)
{
if
(
actionBody
)
{
let
result
=
await
this
.
dao
.
update
(
actionBody
)
return
system
.
getResultSuccess
(
result
);
}
return
;
}
}
}
module
.
exports
=
ProductTypeService
;
module
.
exports
=
ProductTypeService
;
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