This commit is contained in:
wujinliang
2026-09-18 11:41:04 +08:00
parent 263068ac85
commit 1fc3e04723
38 changed files with 378 additions and 61 deletions
@@ -23,6 +23,8 @@ public final class InboundMeasurementResponses {
Integer expectedPalletCount,
String processStatus,
String measureReviewStatus,
@Schema(description = "当前最新费用版本是否已由客户确认;确认后测量数据不可再修改")
boolean customerFeeConfirmed,
@Schema(description = "测量完成后的推荐托盘类型,仅为建议,不代表已分配托盘",
allowableValues = "STANDARD", example = "STANDARD")
String recommendedPalletType,
@@ -109,7 +109,7 @@ public class InboundMeasurementService {
MeasureReviewRecordEntity review = repository.findLatestReview(tenantId, inbound.getId());
LatestDeclaration latestDeclaration = loadLatestDeclaration(inbound);
return toDetail(inbound, measurement, items, weights, allocationSlots, allocationsByWeight,
review, latestDeclaration);
review, latestDeclaration, customerFeeConfirmed(tenantId, inbound.getId()));
}
public PageResult<InboundMeasurementResponses.PalletSnapshot> weightPalletOptions(
@@ -236,10 +236,9 @@ public class InboundMeasurementService {
InboundOrderEntity inbound, String subject) {
var currentFee = pricingRepository.findLatestFeeForUpdate(tenantId, inboundId);
boolean customerConfirmed = currentFee != null && currentFee.getCustomerConfirmedAt() != null;
boolean loadingCompleted = Set.of("LOADED", "DELIVERED").contains(inbound.getProcessStatus());
if (customerConfirmed && loadingCompleted) {
if (customerConfirmed) {
throw new BizException(ResultCode.CONFLICT,
"客户已确认且该票已装柜完成,不能修改" + subject);
"客户已确认费用,不能修改" + subject);
}
}
@@ -569,12 +568,14 @@ public class InboundMeasurementService {
List<com.baiyue.firstleg.entity.InboundPalletAllocationEntity> allocationSlots,
Map<Long, com.baiyue.firstleg.entity.InboundPalletAllocationEntity> allocationsByWeight,
MeasureReviewRecordEntity review,
LatestDeclaration latestDeclaration) {
LatestDeclaration latestDeclaration,
boolean customerFeeConfirmed) {
InboundMeasurementResponses.DeclarationSnapshot declaration = latestDeclaration.snapshot();
return new InboundMeasurementResponses.Detail(
inbound.getId(), inbound.getInboundCode(), customerDisplayName(inbound), inbound.getChannelCode(),
inbound.getChannelName(), inbound.getFulfillmentType(), inbound.getPalletCount(),
inbound.getProcessStatus(), inbound.getMeasureReviewStatus(),
customerFeeConfirmed,
RECOMMENDED_PALLET_TYPE,
review == null ? null : review.getReviewReason(), review == null ? null : review.getReviewerId(),
review == null ? null : review.getReviewerName(), measurement == null ? null : measurement.getId(),
@@ -603,6 +604,11 @@ public class InboundMeasurementService {
toPalletLocationGuide(allocationSlots));
}
private boolean customerFeeConfirmed(long tenantId, long inboundId) {
var latestFee = pricingRepository.findLatestFee(tenantId, inboundId);
return latestFee != null && latestFee.getCustomerConfirmedAt() != null;
}
private static InboundMeasurementResponses.PalletLocationGuide toPalletLocationGuide(
List<com.baiyue.firstleg.entity.InboundPalletAllocationEntity> slots) {
if (slots.isEmpty()) return null;