Commit 04675577 by 王昆

gsb

parents 587d15cd a06fbfa5
{
"lockfileVersion": 1
}
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
// var rule =require("../../../utils/invoiceRule/rule");
// var Context =require("../../../utils/stateChain/context");
// var Calculation = require("../../../utils/strategies/calculation");
class ActionAPI extends APIBase {
constructor() {
super();
this.iinvoiceSve = system.getObject("service.invoice.iinvoiceSve");
// this.context=new Context();
}
/**
* 接口跳转
......@@ -30,13 +26,13 @@ class ActionAPI extends APIBase {
var opResult = null;
switch (action_type) {
case "invoiceApply": // 发票申请
// opResult = await rule.dispatcher(action_body);
opResult = await this.iinvoiceSve.invoiceApply(action_body);
break;
case "invoicePage": // 发票申请列表页(平台)
// opResult = await rule.dispatcher(action_body);
opResult = await this.iinvoiceSve.invoicePage(action_body);
break;
case "deliverInvoicePage": // 发票申请列表页(交付商)
// opResult = await rule.dispatcher(action_body);
opResult = await this.iinvoiceSve.deliverInvoicePage(action_body);
break;
case "handleStatus": //进度处理
break;
......@@ -132,7 +128,7 @@ class ActionAPI extends APIBase {
// break;
case "test": // 查询业务进度
opResult = await this.iinvoiceSve.buildOrderProcess(action_body);
opResult = await this.iinvoiceSve.buildProcess(action_body);
break;
default:
......
const system = require("../../../system");
const Dao = require("../../dao.base");
const moment = require("moment");
class InvoiceDao extends Dao {
class IInvoiceDao extends Dao {
constructor() {
super(Dao.getModelName(InvoiceDao));
this.tableName = this.model.tableName;
super(Dao.getModelName(IInvoiceDao));
}
async countByParams(params) {
......@@ -154,4 +153,4 @@ class InvoiceDao extends Dao {
return await this.customQuery(sql.join(" "), params);
}
}
module.exports = InvoiceDao;
\ No newline at end of file
module.exports = IInvoiceDao;
\ No newline at end of file
......@@ -47,6 +47,7 @@ module.exports = (db, DataTypes) => {
deliver_id:{ type: DataTypes.STRING(32), allowNull: true, defaultValue: null,comment:"交付商ID common下的交付商ID" },
bd_id:{ type: DataTypes.STRING(32), allowNull: true, defaultValue: null ,comment:"业务员Id"},
bd_path:{ type: DataTypes.STRING(200), allowNull: true, defaultValue: null ,comment:"业务员权限"},
channel_id:{ type: DataTypes.STRING(32), allowNull: true ,comment:"渠道ID"},
created_at: { type: DataTypes.DATE, allowNull: true },
updated_at: { type: DataTypes.DATE, allowNull: true },
deleted_at: { type: DataTypes.DATE, allowNull: true },
......
......@@ -4,9 +4,9 @@ const moment = require('moment')
/**
* 交付商 提交的信息
*/
class InvoiceService extends ServiceBase {
class IInvoiceService extends ServiceBase {
constructor() {
super("invoice", ServiceBase.getDaoName(InvoiceService));
super("invoice", ServiceBase.getDaoName(IInvoiceService));
let is = system.getObject("util.invoiceStatus");
this.invoiceStatus = is.status;
......@@ -16,19 +16,29 @@ class InvoiceService extends ServiceBase {
this.iinvoicedeliverDao = system.getObject("db.invoice.iinvoicedeliverDao");
}
/**
* 发票申请
* @param {*} params
*/
async invoiceApply(params){
}
//**********************************************以下是旧版本************************************************************ */
/**
* 构建产品流程对象
* @param productPid
* @param chooseProductIds
* @returns {Promise<void>}
*/
async buildOrderProcess(productPid) {
let productPid = productPid || 50010000;
async buildProcess(params) {
let productPid = params.productPid || 50010000;
// 查询产品流程
let productProcessList = await this.oproductprocessDao.byProductPid(productPid);
if (!productProcessList || productProcessList.length == 0) {
continue;
return [];
}
let invoiceProcessList = [];
......@@ -40,7 +50,7 @@ class InvoiceService extends ServiceBase {
let process = processMap[productProcess.process_id];
let nextArr = this.trim(productProcess.next_status).split(",");
let nextStatus = [];
for (var nextId of nextArr) {
for (let nextId of nextArr) {
nextId = Number(nextId || 0);
let nextObj = processMap[nextId];
if (!nextObj) {
......@@ -68,4 +78,4 @@ class InvoiceService extends ServiceBase {
return invoiceProcessList;
}
}
module.exports = InvoiceService;
\ No newline at end of file
module.exports = IInvoiceService;
\ No newline at end of file
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