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
7cfbb929
Commit
7cfbb929
authored
Dec 09, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化 手动 分配
parent
cf87929c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
14 deletions
+63
-14
ic-deliver/app/base/controller/impl/bizchance/deliverybillCtl.js
+35
-2
ic-deliver/app/base/db/impl/bizchance/deliverybillDao.js
+8
-3
ic-deliver/app/base/service/impl/bizchance/deliverybillSve.js
+11
-4
ic-deliver/app/base/utils/logClient.js
+1
-1
ic-deliver/app/config/routes/api.js
+4
-2
ic-deliver/app/config/routes/web.js
+4
-2
No files found.
ic-deliver/app/base/controller/impl/bizchance/deliverybillCtl.js
View file @
7cfbb929
...
...
@@ -557,7 +557,7 @@ class DeliverybillCtl extends CtlBase {
const
sInfo
=
{
flowType
:
'DELIVERY'
,
flowId
:
res
.
id
,
flowCode
:
pobj
.
deliverNumber
,
flowCode
:
res
.
master_source_number
||
res
.
delivery_code
,
salesmanInfo
:
{
// "oldClerkPhone": res.salesman_phone,
oldFacilitatorId
:
res
.
facilitator_id
,
...
...
@@ -588,7 +588,7 @@ class DeliverybillCtl extends CtlBase {
};
}
await
this
.
shisService
.
insertInfo
(
sInfo
);
// 之前业务员转历史
await
this
.
service
.
updateSalesmanInfoByDeliverCode
(
pobj
);
// 更新业务员信息
await
this
.
service
.
updateSalesmanInfoByDeliverCode
(
{
...
pobj
,
masterSourceNumber
:
res
.
master_source_number
}
);
// 更新业务员信息
return
system
.
getResult
(
'操作成功!'
);
}
...
...
@@ -601,6 +601,39 @@ class DeliverybillCtl extends CtlBase {
}
}
/** 查询子订单的关联单 */
async
findRelationOrder
(
mobj
)
{
try
{
if
(
!
mobj
.
deliverNumber
)
{
throw
new
Error
(
"deliverNumber 不能为空"
);
}
const
data
=
await
this
.
service
.
findOne
({
delivery_code
:
mobj
.
deliverNumber
,
facilitator_id
:
mobj
.
company_id
,
});
if
(
data
)
{
let
result
=
[];
if
(
data
.
master_source_number
)
{
const
orders
=
await
this
.
service
.
findOrderByMasterNumber
(
data
.
master_source_number
);
if
(
orders
&&
orders
.
length
>
0
)
{
result
=
orders
.
map
(
item
=>
{
return
item
.
delivery_code
}).
filter
(
item
=>
{
return
item
!==
mobj
.
deliverNumber
})
}
}
return
system
.
getResult
(
result
);
}
else
{
throw
new
Error
(
`单号错误
${
mobj
.
deliverNumber
}
`
)
}
}
catch
(
error
)
{
return
system
.
getResultError
(
error
.
message
);
}
}
/* 更新业务员信息*/
async
updateSalesmanInfoByDeliverCode
(
mobj
,
qobj
,
req
)
{
const
pobj
=
mobj
.
d
;
...
...
ic-deliver/app/base/db/impl/bizchance/deliverybillDao.js
View file @
7cfbb929
...
...
@@ -83,7 +83,7 @@ class DeliverybillDao extends Dao {
}
/* 更新业务员/交付员信息*/
async
updateSalesmanInfoByDeliverCode
(
qobj
,
t
)
{
async
updateSalesmanInfoByDeliverCode
(
qobj
)
{
const
setobj
=
{};
if
(
qobj
.
type
==
'salesman'
)
{
if
(
qobj
.
salesmanId
&&
qobj
.
salesmanId
!=
'undefined'
)
{
...
...
@@ -116,8 +116,13 @@ class DeliverybillDao extends Dao {
if
(
qobj
.
facilitatorName
&&
qobj
.
facilitatorName
!=
'undefined'
)
{
setobj
.
facilitator_name
=
qobj
.
facilitatorName
;
};
const
whereobj
=
{
delivery_code
:
qobj
.
deliverNumber
};
const
result
=
await
this
.
updateByWhere
(
setobj
,
whereobj
,
t
);
let
whereobj
=
{
delivery_code
:
qobj
.
deliverNumber
}
if
(
qobj
.
masterSourceNumber
)
{
whereobj
=
{
master_source_number
:
qobj
.
masterSourceNumber
}
}
const
result
=
await
this
.
updateByWhere
(
setobj
,
whereobj
);
return
result
;
}
...
...
ic-deliver/app/base/service/impl/bizchance/deliverybillSve.js
View file @
7cfbb929
...
...
@@ -206,10 +206,8 @@ class DeliverybillService extends ServiceBase {
/* 更新业务员信息*/
async
updateSalesmanInfoByDeliverCode
(
qobj
)
{
const
self
=
this
;
return
self
.
db
.
transaction
(
async
(
t
)
=>
{
const
result
=
await
self
.
dao
.
updateSalesmanInfoByDeliverCode
(
qobj
,
t
);
return
result
;
});
const
result
=
await
self
.
dao
.
updateSalesmanInfoByDeliverCode
(
qobj
);
return
result
;
}
async
updateInfoByDeliverCode
(
qobj
)
{
//* 更新交付单信息 */
console
.
log
(
'--------------------------------------------------------------------------------------------------------------------------------------'
);
...
...
@@ -250,5 +248,14 @@ class DeliverybillService extends ServiceBase {
return
system
.
getResultSuccess
();
});
}
findOrderByMasterNumber
(
masterSourceNumber
)
{
return
this
.
dao
.
model
.
findAll
({
where
:
{
master_source_number
:
masterSourceNumber
},
attributes
:
[
"id"
,
"delivery_code"
]
})
}
}
module
.
exports
=
DeliverybillService
;
ic-deliver/app/base/utils/logClient.js
View file @
7cfbb929
...
...
@@ -8,7 +8,7 @@ class LogClient {
const
u
=
uuid
.
replace
(
/-/g
,
''
);
return
u
;
}
async
log
(
pobj
,
req
,
rtninfo
,
errinfo
)
{
async
log
(
pobj
,
req
,
rtninfo
=
{}
,
errinfo
)
{
rtninfo
.
requestId
=
this
.
getUUID
();
req
.
params
.
param
=
pobj
;
// 第三个字段应该存公司id
...
...
ic-deliver/app/config/routes/api.js
View file @
7cfbb929
...
...
@@ -22,7 +22,8 @@ module.exports = function (app) {
if
(
invokeObj
.
doexec
)
{
p
=
invokeObj
.
doexec
.
apply
(
invokeObj
,
params
);
p
.
then
((
r
)
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
// res.end(JSON.stringify(r));
res
.
json
(
r
)
});
}
});
...
...
@@ -49,7 +50,8 @@ module.exports = function (app) {
if
(
invokeObj
.
doexec
)
{
p
=
invokeObj
.
doexec
.
apply
(
invokeObj
,
params
);
p
.
then
((
r
)
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
// res.end(JSON.stringify(r));
res
.
json
(
r
)
});
}
});
...
...
ic-deliver/app/config/routes/web.js
View file @
7cfbb929
...
...
@@ -17,7 +17,8 @@ module.exports = function (app) {
if
(
invokeObj
.
doexec
)
{
p
=
invokeObj
.
doexec
.
apply
(
invokeObj
,
params
);
p
.
then
((
r
)
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
// res.end(JSON.stringify(r));
res
.
json
(
r
)
});
}
});
...
...
@@ -41,7 +42,8 @@ module.exports = function (app) {
if
(
invokeObj
.
doexec
)
{
p
=
invokeObj
.
doexec
.
apply
(
invokeObj
,
params
);
p
.
then
((
r
)
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
// res.end(JSON.stringify(r));
res
.
json
(
r
)
});
}
});
...
...
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