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
15aa0d9b
Commit
15aa0d9b
authored
Jun 24, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
92cf8d08
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
106 additions
and
15 deletions
+106
-15
xgg-deliver/app/base/controller/impl/common/businessscopeCtl.js
+8
-3
xgg-deliver/app/base/controller/impl/order/orderCtl.js
+20
-1
xgg-deliver/app/base/service/impl/chance/chanceSve.js
+61
-8
xgg-deliver/app/base/service/impl/common/businessscopeSve.js
+4
-0
xgg-deliver/app/base/service/impl/order/orderSve.js
+10
-0
xgg-deliver/app/base/system.js
+3
-3
No files found.
xgg-deliver/app/base/controller/impl/common/businessscopeCtl.js
View file @
15aa0d9b
var
system
=
require
(
"../../../system"
)
var
system
=
require
(
"../../../system"
)
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctlms.base"
);
const
CtlBase
=
require
(
"../../ctlms.base"
);
const
uuidv4
=
require
(
'uuid/v4'
);
var
moment
=
require
(
"moment"
);
var
svgCaptcha
=
require
(
'svg-captcha'
);
class
BusinessscopeCtl
extends
CtlBase
{
class
BusinessscopeCtl
extends
CtlBase
{
constructor
()
{
constructor
()
{
...
@@ -21,6 +18,14 @@ class BusinessscopeCtl extends CtlBase {
...
@@ -21,6 +18,14 @@ class BusinessscopeCtl extends CtlBase {
}
}
}
}
/**
* fn:获取说有经营范围(没有分页)
* @returns {Promise<*>}
*/
async
listbusinessscopeAll
(
pobj
,
pobj2
,
req
){
return
await
this
.
businessscopeSve
.
listbusinessscopeAll
(
pobj
);
}
async
info
(
pobj
,
pobj2
,
req
)
{
async
info
(
pobj
,
pobj2
,
req
)
{
try
{
try
{
return
await
this
.
businessscopeSve
.
info
(
pobj
);
return
await
this
.
businessscopeSve
.
info
(
pobj
);
...
...
xgg-deliver/app/base/controller/impl/order/orderCtl.js
View file @
15aa0d9b
...
@@ -9,6 +9,7 @@ class OrderCtl extends CtlBase {
...
@@ -9,6 +9,7 @@ class OrderCtl extends CtlBase {
this
.
deliverSve
=
system
.
getObject
(
"service.common.deliverSve"
);
this
.
deliverSve
=
system
.
getObject
(
"service.common.deliverSve"
);
this
.
businessmenSve
=
system
.
getObject
(
"service.business.businessmenSve"
);
this
.
businessmenSve
=
system
.
getObject
(
"service.business.businessmenSve"
);
this
.
ALI_PRODUCT_CODE
=
"10020000"
;
}
}
async
processList
(
pobj
,
pobj2
,
req
)
{
async
processList
(
pobj
,
pobj2
,
req
)
{
...
@@ -72,7 +73,7 @@ class OrderCtl extends CtlBase {
...
@@ -72,7 +73,7 @@ class OrderCtl extends CtlBase {
}
}
async
orderChooseProducts
(
pobj
,
pobj2
,
req
)
{
async
orderChooseProducts
(
pobj
,
pobj2
,
req
)
{
let
orderId
=
this
.
trim
(
pobj
.
id
);
let
orderId
=
this
.
trim
(
pobj
.
id
)
||
this
.
ALI_PRODUCT_CODE
;
let
order
=
await
this
.
orderSve
.
orderInfo
({
id
:
orderId
});
let
order
=
await
this
.
orderSve
.
orderInfo
({
id
:
orderId
});
if
(
!
order
.
data
||
!
order
.
data
.
product_id
)
{
if
(
!
order
.
data
||
!
order
.
data
.
product_id
)
{
...
@@ -90,6 +91,24 @@ class OrderCtl extends CtlBase {
...
@@ -90,6 +91,24 @@ class OrderCtl extends CtlBase {
}
}
}
}
/**
* fn:阿里可选择订单(为商机提供服务)
* @param pobj
* @param pobj2
* @param req
* @returns {Promise<{msg: *, data: *, status: *}|*|{msg: string, data, bizmsg: *|string, status: number}|undefined>}
*/
async
aliProductForClue
(
pobj
,
pobj2
,
req
)
{
try
{
pobj
.
pid
=
this
.
ALI_PRODUCT_CODE
;
pobj
.
is_choose
=
true
;
return
this
.
orderSve
.
aliProductForClue
(
pobj
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResultFail
(
500
,
"接口错误"
);
}
}
/**
/**
* 分配业务员
* 分配业务员
...
...
xgg-deliver/app/base/service/impl/chance/chanceSve.js
View file @
15aa0d9b
...
@@ -7,6 +7,8 @@ class ChanceService extends ServiceBase {
...
@@ -7,6 +7,8 @@ class ChanceService extends ServiceBase {
this
.
deliverSve
=
system
.
getObject
(
"service.common.deliverSve"
);
this
.
deliverSve
=
system
.
getObject
(
"service.common.deliverSve"
);
this
.
orderSve
=
system
.
getObject
(
"service.order.orderSve"
);
this
.
orderSve
=
system
.
getObject
(
"service.order.orderSve"
);
this
.
ALI_PRODUCT_CODE
=
"10020000"
;
this
.
ALI_PRODUCT_CODE
=
"10020000"
;
this
.
CHANCE_DISTRIBUTION_RULE_KEY
=
"CHANCE_DELIVER_USER_QUEUE"
;
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
}
}
/**
/**
...
@@ -17,11 +19,36 @@ class ChanceService extends ServiceBase {
...
@@ -17,11 +19,36 @@ class ChanceService extends ServiceBase {
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
*/
*/
async
saveClue
(
params
)
{
async
saveClue
(
params
)
{
params
.
operator_id
=
params
.
deliver_user_id
;
params
.
operator_path
=
params
.
deliver_user_path
;
try
{
// if(await this.redisClient.exists(this.CHANCE_DISTRIBUTION_RULE_KEY)){
// await this.redisClient.delete(this.CHANCE_DISTRIBUTION_RULE_KEY);
// }
let
ishave
=
await
this
.
redisClient
.
exists
(
this
.
CHANCE_DISTRIBUTION_RULE_KEY
);
if
(
!
ishave
){
//如果没有这个key则需要重新导入所有的交付商用户
let
res
=
await
this
.
callms
(
"common"
,
"deliverUserAll"
,
{
deliver_id
:
this
.
trim
(
params
.
deliver_id
)});
if
(
res
.
status
!=
0
||
res
.
data
.
length
<=
0
){
return
system
.
getResult
(
null
,
`分配业务员失败 请联系管理员`
);
}
for
(
let
item
of
res
.
data
){
let
temp
=
{
id
:
item
.
id
,
real_name
:
item
.
real_name
,
org_path
:
item
.
org_path
,
ucname
:
item
.
ucname
};
await
this
.
redisClient
.
rpush
(
this
.
CHANCE_DISTRIBUTION_RULE_KEY
,
JSON
.
stringify
(
temp
));
}
}
let
operationtor
=
await
this
.
redisClient
.
lpop
(
this
.
CHANCE_DISTRIBUTION_RULE_KEY
);
operationtor
=
JSON
.
parse
(
operationtor
);
console
.
log
(
`chanceSve-->saveClue->分配业务员 `
+
JSON
.
stringify
(
operationtor
));
params
.
operator_id
=
operationtor
.
id
;
params
.
operator_path
=
operationtor
.
org_path
;
params
.
clue_type_id
=
this
.
trim
(
params
.
clue_type_id
)
||
this
.
ALI_PRODUCT_CODE
;
params
.
clue_type_id
=
this
.
trim
(
params
.
clue_type_id
)
||
this
.
ALI_PRODUCT_CODE
;
params
.
clue_type_name
=
this
.
trim
(
params
.
clue_type_name
)
||
"个体户注册一体化"
;
params
.
clue_type_name
=
this
.
trim
(
params
.
clue_type_name
)
||
"个体户注册一体化"
;
return
await
this
.
callms
(
"chance"
,
"saveClue"
,
params
);
return
await
this
.
callms
(
"chance"
,
"saveClue"
,
params
);
return
system
.
getResultSuccess
();
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
/**
/**
...
@@ -76,18 +103,18 @@ class ChanceService extends ServiceBase {
...
@@ -76,18 +103,18 @@ class ChanceService extends ServiceBase {
for
(
let
item
of
listProductRes
.
data
){
for
(
let
item
of
listProductRes
.
data
){
productMap
[
item
.
id
]
=
item
.
desc
;
productMap
[
item
.
id
]
=
item
.
desc
;
}
}
let
temp
=
[],
p_list
=
[];
let
p_list
=
[];
for
(
let
ele
of
rs
.
data
.
rows
){
for
(
let
ele
of
rs
.
data
.
rows
){
if
(
!
rs
.
data
.
rows
||
rs
.
data
.
rows
.
length
<=
0
||
!
ele
.
cscheme
.
service_ids
){
if
(
!
rs
.
data
.
rows
||
rs
.
data
.
rows
.
length
<=
0
||
!
ele
.
cscheme
.
service_ids
){
continue
;
continue
;
}
}
temp
=
ele
.
cscheme
.
service_ids
.
split
(
","
);
ele
.
cscheme
.
service_ids
=
ele
.
cscheme
.
service_ids
.
split
(
","
);
//这里需要明天去噶哎
//这里需要明天去噶哎
for
(
let
r
of
temp
)
{
for
(
let
r
of
ele
.
cscheme
.
service_ids
)
{
let
_p
=
productMap
[
r
]
||
{};
let
_p
=
productMap
[
r
]
||
{};
p_list
.
push
({
id
:
r
,
name
:
_p
.
desc
})
p_list
.
push
({
id
:
r
,
name
:
_p
})
}
}
ele
.
service_product
=
p_list
;
ele
.
cscheme
.
service_product
=
p_list
;
}
}
return
rs
;
return
rs
;
}
}
...
@@ -140,7 +167,33 @@ class ChanceService extends ServiceBase {
...
@@ -140,7 +167,33 @@ class ChanceService extends ServiceBase {
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
*/
*/
async
getClueById
(
params
)
{
async
getClueById
(
params
)
{
return
await
this
.
callms
(
"chance"
,
"getClueById"
,
params
);
try
{
let
res
=
await
this
.
callms
(
"chance"
,
"getClueById"
,
params
);
if
(
res
.
status
!=
0
){
return
system
.
getResult
(
null
,
`线索【
${
params
.
id
}
】不存在`
);
}
let
bean
=
res
.
data
;
//格式化服务内容
let
listProductRes
=
await
this
.
orderSve
.
productDics
({
pid
:
this
.
ALI_PRODUCT_CODE
});
if
(
listProductRes
.
status
!=
0
||
listProductRes
.
data
.
length
<=
0
){
return
system
.
getResult
(
null
,
`获取数据失败 请联系管理员`
);
}
let
productMap
=
{};
for
(
let
item
of
listProductRes
.
data
){
productMap
[
item
.
id
]
=
item
.
desc
;
}
let
p_list
=
[];
bean
.
cscheme
.
service_ids
=
bean
.
cscheme
.
service_ids
.
split
(
","
);
for
(
let
r
of
bean
.
cscheme
.
service_ids
)
{
let
_p
=
productMap
[
r
]
||
{};
p_list
.
push
({
id
:
r
,
name
:
_p
})
}
bean
.
cscheme
.
service_product
=
p_list
;
return
system
.
getResult
(
bean
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`获取数据失败`
);
}
}
}
/**
/**
...
...
xgg-deliver/app/base/service/impl/common/businessscopeSve.js
View file @
15aa0d9b
...
@@ -11,6 +11,10 @@ class BusinessscopeService extends ServiceBase {
...
@@ -11,6 +11,10 @@ class BusinessscopeService extends ServiceBase {
return
await
this
.
callms
(
"common"
,
"businessscopePage"
,
params
);
return
await
this
.
callms
(
"common"
,
"businessscopePage"
,
params
);
}
}
async
listbusinessscopeAll
(
params
){
return
await
this
.
callms
(
"common"
,
"listbusinessscopeAll"
,
params
);
}
async
info
(
params
)
{
async
info
(
params
)
{
return
await
this
.
callms
(
"common"
,
"businessscopeInfo"
,
params
);
return
await
this
.
callms
(
"common"
,
"businessscopeInfo"
,
params
);
}
}
...
...
xgg-deliver/app/base/service/impl/order/orderSve.js
View file @
15aa0d9b
...
@@ -34,6 +34,16 @@ class OrderService extends ServiceBase {
...
@@ -34,6 +34,16 @@ class OrderService extends ServiceBase {
return
rs
;
return
rs
;
}
}
/**
* fn:查询商机可选择的产品
* @param params
* @returns {Promise<void>}
*/
async
aliProductForClue
(
params
){
var
rs
=
await
this
.
callms
(
"order"
,
"productDics"
,
params
);
return
rs
;
}
async
orderAndDeliver
(
params
)
{
async
orderAndDeliver
(
params
)
{
var
rs
=
await
this
.
callms
(
"order"
,
"orderAndDeliver"
,
params
);
var
rs
=
await
this
.
callms
(
"order"
,
"orderAndDeliver"
,
params
);
return
rs
;
return
rs
;
...
...
xgg-deliver/app/base/system.js
View file @
15aa0d9b
...
@@ -185,7 +185,7 @@ class System {
...
@@ -185,7 +185,7 @@ class System {
var
domain2
=
"http://39.107.234.14"
;
var
domain2
=
"http://39.107.234.14"
;
return
{
return
{
// 公共服务
// 公共服务
common
:
domain
2
+
":3102
"
+
path
,
common
:
domain
+
":3109
"
+
path
,
// common: "http://127.0.0.1:3102" + path,
// common: "http://127.0.0.1:3102" + path,
// 商户服务
// 商户服务
...
@@ -193,8 +193,8 @@ class System {
...
@@ -193,8 +193,8 @@ class System {
// merchant: "http://127.0.0.1:3101" + path,
// merchant: "http://127.0.0.1:3101" + path,
// 订单服务
// 订单服务
//
order: domain + ":3103" + path,
order
:
domain
+
":3103"
+
path
,
order
:
domain2
+
":3103"
+
path
,
//
order: domain2 + ":3103"+ path,
// 发票服务
// 发票服务
invoice
:
domain2
+
":3105"
+
path
,
invoice
:
domain2
+
":3105"
+
path
,
...
...
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