Commit 3e2ea648 by 庄冰

policyQuery

parent ebcf149a
...@@ -12,7 +12,7 @@ class PolicyinfoService extends ServiceBase { ...@@ -12,7 +12,7 @@ class PolicyinfoService extends ServiceBase {
var obj = pobj.actionBody; var obj = pobj.actionBody;
var app = pobj.appInfo; var app = pobj.appInfo;
var paramObj={uapp_id:app.uapp_id}; var paramObj={uapp_id:app.uapp_id};
var attributes =["id","policyType","policyTypeName","policyDate","policyContent","policyCity","policyProvince", var attributes =["id","policyType","policyTypeName","policyDate","policyCity","policyProvince",
"policyLinkUrl","policySource","policyName","policyNo"]; "policyLinkUrl","policySource","policyName","policyNo"];
if(obj){ if(obj){
if(obj.policyProvince){ if(obj.policyProvince){
...@@ -22,7 +22,10 @@ class PolicyinfoService extends ServiceBase { ...@@ -22,7 +22,10 @@ class PolicyinfoService extends ServiceBase {
} }
} }
if(obj.policyName){ if(obj.policyName){
paramObj["policyName"]={ [this.db.Op.like]: "%" + obj.policyName + "%" }; paramObj[this.db.Op.or]=[
{policyName:{ [this.db.Op.like]: "%" + obj.policyName + "%" }},
{policyContent:{ [this.db.Op.like]: "%" + obj.policyName + "%" }}
];
} }
console.log(paramObj); console.log(paramObj);
} }
...@@ -44,7 +47,7 @@ class PolicyinfoService extends ServiceBase { ...@@ -44,7 +47,7 @@ class PolicyinfoService extends ServiceBase {
} }
async addPolicyByExcel(){ async addPolicyByExcel(){
var workbook = xl.readFile("policy2.xls") var workbook = xl.readFile("policy4.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);
...@@ -58,9 +61,9 @@ class PolicyinfoService extends ServiceBase { ...@@ -58,9 +61,9 @@ class PolicyinfoService extends ServiceBase {
uapp_id:26,policyNo:data['政策编号'],policyName:data['政策名称'], uapp_id:26,policyNo:data['政策编号'],policyName:data['政策名称'],
policySource:data['政策出处'],policyLinkUrl:data['政策链接'], policySource:data['政策出处'],policyLinkUrl:data['政策链接'],
policyProvince:data['所属省份'],policyCity:data['所属城市'], policyProvince:data['所属省份'],policyCity:data['所属城市'],
policyTypeName:data['政策类型']}; policyTypeName:data['政策类型'],policyContent:data['内容']};
if(data['政策类型']){ if(data['政策类型']){
var policy_type ={'租金减免':'fzbt','金融贷款':'jrdk','扶持措施':'zdfc','税收优惠':'ssjm','人力资源':'rlzy'}; var policy_type ={'租金减免':'fzbt','金融贷款':'jrdk','行政措施':'zdfc','税收优惠':'ssjm','人力资源':'rlzy'};
var typename = data['政策类型']; var typename = data['政策类型'];
if(policy_type[typename]){ if(policy_type[typename]){
pobj["policyType"]=policy_type[typename]; pobj["policyType"]=policy_type[typename];
...@@ -72,7 +75,7 @@ class PolicyinfoService extends ServiceBase { ...@@ -72,7 +75,7 @@ class PolicyinfoService extends ServiceBase {
} }
} }
}) })
console.log(arr[0],"###################################");
console.log(arr.length,"###################################"); console.log(arr.length,"###################################");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment