@things-factory/operato-wms 4.3.80-alpha.1 → 4.3.80-alpha.5
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/components/select-inventory-popup.js +1 -1
- package/client/pages/inbound/undo-unload-popup.js +37 -21
- package/client/pages/inbound/worksheet-putaway.js +1 -1
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +73 -41
- package/client/pages/order/release-order/create-release-order.js +19 -6
- package/client/pages/outbound/packing-product.js +11 -6
- package/dist-server/graphql/resolvers/dashboard/arrival-notices-by-status.js +20 -8
- package/dist-server/graphql/resolvers/dashboard/arrival-notices-by-status.js.map +1 -1
- package/dist-server/graphql/resolvers/dashboard/index.js +2 -1
- package/dist-server/graphql/resolvers/dashboard/index.js.map +1 -1
- package/dist-server/graphql/resolvers/dashboard/release-goods-by-status.js +20 -8
- package/dist-server/graphql/resolvers/dashboard/release-goods-by-status.js.map +1 -1
- package/dist-server/graphql/resolvers/dashboard/unit-inbounded-outbounded.js +56 -0
- package/dist-server/graphql/resolvers/dashboard/unit-inbounded-outbounded.js.map +1 -0
- package/dist-server/graphql/types/dashboard/index.js +1 -0
- package/dist-server/graphql/types/dashboard/index.js.map +1 -1
- package/package.json +50 -50
- package/server/graphql/resolvers/dashboard/arrival-notices-by-status.ts +19 -9
- package/server/graphql/resolvers/dashboard/index.ts +3 -1
- package/server/graphql/resolvers/dashboard/release-goods-by-status.ts +19 -9
- package/server/graphql/resolvers/dashboard/unit-inbounded-outbounded.ts +61 -0
- package/server/graphql/types/dashboard/index.ts +1 -0
- package/translations/en.json +3 -0
|
@@ -422,7 +422,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
|
|
|
422
422
|
}
|
|
423
423
|
|
|
424
424
|
if (paneType === 'product') {
|
|
425
|
-
const data = this.inventoryData
|
|
425
|
+
const data = this.inventoryData.filter(res => res.batchId !== null)
|
|
426
426
|
|
|
427
427
|
if (data?.length > 0) {
|
|
428
428
|
const remapData = data.map(res => {
|
|
@@ -12,8 +12,7 @@ import { isMobileDevice } from '@things-factory/utils'
|
|
|
12
12
|
class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
13
13
|
static get properties() {
|
|
14
14
|
return {
|
|
15
|
-
|
|
16
|
-
_selectedInventoryIds: Array,
|
|
15
|
+
_selectedRecords: Array,
|
|
17
16
|
config: Object,
|
|
18
17
|
data: Object,
|
|
19
18
|
enableCartonLabel: Boolean,
|
|
@@ -26,8 +25,7 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
26
25
|
|
|
27
26
|
constructor() {
|
|
28
27
|
super()
|
|
29
|
-
this.
|
|
30
|
-
this._autoSelectInventoryIds = []
|
|
28
|
+
this._selectedRecords = []
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
static get styles() {
|
|
@@ -96,13 +94,21 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
96
94
|
|
|
97
95
|
render() {
|
|
98
96
|
return html`
|
|
99
|
-
<form id="input-form" class="single-column-form"
|
|
97
|
+
<form id="input-form" class="single-column-form">
|
|
100
98
|
<fieldset>
|
|
101
99
|
${this.enableCartonLabel
|
|
102
100
|
? html`<label>${i18next.t('label.carton_id')}</label>
|
|
103
|
-
<barcode-scanable-input
|
|
101
|
+
<barcode-scanable-input
|
|
102
|
+
name="cartonId"
|
|
103
|
+
custom-input
|
|
104
|
+
@keypress="${this._populateTargetedInventory.bind(this)}"
|
|
105
|
+
></barcode-scanable-input>`
|
|
104
106
|
: html`<label>${i18next.t('label.lot_id')}</label>
|
|
105
|
-
<barcode-scanable-input
|
|
107
|
+
<barcode-scanable-input
|
|
108
|
+
name="lotId"
|
|
109
|
+
custom-input
|
|
110
|
+
@keypress="${this._populateTargetedInventory.bind(this)}"
|
|
111
|
+
></barcode-scanable-input>`}
|
|
106
112
|
</fieldset>
|
|
107
113
|
</form>
|
|
108
114
|
|
|
@@ -112,6 +118,7 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
112
118
|
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
113
119
|
.config=${this.config}
|
|
114
120
|
.data="${this.data}"
|
|
121
|
+
.selectedRecords=${this._selectedRecords}
|
|
115
122
|
></data-grist>
|
|
116
123
|
</div>
|
|
117
124
|
|
|
@@ -125,7 +132,9 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
125
132
|
this.config = {
|
|
126
133
|
pagination: { infinite: true },
|
|
127
134
|
rows: { selectable: { multiple: true }, appendable: false },
|
|
128
|
-
list: {
|
|
135
|
+
list: {
|
|
136
|
+
fields: ['palletId', 'cartonId', 'batchId', 'sku', 'product', 'packingType', 'packingSize', 'qty', 'status']
|
|
137
|
+
},
|
|
129
138
|
columns: [
|
|
130
139
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
131
140
|
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
@@ -151,6 +160,13 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
151
160
|
header: i18next.t('field.batch_id'),
|
|
152
161
|
width: 150
|
|
153
162
|
},
|
|
163
|
+
{
|
|
164
|
+
type: 'string',
|
|
165
|
+
name: 'sku',
|
|
166
|
+
label: true,
|
|
167
|
+
header: i18next.t('field.sku'),
|
|
168
|
+
width: 120
|
|
169
|
+
},
|
|
154
170
|
{
|
|
155
171
|
type: 'object',
|
|
156
172
|
name: 'product',
|
|
@@ -199,11 +215,8 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
199
215
|
async _undoUnloading() {
|
|
200
216
|
try {
|
|
201
217
|
let selectedInventoryIds = []
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
} else {
|
|
205
|
-
selectedInventoryIds = this.dataGrist.selected.map(inventory => inventory.id)
|
|
206
|
-
}
|
|
218
|
+
selectedInventoryIds = this.dataGrist.selected.map(inventory => inventory.id)
|
|
219
|
+
|
|
207
220
|
if (!selectedInventoryIds?.length) throw new Error(i18next.t('text.select_at_least_one_inventory_to_undo'))
|
|
208
221
|
|
|
209
222
|
this._validateScanInventory()
|
|
@@ -226,9 +239,9 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
226
239
|
}
|
|
227
240
|
|
|
228
241
|
_populateTargetedInventory(e) {
|
|
229
|
-
if (e.keyCode
|
|
230
|
-
|
|
231
|
-
|
|
242
|
+
if (e.keyCode !== 13) return
|
|
243
|
+
e.preventDefault()
|
|
244
|
+
try {
|
|
232
245
|
let targetedUndoInventories = []
|
|
233
246
|
|
|
234
247
|
if (this.enableCartonLabel) {
|
|
@@ -248,13 +261,16 @@ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
248
261
|
this.lotInput.value = ''
|
|
249
262
|
}
|
|
250
263
|
this._showToast({ message: i18next.t('text.no_matching_unloaded_inventory_found') })
|
|
251
|
-
} else if (targetedUndoInventories?.length == 1) {
|
|
252
|
-
this.data = { records: targetedUndoInventories }
|
|
253
|
-
this._autoSelectInventoryIds = targetedUndoInventories.map(inventory => inventory.id)
|
|
254
|
-
this._undoUnloading()
|
|
255
264
|
} else {
|
|
256
|
-
this.data = {
|
|
265
|
+
this.data = {
|
|
266
|
+
records: targetedUndoInventories.map(itm => {
|
|
267
|
+
return { ...itm, sku: itm.product.sku }
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
this._selectedRecords = targetedUndoInventories?.length == 1 ? targetedUndoInventories : []
|
|
257
271
|
}
|
|
272
|
+
} catch (e) {
|
|
273
|
+
this._showToast(e)
|
|
258
274
|
}
|
|
259
275
|
}
|
|
260
276
|
|
|
@@ -485,7 +485,7 @@ class WorksheetPutaway extends localize(i18next)(PageView) {
|
|
|
485
485
|
const currentLocationColumn = {
|
|
486
486
|
type: 'object',
|
|
487
487
|
name: 'location',
|
|
488
|
-
header: i18next.t('field.
|
|
488
|
+
header: i18next.t('field.location'),
|
|
489
489
|
width: 170
|
|
490
490
|
}
|
|
491
491
|
const statusColumnConfig = {
|
|
@@ -405,6 +405,78 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
|
|
|
405
405
|
imex: { header: i18next.t('field.updated_by'), key: 'updater.name', width: 25, type: 'string' },
|
|
406
406
|
sortable: true,
|
|
407
407
|
width: 200
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
type: 'string',
|
|
411
|
+
name: 'attentionTo',
|
|
412
|
+
header: i18next.t('field.receiver_name'),
|
|
413
|
+
imex: { header: i18next.t('field.receiver_name'), key: 'attentionTo', width: 25, type: 'string' },
|
|
414
|
+
width: 200,
|
|
415
|
+
hidden: true
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
type: 'string',
|
|
419
|
+
name: 'attentionCompany',
|
|
420
|
+
header: i18next.t('field.receiver_company'),
|
|
421
|
+
imex: { header: i18next.t('field.receiver_company'), key: 'attentionCompany', width: 25, type: 'string' },
|
|
422
|
+
width: 200,
|
|
423
|
+
hidden: true
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
type: 'string',
|
|
427
|
+
name: 'deliveryAddress1',
|
|
428
|
+
header: i18next.t('field.delivery_address'),
|
|
429
|
+
imex: { header: i18next.t('field.delivery_address'), key: 'deliveryAddress1', width: 75, type: 'string' },
|
|
430
|
+
width: 200,
|
|
431
|
+
hidden: true
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
type: 'string',
|
|
435
|
+
name: 'city',
|
|
436
|
+
header: i18next.t('field.city'),
|
|
437
|
+
imex: { header: i18next.t('field.city'), key: 'city', width: 25, type: 'string' },
|
|
438
|
+
width: 200,
|
|
439
|
+
hidden: true
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
type: 'string',
|
|
443
|
+
name: 'state',
|
|
444
|
+
header: i18next.t('field.state'),
|
|
445
|
+
imex: { header: i18next.t('field.state'), key: 'state', width: 25, type: 'string' },
|
|
446
|
+
width: 200,
|
|
447
|
+
hidden: true
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
type: 'string',
|
|
451
|
+
name: 'country',
|
|
452
|
+
header: i18next.t('field.country'),
|
|
453
|
+
imex: { header: i18next.t('field.country'), key: 'country', width: 20, type: 'string' },
|
|
454
|
+
width: 200,
|
|
455
|
+
hidden: true
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
type: 'string',
|
|
459
|
+
name: 'phone1',
|
|
460
|
+
header: `${i18next.t('field.contact')} 1`,
|
|
461
|
+
imex: { header: `${i18next.t('field.contact')} 1`, key: 'phone1', width: 25, type: 'string' },
|
|
462
|
+
width: 200,
|
|
463
|
+
hidden: true
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
type: 'string',
|
|
467
|
+
name: 'phone2',
|
|
468
|
+
header: `${i18next.t('field.contact')} 2`,
|
|
469
|
+
imex: { header: `${i18next.t('field.contact')} 2`, key: 'phone2', width: 25, type: 'string' },
|
|
470
|
+
width: 200,
|
|
471
|
+
hidden: true
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
type: 'string',
|
|
475
|
+
name: 'email',
|
|
476
|
+
header: i18next.t('field.email'),
|
|
477
|
+
imex: { header: i18next.t('field.email'), key: 'email', width: 25, type: 'string' },
|
|
478
|
+
width: 200,
|
|
479
|
+
hidden: true
|
|
408
480
|
}
|
|
409
481
|
]
|
|
410
482
|
}
|
|
@@ -430,7 +502,6 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
|
|
|
430
502
|
items {
|
|
431
503
|
id
|
|
432
504
|
trackingNo
|
|
433
|
-
attentionTo
|
|
434
505
|
deliveryAddress1
|
|
435
506
|
deliveryAddress2
|
|
436
507
|
deliveryAddress3
|
|
@@ -444,6 +515,7 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
|
|
|
444
515
|
country
|
|
445
516
|
phone1
|
|
446
517
|
phone2
|
|
518
|
+
email
|
|
447
519
|
postalCode
|
|
448
520
|
marketplaceOrderStatus
|
|
449
521
|
transporter
|
|
@@ -713,46 +785,6 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
|
|
|
713
785
|
)
|
|
714
786
|
}
|
|
715
787
|
|
|
716
|
-
async _exportableData() {
|
|
717
|
-
try {
|
|
718
|
-
let data = []
|
|
719
|
-
|
|
720
|
-
var headerSetting = [
|
|
721
|
-
{ header: i18next.t('field.ro'), key: 'name', width: 25, type: 'string' },
|
|
722
|
-
{ header: i18next.t('field.company'), key: 'bizplaceName', width: 25, type: 'string' },
|
|
723
|
-
{ header: i18next.t('field.ref_no'), key: 'refNo', width: 25, type: 'string' },
|
|
724
|
-
{ header: i18next.t('field.ref_no_2'), key: 'refNo2', width: 25, type: 'string' },
|
|
725
|
-
{ header: i18next.t('field.release_date'), key: 'releaseDate', width: 30, type: 'date' },
|
|
726
|
-
{ header: i18next.t('field.postal_code'), key: 'postalCode', width: 30, type: 'string' },
|
|
727
|
-
{
|
|
728
|
-
header: i18next.t('field.marketplace_order_status'),
|
|
729
|
-
key: 'marketplaceOrderStatus',
|
|
730
|
-
width: 30,
|
|
731
|
-
type: 'string'
|
|
732
|
-
},
|
|
733
|
-
{ header: i18next.t('field.warehouse_status'), key: 'status', width: 30, type: 'string' },
|
|
734
|
-
{ header: i18next.t('field.transporter'), key: 'transporter', width: 30, type: 'string' },
|
|
735
|
-
{ header: i18next.t('field.delivery_address'), key: 'deliveryAddress1', width: 30, type: 'string' },
|
|
736
|
-
{ header: i18next.t('field.attention_to'), key: 'attentionTo', width: 30, type: 'string' },
|
|
737
|
-
{ header: i18next.t('field.phone'), key: 'phone1', width: 30, type: 'string' }
|
|
738
|
-
]
|
|
739
|
-
|
|
740
|
-
if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
|
|
741
|
-
data = this.dataGrist.selected
|
|
742
|
-
} else {
|
|
743
|
-
const bizplaceFilters = (await this.searchForm.getQueryFilters()).filter(x => x.name === 'bizplaceId')
|
|
744
|
-
if (bizplaceFilters.length == 0) {
|
|
745
|
-
throw new Error(`Please select a customer for export.`)
|
|
746
|
-
}
|
|
747
|
-
data = await this.fetchHandler({ page: 1, limit: 9999999 })
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
return { header: headerSetting, data }
|
|
751
|
-
} catch (e) {
|
|
752
|
-
this._showToast(e)
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
|
|
756
788
|
async _openGenerateWorksheetPopup() {
|
|
757
789
|
try {
|
|
758
790
|
if (this.dataGrist.selected.length <= 0)
|
|
@@ -1265,7 +1265,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
1265
1265
|
imex: { header: i18next.t('field.inventory_list'), key: 'productName', width: 50, type: 'string' },
|
|
1266
1266
|
handlers: {
|
|
1267
1267
|
click: (columns, data, column, record, rowIndex) => {
|
|
1268
|
-
this._openBulkProductSelection('product')
|
|
1268
|
+
this._openBulkProductSelection('product', rowIndex)
|
|
1269
1269
|
}
|
|
1270
1270
|
},
|
|
1271
1271
|
width: 350
|
|
@@ -1377,7 +1377,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
1377
1377
|
imex: { header: i18next.t('field.inventory_list'), key: 'productName', width: 50, type: 'string' },
|
|
1378
1378
|
handlers: {
|
|
1379
1379
|
click: (columns, data, column, record, rowIndex) => {
|
|
1380
|
-
this._openBulkProductSelection('pallet')
|
|
1380
|
+
this._openBulkProductSelection('pallet', rowIndex)
|
|
1381
1381
|
}
|
|
1382
1382
|
},
|
|
1383
1383
|
width: 350
|
|
@@ -2064,7 +2064,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
2064
2064
|
if (!this.vasGrist.dirtyData.records.every(record => record.ready)) throw new Error('there_is_not_ready_vas')
|
|
2065
2065
|
}
|
|
2066
2066
|
|
|
2067
|
-
_openBulkProductSelection(type) {
|
|
2067
|
+
_openBulkProductSelection(type, rowIndex) {
|
|
2068
2068
|
if (this._bizplaceId) {
|
|
2069
2069
|
openPopup(
|
|
2070
2070
|
html`
|
|
@@ -2079,9 +2079,22 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
2079
2079
|
for (let i = 0; i < e.detail.multipleProducts.length; i++) {
|
|
2080
2080
|
newRecords.push(e.detail.multipleProducts[i])
|
|
2081
2081
|
}
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2082
|
+
|
|
2083
|
+
if (newRecords.length > 1) {
|
|
2084
|
+
this.inventoryData = {
|
|
2085
|
+
...this.inventoryData,
|
|
2086
|
+
records: [...this.inventoryGrist.dirtyData.records, ...newRecords]
|
|
2087
|
+
}
|
|
2088
|
+
} else {
|
|
2089
|
+
// update existing inventory data records
|
|
2090
|
+
this.inventoryGrist.dirtyData.records.splice(rowIndex, 1, {
|
|
2091
|
+
...this.inventoryGrist.dirtyData.records[rowIndex],
|
|
2092
|
+
...newRecords[0]
|
|
2093
|
+
})
|
|
2094
|
+
this.inventoryData = {
|
|
2095
|
+
...this.inventoryData,
|
|
2096
|
+
records: [...this.inventoryGrist.dirtyData.records]
|
|
2097
|
+
}
|
|
2085
2098
|
}
|
|
2086
2099
|
}}"
|
|
2087
2100
|
></select-inventory-popup>
|
|
@@ -37,6 +37,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
37
37
|
trackingNo: String,
|
|
38
38
|
totalBinRO: Number,
|
|
39
39
|
binRo: String,
|
|
40
|
+
ownTransport: Boolean,
|
|
40
41
|
toggleComplete: Boolean,
|
|
41
42
|
_bizplaceName: String,
|
|
42
43
|
_enableProductScanning: Boolean,
|
|
@@ -105,11 +106,13 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
if (this.releaseGoodNo && this.platform == 'operato' && this.completed) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
if (!this.ownTransport) {
|
|
110
|
+
actions.push({
|
|
111
|
+
title: i18next.t('button.print_airway_bill'),
|
|
112
|
+
action: this.printSellercraftDocument.bind(this, 'awb'),
|
|
113
|
+
...CommonButtonStyles.label
|
|
114
|
+
})
|
|
115
|
+
}
|
|
113
116
|
|
|
114
117
|
actions.push({
|
|
115
118
|
title: i18next.t('button.print_invoice'),
|
|
@@ -398,6 +401,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
398
401
|
id
|
|
399
402
|
name
|
|
400
403
|
remark
|
|
404
|
+
ownTransport
|
|
401
405
|
checkedRemarkAt
|
|
402
406
|
totalInventoriesByBin
|
|
403
407
|
isOrderInventoryBin
|
|
@@ -504,6 +508,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
504
508
|
this.shippingProvider = worksheetInfo.shippingProvider
|
|
505
509
|
this.orderInformation = worksheetInfo.marketplaceOrder
|
|
506
510
|
this.orderRemark = worksheetInfo.releaseGood?.remark
|
|
511
|
+
this.ownTransport = worksheetInfo.releaseGood?.ownTransport
|
|
507
512
|
this.checkedRemarkAt = worksheetInfo.releaseGood?.checkedRemarkAt
|
|
508
513
|
this.toggleComplete = Boolean(worksheetInfo.releaseGood?.remark)
|
|
509
514
|
? worksheetDetailInfos.every(res => res.status === 'DONE') &&
|
|
@@ -979,7 +984,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
979
984
|
await this.printAirwayBill()
|
|
980
985
|
}
|
|
981
986
|
|
|
982
|
-
if (this.releaseGoodNo && this.platform == 'operato' && this.airwayBill && this.completed) {
|
|
987
|
+
if (this.releaseGoodNo && this.platform == 'operato' && !this.ownTransport && this.airwayBill && this.completed) {
|
|
983
988
|
await this.printSellercraftDocument('awb')
|
|
984
989
|
}
|
|
985
990
|
}
|
|
@@ -7,18 +7,30 @@ const sales_base_1 = require("@things-factory/sales-base");
|
|
|
7
7
|
const shell_1 = require("@things-factory/shell");
|
|
8
8
|
exports.arrivalNoticesByStatusResolver = {
|
|
9
9
|
async arrivalNoticesByStatus(_, params, context) {
|
|
10
|
+
var _a;
|
|
10
11
|
const { domain, user } = context.state;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const bizplaceId = ((_a = params.filters.find((filter) => filter.name === 'bizplace')) === null || _a === void 0 ? void 0 : _a.value) || 'ALL';
|
|
13
|
+
params.filters = params.filters.filter(filter => filter.name !== 'bizplace');
|
|
14
|
+
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);
|
|
15
|
+
let bizplaceIds;
|
|
16
|
+
if (bizplaceId && (bizplaceId == 'ALL' || bizplaceId.match(v4))) {
|
|
17
|
+
let bizplaces = bizplaceId && bizplaceId != 'ALL' ? [bizplaceId] : await (0, biz_base_1.getPermittedBizplaceIds)(domain, user);
|
|
18
|
+
bizplaceIds = bizplaces
|
|
19
|
+
.map(bizplace => {
|
|
20
|
+
return "'" + (bizplace === null || bizplace === void 0 ? void 0 : bizplace.trim()) + "'";
|
|
21
|
+
})
|
|
22
|
+
.join(',');
|
|
18
23
|
}
|
|
24
|
+
else
|
|
25
|
+
throw new Error('invalid bizplaceId');
|
|
19
26
|
const qb = (0, typeorm_1.getRepository)(sales_base_1.ArrivalNotice).createQueryBuilder('an');
|
|
20
27
|
(0, shell_1.buildQuery)(qb, params, context);
|
|
21
|
-
return qb
|
|
28
|
+
return qb
|
|
29
|
+
.select('an.status', 'status')
|
|
30
|
+
.addSelect('COUNT(*) AS count')
|
|
31
|
+
.andWhere(`an.bizplace_id IN (${bizplaceIds})`)
|
|
32
|
+
.groupBy('an.status')
|
|
33
|
+
.getRawMany();
|
|
22
34
|
}
|
|
23
35
|
};
|
|
24
36
|
//# sourceMappingURL=arrival-notices-by-status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrival-notices-by-status.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/arrival-notices-by-status.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAG3D,uDAAkE;AAClE,2DAA0D;AAC1D,iDAAqE;AAExD,QAAA,8BAA8B,GAAG;IAC5C,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY
|
|
1
|
+
{"version":3,"file":"arrival-notices-by-status.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/arrival-notices-by-status.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAG3D,uDAAkE;AAClE,2DAA0D;AAC1D,iDAAqE;AAExD,QAAA,8BAA8B,GAAG;IAC5C,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;;QAClE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAmC,OAAO,CAAC,KAAK,CAAA;QACtE,MAAM,UAAU,GAAW,CAAA,MAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,0CAAE,KAAK,KAAI,KAAK,CAAA;QAC3G,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;QAC5E,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,wEAAwE,CAAC,CAAA;QAC/F,IAAI,WAAmB,CAAA;QAEvB,IAAI,UAAU,IAAI,CAAC,UAAU,IAAI,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE;YAC/D,IAAI,SAAS,GACX,UAAU,IAAI,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,kCAAuB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAChG,WAAW,GAAG,SAAS;iBACpB,GAAG,CAAC,QAAQ,CAAC,EAAE;gBACd,OAAO,GAAG,IAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,EAAE,CAAA,GAAG,GAAG,CAAA;YACrC,CAAC,CAAC;iBACD,IAAI,CAAC,GAAG,CAAC,CAAA;SACb;;YAAM,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;QAE5C,MAAM,EAAE,GAAsC,IAAA,uBAAa,EAAC,0BAAa,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;QACnG,IAAA,kBAAU,EAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;QAC/B,OAAO,EAAE;aACN,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC;aAC7B,SAAS,CAAC,mBAAmB,CAAC;aAC9B,QAAQ,CAAC,sBAAsB,WAAW,GAAG,CAAC;aAC9C,OAAO,CAAC,WAAW,CAAC;aACpB,UAAU,EAAE,CAAA;IACjB,CAAC;CACF,CAAA"}
|
|
@@ -7,5 +7,6 @@ const delivery_orders_by_status_1 = require("./delivery-orders-by-status");
|
|
|
7
7
|
const inventory_expiry_monitor_1 = require("./inventory-expiry-monitor");
|
|
8
8
|
const outbound_order_by_status_1 = require("./outbound-order-by-status");
|
|
9
9
|
const release_goods_by_status_1 = require("./release-goods-by-status");
|
|
10
|
-
|
|
10
|
+
const unit_inbounded_outbounded_1 = require("./unit-inbounded-outbounded");
|
|
11
|
+
exports.Query = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, arrival_notices_by_status_1.arrivalNoticesByStatusResolver), collection_orders_by_status_1.collectionOrdersByStatusResolver), delivery_orders_by_status_1.deliveryOrdersByStatusResolver), release_goods_by_status_1.releaseGoodsByStatusResolver), outbound_order_by_status_1.outboundOrderByStatusResolver), inventory_expiry_monitor_1.inventoryExpiryMonitorResolver), unit_inbounded_outbounded_1.unitInboundedOutboundedResolver);
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/index.ts"],"names":[],"mappings":";;;AAAA,2EAA4E;AAC5E,+EAAgF;AAChF,2EAA4E;AAC5E,yEAA2E;AAC3E,yEAA0E;AAC1E,uEAAwE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/index.ts"],"names":[],"mappings":";;;AAAA,2EAA4E;AAC5E,+EAAgF;AAChF,2EAA4E;AAC5E,yEAA2E;AAC3E,yEAA0E;AAC1E,uEAAwE;AACxE,2EAA6E;AAEhE,QAAA,KAAK,yGACb,0DAA8B,GAC9B,8DAAgC,GAChC,0DAA8B,GAC9B,sDAA4B,GAC5B,wDAA6B,GAC7B,yDAA8B,GAC9B,2DAA+B,EACnC"}
|
|
@@ -7,18 +7,30 @@ const sales_base_1 = require("@things-factory/sales-base");
|
|
|
7
7
|
const shell_1 = require("@things-factory/shell");
|
|
8
8
|
exports.releaseGoodsByStatusResolver = {
|
|
9
9
|
async releaseGoodsByStatus(_, params, context) {
|
|
10
|
+
var _a;
|
|
10
11
|
const { domain, user } = context.state;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const bizplaceId = ((_a = params.filters.find((filter) => filter.name === 'bizplace')) === null || _a === void 0 ? void 0 : _a.value) || 'ALL';
|
|
13
|
+
params.filters = params.filters.filter(filter => filter.name !== 'bizplace');
|
|
14
|
+
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);
|
|
15
|
+
let bizplaceIds;
|
|
16
|
+
if (bizplaceId && (bizplaceId == 'ALL' || bizplaceId.match(v4))) {
|
|
17
|
+
let bizplaces = bizplaceId && bizplaceId != 'ALL' ? [bizplaceId] : await (0, biz_base_1.getPermittedBizplaceIds)(domain, user);
|
|
18
|
+
bizplaceIds = bizplaces
|
|
19
|
+
.map(bizplace => {
|
|
20
|
+
return "'" + (bizplace === null || bizplace === void 0 ? void 0 : bizplace.trim()) + "'";
|
|
21
|
+
})
|
|
22
|
+
.join(',');
|
|
18
23
|
}
|
|
24
|
+
else
|
|
25
|
+
throw new Error('invalid bizplaceId');
|
|
19
26
|
const qb = (0, typeorm_1.getRepository)(sales_base_1.ReleaseGood).createQueryBuilder('rg');
|
|
20
27
|
(0, shell_1.buildQuery)(qb, params, context);
|
|
21
|
-
return qb
|
|
28
|
+
return qb
|
|
29
|
+
.select('rg.status', 'status')
|
|
30
|
+
.addSelect('COUNT(*) AS count')
|
|
31
|
+
.andWhere(`rg.bizplace_id IN (${bizplaceIds})`)
|
|
32
|
+
.groupBy('rg.status')
|
|
33
|
+
.getRawMany();
|
|
22
34
|
}
|
|
23
35
|
};
|
|
24
36
|
//# sourceMappingURL=release-goods-by-status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-goods-by-status.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/release-goods-by-status.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAG3D,uDAAkE;AAClE,2DAAwD;AACxD,iDAAqE;AAExD,QAAA,4BAA4B,GAAG;IAC1C,KAAK,CAAC,oBAAoB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY
|
|
1
|
+
{"version":3,"file":"release-goods-by-status.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/release-goods-by-status.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAG3D,uDAAkE;AAClE,2DAAwD;AACxD,iDAAqE;AAExD,QAAA,4BAA4B,GAAG;IAC1C,KAAK,CAAC,oBAAoB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;;QAChE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAmC,OAAO,CAAC,KAAK,CAAA;QACtE,MAAM,UAAU,GAAW,CAAA,MAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,0CAAE,KAAK,KAAI,KAAK,CAAA;QAC3G,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;QAC5E,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,wEAAwE,CAAC,CAAA;QAC/F,IAAI,WAAmB,CAAA;QAEvB,IAAI,UAAU,IAAI,CAAC,UAAU,IAAI,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE;YAC/D,IAAI,SAAS,GACX,UAAU,IAAI,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,kCAAuB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAChG,WAAW,GAAG,SAAS;iBACpB,GAAG,CAAC,QAAQ,CAAC,EAAE;gBACd,OAAO,GAAG,IAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,EAAE,CAAA,GAAG,GAAG,CAAA;YACrC,CAAC,CAAC;iBACD,IAAI,CAAC,GAAG,CAAC,CAAA;SACb;;YAAM,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;QAE5C,MAAM,EAAE,GAAoC,IAAA,uBAAa,EAAC,wBAAW,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC/F,IAAA,kBAAU,EAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;QAC/B,OAAO,EAAE;aACN,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC;aAC7B,SAAS,CAAC,mBAAmB,CAAC;aAC9B,QAAQ,CAAC,sBAAsB,WAAW,GAAG,CAAC;aAC9C,OAAO,CAAC,WAAW,CAAC;aACpB,UAAU,EAAE,CAAA;IACjB,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unitInboundedOutboundedResolver = void 0;
|
|
4
|
+
const biz_base_1 = require("@things-factory/biz-base");
|
|
5
|
+
exports.unitInboundedOutboundedResolver = {
|
|
6
|
+
async unitInboundedOutbounded(_, params, context) {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
const { domain, user, tx } = context.state;
|
|
9
|
+
const bizplaceId = ((_a = params.filters.find((filter) => filter.name === 'bizplace')) === null || _a === void 0 ? void 0 : _a.value) || 'ALL';
|
|
10
|
+
const fromDate = (_b = params.filters.find((filter) => filter.name === 'createdAt1')) === null || _b === void 0 ? void 0 : _b.value;
|
|
11
|
+
const toDate = (_c = params.filters.find((filter) => filter.name === 'createdAt2')) === null || _c === void 0 ? void 0 : _c.value;
|
|
12
|
+
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);
|
|
13
|
+
let bizplaceIds;
|
|
14
|
+
if (bizplaceId && (bizplaceId == 'ALL' || bizplaceId.match(v4))) {
|
|
15
|
+
let bizplaces = bizplaceId && bizplaceId != 'ALL' ? [bizplaceId] : await (0, biz_base_1.getPermittedBizplaceIds)(domain, user);
|
|
16
|
+
bizplaceIds = bizplaces
|
|
17
|
+
.map(bizplace => {
|
|
18
|
+
return "'" + (bizplace === null || bizplace === void 0 ? void 0 : bizplace.trim()) + "'";
|
|
19
|
+
})
|
|
20
|
+
.join(',');
|
|
21
|
+
}
|
|
22
|
+
else
|
|
23
|
+
throw new Error('invalid bizplaceId');
|
|
24
|
+
const orderStatus = await tx.query(`
|
|
25
|
+
WITH cte_unit ("status", "count", "type") AS (
|
|
26
|
+
SELECT 'INBOUNDED' AS status, 0 AS "count", 'inbound' AS "type"
|
|
27
|
+
UNION
|
|
28
|
+
SELECT 'OUTBOUNDED' AS status, 0 AS "count", 'outbound' AS "type"
|
|
29
|
+
) SELECT u."status", coalesce(src."count", u."count") AS "count", u."type"
|
|
30
|
+
FROM cte_unit u
|
|
31
|
+
LEFT JOIN (
|
|
32
|
+
SELECT "status", SUM("count") AS count, "type" FROM (
|
|
33
|
+
SELECT 'INBOUNDED' AS "status", SUM(coalesce(op.actual_pack_qty, op.pack_qty)) as "count", 'inbound' as "type" FROM order_products op
|
|
34
|
+
INNER JOIN arrival_notices an ON an.id = op.arrival_notice_id
|
|
35
|
+
WHERE an."status" in ('PUTTING_AWAY','DONE')
|
|
36
|
+
AND an."domain_id" = $1
|
|
37
|
+
AND an."bizplace_id" IN (${bizplaceIds})
|
|
38
|
+
AND an.created_at BETWEEN '${fromDate}' AND '${toDate}'
|
|
39
|
+
GROUP BY an."status"
|
|
40
|
+
UNION ALL
|
|
41
|
+
SELECT 'OUTBOUNDED' AS "status", SUM(coalesce(oi.release_qty , oi.picked_qty)) as "count", 'outbound' as "type" FROM order_inventories oi
|
|
42
|
+
INNER JOIN release_goods rg on rg.id = oi.release_good_id
|
|
43
|
+
WHERE rg."status" in ('DONE')
|
|
44
|
+
AND rg."domain_id" = $1
|
|
45
|
+
AND rg."bizplace_id" IN (${bizplaceIds})
|
|
46
|
+
AND rg.created_at BETWEEN '${fromDate}' AND '${toDate}'
|
|
47
|
+
GROUP BY rg."status"
|
|
48
|
+
) AS src
|
|
49
|
+
GROUP BY "status", "type"
|
|
50
|
+
) src ON src."status" = u."status"
|
|
51
|
+
order by "type", "status"
|
|
52
|
+
`, [domain.id]);
|
|
53
|
+
return orderStatus;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=unit-inbounded-outbounded.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-inbounded-outbounded.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/dashboard/unit-inbounded-outbounded.ts"],"names":[],"mappings":";;;AAGA,uDAAkE;AAGrD,QAAA,+BAA+B,GAAG;IAC7C,KAAK,CAAC,uBAAuB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;;QACnE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAC7F,MAAM,UAAU,GAAW,CAAA,MAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,0CAAE,KAAK,KAAI,KAAK,CAAA;QAC3G,MAAM,QAAQ,GAAW,MAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,0CAAE,KAAK,CAAA;QAClG,MAAM,MAAM,GAAW,MAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,0CAAE,KAAK,CAAA;QAChG,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,wEAAwE,CAAC,CAAA;QAC/F,IAAI,WAAmB,CAAA;QAEvB,IAAI,UAAU,IAAI,CAAC,UAAU,IAAI,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE;YAC/D,IAAI,SAAS,GACX,UAAU,IAAI,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,kCAAuB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAChG,WAAW,GAAG,SAAS;iBACpB,GAAG,CAAC,QAAQ,CAAC,EAAE;gBACd,OAAO,GAAG,IAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,EAAE,CAAA,GAAG,GAAG,CAAA;YACrC,CAAC,CAAC;iBACD,IAAI,CAAC,GAAG,CAAC,CAAA;SACb;;YAAM,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;QAE5C,MAAM,WAAW,GAAwC,MAAM,EAAE,CAAC,KAAK,CACrE;;;;;;;;;;;;;uCAaiC,WAAW;yCACT,QAAQ,UAAU,MAAM;;;;;;;uCAO1B,WAAW;yCACT,QAAQ,UAAU,MAAM;;;;;;OAM1D,EACD,CAAC,MAAM,CAAC,EAAE,CAAC,CACZ,CAAA;QAED,OAAO,WAAW,CAAA;IACpB,CAAC;CACF,CAAA"}
|
|
@@ -11,6 +11,7 @@ exports.Query = `
|
|
|
11
11
|
releaseGoodsByStatus(filters: [Filter]): [OrderStatusCounter] @transaction
|
|
12
12
|
outboundOrderByStatus(filters: [Filter]): [OrderStatusCounter] @transaction
|
|
13
13
|
inventoryExpiryMonitor(filters: [Filter]): InventoryExpiryStatus @transaction
|
|
14
|
+
unitInboundedOutbounded(filters: [Filter]): [OrderStatusCounter] @transaction
|
|
14
15
|
`;
|
|
15
16
|
exports.Types = [inventory_expiry_counter_1.InventoryExpiryCounter, inventory_expiry_status_1.InventoryExpiryStatus, order_status_counter_1.OrderStatusCounter];
|
|
16
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/dashboard/index.ts"],"names":[],"mappings":";;;AAAA,yEAAmE;AACnE,uEAAiE;AACjE,iEAA2D;AAE9C,QAAA,KAAK,GAAiB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/dashboard/index.ts"],"names":[],"mappings":";;;AAAA,yEAAmE;AACnE,uEAAiE;AACjE,iEAA2D;AAE9C,QAAA,KAAK,GAAiB;;;;;;;;CAQlC,CAAA;AACY,QAAA,KAAK,GAAG,CAAC,iDAAsB,EAAE,+CAAqB,EAAE,yCAAkB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-wms",
|
|
3
|
-
"version": "4.3.80-alpha.
|
|
3
|
+
"version": "4.3.80-alpha.5",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -63,60 +63,60 @@
|
|
|
63
63
|
"@operato/scene-tab": "^0.1.8",
|
|
64
64
|
"@operato/scene-table": "^0.1.8",
|
|
65
65
|
"@operato/scene-wheel-sorter": "^0.1.8",
|
|
66
|
-
"@things-factory/apptool-ui": "^4.3.
|
|
67
|
-
"@things-factory/attachment-ui": "^4.3.
|
|
68
|
-
"@things-factory/auth-ui": "^4.3.
|
|
69
|
-
"@things-factory/barcode-ui": "^4.3.
|
|
70
|
-
"@things-factory/biz-ui": "^4.3.
|
|
71
|
-
"@things-factory/board-service": "^4.3.
|
|
72
|
-
"@things-factory/board-ui": "^4.3.
|
|
73
|
-
"@things-factory/code-ui": "^4.3.
|
|
74
|
-
"@things-factory/context-ui": "^4.3.
|
|
75
|
-
"@things-factory/export-ui": "^4.3.
|
|
76
|
-
"@things-factory/export-ui-csv": "^4.3.
|
|
77
|
-
"@things-factory/export-ui-excel": "^4.3.
|
|
78
|
-
"@things-factory/fav-base": "^4.3.
|
|
79
|
-
"@things-factory/form-ui": "^4.3.
|
|
80
|
-
"@things-factory/geography": "^4.3.
|
|
81
|
-
"@things-factory/grist-ui": "^4.3.
|
|
82
|
-
"@things-factory/help": "^4.3.
|
|
83
|
-
"@things-factory/i18n-base": "^4.3.
|
|
84
|
-
"@things-factory/id-rule-base": "^4.3.
|
|
85
|
-
"@things-factory/import-ui": "^4.3.
|
|
86
|
-
"@things-factory/import-ui-excel": "^4.3.
|
|
87
|
-
"@things-factory/menu-ui": "^4.3.
|
|
88
|
-
"@things-factory/more-ui": "^4.3.
|
|
89
|
-
"@things-factory/notification": "^4.3.
|
|
90
|
-
"@things-factory/pdf": "^4.3.
|
|
91
|
-
"@things-factory/print-proxy-service": "^4.3.
|
|
92
|
-
"@things-factory/print-ui": "^4.3.
|
|
93
|
-
"@things-factory/product-base": "^4.3.80-alpha.
|
|
94
|
-
"@things-factory/resource-ui": "^4.3.
|
|
95
|
-
"@things-factory/sales-ui": "^4.3.80-alpha.
|
|
96
|
-
"@things-factory/scene-data-transform": "^4.3.
|
|
97
|
-
"@things-factory/scene-excel": "^4.3.
|
|
98
|
-
"@things-factory/scene-firebase": "^4.3.
|
|
99
|
-
"@things-factory/scene-form": "^4.3.
|
|
100
|
-
"@things-factory/scene-google-map": "^4.3.
|
|
101
|
-
"@things-factory/scene-graphql": "^4.3.
|
|
102
|
-
"@things-factory/scene-label": "^4.3.
|
|
103
|
-
"@things-factory/scene-marker": "^4.3.
|
|
104
|
-
"@things-factory/scene-mqtt": "^4.3.
|
|
105
|
-
"@things-factory/scene-restful": "^4.3.
|
|
106
|
-
"@things-factory/scene-visualizer": "^4.3.
|
|
107
|
-
"@things-factory/setting-ui": "^4.3.
|
|
108
|
-
"@things-factory/system-ui": "^4.3.
|
|
109
|
-
"@things-factory/transport-base": "^4.3.
|
|
110
|
-
"@things-factory/tutorial-ui": "^4.3.
|
|
111
|
-
"@things-factory/warehouse-base": "^4.3.80-alpha.
|
|
112
|
-
"@things-factory/worksheet-base": "^4.3.80-alpha.
|
|
66
|
+
"@things-factory/apptool-ui": "^4.3.80-alpha.5",
|
|
67
|
+
"@things-factory/attachment-ui": "^4.3.80-alpha.5",
|
|
68
|
+
"@things-factory/auth-ui": "^4.3.80-alpha.5",
|
|
69
|
+
"@things-factory/barcode-ui": "^4.3.80-alpha.5",
|
|
70
|
+
"@things-factory/biz-ui": "^4.3.80-alpha.5",
|
|
71
|
+
"@things-factory/board-service": "^4.3.80-alpha.5",
|
|
72
|
+
"@things-factory/board-ui": "^4.3.80-alpha.5",
|
|
73
|
+
"@things-factory/code-ui": "^4.3.80-alpha.5",
|
|
74
|
+
"@things-factory/context-ui": "^4.3.80-alpha.5",
|
|
75
|
+
"@things-factory/export-ui": "^4.3.80-alpha.5",
|
|
76
|
+
"@things-factory/export-ui-csv": "^4.3.80-alpha.5",
|
|
77
|
+
"@things-factory/export-ui-excel": "^4.3.80-alpha.5",
|
|
78
|
+
"@things-factory/fav-base": "^4.3.80-alpha.5",
|
|
79
|
+
"@things-factory/form-ui": "^4.3.80-alpha.5",
|
|
80
|
+
"@things-factory/geography": "^4.3.80-alpha.5",
|
|
81
|
+
"@things-factory/grist-ui": "^4.3.80-alpha.5",
|
|
82
|
+
"@things-factory/help": "^4.3.80-alpha.5",
|
|
83
|
+
"@things-factory/i18n-base": "^4.3.80-alpha.5",
|
|
84
|
+
"@things-factory/id-rule-base": "^4.3.80-alpha.5",
|
|
85
|
+
"@things-factory/import-ui": "^4.3.80-alpha.5",
|
|
86
|
+
"@things-factory/import-ui-excel": "^4.3.80-alpha.5",
|
|
87
|
+
"@things-factory/menu-ui": "^4.3.80-alpha.5",
|
|
88
|
+
"@things-factory/more-ui": "^4.3.80-alpha.5",
|
|
89
|
+
"@things-factory/notification": "^4.3.80-alpha.5",
|
|
90
|
+
"@things-factory/pdf": "^4.3.80-alpha.5",
|
|
91
|
+
"@things-factory/print-proxy-service": "^4.3.80-alpha.5",
|
|
92
|
+
"@things-factory/print-ui": "^4.3.80-alpha.5",
|
|
93
|
+
"@things-factory/product-base": "^4.3.80-alpha.5",
|
|
94
|
+
"@things-factory/resource-ui": "^4.3.80-alpha.5",
|
|
95
|
+
"@things-factory/sales-ui": "^4.3.80-alpha.5",
|
|
96
|
+
"@things-factory/scene-data-transform": "^4.3.80-alpha.5",
|
|
97
|
+
"@things-factory/scene-excel": "^4.3.80-alpha.5",
|
|
98
|
+
"@things-factory/scene-firebase": "^4.3.80-alpha.5",
|
|
99
|
+
"@things-factory/scene-form": "^4.3.80-alpha.5",
|
|
100
|
+
"@things-factory/scene-google-map": "^4.3.80-alpha.5",
|
|
101
|
+
"@things-factory/scene-graphql": "^4.3.80-alpha.5",
|
|
102
|
+
"@things-factory/scene-label": "^4.3.80-alpha.5",
|
|
103
|
+
"@things-factory/scene-marker": "^4.3.80-alpha.5",
|
|
104
|
+
"@things-factory/scene-mqtt": "^4.3.80-alpha.5",
|
|
105
|
+
"@things-factory/scene-restful": "^4.3.80-alpha.5",
|
|
106
|
+
"@things-factory/scene-visualizer": "^4.3.80-alpha.5",
|
|
107
|
+
"@things-factory/setting-ui": "^4.3.80-alpha.5",
|
|
108
|
+
"@things-factory/system-ui": "^4.3.80-alpha.5",
|
|
109
|
+
"@things-factory/transport-base": "^4.3.80-alpha.5",
|
|
110
|
+
"@things-factory/tutorial-ui": "^4.3.80-alpha.5",
|
|
111
|
+
"@things-factory/warehouse-base": "^4.3.80-alpha.5",
|
|
112
|
+
"@things-factory/worksheet-base": "^4.3.80-alpha.5"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
|
-
"@things-factory/builder": "^4.3.
|
|
115
|
+
"@things-factory/builder": "^4.3.80-alpha.5",
|
|
116
116
|
"cypress": "^9.4.1",
|
|
117
117
|
"cypress-file-upload": "^5.0.8",
|
|
118
118
|
"cypress-localstorage-commands": "^1.6.1",
|
|
119
119
|
"eslint-plugin-cypress": "^2.12.1"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "62777e60c67b5a4628391261badd6b6f2ee0a7af"
|
|
122
122
|
}
|
|
@@ -8,18 +8,28 @@ import { buildQuery, Domain, ListParam } from '@things-factory/shell'
|
|
|
8
8
|
export const arrivalNoticesByStatusResolver = {
|
|
9
9
|
async arrivalNoticesByStatus(_: any, params: ListParam, context: any) {
|
|
10
10
|
const { domain, user }: { domain: Domain; user: User } = context.state
|
|
11
|
+
const bizplaceId: string = params.filters.find((filter: any) => filter.name === 'bizplace')?.value || 'ALL'
|
|
12
|
+
params.filters = params.filters.filter(filter => filter.name !== 'bizplace')
|
|
13
|
+
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i)
|
|
14
|
+
let bizplaceIds: string
|
|
11
15
|
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
if (bizplaceId && (bizplaceId == 'ALL' || bizplaceId.match(v4))) {
|
|
17
|
+
let bizplaces: string[] =
|
|
18
|
+
bizplaceId && bizplaceId != 'ALL' ? [bizplaceId] : await getPermittedBizplaceIds(domain, user)
|
|
19
|
+
bizplaceIds = bizplaces
|
|
20
|
+
.map(bizplace => {
|
|
21
|
+
return "'" + bizplace?.trim() + "'"
|
|
22
|
+
})
|
|
23
|
+
.join(',')
|
|
24
|
+
} else throw new Error('invalid bizplaceId')
|
|
20
25
|
|
|
21
26
|
const qb: SelectQueryBuilder<ArrivalNotice> = getRepository(ArrivalNotice).createQueryBuilder('an')
|
|
22
27
|
buildQuery(qb, params, context)
|
|
23
|
-
return qb
|
|
28
|
+
return qb
|
|
29
|
+
.select('an.status', 'status')
|
|
30
|
+
.addSelect('COUNT(*) AS count')
|
|
31
|
+
.andWhere(`an.bizplace_id IN (${bizplaceIds})`)
|
|
32
|
+
.groupBy('an.status')
|
|
33
|
+
.getRawMany()
|
|
24
34
|
}
|
|
25
35
|
}
|
|
@@ -4,6 +4,7 @@ import { deliveryOrdersByStatusResolver } from './delivery-orders-by-status'
|
|
|
4
4
|
import { inventoryExpiryMonitorResolver } from './inventory-expiry-monitor'
|
|
5
5
|
import { outboundOrderByStatusResolver } from './outbound-order-by-status'
|
|
6
6
|
import { releaseGoodsByStatusResolver } from './release-goods-by-status'
|
|
7
|
+
import { unitInboundedOutboundedResolver } from './unit-inbounded-outbounded'
|
|
7
8
|
|
|
8
9
|
export const Query = {
|
|
9
10
|
...arrivalNoticesByStatusResolver,
|
|
@@ -11,5 +12,6 @@ export const Query = {
|
|
|
11
12
|
...deliveryOrdersByStatusResolver,
|
|
12
13
|
...releaseGoodsByStatusResolver,
|
|
13
14
|
...outboundOrderByStatusResolver,
|
|
14
|
-
...inventoryExpiryMonitorResolver
|
|
15
|
+
...inventoryExpiryMonitorResolver,
|
|
16
|
+
...unitInboundedOutboundedResolver
|
|
15
17
|
}
|
|
@@ -8,18 +8,28 @@ import { buildQuery, Domain, ListParam } from '@things-factory/shell'
|
|
|
8
8
|
export const releaseGoodsByStatusResolver = {
|
|
9
9
|
async releaseGoodsByStatus(_: any, params: ListParam, context: any) {
|
|
10
10
|
const { domain, user }: { domain: Domain; user: User } = context.state
|
|
11
|
+
const bizplaceId: string = params.filters.find((filter: any) => filter.name === 'bizplace')?.value || 'ALL'
|
|
12
|
+
params.filters = params.filters.filter(filter => filter.name !== 'bizplace')
|
|
13
|
+
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i)
|
|
14
|
+
let bizplaceIds: string
|
|
11
15
|
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
if (bizplaceId && (bizplaceId == 'ALL' || bizplaceId.match(v4))) {
|
|
17
|
+
let bizplaces: string[] =
|
|
18
|
+
bizplaceId && bizplaceId != 'ALL' ? [bizplaceId] : await getPermittedBizplaceIds(domain, user)
|
|
19
|
+
bizplaceIds = bizplaces
|
|
20
|
+
.map(bizplace => {
|
|
21
|
+
return "'" + bizplace?.trim() + "'"
|
|
22
|
+
})
|
|
23
|
+
.join(',')
|
|
24
|
+
} else throw new Error('invalid bizplaceId')
|
|
20
25
|
|
|
21
26
|
const qb: SelectQueryBuilder<ReleaseGood> = getRepository(ReleaseGood).createQueryBuilder('rg')
|
|
22
27
|
buildQuery(qb, params, context)
|
|
23
|
-
return qb
|
|
28
|
+
return qb
|
|
29
|
+
.select('rg.status', 'status')
|
|
30
|
+
.addSelect('COUNT(*) AS count')
|
|
31
|
+
.andWhere(`rg.bizplace_id IN (${bizplaceIds})`)
|
|
32
|
+
.groupBy('rg.status')
|
|
33
|
+
.getRawMany()
|
|
24
34
|
}
|
|
25
35
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { getRepository, SelectQueryBuilder, EntityManager } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
import { User } from '@things-factory/auth-base'
|
|
4
|
+
import { getPermittedBizplaceIds } from '@things-factory/biz-base'
|
|
5
|
+
import { buildQuery, Domain, ListParam } from '@things-factory/shell'
|
|
6
|
+
|
|
7
|
+
export const unitInboundedOutboundedResolver = {
|
|
8
|
+
async unitInboundedOutbounded(_: any, params: ListParam, context: any) {
|
|
9
|
+
const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state
|
|
10
|
+
const bizplaceId: string = params.filters.find((filter: any) => filter.name === 'bizplace')?.value || 'ALL'
|
|
11
|
+
const fromDate: string = params.filters.find((filter: any) => filter.name === 'createdAt1')?.value
|
|
12
|
+
const toDate: string = params.filters.find((filter: any) => filter.name === 'createdAt2')?.value
|
|
13
|
+
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i)
|
|
14
|
+
let bizplaceIds: string
|
|
15
|
+
|
|
16
|
+
if (bizplaceId && (bizplaceId == 'ALL' || bizplaceId.match(v4))) {
|
|
17
|
+
let bizplaces: string[] =
|
|
18
|
+
bizplaceId && bizplaceId != 'ALL' ? [bizplaceId] : await getPermittedBizplaceIds(domain, user)
|
|
19
|
+
bizplaceIds = bizplaces
|
|
20
|
+
.map(bizplace => {
|
|
21
|
+
return "'" + bizplace?.trim() + "'"
|
|
22
|
+
})
|
|
23
|
+
.join(',')
|
|
24
|
+
} else throw new Error('invalid bizplaceId')
|
|
25
|
+
|
|
26
|
+
const orderStatus: { status: string; count: number }[] = await tx.query(
|
|
27
|
+
`
|
|
28
|
+
WITH cte_unit ("status", "count", "type") AS (
|
|
29
|
+
SELECT 'INBOUNDED' AS status, 0 AS "count", 'inbound' AS "type"
|
|
30
|
+
UNION
|
|
31
|
+
SELECT 'OUTBOUNDED' AS status, 0 AS "count", 'outbound' AS "type"
|
|
32
|
+
) SELECT u."status", coalesce(src."count", u."count") AS "count", u."type"
|
|
33
|
+
FROM cte_unit u
|
|
34
|
+
LEFT JOIN (
|
|
35
|
+
SELECT "status", SUM("count") AS count, "type" FROM (
|
|
36
|
+
SELECT 'INBOUNDED' AS "status", SUM(coalesce(op.actual_pack_qty, op.pack_qty)) as "count", 'inbound' as "type" FROM order_products op
|
|
37
|
+
INNER JOIN arrival_notices an ON an.id = op.arrival_notice_id
|
|
38
|
+
WHERE an."status" in ('PUTTING_AWAY','DONE')
|
|
39
|
+
AND an."domain_id" = $1
|
|
40
|
+
AND an."bizplace_id" IN (${bizplaceIds})
|
|
41
|
+
AND an.created_at BETWEEN '${fromDate}' AND '${toDate}'
|
|
42
|
+
GROUP BY an."status"
|
|
43
|
+
UNION ALL
|
|
44
|
+
SELECT 'OUTBOUNDED' AS "status", SUM(coalesce(oi.release_qty , oi.picked_qty)) as "count", 'outbound' as "type" FROM order_inventories oi
|
|
45
|
+
INNER JOIN release_goods rg on rg.id = oi.release_good_id
|
|
46
|
+
WHERE rg."status" in ('DONE')
|
|
47
|
+
AND rg."domain_id" = $1
|
|
48
|
+
AND rg."bizplace_id" IN (${bizplaceIds})
|
|
49
|
+
AND rg.created_at BETWEEN '${fromDate}' AND '${toDate}'
|
|
50
|
+
GROUP BY rg."status"
|
|
51
|
+
) AS src
|
|
52
|
+
GROUP BY "status", "type"
|
|
53
|
+
) src ON src."status" = u."status"
|
|
54
|
+
order by "type", "status"
|
|
55
|
+
`,
|
|
56
|
+
[domain.id]
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
return orderStatus
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -9,5 +9,6 @@ export const Query = /* GraphQL */ `
|
|
|
9
9
|
releaseGoodsByStatus(filters: [Filter]): [OrderStatusCounter] @transaction
|
|
10
10
|
outboundOrderByStatus(filters: [Filter]): [OrderStatusCounter] @transaction
|
|
11
11
|
inventoryExpiryMonitor(filters: [Filter]): InventoryExpiryStatus @transaction
|
|
12
|
+
unitInboundedOutbounded(filters: [Filter]): [OrderStatusCounter] @transaction
|
|
12
13
|
`
|
|
13
14
|
export const Types = [InventoryExpiryCounter, InventoryExpiryStatus, OrderStatusCounter]
|
package/translations/en.json
CHANGED
|
@@ -214,6 +214,7 @@
|
|
|
214
214
|
"field.comment": "comment",
|
|
215
215
|
"field.company": "company",
|
|
216
216
|
"field.completed": "completed",
|
|
217
|
+
"field.contact": "contact",
|
|
217
218
|
"field.contact_name": "contact name",
|
|
218
219
|
"field.contact_point": "contact point",
|
|
219
220
|
"field.contact_type": "contact type",
|
|
@@ -459,6 +460,8 @@
|
|
|
459
460
|
"field.recall": "recall",
|
|
460
461
|
"field.receipt_reference_no": "receipt reference no",
|
|
461
462
|
"field.receive_date": "receive date",
|
|
463
|
+
"field.receiver_company": "receiver company",
|
|
464
|
+
"field.receiver_name": "receiver name",
|
|
462
465
|
"field.recipient_bizplace": "recipient bizplace",
|
|
463
466
|
"field.ref_code": "ref code",
|
|
464
467
|
"field.ref_no_2": "ref no. 2",
|