Commit a7b6ce11 by 孙亚楠

dd

parent c04cc53f
...@@ -20,8 +20,8 @@ class OorderstatusService extends ServiceBase { ...@@ -20,8 +20,8 @@ class OorderstatusService extends ServiceBase {
this.BUSI_TYPE = 1; //个体公商户类型 this.BUSI_TYPE = 1; //个体公商户类型
this.ISBANK = true; //银行开户 this.ISBANK = true; //银行开户
this.TAXTYPE = [1, 2]; //个税和增值税类别集合 this.TAXTYPE = [1, 2]; //个税和增值税类别集合
this.PALTFORM_DELIVER_AUDIT_SUCCESS_CODE = "1150"; //平台交付审核成功状态码 this.PALTFORM_DELIVER_AUDIT_SUCCESS_CODE = "1160"; //平台交付审核成功状态码
this.PALTFORM_DELIVER_AUDIT_FILE_CODE = "1140"; //平台交付审核失败状态码 this.PALTFORM_DELIVER_AUDIT_FILE_CODE = "1150"; //平台交付审核失败状态码
} }
/***************************************以下是订单处理的分发器***************************************************************** */ /***************************************以下是订单处理的分发器***************************************************************** */
...@@ -310,15 +310,15 @@ class OorderstatusService extends ServiceBase { ...@@ -310,15 +310,15 @@ class OorderstatusService extends ServiceBase {
if (!params.deliver_mail_mobile) { if (!params.deliver_mail_mobile) {
return system.getResult(null, `参数错误 联系电话不能为空`); return system.getResult(null, `参数错误 联系电话不能为空`);
} }
oorderDeliverProperty.audit_remark = this.trim(audit_remark); oorderDeliverProperty.audit_remark = this.trim(params.audit_remark);
oorderDeliverProperty.deliver_content = this.trim(deliver_content); oorderDeliverProperty.deliver_content = this.trim(params.deliver_content);
oorderDeliverProperty.deliver_mail_addr = this.trim(deliver_mail_addr); oorderDeliverProperty.deliver_mail_addr = this.trim(params.deliver_mail_addr);
oorderDeliverProperty.deliver_mail_to = this.trim(deliver_mail_to); oorderDeliverProperty.deliver_mail_to = this.trim(params.deliver_mail_to);
oorderDeliverProperty.deliver_mail_mobile = this.trim(deliver_mail_mobile); oorderDeliverProperty.deliver_mail_mobile = this.trim(params.deliver_mail_mobile);
} else if (this.trim(params.status) == this.PALTFORM_DELIVER_AUDIT_FILE_CODE) {//失败 } else if (this.trim(params.status) == this.PALTFORM_DELIVER_AUDIT_FILE_CODE) {//失败
// todo somthing... // todo somthing...
oorderDeliverProperty.audit_result = params.nextName;
if (!this.trim(params.audit_remark)) { if (!this.trim(params.audit_remark)) {
return system.getResult(null, `参数错误 交付审核备注不能为空`); return system.getResult(null, `参数错误 交付审核备注不能为空`);
} }
...@@ -327,6 +327,7 @@ class OorderstatusService extends ServiceBase { ...@@ -327,6 +327,7 @@ class OorderstatusService extends ServiceBase {
return system.getResult(null, `参数错误 非法的订单状态`); return system.getResult(null, `参数错误 非法的订单状态`);
} }
oorderDeliverProperty.id = params._order.deliver_id; oorderDeliverProperty.id = params._order.deliver_id;
oorderDeliverProperty.audit_result = params.nextName;
let orderProperty = {}; let orderProperty = {};
orderProperty.id = params.id; orderProperty.id = params.id;
orderProperty.status = this.trim(params.status); orderProperty.status = this.trim(params.status);
...@@ -335,7 +336,7 @@ class OorderstatusService extends ServiceBase { ...@@ -335,7 +336,7 @@ class OorderstatusService extends ServiceBase {
let self = this; let self = this;
await this.db.transaction(async t => { await this.db.transaction(async t => {
//更新交付orderdeliver记录 //更新交付orderdeliver记录
await self.oorderdeliverDao.create(oorderDeliverProperty, t); await self.oorderdeliverDao.update(oorderDeliverProperty, t);
//更新oorder订单记录 //更新oorder订单记录
await self.dao.update(orderProperty, t); await self.dao.update(orderProperty, t);
}); });
...@@ -347,6 +348,116 @@ class OorderstatusService extends ServiceBase { ...@@ -347,6 +348,116 @@ class OorderstatusService extends ServiceBase {
} }
/**
* 平台验收
* @param {*} params
*/
async platformAuditDetermine(params) {
if (!params.id) {
return system.getResult(null, `参数错误 订单ID不能为空`);
}
if (!params.status) {
return system.getResult(null, `参数错误 订单状态不能为空`);
}
let orderDeliverProperty={};
orderDeliverProperty.completed_at=new Date();
orderDeliverProperty.id=params._order.id;
let orderProperty = {};
orderProperty.status = this.trim(params.status);
orderProperty.id = this.trim(params._order.id);
try {
await this.db.transaction(async t=>{
await this.dao.update(orderProperty,t);
await this.oorderdeliverDao.update(orderDeliverProperty,t);
});
return system.getResultSuccess();
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 客户交付
* @param {*} params
*/
async deliverCustomer(params) {
if (!params.id) {
return system.getResult(null, `参数错误 订单ID不能为空`);
}
if (!params.status) {
return system.getResult(null, `参数错误 订单状态不能为空`);
}
if (!params.guest_mail_no) {
return system.getResult(null, `参数错误 客户快递单号不能为空`);
}
if (!params.guest_mail_img) {
return system.getResult(null, `参数错误 交付商交付快递单号图片不能为空`);
}
let oorderInforegProperty = {};
oorderInforegProperty.id = this.trim(params._order.id);
oorderInforegProperty.guest_mail_no = this.trim(params.guest_mail_no);
oorderInforegProperty.guest_mail_img = this.trim(params.guest_mail_img);
let oorderProperty = {};
oorderProperty.status = this.trim(params.status);
oorderProperty.id = params._order.id;
try {
await this.db.transaction(async t => {
await this.oorderinforegDao.update(oorderInforegProperty, t);
await this.dao.update(oorderProperty, t);
});
return system.getResultSuccess();
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 订单完成
* @param {*} params
*/
async orderComplete(params) {
if (!params.id) {
return system.getResult(null, `参数错误 订单ID不能为空`);
}
if (!params.status) {
return system.getResult(null, `参数错误 订单状态不能为空`);
}
if (!params.guest_accpet_file) {
return system.getResult(null, `参数错误 客户验收文件不能为空`);
}
let oorderInforegProperty = {};
oorderInforegProperty.id = this.trim(params._order.id);
oorderInforegProperty.guest_accpet_file = this.trim(params.guest_accpet_file);
let oorderProperty = {};
oorderProperty.status = this.trim(params.status);
oorderProperty.id = params._order.id;
try {
await this.db.transaction(async t => {
await this.oorderinforegDao.update(oorderInforegProperty, t);
await this.dao.update(oorderProperty, t);
});
return system.getResultSuccess();
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**********************************以下是交付商订单业务处理******************************************************** */ /**********************************以下是交付商订单业务处理******************************************************** */
/** /**
...@@ -378,7 +489,7 @@ class OorderstatusService extends ServiceBase { ...@@ -378,7 +489,7 @@ class OorderstatusService extends ServiceBase {
orderProperty.id = this.trim(params._order.id); orderProperty.id = this.trim(params._order.id);
await this.db.transaction(async t => { await this.db.transaction(async t => {
await _oorderdeliver.update(orderProperty, t); await _oorderdeliver.update(orderProperty, t);
await _order.update(orderProperty, t); await this.dao.update(orderProperty, t);
}); });
return system.getResultSuccess(); return system.getResultSuccess();
} catch (error) { } catch (error) {
...@@ -796,8 +907,8 @@ class OorderstatusService extends ServiceBase { ...@@ -796,8 +907,8 @@ class OorderstatusService extends ServiceBase {
return system.getResult(null, `参数错误 交付商交付快递单号图片不能为空`); return system.getResult(null, `参数错误 交付商交付快递单号图片不能为空`);
} }
let oorderDeliverProperty = {}; let oorderDeliverProperty = {};
oorderDeliverProperty.deliver_mail_no = this.trim(deliver_mail_no); oorderDeliverProperty.deliver_mail_no = this.trim(params.deliver_mail_no);
oorderDeliverProperty.deliver_mail_img = this.trim(deliver_mail_img); oorderDeliverProperty.deliver_mail_img = this.trim(params.deliver_mail_img);
let _order = params._order; let _order = params._order;
oorderDeliverProperty.id = _order.deliver_id; oorderDeliverProperty.id = _order.deliver_id;
...@@ -808,8 +919,8 @@ class OorderstatusService extends ServiceBase { ...@@ -808,8 +919,8 @@ class OorderstatusService extends ServiceBase {
try { try {
await this.db.transaction(async t => { await this.db.transaction(async t => {
await this.oorderdeliverDao.update(orderdeliverProperty, t); await this.oorderdeliverDao.update(oorderDeliverProperty, t);
await this.oorderdeliverDao.update(orderProperty, t); await this.dao.update(orderProperty, t);
}); });
return system.getResultSuccess(); return system.getResultSuccess();
} catch (error) { } catch (error) {
......
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