Commit 2d3da3f6 by 孙亚楠

d

parent 77f33df4
...@@ -87,6 +87,9 @@ class ActionAPI extends APIBase { ...@@ -87,6 +87,9 @@ class ActionAPI extends APIBase {
case "aliOrderPage": // 阿里我的业务订单 case "aliOrderPage": // 阿里我的业务订单
opResult = await this.oorderSve.aliOrderPage(action_body); opResult = await this.oorderSve.aliOrderPage(action_body);
break; break;
case "queryOrderStatusBySourceNo": // 根据sourceNo查询订单状态
opResult = await this.oorderSve.queryOrderStatusBySourceNo(action_body);
break;
case "productDics": // 阿里查询产品字典 case "productDics": // 阿里查询产品字典
opResult = await this.oproductSve.productDics(action_body); opResult = await this.oproductSve.productDics(action_body);
break; break;
......
...@@ -237,5 +237,20 @@ class OorderDao extends Dao { ...@@ -237,5 +237,20 @@ class OorderDao extends Dao {
return list; return list;
} }
/**
* fn:根据订单来源查询状态
* @param params
* @returns {Promise<void>}
*/
async queryOrderStatusBySourceNo(params){
let result = {};
let sql = [];
sql.push(`SELECT t1.id,t1.source_no,t1.status,t2.name,t2.name1,t2.name2,t2.name3,t2.name4 `);
sql.push(`FROM o_order t1 INNER JOIN o_order_process t2 ON t1.id=t2.order_id WHERE t1.status=t2.status `)
if(params.source_nos && params.source_nos.length>0){
sql.push(`and t1.source_no IN(:source_nos) `)
}
return await this.customQuery(sql.join(" "), params);
}
} }
module.exports = OorderDao; module.exports = OorderDao;
\ No newline at end of file
...@@ -925,6 +925,28 @@ class OorderService extends ServiceBase { ...@@ -925,6 +925,28 @@ class OorderService extends ServiceBase {
} }
return await this.aliOrderPageAll(where); return await this.aliOrderPageAll(where);
} }
/**
* fn:根据订单来源查询状态
* @param params
* @returns {Promise<void>}
*/
async queryOrderStatusBySourceNo(params){
if(!params.source_nos && params.source_nos.length<=0){
return system.getResult(null, `参数错误 订单来源不能为空`);
}
try{
let list = await this.dao.queryOrderStatusBySourceNo(params);
let map = {};
for (let item of list) {
map[item.source_no]=item;
}
return system.getResult(map);
}catch (e) {
console.log(e);
return system.getResult(null,`系统错误`)
}
}
} }
module.exports = OorderService; module.exports = OorderService;
\ No newline at end of file
...@@ -905,26 +905,39 @@ class OorderstatusService extends ServiceBase { ...@@ -905,26 +905,39 @@ class OorderstatusService extends ServiceBase {
if (!params.cost_rate) { if (!params.cost_rate) {
return system.getResult(null, `参数错误 核定成本费用率不能为空`); return system.getResult(null, `参数错误 核定成本费用率不能为空`);
} }
//普票个税
if (!params.common_tax_ladder) { if (!params.common_tax_ladder) {
return system.getResult(null, `参数错误 普票个税阶梯不能为空`); return system.getResult(null, `参数错误 普票个税阶梯不能为空`);
}else{ }else{
params.common_tax_ladder = this.formatMoney(params.common_tax_ladder); params.common_tax_ladder = this.formatMoney(params.common_tax_ladder);
} }
//普票增值税&附加税
if (!params.common_other_ladder) { if (!params.common_other_ladder) {
return system.getResult(null, `参数错误 普票增值税、附加税阶梯不能为空`); // return system.getResult(null, `参数错误 普票增值税、附加税阶梯不能为空`);
//TODO:对于小规模个体户提供默认的税价的梯度
}else{ }else{
params.common_other_ladder = this.formatMoney(params.common_other_ladder); params.common_other_ladder = this.formatMoney(params.common_other_ladder);
} }
//专票个税
if (!params.special_tax_ladder) { if (!params.special_tax_ladder) {
return system.getResult(null, `参数错误 专票个税阶梯不能为空`); return system.getResult(null, `参数错误 专票个税阶梯不能为空`);
}else{ }else{
params.special_tax_ladder=this.formatMoney(params.special_tax_ladder); params.special_tax_ladder=this.formatMoney(params.special_tax_ladder);
} }
//专票增值税&附加税
if (!params.special_other_ladder) { if (!params.special_other_ladder) {
return system.getResult(null, `参数错误 专票增值税、附加税阶梯不能为空`); // return system.getResult(null, `参数错误 专票增值税、附加税阶梯不能为空`);
//TODO:对于小规模个体户提供默认的税价的梯度
}else{ }else{
params.special_other_ladder=this.formatMoney(params.special_other_ladder); params.special_other_ladder=this.formatMoney(params.special_other_ladder);
} }
if (!params.add_value_up_type && this.TAXTYPE.indexOf(Number(params.add_value_up_type)) == -1) { if (!params.add_value_up_type && this.TAXTYPE.indexOf(Number(params.add_value_up_type)) == -1) {
return system.getResult(null, `参数错误 增值税累计类型不能为空`); return system.getResult(null, `参数错误 增值税累计类型不能为空`);
} }
......
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