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
5dbfd34c
Commit
5dbfd34c
authored
Mar 01, 2021
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
importOrders
parent
70eda32a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
4 deletions
+114
-4
center-order/app/base/api/impl/action/order.js
+6
-3
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+101
-1
center-order/app/config/settings.js
+7
-0
No files found.
center-order/app/base/api/impl/action/order.js
View file @
5dbfd34c
...
@@ -13,9 +13,9 @@ class OrderAPI extends APIBase {
...
@@ -13,9 +13,9 @@ class OrderAPI extends APIBase {
* action_body 执行的参数
* action_body 执行的参数
*/
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
userInfo
)
{
//
if (!pobj.userInfo) {
return
system
.
getResultFail
(
system
.
noLogin
,
"user no login!"
);
//
return system.getResultFail(system.noLogin, "user no login!");
}
//
}
if
(
!
pobj
.
actionType
)
{
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
}
...
@@ -97,6 +97,9 @@ class OrderAPI extends APIBase {
...
@@ -97,6 +97,9 @@ class OrderAPI extends APIBase {
case
"tmConfirm"
:
//商标方案确认
case
"tmConfirm"
:
//商标方案确认
opResult
=
await
this
.
orderinfoSve
.
tmConfirm
(
pobj
);
opResult
=
await
this
.
orderinfoSve
.
tmConfirm
(
pobj
);
break
;
break
;
case
"bulkCreateOrders"
:
opResult
=
await
this
.
orderinfoSve
.
bulkCreateOrders
(
pobj
,
req
);
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
...
...
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
5dbfd34c
...
@@ -1396,7 +1396,6 @@ class OrderInfoService extends ServiceBase {
...
@@ -1396,7 +1396,6 @@ class OrderInfoService extends ServiceBase {
}
}
async
getOrderByOrderNo
(
pobj
,
actionBody
)
{
//根据订单号获取订单详情信息
async
getOrderByOrderNo
(
pobj
,
actionBody
)
{
//根据订单号获取订单详情信息
;
let
orderItem
=
await
this
.
dao
.
getItemStatusByOrderNo
(
actionBody
.
orderNo
);
let
orderItem
=
await
this
.
dao
.
getItemStatusByOrderNo
(
actionBody
.
orderNo
);
if
(
!
orderItem
)
{
if
(
!
orderItem
)
{
return
system
.
getResult
(
null
,
"order data is empty!"
);
return
system
.
getResult
(
null
,
"order data is empty!"
);
...
@@ -2163,5 +2162,105 @@ class OrderInfoService extends ServiceBase {
...
@@ -2163,5 +2162,105 @@ class OrderInfoService extends ServiceBase {
let
seRet
=
await
this
.
customQuery
(
sql
,
searchWhere
);
let
seRet
=
await
this
.
customQuery
(
sql
,
searchWhere
);
return
system
.
getResultSuccess
(
seRet
)
return
system
.
getResultSuccess
(
seRet
)
}
}
/**
* 腾讯平台订单导入
* @param pobj
* @returns {Promise<void>}
*/
async
bulkCreateOrders
(
pobj
,
req
)
{
let
ordersArr
=
[];
let
contactsArr
=
[];
let
productsArr
=
[];
let
arr
=
pobj
.
actionBody
.
ordersArr
;
let
uapp_id
=
pobj
.
actionBody
.
uapp_id
;
/*{
number:"N202102251259eaduJjc",需求号 || 订单号
status:"待处理,提交方案,已成单等" //单子状态
companyName:"公司名称",//公司名称
createdAt:"2021-02-25 10:30:11",创建时间
area:"扬州",//区域
productType:"公司注册",//产品名称
personName:"联系人",
personMobile:"联系人电话",
price:"8.80" //价格 ps: 订单会有这个字段
}*/
let
sql
=
'select channelOrderNo from c_order_info where uapp_id = 53'
;
let
ret
=
await
this
.
customQuery
(
sql
);
let
existIds
=
ret
.
map
(
item
=>
{
return
item
.
channelOrderNo
;
})
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
let
order
=
arr
[
i
];
if
(
existIds
.
includes
(
order
.
number
))
continue
;
let
orderObj
=
{
uapp_id
:
uapp_id
,
orderNo
:
order
.
number
,
//订单号
channelServiceNo
:
order
.
number
,
//渠道服务单号
channelOrderNo
:
order
.
number
,
//渠道订单号列表,多个以,隔开
quantity
:
1
,
//项目订单数量(即服务项目的倍数,默认值为1)
orderStatus
:
2
,
//订单状态: 1: 待付款, 2: 已付款, 4: 待服务, 8: 已完成
totalSum
:
order
.
price
,
//订单总额(产品价格×优惠费率×订单件数)
payTotalSum
:
order
.
price
,
}
if
(
order
.
status
==
'已签收'
||
order
.
status
==
'服务已完成'
)
{
orderObj
[
'orderStatus'
]
=
8
;
}
ordersArr
.
push
(
orderObj
);
if
(
order
.
personName
&&
order
.
personMobile
){
let
customerContactObj
=
{
uapp_id
:
uapp_id
,
sourceOrderNo
:
order
.
number
,
contactName
:
order
.
personName
||
""
,
mobile
:
order
.
personMobile
};
contactsArr
.
push
(
customerContactObj
);
}
let
whereParams
=
{
uapp_id
:
uapp_id
,
item_name
:
order
.
productType
};
pobj
.
actionType
=
'getProductByWhere'
;
pobj
.
actionBody
=
{
whereParams
}
let
url
=
settings
.
centerAppUrl
()
+
'action/opProduct/springBoard'
;
let
result
=
await
this
.
execClientNew
.
execPostTimeOutByBusiness
(
'orderinfoSve.js'
,
pobj
,
url
,
null
,
null
,
60
,
req
);
if
(
result
.
status
!=
0
)
{
return
result
;
}
if
(
result
.
data
.
status
!=
0
)
{
return
result
.
data
;
}
let
product
=
result
.
data
.
data
;
let
orderProductObj
=
{
uapp_id
:
uapp_id
,
sourceOrderNo
:
order
.
number
,
// 来源单号
productType_id
:
product
.
productType_id
,
//产品类型Id
pathCode
:
product
.
path_code
,
//产品路径
itemCode
:
product
.
item_code
,
//产品编码
itemName
:
product
.
item_name
,
//产品名称
channelItemCode
:
product
.
channel_item_code
,
// 渠道产品编码
channelItemName
:
product
.
channel_item_name
,
// 渠道产品名称
serviceItemCode
:
product
.
service_item_code
,
// 服务商产品编码
price
:
order
.
price
,
//定价
quantity
:
1
,
// 订单数量(即产品的倍数,默认值为1)
opPayType
:
"00"
,
// 操作付款类型:00: 创建订单, 10: 补单
serviceItemSnapshot
:
JSON
.
stringify
(
product
),
//产品快照
};
productsArr
.
push
(
orderProductObj
);
}
let
orRet
=
null
;
if
(
ordersArr
.
length
>
0
){
orRet
=
await
this
.
dao
.
bulkCreate
(
ordersArr
);
if
(
orRet
.
length
==
0
){
return
system
.
getResultFail
(
-
1
,
'保存订单失败'
);
}
}
if
(
contactsArr
.
length
>
0
){
this
.
ordercontactsDao
.
bulkCreate
(
contactsArr
);
}
if
(
productsArr
.
length
>
0
){
this
.
orderproductDao
.
bulkCreate
(
productsArr
);
}
return
system
.
getResult
(
orRet
);
}
}
}
module
.
exports
=
OrderInfoService
;
module
.
exports
=
OrderInfoService
;
\ No newline at end of file
center-order/app/config/settings.js
View file @
5dbfd34c
...
@@ -49,6 +49,13 @@ var settings = {
...
@@ -49,6 +49,13 @@ var settings = {
return
"http://gsb.qifu.gongsibao.com:4012/"
;
return
"http://gsb.qifu.gongsibao.com:4012/"
;
}
}
},
},
centerAppUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://centerapp.apps.com:4010/"
;
}
else
{
return
"http://center-app-service/"
;
}
},
push360Url
:
function
()
{
push360Url
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
if
(
this
.
env
==
'dev'
)
{
return
"http://180.163.239.98:38086/"
;
return
"http://180.163.239.98:38086/"
;
...
...
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