diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java index 5ed014c..0fbabb6 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java @@ -4,13 +4,13 @@ import java.math.BigDecimal; import java.util.List; import cn.hutool.core.collection.CollUtil; -import com.bonus.canteen.core.ims.domain.ImsIntoInventoryDetail; -import com.bonus.canteen.core.ims.domain.ImsInventory; +import com.bonus.canteen.core.ims.domain.*; import com.bonus.canteen.core.ims.domain.param.*; import com.bonus.canteen.core.ims.domain.vo.ImsIntoInventoryVO; import com.bonus.canteen.core.ims.domain.vo.ImsOutInventoryDetailVO; import com.bonus.canteen.core.ims.domain.vo.ImsOutInventoryVO; import com.bonus.canteen.core.ims.mapper.ImsIntoInventoryMapper; +import com.bonus.canteen.core.ims.service.IFetchMaterialService; import com.bonus.canteen.core.ims.service.IImsInventoryService; import com.bonus.canteen.core.ims.utils.NoGenerateUtils; import com.bonus.canteen.core.kitchen.domain.constants.CommonFlagEnum; @@ -26,9 +26,7 @@ import java.util.Objects; import com.bonus.common.core.utils.StringUtils; import org.springframework.transaction.annotation.Transactional; -import com.bonus.canteen.core.ims.domain.ImsOutInventoryDetail; import com.bonus.canteen.core.ims.mapper.ImsOutInventoryMapper; -import com.bonus.canteen.core.ims.domain.ImsOutInventory; import com.bonus.canteen.core.ims.service.IImsOutInventoryService; /** @@ -46,6 +44,8 @@ public class ImsOutInventoryServiceImpl implements IImsOutInventoryService private IImsInventoryService imsInventoryService; @Autowired private ImsIntoInventoryMapper imsIntoInventoryMapper; + @Autowired + private IFetchMaterialService fetchMaterialService; /** * 查询出库记录 @@ -268,6 +268,7 @@ public class ImsOutInventoryServiceImpl implements IImsOutInventoryService } totalPriceSum += totalPrice; } + updateFetchMaterialOrderStatus(imsOutInventory); } } if (list.size() > 0) @@ -280,4 +281,17 @@ public class ImsOutInventoryServiceImpl implements IImsOutInventoryService } } } + + private void updateFetchMaterialOrderStatus(ImsOutInventory imsOutInventory) { + if(Objects.nonNull(imsOutInventory.getFetchMaterialId())) { + try { + FetchMaterial fetchMaterialUpdate = new FetchMaterial(); + fetchMaterialUpdate.setFetchMaterialId(Long.valueOf(imsOutInventory.getFetchMaterialId())); + fetchMaterialUpdate.setFetchStatus(1L); // 已领 + fetchMaterialService.updateFetchMaterial(fetchMaterialUpdate); + }catch (Exception e) { + throw new ServiceException("修改领料单状态失败"); + } + } + } }