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
6f3412a1
Commit
6f3412a1
authored
Jun 28, 2020
by
sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 统计 分组 年月日
parent
0739419f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
215 additions
and
148 deletions
+215
-148
ic-deliver/app/base/api/impl/bizDeliver/bizChance.js
+15
-12
ic-deliver/app/base/api/impl/bizDeliver/deliver.js
+16
-13
ic-deliver/app/base/controller/impl/bizchance/bizoptCtl.js
+63
-57
ic-deliver/app/base/controller/impl/bizchance/deliverybillCtl.js
+20
-11
ic-deliver/app/base/db/impl/bizchance/bizoptDao.js
+8
-8
ic-deliver/app/base/service/impl/bizchance/bizoptSve.js
+58
-47
ic-deliver/app/base/service/impl/bizchance/deliverybillSve.js
+0
-0
ic-deliver/app/base/service/impl/bizchance/schemeSve.js
+1
-0
ic-deliver/app/base/utils/dateClient.js
+34
-0
No files found.
ic-deliver/app/base/api/impl/bizDeliver/bizChance.js
View file @
6f3412a1
...
@@ -4,7 +4,8 @@ var settings = require("../../../../config/settings");
...
@@ -4,7 +4,8 @@ var settings = require("../../../../config/settings");
class
BizChanceAPI
extends
APIBase
{
class
BizChanceAPI
extends
APIBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
bizChanceS
=
system
.
getObject
(
"service.bizchance.bizoptSve"
)
this
.
bizChanceS
=
system
.
getObject
(
"service.bizchance.bizoptSve"
);
this
.
dateUtil
=
system
.
getObject
(
"util.dateClient"
);
}
}
/**
/**
* 按照服务商进行分组统计
* 按照服务商进行分组统计
...
@@ -13,11 +14,12 @@ class BizChanceAPI extends APIBase {
...
@@ -13,11 +14,12 @@ class BizChanceAPI extends APIBase {
* @param {*} req
* @param {*} req
*/
*/
async
statBizChanceCountBySp
(
p
,
q
,
req
){
async
statBizChanceCountBySp
(
p
,
q
,
req
)
{
let
bizStatus
=
p
.
bizStatus
let
bizStatus
=
p
.
bizStatus
let
rtn
=
await
this
.
bizChanceS
.
statBizChanceCountBySp
(
bizStatus
)
let
betweenTime
=
this
.
dateUtil
.
betweenTime
(
p
.
dateType
);
return
system
.
getResult
(
rtn
)
let
rtn
=
await
this
.
bizChanceS
.
statBizChanceCountBySp
(
bizStatus
,
betweenTime
)
}
return
system
.
getResult
(
rtn
)
}
/**
/**
* 待处理商机beforeSubmission
* 待处理商机beforeSubmission
...
@@ -27,12 +29,13 @@ class BizChanceAPI extends APIBase {
...
@@ -27,12 +29,13 @@ class BizChanceAPI extends APIBase {
* @param {*} q
* @param {*} q
* @param {*} req
* @param {*} req
*/
*/
async
statBizChance
(
p
,
q
,
req
){
async
statBizChance
(
p
,
q
,
req
)
{
let
companyId
=
p
.
company_id
let
companyId
=
p
.
company_id
let
userid
=
p
.
userid
let
userid
=
p
.
userid
let
username
=
p
.
username
let
username
=
p
.
username
let
opath
=
p
.
opath
let
opath
=
p
.
opath
let
rtn
=
await
this
.
bizChanceS
.
statBizChance
(
companyId
,
opath
,
username
,
userid
)
let
betweenTime
=
this
.
dateUtil
.
betweenTime
(
p
.
dateType
);
let
rtn
=
await
this
.
bizChanceS
.
statBizChance
(
companyId
,
opath
,
username
,
userid
,
betweenTime
);
return
system
.
getResult
(
rtn
)
return
system
.
getResult
(
rtn
)
}
}
classDesc
()
{
classDesc
()
{
...
...
ic-deliver/app/base/api/impl/bizDeliver/deliver.js
View file @
6f3412a1
...
@@ -4,16 +4,18 @@ var settings = require("../../../../config/settings");
...
@@ -4,16 +4,18 @@ var settings = require("../../../../config/settings");
class
BizDeliverAPI
extends
APIBase
{
class
BizDeliverAPI
extends
APIBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
bizDeliveryS
=
system
.
getObject
(
"service.bizchance.deliverybillSve"
)
this
.
bizDeliveryS
=
system
.
getObject
(
"service.bizchance.deliverybillSve"
)
this
.
dateUtil
=
system
.
getObject
(
"util.dateClient"
);
}
}
async
statBizDeliveryCountBySp
(
p
,
q
,
req
){
async
statBizDeliveryCountBySp
(
p
,
q
,
req
)
{
let
bizStatus
=
p
.
bizStatus
let
bizStatus
=
p
.
bizStatus
;
let
rtn
=
await
this
.
bizDeliveryS
.
statBizDeliveryCountBySp
(
bizStatus
)
let
betweenTime
=
this
.
dateUtil
.
betweenTime
(
p
.
dateType
);
let
rtn
=
await
this
.
bizDeliveryS
.
statBizDeliveryCountBySp
(
bizStatus
,
betweenTime
)
return
system
.
getResult
(
rtn
)
return
system
.
getResult
(
rtn
)
}
}
async
statBizDeliverySettleAmountBySp
(
p
,
q
,
req
)
{
async
statBizDeliverySettleAmountBySp
(
p
,
q
,
req
)
{
let
bizStatus
=
p
.
bizStatus
let
bizStatus
=
p
.
bizStatus
let
rtn
=
await
this
.
bizDeliveryS
.
statBizDeliverySettleAmountBySp
(
bizStatus
)
let
rtn
=
await
this
.
bizDeliveryS
.
statBizDeliverySettleAmountBySp
(
bizStatus
)
return
system
.
getResult
(
rtn
)
return
system
.
getResult
(
rtn
)
}
}
/**
/**
...
@@ -24,12 +26,13 @@ class BizDeliverAPI extends APIBase {
...
@@ -24,12 +26,13 @@ class BizDeliverAPI extends APIBase {
* @param {*} q
* @param {*} q
* @param {*} req
* @param {*} req
*/
*/
async
statBizDelivery
(
p
,
q
,
req
){
async
statBizDelivery
(
p
,
q
,
req
)
{
let
companyId
=
p
.
company_id
let
companyId
=
p
.
company_id
let
userid
=
p
.
userid
let
userid
=
p
.
userid
let
username
=
p
.
username
let
username
=
p
.
username
let
opath
=
p
.
opath
let
opath
=
p
.
opath
let
rtn
=
await
this
.
bizDeliveryS
.
statBizDelivery
(
companyId
,
opath
,
username
,
userid
)
let
betweenTime
=
this
.
dateUtil
.
betweenTime
(
p
.
dateType
);
let
rtn
=
await
this
.
bizDeliveryS
.
statBizDelivery
(
companyId
,
opath
,
username
,
userid
,
betweenTime
)
return
system
.
getResult
(
rtn
)
return
system
.
getResult
(
rtn
)
}
}
classDesc
()
{
classDesc
()
{
...
...
ic-deliver/app/base/controller/impl/bizchance/bizoptCtl.js
View file @
6f3412a1
...
@@ -12,6 +12,7 @@ class BizOptCtl extends CtlBase {
...
@@ -12,6 +12,7 @@ class BizOptCtl extends CtlBase {
this
.
logService
=
system
.
getObject
(
"service.bizchance.statuslogSve"
);
this
.
logService
=
system
.
getObject
(
"service.bizchance.statuslogSve"
);
this
.
receiveUrl
=
"http://192.168.1.140:4011/api/receive/entService/springBoard"
;
this
.
receiveUrl
=
"http://192.168.1.140:4011/api/receive/entService/springBoard"
;
this
.
queueUrl
=
"http://192.168.1.128:4018/api/queueAction/producer/springBoard"
;
this
.
queueUrl
=
"http://192.168.1.128:4018/api/queueAction/producer/springBoard"
;
this
.
dateUtil
=
system
.
getObject
(
"util.dateClient"
);
}
}
/*根据用户id获取商机信息,分页获取*/
/*根据用户id获取商机信息,分页获取*/
...
@@ -19,7 +20,13 @@ class BizOptCtl extends CtlBase {
...
@@ -19,7 +20,13 @@ class BizOptCtl extends CtlBase {
try
{
try
{
//TODO 根据业务员id获取该业务员所有列表
//TODO 根据业务员id获取该业务员所有列表
//设置查询条件
//设置查询条件
console
.
log
(
"pobj--"
,
pobj
)
console
.
log
(
"pobj--"
,
pobj
)
if
(
pobj
.
search
&&
pobj
.
search
.
dateType
)
{
if
(
pobj
.
search
.
dateType
!==
'全部'
)
{
pobj
.
search
.
created_at
=
this
.
dateUtil
.
betweenTime
(
pobj
.
search
.
dateType
);
}
delete
pobj
.
search
.
dateType
}
const
rs
=
await
this
.
service
.
findAndCountAll
(
pobj
);
const
rs
=
await
this
.
service
.
findAndCountAll
(
pobj
);
let
rarr
=
[];
let
rarr
=
[];
let
results
=
rs
.
results
.
rows
;
let
results
=
rs
.
results
.
rows
;
...
@@ -48,47 +55,46 @@ class BizOptCtl extends CtlBase {
...
@@ -48,47 +55,46 @@ class BizOptCtl extends CtlBase {
}
}
/*根据商机编号获取商机详情*/
/*根据商机编号获取商机详情*/
async
findInfoByDemandCode
(
mobj
,
qobj
,
req
)
{
async
findInfoByDemandCode
(
mobj
,
qobj
,
req
)
{
var
pobj
=
mobj
.
d
;
var
pobj
=
mobj
.
d
;
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
)
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
)
{
{
try
{
try
{
var
rs
=
await
this
.
service
.
findInfoByDemandCode
(
pobj
);
var
rs
=
await
this
.
service
.
findInfoByDemandCode
(
pobj
);
var
ms
=
await
this
.
schemeService
.
findInfoByDemandCode
(
pobj
);
var
ms
=
await
this
.
schemeService
.
findInfoByDemandCode
(
pobj
);
var
rarr
=
{}
var
rarr
=
{}
if
(
rs
){
if
(
rs
)
{
var
statusInfo
=
{
"currentStatus"
:
rs
.
business_status
};
//商机状态
var
statusInfo
=
{
"currentStatus"
:
rs
.
business_status
};
//商机状态
var
businessInfo
=
{};
var
businessInfo
=
{};
businessInfo
.
businessMode
=
rs
.
demand_code
;
//商机编号
businessInfo
.
businessMode
=
rs
.
demand_code
;
//商机编号
businessInfo
.
channelSource
=
appconfig
.
pdict
.
source
[
rs
.
source_name
];
///渠道来源
businessInfo
.
channelSource
=
appconfig
.
pdict
.
source
[
rs
.
source_name
];
///渠道来源
// businessInfo.businessType = rs.business_type;//商机类型代码
// businessInfo.businessType = rs.business_type;//商机类型代码
businessInfo
.
businessType
=
appconfig
.
pdict
.
businessType
[
rs
.
business_type
];
//商机类型名称
businessInfo
.
businessType
=
appconfig
.
pdict
.
businessType
[
rs
.
business_type
];
//商机类型名称
// businessInfo.serviceArea = rs.service_address;//服务地区
// businessInfo.serviceArea = rs.service_address;//服务地区
if
(
businessInfo
.
businessName
==
"云上园区注册"
){
if
(
businessInfo
.
businessName
==
"云上园区注册"
)
{
businessInfo
.
serviceArea
=
appconfig
.
pdict
.
registeredParkDict
[
rs
.
service_address
];
//服务地区名称
businessInfo
.
serviceArea
=
appconfig
.
pdict
.
registeredParkDict
[
rs
.
service_address
];
//服务地区名称
}
}
else
{
else
{
businessInfo
.
serviceArea
=
appconfig
.
pdict
.
registeredAreaDict
[
rs
.
service_address
];
//服务地区名称
businessInfo
.
serviceArea
=
appconfig
.
pdict
.
registeredAreaDict
[
rs
.
service_address
];
//服务地区名称
}
}
if
(
businessInfo
.
businessName
==
"注册地址"
){
if
(
businessInfo
.
businessName
==
"注册地址"
)
{
businessInfo
.
registeredAddress
=
appconfig
.
pdict
.
registeredAreaDict
[
rs
.
service_address
];
//注册地址名称
businessInfo
.
registeredAddress
=
appconfig
.
pdict
.
registeredAreaDict
[
rs
.
service_address
];
//注册地址名称
}
}
businessInfo
.
statusReason
=
rs
.
close_reason
;
//商机关闭原因
businessInfo
.
statusReason
=
rs
.
close_reason
;
//商机关闭原因
businessInfo
.
memoInfo
=
rs
.
business_info
.
memoInfo
;
//备注信息
businessInfo
.
memoInfo
=
rs
.
business_info
.
memoInfo
;
//备注信息
businessInfo
.
contactsName
=
rs
.
business_info
.
contactsName
;
//联系人名称
businessInfo
.
contactsName
=
rs
.
business_info
.
contactsName
;
//联系人名称
businessInfo
.
contactsPhone
=
rs
.
business_info
.
contactsPhone
;
//联系人联系方式
businessInfo
.
contactsPhone
=
rs
.
business_info
.
contactsPhone
;
//联系人联系方式
businessInfo
.
createdTime
=
this
.
timeFormat
(
rs
.
created_at
);
//商机创建时间
businessInfo
.
createdTime
=
this
.
timeFormat
(
rs
.
created_at
);
//商机创建时间
rarr
.
statusInfo
=
statusInfo
;
rarr
.
statusInfo
=
statusInfo
;
rarr
.
businessInfo
=
businessInfo
;
rarr
.
businessInfo
=
businessInfo
;
}
}
if
(
ms
){
if
(
ms
)
{
var
planInfo
=
ms
.
scheme_info
;
var
planInfo
=
ms
.
scheme_info
;
planInfo
.
schemeNumber
=
ms
.
scheme_number
;
planInfo
.
schemeNumber
=
ms
.
scheme_number
;
planInfo
.
currentStatus
=
ms
.
scheme_status
;
planInfo
.
currentStatus
=
ms
.
scheme_status
;
if
(
ms
.
scheme_status
&&
ms
.
scheme_status
==
"isReject"
)
{
if
(
ms
.
scheme_status
&&
ms
.
scheme_status
==
"isReject"
)
{
planInfo
.
currentStatus
=
"已退回"
;
planInfo
.
currentStatus
=
"已退回"
;
}
}
else
{
else
{
planInfo
.
currentStatus
=
ms
.
scheme_status
;
planInfo
.
currentStatus
=
ms
.
scheme_status
;
}
}
planInfo
.
statusReason
=
ms
.
reject_reason
;
planInfo
.
statusReason
=
ms
.
reject_reason
;
...
@@ -96,103 +102,103 @@ class BizOptCtl extends CtlBase {
...
@@ -96,103 +102,103 @@ class BizOptCtl extends CtlBase {
}
}
return
system
.
getResult
(
rarr
);
return
system
.
getResult
(
rarr
);
}
}
catch
(
error
)
{
catch
(
error
)
{
console
.
log
(
"eeeeeeeeeeeeeeeeeeeeee"
);
console
.
log
(
"eeeeeeeeeeeeeeeeeeeeee"
);
console
.
log
(
error
);
console
.
log
(
error
);
return
system
.
getResultError
(
error
);
return
system
.
getResultError
(
error
);
}
}
}
}
else
{
else
{
return
system
.
getResultError
(
"参数错误!"
);
return
system
.
getResultError
(
"参数错误!"
);
}
}
}
}
/*根据商机编号更新商机状态*/
/*根据商机编号更新商机状态*/
async
updateStatusByDemandCode
(
mobj
,
qobj
,
req
)
{
async
updateStatusByDemandCode
(
mobj
,
qobj
,
req
)
{
var
pobj
=
mobj
.
d
;
var
pobj
=
mobj
.
d
;
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
&&
pobj
.
currentStatus
&&
pobj
.
currentStatus
!=
'undefined'
){
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
&&
pobj
.
currentStatus
&&
pobj
.
currentStatus
!=
'undefined'
)
{
try
{
try
{
await
this
.
service
.
updateStatusByDemandCode
(
pobj
);
await
this
.
service
.
updateStatusByDemandCode
(
pobj
);
await
this
.
schemeService
.
updateStatusByDemandCode
(
pobj
);
//同时更新方案的状态
await
this
.
schemeService
.
updateStatusByDemandCode
(
pobj
);
//同时更新方案的状态
var
res
=
this
.
service
.
findInfoByDemandCode
(
pobj
);
var
res
=
this
.
service
.
findInfoByDemandCode
(
pobj
);
if
(
res
&&
res
!=
'undefined'
){
if
(
res
&&
res
!=
'undefined'
)
{
var
logInfo
=
{
var
logInfo
=
{
"flowType"
:
"BIZ"
,
"flowType"
:
"BIZ"
,
"flowId"
:
res
.
id
,
"flowId"
:
res
.
id
,
"statusCode"
:
pobj
.
currentStatus
,
"statusCode"
:
pobj
.
currentStatus
,
"statusReason"
:
res
.
close_reason
,
"statusReason"
:
res
.
close_reason
,
"clerkName"
:
res
.
salesman_name
,
"clerkName"
:
res
.
salesman_name
,
"clerkId"
:
res
.
salesman_id
"clerkId"
:
res
.
salesman_id
}
}
await
this
.
logService
.
insertInfo
(
logInfo
);
//插入状态日至表
await
this
.
logService
.
insertInfo
(
logInfo
);
//插入状态日至表
}
}
if
(
pobj
.
currentStatus
==
"isClosed"
){
//关闭需求时调用
if
(
pobj
.
currentStatus
==
"isClosed"
)
{
//关闭需求时调用
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
requrl
=
this
.
queueUrl
;
var
requrl
=
this
.
queueUrl
;
var
params
=
{
var
params
=
{
"actionType"
:
"produceData"
,
"actionType"
:
"produceData"
,
"actionBody"
:{
"actionBody"
:
{
"pushUrl"
:
this
.
receiveUrl
,
"pushUrl"
:
this
.
receiveUrl
,
"actionType"
:
"closeNeed"
,
"actionType"
:
"closeNeed"
,
"identifyCode"
:
"ic-manage"
,
"identifyCode"
:
"ic-manage"
,
"messageBody"
:{
"messageBody"
:
{
"needNum"
:
pobj
.
businessMode
,
"needNum"
:
pobj
.
businessMode
,
"note"
:
pobj
.
statusReason
"note"
:
pobj
.
statusReason
}
}
}
}
}
}
var
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
1
){
if
(
j
.
status
==
1
)
{
return
system
.
getResult
(
"操作成功!"
);
return
system
.
getResult
(
"操作成功!"
);
}
}
else
{
else
{
return
system
.
getResultError
(
"更新方案状态出错!"
);
return
system
.
getResultError
(
"更新方案状态出错!"
);
}
}
}
}
}
}
catch
(
error
){
catch
(
error
)
{
return
system
.
getResultError
(
error
);
return
system
.
getResultError
(
error
);
}
}
}
}
else
{
else
{
return
system
.
getResultError
(
"参数错误!"
);
return
system
.
getResultError
(
"参数错误!"
);
}
}
}
}
/*插入数据信息 */
/*插入数据信息 */
async
insertInfo
(
nobj
,
qobj
,
req
)
{
async
insertInfo
(
nobj
,
qobj
,
req
)
{
var
pobj
=
nobj
.
d
;
var
pobj
=
nobj
.
d
;
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
&&
pobj
.
businessType
&&
pobj
.
businessType
!=
'undefined'
){
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
&&
pobj
.
businessType
&&
pobj
.
businessType
!=
'undefined'
)
{
try
{
try
{
pobj
.
currentStatus
=
"beforeSubmission"
;
//加上当前状态为待提交方案
pobj
.
currentStatus
=
"beforeSubmission"
;
//加上当前状态为待提交方案
pobj
.
channelSource
=
"tencentCloud"
;
//目前渠道只有腾讯
pobj
.
channelSource
=
"tencentCloud"
;
//目前渠道只有腾讯
pobj
.
sourceNumber
=
"1111111"
;
pobj
.
sourceNumber
=
"1111111"
;
pobj
.
businessType
=
appconfig
.
pdict
.
dyDict
[
pobj
.
businessType
];
pobj
.
businessType
=
appconfig
.
pdict
.
dyDict
[
pobj
.
businessType
];
var
buInfo
=
await
this
.
service
.
insertInfo
(
pobj
);
var
buInfo
=
await
this
.
service
.
insertInfo
(
pobj
);
var
logInfo
=
{
var
logInfo
=
{
"flowType"
:
"BIZ"
,
"flowType"
:
"BIZ"
,
"flowId"
:
buInfo
.
id
,
"flowId"
:
buInfo
.
id
,
"statusCode"
:
pobj
.
currentStatus
,
"statusCode"
:
pobj
.
currentStatus
,
"clerkName"
:
pobj
.
clerkName
,
"clerkName"
:
pobj
.
clerkName
,
"clerkId"
:
pobj
.
salesmanId
"clerkId"
:
pobj
.
salesmanId
}
}
await
this
.
logService
.
insertInfo
(
logInfo
);
//插入状态日至表
await
this
.
logService
.
insertInfo
(
logInfo
);
//插入状态日至表
return
{
return
{
"status"
:
1
,
//1代表成功,否则失败
"status"
:
1
,
//1代表成功,否则失败
"message"
:
"操作成功"
,
"message"
:
"操作成功"
,
"data"
:
""
,
"data"
:
""
,
"requestId"
:
""
"requestId"
:
""
};
};
}
}
catch
(
error
)
{
catch
(
error
)
{
console
.
log
(
"TTTTTTTTTTTTTTTTTTTTTTT"
);
console
.
log
(
"TTTTTTTTTTTTTTTTTTTTTTT"
);
console
.
log
(
error
);
console
.
log
(
error
);
return
system
.
getResultError
(
error
);
return
system
.
getResultError
(
error
);
}
}
}
}
else
{
else
{
return
system
.
getResultError
(
"参数错误!"
);
return
system
.
getResultError
(
"参数错误!"
);
}
}
}
}
...
...
ic-deliver/app/base/controller/impl/bizchance/deliverybillCtl.js
View file @
6f3412a1
...
@@ -15,12 +15,20 @@ class DeliverybillCtl extends CtlBase {
...
@@ -15,12 +15,20 @@ class DeliverybillCtl extends CtlBase {
this
.
receiveUrl
=
"http://192.168.1.140:4011/api/receive/entService/springBoard"
;
this
.
receiveUrl
=
"http://192.168.1.140:4011/api/receive/entService/springBoard"
;
this
.
queueUrl
=
"http://192.168.1.128:4018/api/queueAction/producer/springBoard"
;
this
.
queueUrl
=
"http://192.168.1.128:4018/api/queueAction/producer/springBoard"
;
this
.
wdyUrl
=
"http://192.168.1.113:4011/api/action/order/springBoard"
;
this
.
wdyUrl
=
"http://192.168.1.113:4011/api/action/order/springBoard"
;
this
.
dateUtil
=
system
.
getObject
(
"util.dateClient"
);
}
}
/*根据用户id获取商机信息,分页获取*/
/*根据用户id获取商机信息,分页获取*/
async
findAndCountAll
(
pobj
,
qobj
,
req
)
{
async
findAndCountAll
(
pobj
,
qobj
,
req
)
{
try
{
try
{
//TODO 根据业务员id获取该业务员所有交付单列表
//TODO 根据业务员id获取该业务员所有交付单列表
if
(
pobj
.
search
&&
pobj
.
search
.
dateType
)
{
if
(
pobj
.
search
.
dateType
!==
'全部'
)
{
pobj
.
search
.
created_at
=
this
.
dateUtil
.
betweenTime
(
pobj
.
search
.
dateType
);
}
delete
pobj
.
search
.
dateType
}
const
rs
=
await
this
.
service
.
findAndCountAll
(
pobj
);
const
rs
=
await
this
.
service
.
findAndCountAll
(
pobj
);
let
rarr
=
[];
let
rarr
=
[];
let
results
=
rs
.
results
.
rows
;
let
results
=
rs
.
results
.
rows
;
...
@@ -51,7 +59,7 @@ class DeliverybillCtl extends CtlBase {
...
@@ -51,7 +59,7 @@ class DeliverybillCtl extends CtlBase {
}
}
else
if
(
robj
.
businessName
==
'云上园区注册'
)
{
else
if
(
robj
.
businessName
==
'云上园区注册'
)
{
robj
.
registeredType
=
element
.
delivery_info
.
registeredType
;
//园区注册时,根据该值跳界面
robj
.
registeredType
=
element
.
delivery_info
.
registeredType
;
//园区注册时,根据该值跳界面
if
(
robj
.
baseInfo
.
isWhether
==
"yes"
||
robj
.
baseInfo
.
financial
==
"yes"
)
{
//如果有刻章需求或者是财税服务
if
(
robj
.
baseInfo
.
isWhether
==
"yes"
||
robj
.
baseInfo
.
financial
==
"yes"
)
{
//如果有刻章需求或者是财税服务
robj
.
relatedProducts
=
'有'
;
robj
.
relatedProducts
=
'有'
;
}
}
else
{
else
{
...
@@ -74,6 +82,7 @@ class DeliverybillCtl extends CtlBase {
...
@@ -74,6 +82,7 @@ class DeliverybillCtl extends CtlBase {
rs
.
results
.
rows
=
rarr
;
rs
.
results
.
rows
=
rarr
;
return
system
.
getResult
(
rs
);
return
system
.
getResult
(
rs
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
return
system
.
getResultError
(
error
);
return
system
.
getResultError
(
error
);
}
}
}
}
...
@@ -184,9 +193,9 @@ class DeliverybillCtl extends CtlBase {
...
@@ -184,9 +193,9 @@ class DeliverybillCtl extends CtlBase {
rarr
.
baseInfo
.
startTime
=
rs
.
delivery_info
.
startTime
;
//开始计费时间
rarr
.
baseInfo
.
startTime
=
rs
.
delivery_info
.
startTime
;
//开始计费时间
}
}
if
(
rs
.
delivery_info
.
buyDuration
&&
rs
.
delivery_info
.
buyDuration
!=
'undefined'
&&
rarr
.
baseInfo
.
startTime
&&
rarr
.
baseInfo
.
startTime
!=
'undefined'
)
{
if
(
rs
.
delivery_info
.
buyDuration
&&
rs
.
delivery_info
.
buyDuration
!=
'undefined'
&&
rarr
.
baseInfo
.
startTime
&&
rarr
.
baseInfo
.
startTime
!=
'undefined'
)
{
console
.
log
(
"ddddddddddd____________________________"
+
rarr
.
baseInfo
.
startTime
);
console
.
log
(
"ddddddddddd____________________________"
+
rarr
.
baseInfo
.
startTime
);
var
d
=
new
Date
(
rarr
.
baseInfo
.
startTime
);
var
d
=
new
Date
(
rarr
.
baseInfo
.
startTime
);
console
.
log
(
"ddddddddddd____________________________"
+
d
);
console
.
log
(
"ddddddddddd____________________________"
+
d
);
rarr
.
baseInfo
.
endTime
=
this
.
oneYearPast
(
d
,
1
);
//到期时间
rarr
.
baseInfo
.
endTime
=
this
.
oneYearPast
(
d
,
1
);
//到期时间
var
ss
=
moment
();
var
ss
=
moment
();
rarr
.
baseInfo
.
surplusDuration
=
this
.
diffDays
(
ss
,
rarr
.
baseInfo
.
endTime
);
//剩余时长
rarr
.
baseInfo
.
surplusDuration
=
this
.
diffDays
(
ss
,
rarr
.
baseInfo
.
endTime
);
//剩余时长
...
@@ -227,8 +236,8 @@ class DeliverybillCtl extends CtlBase {
...
@@ -227,8 +236,8 @@ class DeliverybillCtl extends CtlBase {
async
updatestartTimeByDeliverCode
(
mobj
,
qobj
,
red
)
{
//根据交付单编号更新开始计费时间
async
updatestartTimeByDeliverCode
(
mobj
,
qobj
,
red
)
{
//根据交付单编号更新开始计费时间
var
pobj
=
mobj
.
d
;
var
pobj
=
mobj
.
d
;
if
(
pobj
.
deliverNumber
&&
pobj
.
deliverNumber
!=
'undefined'
&&
pobj
.
baseInfo
.
startTime
&&
pobj
.
baseInfo
.
startTime
!=
'undefined'
){
if
(
pobj
.
deliverNumber
&&
pobj
.
deliverNumber
!=
'undefined'
&&
pobj
.
baseInfo
.
startTime
&&
pobj
.
baseInfo
.
startTime
!=
'undefined'
)
{
try
{
try
{
var
rs
=
await
this
.
service
.
findInfoByDeliverCode
(
pobj
)
//先得到交付单详情
var
rs
=
await
this
.
service
.
findInfoByDeliverCode
(
pobj
)
//先得到交付单详情
if
(
rs
&&
rs
!=
'undefined'
)
{
if
(
rs
&&
rs
!=
'undefined'
)
{
rs
.
delivery_info
.
startTime
=
pobj
.
baseInfo
.
startTime
;
rs
.
delivery_info
.
startTime
=
pobj
.
baseInfo
.
startTime
;
...
@@ -289,11 +298,11 @@ class DeliverybillCtl extends CtlBase {
...
@@ -289,11 +298,11 @@ class DeliverybillCtl extends CtlBase {
return
system
.
getResultError
(
"数据不存在!"
);
return
system
.
getResultError
(
"数据不存在!"
);
}
}
}
}
catch
(
error
)
{
catch
(
error
)
{
return
system
.
getResultError
(
error
);
return
system
.
getResultError
(
error
);
}
}
}
}
else
{
else
{
return
system
.
getResultError
(
"参数错误!"
);
return
system
.
getResultError
(
"参数错误!"
);
}
}
}
}
...
@@ -324,7 +333,7 @@ class DeliverybillCtl extends CtlBase {
...
@@ -324,7 +333,7 @@ class DeliverybillCtl extends CtlBase {
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j1status
=
1
;
var
j1status
=
1
;
if
(
pobj
.
deliverStatus
==
"closed"
){
//退款
if
(
pobj
.
deliverStatus
==
"closed"
)
{
//退款
params
=
{
params
=
{
"actionType"
:
"produceData"
,
"actionType"
:
"produceData"
,
"actionBody"
:
{
"actionBody"
:
{
...
@@ -781,7 +790,7 @@ class DeliverybillCtl extends CtlBase {
...
@@ -781,7 +790,7 @@ class DeliverybillCtl extends CtlBase {
//time时间n年后的的前一天
//time时间n年后的的前一天
oneYearPast
(
time
,
n
)
{
oneYearPast
(
time
,
n
)
{
//var time=new Date();
//var time=new Date();
try
{
try
{
var
year
=
time
.
getFullYear
()
+
n
;
var
year
=
time
.
getFullYear
()
+
n
;
var
d
=
time
.
setFullYear
(
year
);
var
d
=
time
.
setFullYear
(
year
);
var
date
=
time
.
getDate
(
d
)
-
1
;
var
date
=
time
.
getDate
(
d
)
-
1
;
...
@@ -796,7 +805,7 @@ class DeliverybillCtl extends CtlBase {
...
@@ -796,7 +805,7 @@ class DeliverybillCtl extends CtlBase {
//计算俩日期相差多少天
//计算俩日期相差多少天
diffDays
(
time1
,
time2
)
{
diffDays
(
time1
,
time2
)
{
try
{
try
{
var
m1
=
moment
(
time1
);
var
m1
=
moment
(
time1
);
var
m2
=
moment
(
time2
);
var
m2
=
moment
(
time2
);
return
m2
.
diff
(
m1
,
'day'
);
return
m2
.
diff
(
m1
,
'day'
);
...
@@ -804,7 +813,7 @@ class DeliverybillCtl extends CtlBase {
...
@@ -804,7 +813,7 @@ class DeliverybillCtl extends CtlBase {
catch
{
catch
{
return
""
;
return
""
;
}
}
}
}
}
}
module
.
exports
=
DeliverybillCtl
;
module
.
exports
=
DeliverybillCtl
;
...
...
ic-deliver/app/base/db/impl/bizchance/bizoptDao.js
View file @
6f3412a1
...
@@ -15,7 +15,7 @@ class BizoptDao extends Dao {
...
@@ -15,7 +15,7 @@ class BizoptDao extends Dao {
qw
[
"facilitator_id"
]
=
Number
(
qobj
.
company_id
)
qw
[
"facilitator_id"
]
=
Number
(
qobj
.
company_id
)
// 为空说明是管理员,不需设置组织结构过滤
// 为空说明是管理员,不需设置组织结构过滤
if
(
qobj
.
opath
&&
qobj
.
opath
!=
""
)
{
if
(
qobj
.
opath
&&
qobj
.
opath
!=
""
)
{
qw
[
"salesman_opcode"
]
=
{
[
this
.
db
.
Op
.
like
]:
'%qobj.opath%'
}
qw
[
"salesman_opcode"
]
=
{
[
this
.
db
.
Op
.
like
]:
'%qobj.opath%'
}
}
}
//不是来自平台前端查询
//不是来自平台前端查询
if
(
qobj
.
bizpath
&&
qobj
.
bizpath
.
indexOf
(
"pmx"
)
<
0
)
{
if
(
qobj
.
bizpath
&&
qobj
.
bizpath
.
indexOf
(
"pmx"
)
<
0
)
{
...
@@ -45,7 +45,7 @@ class BizoptDao extends Dao {
...
@@ -45,7 +45,7 @@ class BizoptDao extends Dao {
if
(
qobj
.
statusReason
&&
qobj
.
statusReason
!=
'undefined'
)
{
if
(
qobj
.
statusReason
&&
qobj
.
statusReason
!=
'undefined'
)
{
setobj
[
"close_reason"
]
=
qobj
.
statusReason
;
setobj
[
"close_reason"
]
=
qobj
.
statusReason
;
}
}
else
{
else
{
setobj
[
"close_reason"
]
=
""
;
setobj
[
"close_reason"
]
=
""
;
}
}
var
whereobj
=
{
"demand_code"
:
qobj
.
businessMode
};
var
whereobj
=
{
"demand_code"
:
qobj
.
businessMode
};
...
@@ -58,7 +58,7 @@ class BizoptDao extends Dao {
...
@@ -58,7 +58,7 @@ class BizoptDao extends Dao {
"demand_code"
:
qobj
.
businessMode
,
"demand_code"
:
qobj
.
businessMode
,
"business_type"
:
qobj
.
businessType
,
"business_type"
:
qobj
.
businessType
,
"business_status"
:
qobj
.
currentStatus
,
"business_status"
:
qobj
.
currentStatus
,
"business_info"
:{}
"business_info"
:
{}
};
};
if
(
qobj
.
channelSource
&&
qobj
.
channelSource
!=
'undefined'
)
{
if
(
qobj
.
channelSource
&&
qobj
.
channelSource
!=
'undefined'
)
{
obj
.
source_name
=
qobj
.
channelSource
;
obj
.
source_name
=
qobj
.
channelSource
;
...
@@ -81,16 +81,16 @@ class BizoptDao extends Dao {
...
@@ -81,16 +81,16 @@ class BizoptDao extends Dao {
if
(
qobj
.
contactsPhone
&&
qobj
.
contactsPhone
!=
'undefined'
)
{
if
(
qobj
.
contactsPhone
&&
qobj
.
contactsPhone
!=
'undefined'
)
{
obj
.
business_info
.
contactsPhone
=
qobj
.
contactsPhone
;
obj
.
business_info
.
contactsPhone
=
qobj
.
contactsPhone
;
}
}
if
(
qobj
.
serviceName
&&
qobj
.
serviceName
!=
'undefined'
){
if
(
qobj
.
serviceName
&&
qobj
.
serviceName
!=
'undefined'
)
{
obj
.
business_info
.
serviceName
=
qobj
.
serviceName
;
obj
.
business_info
.
serviceName
=
qobj
.
serviceName
;
}
}
if
(
qobj
.
businessName
&&
qobj
.
businessName
!=
'undefined'
){
if
(
qobj
.
businessName
&&
qobj
.
businessName
!=
'undefined'
)
{
obj
.
business_info
.
businessName
=
qobj
.
businessName
;
obj
.
business_info
.
businessName
=
qobj
.
businessName
;
}
}
if
(
qobj
.
UserName
&&
qobj
.
UserName
!=
'undefined'
){
if
(
qobj
.
UserName
&&
qobj
.
UserName
!=
'undefined'
)
{
obj
.
business_info
.
userName
=
qobj
.
UserNames
;
obj
.
business_info
.
userName
=
qobj
.
UserNames
;
}
}
if
(
qobj
.
companyName
&&
qobj
.
companyName
!=
'undefined'
){
if
(
qobj
.
companyName
&&
qobj
.
companyName
!=
'undefined'
)
{
obj
.
business_info
.
companyName
=
qobj
.
companyName
;
obj
.
business_info
.
companyName
=
qobj
.
companyName
;
}
}
if
(
qobj
.
servicerCode
&&
qobj
.
servicerCode
!=
'undefined'
)
{
if
(
qobj
.
servicerCode
&&
qobj
.
servicerCode
!=
'undefined'
)
{
...
...
ic-deliver/app/base/service/impl/bizchance/bizoptSve.js
View file @
6f3412a1
...
@@ -6,19 +6,22 @@ class BizOptService extends ServiceBase {
...
@@ -6,19 +6,22 @@ class BizOptService extends ServiceBase {
constructor
()
{
constructor
()
{
super
(
"bizchance"
,
ServiceBase
.
getDaoName
(
BizOptService
));
super
(
"bizchance"
,
ServiceBase
.
getDaoName
(
BizOptService
));
}
}
async
statBizChanceCountBySp
(
bizStatus
)
{
async
statBizChanceCountBySp
(
bizStatus
,
betweenTime
)
{
let
params
=
{}
let
params
=
{}
params
.
group
=
{
params
.
group
=
{
byFields
:
[
'facilitator_name'
],
byFields
:
[
'facilitator_name'
],
actionType
:
'count'
,
actionType
:
'count'
,
aggField
:
'id'
,
aggField
:
'id'
,
aliasField
:
' as chanceCount'
,
aliasField
:
' as chanceCount'
,
tblName
:
'bussiness_opportunity'
,
tblName
:
'bussiness_opportunity'
,
where
:
bizStatus
!=
""
?
`where business_status='
${
bizStatus
}
'`
:
''
,
where
:
bizStatus
!=
""
?
`where business_status='
${
bizStatus
}
'`
:
''
,
having
:
''
,
having
:
''
,
}
}
let
s
=
await
this
.
dao
.
statGroupBy
(
params
,
null
)
if
(
betweenTime
.
length
>
0
)
{
return
s
params
.
group
.
where
=
`
${
params
.
group
.
where
}
${
params
.
group
.
where
?
'AND'
:
"WHERE"
}
(created_at BETWEEN '
${
betweenTime
[
0
]}
' AND '
${
betweenTime
[
1
]}
')`
}
let
s
=
await
this
.
dao
.
statGroupBy
(
params
,
null
)
return
s
}
}
/**
/**
* 公司id,平台公司ID为1
* 公司id,平台公司ID为1
...
@@ -27,38 +30,46 @@ class BizOptService extends ServiceBase {
...
@@ -27,38 +30,46 @@ class BizOptService extends ServiceBase {
* @param {*} username
* @param {*} username
* @param {*} userid
* @param {*} userid
*/
*/
async
statBizChance
(
companyId
,
opath
,
username
,
userid
){
async
statBizChance
(
companyId
,
opath
,
username
,
userid
,
betweenTime
)
{
// 时间 筛选
let
andWhere
=
[];
if
(
betweenTime
.
length
>
0
)
{
andWhere
.
push
({
"created_at"
:
{
[
this
.
db
.
Op
.
between
]:
betweenTime
}
})
}
//如果当前登录人是平台,返回所有商机
//如果当前登录人是平台,返回所有商机
let
waittoHandledCount
=
0
let
waittoHandledCount
=
0
let
handlingCount
=
0
let
handlingCount
=
0
let
finishedCount
=
0
let
finishedCount
=
0
let
closedCount
=
0
let
closedCount
=
0
if
(
companyId
==
1
)
{
if
(
companyId
==
1
)
{
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'beforeSubmission'
}
})
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeSubmission'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'beforeConfirmation'
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeConfirmation'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'isFinished'
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isFinished'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'isClosed'
}
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isClosed'
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
}
else
{
}
else
{
let
opathstr
=
''
let
opathstr
=
''
if
(
opath
)
{
if
(
opath
)
{
opathstr
=
opath
opathstr
=
opath
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'beforeSubmission'
,
salesman_opcode
:{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
}
})
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeSubmission'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'beforeConfirmation'
,
salesman_opcode
:{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeConfirmation'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'isFinished'
,
salesman_opcode
:{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isFinished'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'isClosed'
,
salesman_opcode
:{[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
}
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isClosed'
,
salesman_opcode
:
{
[
this
.
db
.
Op
.
like
]:
`%
${
opathstr
}
%`
},
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
}
else
{
}
else
{
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'beforeSubmission'
,
'facilitator_id'
:
companyId
}
})
waittoHandledCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeSubmission'
,
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'beforeConfirmation'
,
'facilitator_id'
:
companyId
}
})
handlingCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'beforeConfirmation'
,
'facilitator_id'
:
companyId
,
[
this
.
db
.
Op
.
and
]:
andWhere
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'isFinished'
,
'facilitator_id'
:
companyId
}
})
finishedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isFinished'
,
'facilitator_id'
:
companyId
},
[
this
.
db
.
Op
.
and
]:
andWhere
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:{
business_status
:
'isClosed'
,
'facilitator_id'
:
companyId
}
})
closedCount
=
await
this
.
dao
.
findCount
({
where
:
{
business_status
:
'isClosed'
,
'facilitator_id'
:
companyId
},
[
this
.
db
.
Op
.
and
]:
andWhere
})
}
}
}
}
//成单率
//成单率
let
allChance
=
waittoHandledCount
+
handlingCount
+
finishedCount
+
closedCount
let
allChance
=
waittoHandledCount
+
handlingCount
+
finishedCount
+
closedCount
let
successRadio
=
Math
.
ceil
((
finishedCount
/
allChance
)
*
100
)
let
successRadio
=
Math
.
ceil
((
finishedCount
/
allChance
)
*
100
)
//如果当前登录人不是平台,那么需要按照opath查询
//如果当前登录人不是平台,那么需要按照opath查询
return
{
waittoHandledCount
:
waittoHandledCount
,
handlingCount
:
handlingCount
,
finishedCount
:
finishedCount
,
closedCount
:
closedCount
,
successRadio
:
successRadio
}
return
{
waittoHandledCount
:
waittoHandledCount
,
handlingCount
:
handlingCount
,
finishedCount
:
finishedCount
,
closedCount
:
closedCount
,
successRadio
:
successRadio
}
}
}
async
findAndCountAll
(
obj
)
{
async
findAndCountAll
(
obj
)
{
var
self
=
this
;
var
self
=
this
;
...
@@ -67,23 +78,23 @@ class BizOptService extends ServiceBase {
...
@@ -67,23 +78,23 @@ class BizOptService extends ServiceBase {
}
}
/*根据商机编号获取商机详情*/
/*根据商机编号获取商机详情*/
async
findInfoByDemandCode
(
qobj
){
async
findInfoByDemandCode
(
qobj
)
{
return
await
this
.
dao
.
findInfoByDemandCode
(
qobj
);
return
await
this
.
dao
.
findInfoByDemandCode
(
qobj
);
}
}
/* 根据商机编号更新商机状态 */
/* 根据商机编号更新商机状态 */
async
updateStatusByDemandCode
(
qobj
){
async
updateStatusByDemandCode
(
qobj
)
{
var
self
=
this
;
var
self
=
this
;
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
updateStatusByDemandCode
(
qobj
,
t
);
return
await
self
.
dao
.
updateStatusByDemandCode
(
qobj
,
t
);
});
});
}
}
/*插入商机信息*/
/*插入商机信息*/
async
insertInfo
(
qobj
){
async
insertInfo
(
qobj
)
{
var
self
=
this
;
var
self
=
this
;
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
insertInfo
(
qobj
,
t
);
return
await
self
.
dao
.
insertInfo
(
qobj
,
t
);
});
});
}
}
...
...
ic-deliver/app/base/service/impl/bizchance/deliverybillSve.js
View file @
6f3412a1
This diff is collapsed.
Click to expand it.
ic-deliver/app/base/service/impl/bizchance/schemeSve.js
View file @
6f3412a1
...
@@ -14,6 +14,7 @@ class SchemeService extends ServiceBase {
...
@@ -14,6 +14,7 @@ class SchemeService extends ServiceBase {
async
findInfoByDemandCode
(
qobj
){
//根据方案编号获取方案详情
async
findInfoByDemandCode
(
qobj
){
//根据方案编号获取方案详情
return
await
this
.
dao
.
findInfoByDemandCode
(
qobj
);
return
await
this
.
dao
.
findInfoByDemandCode
(
qobj
);
}
}
async
updateStatusByDemandCode
(
qobj
){
//根据商机编号号更新方案状态及原因
async
updateStatusByDemandCode
(
qobj
){
//根据商机编号号更新方案状态及原因
...
...
ic-deliver/app/base/utils/dateClient.js
0 → 100644
View file @
6f3412a1
const
moment
=
require
(
'moment'
);
class
DateClient
{
constructor
()
{
}
betweenDay
()
{
return
[
moment
().
startOf
(
'day'
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
moment
().
endOf
(
'day'
).
format
(
'YYYY-MM-DD HH:mm:ss'
)]
}
betweenMonth
()
{
return
[
moment
().
startOf
(
'month'
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
moment
().
endOf
(
'month'
).
format
(
'YYYY-MM-DD HH:mm:ss'
)]
}
betweenYear
()
{
return
[
moment
().
startOf
(
'year'
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
moment
().
endOf
(
'year'
).
format
(
'YYYY-MM-DD HH:mm:ss'
)]
}
betweenTime
(
type
)
{
let
times
=
[];
switch
(
type
)
{
case
"日"
:
times
=
this
.
betweenDay
();
break
case
"月"
:
times
=
this
.
betweenMonth
();
break
case
"年"
:
times
=
this
.
betweenYear
();
break
case
"全部"
:
break
}
return
times
}
}
module
.
exports
=
DateClient
;
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