bug-1509 发货管理-发货单
This commit is contained in:
parent
c842372069
commit
b15b3cb55b
|
|
@ -87,7 +87,7 @@ public class WmsShipmentDelivery implements Serializable {
|
||||||
private Integer boxStatus;
|
private Integer boxStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发车状态,0:未发车;1:已发车
|
* 发车状态,0:未发车;1:已发车;4:已收货
|
||||||
*/
|
*/
|
||||||
private Integer carStatus;
|
private Integer carStatus;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,4 +22,9 @@ public interface IWmsShipmentDeliveryService extends IService<WmsShipmentDeliver
|
||||||
List<ShipmentPackagingCodeVO> getBoxByPlateNumber(String plateNumber);
|
List<ShipmentPackagingCodeVO> getBoxByPlateNumber(String plateNumber);
|
||||||
|
|
||||||
List<ShipmentPackagingCodeVO> getBoxByDeliveryId(Long deliveryId);
|
List<ShipmentPackagingCodeVO> getBoxByDeliveryId(Long deliveryId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断发货单下所有包装箱是否都已卸货
|
||||||
|
*/
|
||||||
|
boolean allPackagingCodeUnloaded(Long deliveryId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,18 @@ package com.nflg.wms.repository.service.impl;
|
||||||
|
|
||||||
import com.nflg.wms.common.pojo.vo.ShipmentPackagingCodeVO;
|
import com.nflg.wms.common.pojo.vo.ShipmentPackagingCodeVO;
|
||||||
import com.nflg.wms.repository.entity.WmsShipmentDelivery;
|
import com.nflg.wms.repository.entity.WmsShipmentDelivery;
|
||||||
|
import com.nflg.wms.repository.entity.WmsShipmentDeliveryItem;
|
||||||
|
import com.nflg.wms.repository.entity.WmsShipmentPackagingCode;
|
||||||
import com.nflg.wms.repository.mapper.WmsShipmentDeliveryMapper;
|
import com.nflg.wms.repository.mapper.WmsShipmentDeliveryMapper;
|
||||||
|
import com.nflg.wms.repository.service.IWmsShipmentDeliveryItemService;
|
||||||
import com.nflg.wms.repository.service.IWmsShipmentDeliveryService;
|
import com.nflg.wms.repository.service.IWmsShipmentDeliveryService;
|
||||||
|
import com.nflg.wms.repository.service.IWmsShipmentPackagingCodeService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -20,6 +26,12 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class WmsShipmentDeliveryServiceImpl extends ServiceImpl<WmsShipmentDeliveryMapper, WmsShipmentDelivery> implements IWmsShipmentDeliveryService {
|
public class WmsShipmentDeliveryServiceImpl extends ServiceImpl<WmsShipmentDeliveryMapper, WmsShipmentDelivery> implements IWmsShipmentDeliveryService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IWmsShipmentDeliveryItemService deliveryItemService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IWmsShipmentPackagingCodeService packagingCodeService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WmsShipmentDelivery getByPackagingCodeId(Long id) {
|
public WmsShipmentDelivery getByPackagingCodeId(Long id) {
|
||||||
return baseMapper.getByPackagingCodeId(id);
|
return baseMapper.getByPackagingCodeId(id);
|
||||||
|
|
@ -34,4 +46,23 @@ public class WmsShipmentDeliveryServiceImpl extends ServiceImpl<WmsShipmentDeliv
|
||||||
public List<ShipmentPackagingCodeVO> getBoxByDeliveryId(Long deliveryId) {
|
public List<ShipmentPackagingCodeVO> getBoxByDeliveryId(Long deliveryId) {
|
||||||
return baseMapper.getBoxByDeliveryId(deliveryId);
|
return baseMapper.getBoxByDeliveryId(deliveryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean allPackagingCodeUnloaded(Long deliveryId) {
|
||||||
|
List<Long> packagingCodeIds = deliveryItemService.lambdaQuery()
|
||||||
|
.eq(WmsShipmentDeliveryItem::getDeliveryId, deliveryId)
|
||||||
|
.list()
|
||||||
|
.stream()
|
||||||
|
.map(WmsShipmentDeliveryItem::getPackagingCodeId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (packagingCodeIds.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 查询是否存在未卸货的包装箱(status != 4)
|
||||||
|
long notUnloadedCount = packagingCodeService.lambdaQuery()
|
||||||
|
.in(WmsShipmentPackagingCode::getId, packagingCodeIds)
|
||||||
|
.ne(WmsShipmentPackagingCode::getStatus, 4)
|
||||||
|
.count();
|
||||||
|
return notUnloadedCount == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,9 @@ public class H5Controller extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private IWmsShipmentSiteStockMaterialItemRecordService siteStockMaterialItemRecordService;
|
private IWmsShipmentSiteStockMaterialItemRecordService siteStockMaterialItemRecordService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IWmsShipmentDeliveryItemService deliveryItemService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询
|
* 查询
|
||||||
*/
|
*/
|
||||||
|
|
@ -145,6 +148,10 @@ public class H5Controller extends BaseController {
|
||||||
.setCreateTime(LocalDateTime.now())
|
.setCreateTime(LocalDateTime.now())
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
if(deliveryService.allPackagingCodeUnloaded(delivery.getId())) {
|
||||||
|
delivery.setCarStatus(4);
|
||||||
|
deliveryService.updateById(delivery);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue