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
d9b9ebc3
Commit
d9b9ebc3
authored
Feb 20, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
policy notes
parent
0b9c9acc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
+1
-2
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
+22
-7
No files found.
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
View file @
d9b9ebc3
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
var
xl
=
require
(
'xlsx'
);
var
xl
=
require
(
'xlsx'
);
var
fs
=
require
(
'fs'
);
class
PolicyinfoService
extends
ServiceBase
{
class
PolicyinfoService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"dbpolicy"
,
ServiceBase
.
getDaoName
(
PolicyinfoService
));
super
(
"dbpolicy"
,
ServiceBase
.
getDaoName
(
PolicyinfoService
));
...
@@ -47,7 +46,7 @@ class PolicyinfoService extends ServiceBase {
...
@@ -47,7 +46,7 @@ class PolicyinfoService extends ServiceBase {
}
}
async
addPolicyByExcel
(){
async
addPolicyByExcel
(){
var
workbook
=
xl
.
readFile
(
"policy6.xls"
)
var
workbook
=
xl
.
readFile
(
"policy6.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
);
...
...
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
View file @
d9b9ebc3
...
@@ -58,38 +58,52 @@ class PolicyneedService extends ServiceBase {
...
@@ -58,38 +58,52 @@ class PolicyneedService extends ServiceBase {
"policy.policyLinkUrl,policy.policyDate,policy.policyProvince,policy.policyCity from "
+
"policy.policyLinkUrl,policy.policyDate,policy.policyProvince,policy.policyCity 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
+
"' "
;
"from b_policy_need where uapp_id="
+
app
.
uapp_id
+
" and (popularizeUserCode='"
+
user
.
channel_userid
+
"' "
;
var
sqlCount
=
"select count(1) as dataCount from "
+
"(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
+
"' "
;
if
(
user
.
channel_userid
==
"18611219500"
){
if
(
user
.
channel_userid
==
"18611219500"
){
sql
=
sql
+
" or popularizeUserCode is null or popularizeUserCode='' "
;
sql
=
sql
+
" or popularizeUserCode is null or popularizeUserCode='' "
;
sqlCount
=
sqlCount
+
" or popularizeUserCode is null or popularizeUserCode='' "
;
}
}
sql
=
sql
+
" )) as need "
+
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 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 "
;
sqlCount
=
sqlCount
+
" )) as need "
+
"LEFT JOIN "
+
"(select id, policyNo,policyName,policyType,policyTypeName,policySource,policyLinkUrl,"
+
"policyDate,policyProvince,policyCity from b_policy_info) as policy "
+
"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
){
sql
=
sql
+
" and policyName like '%"
+
obj
.
policyName
+
"%'"
;
sql
=
sql
+
" and policyName like '%"
+
obj
.
policyName
+
"%'"
;
sqlCount
=
sqlCount
+
" and policyName like '%"
+
obj
.
policyName
+
"%'"
;
}
}
if
(
obj
.
policyProvince
){
if
(
obj
.
policyProvince
){
sql
=
sql
+
" and policyProvince ='"
+
obj
.
policyProvince
+
"'"
;
sql
=
sql
+
" and policyProvince ='"
+
obj
.
policyProvince
+
"'"
;
sqlCount
=
sqlCount
+
" and policyProvince ='"
+
obj
.
policyProvince
+
"'"
;
if
(
obj
.
policyCity
){
if
(
obj
.
policyCity
){
sql
=
sql
+
" and policyCity ='"
+
obj
.
policyCity
+
"'"
;
sql
=
sql
+
" and policyCity ='"
+
obj
.
policyCity
+
"'"
;
sqlCount
=
sqlCount
+
" and policyCity ='"
+
obj
.
policyCity
+
"'"
;
}
}
}
}
if
(
obj
.
policyType
){
if
(
obj
.
policyType
){
sql
=
sql
+
" and policyType = '"
+
obj
.
policyType
+
"'"
;
sql
=
sql
+
" and policyType = '"
+
obj
.
policyType
+
"'"
;
sqlCount
=
sqlCount
+
" and policyType = '"
+
obj
.
policyType
+
"'"
;
}
}
if
(
obj
.
customerIntention
){
if
(
obj
.
customerIntention
){
sql
=
sql
+
" and customerIntention = '"
+
obj
.
customerIntention
+
"'"
;
sql
=
sql
+
" and customerIntention = '"
+
obj
.
customerIntention
+
"'"
;
sqlCount
=
sqlCount
+
" and customerIntention = '"
+
obj
.
customerIntention
+
"'"
;
}
}
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 " +
" uapp_id="
+
app
.
uapp_id
+
" and (popularizeUserCode='"
+
user
.
channel_userid
+
"'"
;
//
" uapp_id="+app.uapp_id+" and (popularizeUserCode='"+user.channel_userid+"'";
if
(
user
.
channel_userid
==
"18611219500"
){
//
if(user.channel_userid=="18611219500"){
sqlCount
=
sqlCount
+
" or popularizeUserCode is null or popularizeUserCode='' "
;
//
sqlCount=sqlCount+" or popularizeUserCode is null or popularizeUserCode='' ";
}
//
}
sqlCount
=
sqlCount
+
")"
;
//
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) {
...
@@ -133,7 +147,8 @@ class PolicyneedService extends ServiceBase {
...
@@ -133,7 +147,8 @@ class PolicyneedService extends ServiceBase {
if
(
policyneed
.
opNotes
){
if
(
policyneed
.
opNotes
){
var
notes
=
JSON
.
parse
(
policyneed
.
opNotes
);
var
notes
=
JSON
.
parse
(
policyneed
.
opNotes
);
var
noteList
=
notes
.
data
;
var
noteList
=
notes
.
data
;
noteList
.
push
(
noteparam
);
// noteList.push(noteparam);
noteList
.
splice
(
0
,
0
,
noteparam
);
paramObj
[
"opNotes"
]
=
JSON
.
stringify
({
data
:
noteList
});
paramObj
[
"opNotes"
]
=
JSON
.
stringify
({
data
:
noteList
});
}
else
{
}
else
{
paramObj
[
"opNotes"
]
=
JSON
.
stringify
({
data
:[
noteparam
]});
paramObj
[
"opNotes"
]
=
JSON
.
stringify
({
data
:[
noteparam
]});
...
...
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