@things-factory/operato-wms 4.3.122 → 4.3.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pages/outbound/show-ro-list-popup.js +35 -5
- package/client/pages/outbound/sorting-product.js +198 -44
- package/client/pages/report/tote-loading-qc-report.js +372 -0
- package/client/route.js +4 -0
- package/config.development.js +1 -1
- package/dist-server/graphql/resolvers/reports/index.js +2 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/tote-loading-qc-report.js +82 -0
- package/dist-server/graphql/resolvers/reports/tote-loading-qc-report.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +6 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/loading-qc-report-list.js +14 -0
- package/dist-server/graphql/types/reports/loading-qc-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/loading-qc-report.js +22 -0
- package/dist-server/graphql/types/reports/loading-qc-report.js.map +1 -0
- package/package.json +16 -16
- package/server/graphql/resolvers/reports/index.ts +3 -1
- package/server/graphql/resolvers/reports/tote-loading-qc-report.ts +100 -0
- package/server/graphql/types/reports/index.ts +6 -1
- package/server/graphql/types/reports/loading-qc-report-list.ts +8 -0
- package/server/graphql/types/reports/loading-qc-report.ts +16 -0
- package/things-factory.config.js +4 -0
- package/translations/en.json +10 -2
- package/translations/ko.json +9 -1
- package/translations/ms.json +9 -1
- package/translations/zh.json +9 -1
|
@@ -6,6 +6,7 @@ import { inboundOrderDetailsReport } from './inbound-order-details-report'
|
|
|
6
6
|
import { outboundOrderDetailsReport } from './outbound-order-details-report'
|
|
7
7
|
import { productLabelReport } from './product-label-report'
|
|
8
8
|
import { releaseInventoryReport } from './release-inventory-report'
|
|
9
|
+
import { loadingQcReport } from './tote-loading-qc-report'
|
|
9
10
|
|
|
10
11
|
export const Query = {
|
|
11
12
|
...inboundSerialNumberReport,
|
|
@@ -14,5 +15,6 @@ export const Query = {
|
|
|
14
15
|
...inboundOrderDetailsReport,
|
|
15
16
|
...outboundOrderDetailsReport,
|
|
16
17
|
...productLabelReport,
|
|
17
|
-
...releaseInventoryReport
|
|
18
|
+
...releaseInventoryReport,
|
|
19
|
+
...loadingQcReport
|
|
18
20
|
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { EntityManager, SelectQueryBuilder, getRepository } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
import { User } from '@things-factory/auth-base'
|
|
4
|
+
import { Bizplace } from '@things-factory/biz-base'
|
|
5
|
+
import { ListParam, buildQuery, Domain } from '@things-factory/shell'
|
|
6
|
+
import { ReleaseGood } from '@things-factory/sales-base'
|
|
7
|
+
|
|
8
|
+
export const loadingQcReport = {
|
|
9
|
+
async loadingQcReport(_: any, params: ListParam, context: any) {
|
|
10
|
+
try {
|
|
11
|
+
const { domain }: { domain: Domain } = context.state
|
|
12
|
+
|
|
13
|
+
let bizplaceFilter = params.filters.find(filter => filter.name === 'bizplace')
|
|
14
|
+
let releaseDateFilter = params.filters.find(filter => filter.name === 'releaseDate')
|
|
15
|
+
let routeIdFilter = params.filters.find(filter => filter.name === 'routeId')
|
|
16
|
+
let stopIdFilter = params.filters.find(filter => filter.name === 'stopId')
|
|
17
|
+
let toteIdFilter = params.filters.find(filter => filter.name === 'toteId')
|
|
18
|
+
|
|
19
|
+
let orderInfoFilter
|
|
20
|
+
const orderInfoParamIdx = params.filters.findIndex(param => param.name === 'orderInfo')
|
|
21
|
+
if (orderInfoParamIdx >= 0) {
|
|
22
|
+
orderInfoFilter = params.filters[orderInfoParamIdx].value.toLowerCase().split(',').join('|')
|
|
23
|
+
|
|
24
|
+
params.filters.splice(orderInfoParamIdx, 1)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let toteBoxFilter
|
|
28
|
+
const toteBoxParamIdx = params.filters.findIndex(param => param.name === 'toteBox')
|
|
29
|
+
if (toteBoxParamIdx >= 0) {
|
|
30
|
+
toteBoxFilter = params.filters[toteBoxParamIdx].value
|
|
31
|
+
|
|
32
|
+
params.filters.splice(toteBoxParamIdx, 1)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const qb: SelectQueryBuilder<ReleaseGood> = getRepository(ReleaseGood).createQueryBuilder('rg')
|
|
36
|
+
|
|
37
|
+
qb.select('bizplace.name', 'bizplaceName')
|
|
38
|
+
.addSelect('rg.name', 'releaseGoodNo')
|
|
39
|
+
.addSelect('rg.route_id', 'routeId')
|
|
40
|
+
.addSelect('rg.stop_id', 'stopId')
|
|
41
|
+
.addSelect('rg.release_date', 'releaseDate')
|
|
42
|
+
.addSelect('oti.qty', 'orderQuantity')
|
|
43
|
+
.addSelect('ot.name', 'tote')
|
|
44
|
+
.addSelect('case when ot.tote_id is null then false else true end', 'toteBox')
|
|
45
|
+
.addSelect('ots.name', 'sealId')
|
|
46
|
+
.innerJoin('worksheets', 'w', 'w.release_good_id = rg.id')
|
|
47
|
+
.innerJoin('order_inventories', 'oi', 'oi.release_good_id = rg.id')
|
|
48
|
+
.innerJoin('bizplaces', 'bizplace', 'bizplace.id = rg.bizplace_id')
|
|
49
|
+
.innerJoin('order_tote_items', 'oti', 'oti.order_inventory_id = oi.id')
|
|
50
|
+
.innerJoin('order_totes', 'ot', 'ot.id = oti.order_tote_id')
|
|
51
|
+
.innerJoin('order_tote_seals', 'ots', 'ots.order_tote_id = ot.id')
|
|
52
|
+
.where('rg.status = :status', { status: 'LOADING' })
|
|
53
|
+
.andWhere('bizplace.id = :bizplaceId', { bizplaceId: bizplaceFilter.value })
|
|
54
|
+
.andWhere('rg.release_date = :releaseDate', { releaseDate: releaseDateFilter.value })
|
|
55
|
+
.andWhere('w.type = :type', { type: 'LOADING' })
|
|
56
|
+
.andWhere('rg.domain_id = :domainId', { domainId: domain.id })
|
|
57
|
+
|
|
58
|
+
orderInfoFilter
|
|
59
|
+
? qb.andWhere(
|
|
60
|
+
'(rg.name ~* :orderInfoFilter or rg.ref_no ~* :orderInfoFilter or rg.ref_no_2 ~* :orderInfoFilter or rg.ref_no_3 ~* :orderInfoFilter)',
|
|
61
|
+
{ orderInfoFilter }
|
|
62
|
+
)
|
|
63
|
+
: ''
|
|
64
|
+
|
|
65
|
+
toteBoxFilter ? qb.andWhere('ot.tote_id is not null') : ''
|
|
66
|
+
|
|
67
|
+
routeIdFilter ? qb.andWhere(`rg.route_id ilike :routeId`, { routeId: routeIdFilter.value }) : ''
|
|
68
|
+
|
|
69
|
+
stopIdFilter ? qb.andWhere(`rg.stop_id ilike :stopId`, { stopId: stopIdFilter.value }) : ''
|
|
70
|
+
|
|
71
|
+
toteIdFilter ? qb.andWhere(`ot.name ilike :toteId`, { toteId: toteIdFilter.value }) : ''
|
|
72
|
+
|
|
73
|
+
qb.orderBy('w.created_at', 'DESC')
|
|
74
|
+
qb.addOrderBy('ots.name', 'ASC')
|
|
75
|
+
|
|
76
|
+
console.time('loadingQcReport')
|
|
77
|
+
let items = await qb.getRawMany()
|
|
78
|
+
console.timeEnd('loadingQcReport')
|
|
79
|
+
|
|
80
|
+
items = items.reduce((prev, curr, idx) => {
|
|
81
|
+
let reducedItemIndex = prev.findIndex(itm => itm.releaseGoodNo == curr.releaseGoodNo && itm.tote == curr.tote)
|
|
82
|
+
if (reducedItemIndex == -1) {
|
|
83
|
+
prev.push(curr)
|
|
84
|
+
prev[prev.length - 1].totalSeal = 1
|
|
85
|
+
} else {
|
|
86
|
+
prev[reducedItemIndex].orderQuantity += curr.orderQuantity
|
|
87
|
+
if (!prev[reducedItemIndex].sealId.includes(curr.sealId)) {
|
|
88
|
+
prev[reducedItemIndex].sealId = prev[reducedItemIndex].sealId.concat(', ', curr.sealId)
|
|
89
|
+
prev[reducedItemIndex].totalSeal++
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return prev
|
|
93
|
+
}, [])
|
|
94
|
+
|
|
95
|
+
return items
|
|
96
|
+
} catch (error) {
|
|
97
|
+
throw error
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -14,6 +14,8 @@ import { CostingReport } from './costing-report'
|
|
|
14
14
|
import { CostingReportList } from './costing-report-list'
|
|
15
15
|
import { ReleaseInventoryReport } from './release-inventory-report'
|
|
16
16
|
import { ReleaseInventoryReportList } from './release-inventory-report-list'
|
|
17
|
+
import { LoadingQcReport } from './loading-qc-report'
|
|
18
|
+
import { LoadingQcReportList } from './loading-qc-report-list'
|
|
17
19
|
|
|
18
20
|
export const Query = `
|
|
19
21
|
inboundSerialNumberReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundSerialNumberReportList @transaction
|
|
@@ -23,6 +25,7 @@ export const Query = `
|
|
|
23
25
|
productLabelReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ProductLabelReportList @transaction
|
|
24
26
|
costingReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): CostingReportList @transaction
|
|
25
27
|
releaseInventoryReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): ReleaseInventoryReportList @transaction
|
|
28
|
+
loadingQcReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): [LoadingQcReport] @transaction
|
|
26
29
|
`
|
|
27
30
|
|
|
28
31
|
export const Types = [
|
|
@@ -39,5 +42,7 @@ export const Types = [
|
|
|
39
42
|
CostingReport,
|
|
40
43
|
CostingReportList,
|
|
41
44
|
ReleaseInventoryReport,
|
|
42
|
-
ReleaseInventoryReportList
|
|
45
|
+
ReleaseInventoryReportList,
|
|
46
|
+
LoadingQcReport,
|
|
47
|
+
LoadingQcReportList
|
|
43
48
|
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
export const LoadingQcReport = gql`
|
|
4
|
+
type LoadingQcReport {
|
|
5
|
+
bizplaceName: String
|
|
6
|
+
releaseGoodNo: String
|
|
7
|
+
routeId: String
|
|
8
|
+
stopId: String
|
|
9
|
+
releaseDate: Date
|
|
10
|
+
orderQuantity: Int
|
|
11
|
+
tote: String
|
|
12
|
+
toteBox: Boolean
|
|
13
|
+
sealId: String
|
|
14
|
+
totalSeal: Int
|
|
15
|
+
}
|
|
16
|
+
`
|
package/things-factory.config.js
CHANGED
package/translations/en.json
CHANGED
|
@@ -214,10 +214,10 @@
|
|
|
214
214
|
"field.comment": "comment",
|
|
215
215
|
"field.company": "company",
|
|
216
216
|
"field.completed": "completed",
|
|
217
|
-
"field.contact": "contact",
|
|
218
217
|
"field.contact_name": "contact name",
|
|
219
218
|
"field.contact_point": "contact point",
|
|
220
219
|
"field.contact_type": "contact type",
|
|
220
|
+
"field.contact": "contact",
|
|
221
221
|
"field.container_no": "container no",
|
|
222
222
|
"field.container_size": "container size",
|
|
223
223
|
"field.container": "container",
|
|
@@ -388,6 +388,7 @@
|
|
|
388
388
|
"field.order_date": "order date",
|
|
389
389
|
"field.order_info": "order info",
|
|
390
390
|
"field.order_no": "order no",
|
|
391
|
+
"field.order_quantity": "order quantity",
|
|
391
392
|
"field.order_ref_no": "order ref no",
|
|
392
393
|
"field.order_remark": "order remark",
|
|
393
394
|
"field.order_status": "order status",
|
|
@@ -513,6 +514,7 @@
|
|
|
513
514
|
"field.ro_type": "RO type",
|
|
514
515
|
"field.ro": "RO",
|
|
515
516
|
"field.rounded_uom_value": "rounded uom value",
|
|
517
|
+
"field.route_id": "route id",
|
|
516
518
|
"field.route_label": "route label",
|
|
517
519
|
"field.route": "route",
|
|
518
520
|
"field.routing_type": "routing type",
|
|
@@ -521,6 +523,7 @@
|
|
|
521
523
|
"field.row_start": "row start",
|
|
522
524
|
"field.row": "row",
|
|
523
525
|
"field.scanned": "scanned",
|
|
526
|
+
"field.seal_id": "seal id",
|
|
524
527
|
"field.seal_no": "seal no",
|
|
525
528
|
"field.selected_qty": "selected qty",
|
|
526
529
|
"field.selected": "selected",
|
|
@@ -546,6 +549,7 @@
|
|
|
546
549
|
"field.started_at": "started at",
|
|
547
550
|
"field.status": "status",
|
|
548
551
|
"field.stock_name": "stock name",
|
|
552
|
+
"field.stop_id": "stop id",
|
|
549
553
|
"field.stored_at": "stored at",
|
|
550
554
|
"field.stored": "stored",
|
|
551
555
|
"field.sub_brand": "sub brand",
|
|
@@ -573,9 +577,11 @@
|
|
|
573
577
|
"field.total_cost": "total cost",
|
|
574
578
|
"field.total_delivery": "total delivery",
|
|
575
579
|
"field.total_pack_qty": "total pack qty",
|
|
580
|
+
"field.total_pallet": "total pallet",
|
|
576
581
|
"field.total_price": "total price",
|
|
577
582
|
"field.total_qty": "total qty",
|
|
578
583
|
"field.total_quantity": "total quantity",
|
|
584
|
+
"field.total_seal": "total seal",
|
|
579
585
|
"field.total_self_collect": "total self collect",
|
|
580
586
|
"field.total_tracking_no": "total tracking no",
|
|
581
587
|
"field.total_unit_gross_weight": "total unit gross weight",
|
|
@@ -584,6 +590,8 @@
|
|
|
584
590
|
"field.total_uom": "total uom",
|
|
585
591
|
"field.total_volume": "total volume",
|
|
586
592
|
"field.total": "total",
|
|
593
|
+
"field.tote_box": "tote box",
|
|
594
|
+
"field.tote_id": "tote id",
|
|
587
595
|
"field.tote_no": "tote no",
|
|
588
596
|
"field.tote": "tote",
|
|
589
597
|
"field.tracking_no": "tracking no",
|
|
@@ -637,7 +645,6 @@
|
|
|
637
645
|
"field.your_name": "your name",
|
|
638
646
|
"field.zone": "zone",
|
|
639
647
|
"filed.role": "role",
|
|
640
|
-
"field.total_pallet": "total pallet",
|
|
641
648
|
"label.activated": "activated",
|
|
642
649
|
"label.actual_qty": "actual qty",
|
|
643
650
|
"label.add_extension": "add extension",
|
|
@@ -1713,6 +1720,7 @@
|
|
|
1713
1720
|
"title.job_sheet_list": "job sheet list",
|
|
1714
1721
|
"title.job_sheet_report": "job sheet report",
|
|
1715
1722
|
"title.loaded": "loaded",
|
|
1723
|
+
"title.loading_qc_report": "loading qc report",
|
|
1716
1724
|
"title.loading": "loading",
|
|
1717
1725
|
"title.location_label_format": "location label format",
|
|
1718
1726
|
"title.location_scanned_is_not_a_quarantine_zone": "Location scanned is not a quarantine zone!",
|
package/translations/ko.json
CHANGED
|
@@ -2047,5 +2047,13 @@
|
|
|
2047
2047
|
"field.release_order": "[ko] release order",
|
|
2048
2048
|
"field.sorted_by": "[ko] sorted by",
|
|
2049
2049
|
"text.pallet_(x)_is_not_found_in_cycle_count_worksheet_(y)": "[ko] pallet ({x}) is not found in cycle count worksheet ({y})",
|
|
2050
|
-
"text.qty_should_not_have_decimal": "[ko] qty should not have decimal"
|
|
2050
|
+
"text.qty_should_not_have_decimal": "[ko] qty should not have decimal",
|
|
2051
|
+
"title.loading_qc_report": "[ko] loading qc report",
|
|
2052
|
+
"field.route_id": "[ko] route id",
|
|
2053
|
+
"field.stop_id": "[ko] stop id",
|
|
2054
|
+
"field.tote_id": "[ko] tote id",
|
|
2055
|
+
"field.seal_id": "[ko] seal id",
|
|
2056
|
+
"field.order_quantity": "[ko] order quantity",
|
|
2057
|
+
"field.tote_box": "[ko] tote box",
|
|
2058
|
+
"field.total_seal": "[ko] total seal"
|
|
2051
2059
|
}
|
package/translations/ms.json
CHANGED
|
@@ -1920,5 +1920,13 @@
|
|
|
1920
1920
|
"field.release_order": "[ms] release order",
|
|
1921
1921
|
"field.sorted_by": "[ms] sorted by",
|
|
1922
1922
|
"text.pallet_(x)_is_not_found_in_cycle_count_worksheet_(y)": "[ms] pallet ({x}) is not found in cycle count worksheet ({y})",
|
|
1923
|
-
"text.qty_should_not_have_decimal": "[ms] qty should not have decimal"
|
|
1923
|
+
"text.qty_should_not_have_decimal": "[ms] qty should not have decimal",
|
|
1924
|
+
"title.loading_qc_report": "[ms] loading qc report",
|
|
1925
|
+
"field.route_id": "[ms] route id",
|
|
1926
|
+
"field.stop_id": "[ms] stop id",
|
|
1927
|
+
"field.tote_id": "[ms] tote id",
|
|
1928
|
+
"field.seal_id": "[ms] seal id",
|
|
1929
|
+
"field.order_quantity": "[ms] order quantity",
|
|
1930
|
+
"field.tote_box": "[ms] tote box",
|
|
1931
|
+
"field.total_seal": "[ms] total seal"
|
|
1924
1932
|
}
|
package/translations/zh.json
CHANGED
|
@@ -1870,5 +1870,13 @@
|
|
|
1870
1870
|
"field.release_order": "[zh] release order",
|
|
1871
1871
|
"field.sorted_by": "[zh] sorted by",
|
|
1872
1872
|
"text.pallet_(x)_is_not_found_in_cycle_count_worksheet_(y)": "[zh] pallet ({x}) is not found in cycle count worksheet ({y})",
|
|
1873
|
-
"text.qty_should_not_have_decimal": "[zh] qty should not have decimal"
|
|
1873
|
+
"text.qty_should_not_have_decimal": "[zh] qty should not have decimal",
|
|
1874
|
+
"title.loading_qc_report": "[zh] loading qc report",
|
|
1875
|
+
"field.route_id": "[zh] route id",
|
|
1876
|
+
"field.stop_id": "[zh] stop id",
|
|
1877
|
+
"field.tote_id": "[zh] tote id",
|
|
1878
|
+
"field.seal_id": "[zh] seal id",
|
|
1879
|
+
"field.order_quantity": "[zh] order quantity",
|
|
1880
|
+
"field.tote_box": "[zh] tote box",
|
|
1881
|
+
"field.total_seal": "[zh] total seal"
|
|
1874
1882
|
}
|