|
|
|
@ -358,6 +358,29 @@ public class IoAddInoutService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (StrUtil.isEmpty(bizEntity.getBatchNo())) {
|
|
|
|
|
List<InvProductEntity> invProductEntities = invProductService.selectByRelId(bizEntity.getBindRlFk(), bizEntity.getSupId(), null, orderEntity.getInvCode());
|
|
|
|
|
if (CollUtil.isNotEmpty(invProductEntities)) {
|
|
|
|
|
int count = 0;
|
|
|
|
|
for (InvProductEntity invProductEntity : invProductEntities) {
|
|
|
|
|
if (invProductEntity.getReCount() + count > IntUtil.value(bizEntity.getCount())) {
|
|
|
|
|
IoOrderDetailBizEntity orderDetailBizEntity = new IoOrderDetailBizEntity();
|
|
|
|
|
BeanUtils.copyProperties(bizEntity, orderDetailBizEntity);
|
|
|
|
|
orderDetailBizEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
orderDetailBizEntity.setBatchNo(invProductEntity.getBatchNo());
|
|
|
|
|
newBizList.add(orderDetailBizEntity);
|
|
|
|
|
break;
|
|
|
|
|
} else {
|
|
|
|
|
count = invProductEntity.getReCount();
|
|
|
|
|
IoOrderDetailBizEntity orderDetailBizEntity = new IoOrderDetailBizEntity();
|
|
|
|
|
BeanUtils.copyProperties(bizEntity, orderDetailBizEntity);
|
|
|
|
|
orderDetailBizEntity.setCount(count);
|
|
|
|
|
orderDetailBizEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
orderDetailBizEntity.setBatchNo(invProductEntity.getBatchNo());
|
|
|
|
|
newBizList.add(orderDetailBizEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -368,7 +391,7 @@ public class IoAddInoutService {
|
|
|
|
|
|
|
|
|
|
List<IoCodeTempEntity> codeTempEntities = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (IoOrderDetailBizEntity bizEntity : bizEntities) {
|
|
|
|
|
for (IoOrderDetailBizEntity bizEntity : newBizList) {
|
|
|
|
|
IoCodeTempEntity codeTempEntity = new IoCodeTempEntity();
|
|
|
|
|
String udiCode = "#" + bizEntity.getNameCode()
|
|
|
|
|
+ "#" + StrUtil.trimToEmpty(bizEntity.getProductDate())
|
|
|
|
@ -398,7 +421,7 @@ public class IoAddInoutService {
|
|
|
|
|
codeTempEntities.add(codeTempEntity);
|
|
|
|
|
}
|
|
|
|
|
codeTempService.insertBatch(codeTempEntities);
|
|
|
|
|
bizEntities.forEach(orderDetailBizEntity -> {
|
|
|
|
|
newBizList.forEach(orderDetailBizEntity -> {
|
|
|
|
|
IoOrderDetailCodeEntity orderDetailCodeEntity = new IoOrderDetailCodeEntity();
|
|
|
|
|
BeanUtils.copyProperties(orderDetailBizEntity, orderDetailCodeEntity);
|
|
|
|
|
orderDetailCodeEntity.setId(null);
|
|
|
|
|