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
cde66511
Commit
cde66511
authored
Dec 21, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Plain Diff
laolan
parents
cc3dbefa
5b0be7e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
69 deletions
+66
-69
center-order/app/base/service/impl/qcutils/regCenterOrderSve.js
+66
-69
No files found.
center-order/app/base/service/impl/qcutils/regCenterOrderSve.js
View file @
cde66511
...
@@ -3,14 +3,14 @@ const system = require("../../../system");
...
@@ -3,14 +3,14 @@ const system = require("../../../system");
const
moment
=
require
(
'moment'
);
const
moment
=
require
(
'moment'
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
class
RegCenterOrderService
extends
ServiceBase
{
class
RegCenterOrderService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"reg"
,
ServiceBase
.
getDaoName
(
RegCenterOrderService
));
super
(
"reg"
,
ServiceBase
.
getDaoName
(
RegCenterOrderService
));
this
.
needsolutionDao
=
system
.
getObject
(
"db.dbneed.needsolutionDao"
);
this
.
needsolutionDao
=
system
.
getObject
(
"db.dbneed.needsolutionDao"
);
this
.
needinfoDao
=
system
.
getObject
(
"db.dbneed.needinfoDao"
);
this
.
needinfoDao
=
system
.
getObject
(
"db.dbneed.needinfoDao"
);
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
this
.
orderdeliveryDao
=
system
.
getObject
(
"db.dbcorder.orderdeliveryDao"
);
this
.
orderdeliveryDao
=
system
.
getObject
(
"db.dbcorder.orderdeliveryDao"
);
this
.
db
=
system
.
getObject
(
"db.common.connection"
).
getCon
()
this
.
db
=
system
.
getObject
(
"db.common.connection"
).
getCon
()
//工商注册状态
//工商注册状态
this
.
regSolutionStatus
=
{
this
.
regSolutionStatus
=
{
'RECEIVED'
:
'已接单'
,
//
'RECEIVED'
:
'已接单'
,
//
...
@@ -30,8 +30,8 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -30,8 +30,8 @@ class RegCenterOrderService extends ServiceBase {
'SUCCESS'
:
705
//已完成
'SUCCESS'
:
705
//已完成
}
}
}
}
//----------2.
//提交需求
async
submitRegNeed
(
pobj
,
actionBody
,
req
)
{
async
submitRegNeed
(
pobj
,
actionBody
,
req
)
{
var
needNo
=
await
this
.
getBusUid
(
"n"
);
var
needNo
=
await
this
.
getBusUid
(
"n"
);
if
(
!
actionBody
.
intentionBizId
)
{
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResultFail
(
-
5001
,
"intentionBizId不能为空"
);
return
system
.
getResultFail
(
-
5001
,
"intentionBizId不能为空"
);
...
@@ -58,21 +58,20 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -58,21 +58,20 @@ class RegCenterOrderService extends ServiceBase {
// disposeNotes: actionBody.ext,
// disposeNotes: actionBody.ext,
typeCode
:
actionBody
.
type_code
,
typeCode
:
actionBody
.
type_code
,
typeName
:
actionBody
.
type_name
,
typeName
:
actionBody
.
type_name
,
channelTypeCode
:
actionBody
.
channel_type_code
,
channelTypeCode
:
actionBody
.
channel_type_code
||
""
,
channelTypeName
:
actionBody
.
channel_type_name
,
channelTypeName
:
actionBody
.
channel_type_name
||
""
,
status
:
"wts"
,
status
:
"wts"
,
level
:
actionBody
.
level
||
""
,
level
:
actionBody
.
level
||
""
,
probability
:
actionBody
.
probability
||
""
,
probability
:
actionBody
.
probability
||
""
,
notes
:
actionBody
.
notes
notes
:
actionBody
.
notes
||
""
}
}
if
(
nobj
.
channelTypeCode
==
"GSREG"
)
{
if
(
nobj
.
channelTypeCode
==
7
||
nobj
.
channelTypeCode
==
5
)
{
nobj
.
province
=
nobj
.
city
,
nobj
.
province
=
nobj
.
city
,
nobj
.
city
=
""
;
nobj
.
city
=
""
;
}
}
var
needInfo
=
await
this
.
dao
.
create
(
nobj
);
var
needInfo
=
await
this
.
dao
.
create
(
nobj
);
return
system
.
getResultSuccess
(
needInfo
);
return
system
.
getResultSuccess
(
needInfo
);
}
}
//添加业务员信息,用于直接下单的reg订单
//添加业务员信息,用于直接下单的reg订单
async
addRegSalesmanInfo
(
pobj
)
{
async
addRegSalesmanInfo
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
...
@@ -88,23 +87,23 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -88,23 +87,23 @@ class RegCenterOrderService extends ServiceBase {
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
}
}
var
solutionContent
=
ns
.
solutionContent
;
var
solutionContent
=
ns
.
solutionContent
;
solutionContent
.
salesmanInfo
=
salesmanObj
;
solutionContent
.
salesmanInfo
=
salesmanObj
;
var
updateObj
=
{
id
:
ns
.
id
,
solutionContent
:
JSON
.
stringify
(
solutionContent
)
}
var
updateObj
=
{
id
:
ns
.
id
,
solutionContent
:
JSON
.
stringify
(
solutionContent
)
}
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
return
system
.
getResultSuccess
(
solutionContent
);
return
system
.
getResultSuccess
(
solutionContent
);
}
}
//渠道方案号获取需求详情
//渠道方案号获取需求详情
async
getItemByChannelSolutionNo
(
pobj
)
{
async
getItemByChannelSolutionNo
(
pobj
)
{
var
i
=
0
;
var
i
=
0
;
var
bizIdLength
=
pobj
.
actionBody
.
length
;
var
bizIdLength
=
pobj
.
actionBody
.
length
;
var
bizIdList
=
[];
var
bizIdList
=
[];
for
(
i
=
0
;
i
<=
bizIdLength
;
i
++
)
{
for
(
i
=
0
;
i
<=
bizIdLength
;
i
++
)
{
bizIdList
.
push
(
pobj
.
actionBody
[
i
].
bizId
)
bizIdList
.
push
(
pobj
.
actionBody
[
i
].
bizId
)
}
}
bizIdListStr
=
bizIdList
.
join
(
","
);
bizIdListStr
=
bizIdList
.
join
(
","
);
// var solutionitem = await this.needsolutionDao.findOne({ channelSolutionNo: pobj.actionBody.bizId });
// var solutionitem = await this.needsolutionDao.findOne({ channelSolutionNo: pobj.actionBody.bizId });
var
sql
=
"select * from n_need_solution where channelSolutionNo in ("
+
bizIdListStr
+
")"
;
var
sql
=
"select * from n_need_solution where channelSolutionNo in ("
+
bizIdListStr
+
")"
;
var
solutionitem
=
await
this
.
customQuery
(
sql
);
var
solutionitem
=
await
this
.
customQuery
(
sql
);
if
(
solutionitem
.
length
<
1
)
{
if
(
solutionitem
.
length
<
1
)
{
return
system
.
getResult
(
null
,
"方案数据为空,30210"
);
return
system
.
getResult
(
null
,
"方案数据为空,30210"
);
...
@@ -113,15 +112,15 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -113,15 +112,15 @@ class RegCenterOrderService extends ServiceBase {
if
(
!
item
)
{
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"需求数据为空,30210"
);
return
system
.
getResult
(
null
,
"需求数据为空,30210"
);
}
}
item
.
solutionProvince
=
solutionitem
[
0
].
solutionContent
.
solution
.
Area
||
solutionitem
[
0
].
solutionContent
.
solution
.
area
;
item
.
solutionProvince
=
solutionitem
[
0
].
solutionContent
.
solution
.
Area
||
solutionitem
[
0
].
solutionContent
.
solution
.
area
;
item
.
solutionContent
=
solutionitem
[
0
].
solutionContent
item
.
solutionContent
=
solutionitem
[
0
].
solutionContent
item
.
channelSolutionNo
=
solutionitem
[
0
].
channelSolutionNo
item
.
channelSolutionNo
=
solutionitem
[
0
].
channelSolutionNo
return
system
.
getResultSuccess
(
item
);
return
system
.
getResultSuccess
(
item
);
}
}
//接收渠道方案状态变更通知
//接收渠道方案状态变更通知
async
regOrderStatus
(
pobj
)
{
async
regOrderStatus
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
BizId
)
{
if
(
!
ab
.
BizId
)
{
return
system
.
getResultFail
(
-
101
,
"渠道方案号不能为空"
);
return
system
.
getResultFail
(
-
101
,
"渠道方案号不能为空"
);
...
@@ -129,7 +128,7 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -129,7 +128,7 @@ class RegCenterOrderService extends ServiceBase {
if
(
!
ab
.
status
)
{
if
(
!
ab
.
status
)
{
return
system
.
getResultFail
(
-
102
,
"方案状态不能为空"
);
return
system
.
getResultFail
(
-
102
,
"方案状态不能为空"
);
}
}
if
(
ab
.
isDirectBuy
&&
ab
.
isDirectBuy
==
1
&&
ab
.
status
==
1
)
{
//直接下单,无方案 直接返回
if
(
ab
.
isDirectBuy
&&
ab
.
isDirectBuy
==
1
&&
ab
.
status
==
1
)
{
//直接下单,无方案 直接返回
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
//获取方案信息
//获取方案信息
...
@@ -160,11 +159,11 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -160,11 +159,11 @@ class RegCenterOrderService extends ServiceBase {
//方案流程列表
//方案流程列表
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
if
(
ab
.
status
==
"1"
)
{
//⽤户已支付
if
(
ab
.
status
==
"1"
)
{
//⽤户已支付
var
afterStatusList
=
[
//用户支付后的流程状态
var
afterStatusList
=
[
//用户支付后的流程状态
"USER_UPLOADED"
,
"MATERIAL_UNCONFIRM"
,
"USER_CONFIRMED"
,
"ACCOUNT_REGISTERED"
,
"USER_UPLOADED"
,
"MATERIAL_UNCONFIRM"
,
"USER_CONFIRMED"
,
"ACCOUNT_REGISTERED"
,
"MATERIAL_SUBMITTED"
,
"GXB_ACCEPT"
,
"GXB_REFUSE"
,
"GXB_FAIL"
,
"GXB_SUCCESS"
,
"CLOSE"
"MATERIAL_SUBMITTED"
,
"GXB_ACCEPT"
,
"GXB_REFUSE"
,
"GXB_FAIL"
,
"GXB_SUCCESS"
,
"CLOSE"
];
];
if
(
!
solutionContent
.
status
||
afterStatusList
.
indexOf
(
solutionContent
.
status
)
<
0
)
{
if
(
!
solutionContent
.
status
||
afterStatusList
.
indexOf
(
solutionContent
.
status
)
<
0
)
{
solutionFlowList
.
push
({
solutionFlowList
.
push
({
status
:
"PAID"
,
statusName
:
this
.
icpSolutionStatusReference
.
PAID
,
updated_at
:
new
Date
()
status
:
"PAID"
,
statusName
:
this
.
icpSolutionStatusReference
.
PAID
,
updated_at
:
new
Date
()
});
});
...
@@ -337,8 +336,6 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -337,8 +336,6 @@ class RegCenterOrderService extends ServiceBase {
}
}
}
}
/*
/*
返回20位业务订单号
返回20位业务订单号
...
@@ -386,7 +383,7 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -386,7 +383,7 @@ class RegCenterOrderService extends ServiceBase {
//根据需求关闭方案(关闭需求后调用)
//根据需求关闭方案(关闭需求后调用)
async
regClosePlan
(
pobj
)
{
async
regClosePlan
(
pobj
)
{
console
.
log
(
"ncClosePlan+++"
,
pobj
)
console
.
log
(
"ncClosePlan+++"
,
pobj
)
var
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
var
app
=
pobj
.
appInfo
;
var
app
=
pobj
.
appInfo
;
if
(
!
app
||
!
app
.
uapp_id
)
{
if
(
!
app
||
!
app
.
uapp_id
)
{
...
@@ -416,7 +413,7 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -416,7 +413,7 @@ class RegCenterOrderService extends ServiceBase {
return
system
.
getResultFail
(
-
103
,
"方案状态错误,不能废弃已完成方案"
);
return
system
.
getResultFail
(
-
103
,
"方案状态错误,不能废弃已完成方案"
);
}
}
var
flowStatus
=
ns
.
solutionContent
&&
ns
.
solutionContent
.
status
?
ns
.
solutionContent
.
status
:
""
;
var
flowStatus
=
ns
.
solutionContent
&&
ns
.
solutionContent
.
status
?
ns
.
solutionContent
.
status
:
""
;
if
(
flowStatus
&&
[
"NOT_ACCEPTED"
,
"CLOSE"
].
indexOf
(
flowStatus
)
<
0
)
{
if
(
flowStatus
&&
[
"NOT_ACCEPTED"
,
"CLOSE"
].
indexOf
(
flowStatus
)
<
0
)
{
return
system
.
getResultFail
(
-
104
,
"⽅案状态为关闭或不予受理才可关闭需求"
);
return
system
.
getResultFail
(
-
104
,
"⽅案状态为关闭或不予受理才可关闭需求"
);
}
}
}
}
...
@@ -434,14 +431,14 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -434,14 +431,14 @@ class RegCenterOrderService extends ServiceBase {
var
uappId
=
{};
var
uappId
=
{};
uappId
[
'uapp_id'
]
=
needinfo
.
uapp_id
;
uappId
[
'uapp_id'
]
=
needinfo
.
uapp_id
;
ns
=
ns
?
ns
:
{};
ns
=
ns
?
ns
:
{};
ns
=
Object
.
assign
(
ns
,
uappId
)
ns
=
Object
.
assign
(
ns
,
uappId
)
console
.
log
(
'guanbi ns +++'
,
ns
)
console
.
log
(
'guanbi ns +++'
,
ns
)
return
system
.
getResultSuccess
(
ns
);
return
system
.
getResultSuccess
(
ns
);
// return system.getResultSuccess();
// return system.getResultSuccess();
})
})
}
}
//交付商关闭交付单
//交付商关闭交付单
async
ncCloseOrderDelivery
(
pobj
)
{
async
ncCloseOrderDelivery
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
...
@@ -536,17 +533,17 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -536,17 +533,17 @@ class RegCenterOrderService extends ServiceBase {
var
solutionType
=
[];
var
solutionType
=
[];
var
solutionContent
;
var
solutionContent
;
var
needsolutions
=
[];
//最后返回结果用
var
needsolutions
=
[];
//最后返回结果用
if
(
ab
.
solutionList
)
{
if
(
ab
.
solutionList
)
{
var
solutionListLength
=
ab
.
solutionList
.
length
;
var
solutionListLength
=
ab
.
solutionList
.
length
;
}
}
console
.
log
(
'ab.solutionList------'
,
ab
.
solutionList
)
console
.
log
(
'ab.solutionList------'
,
ab
.
solutionList
)
for
(
i
=
0
;
i
<
solutionListLength
;
i
++
)
{
for
(
i
=
0
;
i
<
solutionListLength
;
i
++
)
{
if
(
!
ab
.
solutionList
[
i
].
solutionContent
)
{
if
(
!
ab
.
solutionList
[
i
].
solutionContent
)
{
return
system
.
getResultFail
(
-
102
,
"方案信息有误"
);
return
system
.
getResultFail
(
-
102
,
"方案信息有误"
);
}
}
solutionContent
=
ab
.
solutionList
[
i
].
solutionContent
solutionContent
=
ab
.
solutionList
[
i
].
solutionContent
solutionType
.
push
(
solutionContent
.
solution
.
regType
)
solutionType
.
push
(
solutionContent
.
solution
.
regType
)
console
.
log
(
'solutionType------'
,
solutionType
)
console
.
log
(
'solutionType------'
,
solutionType
)
}
}
//获取需求信息
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
...
@@ -570,11 +567,11 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -570,11 +567,11 @@ class RegCenterOrderService extends ServiceBase {
var
ns
=
await
this
.
needsolutionDao
.
model
.
findAll
({
var
ns
=
await
this
.
needsolutionDao
.
model
.
findAll
({
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
,
order
:
[[
"id"
,
'asc'
]]
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
,
order
:
[[
"id"
,
'asc'
]]
});
});
console
.
log
(
'ns----'
,
ns
)
console
.
log
(
'ns----'
,
ns
)
var
nsRegType
=
[];
var
nsRegType
=
[];
if
(
ns
)
{
if
(
ns
)
{
var
nsLength
=
ns
.
length
;
var
nsLength
=
ns
.
length
;
for
(
l
=
0
;
l
<
nsLength
;
l
++
)
{
for
(
l
=
0
;
l
<
nsLength
;
l
++
)
{
nsRegType
.
push
(
ns
[
l
].
solutionContent
.
solution
.
regType
)
nsRegType
.
push
(
ns
[
l
].
solutionContent
.
solution
.
regType
)
}
}
// var flag = nsRegType.indexOf(solutionType);
// var flag = nsRegType.indexOf(solutionType);
...
@@ -583,13 +580,13 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -583,13 +580,13 @@ class RegCenterOrderService extends ServiceBase {
// return "该方案已创建";
// return "该方案已创建";
// }
// }
var
diff
;
var
diff
;
diff
=
nsRegType
.
find
(
item
=>
solutionType
.
includes
(
item
))
diff
=
nsRegType
.
find
(
item
=>
solutionType
.
includes
(
item
))
console
.
log
(
'diff---'
,
diff
)
console
.
log
(
'diff---'
,
diff
)
if
(
diff
!=
undefined
)
{
if
(
diff
!=
undefined
)
{
return
system
.
getResultFail
(
-
207
,
"该方案中包含已提交过的方案,不能重复提交"
);
return
system
.
getResultFail
(
-
207
,
"该方案中包含已提交过的方案,不能重复提交"
);
}
}
}
}
for
(
j
=
0
;
j
<
solutionListLength
;
j
++
)
{
for
(
j
=
0
;
j
<
solutionListLength
;
j
++
)
{
if
(
ab
.
solutionList
[
j
].
solutionContent
)
{
if
(
ab
.
solutionList
[
j
].
solutionContent
)
{
ab
.
solutionList
[
j
].
solutionContent
.
bizType
=
bizType
;
ab
.
solutionList
[
j
].
solutionContent
.
bizType
=
bizType
;
ab
.
solutionList
[
j
].
solutionContent
.
typeCode
=
needinfo
.
typeCode
;
ab
.
solutionList
[
j
].
solutionContent
.
typeCode
=
needinfo
.
typeCode
;
...
@@ -607,7 +604,7 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -607,7 +604,7 @@ class RegCenterOrderService extends ServiceBase {
}
}
}
}
// var solution = ab.solutionList[j].solutionContent.solution;
// var solution = ab.solutionList[j].solutionContent.solution;
var
solutionFlowList
=
ab
.
solutionList
[
j
].
solutionContent
.
solutionFlowList
||
[];
var
solutionFlowList
=
ab
.
solutionList
[
j
].
solutionContent
.
solutionFlowList
||
[];
solutionFlowList
.
push
({
solutionFlowList
.
push
({
status
:
"RECEIVED"
,
statusName
:
this
.
regSolutionStatus
.
RECEIVED
,
updated_at
:
new
Date
()
status
:
"RECEIVED"
,
statusName
:
this
.
regSolutionStatus
.
RECEIVED
,
updated_at
:
new
Date
()
...
@@ -619,7 +616,7 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -619,7 +616,7 @@ class RegCenterOrderService extends ServiceBase {
// var solutionNo = await this.getBusUid("ns");//chuangjian
// var solutionNo = await this.getBusUid("ns");//chuangjian
var
solutionNo
=
[];
//chuangjian
var
solutionNo
=
[];
//chuangjian
solutionNo
[
j
]
=
await
this
.
getBusUid
(
"ns"
)
solutionNo
[
j
]
=
await
this
.
getBusUid
(
"ns"
)
console
.
log
(
'solutionNo[j]----'
,
solutionNo
[
j
])
console
.
log
(
'solutionNo[j]----'
,
solutionNo
[
j
])
ab
.
solutionList
[
j
][
"solutionNo"
]
=
solutionNo
[
j
];
ab
.
solutionList
[
j
][
"solutionNo"
]
=
solutionNo
[
j
];
ab
.
solutionList
[
j
][
"status"
]
=
"dqr"
;
ab
.
solutionList
[
j
][
"status"
]
=
"dqr"
;
var
customerInfo
=
{
//客户信息
var
customerInfo
=
{
//客户信息
...
@@ -636,7 +633,7 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -636,7 +633,7 @@ class RegCenterOrderService extends ServiceBase {
ab
.
solutionList
[
j
].
solutionContent
[
"salesmanInfo"
]
=
salesmanInfo
;
ab
.
solutionList
[
j
].
solutionContent
[
"salesmanInfo"
]
=
salesmanInfo
;
ab
.
solutionList
[
j
].
solutionContent
.
solution
.
solutionPrice
=
(
ab
.
solutionList
[
j
].
solutionContent
.
solution
.
solutionPrice
)
/
100
||
""
;
//分转元
ab
.
solutionList
[
j
].
solutionContent
.
solution
.
solutionPrice
=
(
ab
.
solutionList
[
j
].
solutionContent
.
solution
.
solutionPrice
)
/
100
||
""
;
//分转元
ab
.
solutionList
[
j
].
solutionContent
=
JSON
.
stringify
(
ab
.
solutionList
[
j
].
solutionContent
);
ab
.
solutionList
[
j
].
solutionContent
=
JSON
.
stringify
(
ab
.
solutionList
[
j
].
solutionContent
);
console
.
log
(
'abababab---+++---++'
,
ab
)
console
.
log
(
'abababab---+++---++'
,
ab
)
var
self
=
this
;
var
self
=
this
;
var
res
=
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
var
res
=
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
ab
.
solutionList
[
j
][
"needNo"
]
=
needinfo
.
needNo
;
ab
.
solutionList
[
j
][
"needNo"
]
=
needinfo
.
needNo
;
...
@@ -668,16 +665,16 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -668,16 +665,16 @@ class RegCenterOrderService extends ServiceBase {
});
});
// return system.getResultSuccess({ needinfo: needinfo, needsolution: od });
// return system.getResultSuccess({ needinfo: needinfo, needsolution: od });
needsolutions
.
push
(
od
.
dataValues
)
needsolutions
.
push
(
od
.
dataValues
)
console
.
log
(
'needsolutions-------'
,
needsolutions
)
console
.
log
(
'needsolutions-------'
,
needsolutions
)
}
}
// else {
// else {
// return system.getResultFail(-302, "提交方案失败");
// return system.getResultFail(-302, "提交方案失败");
// }
// }
})
})
}
}
}
}
return
system
.
getResultSuccess
({
needinfo
:
needinfo
,
needsolutions
:
needsolutions
});
return
system
.
getResultSuccess
({
needinfo
:
needinfo
,
needsolutions
:
needsolutions
});
}
}
//方案推送baidu后,接收保存方案编号/链接
//方案推送baidu后,接收保存方案编号/链接
async
saveReginfo
(
pobj
)
{
async
saveReginfo
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
...
@@ -690,9 +687,9 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -690,9 +687,9 @@ class RegCenterOrderService extends ServiceBase {
var
solutionNos
=
[];
var
solutionNos
=
[];
var
infoList
=
[];
var
infoList
=
[];
var
nsLength
=
ns
.
length
var
nsLength
=
ns
.
length
for
(
i
=
0
;
i
<
infosLength
;
i
++
)
{
for
(
i
=
0
;
i
<
infosLength
;
i
++
)
{
var
solutionNo
=
{
var
solutionNo
=
{
solutionNo
:
ab
.
infos
[
i
].
bizId
solutionNo
:
ab
.
infos
[
i
].
bizId
}
}
solutionNos
.
push
(
solutionNo
)
solutionNos
.
push
(
solutionNo
)
}
}
...
@@ -711,7 +708,7 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -711,7 +708,7 @@ class RegCenterOrderService extends ServiceBase {
if
(
needinfo
.
status
==
"ycd"
||
needinfo
.
status
==
"ygb"
)
{
if
(
needinfo
.
status
==
"ycd"
||
needinfo
.
status
==
"ygb"
)
{
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
}
for
(
j
=
0
;
j
<
nsLength
;
j
++
)
{
for
(
j
=
0
;
j
<
nsLength
;
j
++
)
{
await
this
.
needsolutionDao
.
model
.
update
({
channelSolutionNo
:
ab
.
infos
[
j
].
bizId
},
{
where
:
{
id
:
ns
[
j
].
id
}
});
//修改方案信息
await
this
.
needsolutionDao
.
model
.
update
({
channelSolutionNo
:
ab
.
infos
[
j
].
bizId
},
{
where
:
{
id
:
ns
[
j
].
id
}
});
//修改方案信息
}
}
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
...
@@ -748,11 +745,11 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -748,11 +745,11 @@ class RegCenterOrderService extends ServiceBase {
if
(
updateRes
[
1
])
{
if
(
updateRes
[
1
])
{
var
sql
=
"select uapp_id from n_need_info where channelNeedNo = :channelNeedNo "
;
var
sql
=
"select uapp_id from n_need_info where channelNeedNo = :channelNeedNo "
;
var
where
=
{
var
where
=
{
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
}
}
var
uappIdInfo
=
await
this
.
customQuery
(
sql
,
where
);
var
uappIdInfo
=
await
this
.
customQuery
(
sql
,
where
);
console
.
log
(
'uappIdInfo+++'
,
uappIdInfo
)
console
.
log
(
'uappIdInfo+++'
,
uappIdInfo
)
if
(
uappIdInfo
)
{
if
(
uappIdInfo
)
{
var
uappIds
=
uappIdInfo
[
0
].
uapp_id
var
uappIds
=
uappIdInfo
[
0
].
uapp_id
}
}
return
system
.
getResultSuccess
(
uappIds
);
return
system
.
getResultSuccess
(
uappIds
);
...
@@ -770,10 +767,10 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -770,10 +767,10 @@ class RegCenterOrderService extends ServiceBase {
if
(
updateRes
[
1
])
{
if
(
updateRes
[
1
])
{
var
sql
=
"select uapp_id from n_need_info where channelNeedNo = :channelNeedNo "
;
var
sql
=
"select uapp_id from n_need_info where channelNeedNo = :channelNeedNo "
;
var
where
=
{
var
where
=
{
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
}
}
var
uappIdInfo
=
await
this
.
customQuery
(
sql
,
where
);
var
uappIdInfo
=
await
this
.
customQuery
(
sql
,
where
);
if
(
uappIdInfo
)
{
if
(
uappIdInfo
)
{
var
uappIds
=
uappIdInfo
[
0
].
uapp_id
var
uappIds
=
uappIdInfo
[
0
].
uapp_id
}
}
return
system
.
getResultSuccess
(
uappIds
);
return
system
.
getResultSuccess
(
uappIds
);
...
@@ -792,10 +789,10 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -792,10 +789,10 @@ class RegCenterOrderService extends ServiceBase {
// }
// }
var
sql
=
"select uapp_id from n_need_info where channelNeedNo = :channelNeedNo "
;
var
sql
=
"select uapp_id from n_need_info where channelNeedNo = :channelNeedNo "
;
var
where
=
{
var
where
=
{
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
}
}
var
uappIdInfo
=
await
this
.
customQuery
(
sql
,
where
);
var
uappIdInfo
=
await
this
.
customQuery
(
sql
,
where
);
if
(
uappIdInfo
)
{
if
(
uappIdInfo
)
{
uappIdInfo
=
uappIdInfo
[
0
];
uappIdInfo
=
uappIdInfo
[
0
];
return
system
.
getResultSuccess
(
uappIdInfo
);
return
system
.
getResultSuccess
(
uappIdInfo
);
}
}
...
@@ -852,12 +849,12 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -852,12 +849,12 @@ class RegCenterOrderService extends ServiceBase {
var
ns
=
await
this
.
needsolutionDao
.
model
.
findAll
({
var
ns
=
await
this
.
needsolutionDao
.
model
.
findAll
({
where
:
{
needNo
:
needinfo
.
needNo
,
isInvalid
:
0
},
raw
:
true
where
:
{
needNo
:
needinfo
.
needNo
,
isInvalid
:
0
},
raw
:
true
});
});
console
.
log
(
'nnnsss-----'
,
ns
)
console
.
log
(
'nnnsss-----'
,
ns
)
var
i
;
var
i
;
var
nsLength
=
ns
.
length
var
nsLength
=
ns
.
length
if
(
ns
)
{
if
(
ns
)
{
for
(
i
=
0
;
i
<
nsLength
;
i
++
)
{
for
(
i
=
0
;
i
<
nsLength
;
i
++
)
{
if
(
ns
[
i
].
id
)
{
if
(
ns
[
i
].
id
)
{
if
(
ns
[
i
].
status
==
"ywc"
)
{
if
(
ns
[
i
].
status
==
"ywc"
)
{
return
system
.
getResultFail
(
-
103
,
"方案状态错误,不能废弃已完成方案"
);
return
system
.
getResultFail
(
-
103
,
"方案状态错误,不能废弃已完成方案"
);
}
}
...
@@ -875,7 +872,7 @@ class RegCenterOrderService extends ServiceBase {
...
@@ -875,7 +872,7 @@ class RegCenterOrderService extends ServiceBase {
await
self
.
needsolutionDao
.
model
.
update
({
status
:
"yzf"
,
isInvalid
:
1
},
{
where
:
{
id
:
ns
.
id
},
transaction
:
t
});
//方案废弃
await
self
.
needsolutionDao
.
model
.
update
({
status
:
"yzf"
,
isInvalid
:
1
},
{
where
:
{
id
:
ns
.
id
},
transaction
:
t
});
//方案废弃
// return system.getResultSuccess(ns.orderNo);
// return system.getResultSuccess(ns.orderNo);
ns
[
'uapp_id'
]
=
needinfo
.
uapp_id
;
ns
[
'uapp_id'
]
=
needinfo
.
uapp_id
;
console
.
log
(
'guanbi ns +++'
,
ns
)
console
.
log
(
'guanbi ns +++'
,
ns
)
})
})
}
}
}
}
...
...
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