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
173ed045
Commit
173ed045
authored
Feb 17, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-order' of gitlab.gongsibao.com:jiangyong/zhichan into center-order
parents
3a728563
a5c326da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
+3
-2
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
+11
-3
No files found.
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
View file @
173ed045
...
@@ -47,7 +47,7 @@ class PolicyinfoService extends ServiceBase {
...
@@ -47,7 +47,7 @@ class PolicyinfoService extends ServiceBase {
}
}
async
addPolicyByExcel
(){
async
addPolicyByExcel
(){
var
workbook
=
xl
.
readFile
(
"policy
4
.xls"
)
var
workbook
=
xl
.
readFile
(
"policy
6
.xls"
)
const
sheetNames
=
workbook
.
SheetNames
;
// 返回 ['sheet1', 'sheet2']
const
sheetNames
=
workbook
.
SheetNames
;
// 返回 ['sheet1', 'sheet2']
const
worksheet
=
workbook
.
Sheets
[
sheetNames
[
0
]];
const
worksheet
=
workbook
.
Sheets
[
sheetNames
[
0
]];
var
dataa
=
xl
.
utils
.
sheet_to_json
(
worksheet
);
var
dataa
=
xl
.
utils
.
sheet_to_json
(
worksheet
);
...
@@ -83,4 +83,4 @@ module.exports = PolicyinfoService;
...
@@ -83,4 +83,4 @@ module.exports = PolicyinfoService;
// var task = new PolicyinfoService();
// var task = new PolicyinfoService();
// task.addPolicyByExcel().then(d=>{
// task.addPolicyByExcel().then(d=>{
// console.log("----------end-------------------------");
// console.log("----------end-------------------------");
// })
// })
\ No newline at end of file
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
View file @
173ed045
...
@@ -56,10 +56,14 @@ class PolicyneedService extends ServiceBase {
...
@@ -56,10 +56,14 @@ class PolicyneedService extends ServiceBase {
}
}
var
sql
=
"select * from "
+
var
sql
=
"select * from "
+
"(select id,uapp_id,contacts,customerIntention,customerIntentionName,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"(select id,uapp_id,contacts,customerIntention,customerIntentionName,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"from b_policy_need where uapp_id="
+
app
.
uapp_id
+
" and popularizeUserCode='"
+
user
.
channel_userid
+
"') as need "
+
"from b_policy_need where uapp_id="
+
app
.
uapp_id
+
" and (popularizeUserCode='"
+
user
.
channel_userid
+
"' "
;
if
(
user
.
channel_userid
==
"18611219500"
){
sql
=
sql
+
" or popularizeUserCode is null or popularizeUserCode='' "
;
}
sql
=
sql
+
" )) as need "
+
"LEFT JOIN "
+
"LEFT JOIN "
+
"(select id, policyNo,policyName,policyType,policyTypeName,policySource,policyLinkUrl,"
+
"(select id, policyNo,policyName,policyType,policyTypeName,policySource,policyLinkUrl,"
+
"policyDate,policyProvince,policyCity
,policyContent
from b_policy_info) as policy "
+
"policyDate,policyProvince,policyCity from b_policy_info) as policy "
+
"on need.policy_id=policy.id where 1=1 "
;
"on need.policy_id=policy.id where 1=1 "
;
// var sql = "SELECT * from b_policy_need where popularizeUserCode='"+user.channel_userid+"' and uapp_id="+app.uapp_id;
// var sql = "SELECT * from b_policy_need where popularizeUserCode='"+user.channel_userid+"' and uapp_id="+app.uapp_id;
if
(
obj
.
policyName
){
if
(
obj
.
policyName
){
...
@@ -80,7 +84,11 @@ class PolicyneedService extends ServiceBase {
...
@@ -80,7 +84,11 @@ class PolicyneedService extends ServiceBase {
sql
=
sql
+
" order by need.id desc LIMIT "
+
pageSize
+
" OFFSET "
+
from
+
""
;
sql
=
sql
+
" order by need.id desc LIMIT "
+
pageSize
+
" OFFSET "
+
from
+
""
;
console
.
log
(
sql
);
console
.
log
(
sql
);
var
sqlCount
=
"SELECT count(1) as dataCount FROM b_policy_need where "
+
var
sqlCount
=
"SELECT count(1) as dataCount FROM b_policy_need where "
+
" popularizeUserCode='"
+
user
.
channel_userid
+
"' and uapp_id="
+
app
.
uapp_id
;
" uapp_id="
+
app
.
uapp_id
+
" and (popularizeUserCode='"
+
user
.
channel_userid
+
"'"
;
if
(
user
.
channel_userid
==
"18611219500"
){
sqlCount
=
sqlCount
+
" or popularizeUserCode is null or popularizeUserCode='' "
;
}
sqlCount
=
sqlCount
+
")"
;
var
tmpResult
=
await
this
.
customQuery
(
sql
,{});
var
tmpResult
=
await
this
.
customQuery
(
sql
,{});
var
tmpResultCount
=
await
this
.
customQuery
(
sqlCount
,{});
var
tmpResultCount
=
await
this
.
customQuery
(
sqlCount
,{});
// if (!tmpResult || tmpResult.length == 0) {
// if (!tmpResult || tmpResult.length == 0) {
...
...
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