diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java index b34560f..1913632 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java @@ -16,6 +16,7 @@ import com.hnac.hzims.spare.service.*; import com.hnac.hzims.spare.vo.SpWarehouseOutVO; import com.hnac.hzims.spare.vo.WtSpBasicVO; import lombok.AllArgsConstructor; +import org.apache.commons.lang3.ObjectUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springblade.core.log.exception.ServiceException; @@ -258,16 +259,18 @@ public class SpWarehouseOutServiceImpl extends ServiceImpl basicVOList = new ArrayList<>(); for (int i = 0; i < basicList.size(); i++) { WtSpBasicEntity spBasicEntity = basicService.getById(basicList.get(i).getSpBasicId()); - WtSpBasicVO spBasicVO = new WtSpBasicVO(); - spBasicVO.setId(spBasicEntity.getId()); - spBasicVO.setCode(spBasicEntity.getCode()); - spBasicVO.setName(spBasicEntity.getName()); - spBasicVO.setSpecifications(spBasicEntity.getSpecifications()); - spBasicVO.setUnit(spBasicEntity.getUnit()); - spBasicVO.setPrice(spBasicEntity.getPrice()); - spBasicVO.setStock(basicList.get(i).getAmount().longValue()); - spBasicVO.setCreateTime(spBasicEntity.getCreateTime()); - basicVOList.add(spBasicVO); + if (ObjectUtils.isNotEmpty(spBasicEntity)) { + WtSpBasicVO spBasicVO = new WtSpBasicVO(); + spBasicVO.setId(spBasicEntity.getId()); + spBasicVO.setCode(spBasicEntity.getCode()); + spBasicVO.setName(spBasicEntity.getName()); + spBasicVO.setSpecifications(spBasicEntity.getSpecifications()); + spBasicVO.setUnit(spBasicEntity.getUnit()); + spBasicVO.setPrice(spBasicEntity.getPrice()); + spBasicVO.setStock(basicList.get(i).getAmount().longValue()); + spBasicVO.setCreateTime(spBasicEntity.getCreateTime()); + basicVOList.add(spBasicVO); + } } spWarehouseOutVO.setBasicVOList(basicVOList); return spWarehouseOutVO;