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
d1aa6487
Commit
d1aa6487
authored
Mar 10, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
b64ccf9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
18 deletions
+57
-18
xggsve-invoice/app/base/db/impl/product/iproductprocessDao.js
+2
-18
xggsve-invoice/app/base/service/impl/invoice/iinvoiceSve.js
+55
-0
No files found.
xggsve-invoice/app/base/db/impl/product/iproductprocessDao.js
View file @
d1aa6487
...
...
@@ -26,7 +26,7 @@ class IproductprocessDao extends Dao {
}
}
async
findMapByProductProductIds
(
productPid
,
productIds
)
{
async
byProductPid
(
productPid
)
{
let
result
=
{};
let
sql
=
[];
sql
.
push
(
"SELECT"
);
...
...
@@ -34,29 +34,14 @@ class IproductprocessDao extends Dao {
sql
.
push
(
"FROM"
);
sql
.
push
(
this
.
model
.
tableName
)
sql
.
push
(
"WHERE product_pid = :productPid"
);
if
(
productIds
&&
productIds
.
length
>
0
)
{
sql
.
push
(
"AND product_id IN (:productIds)"
);
}
sql
.
push
(
"ORDER BY sort ASC"
);
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
productPid
:
productPid
,
productIds
:
productIds
});
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
productPid
:
productPid
});
if
(
!
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
let
item
of
list
)
{
let
productId
=
item
.
product_id
;
let
items
=
result
[
productId
];
if
(
!
items
)
{
items
=
[];
}
items
.
push
(
item
);
result
[
productId
]
=
items
;
}
return
result
;
}
}
module
.
exports
=
IproductprocessDao
;
\ No newline at end of file
xggsve-invoice/app/base/service/impl/invoice/iinvoiceSve.js
View file @
d1aa6487
...
...
@@ -15,5 +15,59 @@ class InvoiceService extends ServiceBase {
this
.
iinvoiceinforegDao
=
system
.
getObject
(
"db.invoice.iinvoiceinforegDao"
);
this
.
iinvoicedeliverDao
=
system
.
getObject
(
"db.invoice.iinvoicedeliverDao"
);
}
/**
* 构建产品流程对象
* @param productPid
* @param chooseProductIds
* @returns {Promise<void>}
*/
async
buildOrderProcess
(
productPid
)
{
// 查询所有产品子项
let
productList
=
await
this
.
oproductDao
.
findListByPid
(
productPid
);
// 查询产品流程
let
productProcessList
=
await
this
.
oproductprocessDao
.
byProductPid
(
productPid
);
if
(
!
productProcessList
||
productProcessList
.
length
==
0
)
{
continue
;
}
let
invoiceProcessList
=
[];
// 批量查流程
let
processMap
=
await
this
.
oprocessDao
.
mapAll
();
for
(
let
productProcess
of
productProcessList
)
{
// 风还钻该处理每一个子项流程 变为 订单流程对象
let
process
=
processMap
[
productProcess
.
process_id
];
let
nextArr
=
this
.
trim
(
productProcess
.
next_status
).
split
(
","
);
let
nextStatus
=
[];
for
(
var
nextId
of
nextArr
)
{
nextId
=
Number
(
nextId
||
0
);
let
nextObj
=
processMap
[
nextId
];
if
(
!
nextObj
)
{
continue
;
}
nextStatus
.
push
({
next_status
:
nextObj
.
status
,
next_name
:
nextObj
.
name
});
}
let
orderProcess
=
{
product_id
:
productPid
,
name
:
process
.
name
,
status
:
process
.
status
,
func
:
productProcess
.
func
,
next_status
:
JSON
.
stringify
(
nextStatus
),
name1
:
productProcess
.
name1
,
name2
:
productProcess
.
name2
,
name3
:
productProcess
.
name3
,
name4
:
productProcess
.
name4
,
sort
:
productProcess
.
sort
,
autoIncrement
:
true
};
invoiceProcessList
.
push
(
orderProcess
);
}
return
invoiceProcessList
;
}
}
module
.
exports
=
InvoiceService
;
\ No newline at end of file
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