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
9cf7636e
Commit
9cf7636e
authored
Jun 16, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ic-deliver' of gitlab.gongsibao.com:jiangyong/zhichan into ic-deliver
parents
0755a53d
e8f81609
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
3 deletions
+47
-3
ic-deliver/app/base/controller/ctl.base.js
+1
-0
ic-deliver/app/base/controller/impl/bizchance/bizoptCtl.js
+4
-0
ic-deliver/app/base/controller/impl/bizchance/deliverybillCtl.js
+7
-3
ic-deliver/app/base/controller/impl/bizchance/settlebillCtl.js
+16
-0
ic-deliver/app/base/db/impl/common/connection.js
+3
-0
ic-deliver/app/base/db/models/delivery/settlebill.js
+0
-0
ic-deliver/app/base/service/impl/bizchance/deliverybillSve.js
+16
-0
No files found.
ic-deliver/app/base/controller/ctl.base.js
View file @
9cf7636e
...
...
@@ -82,6 +82,7 @@ class CtlBase {
}
if
(
req
.
xctx
.
userid
)
{
//在请求传递数据对象注入公司id
pobj
.
userid
=
req
.
xctx
.
userid
;
pobj
.
username
=
req
.
xctx
.
username
}
pobj
.
bizpath
=
req
.
xctx
.
bizpath
;
}
...
...
ic-deliver/app/base/controller/impl/bizchance/bizoptCtl.js
View file @
9cf7636e
...
...
@@ -31,6 +31,10 @@ class BizOptCtl extends CtlBase {
robj
.
business_info_phone
=
element
.
business_info
.
contactsPhone
;
//联系电话
robj
.
business_status
=
element
.
business_status
;
//商机当前状态
robj
.
updated_at
=
this
.
timeFormat
(
element
.
updated_at
);
//商机当前状态日期
robj
.
servicerName
=
element
.
facilitator_name
;
robj
.
sourceName
=
element
.
source_name
;
//渠道来源
rarr
.
push
(
robj
);
});
rs
.
results
.
rows
=
rarr
;
...
...
ic-deliver/app/base/controller/impl/bizchance/deliverybillCtl.js
View file @
9cf7636e
...
...
@@ -27,9 +27,11 @@ class DeliverybillCtl extends CtlBase {
robj
.
businessType
=
element
.
product_code
;
//产品编码
robj
.
sourceName
=
element
.
source_name
;
//渠道来源
robj
.
channelNumber
=
element
.
source_number
;
//渠道编码
robj
.
servicerName
=
element
.
facilitator_name
;
robj
.
baseInfo
=
element
.
delivery_info
;
//交付单详情
robj
.
payStatus
=
element
.
delivery_info
.
payStatus
;
//交付状态
robj
.
costPrice
=
element
.
cost_price
;
//成本
robj
.
settleStatus
=
element
.
settle_status
;
if
(
robj
.
businessName
==
'公司注册'
){
if
(
robj
.
baseInfo
.
isWhether
==
"是"
||
robj
.
baseInfo
.
isVirtual
==
"是"
){
//如果有刻章需求或者是虚拟地址
robj
.
relatedProducts
=
'有'
;
...
...
@@ -224,9 +226,11 @@ class DeliverybillCtl extends CtlBase {
}
async
settleApply
(
p
,
q
,
req
){
let
ids
=
p
.
ids
let
rtn
=
await
this
.
service
.
settleApply
(
ids
,
req
.
userid
,
req
.
username
)
return
system
.
getResult
({})
}
/*根据商机编号插入交付单信息*/
async
insertInfo
(
pobj
,
qobj
,
req
){
//队列的时候用
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
&&
pobj
.
schemeNumber
&&
pobj
.
schemeNumber
!=
'undefined'
...
...
ic-deliver/app/base/controller/impl/bizchance/settlebillCtl.js
0 → 100644
View file @
9cf7636e
var
system
=
require
(
"../../../system"
);
const
http
=
require
(
"http"
);
const
querystring
=
require
(
'querystring'
);
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
moment
=
require
(
'moment'
);
const
appconfig
=
system
.
getSysConfig
();
class
SettleBillCtl
extends
CtlBase
{
constructor
()
{
super
(
"bizchance"
,
CtlBase
.
getServiceName
(
BizOptCtl
));
this
.
deliverService
=
system
.
getObject
(
"service.bizchance.deliverybillSve"
);
}
}
module
.
exports
=
SettleBillCtl
;
ic-deliver/app/base/db/impl/common/connection.js
View file @
9cf7636e
...
...
@@ -67,6 +67,9 @@ class DbFactory {
this
.
db
.
models
.
scheme
.
belongsTo
(
this
.
db
.
models
.
bizopt
,
{
constraints
:
false
,
});
this
.
db
.
models
.
bizopt
.
hasOne
(
this
.
db
.
models
.
scheme
,
{
constraints
:
false
,
});
//交付单关联结算单
this
.
db
.
models
.
deliverybill
.
belongsTo
(
this
.
db
.
models
.
settlebill
,
{
constraints
:
false
,
});
}
//async getCon(){,用于使用替换table模型内字段数据使用
getCon
()
{
...
...
ic-deliver/app/base/db/models/delivery/settle
_
bill.js
→
ic-deliver/app/base/db/models/delivery/settlebill.js
View file @
9cf7636e
File moved
ic-deliver/app/base/service/impl/bizchance/deliverybillSve.js
View file @
9cf7636e
...
...
@@ -6,6 +6,22 @@ class DeliverybillService extends ServiceBase {
constructor
()
{
super
(
"bizchance"
,
ServiceBase
.
getDaoName
(
DeliverybillService
));
}
async
settleApply
(
ids
,
uid
,
uname
){
var
self
=
this
return
this
.
db
.
transaction
(
async
function
(
t
){
//先按照ids查询出交付单的合计服务成本
let
settleAmount
=
await
self
.
dao
.
model
.
findSum
(
"cost_price"
,{
where
:{[
self
.
db
.
Op
.
In
]:
ids
},
transaction
:
t
})
let
settlecode
=
await
self
.
getBusUid
(
"JSD"
)
let
settleObj
=
{
code
:
settlecode
,
settle_amount
:
settleAmount
,
}
//生成结算单,结算单状态为待审核
await
self
.
db
.
models
.
settlebill
.
create
(
settleObj
,{
transaction
:
t
})
//然后按照ids更新交付单的状态为结算中,更新结算单的id到交付单表
});
}
async
findAndCountAll
(
obj
)
{
var
self
=
this
;
const
apps
=
await
this
.
dao
.
findAndCountAll
(
obj
);
...
...
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