Commit 6de828a0 by 孙亚楠

dd

parent bfcfea3d
......@@ -53,7 +53,7 @@ module.exports = (db, DataTypes) => {
saas_deliver_api: {type: DataTypes.STRING, field: 'saas_deliver_api', allowNull: true, defaultValue:'', comment:'saas系统状态通知api' },
ali_deliver_api:{ type: DataTypes.STRING, allowNull: true, defaultValue: null ,comment:"发票状态更新回调api"},
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, allowNull: true },
}, {
timestamps: false,
......
......@@ -6,6 +6,7 @@ module.exports = function (db, DataTypes) {
return db.define('iprocess', {
name: { type: DataTypes.STRING, field: 'name', allowNull: false, defaultValue: '', comment: '流程名称' },
status: { type: DataTypes.STRING, field: 'status', allowNull: false, defaultValue: '', comment: '流程状态' },
product_id:{type: DataTypes.STRING, field: 'product_id', allowNull: false, defaultValue: '', comment: '所属产品一级分类'},
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 },
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true }
......
......@@ -16,7 +16,7 @@ class IInvoiceService extends ServiceBase {
this.iinvoicedeliverDao = system.getObject("db.invoice.iinvoicedeliverDao");
this.RULE_INVOICE_TYPE = ["10", '20', '30']; //发票类型
this.RULE_BUSINESSMEN_TYPE = ['10', '20']; //销售方类型
this.DEFAULT_PRODUCT_ID = "50010000"; //默认产品ID
this.DEFAULT_PRODUCT_ID = "50020000"; //默认产品ID
this.iproductDao = system.getObject("db.product.iproductDao");
this.iprocessDao = system.getObject("db.product.iprocessDao");
this.iproductprocessDao = system.getObject("db.product.iproductprocessDao");
......@@ -152,6 +152,23 @@ class IInvoiceService extends ServiceBase {
await this.iinvoiceprocessDao.model.bulkCreate(processList, {
transaction: t
});
//如果存在交付商信息这需要创建交付商记录
if(params.deliver_id){
let iinvoicedeliverProperty = {
invoice_id:_invoice.id,
deliver_id:params.deliver_id,
deliver_name:params.deliverName,
deliver_delive:0
};
let iinvoicedeliver = await this.iinvoicedeliverDao.create(iinvoicedeliverProperty, t);
//将id和交付商商id回写到发票表种
let _invoiceProperty = {
id:_invoice.id,
invoice_deliver_id:iinvoicedeliver.id,
deliver_id:params.deliver_id
}
await this.dao.update(_invoiceProperty, t);
}
});
return system.getResult(`success`);
} catch (error) {
......
......@@ -424,6 +424,10 @@ class IinvoicestatusService extends ServiceBase {
if (!params.operator_id) {
return system.getResult(null, `参数错误 业务员ID不能为空`);
}
if (!params.operator_path) {
return system.getResult(null, `参数错误 业务员URL不能为空`);
}
try {
let _iinvoicedeliver = await this.iinvoicedeliverDao.model.findOne({
where: {
......@@ -435,6 +439,7 @@ class IinvoicestatusService extends ServiceBase {
}
let invoicedeliverProperty = {};
invoicedeliverProperty.operator_id = this.trim(params.operator_id);
invoicedeliverProperty.operator_path = this.trim(params.operator_path);
invoicedeliverProperty.id = _iinvoicedeliver.id;
let invoiceProperty = {};
......
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