| | |
| | | |
| | | // 获取单据 |
| | | Order order = orderService.selectByNo(orderNo); |
| | | if (order == null) { |
| | | int i = 30; |
| | | while (i >= 0) { |
| | | try { |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | order = orderService.selectByNo(orderNo); |
| | | if (order != null) { |
| | | break; |
| | | } |
| | | i--; |
| | | } |
| | | } |
| | | if (order == null) { |
| | | return R.parse("单据不存在:" + orderNo); |
| | | } |
| | | // 获取单据明细 |
| | | List<OrderDetl> orderDetlList = orderDetlService.selectByOrderId(order.getId()); |
| | | |
| | |
| | | } |
| | | return R.ok("出库成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | @Override |
| | | @Transactional |
| | | public void syncMat(MatSyncParam param) { |
| | | if (Cools.isEmpty(param.getMatDetails()) || param.getMatDetails().size() <=0 ) { |
| | | if (Cools.isEmpty(param.getMatDetails()) || param.getMatDetails().size() <= 0) { |
| | | throw new CoolException("商品数据为空"); |
| | | } |
| | | |
| | | for(MatSyncParam.MatParam matParam : param.getMatDetails()){ |
| | | if(Cools.isEmpty(matParam.getMatnr())){ |
| | | for (MatSyncParam.MatParam matParam : param.getMatDetails()) { |
| | | if (Cools.isEmpty(matParam.getMatnr())) { |
| | | throw new CoolException("商品编码不能为空"); |
| | | } |
| | | |
| | |
| | | } |
| | | } else { |
| | | mat.sync(param); |
| | | if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr",matParam.getMatnr()))) { |
| | | if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr", matParam.getMatnr()))) { |
| | | throw new CoolException("更新已存在商品信息失败,请联系管理员"); |
| | | } |
| | | } |