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
ed65d873
Commit
ed65d873
authored
Mar 01, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pushpolicy2fq
parent
373ff7af
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
3 deletions
+63
-3
center-order/app/base/api/api.base.js
+7
-0
center-order/app/base/api/impl/action/policy.js
+3
-0
center-order/app/base/db/models/dbpolicy/policyneed.js
+5
-1
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
+46
-0
center-order/app/base/utils/aliyunClient.js
+2
-2
No files found.
center-order/app/base/api/api.base.js
View file @
ed65d873
...
...
@@ -20,6 +20,13 @@ class APIBase {
return
system
.
getResultSuccess
();
}
}
var
method
=
pobj
.
actionType
;
if
(
method
&&
method
.
length
>
4
)
{
var
prefixStr
=
method
.
substr
(
0
,
4
);
if
(
prefixStr
==
"task"
)
{
return
system
.
getResultSuccess
();
}
}
if
(
!
pobj
.
appInfo
)
{
return
system
.
getResult
(
null
,
"pobj.appInfo can not be empty !!"
);
}
...
...
center-order/app/base/api/impl/action/policy.js
View file @
ed65d873
...
...
@@ -74,6 +74,9 @@ class PolicyAPI extends APIBase {
case
"getPolicyNeedInfo"
:
//政策需求信息(icompany)
opResult
=
this
.
policyneedSve
.
getPolicyNeedInfo
(
pobj
);
break
;
case
"taskpolicyneed2fq"
:
//推送政策需求数据至蜂擎系统(任务)
opResult
=
this
.
policyneedSve
.
taskpolicyneed2fq
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-order/app/base/db/models/dbpolicy/policyneed.js
View file @
ed65d873
...
...
@@ -24,7 +24,11 @@ module.exports = (db, DataTypes) => {
this
.
setDataValue
(
"customerIntention"
,
val
);
this
.
setDataValue
(
"customerIntentionName"
,
uiconfig
.
config
.
pdict
.
customer_intention
[
val
]);
}
},
},
isPushAlready
:
{
//是否已推送
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
false
},
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
...
...
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
View file @
ed65d873
...
...
@@ -4,6 +4,7 @@ class PolicyneedService extends ServiceBase {
constructor
()
{
super
(
"dbpolicy"
,
ServiceBase
.
getDaoName
(
PolicyneedService
));
this
.
policyinfoDao
=
system
.
getObject
(
"db.dbpolicy.policyinfoDao"
);
this
.
oplogDao
=
system
.
getObject
(
"db.common.oplogDao"
);
}
//提交政策需求
async
submitPolicyNeed
(
pobj
){
...
...
@@ -280,5 +281,50 @@ class PolicyneedService extends ServiceBase {
result
.
dataCount
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
return
result
;
}
//推送政策需求数据至蜂擎系统
async
taskpolicyneed2fq
(
pobj
)
{
var
obj
=
pobj
.
actionBody
;
var
limit
=
obj
.
limit
||
100
;
var
pns
=
await
this
.
dao
.
model
.
findAll
({
where
:{
isPushAlready
:
false
},
raw
:
true
,
offset
:
0
,
limit
:
limit
});
for
(
var
i
=
0
;
i
<
pns
.
length
;
i
++
){
var
pn
=
pns
[
i
];
var
needNo
=
await
this
.
getBusUid
(
"pn"
);
var
pobj
=
{
"idempotentId"
:
needNo
,
"idempotentSource"
:
"policyMpm"
,
"idempotentSourceName"
:
"政策_政策申请"
,
"phone"
:
pn
.
mobile
,
"customerName"
:
pn
.
contacts
,
"companyName"
:[
pn
.
company
],
"city"
:
pn
.
region
,
"operator_phone"
:
pn
.
popularizeUserCode
};
var
rtn
=
""
;
try
{
var
rc
=
system
.
getObject
(
"util.aliyunClient"
);
//rtn = await rc.post("https://yunfuapi.gongsibao.com/crm/opportunity/submit", pobj);//线上
rtn
=
await
rc
.
post
(
"https://yunfuapi-dev.gongsibao.com/crm/opportunity/submit"
,
pobj
);
//开发
if
(
rtn
&&
rtn
.
code
==
"200"
){
await
this
.
dao
.
update
({
id
:
pn
.
id
,
isPushAlready
:
true
});
//标记需求数据,已推送
}
}
catch
(
e
)
{
var
logObj
=
{
op
:
"app/base/service/impl/dbpolicy/policyneedSve.js"
,
content
:
JSON
.
stringify
(
rtn
),
resultInfo
:
JSON
.
stringify
(
e
),
opTitle
:
"推送政策需求数据至蜂擎系统--异常"
,
};
await
this
.
oplogDao
.
create
(
logObj
);
}
}
return
system
.
getResultSuccess
();
}
}
module
.
exports
=
PolicyneedService
;
center-order/app/base/utils/aliyunClient.js
View file @
ed65d873
...
...
@@ -2,8 +2,8 @@ const Client = require('aliyun-api-gateway').Client;
var
RPCClient
=
require
(
'@alicloud/pop-core'
).
RPCClient
;
//
const client = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn');//开发
const
client
=
new
Client
(
'203763771'
,
'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu'
);
//线上
const
client
=
new
Client
(
'203756805'
,
'crkyej0xlmqa6bmvqijun6ltxparllyn'
);
//开发
//
const client = new Client('203763771', 'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu');//线上
class
aliyunClient
{
constructor
()
{
// this.aliReqUrl = "https://aliapi.gongsibao.com/tm/springboard";
...
...
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