@things-factory/worksheet-base 5.0.0-alpha.22 → 5.0.0-alpha.23
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/dist-server/graphql/resolvers/worksheet/worksheet.js +187 -191
- package/dist-server/graphql/resolvers/worksheet/worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/worksheets.js +250 -255
- package/dist-server/graphql/resolvers/worksheet/worksheets.js.map +1 -1
- package/dist-server/index.js +1 -2
- package/dist-server/index.js.map +1 -1
- package/package.json +17 -17
- package/server/graphql/resolvers/worksheet/worksheet.ts +191 -195
- package/server/graphql/resolvers/worksheet/worksheets.ts +325 -328
- package/server/index.ts +1 -2
package/dist-server/index.js
CHANGED
|
@@ -21,9 +21,8 @@ __exportStar(require("./graphql"), exports);
|
|
|
21
21
|
__exportStar(require("./graphql/resolvers/worksheet/generate-worksheet/generate-release-good-worksheet"), exports);
|
|
22
22
|
__exportStar(require("./graphql/resolvers/worksheet-detail/generate-release-good-worksheet-details"), exports);
|
|
23
23
|
__exportStar(require("./graphql/resolvers/worksheet/generate-worksheet/generate-arrival-notice-worksheet"), exports);
|
|
24
|
+
__exportStar(require("./graphql/resolvers/worksheet-detail/generate-release-good-worksheet-details"), exports);
|
|
24
25
|
__exportStar(require("./graphql/resolvers/worksheet/unloading/activate-unloading"), exports);
|
|
25
26
|
__exportStar(require("./graphql/resolvers/worksheet/picking/activate-picking"), exports);
|
|
26
|
-
__exportStar(require("./graphql/resolvers/worksheet/worksheets"), exports);
|
|
27
|
-
__exportStar(require("./graphql/resolvers/worksheet/worksheet"), exports);
|
|
28
27
|
__exportStar(require("./migrations"), exports);
|
|
29
28
|
//# sourceMappingURL=index.js.map
|
package/dist-server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oBAAiB;AAEjB,8CAA2B;AAC3B,6CAA0B;AAC1B,4CAAyB;AACzB,mHAAgG;AAChG,+GAA4F;AAC5F,qHAAkG;AAClG,6FAA0E;AAC1E,yFAAsE;AACtE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oBAAiB;AAEjB,8CAA2B;AAC3B,6CAA0B;AAC1B,4CAAyB;AACzB,mHAAgG;AAChG,+GAA4F;AAC5F,qHAAkG;AAClG,+GAA4F;AAC5F,6FAA0E;AAC1E,yFAAsE;AACtE,+CAA4B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/worksheet-base",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.23",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,21 +24,21 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/auth-base": "^5.0.0-alpha.
|
|
28
|
-
"@things-factory/biz-base": "^5.0.0-alpha.
|
|
29
|
-
"@things-factory/document-template-base": "^5.0.0-alpha.
|
|
30
|
-
"@things-factory/id-rule-base": "^5.0.0-alpha.
|
|
31
|
-
"@things-factory/integration-lmd": "^5.0.0-alpha.
|
|
32
|
-
"@things-factory/integration-marketplace": "^5.0.0-alpha.
|
|
33
|
-
"@things-factory/integration-sellercraft": "^5.0.0-alpha.
|
|
34
|
-
"@things-factory/integration-sftp": "^5.0.0-alpha.
|
|
35
|
-
"@things-factory/marketplace-base": "^5.0.0-alpha.
|
|
36
|
-
"@things-factory/notification": "^5.0.0-alpha.
|
|
37
|
-
"@things-factory/sales-base": "^5.0.0-alpha.
|
|
38
|
-
"@things-factory/setting-base": "^5.0.0-alpha.
|
|
39
|
-
"@things-factory/shell": "^5.0.0-alpha.
|
|
40
|
-
"@things-factory/transport-base": "^5.0.0-alpha.
|
|
41
|
-
"@things-factory/warehouse-base": "^5.0.0-alpha.
|
|
27
|
+
"@things-factory/auth-base": "^5.0.0-alpha.23",
|
|
28
|
+
"@things-factory/biz-base": "^5.0.0-alpha.23",
|
|
29
|
+
"@things-factory/document-template-base": "^5.0.0-alpha.23",
|
|
30
|
+
"@things-factory/id-rule-base": "^5.0.0-alpha.23",
|
|
31
|
+
"@things-factory/integration-lmd": "^5.0.0-alpha.23",
|
|
32
|
+
"@things-factory/integration-marketplace": "^5.0.0-alpha.23",
|
|
33
|
+
"@things-factory/integration-sellercraft": "^5.0.0-alpha.23",
|
|
34
|
+
"@things-factory/integration-sftp": "^5.0.0-alpha.23",
|
|
35
|
+
"@things-factory/marketplace-base": "^5.0.0-alpha.23",
|
|
36
|
+
"@things-factory/notification": "^5.0.0-alpha.23",
|
|
37
|
+
"@things-factory/sales-base": "^5.0.0-alpha.23",
|
|
38
|
+
"@things-factory/setting-base": "^5.0.0-alpha.23",
|
|
39
|
+
"@things-factory/shell": "^5.0.0-alpha.23",
|
|
40
|
+
"@things-factory/transport-base": "^5.0.0-alpha.23",
|
|
41
|
+
"@things-factory/warehouse-base": "^5.0.0-alpha.23"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "2be04b72d722f690fac58a3698ddaed5cc616959"
|
|
44
44
|
}
|
|
@@ -17,68 +17,37 @@ interface WorksheetInterface extends Worksheet {
|
|
|
17
17
|
|
|
18
18
|
export const worksheetResolver = {
|
|
19
19
|
async worksheet(_: any, { name }, context: any) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export async function worksheet(name: string, context: any) {
|
|
25
|
-
const { domain }: { domain: Domain } = context.state
|
|
26
|
-
let worksheet: WorksheetInterface
|
|
27
|
-
worksheet = (await getRepository(Worksheet).findOne({
|
|
28
|
-
where: {
|
|
29
|
-
domain,
|
|
30
|
-
name
|
|
31
|
-
},
|
|
32
|
-
relations: [
|
|
33
|
-
'domain',
|
|
34
|
-
'bizplace',
|
|
35
|
-
'bizplace.domain',
|
|
36
|
-
'bufferLocation',
|
|
37
|
-
'bufferLocation.warehouse',
|
|
38
|
-
'arrivalNotice',
|
|
39
|
-
'arrivalNotice.releaseGood',
|
|
40
|
-
'releaseGood',
|
|
41
|
-
'releaseGood.arrivalNotice',
|
|
42
|
-
'releaseGood.shippingOrder',
|
|
43
|
-
'returnOrder',
|
|
44
|
-
'inventoryCheck',
|
|
45
|
-
'vasOrder',
|
|
46
|
-
'assignee',
|
|
47
|
-
'worksheetDetails',
|
|
48
|
-
'worksheetDetails.toLocation',
|
|
49
|
-
'worksheetDetails.targetProduct',
|
|
50
|
-
'worksheetDetails.targetProduct.product',
|
|
51
|
-
'worksheetDetails.targetVas',
|
|
52
|
-
'worksheetDetails.targetVas.vas',
|
|
53
|
-
'worksheetDetails.targetVas.inventory',
|
|
54
|
-
'worksheetDetails.targetVas.inventory.location',
|
|
55
|
-
'worksheetDetails.targetVas.targetProduct',
|
|
56
|
-
'worksheetDetails.targetInventory',
|
|
57
|
-
'worksheetDetails.targetInventory.releaseGood',
|
|
58
|
-
'worksheetDetails.targetInventory.product',
|
|
59
|
-
'worksheetDetails.targetInventory.inventory',
|
|
60
|
-
'worksheetDetails.targetInventory.inventory.product',
|
|
61
|
-
'worksheetDetails.targetInventory.inventory.warehouse',
|
|
62
|
-
'worksheetDetails.targetInventory.inventory.location',
|
|
63
|
-
'worksheetDetails.targetInventory.inspectedLocation',
|
|
64
|
-
'creator',
|
|
65
|
-
'updater'
|
|
66
|
-
]
|
|
67
|
-
})) as WorksheetInterface
|
|
68
|
-
|
|
69
|
-
if (!worksheet) {
|
|
20
|
+
const { domain }: { domain: Domain } = context.state
|
|
21
|
+
let worksheet: WorksheetInterface
|
|
70
22
|
worksheet = (await getRepository(Worksheet).findOne({
|
|
71
23
|
where: {
|
|
72
24
|
domain,
|
|
73
|
-
|
|
25
|
+
name
|
|
74
26
|
},
|
|
75
27
|
relations: [
|
|
76
28
|
'domain',
|
|
77
29
|
'bizplace',
|
|
78
30
|
'bizplace.domain',
|
|
31
|
+
'bufferLocation',
|
|
32
|
+
'bufferLocation.warehouse',
|
|
33
|
+
'arrivalNotice',
|
|
34
|
+
'arrivalNotice.releaseGood',
|
|
35
|
+
'releaseGood',
|
|
36
|
+
'releaseGood.arrivalNotice',
|
|
37
|
+
'releaseGood.shippingOrder',
|
|
38
|
+
'returnOrder',
|
|
39
|
+
'inventoryCheck',
|
|
40
|
+
'vasOrder',
|
|
41
|
+
'assignee',
|
|
79
42
|
'worksheetDetails',
|
|
43
|
+
'worksheetDetails.toLocation',
|
|
80
44
|
'worksheetDetails.targetProduct',
|
|
81
45
|
'worksheetDetails.targetProduct.product',
|
|
46
|
+
'worksheetDetails.targetVas',
|
|
47
|
+
'worksheetDetails.targetVas.vas',
|
|
48
|
+
'worksheetDetails.targetVas.inventory',
|
|
49
|
+
'worksheetDetails.targetVas.inventory.location',
|
|
50
|
+
'worksheetDetails.targetVas.targetProduct',
|
|
82
51
|
'worksheetDetails.targetInventory',
|
|
83
52
|
'worksheetDetails.targetInventory.releaseGood',
|
|
84
53
|
'worksheetDetails.targetInventory.product',
|
|
@@ -91,169 +60,196 @@ export async function worksheet(name: string, context: any) {
|
|
|
91
60
|
'updater'
|
|
92
61
|
]
|
|
93
62
|
})) as WorksheetInterface
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
let pWorksheetPickingItemSorting = getRepository(Setting).findOne({
|
|
97
|
-
where: { domain, category: 'location', name: 'rule-for-worksheet-release-goods-item' }
|
|
98
|
-
})
|
|
99
63
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
64
|
+
if (!worksheet) {
|
|
65
|
+
worksheet = (await getRepository(Worksheet).findOne({
|
|
66
|
+
where: {
|
|
67
|
+
domain,
|
|
68
|
+
arrivalNotice: name
|
|
69
|
+
},
|
|
70
|
+
relations: [
|
|
71
|
+
'domain',
|
|
72
|
+
'bizplace',
|
|
73
|
+
'bizplace.domain',
|
|
74
|
+
'worksheetDetails',
|
|
75
|
+
'worksheetDetails.targetProduct',
|
|
76
|
+
'worksheetDetails.targetProduct.product',
|
|
77
|
+
'worksheetDetails.targetInventory',
|
|
78
|
+
'worksheetDetails.targetInventory.releaseGood',
|
|
79
|
+
'worksheetDetails.targetInventory.product',
|
|
80
|
+
'worksheetDetails.targetInventory.inventory',
|
|
81
|
+
'worksheetDetails.targetInventory.inventory.product',
|
|
82
|
+
'worksheetDetails.targetInventory.inventory.warehouse',
|
|
83
|
+
'worksheetDetails.targetInventory.inventory.location',
|
|
84
|
+
'worksheetDetails.targetInventory.inspectedLocation',
|
|
85
|
+
'creator',
|
|
86
|
+
'updater'
|
|
87
|
+
]
|
|
88
|
+
})) as WorksheetInterface
|
|
89
|
+
}
|
|
108
90
|
|
|
109
|
-
|
|
110
|
-
where: {
|
|
111
|
-
domain,
|
|
112
|
-
bizplace: worksheet.bizplace,
|
|
113
|
-
arrivalNotice: worksheet.arrivalNotice
|
|
114
|
-
},
|
|
115
|
-
relations: ['targetProduct']
|
|
91
|
+
let pWorksheetPickingItemSorting = getRepository(Setting).findOne({
|
|
92
|
+
where: { domain, category: 'location', name: 'rule-for-worksheet-release-goods-item' }
|
|
116
93
|
})
|
|
117
|
-
}
|
|
118
94
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
.leftJoinAndSelect('oi.bizplace', 'bizplace')
|
|
127
|
-
.where('"oi"."domain_id" = :domain')
|
|
128
|
-
.andWhere('"oi"."bizplace_id" = :bizplace')
|
|
129
|
-
.andWhere('"oi"."ref_worksheet_id" = :refWorksheetId')
|
|
130
|
-
.setParameters({
|
|
131
|
-
domain: domain.id,
|
|
132
|
-
bizplace: worksheet.bizplace.id,
|
|
133
|
-
refWorksheetId: worksheet.id
|
|
95
|
+
if (worksheet?.arrivalNotice?.id) {
|
|
96
|
+
worksheet.orderProducts = await getRepository(OrderProduct).find({
|
|
97
|
+
where: {
|
|
98
|
+
domain,
|
|
99
|
+
bizplace: worksheet.bizplace,
|
|
100
|
+
arrivalNotice: worksheet.arrivalNotice
|
|
101
|
+
}
|
|
134
102
|
})
|
|
135
103
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
let orderInventories: OrderInventory[] = await qbOrderInventories.getMany()
|
|
145
|
-
worksheet.orderInventories = orderInventories
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (worksheet?.releaseGood?.id) {
|
|
149
|
-
let qbOrderInventories = getRepository(OrderInventory)
|
|
150
|
-
.createQueryBuilder('oi')
|
|
151
|
-
.leftJoinAndSelect('oi.releaseGood', 'releaseGood')
|
|
152
|
-
.leftJoinAndSelect('oi.inventory', 'inventory')
|
|
153
|
-
.leftJoinAndSelect('oi.product', 'product')
|
|
154
|
-
.leftJoinAndSelect('inventory.location', 'location')
|
|
155
|
-
.leftJoinAndSelect('oi.bizplace', 'bizplace')
|
|
156
|
-
.where('"oi"."domain_id" = :domain')
|
|
157
|
-
.andWhere('"oi"."bizplace_id" = :bizplace')
|
|
158
|
-
.andWhere('"oi"."release_good_id" = :releaseGood')
|
|
159
|
-
.andWhere('"oi"."status" NOT IN (:...statuses)')
|
|
160
|
-
.setParameters({
|
|
161
|
-
domain: domain.id,
|
|
162
|
-
bizplace: worksheet.bizplace.id,
|
|
163
|
-
releaseGood: worksheet.releaseGood.id,
|
|
164
|
-
statuses: [ORDER_INVENTORY_STATUS.CANCELLED, ORDER_INVENTORY_STATUS.REPLACED]
|
|
104
|
+
worksheet.orderVass = await getRepository(OrderVas).find({
|
|
105
|
+
where: {
|
|
106
|
+
domain,
|
|
107
|
+
bizplace: worksheet.bizplace,
|
|
108
|
+
arrivalNotice: worksheet.arrivalNotice
|
|
109
|
+
},
|
|
110
|
+
relations: ['targetProduct']
|
|
165
111
|
})
|
|
166
|
-
|
|
167
|
-
let sortingSetting: Setting = await pWorksheetPickingItemSorting
|
|
168
|
-
if (sortingSetting?.value) {
|
|
169
|
-
let settingValue = JSON.parse(sortingSetting.value)
|
|
170
|
-
for (const key in settingValue) {
|
|
171
|
-
qbOrderInventories.addOrderBy(`location.${key}`, settingValue[key] ? 'ASC' : 'DESC')
|
|
172
|
-
}
|
|
173
112
|
}
|
|
174
113
|
|
|
175
|
-
|
|
176
|
-
|
|
114
|
+
if (worksheet.type === WORKSHEET_TYPE.BATCH_PICKING) {
|
|
115
|
+
let qbOrderInventories = getRepository(OrderInventory)
|
|
116
|
+
.createQueryBuilder('oi')
|
|
117
|
+
.leftJoinAndSelect('oi.releaseGood', 'releaseGood')
|
|
118
|
+
.leftJoinAndSelect('oi.inventory', 'inventory')
|
|
119
|
+
.leftJoinAndSelect('oi.product', 'product')
|
|
120
|
+
.leftJoinAndSelect('inventory.location', 'location')
|
|
121
|
+
.leftJoinAndSelect('oi.bizplace', 'bizplace')
|
|
122
|
+
.where('"oi"."domain_id" = :domain')
|
|
123
|
+
.andWhere('"oi"."bizplace_id" = :bizplace')
|
|
124
|
+
.andWhere('"oi"."ref_worksheet_id" = :refWorksheetId')
|
|
125
|
+
.setParameters({
|
|
126
|
+
domain: domain.id,
|
|
127
|
+
bizplace: worksheet.bizplace.id,
|
|
128
|
+
refWorksheetId: worksheet.id
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
let sortingSetting: Setting = await pWorksheetPickingItemSorting
|
|
132
|
+
if (sortingSetting?.value) {
|
|
133
|
+
let settingValue = JSON.parse(sortingSetting.value)
|
|
134
|
+
for (const key in settingValue) {
|
|
135
|
+
qbOrderInventories.addOrderBy(`location.${key}`, settingValue[key] ? 'ASC' : 'DESC')
|
|
136
|
+
}
|
|
137
|
+
}
|
|
177
138
|
|
|
178
|
-
|
|
179
|
-
worksheet.
|
|
180
|
-
|
|
181
|
-
relations: ['marketplaceOrderItems', 'marketplaceStore']
|
|
182
|
-
})
|
|
139
|
+
let orderInventories: OrderInventory[] = await qbOrderInventories.getMany()
|
|
140
|
+
worksheet.orderInventories = orderInventories
|
|
141
|
+
}
|
|
183
142
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
143
|
+
if (worksheet?.releaseGood?.id) {
|
|
144
|
+
let qbOrderInventories = getRepository(OrderInventory)
|
|
145
|
+
.createQueryBuilder('oi')
|
|
146
|
+
.leftJoinAndSelect('oi.releaseGood', 'releaseGood')
|
|
147
|
+
.leftJoinAndSelect('oi.inventory', 'inventory')
|
|
148
|
+
.leftJoinAndSelect('oi.product', 'product')
|
|
149
|
+
.leftJoinAndSelect('inventory.location', 'location')
|
|
150
|
+
.leftJoinAndSelect('oi.bizplace', 'bizplace')
|
|
151
|
+
.where('"oi"."domain_id" = :domain')
|
|
152
|
+
.andWhere('"oi"."bizplace_id" = :bizplace')
|
|
153
|
+
.andWhere('"oi"."release_good_id" = :releaseGood')
|
|
154
|
+
.andWhere('"oi"."status" NOT IN (:...statuses)')
|
|
155
|
+
.setParameters({
|
|
156
|
+
domain: domain.id,
|
|
157
|
+
bizplace: worksheet.bizplace.id,
|
|
158
|
+
releaseGood: worksheet.releaseGood.id,
|
|
159
|
+
statuses: [ORDER_INVENTORY_STATUS.CANCELLED, ORDER_INVENTORY_STATUS.REPLACED]
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
let sortingSetting: Setting = await pWorksheetPickingItemSorting
|
|
163
|
+
if (sortingSetting?.value) {
|
|
164
|
+
let settingValue = JSON.parse(sortingSetting.value)
|
|
165
|
+
for (const key in settingValue) {
|
|
166
|
+
qbOrderInventories.addOrderBy(`location.${key}`, settingValue[key] ? 'ASC' : 'DESC')
|
|
194
167
|
}
|
|
168
|
+
}
|
|
195
169
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
:
|
|
170
|
+
let orderInventories: OrderInventory[] = await qbOrderInventories.getMany()
|
|
171
|
+
worksheet.orderInventories = orderInventories
|
|
172
|
+
|
|
173
|
+
if (worksheet.releaseGood.type == 'b2c') {
|
|
174
|
+
worksheet.marketplaceOrder = await getRepository(MarketplaceOrder).findOne({
|
|
175
|
+
where: { orderNo: worksheet.releaseGood.refNo },
|
|
176
|
+
relations: ['marketplaceOrderItems', 'marketplaceStore']
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
if (worksheet.marketplaceOrder) {
|
|
180
|
+
let marketplaceOrderShipping: MarketplaceOrderShipping
|
|
181
|
+
if (worksheet.marketplaceOrder.isSplitted) {
|
|
182
|
+
marketplaceOrderShipping = await getRepository(MarketplaceOrderShipping).findOne({
|
|
183
|
+
where: { subOrderNoRef: worksheet.releaseGood.refNo2 }
|
|
184
|
+
})
|
|
185
|
+
} else {
|
|
186
|
+
marketplaceOrderShipping = await getRepository(MarketplaceOrderShipping).findOne({
|
|
187
|
+
where: { orderNoRef: worksheet.releaseGood.refNo }
|
|
188
|
+
})
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
worksheet.marketplaceOrder.trackingNo = marketplaceOrderShipping.ownTrackingNo
|
|
192
|
+
? marketplaceOrderShipping.ownTrackingNo
|
|
193
|
+
: marketplaceOrderShipping.trackingNo
|
|
194
|
+
worksheet.marketplaceOrder.shippingProvider = marketplaceOrderShipping.ownTransporter
|
|
195
|
+
? marketplaceOrderShipping.ownTransporter
|
|
196
|
+
: marketplaceOrderShipping.transporter
|
|
197
|
+
}
|
|
202
198
|
}
|
|
199
|
+
|
|
200
|
+
worksheet.orderVass = await getRepository(OrderVas).find({
|
|
201
|
+
where: {
|
|
202
|
+
domain,
|
|
203
|
+
bizplace: worksheet.bizplace,
|
|
204
|
+
releaseGood: worksheet.releaseGood
|
|
205
|
+
},
|
|
206
|
+
relations: ['targetProduct']
|
|
207
|
+
})
|
|
203
208
|
}
|
|
204
209
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
if (worksheet?.returnOrder?.id) {
|
|
211
|
+
worksheet.orderInventories = await getRepository(OrderInventory).find({
|
|
212
|
+
where: {
|
|
213
|
+
domain,
|
|
214
|
+
bizplace: worksheet.bizplace,
|
|
215
|
+
returnOrder: worksheet.returnOrder,
|
|
216
|
+
status: Not(Equal(ORDER_INVENTORY_STATUS.CANCELLED))
|
|
217
|
+
},
|
|
218
|
+
relations: ['product', 'inventory', 'inventory.location']
|
|
219
|
+
})
|
|
214
220
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
})
|
|
221
|
+
worksheet.orderVass = await getRepository(OrderVas).find({
|
|
222
|
+
where: {
|
|
223
|
+
domain,
|
|
224
|
+
bizplace: worksheet.bizplace,
|
|
225
|
+
returnOrder: worksheet.returnOrder
|
|
226
|
+
},
|
|
227
|
+
relations: ['targetProduct']
|
|
228
|
+
})
|
|
229
|
+
}
|
|
225
230
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
231
|
+
if (worksheet?.inventoryCheck?.id) {
|
|
232
|
+
worksheet.orderInventories = await getRepository(OrderInventory).find({
|
|
233
|
+
where: {
|
|
234
|
+
domain,
|
|
235
|
+
bizplace: worksheet.bizplace,
|
|
236
|
+
inventoryCheck: worksheet.inventoryCheck
|
|
237
|
+
},
|
|
238
|
+
relations: ['product', 'inventory', 'inventory.location']
|
|
239
|
+
})
|
|
240
|
+
}
|
|
235
241
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
242
|
+
if (worksheet?.vasOrder?.id) {
|
|
243
|
+
worksheet.orderVass = await getRepository(OrderVas).find({
|
|
244
|
+
where: {
|
|
245
|
+
domain,
|
|
246
|
+
bizplace: worksheet.bizplace,
|
|
247
|
+
vasOrder: worksheet.vasOrder
|
|
248
|
+
},
|
|
249
|
+
relations: ['targetProduct']
|
|
250
|
+
})
|
|
251
|
+
}
|
|
246
252
|
|
|
247
|
-
|
|
248
|
-
worksheet.orderVass = await getRepository(OrderVas).find({
|
|
249
|
-
where: {
|
|
250
|
-
domain,
|
|
251
|
-
bizplace: worksheet.bizplace,
|
|
252
|
-
vasOrder: worksheet.vasOrder
|
|
253
|
-
},
|
|
254
|
-
relations: ['targetProduct']
|
|
255
|
-
})
|
|
253
|
+
return worksheet
|
|
256
254
|
}
|
|
257
|
-
|
|
258
|
-
return worksheet
|
|
259
255
|
}
|