| | |
| | | package zy.cloud.wms.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import zy.cloud.wms.manager.entity.Order; |
| | | import zy.cloud.wms.manager.entity.Pickout; |
| | | import zy.cloud.wms.manager.entity.Wave; |
| | | import zy.cloud.wms.manager.mapper.OrderDetlMapper; |
| | | import zy.cloud.wms.manager.entity.OrderDetl; |
| | | import zy.cloud.wms.manager.service.OrderDetlService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import zy.cloud.wms.manager.service.OrderService; |
| | | import zy.cloud.wms.manager.service.PickoutService; |
| | | import zy.cloud.wms.manager.service.WaveService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("orderDetlService") |
| | | public class OrderDetlServiceImpl extends ServiceImpl<OrderDetlMapper, OrderDetl> implements OrderDetlService { |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private WaveService waveService; |
| | | @Autowired |
| | | private PickoutService pickoutService; |
| | | |
| | | @Override |
| | | public List<OrderDetl> selectByOrderNo(String orderNo, Long hostId) { |
| | |
| | | public List<OrderDetl> selectBatchByOrderNo(List<Order> orders) { |
| | | return this.baseMapper.selectBatchByOrderNo(orders); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderDetl> selectOutList(String matnr, ArrayList<String> strings) { |
| | | return this.baseMapper.selectOutList(matnr,strings); |
| | | } |
| | | |
| | | /** |
| | | * 通过orderid来查询所有orderDetl |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean checkFinish(Long id) { |
| | | List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>() |
| | | .eq("order_id", id)); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | if (orderDetl.getAnfme() - orderDetl.getOutQty() != 0 ){ |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public void finishOrder(Long id) { |
| | | /** |
| | | * 更改order状态 |
| | | */ |
| | | Order order = orderService.selectOne(new EntityWrapper<Order>() |
| | | .eq("id", id)); |
| | | order.setSettle(5L); |
| | | orderService.update(order,new EntityWrapper<Order>() |
| | | .eq("id", id)); |
| | | /** |
| | | * 更改波次状态 |
| | | */ |
| | | Wave wave = waveService.selectOne(new EntityWrapper<Wave>() |
| | | .eq("wave_no", order.getWaveNo())); |
| | | wave.setStatus((short) 2); |
| | | waveService.update(wave,new EntityWrapper<Wave>() |
| | | .eq("wave_no", order.getWaveNo())); |
| | | |
| | | /** |
| | | * 更改拣货单状态 |
| | | */ |
| | | Pickout pickout = pickoutService.selectOne(new EntityWrapper<Pickout>() |
| | | .eq("wave_no", wave.getWaveNo())); |
| | | pickout.setWrkSts(3L); |
| | | pickoutService.update(pickout,new EntityWrapper<Pickout>() |
| | | .eq("wave_no", wave.getWaveNo())); |
| | | |
| | | } |
| | | } |