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
736890f0
Commit
736890f0
authored
Jul 23, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
2ae532b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
39 deletions
+76
-39
center-manage/app/base/service/impl/product/productSve.js
+39
-39
center-manage/plan.txt
+37
-0
No files found.
center-manage/app/base/service/impl/product/productSve.js
View file @
736890f0
...
...
@@ -5,43 +5,43 @@ class ProductService extends ServiceBase {
super
(
"product"
,
ServiceBase
.
getDaoName
(
ProductService
));
this
.
priceDao
=
system
.
getObject
(
"db.product.productpriceDao"
)
}
async
findPriceStrategys
(
stragetyids
,
t
)
{
async
findPriceStrategys
(
stragetyids
,
t
)
{
//按照策略id查询出定价策略集合
let
pts
=
await
this
.
db
.
models
.
pricestrategy
.
findAll
({
where
:
{
id
:
{
[
this
.
db
.
Op
.
in
]:
stragetyids
}
},
attributes
:[
'id'
,
'optionunion'
],
transaction
:
t
})
let
tmpdic
=
{}
pts
.
forEach
(
p
=>
{
tmpdic
[
p
.
id
+
''
]
=
p
.
optionunion
let
pts
=
await
this
.
db
.
models
.
pricestrategy
.
findAll
({
where
:
{
id
:
{
[
this
.
db
.
Op
.
in
]:
stragetyids
}
},
attributes
:
[
'id'
,
'optionunion'
],
transaction
:
t
})
let
tmpdic
=
{}
pts
.
forEach
(
p
=>
{
tmpdic
[
p
.
id
+
''
]
=
p
.
optionunion
})
return
tmpdic
}
async
create
(
p
)
{
async
create
(
p
)
{
if
(
!
p
.
name
||
p
.
name
==
""
)
{
p
.
name
=
p
.
productcatpath
+
"~"
+
p
.
regionpath
p
.
name
=
p
.
productcatpath
+
"~"
+
p
.
regionpath
}
//策略ids
let
stragetyids
=
p
.
sts
let
skucodemap
=
p
.
skucodemap
let
skucodemap
=
p
.
skucodemap
var
self
=
this
;
return
this
.
db
.
transaction
(
async
function
(
t
)
{
let
pnew
=
await
self
.
dao
.
create
(
p
,
t
)
let
productprices
=
[]
//按照策略id查询出定价策略集合
let
tmpdic
=
await
self
.
findPriceStrategys
(
stragetyids
,
t
)
let
tmpdic
=
await
self
.
findPriceStrategys
(
stragetyids
,
t
)
stragetyids
.
forEach
(
stragetyid
=>
{
if
(
skucodemap
)
{
p
.
skucode
=
skucodemap
[
stragetyid
]
if
(
skucodemap
)
{
p
.
skucode
=
skucodemap
[
stragetyid
]
}
let
pps
=
{
product_id
:
pnew
.
id
,
pricestrategy_id
:
stragetyid
,
pname
:
p
.
name
,
strategyitems
:
tmpdic
[
stragetyid
+
''
],
company_id
:
p
.
company_id
,
skucode
:
p
.
skucode
?
p
.
skucode
:
self
.
getUUID
(),
skuname
:
p
.
skuname
?
p
.
skuname
:
p
.
name
,
sptags
:
p
.
sptags
,
channeltags
:
p
.
channeltags
pname
:
p
.
name
,
strategyitems
:
tmpdic
[
stragetyid
+
''
],
company_id
:
p
.
company_id
,
skucode
:
p
.
skucode
?
p
.
skucode
:
self
.
getUUID
(),
skuname
:
p
.
skuname
?
p
.
skuname
:
p
.
name
,
sptags
:
p
.
sptags
,
channeltags
:
p
.
channeltags
}
productprices
.
push
(
pps
)
})
...
...
@@ -49,7 +49,7 @@ class ProductService extends ServiceBase {
return
pnew
;
});
}
async
update
(
p
)
{
async
update
(
p
)
{
if
(
!
p
.
name
||
p
.
name
==
""
)
{
p
.
name
=
p
.
regionpath
+
"~"
+
p
.
productcatpath
}
...
...
@@ -63,44 +63,44 @@ class ProductService extends ServiceBase {
//在传入中的不做处理
let
currentProduct
=
await
self
.
dao
.
model
.
findOne
({
where
:
{
id
:
p
.
id
},
include
:
[
{
model
:
self
.
db
.
models
.
productprice
,
as
:
"skus"
,
attributes
:
[
'id'
,
'pricestrategy_id'
],
raw
:
true
},
{
model
:
self
.
db
.
models
.
productprice
,
as
:
"skus"
,
attributes
:
[
'id'
,
'pricestrategy_id'
],
raw
:
true
},
],
transaction
:
t
})
let
notInInput
=
[]
//需要删除
let
skusarray
=
[]
currentProduct
.
skus
.
forEach
(
sku
=>
{
let
notInInput
=
[]
//需要删除
let
skusarray
=
[]
currentProduct
.
skus
.
forEach
(
sku
=>
{
skusarray
.
push
(
sku
.
pricestrategy_id
)
if
(
stragetyids
.
indexOf
(
sku
.
pricestrategy_id
)
<
0
)
{
if
(
stragetyids
.
indexOf
(
sku
.
pricestrategy_id
)
<
0
)
{
notInInput
.
push
(
sku
.
id
)
}
})
//删除
if
(
notInInput
.
length
>
0
)
{
await
self
.
priceDao
.
bulkDelete
(
notInInput
,
t
)
}
//删除
if
(
notInInput
.
length
>
0
)
{
await
self
.
priceDao
.
bulkDelete
(
notInInput
,
t
)
}
//传入不在查出中的,需要新增
let
notintables
=
[]
stragetyids
.
forEach
(
st
=>
{
if
(
skusarray
.
indexOf
(
st
)
<
0
)
{
let
notintables
=
[]
stragetyids
.
forEach
(
st
=>
{
if
(
skusarray
.
indexOf
(
st
)
<
0
)
{
notintables
.
push
(
st
)
}
})
//新增
let
productprices
=
[]
let
tmpdic
=
await
self
.
findPriceStrategys
(
stragetyids
,
t
)
let
tmpdic
=
await
self
.
findPriceStrategys
(
stragetyids
,
t
)
notintables
.
forEach
(
stragetyid
=>
{
let
pps
=
{
product_id
:
p
.
id
,
pricestrategy_id
:
stragetyid
,
pname
:
p
.
name
,
strategyitems
:
tmpdic
[
stragetyid
+
''
],
company_id
:
p
.
company_id
,
skucode
:
this
.
getUUID
(),
skuname
:
p
.
name
,
pname
:
p
.
name
,
strategyitems
:
tmpdic
[
stragetyid
+
''
],
company_id
:
p
.
company_id
,
skucode
:
self
.
getUUID
(),
skuname
:
p
.
name
,
}
productprices
.
push
(
pps
)
})
if
(
productprices
.
length
>
0
)
{
if
(
productprices
.
length
>
0
)
{
await
self
.
priceDao
.
bulkCreate
(
productprices
,
t
)
}
return
{};
...
...
center-manage/plan.txt
View file @
736890f0
...
...
@@ -33,3 +33,39 @@
5、K8s环境搭建
--提供k8集群/镜像服务--git push tag--自动打包
--我们提供yaml上线文件/Dockerfile
仓库
web-deliver-center 交付中心前端
web-deliver-bussiness 工商交付前端
api-deliver-bussiness 工商交付后台
web-deliver-vat 增值电信前端
api-deliver-vat 增值电信后台
task-deliver 日常任务
仓库到YAML映射
后台(前端代码直接内置到后台服务的public目录下)
api-deliver-center 交付中心后台 -> paas-deployment.yaml
api-deliver-bussiness 工商交付后台 ->ic-deployment.yaml
api-deliver-vat 增值电信后台 -> icp-deployment.yaml
task-deliver 日常任务 ->1.icp_filebuild_cronjobs.yaml
task-deliver 日常任务 ->2.ic_filebuild_cronjobs.yaml
1.中台镜像center-manage
路由域名:delivery.brg.tencentyun.com
后台服务:paas-service
2.工商交付镜像 ic-deliver
路由域名:ic.brg.tencentyun.com
后台服务:icdeliver-service
3.ICP交付镜像 icp-deliver
路由域名:http://icp.brg.tencentyun.com/
后台服务:icpdeliver-service
4.任务镜像 center-taskexecutor
\ No newline at end of file
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