@things-factory/sales-base 4.3.62 → 4.3.67

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.
Files changed (25) hide show
  1. package/dist-server/controllers/order-controller.js +7 -5
  2. package/dist-server/controllers/order-controller.js.map +1 -1
  3. package/dist-server/service/arrival-notice/arrival-notice-mutation.js +35 -21
  4. package/dist-server/service/arrival-notice/arrival-notice-mutation.js.map +1 -1
  5. package/dist-server/service/delivery-order/delivery-order-query.js +3 -0
  6. package/dist-server/service/delivery-order/delivery-order-query.js.map +1 -1
  7. package/dist-server/service/order-inventory/order-inventory.js +7 -3
  8. package/dist-server/service/order-inventory/order-inventory.js.map +1 -1
  9. package/dist-server/service/order-tote/order-tote.js +2 -1
  10. package/dist-server/service/order-tote/order-tote.js.map +1 -1
  11. package/dist-server/service/release-good/release-good-mutation.js +28 -17
  12. package/dist-server/service/release-good/release-good-mutation.js.map +1 -1
  13. package/dist-server/service/return-order/return-order-mutation.js +28 -17
  14. package/dist-server/service/return-order/return-order-mutation.js.map +1 -1
  15. package/dist-server/service/vas-order/vas-order-mutation.js +14 -9
  16. package/dist-server/service/vas-order/vas-order-mutation.js.map +1 -1
  17. package/package.json +13 -13
  18. package/server/controllers/order-controller.ts +7 -4
  19. package/server/service/arrival-notice/arrival-notice-mutation.ts +42 -20
  20. package/server/service/delivery-order/delivery-order-query.ts +19 -18
  21. package/server/service/order-inventory/order-inventory.ts +7 -3
  22. package/server/service/order-tote/order-tote.ts +13 -2
  23. package/server/service/release-good/release-good-mutation.ts +38 -21
  24. package/server/service/return-order/return-order-mutation.ts +32 -17
  25. package/server/service/vas-order/vas-order-mutation.ts +17 -8
@@ -181,10 +181,14 @@ export class ArrivalNoticeMutation {
181
181
  url: context.header.referer,
182
182
  data: { url: context.header.referer }
183
183
  }
184
- await sendNotification({
185
- receivers,
186
- message: { ...msg }
187
- })
184
+ /**
185
+ * @notes Temporary off sendNotification due to suspect of causing wms down
186
+ */
187
+
188
+ // await sendNotification({
189
+ // receivers,
190
+ // message: { ...msg }
191
+ // })
188
192
  }
189
193
 
190
194
  return true
@@ -668,10 +672,14 @@ export async function confirmArrivalNoticeFunction(
668
672
  data: { url: context.header.referer }
669
673
  }
670
674
 
671
- await sendNotification({
672
- receivers,
673
- message: { ...msg }
674
- })
675
+ /**
676
+ * @notes Temporary off sendNotification due to suspect of causing wms down
677
+ */
678
+
679
+ // await sendNotification({
680
+ // receivers,
681
+ // message: { ...msg }
682
+ // })
675
683
  }
676
684
  }
677
685
 
@@ -767,10 +775,15 @@ export async function receiveArrivalNoticeFunction(_: any, name: String, context
767
775
  url: context.header.referer,
768
776
  data: { url: context.header.referer }
769
777
  }
770
- await sendNotification({
771
- receivers,
772
- message: { ...msg }
773
- })
778
+
779
+ /**
780
+ * @notes Temporary off sendNotification due to suspect of causing wms down
781
+ */
782
+
783
+ // await sendNotification({
784
+ // receivers,
785
+ // message: { ...msg }
786
+ // })
774
787
  }
775
788
 
776
789
  // 4. Update status of arrival notice (PENDING_RECEIVE => INTRANSIT)
@@ -857,10 +870,15 @@ export async function checkArrivedNoticeFunction(
857
870
  url: context.header.referer,
858
871
  data: { url: context.header.referer }
859
872
  }
860
- await sendNotification({
861
- receivers,
862
- message: { ...msg }
863
- })
873
+
874
+ /**
875
+ * @notes Temporary off sendNotification due to suspect of causing wms down
876
+ */
877
+
878
+ // await sendNotification({
879
+ // receivers,
880
+ // message: { ...msg }
881
+ // })
864
882
  }
865
883
 
866
884
  return foundArrivalNotice
@@ -935,10 +953,14 @@ export async function rejectArrivalNotice(
935
953
  data: { url: context.header.referer }
936
954
  }
937
955
 
938
- await sendNotification({
939
- receivers,
940
- message: { ...msg }
941
- })
956
+ /**
957
+ * @notes Temporary off sendNotification due to suspect of causing wms down
958
+ */
959
+
960
+ // await sendNotification({
961
+ // receivers,
962
+ // message: { ...msg }
963
+ // })
942
964
  }
943
965
 
944
966
  return foundArrivalNotice
@@ -143,8 +143,8 @@ export class DeliveryOrderQuery {
143
143
  [arrChildSortData.indexOf(sort.name) >= 0
144
144
  ? 'releaseGood.' + sort.name
145
145
  : arrNameSortData.indexOf(sort.name) >= 0
146
- ? sort.name + '.name'
147
- : 'do.' + sort.name]: sort.desc ? 'DESC' : 'ASC'
146
+ ? sort.name + '.name'
147
+ : 'do.' + sort.name]: sort.desc ? 'DESC' : 'ASC'
148
148
  }),
149
149
  params.sortings.length < 1 ? { rank: 'ASC', 'do.createdAt': 'DESC' } : {}
150
150
  )
@@ -155,13 +155,15 @@ export class DeliveryOrderQuery {
155
155
 
156
156
  console.time('orderProductsApiFilter')
157
157
  if (orderProductsApiFilter?.value) {
158
-
159
158
  items = await Promise.all(
160
159
  items.map(async itm => {
161
160
  const qb: any = getRepository(OrderInventory).createQueryBuilder('OrderInventory')
162
161
 
163
162
  let orderInventories: any[] = await qb
164
163
  .leftJoinAndSelect('OrderInventory.product', 'Product')
164
+ .leftJoinAndSelect('OrderInventory.orderToteItems', 'OrderToteItems')
165
+ .leftJoinAndSelect('OrderToteItems.orderTote', 'OrderTote')
166
+ .leftJoinAndSelect('OrderTote.orderToteSeals', 'OrderToteSeals')
165
167
  .where('OrderInventory.delivery_order_id = :deliveryOrderId', { deliveryOrderId: itm.id })
166
168
  .andWhere('OrderInventory.domain_id = :domainId', { domainId: domain.id })
167
169
  .getMany()
@@ -172,7 +174,6 @@ export class DeliveryOrderQuery {
172
174
  }
173
175
  })
174
176
  )
175
-
176
177
  }
177
178
 
178
179
  return { items, total }
@@ -322,12 +323,12 @@ export class DeliveryOrderQuery {
322
323
  systemRemark: prod?.remark
323
324
  ? prod.remark
324
325
  : prod.crossDocking
325
- ? prod.pallet === ''
326
- ? `${prod.palletQty} PALLET(S) [C/D]`
327
- : `${prod.palletQty} PALLET(S) (${prod.pallet}) [C/D]`
328
- : prod.pallet === ''
329
- ? `${prod.palletQty} PALLET(S)`
330
- : `${prod.palletQty} PALLET(S) (${prod.pallet})`
326
+ ? prod.pallet === ''
327
+ ? `${prod.palletQty} PALLET(S) [C/D]`
328
+ : `${prod.palletQty} PALLET(S) (${prod.pallet}) [C/D]`
329
+ : prod.pallet === ''
330
+ ? `${prod.palletQty} PALLET(S)`
331
+ : `${prod.palletQty} PALLET(S) (${prod.pallet})`
331
332
  }
332
333
  })
333
334
 
@@ -414,12 +415,12 @@ export class DeliveryOrderQuery {
414
415
  systemRemark: prod?.remark
415
416
  ? prod.remark
416
417
  : prod.crossDocking
417
- ? prod.pallet === ''
418
- ? `${prod.palletQty} PALLET(S) [C/D]`
419
- : `${prod.palletQty} PALLET(S) (${prod.pallet}) [C/D]`
420
- : prod.pallet === ''
421
- ? `${prod.palletQty} PALLET(S)`
422
- : `${prod.palletQty} PALLET(S) (${prod.pallet})`
418
+ ? prod.pallet === ''
419
+ ? `${prod.palletQty} PALLET(S) [C/D]`
420
+ : `${prod.palletQty} PALLET(S) (${prod.pallet}) [C/D]`
421
+ : prod.pallet === ''
422
+ ? `${prod.palletQty} PALLET(S)`
423
+ : `${prod.palletQty} PALLET(S) (${prod.pallet})`
423
424
  }
424
425
  })
425
426
 
@@ -547,8 +548,8 @@ export class DeliveryOrderQuery {
547
548
  [arrChildSortData.indexOf(sort.name) >= 0
548
549
  ? 'releaseGood.' + sort.name
549
550
  : arrNameSortData.indexOf(sort.name) >= 0
550
- ? sort.name + '.name'
551
- : 'do.' + sort.name]: sort.desc ? 'DESC' : 'ASC'
551
+ ? sort.name + '.name'
552
+ : 'do.' + sort.name]: sort.desc ? 'DESC' : 'ASC'
552
553
  }),
553
554
  params.sortings.length < 1 ? { rank: 'ASC', 'do.createdAt': 'DESC' } : {}
554
555
  )
@@ -5,6 +5,7 @@ import {
5
5
  Entity,
6
6
  Index,
7
7
  ManyToOne,
8
+ OneToMany,
8
9
  PrimaryGeneratedColumn,
9
10
  RelationId,
10
11
  UpdateDateColumn
@@ -20,6 +21,7 @@ import { ArrivalNotice } from '../arrival-notice/arrival-notice'
20
21
  import { DeliveryOrder } from '../delivery-order/delivery-order'
21
22
  import { InventoryCheck } from '../inventory-check/inventory-check'
22
23
  import { OrderProduct } from '../order-product/order-product'
24
+ import { OrderToteItem } from '../order-tote-item/order-tote-item'
23
25
  import { ReleaseGood } from '../release-good/release-good'
24
26
  import { ReturnOrder } from '../return-order/return-order'
25
27
  import { TransferOrder } from '../transfer-order/transfer-order'
@@ -62,9 +64,7 @@ import { TransferOrder } from '../transfer-order/transfer-order'
62
64
  orderInventory.releaseQty,
63
65
  orderInventory.uom
64
66
  ])
65
- @Index('ix_order-inventory_5', (orderInventory: OrderInventory) => [
66
- orderInventory.releaseGood
67
- ])
67
+ @Index('ix_order-inventory_5', (orderInventory: OrderInventory) => [orderInventory.releaseGood])
68
68
  @ObjectType()
69
69
  export class OrderInventory {
70
70
  @PrimaryGeneratedColumn('uuid')
@@ -185,6 +185,10 @@ export class OrderInventory {
185
185
  @RelationId((orderInventory: OrderInventory) => orderInventory.orderProduct)
186
186
  orderProductId: string
187
187
 
188
+ @OneToMany(type => OrderToteItem, orderToteItem => orderToteItem.orderInventory, { nullable: true })
189
+ @Field(type => [OrderToteItem], { nullable: true })
190
+ orderToteItems: OrderToteItem[]
191
+
188
192
  @Column({ type: 'uuid', nullable: true })
189
193
  @Field({ nullable: true })
190
194
  refWorksheetId: string
@@ -1,11 +1,21 @@
1
1
  import { Field, ObjectType } from 'type-graphql'
2
- import { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
2
+ import {
3
+ Column,
4
+ Entity,
5
+ Index,
6
+ ManyToOne,
7
+ OneToMany,
8
+ PrimaryGeneratedColumn,
9
+ RelationId,
10
+ UpdateDateColumn
11
+ } from 'typeorm'
3
12
 
4
13
  import { User } from '@things-factory/auth-base'
5
14
  import { Domain } from '@things-factory/shell'
6
15
  import { Tote } from '@things-factory/warehouse-base'
7
- import { ReleaseGood } from '../release-good/release-good'
16
+
8
17
  import { OrderToteSeal } from '../order-tote-seal/order-tote-seal'
18
+ import { ReleaseGood } from '../release-good/release-good'
9
19
 
10
20
  @Entity()
11
21
  @Index('ix_order_tote_0', (orderTote: OrderTote) => [orderTote.id], { unique: true })
@@ -57,6 +67,7 @@ export class OrderTote {
57
67
  @RelationId((orderTote: OrderTote) => orderTote.updater)
58
68
  updaterId: string
59
69
 
70
+ @OneToMany(type => OrderToteSeal, orderToteSeal => orderToteSeal.orderTote, { nullable: true })
60
71
  @Field(type => [OrderToteSeal], { nullable: true })
61
72
  orderToteSeals?: OrderToteSeal[]
62
73
  }
@@ -136,7 +136,7 @@ export class ReleaseGoodMutation {
136
136
  context,
137
137
  tx
138
138
  )
139
- } catch (error) { }
139
+ } catch (error) {}
140
140
 
141
141
  if (errorsCaught.length)
142
142
  throw new ValidationError({
@@ -624,8 +624,8 @@ export async function generateReleaseGoodFunction(
624
624
  orderMethod: releaseGood?.orderMethod
625
625
  ? releaseGood.orderMethod
626
626
  : releaseGood.orderInventories[0]?.inventory?.id
627
- ? ORDER_METHOD.SELECT_BY_PALLET
628
- : ORDER_METHOD.SELECT_BY_PRODUCT,
627
+ ? ORDER_METHOD.SELECT_BY_PALLET
628
+ : ORDER_METHOD.SELECT_BY_PRODUCT,
629
629
  status: ORDER_STATUS.PENDING,
630
630
  packageId: releaseGood?.packageId,
631
631
  storeName: releaseGood?.storeName,
@@ -1026,10 +1026,15 @@ export async function confirmReleaseGood(name: string, context: any, tx?: Entity
1026
1026
  url: context.header.referer,
1027
1027
  data: { url: context.header.referer }
1028
1028
  }
1029
- await sendNotification({
1030
- receivers,
1031
- message: { ...msg }
1032
- })
1029
+
1030
+ /**
1031
+ * @notes Temporary off sendNotification due to suspect of causing wms down
1032
+ */
1033
+
1034
+ // await sendNotification({
1035
+ // receivers,
1036
+ // message: { ...msg }
1037
+ // })
1033
1038
  }
1034
1039
  }
1035
1040
 
@@ -1109,10 +1114,14 @@ export async function receiveReleaseGood(name: string, context: any, tx: EntityM
1109
1114
  data: { url: context.header.referer }
1110
1115
  }
1111
1116
 
1112
- await sendNotification({
1113
- receivers,
1114
- message: { ...msg }
1115
- })
1117
+ /**
1118
+ * @notes Temporary off sendNotification due to suspect of causing wms down
1119
+ */
1120
+
1121
+ // await sendNotification({
1122
+ // receivers,
1123
+ // message: { ...msg }
1124
+ // })
1116
1125
  }
1117
1126
  }
1118
1127
 
@@ -1232,10 +1241,14 @@ export async function rejectReleaseGood(
1232
1241
  data: { url: context.header.referer }
1233
1242
  }
1234
1243
 
1235
- await sendNotification({
1236
- receivers,
1237
- message: { ...msg }
1238
- })
1244
+ /**
1245
+ * @notes Temporary off sendNotification due to suspect of causing wms down
1246
+ */
1247
+
1248
+ // await sendNotification({
1249
+ // receivers,
1250
+ // message: { ...msg }
1251
+ // })
1239
1252
  }
1240
1253
 
1241
1254
  return releaseGood
@@ -1247,7 +1260,7 @@ export async function bulkGenerateReleaseGood(
1247
1260
  roNoSetting: any,
1248
1261
  domain: Domain,
1249
1262
  user: User,
1250
- tx?: EntityManager,
1263
+ tx?: EntityManager
1251
1264
  ): Promise<ReleaseGood> {
1252
1265
  try {
1253
1266
  let warehouseDomain: Domain = domain
@@ -1288,7 +1301,6 @@ export async function bulkGenerateReleaseGood(
1288
1301
 
1289
1302
  newReleaseGood = await tx.getRepository(ReleaseGood).save(newReleaseGood)
1290
1303
 
1291
-
1292
1304
  /** Generate Shipping Order */
1293
1305
  if (shippingOrder) {
1294
1306
  shippingOrder.remark = shippingOrder.exportRemark
@@ -1466,10 +1478,15 @@ export async function bulkConfirmReleaseGoods(
1466
1478
  url: context.header.referer,
1467
1479
  data: { url: context.header.referer }
1468
1480
  }
1469
- await sendNotification({
1470
- receivers,
1471
- message
1472
- })
1481
+
1482
+ /**
1483
+ * @notes Temporary off sendNotification due to suspect of causing wms down
1484
+ */
1485
+
1486
+ // await sendNotification({
1487
+ // receivers,
1488
+ // message
1489
+ // })
1473
1490
  }
1474
1491
  }
1475
1492
 
@@ -284,11 +284,14 @@ export async function confirmReturnOrder(tx: EntityManager, name: string, contex
284
284
  url: context.header.referer,
285
285
  data: { url: context.header.referer }
286
286
  }
287
-
288
- await sendNotification({
289
- receivers,
290
- message: { ...msg }
291
- })
287
+ /**
288
+ * @notes Temporary off sendNotification due to suspect of causing wms down
289
+ */
290
+
291
+ // await sendNotification({
292
+ // receivers,
293
+ // message: { ...msg }
294
+ // })
292
295
  }
293
296
 
294
297
  return returnOrder
@@ -349,10 +352,14 @@ export async function receiveReturnOrder(tx: EntityManager, name: string, contex
349
352
  data: { url: context.header.referer }
350
353
  }
351
354
 
352
- await sendNotification({
353
- receivers,
354
- message: { ...msg }
355
- })
355
+ /**
356
+ * @notes Temporary off sendNotification due to suspect of causing wms down
357
+ */
358
+
359
+ // await sendNotification({
360
+ // receivers,
361
+ // message: { ...msg }
362
+ // })
356
363
  }
357
364
 
358
365
  return returnOrder
@@ -416,10 +423,14 @@ export async function rejectReturnOrder(
416
423
  data: { url: context.header.referer }
417
424
  }
418
425
 
419
- await sendNotification({
420
- receivers,
421
- message: { ...msg }
422
- })
426
+ /**
427
+ * @notes Temporary off sendNotification due to suspect of causing wms down
428
+ */
429
+
430
+ // await sendNotification({
431
+ // receivers,
432
+ // message: { ...msg }
433
+ // })
423
434
  }
424
435
 
425
436
  return foundReturnOrder
@@ -476,10 +487,14 @@ export async function checkReturnOrder(tx: EntityManager, name: string, context:
476
487
  data: { url: context.header.referer }
477
488
  }
478
489
 
479
- await sendNotification({
480
- receivers,
481
- message: { ...msg }
482
- })
490
+ /**
491
+ * @notes Temporary off sendNotification due to suspect of causing wms down
492
+ */
493
+
494
+ // await sendNotification({
495
+ // receivers,
496
+ // message: { ...msg }
497
+ // })
483
498
  }
484
499
 
485
500
  return foundReturnOrder
@@ -164,10 +164,15 @@ export class VasOrderMutation {
164
164
  url: context.header.referer,
165
165
  data: { url: context.header.referer }
166
166
  }
167
- await sendNotification({
168
- receivers,
169
- message: { ...msg }
170
- })
167
+
168
+ /**
169
+ * @notes Temporary off sendNotification due to suspect of causing wms down
170
+ */
171
+
172
+ // await sendNotification({
173
+ // receivers,
174
+ // message: { ...msg }
175
+ // })
171
176
  }
172
177
 
173
178
  return vasOrder
@@ -235,10 +240,14 @@ export class VasOrderMutation {
235
240
  data: { url: context.header.referer }
236
241
  }
237
242
 
238
- await sendNotification({
239
- receivers,
240
- message: { ...msg }
241
- })
243
+ /**
244
+ * @notes Temporary off sendNotification due to suspect of causing wms down
245
+ */
246
+
247
+ // await sendNotification({
248
+ // receivers,
249
+ // message: { ...msg }
250
+ // })
242
251
  }
243
252
 
244
253
  return vasOrder