Compare commits
66
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b221b13d1 | ||
|
|
48eaf2356f | ||
|
|
970952d9fa | ||
|
|
135996ce19 | ||
|
|
6b85cddede | ||
|
|
e486f850f2 | ||
|
|
76c2f3a5fd | ||
|
|
bb542e7510 | ||
|
|
eba4461381 | ||
|
|
f5ad238015 | ||
|
|
4bdb24e9ac | ||
|
|
425922fd04 | ||
|
|
d65424e5bf | ||
|
|
2a35793baf | ||
|
|
d22df698b6 | ||
|
|
1771bf9909 | ||
|
|
15d69f9361 | ||
|
|
2b4089ef59 | ||
|
|
20c3e1f422 | ||
|
|
3b19d9e930 | ||
|
|
5fd11e9caf | ||
|
|
0b98dcdfe9 | ||
|
|
b373cbbe46 | ||
|
|
acd97c7b9b | ||
|
|
118bdb1666 | ||
|
|
944de228f7 | ||
|
|
25c9cd4dfc | ||
|
|
882cd226ec | ||
|
|
feb4d7af66 | ||
|
|
d75ab1ed5f | ||
|
|
a501eb7443 | ||
|
|
19941d9480 | ||
|
|
cd3d522d4f | ||
|
|
181c5078e9 | ||
|
|
e97f46e6b4 | ||
|
|
c0f89deb83 | ||
|
|
ce695463d3 | ||
|
|
83c683d473 | ||
|
|
9555474b0b | ||
|
|
a150f9e017 | ||
|
|
ecd2fa1c33 | ||
|
|
e3236d262d | ||
|
|
c8e2e16ba5 | ||
|
|
99b44faf09 | ||
|
|
b3e3cbf84b | ||
|
|
0aee11d824 | ||
|
|
fcf358a768 | ||
|
|
619369104c | ||
|
|
4f1408b9d0 | ||
|
|
029eea70cc | ||
|
|
22b1e65385 | ||
|
|
2170c48763 | ||
|
|
c2d1c48aae | ||
|
|
e14958c643 | ||
|
|
da288338cd | ||
|
|
ea430f2468 | ||
|
|
f76f79744a | ||
|
|
19daaff907 | ||
|
|
db94d8f932 | ||
|
|
53618fe362 | ||
|
|
523edffc4e | ||
|
|
c7ddb1a8b0 | ||
|
|
45c9fc814a | ||
|
|
407dc13ac4 | ||
|
|
0c06bf16c2 | ||
|
|
1db39e77d3 |
@@ -11,7 +11,7 @@
|
||||
|
||||
<groupId>com.imyeyu.timiserverapi</groupId>
|
||||
<artifactId>TimiServerAPI</artifactId>
|
||||
<version>1.0.52</version>
|
||||
<version>1.0.53</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>TimiServerAPI</name>
|
||||
<description>imyeyu.com API</description>
|
||||
|
||||
+1
@@ -184,6 +184,7 @@ public class AttachmentServiceImplement extends AbstractEntityService<Attachment
|
||||
try (InputStream inputStream = getInputStreamByMongoId(source.getMongoId())) {
|
||||
target.setInputStream(inputStream);
|
||||
create(target);
|
||||
target.setInputStream(null);
|
||||
return target;
|
||||
} catch (IOException e) {
|
||||
if (target.getMongoId() != null) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.imyeyu.api.modules.gao.service;
|
||||
|
||||
import com.imyeyu.api.modules.common.entity.Attachment;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoProductStock;
|
||||
import com.imyeyu.api.modules.gao.entity.GaoProductStockRecord;
|
||||
import com.imyeyu.api.modules.gao.vo.GaoProductStockChangeRequest;
|
||||
@@ -62,6 +63,10 @@ public interface GaoProductStockService {
|
||||
/// 履约出库
|
||||
List<GaoProductStock> outForFulfillment(String storeId, String bizId, List<GaoStockChangeItem> items, String requestNo, String operatorUserId);
|
||||
|
||||
/// 履约出库并复制履约附件到出库流水
|
||||
List<GaoProductStock> outForFulfillment(String storeId, String bizId, List<GaoStockChangeItem> items, String requestNo,
|
||||
String operatorUserId, List<Attachment> attachmentList);
|
||||
|
||||
/// 履约库存冲正入库
|
||||
List<GaoProductStock> revokeForFulfillment(String storeId, String bizId, List<GaoStockChangeItem> items, String requestNo, String operatorUserId);
|
||||
|
||||
|
||||
+3
-1
@@ -261,8 +261,10 @@ public class GaoOrderFulfillmentServiceImplement extends AbstractEntityService<G
|
||||
applySkuSpecSnapshots(stockItems, fulfillmentItemList);
|
||||
String verifierUserId = userLoginService.getRequireLoginUserId();
|
||||
if (!stockItems.isEmpty()) {
|
||||
List<Attachment> attachmentList = attachmentService.listByBizId(
|
||||
Attachment.BizType.GAO_ORDER_FULFILLMENT, fulfillment.getId());
|
||||
productStockService.outForFulfillment(order.getStoreId(), fulfillment.getId(), stockItems,
|
||||
stockRequestNo(fulfillment, "OUT"), verifierUserId);
|
||||
stockRequestNo(fulfillment, "OUT"), verifierUserId, attachmentList);
|
||||
}
|
||||
TimiException.requiredTrue(1 == mapper.updateStatus(fulfillment.getId(), GaoOrderFulfillment.Status.VERIFIED,
|
||||
verifierUserId, Time.now(), request.getReason()), "履约状态已变化");
|
||||
|
||||
+30
-1
@@ -232,6 +232,14 @@ public class GaoProductStockServiceImplement implements GaoProductStockService {
|
||||
return executeInternal(storeId, bizId, items, requestNo, operatorUserId, GaoProductStockRecord.OperationType.ORDER_OUT, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(TimiServerDBConfig.ROLLBACKER)
|
||||
public List<GaoProductStock> outForFulfillment(String storeId, String bizId, List<GaoStockChangeItem> items, String requestNo,
|
||||
String operatorUserId, List<Attachment> attachmentList) {
|
||||
return executeInternal(storeId, bizId, items, requestNo, operatorUserId,
|
||||
GaoProductStockRecord.OperationType.ORDER_OUT, null, null, attachmentList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(TimiServerDBConfig.ROLLBACKER)
|
||||
public List<GaoProductStock> revokeForFulfillment(String storeId, String bizId, List<GaoStockChangeItem> items, String requestNo, String operatorUserId) {
|
||||
@@ -445,7 +453,11 @@ public class GaoProductStockServiceImplement implements GaoProductStockService {
|
||||
record.setOperatorUserId(operatorUserId);
|
||||
record.setOccurredAt(TimiJava.defaultIfNull(occurredAt, Time.now()));
|
||||
record.setRemark(remark);
|
||||
recordService.createOperationRecord(record, attachmentList);
|
||||
recordService.createOperationRecord(record,
|
||||
operationType == GaoProductStockRecord.OperationType.ORDER_OUT ? null : attachmentList);
|
||||
if (operationType == GaoProductStockRecord.OperationType.ORDER_OUT) {
|
||||
copyAttachments(record.getId(), attachmentList);
|
||||
}
|
||||
stock.setOnHandQuantity(onHandAfter);
|
||||
stock.setReservedQuantity(reservedAfter);
|
||||
stock.setUpdatedBy(operatorUserId);
|
||||
@@ -455,6 +467,23 @@ public class GaoProductStockServiceImplement implements GaoProductStockService {
|
||||
return result;
|
||||
}
|
||||
|
||||
/// 复制履约附件到出库流水
|
||||
///
|
||||
/// @param recordId 出库流水 ID
|
||||
/// @param sourceAttachmentList 履约附件
|
||||
private void copyAttachments(String recordId, List<Attachment> sourceAttachmentList) {
|
||||
for (Attachment source : TimiJava.safeIterable(sourceAttachmentList)) {
|
||||
if (source == null) {
|
||||
continue;
|
||||
}
|
||||
TimiException.required(source.getId(), "履约附件 ID 不能为空");
|
||||
Attachment copy = attachmentService.clone(source.getId());
|
||||
copy.setBizType(Attachment.BizType.GAO_STOCK_RECORD);
|
||||
copy.setBizId(recordId);
|
||||
attachmentService.update(copy);
|
||||
}
|
||||
}
|
||||
|
||||
private GaoProductStock lockOrCreateStock(String storeId, String skuId) {
|
||||
GaoProductStock stock = stockMapper.selectForUpdate(storeId, skuId);
|
||||
if (stock != null) {
|
||||
|
||||
Reference in New Issue
Block a user