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
4eccce74
Commit
4eccce74
authored
Mar 17, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ic3
parent
882a6fa4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
2 deletions
+81
-2
center-order/app/base/api/impl/action/icapi.js
+3
-0
center-order/app/base/service/impl/dbneed/needsolutionSve.js
+78
-2
No files found.
center-order/app/base/api/impl/action/icapi.js
View file @
4eccce74
...
...
@@ -37,6 +37,9 @@ class IcAPI extends APIBase {
case
"receiveProgrammeNo"
:
//接收方案编号(方案推送至阿里后,接收保存方案信息)
opResult
=
await
this
.
needsolutionSve
.
receiveProgrammeNo
(
pobj
);
break
;
case
"getProgrammeListByUser"
:
//获取方案列表(获取用户所有方案)
opResult
=
await
this
.
needsolutionSve
.
getProgrammeListByUser
(
pobj
);
break
;
case
"getProgrammeInfoByNeedNo"
:
//根据需求查看方案列表
opResult
=
await
this
.
needsolutionSve
.
getProgrammeInfoByNeedNo
(
pobj
);
break
;
...
...
center-order/app/base/service/impl/dbneed/needsolutionSve.js
View file @
4eccce74
...
...
@@ -75,6 +75,11 @@ class NeedsolutionService extends ServiceBase {
//根据需求查看方案列表
async
getProgrammeInfoByNeedNo
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
){
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
ab
[
"createUserId"
]
=
user
.
id
;
// followManMobile: DataTypes.STRING,//跟进人手机号(合伙人)
// followManOnlyCode: DataTypes.STRING(50),//跟进者唯一码
if
(
!
ab
.
needNo
){
...
...
@@ -88,17 +93,85 @@ class NeedsolutionService extends ServiceBase {
// }
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:{
needNo
:
ab
.
needNo
,
followManOnlyCode
:
ab
.
followManOnlyCode
},
raw
:
true
where
:{
needNo
:
ab
.
needNo
},
raw
:
true
});
if
(
!
needinfo
||
!
needinfo
.
id
){
return
system
.
getResultFail
(
-
102
,
"未知需求信息"
);
}
var
ns
=
await
this
.
dao
.
model
.
findAll
({
where
:{
needNo
:
ab
.
needNo
},
raw
:
true
,
where
:{
needNo
:
ab
.
needNo
,
createUserId
:
user
.
id
},
raw
:
true
,
attributes
:[
"needNo"
,
"solutionNo"
,
"orderNo"
,
"solutionContent"
,
"status"
,
"statusName"
]
});
return
system
.
getResultSuccess
(
ns
);
}
//获取方案列表(获取用户所有方案)
async
getProgrammeListByUser
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
){
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
var
pageSize
=
Number
(
ab
.
pageSize
||
20
);
if
(
pageSize
>
500
)
{
pageSize
=
500
;
}
var
bizType
=
ab
.
bizType
||
"companyreg"
;
// companyreg_cloud
var
pageIndex
=
Number
(
ab
.
pageIndex
||
1
);
var
from
=
pageIndex
==
1
?
0
:
Number
((
pageIndex
-
1
)
*
pageSize
);
//select * from log where data->'$.id' = 142;
var
sql
=
"select id,needNo,solutionNo,orderNo,solutionContent,status,statusName,created_at from n_need_solution where 1=1 "
;
var
sqlCount
=
"select count(1) as dataCount from n_need_solution where 1=1 "
;
sql
=
sql
+
" and createUserId="
+
user
.
id
;
sqlCount
=
sqlCount
+
" and createUserId="
+
user
.
id
;
sql
=
sql
+
" and solutionContent->'$.bizType' = '"
+
bizType
+
"'"
;
sqlCount
=
sqlCount
+
" and solutionContent->'$.bizType' = '"
+
bizType
+
"'"
;
var
paramWhere
=
{};
if
(
ab
.
solutionNo
)
{
//方案号
sql
+=
" and solutionNo = :solutionNo"
;
sqlCount
+=
" and solutionNo = :solutionNo"
;
paramWhere
.
solutionNo
=
ab
.
solutionNo
;
}
if
(
ab
.
orderNo
)
{
//服务单号
sql
+=
" and orderNo = :orderNo"
;
sqlCount
+=
" and orderNo = :orderNo"
;
paramWhere
.
orderNo
=
ab
.
orderNo
;
}
if
(
ab
.
status
)
{
//方案状态
sql
+=
" and status = :status"
;
sqlCount
+=
" and status = :status"
;
paramWhere
.
status
=
ab
.
status
;
}
if
(
bizType
==
"companyreg"
){
//普通公司注册
if
(
ab
.
entName
)
{
//企业名称
sql
=
sql
+
" and solutionContent->'$.solution.entName' = :entName"
;
sqlCount
=
sqlCount
+
" and solutionContent->'$.solution.entName' = :entName"
;
paramWhere
.
entName
=
ab
.
entName
;
}
}
if
(
bizType
==
"companyreg_cloud"
){
//云上公司注册
if
(
ab
.
regPark
)
{
//注册园区
sql
=
sql
+
" and solutionContent->'$.solution.regPark' = :regPark"
;
sqlCount
=
sqlCount
+
" and solutionContent->'$.solution.regPark' = :regPark"
;
paramWhere
.
regPark
=
ab
.
regPark
;
}
if
(
ab
.
productType
)
{
//产品类型
sql
=
sql
+
" and solutionContent->'$.solution.productType' = :productType"
;
sqlCount
=
sqlCount
+
" and solutionContent->'$.solution.productType' = :productType"
;
paramWhere
.
productType
=
ab
.
productType
;
}
}
sql
+=
" order by id desc LIMIT "
+
pageSize
+
" OFFSET "
+
from
;
var
list
=
await
this
.
customQuery
(
sql
,
paramWhere
);
var
result
=
system
.
getResultSuccess
(
list
);
var
tmpResultCount
=
await
this
.
customQuery
(
sqlCount
,
paramWhere
);
result
.
dataCount
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
return
result
;
}
//接收方案反馈信息(即方案作废)
async
receiveFeedback
(
pobj
){
var
ab
=
pobj
.
actionBody
;
...
...
@@ -161,5 +234,7 @@ class NeedsolutionService extends ServiceBase {
}
}
module
.
exports
=
NeedsolutionService
;
\ 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