Merge branch 'dev' into feature/dev-0729
This commit is contained in:
+34
-18
@@ -234,7 +234,7 @@ public class ReviewOrderApplicationService {
|
||||
}
|
||||
db.setPendingReviewQty(pending.subtract(qty));
|
||||
db.setReviewedQty(reviewed.add(qty));
|
||||
// 同步页面传入的重量/体积/面积
|
||||
// 同步页面传入的重量/体积/面积/尺寸
|
||||
if (i.getNetWeightKg() != null) {
|
||||
db.setNetWeightKg(i.getNetWeightKg());
|
||||
}
|
||||
@@ -247,6 +247,9 @@ public class ReviewOrderApplicationService {
|
||||
if (i.getAreaSqm() != null) {
|
||||
db.setAreaSqm(i.getAreaSqm());
|
||||
}
|
||||
if (i.getSize() != null) {
|
||||
db.setSize(i.getSize());
|
||||
}
|
||||
fillOperator(db);
|
||||
reviewMaterialDetailMapper.updateById(db);
|
||||
}
|
||||
@@ -288,7 +291,7 @@ public class ReviewOrderApplicationService {
|
||||
db.setReviewedQty(reviewed.subtract(qty));
|
||||
db.setPendingReviewQty(pending.add(qty));
|
||||
db.setCancelQty(cancel.add(qty));
|
||||
// 同步页面传入的重量/体积/面积
|
||||
// 同步页面传入的重量/体积/面积/尺寸
|
||||
if (i.getNetWeightKg() != null) {
|
||||
db.setNetWeightKg(i.getNetWeightKg());
|
||||
}
|
||||
@@ -301,6 +304,9 @@ public class ReviewOrderApplicationService {
|
||||
if (i.getAreaSqm() != null) {
|
||||
db.setAreaSqm(i.getAreaSqm());
|
||||
}
|
||||
if (i.getSize() != null) {
|
||||
db.setSize(i.getSize());
|
||||
}
|
||||
fillOperator(db);
|
||||
reviewMaterialDetailMapper.updateById(db);
|
||||
}
|
||||
@@ -337,16 +343,16 @@ public class ReviewOrderApplicationService {
|
||||
// 与出库单「复核确认」一致:复核数量与拣货数量不一致时生成复核异常单(FHYC)
|
||||
genOutOrderAbnormalAfterReviewConfirm(reviewOrderId);
|
||||
// 校验:复核确认前,已复核数量必须等于计划数量
|
||||
List<ReviewMaterialDetailPO> details = reviewOrderMapper.queryDetailByReviewOrderId(reviewOrderId);
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
for (ReviewMaterialDetailPO detail : details) {
|
||||
BigDecimal reviewed = nz(detail.getReviewedQty());
|
||||
BigDecimal plan = nz(detail.getMaterialPlanQty());
|
||||
if (reviewed.compareTo(plan) != 0) {
|
||||
throw new ServiceException("该物料已复核数量不等于计划数量");
|
||||
}
|
||||
}
|
||||
}
|
||||
// List<ReviewMaterialDetailPO> details = reviewOrderMapper.queryDetailByReviewOrderId(reviewOrderId);
|
||||
// if (!CollectionUtils.isEmpty(details)) {
|
||||
// for (ReviewMaterialDetailPO detail : details) {
|
||||
// BigDecimal reviewed = nz(detail.getReviewedQty());
|
||||
// BigDecimal plan = nz(detail.getMaterialPlanQty());
|
||||
// if (reviewed.compareTo(plan) != 0) {
|
||||
// throw new ServiceException("该物料已复核数量不等于计划数量");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
ReviewOrder order = reviewOrderMapper.selectById(reviewOrderId);
|
||||
if (order == null) {
|
||||
continue;
|
||||
@@ -751,8 +757,11 @@ public class ReviewOrderApplicationService {
|
||||
if (i.getAreaSqm() != null) {
|
||||
db.setAreaSqm(i.getAreaSqm());
|
||||
}
|
||||
if (i.getSize() != null) {
|
||||
db.setSize(i.getSize());
|
||||
}
|
||||
if (qtyTouched || i.getNetWeightKg() != null || i.getGrossWeightKg() != null
|
||||
|| i.getVolumeCbm() != null || i.getAreaSqm() != null) {
|
||||
|| i.getVolumeCbm() != null || i.getAreaSqm() != null || i.getSize() != null) {
|
||||
fillOperator(db);
|
||||
reviewMaterialDetailMapper.updateById(db);
|
||||
}
|
||||
@@ -792,11 +801,18 @@ public class ReviewOrderApplicationService {
|
||||
|
||||
private void refreshReviewOrderStatus(Long reviewOrderId) {
|
||||
List<ReviewMaterialDetailPO> rows = reviewOrderMapper.queryDetailByReviewOrderId(reviewOrderId);
|
||||
// 业务口径:只有全部明细待复核=0 时,状态才置为 2;部分复核仍保持 1。
|
||||
// 状态 3 仅在 checkConfirm 中设置。
|
||||
boolean allReviewed = !CollectionUtils.isEmpty(rows)
|
||||
&& rows.stream().allMatch(r -> nz(r.getPendingReviewQty()).compareTo(BigDecimal.ZERO) == 0);
|
||||
Integer targetStatus = allReviewed ? 2 : 1;
|
||||
// ================== 旧口径:全部明细待复核=0 置 2,部分复核保持 1 ==================
|
||||
// // 业务口径:只有全部明细待复核=0 时,状态才置为 2;部分复核仍保持 1。
|
||||
// // 状态 3 仅在 checkConfirm 中设置。
|
||||
// boolean allReviewed = !CollectionUtils.isEmpty(rows)
|
||||
// && rows.stream().allMatch(r -> nz(r.getPendingReviewQty()).compareTo(BigDecimal.ZERO) == 0);
|
||||
// Integer targetStatus = allReviewed ? 2 : 1;
|
||||
// ================== 新口径:部分复核/全部复核完未确认均置 复核中(2),完全未复核保持 待复核(1) ==================
|
||||
// 只要有任意明细已复核数量>0(部分复核 / 全部复核完未确认)即为复核中(2);
|
||||
// 完全未复核(全部已复核=0)保持待复核(1)。状态 3 仅在 checkConfirm 中设置。
|
||||
boolean anyReviewed = !CollectionUtils.isEmpty(rows)
|
||||
&& rows.stream().anyMatch(r -> nz(r.getReviewedQty()).compareTo(BigDecimal.ZERO) > 0);
|
||||
Integer targetStatus = anyReviewed ? 2 : 1;
|
||||
|
||||
ReviewOrder order = reviewOrderMapper.selectById(reviewOrderId);
|
||||
if (order == null) {
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@ package com.mhd.wms.domain.inventoryAdjustmentRecord.service;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.aliyun.oss.ServiceException;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mhd.common.core.constant.SnowFlakeConstants;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
@@ -175,7 +175,7 @@ public class InventoryAdjustmentRecordDomainService {
|
||||
}
|
||||
materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) {
|
||||
throw new ServiceException("可用数量调整之后不能小于0");
|
||||
throw new ServiceException("调整之后可用数量不能小于0");
|
||||
}
|
||||
}
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||
@@ -231,7 +231,7 @@ public class InventoryAdjustmentRecordDomainService {
|
||||
}
|
||||
materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) {
|
||||
throw new ServiceException("可用数量调整之后不能小于0");
|
||||
throw new ServiceException("调整之后可用数量不能小于0");
|
||||
}
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity());
|
||||
@@ -292,7 +292,7 @@ public class InventoryAdjustmentRecordDomainService {
|
||||
//推送oms库存调整记录
|
||||
try{
|
||||
// 当仓库启用 oms 才进行推送
|
||||
if (warehousePO.getIsEnable() == 1) {
|
||||
if (ObjectUtil.isNotNull(warehousePO) && warehousePO.getIsEnable() == 1) {
|
||||
Boolean pushSuccess = pushOms(materialInventory, inventoryAdjustmentRecordDO);
|
||||
if (!pushSuccess) {
|
||||
throw new ServiceException("库存调整推送OMS失败,请稍后重试");
|
||||
|
||||
+2
-1
@@ -78,7 +78,8 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
if ("hz".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByHz(materialInventoryDO);
|
||||
} else if ("hzwl".equals(queryRule)) { // 货主查询
|
||||
return materialInventoryMapper.queryListByHzWl(materialInventoryDO);
|
||||
return materialInventoryMapper.queryListByHz(materialInventoryDO);
|
||||
// return materialInventoryMapper.queryListByHzWl(materialInventoryDO);
|
||||
} else if ("wl".equals(queryRule)) { // 物料查询
|
||||
return materialInventoryMapper.queryListByWl(materialInventoryDO);
|
||||
} else if ("kw".equals(queryRule)) {
|
||||
|
||||
Reference in New Issue
Block a user