diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java index b4146ce..24f2bde 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java @@ -6,6 +6,7 @@ import java.util.UUID; import com.bonus.canteen.core.alloc.domain.AllocCanteen; import com.bonus.canteen.core.alloc.mapper.AllocCanteenMapper; +import com.bonus.canteen.core.utils.BnsConstants; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.houqin.constant.GlobalConstants; @@ -55,6 +56,7 @@ public class AllocCanteenServiceImpl implements IAllocCanteenService { @Override public int insertAllocCanteen(AllocCanteen allocCanteen) { allocCanteen.setCreateTime(DateUtils.getNowDate()); + allocCanteen.setIfReserve(BnsConstants.COMMON_YES); //默认开启预订餐 try { return allocCanteenMapper.insertAllocCanteen(allocCanteen); } catch (Exception e) { diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocStallServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocStallServiceImpl.java index a1c930c..cc78a85 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocStallServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocStallServiceImpl.java @@ -6,6 +6,7 @@ import com.bonus.canteen.core.alloc.domain.AllocStall; import com.bonus.canteen.core.alloc.domain.AllocStallMealtime; import com.bonus.canteen.core.alloc.mapper.AllocStallMapper; import com.bonus.canteen.core.alloc.service.IAllocStallService; +import com.bonus.canteen.core.utils.BnsConstants; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -57,11 +58,14 @@ public class AllocStallServiceImpl implements IAllocStallService { @Override public int insertAllocStall(AllocStall allocStall) { allocStall.setCreateTime(DateUtils.getNowDate()); + allocStall.setIfReserve(BnsConstants.COMMON_YES); //默认开启预订餐 try { int stallCount = allocStallMapper.insertAllocStall(allocStall); if (stallCount > 0 && !CollectionUtils.isEmpty(allocStall.getAllocStallMealtimeList())) { allocStallMapper.deleteMealtimeByStallId(allocStall.getStallId()); - allocStallMapper.insertAllocStallMealtime(allocStall.getAllocStallMealtimeList()); + List mealtimes = allocStall.getAllocStallMealtimeList(); + mealtimes.stream().forEach(o -> o.setStallId(allocStall.getStallId())); + allocStallMapper.insertAllocStallMealtime(mealtimes); } return stallCount; } catch (Exception e) {