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
a9871047
Commit
a9871047
authored
Mar 05, 2021
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
3167856f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
29 deletions
+47
-29
center-order/app/base/api/impl/action/opNeed.js
+3
-0
center-order/app/base/service/impl/dbneed/opneedinfoSve.js
+44
-29
No files found.
center-order/app/base/api/impl/action/opNeed.js
View file @
a9871047
...
...
@@ -48,6 +48,9 @@ class IcAPI extends APIBase {
case
"getStatisticsByProduct"
:
opResult
=
await
this
.
opNeedInfoSve
.
getStatisticsByProduct
(
pobj
);
break
;
case
"getNeedProductType"
:
opResult
=
await
this
.
opNeedInfoSve
.
getNeedProductType
(
pobj
);
break
;
case
"getStatisticsByArea"
:
opResult
=
await
this
.
opNeedInfoSve
.
getStatisticsByCity
(
pobj
);
break
;
...
...
center-order/app/base/service/impl/dbneed/opneedinfoSve.js
View file @
a9871047
...
...
@@ -156,9 +156,9 @@ class NeedinfoService extends ServiceBase {
whereParam
.
start
=
ac
.
start
;
whereParam
.
end
=
ac
.
end
;
}
if
(
ac
.
type_
cod
e
){
sql
+=
` AND typeCode = :type_
cod
e`
;
whereParam
.
type_
code
=
ac
.
type_cod
e
;
if
(
ac
.
type_
nam
e
){
sql
+=
` AND typeCode = :type_
nam
e`
;
whereParam
.
type_
name
=
ac
.
type_nam
e
;
}
if
(
ac
.
status
){
sql
+=
` AND status = :status`
;
...
...
@@ -177,7 +177,7 @@ class NeedinfoService extends ServiceBase {
async
getNeedFunnelStatistics
(
pobj
){
let
ac
=
pobj
.
actionBody
;
let
sql
=
`select count(*) count from n_need_info where deleted_at is null `
;
let
sql2
=
`select count(DISTINCT(a.needNo)) count from n_need_solution a left join n_need_info b on a.needNo = b.needNo where a.deleted_at is null`
;
let
sql2
=
sql
+
` and status = ygj`
let
whereParams
=
{};
if
(
ac
.
start
&&
ac
.
end
){
sql
+=
` AND created_at >= :start and created_at <= :end`
;
...
...
@@ -190,14 +190,14 @@ class NeedinfoService extends ServiceBase {
sql2
+=
` and b.uapp_id = :uapp_id`
;
whereParams
.
uapp_id
=
ac
.
uapp_id
;
}
if
(
ac
.
type_
cod
e
){
sql
+=
` and typeCode = :type_
cod
e`
;
sql2
+=
` and b.typeCode = :type_
cod
e`
;
whereParams
.
type_
code
=
ac
.
type_cod
e
;
if
(
ac
.
type_
nam
e
){
sql
+=
` and typeCode = :type_
nam
e`
;
sql2
+=
` and b.typeCode = :type_
nam
e`
;
whereParams
.
type_
name
=
ac
.
type_nam
e
;
}
let
total
=
await
this
.
customQuery
(
sql
,
whereParams
);
let
middle
=
await
this
.
customQuery
(
sql2
,
whereParams
);
let
sql3
=
sql
2
+
` and b.status = 'ycd'`
let
sql3
=
sql
+
` and b.status = 'ycd'`
let
finish
=
await
this
.
customQuery
(
sql3
,
whereParams
);
let
result
=
{
total
:
total
[
0
].
count
,
...
...
@@ -208,13 +208,13 @@ class NeedinfoService extends ServiceBase {
}
/**
* 需求统计(产品
维度
)
* 需求统计(产品
类型
)
* @param pobj
* @returns {Promise<void>}
*/
async
getStatisticsByProduct
(
pobj
){
let
ac
=
pobj
.
actionBody
;
let
sql
=
`select typeName typeCode,uapp_id,count(*) count from n_need_info where type
Cod
e is not null `
;
let
sql
=
`select typeName typeCode,uapp_id,count(*) count from n_need_info where type
Nam
e is not null `
;
let
whereParams
=
{};
if
(
ac
.
start
&&
ac
.
end
){
sql
+=
` and created_at >= :start and created_at <= :end `
;
...
...
@@ -227,6 +227,20 @@ class NeedinfoService extends ServiceBase {
}
/**
* 需求统计(获取产品类型)
* @param pobj
* @returns {Promise<void>}
*/
async
getNeedProductType
(
pobj
){
let
sql
=
`select typeName,count(*) count from n_need_info where typeName is not null GROUP BY typeName`
;
let
result
=
await
this
.
customQuery
(
sql
);
let
typeNames
=
result
.
map
(
item
=>
{
return
item
.
typeName
;
})
return
system
.
getResultSuccess
(
typeNames
);
}
/**
* 需求统计(区域维度)
* @param pobj
* @returns {Promise<void>}
...
...
@@ -240,9 +254,9 @@ class NeedinfoService extends ServiceBase {
whereParams
.
start
=
ac
.
start
;
whereParams
.
end
=
ac
.
end
;
}
if
(
ac
.
type_
cod
e
){
if
(
ac
.
type_
nam
e
){
sql
+=
` and typeCode = :typeCode`
;
whereParams
.
typeCode
=
ac
.
type_
cod
e
;
whereParams
.
typeCode
=
ac
.
type_
nam
e
;
}
if
(
ac
.
uapp_id
){
sql
+=
` and uapp_id = :uapp_id`
;
...
...
@@ -274,10 +288,10 @@ class NeedinfoService extends ServiceBase {
sql2
+=
` and b.uapp_id = :uapp_id`
;
whereParams
.
uapp_id
=
ab
.
uapp_id
;
}
if
(
ab
.
type_
cod
e
){
sql1
+=
` and type
Code = :type_cod
e`
;
sql2
+=
` and b.type
Code = :type_cod
e`
;
whereParams
.
type_
code
=
ab
.
type_cod
e
;
if
(
ab
.
type_
nam
e
){
sql1
+=
` and type
Name = :type_nam
e`
;
sql2
+=
` and b.type
name = :type_nam
e`
;
whereParams
.
type_
name
=
ab
.
type_nam
e
;
}
let
totalRet1
=
await
this
.
customQuery
(
sql1
,
whereParams
);
let
orderRet1
=
await
this
.
customQuery
(
sql2
,
whereParams
);
...
...
@@ -339,12 +353,12 @@ class NeedinfoService extends ServiceBase {
needToOrderTotalSql
+=
` and b.uapp_id = :uapp_id`
;
whereParams
.
uapp_id
=
actionBody
.
uapp_id
;
}
if
(
actionBody
.
type_
cod
e
){
needSql
+=
` and a.type
Code = :type_cod
e`
;
needTotalSql
+=
` and a.type
Code = :type_cod
e`
;
needToOrderSql
+=
` and b.type
Code = :type_cod
e`
;
needToOrderTotalSql
+=
` and b.type
Code = :type_cod
e`
;
whereParams
.
type
_code
=
actionBody
.
type_cod
e
;
if
(
actionBody
.
type_
nam
e
){
needSql
+=
` and a.type
Name = :type_nam
e`
;
needTotalSql
+=
` and a.type
Name = :type_nam
e`
;
needToOrderSql
+=
` and b.type
Name = :type_nam
e`
;
needToOrderTotalSql
+=
` and b.type
Name = :type_nam
e`
;
whereParams
.
type
Name
=
actionBody
.
type_nam
e
;
}
if
(
actionBody
.
fuzzy_code
){
needSql
+=
` and ( a.needNo like :fuzzy_code or a.channelNeedNo like :fuzzy_code or a.publishMobile like :fuzzy_code)`
;
...
...
@@ -374,12 +388,13 @@ class NeedinfoService extends ServiceBase {
}
return
system
.
getResult
(
data
);
}
/**
* 修改需求商机推送状态
* @param actionBody
* @returns {Promise<void>}
*/
async
updateNeedPushStatus
(
actionBody
)
{
/**
* 修改需求商机推送状态
* @param actionBody
* @returns {Promise<void>}
*/
async
updateNeedPushStatus
(
actionBody
)
{
let
channelNeedNo
=
actionBody
.
intentionBizId
;
let
setObj
=
{
status
:
'yts'
,
...
...
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