| | |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | /** |
| | | * 平庫上架 |
| | | * |
| | | * @param locNo |
| | | * @param barcode |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 平庫下架 |
| | | * |
| | | * @param combParam |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 多次并板 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | |
| | | return R.ok().add(wrkMastArrayList); |
| | | } |
| | | |
| | | @PostMapping("/pda/OutLocNo") |
| | | @ManagerAuth(memo = "获得平库出库的对应库位号") |
| | | @Transactional |
| | | public R OutLocNo(@RequestParam Long orderId) { |
| | | List<OrderDetl> orderDetls = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>() |
| | | .eq(OrderDetl::getOrderId, orderId) |
| | | .eq(OrderDetl::getHostId, getHostId()) |
| | | ); |
| | | if (Cools.isEmpty(orderDetls)) { |
| | | return R.error("订单明细不存在"); |
| | | } |
| | | List<String> list = new ArrayList<>(); |
| | | for (OrderDetl o : orderDetls |
| | | ) { |
| | | if (o.getAnfme() <= o.getWorkQty()) { |
| | | continue; |
| | | } else { |
| | | //查看库位明细中有的物料 |
| | | List<LocDetl> locDetls = locDetlService.list(new LambdaQueryWrapper<LocDetl>() |
| | | .eq(LocDetl::getMatnr, o.getMatnr()).eq(LocDetl::getHostId, getHostId()) |
| | | ); |
| | | if (Cools.isEmpty(locDetls)) { |
| | | continue; |
| | | } else { |
| | | for (LocDetl l : locDetls |
| | | ) { |
| | | String s = l.getLocNo().substring(1, 2); |
| | | if (Integer.valueOf(s) > 4) { |
| | | list.add(l.getLocNo()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | List<String> myList = list.stream().distinct().collect(Collectors.toList()); |
| | | return R.ok(myList); |
| | | } |
| | | |
| | | @PostMapping("/pda/OrderDetlContrastLocDetl") |
| | | @ManagerAuth(memo = "获得订单明细对应的库存明细") |
| | | @Transactional |
| | | public R OrderDetlContrastLocDetl(@RequestParam Long orderId, @RequestParam String locNo) { |
| | | List<LocDetl> locDetlList = new ArrayList<LocDetl>(); |
| | | List<OrderDetl> orderDetls = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>() |
| | | .eq(OrderDetl::getOrderId, orderId) |
| | | .eq(OrderDetl::getHostId, getHostId()) |
| | | ); |
| | | if (Cools.isEmpty(orderDetls)) { |
| | | return R.error("订单明细不存在"); |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.list(new LambdaQueryWrapper<LocDetl>() |
| | | .eq(LocDetl::getLocNo, locNo)); |
| | | if (Cools.isEmpty(locDetls)) { |
| | | return R.error("库位为空"); |
| | | } |
| | | for (OrderDetl o : orderDetls |
| | | ) { |
| | | for (LocDetl l : locDetls |
| | | ) { |
| | | if (o.getMatnr().equals(l.getMatnr())) { |
| | | if (o.getAnfme() - o.getWorkQty() >= l.getAnfme()) { |
| | | |
| | | } else { |
| | | l.setAnfme(o.getAnfme() - o.getWorkQty()); |
| | | } |
| | | locDetlList.add(l); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return R.ok(locDetlList); |
| | | } |
| | | |
| | | } |