单只出库时直接进行托盘的解绑

This commit is contained in:
彭枝刚 2024-11-11 16:36:40 +08:00
parent 8205714bba
commit 7c47bcfd45

View File

@ -11,6 +11,7 @@ import com.foreverwin.nlv.wms.mapper.WmsOutDeliveryMapper;
import com.foreverwin.nlv.wms.service.WmsCuttingPackageService;
import com.foreverwin.nlv.wms.service.WmsInventoryService;
import com.foreverwin.nlv.wms.service.WmsOutDeliveryService;
import com.foreverwin.nlv.wms.util.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -119,16 +120,22 @@ public class WmsOutDeliveryServiceImpl extends ServiceImpl<WmsOutDeliveryMapper,
WmsCuttingPackage wmsCuttingPackage = wmsCuttingPackageService.getOne(queryWrapper);
if (wmsCuttingPackage == null) {
throw BusinessException.build("此标签号不存在!");
} else if ("1".equals(wmsCuttingPackage.getOutState())) {
throw BusinessException.build(wmsCuttingPackage.getBatchNumber() + "此标签号已经出库!");
} else if ("1".equals(wmsOutDelivery.getType()) || "2".equals(wmsOutDelivery.getType())) {
} else if ("1".equals(wmsOutDelivery.getType()) ) {
wmsCuttingPackage.setOutState("1");
wmsCuttingPackage.setPackageNumber(null); // 单只出时进行解绑
wmsCuttingPackage.setUpdater(SecurityUtils.getUserName());
wmsCuttingPackage.setDateUpdate(LocalDateTime.now());
wmsCuttingPackageService.updateById(wmsCuttingPackage);
// 更新库存
wmsInventoryService.outInventoryByMaterialLot(site, batchNumber, qty);
} else if("2".equals(wmsOutDelivery.getType())){
wmsCuttingPackage.setOutState("1");
wmsCuttingPackage.setUpdater(SecurityUtils.getUserName());
wmsCuttingPackage.setDateUpdate(LocalDateTime.now());
wmsCuttingPackageService.updateById(wmsCuttingPackage);
// 更新库存
wmsInventoryService.outInventoryByMaterialLot(site, batchNumber, qty);
} else if ("3".equals(wmsOutDelivery.getType())) {
}else if ("3".equals(wmsOutDelivery.getType())) {
BigDecimal qtyHand = new BigDecimal(wmsCuttingPackage.getLength());
// 彩包拖
if (qty.compareTo(qtyHand) == 0) {