|
@@ -79,13 +79,15 @@ public class TBDeviceInOutServiceImpl extends ServiceImpl<TBDeviceInOutMapper, T
|
|
|
|
|
|
@Override
|
|
|
public List<DeviceInOutResult> findDeviceCanOutInfo(Long supplierId, String sopNo) {
|
|
|
- SopCrmInfo sopCrmInfo = tbCrmService.findSopCrmInfoBySop(sopNo);
|
|
|
- String crmNo = sopCrmInfo.getCrmNo();
|
|
|
+ String crmNo = null;
|
|
|
+ if (sopNo != null && sopNo.length() > 0) {
|
|
|
+ SopCrmInfo sopCrmInfo = tbCrmService.findSopCrmInfoBySop(sopNo);
|
|
|
+ crmNo = sopCrmInfo.getCrmNo();
|
|
|
+ }
|
|
|
+
|
|
|
List<TBDeviceDelivery> tbDeviceDeliveryList = tbDeviceDeliveryService.list(new QueryWrapper<TBDeviceDelivery>()
|
|
|
.lambda()
|
|
|
- .eq(TBDeviceDelivery::getEffect, true)
|
|
|
- .eq(TBDeviceDelivery::getDeliveryType, InOutTypeEnum.OUT)
|
|
|
- .eq(TBDeviceDelivery::getStatus, DeviceDeliveryStatusEnum.RECEIVE));
|
|
|
+ .eq(TBDeviceDelivery::getEffect, true));
|
|
|
|
|
|
List<DeviceInOutResult> result = new ArrayList<>();
|
|
|
List<DeviceInOutResult> deviceInOutResultList = this.baseMapper.findDeviceCanOutInfo(supplierId, DeviceStatusEnum.NORMAL, InOutTypeEnum.IN);
|
|
@@ -105,6 +107,10 @@ public class TBDeviceInOutServiceImpl extends ServiceImpl<TBDeviceInOutMapper, T
|
|
|
}
|
|
|
TBDeviceDelivery tbDeviceDelivery = cellDeliveryList.get(0);
|
|
|
String deliveryCrmNo = tbDeviceDelivery.getCrmNo();
|
|
|
+ if (!InOutTypeEnum.OUT.equals(tbDeviceDelivery.getDeliveryType()) || !DeviceDeliveryStatusEnum.DELIVER.equals(tbDeviceDelivery.getStatus())){
|
|
|
+ // 出库 且 已发货的可以出库
|
|
|
+ continue;
|
|
|
+ }
|
|
|
if (crmNo != null && crmNo.length() > 0) {
|
|
|
// 用于sop
|
|
|
if (crmNo.equals(deliveryCrmNo)) {
|
|
@@ -211,7 +217,7 @@ public class TBDeviceInOutServiceImpl extends ServiceImpl<TBDeviceInOutMapper, T
|
|
|
.set(SysDevice::getScanCount, e.getScanCount())
|
|
|
.set(SysDevice::getStatus, e.getDeviceStatus())
|
|
|
.set(SysDevice::getBound, inOutType)
|
|
|
- .eq(SysDevice::getDeviceCode, e.getSerialNo());
|
|
|
+ .eq(SysDevice::getSerialNo, e.getSerialNo());
|
|
|
sysDeviceService.update(updateWrapper);
|
|
|
|
|
|
return Stream.of(tbDeviceInOut);
|