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
e04b93bf
Commit
e04b93bf
authored
Feb 26, 2021
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
腾讯需求导入
parent
24f432f1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
2 deletions
+74
-2
center-order/app/base/api/impl/action/need.js
+3
-0
center-order/app/base/db/dao.base.js
+12
-0
center-order/app/base/db/metadata/apps/platform.js
+9
-2
center-order/app/base/service/impl/dbneed/needinfoSve.js
+50
-0
No files found.
center-order/app/base/api/impl/action/need.js
View file @
e04b93bf
...
@@ -77,6 +77,9 @@ class IcAPI extends APIBase {
...
@@ -77,6 +77,9 @@ class IcAPI extends APIBase {
case
"queryExpertApplyCommunicationLogs"
:
// 查询需求沟通记录 2020-10-28 laolan
case
"queryExpertApplyCommunicationLogs"
:
// 查询需求沟通记录 2020-10-28 laolan
opResult
=
await
this
.
needinfoSve2
.
queryExpertApplyCommunicationLogs
(
pobj
,
pobj
.
actionBody
,
req
);
opResult
=
await
this
.
needinfoSve2
.
queryExpertApplyCommunicationLogs
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
break
;
case
"bulkCreateNeeds"
:
opResult
=
await
this
.
needinfoSve
.
bulkCreateNeeds
(
pobj
);
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
...
...
center-order/app/base/db/dao.base.js
View file @
e04b93bf
...
@@ -26,6 +26,18 @@ class Dao {
...
@@ -26,6 +26,18 @@ class Dao {
});
});
}
}
}
}
async
bulkCreate
(
u
,
t
){
if
(
t
!=
null
&&
t
!=
'undefined'
)
{
return
this
.
model
.
bulkCreate
(
u
,
{
transaction
:
t
}).
then
(
u
=>
{
return
u
;
});
}
else
{
return
this
.
model
.
bulkCreate
(
u
).
then
(
u
=>
{
``
return
u
;
});
}
}
static
getModelName
(
ClassObj
)
{
static
getModelName
(
ClassObj
)
{
return
ClassObj
[
"name"
].
substring
(
0
,
ClassObj
[
"name"
].
lastIndexOf
(
"Dao"
)).
toLowerCase
()
return
ClassObj
[
"name"
].
substring
(
0
,
ClassObj
[
"name"
].
lastIndexOf
(
"Dao"
)).
toLowerCase
()
}
}
...
...
center-order/app/base/db/metadata/apps/platform.js
View file @
e04b93bf
...
@@ -84,7 +84,13 @@ module.exports = {
...
@@ -84,7 +84,13 @@ module.exports = {
// 诊断结果
// 诊断结果
"diagnosis_result"
:
{
"tg"
:
"通过"
,
"wtg"
:
"未通过"
,
"rgshz"
:
"人工审核中"
},
"diagnosis_result"
:
{
"tg"
:
"通过"
,
"wtg"
:
"未通过"
,
"rgshz"
:
"人工审核中"
},
// 诊断处理状态
// 诊断处理状态
"diagnosis_status"
:
{
"dcl"
:
"待处理"
,
"gtz"
:
"沟通中"
,
"dqrfa"
:
"待确认方案"
,
"ygb"
:
"已关闭"
,
"ywc"
:
"已完成"
}
"diagnosis_status"
:
{
"dcl"
:
"待处理"
,
"gtz"
:
"沟通中"
,
"dqrfa"
:
"待确认方案"
,
"ygb"
:
"已关闭"
,
"ywc"
:
"已完成"
},
},
//腾讯需求商机状态名称
"tx_need_status_name"
:{
"待处理"
:
"已推送"
,
"跟进中"
:
"已跟进"
,
"待用户确认"
:
"已跟进"
,
"已成交"
:
"已成单"
,
"已关闭"
:
"已关闭"
},
//腾讯需求商机状态码
"tx_need_status"
:{
"待处理"
:
"yts"
,
"跟进中"
:
"ygj"
,
"待用户确认"
:
"ygj"
,
"已成交"
:
"ycd"
,
"已关闭"
:
"ygb"
},
//腾讯产品码
"tx_product"
:{
"公司注册"
:
"gszc"
,
"跟进中"
:
"kzfu"
,
"税务报道"
:
"swbd"
,
"税控申请"
:
"sksq"
,
"代理记账"
:
"dljz"
,
"银行开户"
:
"yhkh"
,
"工商变更"
:
"gsbg"
,
"工商年报"
:
"gsnb"
,
"社保开户"
:
"sbkh"
,
"云上园区服务"
:
"ysgszc"
,
"icp"
:
"icpsq"
,
"edi"
:
"edisq"
,
"icp年报"
:
"icpnb"
,
"edi年报"
:
"edinb"
},
},
}
}
}
}
\ No newline at end of file
center-order/app/base/service/impl/dbneed/needinfoSve.js
View file @
e04b93bf
...
@@ -3,6 +3,8 @@ const system = require("../../../system");
...
@@ -3,6 +3,8 @@ const system = require("../../../system");
const
ServiceBase
=
require
(
"../../sve.base"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
settings
=
require
(
"../../../../config/settings"
);
var
moment
=
require
(
'moment'
)
var
moment
=
require
(
'moment'
)
const
uiconfig
=
require
(
"../../../db/metadata/apps/platform"
);
class
NeedinfoService
extends
ServiceBase
{
class
NeedinfoService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"dbneed"
,
ServiceBase
.
getDaoName
(
NeedinfoService
));
super
(
"dbneed"
,
ServiceBase
.
getDaoName
(
NeedinfoService
));
...
@@ -357,6 +359,54 @@ class NeedinfoService extends ServiceBase {
...
@@ -357,6 +359,54 @@ class NeedinfoService extends ServiceBase {
return
system
.
getResult
(
null
,
"operationType参数错误"
);
return
system
.
getResult
(
null
,
"operationType参数错误"
);
}
}
}
}
/**
* 批量需求导入
* @param pobj
* @returns {Promise<void>}
*/
async
bulkCreateNeeds
(
pobj
){
const
tx_product
=
uiconfig
.
config
.
pdict
.
tx_product
;
const
tx_need_status
=
uiconfig
.
config
.
pdict
.
tx_need_status
;
const
tx_need_status_name
=
uiconfig
.
config
.
pdict
.
tx_need_status_name
;
let
needsArr
=
[];
let
arr
=
pobj
.
actionBody
.
needsArr
;
let
uapp_id
=
pobj
.
actionBody
.
uapp_id
;
let
sql
=
'select channelNeedNo from n_need_info where uapp_id = 53'
;
let
ret
=
await
this
.
customQuery
(
sql
);
let
existIds
=
ret
.
map
(
item
=>
{
return
item
.
channelNeedNo
;
})
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
){
let
item
=
arr
[
i
];
let
typeCode
=
tx_product
[
item
.
productType
];
let
obj
=
{
"uapp_id"
:
uapp_id
,
"needNo"
:
""
,
"channelNeedNo"
:
item
.
number
,
"publishContent"
:
item
.
companyName
,
"publishName"
:
item
.
personName
,
"publishMobile"
:
item
.
personMobile
,
"statusName"
:
tx_need_status_name
[
item
.
status
],
"STATUS"
:
tx_need_status
[
item
.
status
],
"typeCode"
:
typeCode
,
"typeName"
:
item
.
productType
,
"created_at"
:
item
.
createdAt
};
if
([
"icp"
,
"edi"
,
"icp年报"
,
"edi年报"
].
includes
(
item
.
productType
)){
obj
.
province
=
item
.
area
;
}
else
{
obj
.
city
=
item
.
area
;
}
if
(
!
existIds
.
includes
(
item
.
number
)){
needsArr
.
push
(
obj
);
}
}
let
result
=
await
this
.
dao
.
bulkCreate
(
needsArr
);
return
system
.
getResult
(
result
);
}
}
}
module
.
exports
=
NeedinfoService
;
module
.
exports
=
NeedinfoService
;
...
...
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