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
c843cbda
Commit
c843cbda
authored
Jul 23, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-manage' of gitlab.gongsibao.com:jiangyong/zhichan into center-manage
parents
02cab8cb
736890f0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
37 deletions
+74
-37
center-manage/app/base/service/impl/product/productSve.js
+36
-36
center-manage/app/base/service/impl/product/productpriceSve.js
+1
-1
center-manage/plan.txt
+37
-0
No files found.
center-manage/app/base/service/impl/product/productSve.js
View file @
c843cbda
...
@@ -5,43 +5,43 @@ class ProductService extends ServiceBase {
...
@@ -5,43 +5,43 @@ class ProductService extends ServiceBase {
super
(
"product"
,
ServiceBase
.
getDaoName
(
ProductService
));
super
(
"product"
,
ServiceBase
.
getDaoName
(
ProductService
));
this
.
priceDao
=
system
.
getObject
(
"db.product.productpriceDao"
)
this
.
priceDao
=
system
.
getObject
(
"db.product.productpriceDao"
)
}
}
async
findPriceStrategys
(
stragetyids
,
t
)
{
async
findPriceStrategys
(
stragetyids
,
t
)
{
//按照策略id查询出定价策略集合
//按照策略id查询出定价策略集合
let
pts
=
await
this
.
db
.
models
.
pricestrategy
.
findAll
({
where
:
{
id
:
{
[
this
.
db
.
Op
.
in
]:
stragetyids
}
},
attributes
:[
'id'
,
'optionunion'
],
transaction
:
t
})
let
pts
=
await
this
.
db
.
models
.
pricestrategy
.
findAll
({
where
:
{
id
:
{
[
this
.
db
.
Op
.
in
]:
stragetyids
}
},
attributes
:
[
'id'
,
'optionunion'
],
transaction
:
t
})
let
tmpdic
=
{}
let
tmpdic
=
{}
pts
.
forEach
(
p
=>
{
pts
.
forEach
(
p
=>
{
tmpdic
[
p
.
id
+
''
]
=
p
.
optionunion
tmpdic
[
p
.
id
+
''
]
=
p
.
optionunion
})
})
return
tmpdic
return
tmpdic
}
}
async
create
(
p
)
{
async
create
(
p
)
{
if
(
!
p
.
name
||
p
.
name
==
""
)
{
if
(
!
p
.
name
||
p
.
name
==
""
)
{
p
.
name
=
p
.
productcatpath
+
"~"
+
p
.
regionpath
p
.
name
=
p
.
productcatpath
+
"~"
+
p
.
regionpath
}
}
//策略ids
//策略ids
let
stragetyids
=
p
.
sts
let
stragetyids
=
p
.
sts
let
skucodemap
=
p
.
skucodemap
let
skucodemap
=
p
.
skucodemap
var
self
=
this
;
var
self
=
this
;
return
this
.
db
.
transaction
(
async
function
(
t
)
{
return
this
.
db
.
transaction
(
async
function
(
t
)
{
let
pnew
=
await
self
.
dao
.
create
(
p
,
t
)
let
pnew
=
await
self
.
dao
.
create
(
p
,
t
)
let
productprices
=
[]
let
productprices
=
[]
//按照策略id查询出定价策略集合
//按照策略id查询出定价策略集合
let
tmpdic
=
await
self
.
findPriceStrategys
(
stragetyids
,
t
)
let
tmpdic
=
await
self
.
findPriceStrategys
(
stragetyids
,
t
)
stragetyids
.
forEach
(
stragetyid
=>
{
stragetyids
.
forEach
(
stragetyid
=>
{
if
(
skucodemap
)
{
if
(
skucodemap
)
{
p
.
skucode
=
skucodemap
[
stragetyid
]
p
.
skucode
=
skucodemap
[
stragetyid
]
}
}
let
pps
=
{
let
pps
=
{
product_id
:
pnew
.
id
,
product_id
:
pnew
.
id
,
pricestrategy_id
:
stragetyid
,
pricestrategy_id
:
stragetyid
,
pname
:
p
.
name
,
pname
:
p
.
name
,
strategyitems
:
tmpdic
[
stragetyid
+
''
],
strategyitems
:
tmpdic
[
stragetyid
+
''
],
company_id
:
p
.
company_id
,
company_id
:
p
.
company_id
,
skucode
:
p
.
skucode
?
p
.
skucode
:
self
.
getUUID
(),
skucode
:
p
.
skucode
?
p
.
skucode
:
self
.
getUUID
(),
skuname
:
p
.
skuname
?
p
.
skuname
:
p
.
name
,
skuname
:
p
.
skuname
?
p
.
skuname
:
p
.
name
,
sptags
:
p
.
sptags
,
sptags
:
p
.
sptags
,
channeltags
:
p
.
channeltags
channeltags
:
p
.
channeltags
}
}
productprices
.
push
(
pps
)
productprices
.
push
(
pps
)
})
})
...
@@ -49,7 +49,7 @@ class ProductService extends ServiceBase {
...
@@ -49,7 +49,7 @@ class ProductService extends ServiceBase {
return
pnew
;
return
pnew
;
});
});
}
}
async
update
(
p
)
{
async
update
(
p
)
{
if
(
!
p
.
name
||
p
.
name
==
""
)
{
if
(
!
p
.
name
||
p
.
name
==
""
)
{
p
.
name
=
p
.
regionpath
+
"~"
+
p
.
productcatpath
p
.
name
=
p
.
regionpath
+
"~"
+
p
.
productcatpath
}
}
...
@@ -63,44 +63,44 @@ class ProductService extends ServiceBase {
...
@@ -63,44 +63,44 @@ class ProductService extends ServiceBase {
//在传入中的不做处理
//在传入中的不做处理
let
currentProduct
=
await
self
.
dao
.
model
.
findOne
({
let
currentProduct
=
await
self
.
dao
.
model
.
findOne
({
where
:
{
id
:
p
.
id
},
include
:
[
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
],
transaction
:
t
})
})
let
notInInput
=
[]
//需要删除
let
notInInput
=
[]
//需要删除
let
skusarray
=
[]
let
skusarray
=
[]
currentProduct
.
skus
.
forEach
(
sku
=>
{
currentProduct
.
skus
.
forEach
(
sku
=>
{
skusarray
.
push
(
sku
.
pricestrategy_id
)
skusarray
.
push
(
sku
.
pricestrategy_id
)
if
(
stragetyids
.
indexOf
(
sku
.
pricestrategy_id
)
<
0
)
{
if
(
stragetyids
.
indexOf
(
sku
.
pricestrategy_id
)
<
0
)
{
notInInput
.
push
(
sku
.
id
)
notInInput
.
push
(
sku
.
id
)
}
}
})
})
//删除
//删除
if
(
notInInput
.
length
>
0
)
{
if
(
notInInput
.
length
>
0
)
{
await
self
.
priceDao
.
bulkDelete
(
notInInput
,
t
)
await
self
.
priceDao
.
bulkDelete
(
notInInput
,
t
)
}
}
//传入不在查出中的,需要新增
//传入不在查出中的,需要新增
let
notintables
=
[]
let
notintables
=
[]
stragetyids
.
forEach
(
st
=>
{
stragetyids
.
forEach
(
st
=>
{
if
(
skusarray
.
indexOf
(
st
)
<
0
)
{
if
(
skusarray
.
indexOf
(
st
)
<
0
)
{
notintables
.
push
(
st
)
notintables
.
push
(
st
)
}
}
})
})
//新增
//新增
let
productprices
=
[]
let
productprices
=
[]
let
tmpdic
=
await
self
.
findPriceStrategys
(
stragetyids
,
t
)
let
tmpdic
=
await
self
.
findPriceStrategys
(
stragetyids
,
t
)
notintables
.
forEach
(
stragetyid
=>
{
notintables
.
forEach
(
stragetyid
=>
{
let
pps
=
{
let
pps
=
{
product_id
:
p
.
id
,
product_id
:
p
.
id
,
pricestrategy_id
:
stragetyid
,
pricestrategy_id
:
stragetyid
,
pname
:
p
.
name
,
pname
:
p
.
name
,
strategyitems
:
tmpdic
[
stragetyid
+
''
],
strategyitems
:
tmpdic
[
stragetyid
+
''
],
company_id
:
p
.
company_id
,
company_id
:
p
.
company_id
,
skucode
:
this
.
getUUID
(),
skucode
:
self
.
getUUID
(),
skuname
:
p
.
name
,
skuname
:
p
.
name
,
}
}
productprices
.
push
(
pps
)
productprices
.
push
(
pps
)
})
})
if
(
productprices
.
length
>
0
)
{
if
(
productprices
.
length
>
0
)
{
await
self
.
priceDao
.
bulkCreate
(
productprices
,
t
)
await
self
.
priceDao
.
bulkCreate
(
productprices
,
t
)
}
}
return
{};
return
{};
...
...
center-manage/app/base/service/impl/product/productpriceSve.js
View file @
c843cbda
...
@@ -38,7 +38,7 @@ class ProductpriceService extends ServiceBase {
...
@@ -38,7 +38,7 @@ class ProductpriceService extends ServiceBase {
}
}
})
})
let
codeval
=
String
(
areainfos
[
0
].
code
).
padEnd
(
6
,
'0'
)
let
codeval
=
String
(
areainfos
[
0
].
code
).
padEnd
(
6
,
'0'
)
if
(
productname
.
indexOf
(
"icp"
)
<
0
&&
productname
.
indexOf
(
"edi"
)
<
0
&&
areainfos
[
0
].
name
.
indexOf
(
"天津"
)
>=
0
||
areainfos
[
0
].
name
.
indexOf
(
"北京"
)
>=
0
||
areainfos
[
0
].
name
.
indexOf
(
"上海"
)
>=
0
||
areainfos
[
0
].
name
.
indexOf
(
"重庆"
)
>=
0
)
{
if
(
(
productname
.
indexOf
(
"icp"
)
<
0
&&
productname
.
indexOf
(
"edi"
)
<
0
)
&&
(
areainfos
[
0
].
name
.
indexOf
(
"天津"
)
>=
0
||
areainfos
[
0
].
name
.
indexOf
(
"北京"
)
>=
0
||
areainfos
[
0
].
name
.
indexOf
(
"上海"
)
>=
0
||
areainfos
[
0
].
name
.
indexOf
(
"重庆"
)
>=
0
)
)
{
codeval
=
String
(
areainfos
[
0
].
code
+
"01"
).
padEnd
(
6
,
'0'
)
codeval
=
String
(
areainfos
[
0
].
code
+
"01"
).
padEnd
(
6
,
'0'
)
}
}
if
(
!
cacheregions
[
codeval
])
{
if
(
!
cacheregions
[
codeval
])
{
...
...
center-manage/plan.txt
View file @
c843cbda
...
@@ -33,3 +33,39 @@
...
@@ -33,3 +33,39 @@
5、K8s环境搭建
5、K8s环境搭建
--提供k8集群/镜像服务--git push tag--自动打包
--提供k8集群/镜像服务--git push tag--自动打包
--我们提供yaml上线文件/Dockerfile
--我们提供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