Browse Source

fix: 入库单详情报错问题

zhongwei
liwen 3 months ago
parent
commit
deaf61a2a8
  1. 23
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java

23
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<SpWarehouseOutMapper,
List<WtSpBasicVO> 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;

Loading…
Cancel
Save