From deaf61a2a888f8885eab37555ed517ca689a6f04 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 3 Sep 2024 22:58:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=A5=E5=BA=93=E5=8D=95=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SpWarehouseOutServiceImpl.java | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) 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;