Showing
4 changed files
with
33 additions
and
3 deletions
| @@ -282,18 +282,33 @@ public class PurchaseOrderLineServiceImpl extends BaseMpServiceImpl<PurchaseOrde | @@ -282,18 +282,33 @@ public class PurchaseOrderLineServiceImpl extends BaseMpServiceImpl<PurchaseOrde | ||
| 282 | } | 282 | } |
| 283 | 283 | ||
| 284 | @Override | 284 | @Override |
| 285 | - public List<PurchaseOrderLine> listByShipmentDate(List<LocalDate> shipmentDateList) { | 285 | + public List<PurchaseOrderLine> listByShipmentDate(List<LocalDate> shipmentDateList, boolean includeShipment) { |
| 286 | if (CollectionUtils.isEmpty(shipmentDateList)) { | 286 | if (CollectionUtils.isEmpty(shipmentDateList)) { |
| 287 | return Collections.emptyList(); | 287 | return Collections.emptyList(); |
| 288 | } | 288 | } |
| 289 | // 根据日期批量查询 | 289 | // 根据日期批量查询 |
| 290 | LambdaQueryWrapper<PurchaseOrderLine> queryWrapper = Wrappers.lambdaQuery(PurchaseOrderLine.class); | 290 | LambdaQueryWrapper<PurchaseOrderLine> queryWrapper = Wrappers.lambdaQuery(PurchaseOrderLine.class); |
| 291 | + if (!includeShipment) { | ||
| 292 | + queryWrapper.eq(PurchaseOrderLine::getShipment, Boolean.FALSE); | ||
| 293 | + } | ||
| 291 | queryWrapper.in(PurchaseOrderLine::getDeliveryDate, shipmentDateList); | 294 | queryWrapper.in(PurchaseOrderLine::getDeliveryDate, shipmentDateList); |
| 292 | 295 | ||
| 293 | return getBaseMapper().selectList(queryWrapper); | 296 | return getBaseMapper().selectList(queryWrapper); |
| 294 | } | 297 | } |
| 295 | 298 | ||
| 296 | @Override | 299 | @Override |
| 300 | + public void updateShipments(List<String> ids) { | ||
| 301 | + if (CollectionUtils.isEmpty(ids)) { | ||
| 302 | + return; | ||
| 303 | + } | ||
| 304 | + LambdaUpdateWrapper<PurchaseOrderLine> updateWrapper = Wrappers.lambdaUpdate(PurchaseOrderLine.class); | ||
| 305 | + updateWrapper.set(PurchaseOrderLine::getShipment, Boolean.TRUE); | ||
| 306 | + updateWrapper.in(PurchaseOrderLine::getId, ids); | ||
| 307 | + | ||
| 308 | + getBaseMapper().update(updateWrapper); | ||
| 309 | + } | ||
| 310 | + | ||
| 311 | + @Override | ||
| 297 | public void cleanCacheByKey(Serializable key) { | 312 | public void cleanCacheByKey(Serializable key) { |
| 298 | 313 | ||
| 299 | } | 314 | } |
| @@ -228,7 +228,7 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | @@ -228,7 +228,7 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | ||
| 228 | List<LocalDate> dateList = new ArrayList<>(); | 228 | List<LocalDate> dateList = new ArrayList<>(); |
| 229 | dateList.add(tomorrow); | 229 | dateList.add(tomorrow); |
| 230 | dateList.add(afTomorrow); | 230 | dateList.add(afTomorrow); |
| 231 | - List<PurchaseOrderLine> orderLineList = purchaseOrderLineService.listByShipmentDate(dateList); | 231 | + List<PurchaseOrderLine> orderLineList = purchaseOrderLineService.listByShipmentDate(dateList, false); |
| 232 | // 获取订货单数据 | 232 | // 获取订货单数据 |
| 233 | Map<String, PurchaseOrderInfo> orderInfoMap = new HashMap<>(); | 233 | Map<String, PurchaseOrderInfo> orderInfoMap = new HashMap<>(); |
| 234 | if (CollectionUtils.isNotEmpty(orderLineList)) { | 234 | if (CollectionUtils.isNotEmpty(orderLineList)) { |
| @@ -15,6 +15,7 @@ import com.lframework.starter.web.core.annotations.oplog.OpLog; | @@ -15,6 +15,7 @@ import com.lframework.starter.web.core.annotations.oplog.OpLog; | ||
| 15 | import com.lframework.starter.web.core.utils.PageHelperUtil; | 15 | import com.lframework.starter.web.core.utils.PageHelperUtil; |
| 16 | import com.lframework.starter.common.utils.Assert; | 16 | import com.lframework.starter.common.utils.Assert; |
| 17 | import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | 17 | import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; |
| 18 | +import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService; | ||
| 18 | import org.springframework.transaction.annotation.Transactional; | 19 | import org.springframework.transaction.annotation.Transactional; |
| 19 | import com.lframework.xingyun.sc.mappers.ShipmentsPlanMapper; | 20 | import com.lframework.xingyun.sc.mappers.ShipmentsPlanMapper; |
| 20 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; | 21 | import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; |
| @@ -23,6 +24,7 @@ import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; | @@ -23,6 +24,7 @@ import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanVo; | ||
| 23 | import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanVo; | 24 | import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanVo; |
| 24 | import org.springframework.stereotype.Service; | 25 | import org.springframework.stereotype.Service; |
| 25 | 26 | ||
| 27 | +import javax.annotation.Resource; | ||
| 26 | import java.util.List; | 28 | import java.util.List; |
| 27 | 29 | ||
| 28 | @Service | 30 | @Service |
| @@ -30,6 +32,8 @@ public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMap | @@ -30,6 +32,8 @@ public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMap | ||
| 30 | 32 | ||
| 31 | 33 | ||
| 32 | 34 | ||
| 35 | + @Resource | ||
| 36 | + private PurchaseOrderLineService orderLineService; | ||
| 33 | 37 | ||
| 34 | @Override | 38 | @Override |
| 35 | public PageResult<ShipmentsPlan> query(Integer pageIndex, Integer pageSize, QueryShipmentsPlanVo vo) { | 39 | public PageResult<ShipmentsPlan> query(Integer pageIndex, Integer pageSize, QueryShipmentsPlanVo vo) { |
| @@ -84,6 +88,9 @@ public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMap | @@ -84,6 +88,9 @@ public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMap | ||
| 84 | .eq(ShipmentsPlan::getId, vo.getId()); | 88 | .eq(ShipmentsPlan::getId, vo.getId()); |
| 85 | 89 | ||
| 86 | getBaseMapper().update(updateWrapper); | 90 | getBaseMapper().update(updateWrapper); |
| 91 | + if ("CHECK".equals(vo.getStatus())) { | ||
| 92 | + // 更新订货单规格发货状态 | ||
| 93 | + } | ||
| 87 | 94 | ||
| 88 | OpLogUtil.setVariable("id", data.getId()); | 95 | OpLogUtil.setVariable("id", data.getId()); |
| 89 | OpLogUtil.setExtra(vo); | 96 | OpLogUtil.setExtra(vo); |
| @@ -112,7 +112,15 @@ public interface PurchaseOrderLineService extends BaseMpService<PurchaseOrderLin | @@ -112,7 +112,15 @@ public interface PurchaseOrderLineService extends BaseMpService<PurchaseOrderLin | ||
| 112 | * 根据发货日期批量查询 | 112 | * 根据发货日期批量查询 |
| 113 | * | 113 | * |
| 114 | * @param shipmentDateList 发货日期 | 114 | * @param shipmentDateList 发货日期 |
| 115 | + * @param includeShipment 是否包含已发货数据 | ||
| 115 | * @return List<PurchaseOrderLine> | 116 | * @return List<PurchaseOrderLine> |
| 116 | */ | 117 | */ |
| 117 | - List<PurchaseOrderLine> listByShipmentDate(List<LocalDate> shipmentDateList); | 118 | + List<PurchaseOrderLine> listByShipmentDate(List<LocalDate> shipmentDateList, boolean includeShipment); |
| 119 | + | ||
| 120 | + /** | ||
| 121 | + * 更新发货状态 | ||
| 122 | + * | ||
| 123 | + * @param ids 主键ID | ||
| 124 | + */ | ||
| 125 | + void updateShipments(List<String> ids); | ||
| 118 | } | 126 | } |