Commit 74bb9bac by 孙亚楠

d

parent 4feda5f9
...@@ -38,6 +38,9 @@ class ObusinessmenDao extends Dao { ...@@ -38,6 +38,9 @@ class ObusinessmenDao extends Dao {
} }
setCondition(sql, params) { setCondition(sql, params) {
if (params.saas_id) {
sql.push("AND t1.saas_id = :saas_id");
}
if (params.order_id) { if (params.order_id) {
sql.push("AND t1.order_id = :order_id"); sql.push("AND t1.order_id = :order_id");
} }
...@@ -84,12 +87,15 @@ class ObusinessmenDao extends Dao { ...@@ -84,12 +87,15 @@ class ObusinessmenDao extends Dao {
* 通过统一社会信用代码 * 通过统一社会信用代码
* @param {*} CreditCode * @param {*} CreditCode
*/ */
async findByCreditCode(credit_code){ async findByCreditCode(credit_code,saas_id){
let sql = []; let sql = [];
sql.push("SELECT"); sql.push("SELECT");
sql.push("t1.*"); sql.push("t1.*");
sql.push("FROM `o_businessmen` t1"); sql.push("FROM `o_businessmen` t1");
sql.push("WHERE credit_code = :credit_code"); sql.push("WHERE t1.credit_code = :credit_code");
if(saas_id){
sql.push("WHERE t1.saas_id = :saas_id")
}
return await this.customQuery(sql.join(" "), {credit_code:credit_code}); return await this.customQuery(sql.join(" "), {credit_code:credit_code});
} }
......
...@@ -204,10 +204,12 @@ class OorderDao extends Dao { ...@@ -204,10 +204,12 @@ class OorderDao extends Dao {
sql.push("AND t2.deliver_user_id = :deliver_user_id"); sql.push("AND t2.deliver_user_id = :deliver_user_id");
} }
if (params.deliver_user_path) { if (params.deliver_user_path) {
// sql.push("AND t2.delier_user_id like ':deliver_user_path%'");
params.deliver_user_path_like = params.deliver_user_path + "%"; params.deliver_user_path_like = params.deliver_user_path + "%";
sql.push("AND t2.deliver_user_path like :deliver_user_path_like"); sql.push("AND t2.deliver_user_path like :deliver_user_path_like");
} }
if (params.saas_id) {
sql.push("AND t1.saas_id = :saas_id");
}
} }
/** /**
......
...@@ -51,6 +51,7 @@ class OorderdeliverDao extends Dao { ...@@ -51,6 +51,7 @@ class OorderdeliverDao extends Dao {
return []; return [];
} }
let sql = `SELECT * FROM o_order_deliver WHERE id in (:deliverIdList)`; let sql = `SELECT * FROM o_order_deliver WHERE id in (:deliverIdList)`;
return await this.customQuery(sql, { deliverIdList: ids }); return await this.customQuery(sql, { deliverIdList: ids });
} }
...@@ -121,6 +122,10 @@ class OorderdeliverDao extends Dao { ...@@ -121,6 +122,10 @@ class OorderdeliverDao extends Dao {
if (params.createdEnd) { if (params.createdEnd) {
sql.push(`AND b.created_at <= :createdEnd`); sql.push(`AND b.created_at <= :createdEnd`);
} }
if (params.saas_id) {
sql.push(`AND b.saas_id = :saas_id`);
sql.push(`AND a.saas_id = :saas_id`);
}
} }
/** /**
......
...@@ -3,37 +3,37 @@ ...@@ -3,37 +3,37 @@
* 订单表 * 订单表
*/ */
module.exports = function (db, DataTypes) { module.exports = function (db, DataTypes) {
return db.define('oorder', { return db.define('oorder', {
merchant_id: {type: DataTypes.STRING, field: 'merchant_id', allowNull: true, defaultValue:'',comment:'商户id, 为了兼容司机宝' }, merchant_id: {type: DataTypes.STRING, field: 'merchant_id', allowNull: true, defaultValue:'',comment:'商户id, 为了兼容司机宝' },
// order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: true, comment:'订单ID' }, saas_id: {type: DataTypes.STRING, field: 'saas_id', allowNull: true, defaultValue:'',comment:'SAAS_ID' },
busi_type: {type: DataTypes.STRING, field: 'busi_type', allowNull: true,defaultValue:'', comment:'业务类型 1个体户 2...暂不知道' }, busi_type: {type: DataTypes.STRING, field: 'busi_type', allowNull: true,defaultValue:'', comment:'业务类型 1个体户 2...暂不知道' },
busi_id: { type: DataTypes.STRING, field: 'busi_id', allowNull: false,defaultValue:'', comment:'业务id'}, busi_id: { type: DataTypes.STRING, field: 'busi_id', allowNull: false,defaultValue:'', comment:'业务id'},
product_id: {type: DataTypes.BIGINT, field: 'product_id', allowNull: true,defaultValue:0, comment:'产品id'}, product_id: {type: DataTypes.BIGINT, field: 'product_id', allowNull: true,defaultValue:0, comment:'产品id'},
price: { type: DataTypes.BIGINT, field: 'price', allowNull: true, defaultValue:0,comment:'订单价格'}, price: { type: DataTypes.BIGINT, field: 'price', allowNull: true, defaultValue:0,comment:'订单价格'},
status: {type: DataTypes.INTEGER, field: 'status', allowNull: true, defaultValue:'0',comment:'订单状态 业务进度' }, status: {type: DataTypes.INTEGER, field: 'status', allowNull: true, defaultValue:'0',comment:'订单状态 业务进度' },
assign_time: {type: DataTypes.DATE, field: 'assign_time', allowNull: true, defaultValue:null, comment:'分配时间' }, assign_time: {type: DataTypes.DATE, field: 'assign_time', allowNull: true, defaultValue:null, comment:'分配时间' },
assign_user_id: {type: DataTypes.BIGINT, field: 'assign_user_id', allowNull: true, defaultValue:'0', comment:'分配人id' }, assign_user_id: {type: DataTypes.BIGINT, field: 'assign_user_id', allowNull: true, defaultValue:'0', comment:'分配人id' },
deliver_id: {type: DataTypes.STRING, field: 'deliver_id', allowNull: true, defaultValue:'', comment:'交付商id common微服务下' }, deliver_id: {type: DataTypes.STRING, field: 'deliver_id', allowNull: true, defaultValue:'', comment:'交付商id common微服务下' },
desc: {type: DataTypes.STRING, field: 'desc', allowNull: true, defaultValue:'', comment:'订单信息' }, desc: {type: DataTypes.STRING, field: 'desc', allowNull: true, defaultValue:'', comment:'订单信息' },
bd_id: {type: DataTypes.INTEGER, field: 'bd_id', allowNull: true, defaultValue:'', comment:'业务员id' }, bd_id: {type: DataTypes.INTEGER, field: 'bd_id', allowNull: true, defaultValue:'', comment:'业务员id' },
bd_path: {type: DataTypes.STRING, field: 'bd_path', allowNull: true, defaultValue:'', comment:'业务员权限路径' }, bd_path: {type: DataTypes.STRING, field: 'bd_path', allowNull: true, defaultValue:'', comment:'业务员权限路径' },
service_items: {type: DataTypes.STRING, field: 'service_items', allowNull: true, defaultValue:'', comment:'服务项json' }, service_items: {type: DataTypes.STRING, field: 'service_items', allowNull: true, defaultValue:'', comment:'服务项json' },
service_remark: {type: DataTypes.STRING, field: 'service_remark', allowNull: true, defaultValue:'', comment:'服务信息备注' }, service_remark: {type: DataTypes.STRING, field: 'service_remark', allowNull: true, defaultValue:'', comment:'服务信息备注' },
source_id: {type: DataTypes.BIGINT, field: 'source_id', allowNull: true, defaultValue:0, comment:'来源id' }, source_id: {type: DataTypes.BIGINT, field: 'source_id', allowNull: true, defaultValue:0, comment:'来源id' },
source_no: {type: DataTypes.STRING, field: 'source_no', allowNull: true, defaultValue:'', comment:'来源订单号' }, source_no: {type: DataTypes.STRING, field: 'source_no', allowNull: true, defaultValue:'', comment:'来源订单号' },
contact_mobile: {type: DataTypes.STRING, field: 'contact_mobile', allowNull: true, defaultValue:'', comment:'联系电话' }, contact_mobile: {type: DataTypes.STRING, field: 'contact_mobile', allowNull: true, defaultValue:'', comment:'联系电话' },
customer_name: {type: DataTypes.STRING, field: 'customer_name', allowNull: true, defaultValue:'', comment:'客户名称' }, customer_name: {type: DataTypes.STRING, field: 'customer_name', allowNull: true, defaultValue:'', comment:'客户名称' },
saas_deliver_api: {type: DataTypes.STRING, field: 'saas_deliver_api', allowNull: true, defaultValue:'', comment:'saas系统状态通知api' }, saas_deliver_api: {type: DataTypes.STRING, field: 'saas_deliver_api', allowNull: true, defaultValue:'', comment:'saas系统状态通知api' },
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW }, created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW },
updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW }, updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW },
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true } deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true }
}, },
{ {
paranoid: true, //假的删除 paranoid: true, //假的删除
underscored: true, underscored: true,
version: true, version: true,
freezeTableName: true, freezeTableName: true,
tableName: 'o_order', tableName: 'o_order',
}); });
} }
...@@ -3,33 +3,34 @@ ...@@ -3,33 +3,34 @@
* 订单交付表 * 订单交付表
*/ */
module.exports = function (db, DataTypes) { module.exports = function (db, DataTypes) {
return db.define('oorderdeliver', { return db.define('oorderdeliver', {
order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: false,comment:'订单ID' }, order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: false,comment:'订单ID' },
deliver_id: {type: DataTypes.STRING, field: 'deliver_id', allowNull: false, comment:'交付商id' }, saas_id: {type: DataTypes.STRING, field: 'saas_id', allowNull: true, defaultValue:'',comment:'SAAS_ID' },
deliver_name: { type: DataTypes.STRING, field: 'deliver_name', allowNull: false, comment:'交付商名称'}, deliver_id: {type: DataTypes.STRING, field: 'deliver_id', allowNull: false, comment:'交付商id' },
deliver_divide: {type: DataTypes.STRING, field: 'deliver_divide', allowNull: false,comment:'订单分成' }, deliver_name: { type: DataTypes.STRING, field: 'deliver_name', allowNull: false, comment:'交付商名称'},
audit_result: { type: DataTypes.STRING, field: 'audit_result', allowNull: true,defaultValue:'', comment:'审核结果'}, deliver_divide: {type: DataTypes.STRING, field: 'deliver_divide', allowNull: false,comment:'订单分成' },
audit_remark: {type: DataTypes.STRING, field: 'audit_remark', allowNull: true,defaultValue:'', comment:'交付审核备注'}, audit_result: { type: DataTypes.STRING, field: 'audit_result', allowNull: true,defaultValue:'', comment:'审核结果'},
deliver_mail_addr: { type: DataTypes.STRING, field: 'deliver_mail_addr', allowNull: true, defaultValue:'',comment:'交付地址'}, audit_remark: {type: DataTypes.STRING, field: 'audit_remark', allowNull: true,defaultValue:'', comment:'交付审核备注'},
deliver_mail_to: {type: DataTypes.STRING, field: 'deliver_mail_to', allowNull: true, defaultValue:'',comment:'收件人' }, deliver_mail_addr: { type: DataTypes.STRING, field: 'deliver_mail_addr', allowNull: true, defaultValue:'',comment:'交付地址'},
deliver_mail_mobile: { type: DataTypes.STRING, field: 'deliver_mail_mobile', allowNull: true, defaultValue:'', comment:'联系电话'}, deliver_mail_to: {type: DataTypes.STRING, field: 'deliver_mail_to', allowNull: true, defaultValue:'',comment:'收件人' },
deliver_content: {type: DataTypes.STRING, field: 'deliver_content', allowNull: true, defaultValue:'', comment:'交付内容' }, deliver_mail_mobile: { type: DataTypes.STRING, field: 'deliver_mail_mobile', allowNull: true, defaultValue:'', comment:'联系电话'},
deliver_mail_no: {type: DataTypes.STRING, field: 'deliver_mail_no', allowNull: true, defaultValue:'', comment:'交付商交付快递单号' }, deliver_content: {type: DataTypes.STRING, field: 'deliver_content', allowNull: true, defaultValue:'', comment:'交付内容' },
deliver_mail_img: {type: DataTypes.STRING, field: 'deliver_mail_img', allowNull: true, defaultValue:'', comment:'交付商交付快递单号图片' }, deliver_mail_no: {type: DataTypes.STRING, field: 'deliver_mail_no', allowNull: true, defaultValue:'', comment:'交付商交付快递单号' },
completed_at: { type: DataTypes.DATE, field: 'completed_at', allowNull: true, comment:'订单的完成时间' }, deliver_mail_img: {type: DataTypes.STRING, field: 'deliver_mail_img', allowNull: true, defaultValue:'', comment:'交付商交付快递单号图片' },
operator_id: { type: DataTypes.STRING, field: 'operator_id', allowNull: true, comment:'业务员id' }, completed_at: { type: DataTypes.DATE, field: 'completed_at', allowNull: true, comment:'订单的完成时间' },
operator_path: { type: DataTypes.STRING, field: 'operator_path', allowNull: true, comment:'交付商业务员组织机构path' }, operator_id: { type: DataTypes.STRING, field: 'operator_id', allowNull: true, comment:'业务员id' },
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW }, operator_path: { type: DataTypes.STRING, field: 'operator_path', allowNull: true, comment:'交付商业务员组织机构path' },
updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW }, created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW },
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true } updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW },
}, deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true }
{ },
timestamps: false, {
underscore: true, timestamps: false,
paranoid: true, underscore: true,
version: true, paranoid: true,
tableName: 'o_order_deliver', version: true,
comment: '订单交付表', tableName: 'o_order_deliver',
}); comment: '订单交付表',
});
} }
...@@ -3,38 +3,39 @@ ...@@ -3,38 +3,39 @@
* 订单信息明细表 * 订单信息明细表
*/ */
module.exports = function (db, DataTypes) { module.exports = function (db, DataTypes) {
return db.define('oorderinforeg', { return db.define('oorderinforeg', {
legal_name: {type: DataTypes.STRING, field: 'legal_name', allowNull: true, defaultValue:'',comment:'法人姓名' }, saas_id: {type: DataTypes.STRING, field: 'saas_id', allowNull: true, defaultValue:'',comment:'SAAS_ID' },
id_card: {type: DataTypes.STRING, field: 'id_card', allowNull: true, comment:'法人身份证' }, legal_name: {type: DataTypes.STRING, field: 'legal_name', allowNull: true, defaultValue:'',comment:'法人姓名' },
legal_mobile: { type: DataTypes.STRING, field: 'legal_mobile', allowNull: true, defaultValue:'', comment:'法人电话'}, id_card: {type: DataTypes.STRING, field: 'id_card', allowNull: true, comment:'法人身份证' },
names: {type: DataTypes.STRING, field: 'names', allowNull: true,defaultValue:'', comment:'个体户名称' }, legal_mobile: { type: DataTypes.STRING, field: 'legal_mobile', allowNull: true, defaultValue:'', comment:'法人电话'},
capital: { type: DataTypes.STRING, field: 'capital', allowNull: false,defaultValue:'', comment:'注册资本'}, names: {type: DataTypes.STRING, field: 'names', allowNull: true,defaultValue:'', comment:'个体户名称' },
domicile_id: {type: DataTypes.STRING, field: 'domicile_id', allowNull: true,defaultValue:'', comment:'注册地id'}, capital: { type: DataTypes.STRING, field: 'capital', allowNull: false,defaultValue:'', comment:'注册资本'},
domicile_name: { type: DataTypes.STRING, field: 'domicile_name', allowNull: true, defaultValue:'',comment:'注册地名称'}, domicile_id: {type: DataTypes.STRING, field: 'domicile_id', allowNull: true,defaultValue:'', comment:'注册地id'},
business_scope_id: {type: DataTypes.STRING, field: 'business_scope_id', allowNull: true, defaultValue:'',comment:'经营范围id' }, domicile_name: { type: DataTypes.STRING, field: 'domicile_name', allowNull: true, defaultValue:'',comment:'注册地名称'},
business_type: { type: DataTypes.STRING, field: 'business_type', allowNull: true, defaultValue:'', comment:'经营范围'}, business_scope_id: {type: DataTypes.STRING, field: 'business_scope_id', allowNull: true, defaultValue:'',comment:'经营范围id' },
business_scope: {type: DataTypes.STRING, field: 'business_scope', allowNull: true, defaultValue:'', comment:'经营范围详情' }, business_type: { type: DataTypes.STRING, field: 'business_type', allowNull: true, defaultValue:'', comment:'经营范围'},
idcard_front: {type: DataTypes.STRING, field: 'idcard_front', allowNull: true, defaultValue:'', comment:'身份证正面照片' }, business_scope: {type: DataTypes.STRING, field: 'business_scope', allowNull: true, defaultValue:'', comment:'经营范围详情' },
idcard_back: {type: DataTypes.STRING, field: 'idcard_back', allowNull: true, defaultValue:'', comment:'身份证反面照片' }, idcard_front: {type: DataTypes.STRING, field: 'idcard_front', allowNull: true, defaultValue:'', comment:'身份证正面照片' },
other_file: {type: DataTypes.STRING, field: 'other_file', allowNull: true, defaultValue:'', comment:'其他文件' }, idcard_back: {type: DataTypes.STRING, field: 'idcard_back', allowNull: true, defaultValue:'', comment:'身份证反面照片' },
notes: {type: DataTypes.STRING, field: 'notes', allowNull: true, defaultValue:'', comment:'备注' }, other_file: {type: DataTypes.STRING, field: 'other_file', allowNull: true, defaultValue:'', comment:'其他文件' },
guest_mail_addr: {type: DataTypes.STRING, field: 'guest_mail_addr', allowNull: true, defaultValue:'', comment:'邮寄客户地址' }, notes: {type: DataTypes.STRING, field: 'notes', allowNull: true, defaultValue:'', comment:'备注' },
guest_mail_to: {type: DataTypes.STRING, field: 'guest_mail_to', allowNull: true, defaultValue:'', comment:'客户收件人' }, guest_mail_addr: {type: DataTypes.STRING, field: 'guest_mail_addr', allowNull: true, defaultValue:'', comment:'邮寄客户地址' },
guest_mail_mobile: {type: DataTypes.STRING, field: 'guest_mail_mobile', allowNull: true, defaultValue:'', comment:'客户收件人电话' }, guest_mail_to: {type: DataTypes.STRING, field: 'guest_mail_to', allowNull: true, defaultValue:'', comment:'客户收件人' },
guest_mail_no: {type: DataTypes.STRING, field: 'guest_mail_no', allowNull: true, defaultValue:'', comment:'客户快递单号' }, guest_mail_mobile: {type: DataTypes.STRING, field: 'guest_mail_mobile', allowNull: true, defaultValue:'', comment:'客户收件人电话' },
guest_mail_img: {type: DataTypes.STRING, field: 'guest_mail_img', allowNull: true, defaultValue:'', comment:'交付商交付快递单号图片' }, guest_mail_no: {type: DataTypes.STRING, field: 'guest_mail_no', allowNull: true, defaultValue:'', comment:'客户快递单号' },
guest_accpet_file: {type: DataTypes.STRING, field: 'guest_accpet_file', allowNull: true, defaultValue:'', comment:'客户验收文件' }, guest_mail_img: {type: DataTypes.STRING, field: 'guest_mail_img', allowNull: true, defaultValue:'', comment:'交付商交付快递单号图片' },
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW }, guest_accpet_file: {type: DataTypes.STRING, field: 'guest_accpet_file', allowNull: true, defaultValue:'', comment:'客户验收文件' },
updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW }, created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW },
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true } updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW },
}, deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true }
{ },
timestamps: false, {
underscore: true, timestamps: false,
paranoid: true, underscore: true,
version: true, paranoid: true,
tableName: 'o_order_info_reg', version: true,
comment: '订单信息明细表', tableName: 'o_order_info_reg',
}); comment: '订单信息明细表',
});
} }
...@@ -62,10 +62,13 @@ class ObusinessmenService extends ServiceBase { ...@@ -62,10 +62,13 @@ class ObusinessmenService extends ServiceBase {
* 根据统一社会信用代码查记录 * 根据统一社会信用代码查记录
* @param {*} params * @param {*} params
* @Id 个体户ID * @Id 个体户ID
* @Saas_id
*/ */
async queryObusinessmenByCreditCode(params) { async queryObusinessmenByCreditCode(params) {
let credit_code = this.trim(params.credit_code) || "";
let saas_id = this.trim(params.saas_id) || "";
try { try {
let obj = await this.dao.findByCreditCode(this.trim(params.credit_code)); let obj = await this.dao.findByCreditCode(credit_code,saas_id);
if(obj && obj.length>0){ if(obj && obj.length>0){
this.handleDate(obj[0], ["created_at", "assignTime","reg_date","tax_reg_day","updated_at"], null, -8); this.handleDate(obj[0], ["created_at", "assignTime","reg_date","tax_reg_day","updated_at"], null, -8);
}else{ }else{
...@@ -111,6 +114,9 @@ class ObusinessmenService extends ServiceBase { ...@@ -111,6 +114,9 @@ class ObusinessmenService extends ServiceBase {
} }
let _obusinessmen = await this.dao.findById(this.trim(params.id)); let _obusinessmen = await this.dao.findById(this.trim(params.id));
if(_obusinessmen.saas_id != this.trim(params.saas_id)){
return system.getResult(null, `【${saas_id}】错误`);
}
let _order = await this.oorderDao.model.findOne({ let _order = await this.oorderDao.model.findOne({
where:{ where:{
id:_obusinessmen.order_id id:_obusinessmen.order_id
...@@ -296,17 +302,22 @@ class ObusinessmenService extends ServiceBase { ...@@ -296,17 +302,22 @@ class ObusinessmenService extends ServiceBase {
} }
/** /**
* fn:推送财税系统建账
* @param {*} params * @param {*} params
* @id 个体户id * @id 个体户id
*/ */
async updateOBusinessmenProinvce(params){ async updateOBusinessmenProinvce(params){
let where = {};
if(!params.id){ if(!params.id){
return system.getResult(null,`参数错误 个体户ID非法`); return system.getResult(null,`参数错误 个体户ID非法`);
}else{
where.id = this.trim(params.id);
}
if(params.saas_id){
where.saas_id = this.trim(params.saas_id);
} }
let bean = await this.dao.model.findOne({ let bean = await this.dao.model.findOne({
where:{ where:where
id:this.trim(params.id)
}
}); });
if(!bean){ if(!bean){
......
...@@ -52,6 +52,7 @@ class OorderService extends ServiceBase { ...@@ -52,6 +52,7 @@ class OorderService extends ServiceBase {
* @params customer_name 客户名称 * @params customer_name 客户名称
*/ */
async addSourceOrder(params) { async addSourceOrder(params) {
// 整理参数 // 整理参数
let order = { let order = {
merchant_id: "", merchant_id: "",
...@@ -69,6 +70,7 @@ class OorderService extends ServiceBase { ...@@ -69,6 +70,7 @@ class OorderService extends ServiceBase {
order.saas_deliver_api = this.trim(params.saas_deliver_api); order.saas_deliver_api = this.trim(params.saas_deliver_api);
order.service_items = this.trim(params.service_items); order.service_items = this.trim(params.service_items);
order.ali_deliver_api = this.trim(params.ali_deliver_api) || ""; order.ali_deliver_api = this.trim(params.ali_deliver_api) || "";
order.saas_id = this.trim(params.saas_id) || "";
// 验证订单是否存在 // 验证订单是否存在
let exists = await this.dao.findOne({ source_id: order.source_id, source_no: order.source_no }); let exists = await this.dao.findOne({ source_id: order.source_id, source_no: order.source_no });
if (exists) { if (exists) {
...@@ -125,6 +127,7 @@ class OorderService extends ServiceBase { ...@@ -125,6 +127,7 @@ class OorderService extends ServiceBase {
deliver_divide:self.trim(params.deliver_divide) || 0, deliver_divide:self.trim(params.deliver_divide) || 0,
delier_user_id : self.trim(params.delier_user_id), delier_user_id : self.trim(params.delier_user_id),
deliver_user_path: self.trim(params.deliver_user_path), deliver_user_path: self.trim(params.deliver_user_path),
saas_id: self.trim(params.saas_id)
}, t); }, t);
await self.dao.update({id:order.id,deliver_id:_oorderdeliver.id},t); await self.dao.update({id:order.id,deliver_id:_oorderdeliver.id},t);
} }
...@@ -154,7 +157,7 @@ class OorderService extends ServiceBase { ...@@ -154,7 +157,7 @@ class OorderService extends ServiceBase {
obj.guest_mail_addr = this.trim(params.guest_mail_addr) || ""; obj.guest_mail_addr = this.trim(params.guest_mail_addr) || "";
obj.guest_mail_to= this.trim(params.guest_mail_to) || ""; obj.guest_mail_to= this.trim(params.guest_mail_to) || "";
obj.guest_mail_mobile= this.trim(params.guest_mail_mobile) || ""; obj.guest_mail_mobile= this.trim(params.guest_mail_mobile) || "";
obj.saas_id= this.trim(params.saas_id) || "";
// 这些字段在交付系统里暂时没有 // 这些字段在交付系统里暂时没有
// `bank_front` '银行卡正面照片', // `bank_front` '银行卡正面照片',
// `bank_back` '银行卡背面照片', // `bank_back` '银行卡背面照片',
...@@ -402,6 +405,9 @@ class OorderService extends ServiceBase { ...@@ -402,6 +405,9 @@ class OorderService extends ServiceBase {
[this.db.Op.like]: this.trim(params.bd_path) + "%" [this.db.Op.like]: this.trim(params.bd_path) + "%"
} }
} }
if (params.saas_id) {
where.saas_id = this.trim(params.saas_id);
}
var currentPage = Number(params.currentPage || 1); var currentPage = Number(params.currentPage || 1);
var pageSize = Number(params.pageSize || 10); var pageSize = Number(params.pageSize || 10);
...@@ -852,7 +858,6 @@ class OorderService extends ServiceBase { ...@@ -852,7 +858,6 @@ class OorderService extends ServiceBase {
element.price = system.f2y(element.price); element.price = system.f2y(element.price);
element.odeliver.deliver_divide = system.f2y(element.odeliver.deliver_divide); element.odeliver.deliver_divide = system.f2y(element.odeliver.deliver_divide);
element.orderInfoReg.capital = system.f2y(element.orderInfoReg.capital); element.orderInfoReg.capital = system.f2y(element.orderInfoReg.capital);
} }
return system.getResult({count: countRes.count, rows: list}); return system.getResult({count: countRes.count, rows: list});
}catch (e) { }catch (e) {
...@@ -895,7 +900,9 @@ class OorderService extends ServiceBase { ...@@ -895,7 +900,9 @@ class OorderService extends ServiceBase {
statusArray:params.statusArray, statusArray:params.statusArray,
id:this.trim(params.id), id:this.trim(params.id),
createdBegin:params.createdBegin, createdBegin:params.createdBegin,
createdEnd:params.createdEnd createdEnd:params.createdEnd,
saas_id:params.saas_id
}; };
if(!params.isManager){//如果是管理员 则可能看到所有的数据 if(!params.isManager){//如果是管理员 则可能看到所有的数据
if(params.isMain){ //如果是主管 则可以看到自己和下属的所有的订单 if(params.isMain){ //如果是主管 则可以看到自己和下属的所有的订单
......
...@@ -33,6 +33,9 @@ class OorderdeliverService extends ServiceBase { ...@@ -33,6 +33,9 @@ class OorderdeliverService extends ServiceBase {
} else { } else {
return system.getResult(null, `参数错误 交付商ID不能为空`); return system.getResult(null, `参数错误 交付商ID不能为空`);
} }
if(params.saas_id){
where.saas_id = this.trim(params.saas_id);
}
//交付商订单表条件 //交付商订单表条件
if (params.createdBegin && params.createdEnd) { if (params.createdBegin && params.createdEnd) {
where.createdBegin = this.trim(params.createdBegin); where.createdBegin = this.trim(params.createdBegin);
......
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