Commit 11977b6a by 任晓松

全类保护

parent 4045e432
......@@ -30,6 +30,9 @@ class OrderAPI extends APIBase {
case "getNclByCode":
opResult = await this.orderinfoSve.getNclByCode(pobj);
break;
case "getAllNcl":
opResult = await this.orderinfoSve.getAllNcl(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -1857,7 +1857,7 @@ class OrderInfoService extends ServiceBase {
return system.getResultSuccess();
}
//智能选择、全类保护 尼斯类获取
//智能选择 尼斯类获取
async getNclByCode(pobj){
var sql = "select `business_code`,`ncl_content` from b_business_ncl where business_code=:business_code LIMIT 1";
var paramWhere = { business_code: pobj.actionBody.businessCode };
......@@ -1867,5 +1867,30 @@ class OrderInfoService extends ServiceBase {
}
return system.getResult(result[0].ncl_content);
}
//智能选择 尼斯类获取
async getAllNcl(pobj){
var sql = "select `ncl_content` from b_business_ncl where business_code like '%类%'";
var result = await this.customQuery(sql);
if(Object.keys(result).length==0){
return system.getResultFail(-1,'find err');
}
let ret = []
result.forEach(item =>{
let Arr=item.ncl_content.nclThree;
let arrNew=[];
for(var i=0;i<10;i++)
{
var _num = Math.floor(Math.random()*Arr.length)
var mm = Arr[_num];
Arr.splice(_num,1)
arrNew.push(mm)
}
item.ncl_content.nclThree = arrNew;
ret.push(item.ncl_content);
})
return system.getResult(ret);
}
}
module.exports = OrderInfoService;
\ No newline at end of file
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