Commit 04675577 by 王昆

gsb

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