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
18840f22
Commit
18840f22
authored
Apr 27, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
ebdd3a6a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
6 deletions
+106
-6
xgg-deliver/app/base/controller/impl/order/orderCtl.js
+87
-5
xgg-deliver/app/base/service/impl/order/orderSve.js
+17
-0
xgg-deliver/app/base/system.js
+1
-1
xgg-deliver/app/config/routes/web.js
+1
-0
No files found.
xgg-deliver/app/base/controller/impl/order/orderCtl.js
View file @
18840f22
...
...
@@ -4,6 +4,7 @@ class OrderCtl extends CtlBase {
constructor
()
{
super
();
this
.
orderSve
=
system
.
getObject
(
"service.order.orderSve"
);
this
.
deliverSve
=
system
.
getObject
(
"service.common.deliverSve"
);
}
async
processList
(
pobj
,
pobj2
,
req
)
{
...
...
@@ -85,13 +86,12 @@ class OrderCtl extends CtlBase {
}
}
/**
* 分配业务员
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
*/
async
deliverAssignSalesman
(
pobj
,
pobj2
,
req
)
{
if
(
!
pobj
.
id
)
{
...
...
@@ -103,7 +103,11 @@ class OrderCtl extends CtlBase {
if
(
!
pobj
.
operator_id
)
{
return
system
.
getResult
(
null
,
`参数错误 业务员ID不能为空`
);
}
let
user
=
await
this
.
deliverSve
.
deliverUserById
({
id
:
pobj
.
operator_id
});
if
(
!
user
||
user
.
status
!=
0
||
!
user
.
data
)
{
return
system
.
getResult
(
null
,
`业务员【
${
pobj
.
operator_id
}
】不存在`
);
}
pobj
.
operator_path
=
user
.
data
.
org_path
;
try
{
return
await
this
.
orderSve
.
handleStatus
(
pobj
);
}
catch
(
error
)
{
...
...
@@ -495,5 +499,82 @@ class OrderCtl extends CtlBase {
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
/***************************************************一下是阿里改版的接口*****************************************************************/
/**
* 新增订单
* @returns {Promise<void>}
* @params product_id 产品ID
* @params source_id 来源ID
* @params source_no 来源订单号
* @params desc 订单信息
* @params contact_mobile 联系电话
* @params customer_name 客户名称
*
* deliver_id:""
product_id:"10020000",
product_items: ["10020200","10020300","10020400","10020500","10020600",10020700],
customer_name: "",
contact_mobile:"",
*/
async
addSourceOrder
(
pobj
,
pobj2
,
req
)
{
if
(
!
pobj
.
product_id
)
{
return
system
.
getResult
(
null
,
`参数错误 订单ID不能为空`
);
}
if
(
!
pobj
.
contact_mobile
)
{
return
system
.
getResult
(
null
,
`参数错误 联系电话不能为空`
);
}
if
(
!
pobj
.
customer_name
)
{
return
system
.
getResult
(
null
,
`参数错误 客户名称不能为空`
);
}
if
(
!
pobj
.
chooseItems
){
pobj
.
chooseItems
=
[
"10020200"
,
"10020300"
,
"10020400"
,
"10020500"
,
"10020600"
,
"10020700"
];
}
if
(
!
pobj
.
chooseItems
.
includes
(
"10020200"
)){
pobj
.
chooseItems
.
push
(
"10020200"
);
}
pobj
.
source_id
=
pobj
.
source_id
||
'1003'
;
pobj
.
notes
=
pobj
.
desc
||
"工商注册,刻章,银行卡户,税务报到,建账"
;
if
(
!
pobj
.
deliverId
){
return
system
.
getResult
(
null
,
`请重新登录`
);
}
pobj
.
deliver_id
=
pobj
.
deliverId
;
pobj
.
deliver_name
=
pobj
.
deliverName
||
""
;
try
{
return
await
this
.
orderSve
.
addSourceOrder
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**
* ali完善订单
* @param pobj
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async
aliPerfectInformation
(
pobj
,
pobj2
,
req
){
if
(
!
pobj
.
id
){
return
system
.
getResult
(
null
,
`订单【
${
pobj
.
id
}
】不存在`
)
}
if
(
!
pobj
.
status
){
return
system
.
getResult
(
null
,
`订单状态不能为空`
)
}
try
{
return
await
this
.
orderSve
.
handleStatus
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
OrderCtl
;
\ No newline at end of file
xgg-deliver/app/base/service/impl/order/orderSve.js
View file @
18840f22
...
...
@@ -121,5 +121,21 @@ class OrderService extends ServiceBase {
var
rs
=
await
this
.
callms
(
"order"
,
"updateOBusinessmenProinvce"
,
params
);
return
rs
;
}
/*********************************************以下是阿里的接口****************************************************************/
/**
* 添加订单
* @param params
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}|{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
*/
async
addSourceOrder
(
params
)
{
try
{
return
await
this
.
callms
(
"order"
,
"addSourceOrder"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
OrderService
;
\ No newline at end of file
xgg-deliver/app/base/system.js
View file @
18840f22
...
...
@@ -194,7 +194,7 @@ class System {
// 订单服务
// order: domain2 + ":3103" + path,
order
:
domain
2
+
path
,
order
:
domain
+
":3103"
+
path
,
// 发票服务
invoice
:
domain2
+
":3105"
+
path
,
...
...
xgg-deliver/app/config/routes/web.js
View file @
18840f22
...
...
@@ -104,6 +104,7 @@ module.exports = function (app) {
req
.
body
.
saas_id
=
req
.
loginUser
.
saas_id
;
req
.
body
.
deliverId
=
req
.
loginUser
.
deliver_id
||
""
;
req
.
body
.
deliver_id
=
req
.
loginUser
.
deliver_id
||
""
;
req
.
body
.
deliverName
=
req
.
loginUser
.
deliver
.
name
||
""
;
}
params
.
push
(
methodName
);
...
...
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