Commit ab9f04a3 by 孙亚楠

dd

parent fbb1b57a
...@@ -5,6 +5,7 @@ class ActionAPI extends APIBase { ...@@ -5,6 +5,7 @@ class ActionAPI extends APIBase {
constructor() { constructor() {
super(); super();
this.iinvoiceSve = system.getObject("service.invoice.iinvoiceSve"); this.iinvoiceSve = system.getObject("service.invoice.iinvoiceSve");
this.iinvoicestatusSve = system.getObject("service.invoice.iinvoicestatusSve");
this.iinvoicedeliverSve = system.getObject("service.invoice.iinvoicedeliverSve"); this.iinvoicedeliverSve = system.getObject("service.invoice.iinvoicedeliverSve");
this.iproductSve = system.getObject("service.product.iproductSve"); this.iproductSve = system.getObject("service.product.iproductSve");
...@@ -39,8 +40,8 @@ class ActionAPI extends APIBase { ...@@ -39,8 +40,8 @@ class ActionAPI extends APIBase {
opResult = await this.iinvoicedeliverSve.invoicePage(action_body); opResult = await this.iinvoicedeliverSve.invoicePage(action_body);
break; break;
case "handleStatus": //进度处理 case "handleStatus": //进度处理
opResult = await this.iinvoicestatusSve.handleStatus(action_body);
break; break;
case "productDics": // 查询产品字典 case "productDics": // 查询产品字典
// opResult = await this.oproductSve.productDics(action_body); // opResult = await this.oproductSve.productDics(action_body);
break; break;
......
...@@ -41,7 +41,7 @@ module.exports = (db, DataTypes) => { ...@@ -41,7 +41,7 @@ module.exports = (db, DataTypes) => {
value_added_tax: { type: DataTypes.BIGINT, allowNull: false, defaultValue: null, COMMENT: '增值税' }, value_added_tax: { type: DataTypes.BIGINT, allowNull: false, defaultValue: null, COMMENT: '增值税' },
mail_addr: { type: DataTypes.STRING(200), allowNull: true, defaultValue: null, COMMENT: '邮寄地址' }, mail_addr: { type: DataTypes.STRING(200), allowNull: true, defaultValue: null, COMMENT: '邮寄地址' },
mail_mobile: { type: DataTypes.STRING(20), allowNull: true, defaultValue: null, COMMENT: '邮寄电话' }, mail_mobile: { type: DataTypes.STRING(20), allowNull: true, defaultValue: null, COMMENT: '邮寄电话' },
mail_to: { type: DataTypes.STRING(20), allowNull: true, defaultValue: null, COMMENT: '邮寄人' }, mail_to: { type: DataTypes.STRING(45), allowNull: true, defaultValue: null, COMMENT: '邮寄人' },
statements: { type: DataTypes.STRING(45), allowNull: true, defaultValue: null, COMMENT: '结算单' }, statements: { type: DataTypes.STRING(45), allowNull: true, defaultValue: null, COMMENT: '结算单' },
invoice_img: { type: DataTypes.STRING(500), allowNull: true, defaultValue: null,COMMENT:'发票图片'}, invoice_img: { type: DataTypes.STRING(500), allowNull: true, defaultValue: null,COMMENT:'发票图片'},
invoice_deliver_id:{ type: DataTypes.STRING(32), allowNull: true, defaultValue: null,comment:"交付id i_invoice_deliver 表ID" }, invoice_deliver_id:{ type: DataTypes.STRING(32), allowNull: true, defaultValue: null,comment:"交付id i_invoice_deliver 表ID" },
......
...@@ -5,19 +5,18 @@ const uiconfig = system.getUiConfig2(settings.appKey); ...@@ -5,19 +5,18 @@ const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("iinvoicedeliver", { return db.define("iinvoicedeliver", {
// id: { type: DataTypes.STRING(32), field: 'id', allowNull: true },
invoice_id: { type: DataTypes.STRING, field: 'invoice_id', allowNull: true, comment: '发票id' }, invoice_id: { type: DataTypes.STRING, field: 'invoice_id', allowNull: true, comment: '发票id' },
deliver_id: { type: DataTypes.STRING, field: 'deliver_id', allowNull: true, comment: '交付商id' }, deliver_id: { type: DataTypes.STRING, field: 'deliver_id', allowNull: true, comment: '交付商id' },
deliver_name: { type: DataTypes.STRING, field: 'deliver_name', allowNull: true, comment: '交付商id' }, deliver_name: { type: DataTypes.STRING, field: 'deliver_name', allowNull: true, comment: '交付商id' },
deliver_divide: { type: DataTypes.BIGINT, field: 'deliver_divide', allowNull: true, comment: '交付商分成' }, deliver_delive: { type: DataTypes.BIGINT, field: 'deliver_delive', allowNull: true, defaultValue:0, comment: '交付商分成' },
deliver_mail_addr: { type: DataTypes.STRING, field: 'deliver_mail_addr', allowNull: false, comment: '交付地址' }, deliver_mail_addr: { type: DataTypes.STRING, field: 'deliver_mail_addr', allowNull: true, comment: '交付地址' },
deliver_mail_to: { type: DataTypes.STRING, field: 'deliver_mail_to', allowNull: true, comment: '收件人' }, deliver_mail_to: { type: DataTypes.STRING, field: 'deliver_mail_to', allowNull: true, comment: '收件人' },
deliver_mail_mobile: { type: DataTypes.STRING, field: 'deliver_mail_mobile', allowNull: true, comment: '联系电话' }, deliver_mail_mobile: { type: DataTypes.STRING, field: 'deliver_mail_mobile', allowNull: true, comment: '联系电话' },
audit_content: { type: DataTypes.STRING, field: 'audit_content', allowNull: true, defaultValue: "", comment: '交付审核内容' }, audit_content: { type: DataTypes.STRING, field: 'audit_content', allowNull: true, defaultValue: "", comment: '交付审核内容' },
deliver_content: { type: DataTypes.STRING, field: 'deliver_content', allowNull: true, defaultValue: "", comment: '交付内容' }, deliver_content: { type: DataTypes.STRING, field: 'deliver_content', allowNull: true, defaultValue: "", comment: '交付内容' },
deliver_mail_no: { type: DataTypes.STRING, field: 'deliver_mail_no', allowNull: true, defaultValue: "", comment: '交付商交付快递单号' }, deliver_mail_no: { type: DataTypes.STRING, field: 'deliver_mail_no', allowNull: true, defaultValue: "", comment: '交付商交付快递单号' },
deliver_img: { type: DataTypes.STRING, field: 'deliver_img', allowNull: true, defaultValue: "", comment: '交接单' }, deliver_img: { type: DataTypes.STRING, field: 'deliver_img', allowNull: true, defaultValue: "", comment: '交接单' },
operator_id: { type: DataTypes.STRING, field: 'operator_id', allowNull: true, defaultValue: "", comment: '交付商业务员id' }, operator_id: { type: DataTypes.STRING, field: 'operator_id', allowNull: true, defaultValue:"", comment: '交付商业务员id' },
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 },
......
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
*/ */
module.exports = function (db, DataTypes) { module.exports = function (db, DataTypes) {
return db.define('iinvoiceinforeg', { return db.define('iinvoiceinforeg', {
// invoice_id: { type: DataTypes.STRING, allowNull: true, comment: '订单号' },
deliver_id: { type: DataTypes.STRING, allowNull: true, comment: '交付商id' },
deliver_name: { type: DataTypes.STRING, allowNull: true, comment: '交付商名称' },
deliver_divide: { type: DataTypes.BIGINT, allowNull: true, comment: '订单分成' },
deliver_mail_addr: { type: DataTypes.STRING, allowNull: true, comment: '交付地址' }, deliver_mail_addr: { type: DataTypes.STRING, allowNull: true, comment: '交付地址' },
deliver_mail_to: { type: DataTypes.STRING, allowNull: true, comment: '收件人' }, deliver_mail_to: { type: DataTypes.STRING, allowNull: true, comment: '收件人' },
deliver_mail_mobile: { type: DataTypes.STRING, allowNull: true, comment: '联系电话' }, deliver_mail_mobile: { type: DataTypes.STRING, allowNull: true, comment: '联系电话' },
...@@ -15,7 +11,6 @@ module.exports = function (db, DataTypes) { ...@@ -15,7 +11,6 @@ module.exports = function (db, DataTypes) {
deliver_content: { type: DataTypes.STRING, allowNull: true, comment: '交付内容' }, deliver_content: { type: DataTypes.STRING, allowNull: true, comment: '交付内容' },
deliver_mail_no: { type: DataTypes.STRING, allowNull: true, comment: '交付商交付快递单号' }, deliver_mail_no: { type: DataTypes.STRING, allowNull: true, comment: '交付商交付快递单号' },
deliver_img: { type: DataTypes.STRING, allowNull: true, comment: '交接单' }, deliver_img: { type: DataTypes.STRING, allowNull: true, comment: '交接单' },
// operator_id: { type: DataTypes.INTEGER, allowNull: true, comment: '交付商业务员id' },
audit_result: { type: DataTypes.STRING, field: 'audit_result', allowNull: true,defaultValue:'', comment:'审核结果'}, audit_result: { type: DataTypes.STRING, field: 'audit_result', allowNull: true,defaultValue:'', comment:'审核结果'},
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 },
......
...@@ -7,32 +7,31 @@ module.exports = function (db, DataTypes) { ...@@ -7,32 +7,31 @@ module.exports = function (db, DataTypes) {
province: { type: DataTypes.STRING(10), allowNull: true, comment: "发票对应省份" }, province: { type: DataTypes.STRING(10), allowNull: true, comment: "发票对应省份" },
invoice_type: { type: DataTypes.STRING(4), allowNull: true, comment: '发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票' }, invoice_type: { type: DataTypes.STRING(4), allowNull: true, comment: '发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票' },
invoice_join: { type: DataTypes.STRING(4), allowNull: true, comment: '发票联次 10 记账联 20 发票联 30 抵扣联 40 销售方次' }, invoice_join: { type: DataTypes.STRING(4), allowNull: true, comment: '发票联次 10 记账联 20 发票联 30 抵扣联 40 销售方次' },
invoice_no: { type: DataTypes.STRING(20), allowNull: true,delaultValue:"", comment: "发票代码" }, invoice_no: { type: DataTypes.STRING(20), allowNull: true, comment: "发票代码" },
invoice_number: { type: DataTypes.STRING(20), allowNull: true,delaultValue:"", comment: "发票号码" }, invoice_number: { type: DataTypes.STRING(20), allowNull: true,comment: "发票号码" },
invoice_time: { type: DataTypes.DATE, allowNull: true, delaultValue:null,comment: "开票日期" }, invoice_time: { type: DataTypes.DATE, allowNull: true, delaultValue:null,comment: "开票日期" },
merchant_name: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '购买方名称' }, merchant_name: { type: DataTypes.STRING(45), allowNull: true,delaultValue:"", COMMENT: '购买方名称' },
merchant_credit_code: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '购买方纳税人识别号' }, merchant_credit_code: { type: DataTypes.STRING(45), allowNull: true, delaultValue:"", COMMENT: '购买方纳税人识别号' },
merchant_addr: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '购买方地址' }, merchant_addr: { type: DataTypes.STRING(45), allowNull: true,delaultValue:"", COMMENT: '购买方地址' },
merchant_mobile: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '购买方电话' }, merchant_mobile: { type: DataTypes.STRING(45), allowNull: true,delaultValue:"", COMMENT: '购买方电话' },
merchant_bank: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '购买方开户行' }, merchant_bank: { type: DataTypes.STRING(45), allowNull: true,delaultValue:"", COMMENT: '购买方开户行' },
merchant_account: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '银行账号' }, merchant_account: { type: DataTypes.STRING(45), allowNull: true,delaultValue:"", COMMENT: '银行账号' },
businessmen_credit_code: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '销售方社会统一信用代码' }, businessmen_credit_code: { type: DataTypes.STRING(45), allowNull: true,delaultValue:"", COMMENT: '销售方社会统一信用代码' },
businessmen_name: { type: DataTypes.STRING(45), allowNull: true, defaultValue: "" }, businessmen_name: { type: DataTypes.STRING(45), allowNull: true,delaultValue:"", defaultValue: "" },
businessmen_addr: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '销售方地址' }, businessmen_addr: { type: DataTypes.STRING(45), allowNull: true, delaultValue:"", COMMENT: '销售方地址' },
businessmen_mobile: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '销售方电话' }, businessmen_mobile: { type: DataTypes.STRING(45), allowNull: true,delaultValue:"", COMMENT: '销售方电话' },
businessmen_bank: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '销售方开户行' }, businessmen_bank: { type: DataTypes.STRING(45), allowNull: true,delaultValue:"", COMMENT: '销售方开户行' },
businessmen_account: { type: DataTypes.STRING(45), allowNull: false, COMMENT: '销售方银行账号' }, businessmen_account: { type: DataTypes.STRING(45), allowNull: true, delaultValue:"", COMMENT: '销售方银行账号' },
summary:{ type: DataTypes.TEXT, allowNull: true, defaultValue:"",comment: '发票摘要'}, summary:{ type: DataTypes.TEXT, allowNull: true, comment: '发票摘要'},
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW }, created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: true, 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: true, defaultValue: DataTypes.NOW },
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true }, deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true },
}, },
{ {
timestamps: false, timestamps: false,
underscore: true,
paranoid: true, paranoid: true,
version: true, version: true,
tableName: 'i_invoice_summary_info', tableName: 'i_invoice_summary_info',
......
...@@ -16,6 +16,7 @@ class IInvoiceService extends ServiceBase { ...@@ -16,6 +16,7 @@ class IInvoiceService extends ServiceBase {
this.iinvoicedeliverDao = system.getObject("db.invoice.iinvoicedeliverDao"); this.iinvoicedeliverDao = system.getObject("db.invoice.iinvoicedeliverDao");
this.RULE_INVOICE_TYPE =["10",'20','30']; //发票类型 this.RULE_INVOICE_TYPE =["10",'20','30']; //发票类型
this.RULE_BUSINESSMEN_TYPE=['10','20']; //销售方类型 this.RULE_BUSINESSMEN_TYPE=['10','20']; //销售方类型
this.DEFAULT_PRODUCT_ID = "50010000"; //默认产品ID
this.iproductDao = system.getObject("db.product.iproductDao"); this.iproductDao = system.getObject("db.product.iproductDao");
this.iprocessDao = system.getObject("db.product.iprocessDao"); this.iprocessDao = system.getObject("db.product.iprocessDao");
this.iproductprocessDao = system.getObject("db.product.iproductprocessDao"); this.iproductprocessDao = system.getObject("db.product.iproductprocessDao");
...@@ -51,9 +52,9 @@ class IInvoiceService extends ServiceBase { ...@@ -51,9 +52,9 @@ class IInvoiceService extends ServiceBase {
if(!params.invoice_content){ if(!params.invoice_content){
return system.getResult(null,`开票内容不能为空`); return system.getResult(null,`开票内容不能为空`);
} }
if(!params.contract){ // if(!params.contract){
return system.getResult(null,`合同不能为空`); // return system.getResult(null,`合同不能为空`);
} // }
let _invoice = {}; let _invoice = {};
_invoice.channel_id = this.trim(params.channel_id); _invoice.channel_id = this.trim(params.channel_id);
...@@ -62,11 +63,11 @@ class IInvoiceService extends ServiceBase { ...@@ -62,11 +63,11 @@ class IInvoiceService extends ServiceBase {
_invoice.apply_time = this.trim(params.apply_time) || new Date(); _invoice.apply_time = this.trim(params.apply_time) || new Date();
_invoice.invoice_amount = this.trim(params.invoice_amount) || 0; _invoice.invoice_amount = this.trim(params.invoice_amount) || 0;
_invoice.invoice_content = this.trim(params.invoice_content) || "服务费"; _invoice.invoice_content = this.trim(params.invoice_content) || "服务费";
_invoice.contract = this.trim(params.contract) || null; _invoice.contract = this.trim(params.contract) || "";
_invoice.personal_invoice_tax = this.trim(params.personal_invoice_tax) || 0 ; _invoice.personal_invoice_tax = this.trim(params.personal_invoice_tax) || 0 ;
_invoice.additional_tax = this.trim(params.additional_tax) || 0 ; _invoice.additional_tax = this.trim(params.additional_tax) || 0 ;
_invoice.value_added_tax = this.trim(params.value_added_tax) || 0 ; _invoice.value_added_tax = this.trim(params.value_added_tax) || 0 ;
_invoice.product_id = params.product_id || 50010000; _invoice.product_id = params.product_id || this.DEFAULT_PRODUCT_ID;
if(!params.merchant_name){ if(!params.merchant_name){
return system.getResult(null,`购买方名称不能为空`); return system.getResult(null,`购买方名称不能为空`);
} }
......
...@@ -6,7 +6,7 @@ const ServiceBase = require("../../sve.base") ...@@ -6,7 +6,7 @@ const ServiceBase = require("../../sve.base")
*/ */
class IinvoicestatusService extends ServiceBase { class IinvoicestatusService extends ServiceBase {
constructor() { constructor() {
super("invoice", ServiceBase.getDaoName(IInvoiceService)); super("invoice", ServiceBase.getDaoName(IinvoicestatusService));
this.iinvoicesummaryinfoDao = system.getObject("db.invoice.iinvoicesummaryinfoDao"); this.iinvoicesummaryinfoDao = system.getObject("db.invoice.iinvoicesummaryinfoDao");
this.iinvoiceprocessDao = system.getObject("db.invoice.iinvoiceprocessDao"); this.iinvoiceprocessDao = system.getObject("db.invoice.iinvoiceprocessDao");
...@@ -107,8 +107,8 @@ class IinvoicestatusService extends ServiceBase { ...@@ -107,8 +107,8 @@ class IinvoicestatusService extends ServiceBase {
} }
_invoice.contract= this.trim(params.contract); _invoice.contract= this.trim(params.contract);
_invoice.status = this.trim(params.status); _invoice.status = this.trim(params.status);
let res = await _invoice.save(); await _invoice.save();
return system.getResult(res); return system.getResultSuccess();
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
...@@ -136,8 +136,8 @@ class IinvoicestatusService extends ServiceBase { ...@@ -136,8 +136,8 @@ class IinvoicestatusService extends ServiceBase {
_invoice.bd_id = this.trim(params.bd_id); _invoice.bd_id = this.trim(params.bd_id);
_invoice.status = this.trim(params.status); _invoice.status = this.trim(params.status);
_invoice.bd_path = this.trim(params.bd_path); _invoice.bd_path = this.trim(params.bd_path);
let res = await _invoice.save(); await _invoice.save();
return system.getResult(res); return system.getResultSuccess();
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
...@@ -161,7 +161,7 @@ class IinvoicestatusService extends ServiceBase { ...@@ -161,7 +161,7 @@ class IinvoicestatusService extends ServiceBase {
if (!params.deliver_id) { if (!params.deliver_id) {
return system.getResult(null, `参数错误 交付商ID不能为空`); return system.getResult(null, `参数错误 交付商ID不能为空`);
} }
if (!params.hasOwnProperty(`deliver_divide`)) { if (!params.hasOwnProperty(`deliver_delive`)) {
return system.getResult(null, `参数错误 交付商分成不能为空`); return system.getResult(null, `参数错误 交付商分成不能为空`);
} }
...@@ -173,14 +173,15 @@ class IinvoicestatusService extends ServiceBase { ...@@ -173,14 +173,15 @@ class IinvoicestatusService extends ServiceBase {
invoice_id: self.trim(params.invoice_id), invoice_id: self.trim(params.invoice_id),
deliver_id: self.trim(params.deliver_id), deliver_id: self.trim(params.deliver_id),
deliver_name: self.trim(params.deliver_name), deliver_name: self.trim(params.deliver_name),
deliver_divide: self.trim(params.deliver_divide), deliver_delive: self.trim(params.deliver_delive),
}, t); }, t);
//更新iinvoice发票记录 //更新iinvoice发票记录
await self.dao.update({ await self.dao.update({
deliver_id: _iinvoicedeliver.id, deliver_id: _iinvoicedeliver.id,
id: self.trim(params.invoice_id), id: self.trim(params.invoice_id),
status: self.trim(params.status) status: self.trim(params.status),
invoice_deliver_id:self.trim(params.deliver_id)
}, t); }, t);
}); });
return system.getResultSuccess(); return system.getResultSuccess();
...@@ -197,13 +198,6 @@ class IinvoicestatusService extends ServiceBase { ...@@ -197,13 +198,6 @@ class IinvoicestatusService extends ServiceBase {
* *
*/ */
async deliverAudit(params) { async deliverAudit(params) {
//参数验证
if (!params.invoice_id) {
return system.getResult(null, `参数错误 订单ID不能为空`);
}
if (!params.status) {
return system.getResult(null, `参数错误 订单状态不能为空`);
}
let iinvoiceinforegProperty = {}; let iinvoiceinforegProperty = {};
if (this.trim(params.status) == this.PALTFORM_DELIVER_AUDIT_SUCCESS_CODE) { //成功 if (this.trim(params.status) == this.PALTFORM_DELIVER_AUDIT_SUCCESS_CODE) { //成功
if (!params.audit_content) { if (!params.audit_content) {
...@@ -247,7 +241,7 @@ class IinvoicestatusService extends ServiceBase { ...@@ -247,7 +241,7 @@ class IinvoicestatusService extends ServiceBase {
let self = this; let self = this;
await this.db.transaction(async t => { await this.db.transaction(async t => {
//更新交付orderdeliver记录 //更新交付orderdeliver记录
await self.iinvoicedeliverDao.update(iinvoiceinforegProperty, t); await self.iinvoiceinforegDao.update(iinvoiceinforegProperty, t);
//更新oorder订单记录 //更新oorder订单记录
await self.dao.update(iinvoiceProperty, t); await self.dao.update(iinvoiceProperty, t);
}); });
...@@ -321,7 +315,7 @@ class IinvoicestatusService extends ServiceBase { ...@@ -321,7 +315,7 @@ class IinvoicestatusService extends ServiceBase {
return system.getResult(null,`销售方对公账户不能为空`); return system.getResult(null,`销售方对公账户不能为空`);
} }
let _invoice= params._invoice; let _invoice= params._invoice;
let _iinvoicesummaryinfoBean = await this.iinvoicesummaryinfoDao.dao.findById(_invoice.id); let _iinvoicesummaryinfoBean = await this.iinvoicesummaryinfoDao.findById(_invoice.id);
if(!_iinvoicesummaryinfoBean){ if(!_iinvoicesummaryinfoBean){
return system.getResult(null, `系统错误 ,当前摘要信息不存在`); return system.getResult(null, `系统错误 ,当前摘要信息不存在`);
} }
...@@ -333,7 +327,7 @@ class IinvoicestatusService extends ServiceBase { ...@@ -333,7 +327,7 @@ class IinvoicestatusService extends ServiceBase {
_iinvoicesummaryinfoProperty.invoice_number = this.trim(params.invoice_number); _iinvoicesummaryinfoProperty.invoice_number = this.trim(params.invoice_number);
_iinvoicesummaryinfoProperty.invoice_time = this.trim(params.invoice_time); _iinvoicesummaryinfoProperty.invoice_time = this.trim(params.invoice_time);
_iinvoicesummaryinfoProperty.merchant_id = this.trim(params.merchant_id);
_iinvoicesummaryinfoProperty.merchant_name = this.trim(params.merchant_name); _iinvoicesummaryinfoProperty.merchant_name = this.trim(params.merchant_name);
_iinvoicesummaryinfoProperty.merchant_credit_code = this.trim(params.merchant_credit_code); _iinvoicesummaryinfoProperty.merchant_credit_code = this.trim(params.merchant_credit_code);
_iinvoicesummaryinfoProperty.merchant_addr = this.trim(params.merchant_addr); _iinvoicesummaryinfoProperty.merchant_addr = this.trim(params.merchant_addr);
...@@ -341,8 +335,7 @@ class IinvoicestatusService extends ServiceBase { ...@@ -341,8 +335,7 @@ class IinvoicestatusService extends ServiceBase {
_iinvoicesummaryinfoProperty.merchant_bank = this.trim(params.merchant_bank); _iinvoicesummaryinfoProperty.merchant_bank = this.trim(params.merchant_bank);
_iinvoicesummaryinfoProperty.merchant_account = this.trim(params.merchant_account); _iinvoicesummaryinfoProperty.merchant_account = this.trim(params.merchant_account);
_iinvoicesummaryinfoProperty.businessmen_type = this.trim(params.businessmen_type);
_iinvoicesummaryinfoProperty.businessmen_id = this.trim(params.businessmen_id);
_iinvoicesummaryinfoProperty.businessmen_credit_code = this.trim(params.businessmen_credit_code); _iinvoicesummaryinfoProperty.businessmen_credit_code = this.trim(params.businessmen_credit_code);
_iinvoicesummaryinfoProperty.businessmen_name = this.trim(params.businessmen_name); _iinvoicesummaryinfoProperty.businessmen_name = this.trim(params.businessmen_name);
_iinvoicesummaryinfoProperty.businessmen_addr = this.trim(params.businessmen_addr); _iinvoicesummaryinfoProperty.businessmen_addr = this.trim(params.businessmen_addr);
...@@ -454,7 +447,7 @@ class IinvoicestatusService extends ServiceBase { ...@@ -454,7 +447,7 @@ class IinvoicestatusService extends ServiceBase {
invoiceProperty.status = this.trim(params.status); invoiceProperty.status = this.trim(params.status);
invoiceProperty.id = this.trim(params._invoice.id); invoiceProperty.id = this.trim(params._invoice.id);
await this.db.transaction(async t => { await this.db.transaction(async t => {
await this.oorderdeliverDao.update(invoicedeliverProperty, t); await this.iinvoicedeliverDao.update(invoicedeliverProperty, t);
await this.dao.update(invoiceProperty, t); await this.dao.update(invoiceProperty, t);
}); });
return system.getResultSuccess(); return system.getResultSuccess();
...@@ -471,11 +464,23 @@ class IinvoicestatusService extends ServiceBase { ...@@ -471,11 +464,23 @@ class IinvoicestatusService extends ServiceBase {
*/ */
async invoiced(params){ async invoiced(params){
let _invoice = params._invoice; let _invoice = params._invoice;
_invoice.invoice_no = this.trim(params.invoiceNo); if(!params.invoice_no){
return system.getResult(null,`发票代码不能为空`);
}
if(!params.invoice_img){
return system.getResult(null,`发票图片不能为空`);
}
if(!params.invoice_time){
return system.getResult(null,`发票时间不能为空`);
}
if(!params.invoice_number){
return system.getResult(null,`发票号码不能为空`);
}
_invoice.invoice_no = this.trim(params.invoice_no);
_invoice.invoice_img = this.trim(params.invoice_img); _invoice.invoice_img = this.trim(params.invoice_img);
_invoice.invoice_time = this.trim(params.invoice_time); _invoice.invoice_time = this.trim(params.invoice_time);
_invoice.invoice_number = this.trim(params.invoice_number); _invoice.invoice_number = this.trim(params.invoice_number);
_invoice.status = this.trim(params.nextStatus); _invoice.status = this.trim(params.status);
try { try {
await _invoice.save(); await _invoice.save();
return system.getResultSuccess(); return system.getResultSuccess();
...@@ -504,18 +509,12 @@ class IinvoicestatusService extends ServiceBase { ...@@ -504,18 +509,12 @@ class IinvoicestatusService extends ServiceBase {
} }
/** /**
* 交付商订单交付 * 交付商交付
* @param {*} params * @param {*} params
* @invoice_id String 订单ID * @invoice_id String 订单ID
* @status String 订单状态 * @status String 订单状态
*/ */
async delivered(params) { async delivered(params) {
if (!params.invoice_id) {
return system.getResult(null, `参数错误 发票ID不能为空`);
}
if (!params.status) {
return system.getResult(null, `参数错误 状态码不能为空`);
}
if (!params.deliver_mail_no) { if (!params.deliver_mail_no) {
return system.getResult(null, `参数错误 交付商交付快递单号不能为空`); return system.getResult(null, `参数错误 交付商交付快递单号不能为空`);
...@@ -532,7 +531,7 @@ class IinvoicestatusService extends ServiceBase { ...@@ -532,7 +531,7 @@ class IinvoicestatusService extends ServiceBase {
let invoiceProperty = {}; let invoiceProperty = {};
invoiceProperty.status = this.trim(params.status); invoiceProperty.status = this.trim(params.status);
invoiceProperty.id = _order.id; invoiceProperty.id = _invoice.id;
try { try {
await this.db.transaction(async t => { await this.db.transaction(async t => {
......
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