Commit 8bd8714e by 孙亚楠

ddg

parent b5220f75
......@@ -196,9 +196,10 @@ class OrderCtl extends CtlBase {
// return system.getResult(null, `参数错误 工商官方文件不能为空`);
// }
pobj.bd_id = req.loginUser.id;
pobj.bd_path = req.loginUser.orgpath;
if(!pobj.deliver_id){
return system.getResult(null,`请重新登录`);
}
pobj.deliver_id = pobj.deliver_id;
try {
return await this.orderSve.handleStatus(pobj);
} catch (error) {
......@@ -542,6 +543,9 @@ class OrderCtl extends CtlBase {
}
pobj.deliver_id = pobj.deliverId;
pobj.deliver_name = pobj.deliverName || "";
pobj.delier_user_id = pobj.delier_user_id || "";
pobj.deliver_user_path = pobj.deliver_user_path || "";
try {
return await this.orderSve.addSourceOrder(pobj);
} catch (error) {
......@@ -572,9 +576,117 @@ class OrderCtl extends CtlBase {
}
}
/**
* ali建账
* @param pobj
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async accountCreation (pobj, pobj2, req){
if(!pobj.id){
return system.getResult(null,`订单【${pobj.id}】不存在`)
}
if(!pobj.status){
return system.getResult(null,`订单状态不能为空`)
}
if(!pobj.province){
return system.getResult(null,`省份不能为空`)
}
try {
return await this.orderSve.handleStatus(pobj);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* ali客户交付
* @param {*} params
*/
async orderComplete(pobj, pobj2, req) {
if (!pobj.id) {
return system.getResult(null, `参数错误 订单ID不能为空`);
}
if (!pobj.status) {
return system.getResult(null, `参数错误 订单状态不能为空`);
}
if (!pobj.guest_mail_no) {
return system.getResult(null, `参数错误 客户快递单号不能为空`);
}
if (!pobj.guest_mail_img) {
return system.getResult(null, `参数错误 交付商交付快递单号图片不能为空`);
}
try {
return await this.orderSve.handleStatus(pobj);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 阿里 全部订单
* @returns {Promise<void>}
*/
async aliOrderPageAll(pobj, pobj2, req){
var condition = {
currentPage: Number(pobj.currentPage || 1),
pageSize: Number(pobj.pageSize || 10),
deliver_id: pobj.deliver_id,
}
if(pobj.createdBegin){
condition.createdBegin = this.trim(pobj.createdBegin);
}
if(pobj.createdEnd){
condition.createdEnd = this.trim(pobj.createdEnd);
}
if(pobj.status){
condition.status = this.trim(pobj.status);
}
this.doTimeCondition(condition, ["createdBegin", "createdEnd"]);
return await this.orderSve.aliOrderPageAll(condition);
}
/**
* 阿里 我的业务订单
* @returns {Promise<void>}
*/
async aliOrderPage(pobj, pobj2, req){
//1.2010~2090状态
let statusMap = {
"1":"2010", //待完善
"2":"2020",//工商注册
"3":"2030",//刻章办理
"4":"2040",//银行开户
"5":"2050",//税务报道
"6":"2060",//核定税种
"7":"2070",//建帐
"8":"2080",//客户交付
"9":"2090"//订单完成
};
if(!statusMap[pobj.status]){
return system.getResult(null, `订单状态错误`);
}
var condition = {
currentPage: Number(pobj.currentPage || 1),
pageSize: Number(pobj.pageSize || 10),
deliver_id: pobj.deliver_id,
status:statusMap[pobj.status],
isMain:pobj.isMain,
isManager:pobj.isManager,
delier_user_id:pobj.delier_user_id,
deliver_user_path:pobj.deliver_user_path
}
if(pobj.createdBegin){
condition.createdBegin = this.trim(pobj.createdBegin);
}
if(pobj.createdEnd){
condition.createdEnd = this.trim(pobj.createdEnd);
}
this.doTimeCondition(condition, ["createdBegin", "createdEnd"]);
return await this.orderSve.aliOrderPage(condition);
}
}
module.exports = OrderCtl;
\ No newline at end of file
......@@ -137,5 +137,22 @@ class OrderService extends ServiceBase {
}
}
async aliOrderPageAll(params){
try {
return await this.callms("order", "aliOrderPageAll", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async aliOrderPage(params){
try {
return await this.callms("order", "aliOrderPage", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = OrderService;
\ No newline at end of file
......@@ -105,6 +105,10 @@ module.exports = function (app) {
req.body.deliverId = req.loginUser.deliver_id || "";
req.body.deliver_id = req.loginUser.deliver_id || "";
req.body.deliverName = req.loginUser.deliver.name ||"";
req.body.delier_user_id = req.loginUser.id || "";
req.body.deliver_user_path = req.loginUser.org_path || "";
req.body.isManager = req.loginUser.isManager;
req.body.isAdmin = req.loginUser.isAdmin;
}
params.push(methodName);
......
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