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
9f7ae466
Commit
9f7ae466
authored
Aug 01, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pp
parent
eb1b4ecd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
15 deletions
+47
-15
center-manage/app/base/service/impl/auth/userSve.js
+15
-4
center-manage/app/base/service/impl/common/channelhandlers/ali.js
+32
-11
No files found.
center-manage/app/base/service/impl/auth/userSve.js
View file @
9f7ae466
...
...
@@ -650,7 +650,7 @@ class UserService extends ServiceBase {
// return false;
// }
// });
//按条件筛选
let
cansels
=
users
.
filter
(
u
=>
{
if
(
regionName
&&
regionName
!=
""
&&
u
.
regiontags
)
{
...
...
@@ -668,7 +668,7 @@ class UserService extends ServiceBase {
}
})
console
.
log
(
'------------1'
,
JSON
.
stringify
(
cansels
)
);
console
.
log
(
'------------1'
,
JSON
.
stringify
(
cansels
));
let
lngth
=
cansels
.
length
if
(
lngth
>
0
)
{
let
obj
=
{};
...
...
@@ -688,7 +688,7 @@ class UserService extends ServiceBase {
}
}
console
.
log
(
'------------2'
,
JSON
.
stringify
(
obj
)
);
console
.
log
(
'------------2'
,
JSON
.
stringify
(
obj
));
let
resultUserKey
=
Object
.
keys
(
obj
)[
0
];
let
resultUser
=
obj
[
resultUserKey
].
userInfo
;
...
...
@@ -701,6 +701,17 @@ class UserService extends ServiceBase {
}
})
}
/**
*根据业务员openid查找该用户信息
*@param {*} openid 业务员唯一标识
*/
async
getSalesmanInfo
(
openid
)
{
let
userfind
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
openid
:
openid
}
});
return
userfind
;
}
}
module
.
exports
=
UserService
;
...
...
@@ -717,7 +728,7 @@ module.exports = UserService;
// let result = await cacheManager["LoopDistributionUserCache"].getCache("LoopDistributionUserCache");
// // let result = await cacheManager["LoopDistributionUserCache"].invalidate("LoopDistributionUserCache");
// console.log('----=-=-=-:' + JSON.stringify(result));
// } catch (error) {
// console.log("err:" + error);
// }
...
...
center-manage/app/base/service/impl/common/channelhandlers/ali.js
View file @
9f7ae466
...
...
@@ -212,13 +212,29 @@ class AliHandler {
}
else
{
let
obj
=
await
this
.
actionBodyHandler
(
datajson
.
actionBody
);
//获取分配的业务员信息
//分配业务员
if
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
)
{
//去数据库查询该业务员信息
try
{
let
resInfo
=
await
this
.
userService
.
getSalesmanInfo
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
);
obj
.
salesmanOpcode
=
resInfo
.
opath
;
}
catch
(
error
)
{
console
.
log
(
"salesmanChannelId: "
+
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
+
"获取业务员opcode失败:"
+
error
)
}
}
//分配交付员
var
ConsultTypeName
=
""
;
if
(
obj
.
businessName
&&
obj
.
businessName
!=
'undefined'
)
{
console
.
log
(
"productTypeName-----------------------------"
+
obj
.
businessName
);
ConsultTypeName
=
obj
.
businessName
;
}
var
deliveryInfo
=
await
this
.
userService
.
getBizUserForAliDelivery
(
obj
.
baseInfo
.
contactsName
,
obj
.
servicerName
,
ConsultTypeName
,
obj
.
skuCode
,
obj
.
serviceName
);
try
{
var
deliveryInfo
=
await
this
.
userService
.
getBizUserForAliDelivery
(
obj
.
baseInfo
.
contactsName
,
obj
.
servicerName
,
ConsultTypeName
,
obj
.
skuCode
,
obj
.
serviceName
);
}
catch
(
error
)
{
console
.
log
(
"分配交付元失败."
);
}
requrl
=
this
.
icUrl
+
"/deliverybillCtl/dealAliDeliveryInfo"
;
// var bizurl = this.icUrl + "/bizoptCtl/updateStatusByDemandCode";
...
...
@@ -359,15 +375,15 @@ class AliHandler {
obj
.
servicerName
=
data
.
servicer
.
name
;
}
}
if
(
data
.
needsolution
.
solution
.
Area
)
{
//服务地区编码和服务地区
if
(
data
.
needsolution
.
solution
.
Area
)
{
//服务地区编码和服务地区
obj
.
serviceCode
=
data
.
needsolution
.
solution
.
Area
;
obj
.
serviceName
=
data
.
needsolution
.
solution
.
Area
;
obj
.
baseInfo
.
serviceName
=
data
.
needsolution
.
solution
.
Area
;
}
if
(
data
.
needsolution
.
solution
.
CompanyName
)
{
//公司名称
if
(
data
.
needsolution
.
solution
.
CompanyName
)
{
//公司名称
obj
.
baseInfo
.
companyName
=
data
.
needsolution
.
solution
.
CompanyName
;
}
if
(
data
.
needsolution
.
solution
.
CompanyAddress
)
{
//公司地址
if
(
data
.
needsolution
.
solution
.
CompanyAddress
)
{
//公司地址
obj
.
baseInfo
.
companyAddress
=
data
.
needsolution
.
solution
.
CompanyAddress
;
}
if
(
data
.
needsolution
.
bizType
)
{
//产品编码
...
...
@@ -390,14 +406,14 @@ class AliHandler {
obj
.
skuCode
=
data
.
skuCode
;
}
if
(
data
.
needsolution
.
status
)
{
//交付单状态码
if
(
data
.
needsolution
.
status
=
"USER_UPLOADED"
)
{
if
(
data
.
needsolution
.
status
=
"USER_UPLOADED"
)
{
obj
.
deliverStatus
=
"received"
;
}
}
if
(
data
.
needsolution
.
customerRemark
)
{
//状态原因
obj
.
statusReason
=
data
.
needsolution
.
customerRemark
;
}
if
(
data
.
needsolution
.
status
)
{
//
TODO
成本
if
(
data
.
needsolution
.
status
)
{
//成本
obj
.
costPrice
=
data
.
needsolution
.
status
;
}
if
(
data
.
needsolution
.
totalSum
)
{
//价格
...
...
@@ -409,6 +425,9 @@ class AliHandler {
obj
.
channelNumber
=
"阿里云"
;
if
(
data
.
needsolution
.
salesmanInfo
)
{
if
(
data
.
needsolution
.
salesmanInfo
.
salesmanId
)
{
obj
.
salesmanId
=
data
.
needsolution
.
salesmanInfo
.
salesmanId
;
}
if
(
data
.
needsolution
.
salesmanInfo
.
salesmanName
)
{
obj
.
salesmanName
=
data
.
needsolution
.
salesmanInfo
.
salesmanName
;
}
...
...
@@ -417,12 +436,13 @@ class AliHandler {
}
}
if
(
data
.
needsolution
.
customerInfo
)
{
//联系人
if
(
data
.
needsolution
.
customerInfo
.
publishName
)
{
obj
.
baseInfo
.
contactsName
=
data
.
needsolution
.
customerInfo
.
publishName
;
}
if
(
data
.
needsolution
.
customerInfo
.
publishMobile
)
{
//联系电话
obj
.
baseInfo
.
publishMobil
e
=
data
.
needsolution
.
customerInfo
.
publishMobile
;
obj
.
baseInfo
.
contactsPhon
e
=
data
.
needsolution
.
customerInfo
.
publishMobile
;
}
if
(
data
.
needsolution
.
customerRemark
)
{
//备注信息
obj
.
baseInfo
.
memoinfo
=
data
.
needsolution
.
customerRemark
;
...
...
@@ -462,9 +482,9 @@ module.exports = new AliHandler();
// console.log("getBizUserForAliDelivery err: "+ error);
// }
// }
// let rc = system.getObject("util.execClient");
// let requrl = settings.icUrl() + "/web/bizchance" + ;
// let userService = system.getObject("service.auth.userSve");
// start();
// async function start() {
// let res = await rc.execPost3({ "d": obj }, requrl);
// let resInfo = await userService.getSalesmanInfo("5ddf5f5d8b13b0000a3f2b18");
// console.log("ceshi:" + JSON.stringify(resInfo));
// }
\ 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