Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
416996d9
Commit
416996d9
authored
Mar 10, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
a06fbfa5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
309 additions
and
196 deletions
+309
-196
xggsve-invoice/app/base/db/impl/invoice/iinvoiceDao.js
+152
-144
xggsve-invoice/app/base/db/models/invoice/iinvoice.js
+2
-1
xggsve-invoice/app/base/service/impl/invoice/iinvoiceSve.js
+154
-50
xggsve-invoice/app/config/localsettings.js
+1
-1
No files found.
xggsve-invoice/app/base/db/impl/invoice/iinvoiceDao.js
View file @
416996d9
...
@@ -4,154 +4,161 @@ const moment = require("moment");
...
@@ -4,154 +4,161 @@ const moment = require("moment");
class
InvoiceDao
extends
Dao
{
class
InvoiceDao
extends
Dao
{
constructor
()
{
constructor
()
{
super
(
Dao
.
getModelName
(
InvoiceDao
));
super
(
Dao
.
getModelName
(
InvoiceDao
));
this
.
tableName
=
this
.
model
.
tableName
;
//
this.tableName = this.model.tableName;
}
}
async
countByParams
(
params
)
{
async
findByChannelAndApplyNo
(
channel_id
,
apply_no
){
var
sql
=
[];
let
sql
=
`select count(1) as total from i_invoice where channel_id = "
${
channel_id
}
" and apply_no = "
${
apply_no
}
"`
;
sql
.
push
(
"SELECT"
);
var
counts
=
await
this
.
customQuery
(
sql
);
sql
.
push
(
"COUNT(1) as total"
);
return
counts
[
0
];
sql
.
push
(
"FROM `invoice` t1"
);
sql
.
push
(
"INNER JOIN `invoice_apply` t2 ON t1.`id` = t2.`id`"
);
sql
.
push
(
"WHERE 1 = 1 and t2.status in('1070','1080','1090')"
);
this
.
setCondition
(
params
,
sql
);
var
counts
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
counts
||
counts
.
length
==
0
)
{
return
0
;
}
return
counts
[
0
].
total
||
0
;
}
async
pageByParams
(
params
,
startRow
,
pageSize
)
{
var
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"t1.*"
);
sql
.
push
(
"FROM `invoice` t1"
);
sql
.
push
(
"INNER JOIN `invoice_apply` t2 ON t1.`id` = t2.`id`"
);
sql
.
push
(
"WHERE 1 = 1 "
);
this
.
setCondition
(
params
,
sql
);
sql
.
push
(
"ORDER BY id DESC"
);
sql
.
push
(
"LIMIT :startRow, :pageSize"
);
params
.
startRow
=
startRow
||
0
;
params
.
pageSize
=
pageSize
||
10
;
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
}
setCondition
(
params
,
sql
)
{
var
complateTax
=
params
.
complateTax
;
if
(
complateTax
!=
"-1"
)
{
params
.
complateTax
=
Number
(
complateTax
);
sql
.
push
(
"AND t1.`complate_tax` = :complateTax"
);
}
// invoiceTimeBegin 2019-01-01 2019-01-01 00:00:00
// invoiceTimeEnd 2019-11-01 2019-11-01 23:59:59
if
(
params
.
invoiceTimeBegin
)
{
sql
.
push
(
"AND t1.`invoice_time` >= :invoiceTimeBegin"
);
}
if
(
params
.
invoiceTimeEnd
)
{
sql
.
push
(
"AND t1.`invoice_time` <= :invoiceTimeEnd"
);
}
if
(
params
.
invoiceTime
){
sql
.
push
(
"AND t1.`invoice_time` >= :invoiceTime"
);
}
if
(
params
.
applyNo
)
{
sql
.
push
(
"AND t2.`apply_no` = :applyNo"
);
}
if
(
params
.
redStatus
)
{
sql
.
push
(
"AND t1.`red_status` = :redStatus"
);
}
if
(
params
.
type
)
{
sql
.
push
(
"AND t2.`type` = :type"
);
}
if
(
params
.
statuses
&&
params
.
statuses
.
length
>
0
){
sql
.
push
(
"AND t2.`status` in (:statuses)"
);
}
}
}
/**
// async countByParams(params) {
* 红冲列表总计
// var sql = [];
* @param {*} params
// sql.push("SELECT");
*/
// sql.push("COUNT(1) as total");
async
countRedRushListByParams
(
params
){
// sql.push("FROM `invoice` t1");
var
sql
=
[];
// sql.push("INNER JOIN `invoice_apply` t2 ON t1.`id` = t2.`id`");
// sql.push("WHERE 1 = 1 and t2.status in('1070','1080','1090')");
sql
.
push
(
`select count(1) as count from invoice_apply a inner join invoice_deliverer b on a.deliverer_id =b.id
inner join invoice c on b.invoice_id =c.id where a.id = c.id `
);
// this.setCondition(params, sql);
if
(
params
.
delivererId
)
{
// var counts = await this.customQuery(sql.join(" "), params);
sql
.
push
(
` AND b.deliverer_id = :delivererId`
);
// if(!counts || counts.length == 0) {
}
// return 0;
if
(
params
.
applyNo
)
{
// }
sql
.
push
(
` AND a.apply_no = :applyNo`
);
// return counts[0].total || 0;
}
// }
if
(
params
.
invoiceNo
)
{
sql
.
push
(
` AND c.invoice_no = :invoiceNo`
);
// async pageByParams(params, startRow, pageSize) {
}
// var sql = [];
if
(
params
.
startTime
)
{
// sql.push("SELECT");
sql
.
push
(
`and a.invoice_time >= :startTime`
);
// sql.push("t1.*");
}
// sql.push("FROM `invoice` t1");
if
(
params
.
endTime
)
{
// sql.push("INNER JOIN `invoice_apply` t2 ON t1.`id` = t2.`id`");
sql
.
push
(
`and a.invoice_time <= :endTime`
);
// sql.push("WHERE 1 = 1 ");
}
if
(
params
.
invoiceTime
){
// this.setCondition(params, sql);
sql
.
push
(
`and a.invoice_time >= :invoiceTime`
);
}
// sql.push("ORDER BY id DESC");
if
(
params
.
type
)
{
// sql.push("LIMIT :startRow, :pageSize");
sql
.
push
(
`and a.type = :type`
);
// params.startRow = startRow || 0;
}
// params.pageSize = pageSize || 10;
if
(
params
.
redStatus
)
{
// return await this.customQuery(sql.join(" "), params);
sql
.
push
(
`and c.red_status = :redStatus`
);
// }
}
if
(
params
.
status
)
{
// setCondition(params, sql) {
sql
.
push
(
`and c.status = :status`
);
// var complateTax = params.complateTax;
}
// if (complateTax != "-1") {
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
// params.complateTax = Number(complateTax);
}
// sql.push("AND t1.`complate_tax` = :complateTax");
// }
/**
* 红冲列表
// // invoiceTimeBegin 2019-01-01 2019-01-01 00:00:00
* @param {*} params
// // invoiceTimeEnd 2019-11-01 2019-11-01 23:59:59
*/
// if(params.invoiceTimeBegin) {
async
redRushListByParams
(
params
){
// sql.push("AND t1.`invoice_time` >= :invoiceTimeBegin");
var
sql
=
[];
// }
sql
.
push
(
`select a.apply_no,a.type,a.invoice_amount,a.invoice_time,c.status,
// if(params.invoiceTimeEnd) {
a.merchant_name,a.businessmen_name,a.id,b.deliverer_id from invoice_apply a
// sql.push("AND t1.`invoice_time` <= :invoiceTimeEnd");
inner join invoice_deliverer b on a.deliverer_id =b.id
// }
inner join invoice c on b.invoice_id =c.id where a.id = c.id `
);
// if(params.invoiceTime){
// sql.push("AND t1.`invoice_time` >= :invoiceTime");
if
(
params
.
delivererId
)
{
// }
sql
.
push
(
` AND b.deliverer_id = :delivererId`
);
}
// if(params.applyNo) {
if
(
params
.
applyNo
)
{
// sql.push("AND t2.`apply_no` = :applyNo");
sql
.
push
(
` AND a.apply_no = :applyNo`
);
// }
}
if
(
params
.
startTime
)
{
// if(params.redStatus) {
sql
.
push
(
`and a.invoice_time >= :startTime`
);
// sql.push("AND t1.`red_status` = :redStatus");
}
// }
if
(
params
.
endTime
)
{
sql
.
push
(
`and a.invoice_time <= :endTime`
);
// if (params.type) {
}
// sql.push("AND t2.`type` = :type");
if
(
params
.
invoiceTime
){
// }
sql
.
push
(
`and a.invoice_time >= :invoiceTime`
);
// if(params.statuses && params.statuses.length > 0){
}
// sql.push("AND t2.`status` in (:statuses)");
if
(
params
.
type
)
{
// }
sql
.
push
(
`and a.type = :type`
);
// }
}
if
(
params
.
redStatus
)
{
sql
.
push
(
`and c.red_status = :redStatus`
);
// /**
}
// * 红冲列表总计
sql
.
push
(
"ORDER BY c.id DESC"
);
// * @param {*} params
sql
.
push
(
"LIMIT :statRow, :pageSize"
);
// */
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
// async countRedRushListByParams(params){
}
// var sql = [];
// sql.push(`select count(1) as count from invoice_apply a inner join invoice_deliverer b on a.deliverer_id =b.id
// inner join invoice c on b.invoice_id =c.id where a.id = c.id `);
// if (params.delivererId) {
// sql.push(` AND b.deliverer_id = :delivererId`);
// }
// if (params.applyNo) {
// sql.push(` AND a.apply_no = :applyNo`);
// }
// if (params.invoiceNo) {
// sql.push(` AND c.invoice_no = :invoiceNo`);
// }
// if (params.startTime) {
// sql.push(`and a.invoice_time >= :startTime`);
// }
// if (params.endTime) {
// sql.push(`and a.invoice_time <= :endTime`);
// }
// if(params.invoiceTime){
// sql.push(`and a.invoice_time >= :invoiceTime`);
// }
// if (params.type) {
// sql.push(`and a.type = :type`);
// }
// if (params.redStatus) {
// sql.push(`and c.red_status = :redStatus`);
// }
// if (params.status) {
// sql.push(`and c.status = :status`);
// }
// return await this.customQuery(sql.join(" "), params);
// }
// /**
// * 红冲列表
// * @param {*} params
// */
// async redRushListByParams(params){
// var sql = [];
// sql.push(`select a.apply_no,a.type,a.invoice_amount,a.invoice_time,c.status,
// a.merchant_name,a.businessmen_name,a.id,b.deliverer_id from invoice_apply a
// inner join invoice_deliverer b on a.deliverer_id =b.id
// inner join invoice c on b.invoice_id =c.id where a.id = c.id `);
// if (params.delivererId) {
// sql.push(` AND b.deliverer_id = :delivererId`);
// }
// if (params.applyNo) {
// sql.push(` AND a.apply_no = :applyNo`);
// }
// if (params.startTime) {
// sql.push(`and a.invoice_time >= :startTime`);
// }
// if (params.endTime) {
// sql.push(`and a.invoice_time <= :endTime`);
// }
// if(params.invoiceTime){
// sql.push(`and a.invoice_time >= :invoiceTime`);
// }
// if (params.type) {
// sql.push(`and a.type = :type`);
// }
// if (params.redStatus) {
// sql.push(`and c.red_status = :redStatus`);
// }
// sql.push("ORDER BY c.id DESC");
// sql.push("LIMIT :statRow, :pageSize");
// return await this.customQuery(sql.join(" "), params);
// }
}
}
module
.
exports
=
InvoiceDao
;
module
.
exports
=
InvoiceDao
;
\ No newline at end of file
xggsve-invoice/app/base/db/models/invoice/iinvoice.js
View file @
416996d9
...
@@ -47,7 +47,8 @@ module.exports = (db, DataTypes) => {
...
@@ -47,7 +47,8 @@ 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"
},
channel_id
:{
type
:
DataTypes
.
STRING
(
32
),
allowNull
:
true
,
delaultValue
:
''
,
comment
:
"渠道ID"
},
product_id
:{
type
:
DataTypes
.
STRING
(
32
),
allowNull
:
true
,
delaultValue
:
''
,
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
},
...
...
xggsve-invoice/app/base/service/impl/invoice/iinvoiceSve.js
View file @
416996d9
...
@@ -4,16 +4,15 @@ const moment = require('moment')
...
@@ -4,16 +4,15 @@ const moment = require('moment')
/**
/**
* 交付商 提交的信息
* 交付商 提交的信息
*/
*/
class
InvoiceService
extends
ServiceBase
{
class
I
i
nvoiceService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"invoice"
,
ServiceBase
.
getDaoName
(
InvoiceService
));
super
(
"invoice"
,
ServiceBase
.
getDaoName
(
IinvoiceService
));
let
is
=
system
.
getObject
(
"util.invoiceStatus"
);
this
.
invoiceStatus
=
is
.
status
;
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"
);
this
.
iinvoiceinforegDao
=
system
.
getObject
(
"db.invoice.iinvoiceinforegDao"
);
this
.
iinvoiceinforegDao
=
system
.
getObject
(
"db.invoice.iinvoiceinforegDao"
);
this
.
iinvoicedeliverDao
=
system
.
getObject
(
"db.invoice.iinvoicedeliverDao"
);
this
.
iinvoicedeliverDao
=
system
.
getObject
(
"db.invoice.iinvoicedeliverDao"
);
this
.
RULE_INVOICE_TYPE
=
[
"10"
,
'20'
,
'30'
];
//发票类型
this
.
RULE_BUSINESSMEN_TYPE
=
[
'10'
,
'20'
];
//销售方类型
}
}
/**
/**
...
@@ -21,61 +20,166 @@ class InvoiceService extends ServiceBase {
...
@@ -21,61 +20,166 @@ class InvoiceService extends ServiceBase {
* @param {*} params
* @param {*} params
*/
*/
async
invoiceApply
(
params
){
async
invoiceApply
(
params
){
}
if
(
!
params
.
channel_id
){
return
system
.
getResult
(
null
,
`渠道ID不能为空`
);
}
if
(
!
params
.
apply_no
){
return
system
.
getResult
(
null
,
`发票申请编号不能为空`
);
}
try
{
let
invoiceExists
=
await
this
.
dao
.
findByChannelAndApplyNo
(
this
.
trim
(
params
.
channel_id
),
this
.
trim
(
params
.
apply_no
));
if
(
invoiceExists
.
total
!=
0
){
return
system
.
getResult
(
null
,
`发票编号已存在`
);
}
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误
${
error
}
`
);
}
if
(
this
.
RULE_INVOICE_TYPE
.
indexOf
(
this
.
trim
(
params
.
invoice_type
))
==-
1
){
return
system
.
getResult
(
null
,
`发票类型不存在`
);
}
if
(
!
params
.
apply_time
){
return
system
.
getResult
(
null
,
`发票申请时间错误`
);
}
if
(
!
params
.
invoice_content
){
return
system
.
getResult
(
null
,
`开票内容不能为空`
);
}
if
(
!
params
.
contract
){
return
system
.
getResult
(
null
,
`合同不能为空`
);
}
let
_invoice
=
{};
_invoice
.
apply_no
=
this
.
trim
(
params
.
apply_no
);
_invoice
.
invoice_type
=
this
.
trim
(
params
.
invoice_type
);
_invoice
.
apply_time
=
this
.
trim
(
params
.
apply_time
);
_invoice
.
invoice_amount
=
this
.
trim
(
params
.
invoice_amount
)
||
0
;
_invoice
.
invoice_content
=
this
.
trim
(
params
.
invoice_content
)
||
"服务费"
;
_invoice
.
contract
=
this
.
trim
(
params
.
contract
)
||
null
;
_invoice
.
personal_invoice_tax
=
this
.
trim
(
params
.
personal_invoice_tax
)
||
0
;
_invoice
.
additional_tax
=
this
.
trim
(
params
.
additional_tax
)
||
0
;
_invoice
.
value_added_tax
=
this
.
trim
(
params
.
value_added_tax
)
||
0
;
_invoice
.
product_id
=
this
.
trim
(
params
.
product_id
)
||
1
;
if
(
!
params
.
merchant_name
){
return
system
.
getResult
(
null
,
`购买方名称不能为空`
);
}
if
(
!
params
.
merchant_credit_code
){
return
system
.
getResult
(
null
,
`购买方社会统一信用代码不能为空`
);
}
if
(
!
params
.
merchant_addr
){
return
system
.
getResult
(
null
,
`购买方地址不能为空`
);
}
if
(
!
params
.
merchant_mobile
){
return
system
.
getResult
(
null
,
`购买方电话不能为空`
);
}
if
(
!
params
.
merchant_bank
){
return
system
.
getResult
(
null
,
`购买方开户行不能为空`
);
}
if
(
!
params
.
merchant_account
){
return
system
.
getResult
(
null
,
`购买方对公账户不能为空`
);
}
_invoice
.
merchant_id
=
this
.
trim
(
params
.
merchant_id
);
_invoice
.
merchant_name
=
this
.
trim
(
params
.
merchant_name
);
_invoice
.
merchant_credit_code
=
this
.
trim
(
params
.
merchant_credit_code
);
_invoice
.
merchant_addr
=
this
.
trim
(
params
.
merchant_addr
);
_invoice
.
merchant_mobile
=
this
.
trim
(
params
.
merchant_mobile
);
_invoice
.
merchant_bank
=
this
.
trim
(
params
.
merchant_bank
);
_invoice
.
merchant_account
=
this
.
trim
(
params
.
merchant_account
);
if
(
!
params
.
businessmen_name
){
return
system
.
getResult
(
null
,
`销售方名称不能为空`
);
}
if
(
!
params
.
businessmen_credit_code
){
return
system
.
getResult
(
null
,
`销售方社会统一信用代码不能为空`
);
}
if
(
!
params
.
businessmen_addr
){
return
system
.
getResult
(
null
,
`销售方地址不能为空`
);
}
if
(
!
params
.
businessmen_mobile
){
return
system
.
getResult
(
null
,
`销售方电话不能为空`
);
}
if
(
!
params
.
businessmen_bank
){
return
system
.
getResult
(
null
,
`销售方开户行不能为空`
);
}
if
(
!
params
.
businessmen_account
){
return
system
.
getResult
(
null
,
`销售方对公账户不能为空`
);
}
if
(
this
.
RULE_BUSINESSMEN_TYPE
.
indexOf
(
this
.
trim
(
params
.
businessmen_type
))
==-
1
){
return
system
.
getResult
(
null
,
`销售方类型错误`
);
}
_invoice
.
businessmen_type
=
this
.
trim
(
params
.
businessmen_type
);
_invoice
.
businessmen_id
=
this
.
trim
(
params
.
businessmen_id
);
_invoice
.
businessmen_credit_code
=
this
.
trim
(
params
.
businessmen_credit_code
)
||
0
;
_invoice
.
businessmen_name
=
this
.
trim
(
params
.
businessmen_name
);
_invoice
.
businessmen_addr
=
this
.
trim
(
params
.
businessmen_addr
);
_invoice
.
businessmen_mobile
=
this
.
trim
(
params
.
businessmen_mobile
);
_invoice
.
businessmen_bank
=
this
.
trim
(
params
.
businessmen_bank
);
_invoice
.
businessmen_account
=
this
.
trim
(
params
.
businessmen_account
);
_invoice
.
mail_to
=
this
.
trim
(
params
.
mail_to
)
||
""
;
_invoice
.
mail_mobile
=
this
.
trim
(
params
.
mail_mobile
)
||
""
;
_invoice
.
mail_addr
=
this
.
trim
(
params
.
mail_addr
)
||
""
;
try
{
await
this
.
dao
.
create
(
_invoice
);
return
system
.
getResult
(
`success`
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/
/**********************************************以下是旧版本************************************************************ */
/
**********************************************以下是旧版本************************************************************
/*
*
/*
* 构建产品流程对象
* 构建产品流程对象
* @param productPid
* @param productPid
* @param chooseProductIds
* @param chooseProductIds
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
async
buildOrderProcess
(
productPid
)
{
//
async buildOrderProcess(productPid) {
let
productPid
=
productPid
||
50010000
;
//
let productPid = 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
;
//
continue;
}
//
}
let
invoiceProcessList
=
[];
//
let invoiceProcessList = [];
// 批量查流程
//
// 批量查流程
let
processMap
=
await
this
.
oprocessDao
.
mapAll
();
//
let processMap = await this.oprocessDao.mapAll();
for
(
let
productProcess
of
productProcessList
)
{
//
for (let productProcess of productProcessList) {
// 风还钻该处理每一个子项流程 变为 订单流程对象
//
// 风还钻该处理每一个子项流程 变为 订单流程对象
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 (var nextId of nextArr) {
nextId
=
Number
(
nextId
||
0
);
//
nextId = Number(nextId || 0);
let
nextObj
=
processMap
[
nextId
];
//
let nextObj = processMap[nextId];
if
(
!
nextObj
)
{
//
if (!nextObj) {
continue
;
//
continue;
}
//
}
nextStatus
.
push
({
next_status
:
nextObj
.
status
,
next_name
:
nextObj
.
name
});
//
nextStatus.push({ next_status: nextObj.status, next_name: nextObj.name });
}
//
}
let
orderProcess
=
{
// let orderProcess = {
product_id
:
productPid
,
// product_id: productPid,
name
:
process
.
name
,
// name: process.name,
status
:
process
.
status
,
// status: process.status,
func
:
productProcess
.
func
,
// func: productProcess.func,
next_status
:
JSON
.
stringify
(
nextStatus
),
// next_status: JSON.stringify(nextStatus),
name1
:
productProcess
.
name1
,
// name1: productProcess.name1,
name2
:
productProcess
.
name2
,
// name2: productProcess.name2,
name3
:
productProcess
.
name3
,
// name3: productProcess.name3,
name4
:
productProcess
.
name4
,
// name4: productProcess.name4,
sort
:
productProcess
.
sort
,
// sort: productProcess.sort,
autoIncrement
:
true
// autoIncrement: true
};
// };
invoiceProcessList
.
push
(
orderProcess
);
// invoiceProcessList.push(orderProcess);
}
// }
// return invoiceProcessList;
// }
return
invoiceProcessList
;
}
}
}
module
.
exports
=
InvoiceService
;
module
.
exports
=
IinvoiceService
;
\ No newline at end of file
\ No newline at end of file
xggsve-invoice/app/config/localsettings.js
View file @
416996d9
...
@@ -6,7 +6,7 @@ var settings={
...
@@ -6,7 +6,7 @@ var settings={
db
:
10
,
db
:
10
,
},
},
database
:{
database
:{
dbname
:
"xgg-invoice"
,
dbname
:
"xgg-invoice
1
"
,
user
:
"write"
,
user
:
"write"
,
password
:
"write"
,
password
:
"write"
,
config
:
{
config
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment