@things-factory/worksheet-base 4.2.4 → 4.2.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.
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createReturnWorksheet = exports.completeLoading = exports.completeLoadingResolver = void 0;
|
|
4
|
+
const integration_sftp_1 = require("@things-factory/integration-sftp");
|
|
4
5
|
const sales_base_1 = require("@things-factory/sales-base");
|
|
6
|
+
const warehouse_base_1 = require("@things-factory/warehouse-base");
|
|
5
7
|
const constants_1 = require("../../../../constants");
|
|
6
8
|
const controllers_1 = require("../../../../controllers");
|
|
7
|
-
const integration_sftp_1 = require("@things-factory/integration-sftp");
|
|
8
9
|
exports.completeLoadingResolver = {
|
|
9
10
|
async completeLoading(_, { releaseGoodNo }, context) {
|
|
10
11
|
const { tx, domain, user } = context.state;
|
|
@@ -31,12 +32,21 @@ async function completeLoading(tx, domain, user, releaseGoodNo) {
|
|
|
31
32
|
where: { domain: customerDomain }
|
|
32
33
|
});
|
|
33
34
|
if (customerAvailableSftp) {
|
|
34
|
-
let
|
|
35
|
+
let inventoryItems = await tx.getRepository(warehouse_base_1.InventoryItem).find({
|
|
36
|
+
where: { domain, outboundOrderId: releaseGood.id }
|
|
37
|
+
});
|
|
38
|
+
let shipmentResult = await integration_sftp_1.SftpAPI.createShipment(customerAvailableSftp, {
|
|
35
39
|
releaseGood,
|
|
36
40
|
orderInventories: targetInventories,
|
|
37
41
|
sftp: customerAvailableSftp
|
|
38
42
|
});
|
|
39
|
-
customerAvailableSftp = await tx.getRepository(integration_sftp_1.Sftp).save(
|
|
43
|
+
customerAvailableSftp = await tx.getRepository(integration_sftp_1.Sftp).save(shipmentResult);
|
|
44
|
+
let snResult = await integration_sftp_1.SftpAPI.createSerialNumber(customerAvailableSftp, {
|
|
45
|
+
releaseGood,
|
|
46
|
+
inventoryItems,
|
|
47
|
+
sftp: customerAvailableSftp
|
|
48
|
+
});
|
|
49
|
+
customerAvailableSftp = await tx.getRepository(integration_sftp_1.Sftp).save(snResult);
|
|
40
50
|
}
|
|
41
51
|
await worksheetController.completeLoading(releaseGoodNo);
|
|
42
52
|
if (remainInventories.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complete-loading.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/worksheet/loading/complete-loading.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"complete-loading.js","sourceRoot":"","sources":["../../../../../server/graphql/resolvers/worksheet/loading/complete-loading.ts"],"names":[],"mappings":";;;AAGA,uEAAgE;AAChE,2DAA8G;AAE9G,mEAA8D;AAE9D,qDAAsD;AACtD,yDAAkG;AAGrF,QAAA,uBAAuB,GAAG;IACrC,KAAK,CAAC,eAAe,CAAC,CAAM,EAAE,EAAE,aAAa,EAAE,EAAE,OAAY;QAC3D,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAC7F,MAAM,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,CAAA;IACxD,CAAC;CACF,CAAA;AAEM,KAAK,UAAU,eAAe,CACnC,EAAiB,EACjB,MAAc,EACd,IAAU,EACV,aAAqB;IAErB,MAAM,mBAAmB,GAA+B,IAAI,wCAA0B,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IACxG,MAAM,WAAW,GAAgB,MAAM,mBAAmB,CAAC,YAAY,CACrE,wBAAW,EACX;QACE,MAAM;QACN,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,yBAAY,CAAC,OAAO;KAC7B,EACD,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAChC,CAAA;IACD,MAAM,SAAS,GAAc,MAAM,mBAAmB,CAAC,uBAAuB,CAAC,WAAW,EAAE,0BAAc,CAAC,OAAO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AAC,aAAa,CAAC,uBAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;KACpE;IAED,MAAM,mBAAmB,CAAC,eAAe,CAAC,aAAa,CAAC,CAAA;IAExD,IAAI,iBAAiB,CAAC,MAAM,EAAE;QAC5B,MAAM,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAA;KAChF;AACH,CAAC;AAxDD,0CAwDC;AAED,6CAA6C;AACtC,KAAK,UAAU,qBAAqB,CACzC,EAAiB,EACjB,MAAc,EACd,IAAU,EACV,aAAqB,EACrB,gBAAkC;IAElC,MAAM,mBAAmB,GAAiC,IAAI,0CAA4B,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IAC5G,OAAO,MAAM,mBAAmB,CAAC,0BAA0B,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAA;AAC9F,CAAC;AATD,sDASC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/worksheet-base",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.5",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"@things-factory/document-template-base": "^4.1.40",
|
|
30
30
|
"@things-factory/id-rule-base": "^4.2.0",
|
|
31
31
|
"@things-factory/integration-lmd": "^4.1.40",
|
|
32
|
-
"@things-factory/integration-marketplace": "^4.2.
|
|
33
|
-
"@things-factory/integration-sellercraft": "^4.2.
|
|
34
|
-
"@things-factory/integration-sftp": "^4.
|
|
35
|
-
"@things-factory/marketplace-base": "^4.2.
|
|
32
|
+
"@things-factory/integration-marketplace": "^4.2.5",
|
|
33
|
+
"@things-factory/integration-sellercraft": "^4.2.5",
|
|
34
|
+
"@things-factory/integration-sftp": "^4.2.5",
|
|
35
|
+
"@things-factory/marketplace-base": "^4.2.5",
|
|
36
36
|
"@things-factory/notification": "^4.1.40",
|
|
37
|
-
"@things-factory/sales-base": "^4.2.
|
|
37
|
+
"@things-factory/sales-base": "^4.2.5",
|
|
38
38
|
"@things-factory/setting-base": "^4.1.40",
|
|
39
39
|
"@things-factory/shell": "^4.1.40",
|
|
40
40
|
"@things-factory/transport-base": "^4.2.0",
|
|
41
|
-
"@things-factory/warehouse-base": "^4.2.
|
|
41
|
+
"@things-factory/warehouse-base": "^4.2.5"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "e1447c2e0c5c1ad9375e84291f688b7ecdbeee40"
|
|
44
44
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm'
|
|
2
|
+
|
|
1
3
|
import { User } from '@things-factory/auth-base'
|
|
2
|
-
import {
|
|
4
|
+
import { Sftp, SftpAPI } from '@things-factory/integration-sftp'
|
|
5
|
+
import { ORDER_INVENTORY_STATUS, ORDER_STATUS, OrderInventory, ReleaseGood } from '@things-factory/sales-base'
|
|
3
6
|
import { Domain } from '@things-factory/shell'
|
|
4
|
-
import {
|
|
7
|
+
import { InventoryItem } from '@things-factory/warehouse-base'
|
|
8
|
+
|
|
5
9
|
import { WORKSHEET_TYPE } from '../../../../constants'
|
|
6
10
|
import { LoadingWorksheetController, ReturningWorksheetController } from '../../../../controllers'
|
|
7
11
|
import { Worksheet, WorksheetDetail } from '../../../../entities'
|
|
8
|
-
import { Sftp, SftpAPI } from '@things-factory/integration-sftp'
|
|
9
12
|
|
|
10
13
|
export const completeLoadingResolver = {
|
|
11
14
|
async completeLoading(_: any, { releaseGoodNo }, context: any) {
|
|
@@ -46,12 +49,23 @@ export async function completeLoading(
|
|
|
46
49
|
where: { domain: customerDomain }
|
|
47
50
|
})
|
|
48
51
|
if (customerAvailableSftp) {
|
|
49
|
-
let
|
|
52
|
+
let inventoryItems: InventoryItem[] = await tx.getRepository(InventoryItem).find({
|
|
53
|
+
where: { domain, outboundOrderId: releaseGood.id }
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
let shipmentResult: Sftp = await SftpAPI.createShipment(customerAvailableSftp, {
|
|
50
57
|
releaseGood,
|
|
51
58
|
orderInventories: targetInventories,
|
|
52
59
|
sftp: customerAvailableSftp
|
|
53
60
|
})
|
|
54
|
-
customerAvailableSftp = await tx.getRepository(Sftp).save(
|
|
61
|
+
customerAvailableSftp = await tx.getRepository(Sftp).save(shipmentResult)
|
|
62
|
+
|
|
63
|
+
let snResult: Sftp = await SftpAPI.createSerialNumber(customerAvailableSftp, {
|
|
64
|
+
releaseGood,
|
|
65
|
+
inventoryItems,
|
|
66
|
+
sftp: customerAvailableSftp
|
|
67
|
+
})
|
|
68
|
+
customerAvailableSftp = await tx.getRepository(Sftp).save(snResult)
|
|
55
69
|
}
|
|
56
70
|
|
|
57
71
|
await worksheetController.completeLoading(releaseGoodNo)
|