| | |
| | | import com.zy.asrs.entity.result.MobileAdjustResult; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.MatServiceImpl; |
| | | import com.zy.common.model.WrkDto; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import com.zy.third.entity.ExdMaterial; |
| | | import com.zy.third.entity.ExdvYanbu; |
| | | import com.zy.third.mapper.ExdMaterialMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Autowired |
| | | private ExdMaterialMapper exdMaterialMapper; |
| | | @Autowired |
| | | private MatServiceImpl matService; |
| | | |
| | | // 商品上架 |
| | | @RequestMapping("/mat/onSale/auth") |
| | |
| | | if (docType.getPakin() == null || docType.getPakin() != 1) { |
| | | return R.ok(); |
| | | } |
| | | if (order.getSettle() > 2) { |
| | | return R.ok(); |
| | | } |
| | | |
| | | List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId()); |
| | | if (Cools.isEmpty(orderDetls)) { |
| | | return R.ok(); |
| | | } |
| | | return R.ok().add(orderDetls); |
| | | List<OrderDetl> orderDetls1= new ArrayList<>(); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | if(orderDetl.getAnfme()-orderDetl.getWorkQty()>0){ |
| | | orderDetls1.add(orderDetl); |
| | | } |
| | | |
| | | } |
| | | return R.ok().add(orderDetls1); |
| | | } |
| | | |
| | | @RequestMapping("/comb/auth") |
| | | @ManagerAuth(memo = "组托") |
| | | public R comb(@RequestBody CombParam combParam) { |
| | | log.info("组托数据:{}", combParam.toString()); |
| | | mobileService.comb(combParam, getUserId(), getUser().getEmail()); |
| | | return R.ok("组托成功"); |
| | | } |
| | |
| | | } |
| | | //空托盘缓冲区 小:E8 大:E9 |
| | | String rStaNo = "E8"; |
| | | if (barcode.substring(0, 1).equals("9")) { |
| | | String rStaNo ="E8"; |
| | | String type ="ZONE"; //区域 |
| | | if(barcode.substring(0,1).equals("9")){ |
| | | rStaNo = "E9"; |
| | | } |
| | | String type = "ZONE"; //区域 |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "autoE").eq("status", "1")); |
| | | if (config != null) { |
| | | type = "STACK"; //巷道 |
| | | if (Cools.isEmpty(config.getValue())) { |
| | | rStaNo = rStaNo + "01"; |
| | | config.setValue("2"); |
| | | } else if (config.getValue().equals("1")) { |
| | | rStaNo = rStaNo + "01"; |
| | | config.setValue("2"); |
| | | } else if (config.getValue().equals("2")) { |
| | | rStaNo = rStaNo + "02"; |
| | | config.setValue("3"); |
| | | } else if (config.getValue().equals("3")) { |
| | | rStaNo = rStaNo + "03"; |
| | | config.setValue("1"); |
| | | } |
| | | configService.updateById(config); |
| | | }else{ |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "autoE").eq("status", "1")); |
| | | |
| | | if (config != null) { |
| | | type ="STACK"; //巷道 |
| | | if (Cools.isEmpty(config.getValue())) { |
| | | rStaNo = rStaNo + "01"; |
| | | config.setValue("2"); |
| | | }else if (config.getValue().equals("1")) { |
| | | rStaNo = rStaNo + "01"; |
| | | config.setValue("2"); |
| | | }else if (config.getValue().equals("2")) { |
| | | rStaNo = rStaNo + "02"; |
| | | config.setValue("3"); |
| | | }else if (config.getValue().equals("3")) { |
| | | rStaNo = rStaNo + "03"; |
| | | config.setValue("1"); |
| | | String type = "ZONE"; //区域 |
| | | if (barcode.substring(0, 1).equals("9")) { |
| | | rStaNo = "E9"; |
| | | }else { |
| | | if (config != null) { |
| | | type = "STACK"; //巷道 |
| | | if (Cools.isEmpty(config.getValue())) { |
| | | rStaNo = rStaNo + "01"; |
| | | config.setValue("2"); |
| | | } else if (config.getValue().equals("1")) { |
| | | rStaNo = rStaNo + "01"; |
| | | config.setValue("2"); |
| | | } else if (config.getValue().equals("2")) { |
| | | rStaNo = rStaNo + "02"; |
| | | config.setValue("3"); |
| | | } else if (config.getValue().equals("3")) { |
| | | rStaNo = rStaNo + "03"; |
| | | config.setValue("1"); |
| | | } |
| | | configService.updateById(config); |
| | | } |
| | | configService.updateById(config); |
| | | } |
| | | } |
| | | |
| | | LinkedHashMap<String, Object> rcsParam = new LinkedHashMap<>(); |
| | | rcsParam.put("taskType", "PF-FMR-COMMON"); |
| | | List<LinkedHashMap<String, Object>> targetRoutes = new ArrayList<>(); |
| | | LinkedHashMap<String, Object> t1 = new LinkedHashMap<>(); |
| | | LinkedHashMap<String, Object> t2 = new LinkedHashMap<>(); |
| | | t1.put("seq", 0); |
| | | t1.put("type", "SITE"); |
| | | t1.put("code", sourceStaNo); |
| | | t1.put("autoStart", 0); |
| | | t1.put("operation", "COLLECT"); |
| | | LinkedHashMap<String, Object> rcsParam = new LinkedHashMap<>(); |
| | | rcsParam.put("taskType", "PF-FMR-COMMON"); |
| | | List<LinkedHashMap<String, Object>> targetRoutes = new ArrayList<>(); |
| | | LinkedHashMap<String, Object> t1 = new LinkedHashMap<>(); |
| | | LinkedHashMap<String, Object> t2 = new LinkedHashMap<>(); |
| | | t1.put("seq", 0); |
| | | t1.put("type", "SITE"); |
| | | t1.put("code", sourceStaNo); |
| | | t1.put("autoStart", 0); |
| | | t1.put("operation", "COLLECT"); |
| | | |
| | | t2.put("seq", 0); |
| | | t2.put("type", type); |
| | | t2.put("code", rStaNo); |
| | | t2.put("autoStart", 0); |
| | | t2.put("operation", "DELIVERY"); |
| | | t2.put("seq", 0); |
| | | t2.put("type", type); |
| | | t2.put("code", rStaNo); |
| | | t2.put("autoStart", 0); |
| | | t2.put("operation", "DELIVERY"); |
| | | |
| | | targetRoutes.add(t1); |
| | | targetRoutes.add(t2); |
| | | rcsParam.put("targetRoute", targetRoutes); |
| | | rcsParam.put("initPriority", 100); |
| | | targetRoutes.add(t1); |
| | | targetRoutes.add(t2); |
| | | rcsParam.put("targetRoute", targetRoutes); |
| | | rcsParam.put("initPriority", 100); |
| | | |
| | | |
| | | String response = ""; |
| | | Boolean bool = false; |
| | | String msg = ""; |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | Date date = new Date(); |
| | | String time = date.getTime() + ""; |
| | | String response = ""; |
| | | Boolean bool = false; |
| | | String msg = ""; |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | Date date = new Date(); |
| | | String time = date.getTime() + ""; |
| | | |
| | | map.put("X-LR-REQUEST-ID", time); |
| | | try { |
| | | log.info("wms派发搬运任务给AGV搬运={}", rcsParam); |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(map) |
| | | .setUri(url) |
| | | .setHttps(true) |
| | | .setPath(attrcs) |
| | | .setJson(JSON.toJSONString(rcsParam)) |
| | | .build() |
| | | .doPostCloseSSL(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getString("code").equals("SUCCESS")) { |
| | | bool = true; |
| | | map.put("X-LR-REQUEST-ID", time); |
| | | try { |
| | | log.info("wms派发搬运任务给AGV搬运={}", rcsParam); |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(map) |
| | | .setUri(url) |
| | | .setHttps(true) |
| | | .setPath(attrcs) |
| | | .setJson(JSON.toJSONString(rcsParam)) |
| | | .build() |
| | | .doPostCloseSSL(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getString("code").equals("SUCCESS")) { |
| | | bool = true; |
| | | } else { |
| | | msg = jsonObject.getString("message"); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("wms派发搬运任务给AGV搬运失败返回值={}", response); |
| | | } finally { |
| | | apiLogService.save("wms派发搬运任务给AGV搬运" |
| | | , url + attrcs |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(rcsParam) |
| | | , response |
| | | , bool |
| | | ); |
| | | } |
| | | |
| | | if (bool) { |
| | | return R.ok(); |
| | | } else { |
| | | msg = jsonObject.getString("message"); |
| | | return R.error(msg); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("wms派发搬运任务给AGV搬运失败返回值={}", response); |
| | | } finally { |
| | | apiLogService.save("wms派发搬运任务给AGV搬运" |
| | | , url + attrcs |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(rcsParam) |
| | | , response |
| | | , bool |
| | | ); |
| | | } |
| | | |
| | | if (bool) { |
| | | return R.ok(); |
| | | } else { |
| | | return R.error(msg); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 执行移库任务--点到点 |
| | |
| | | |
| | | } else if (sourceStaNo.equals("R02")) { |
| | | rcsParam.put("carrierDir", "90"); |
| | | } else { |
| | | } else if(sourceStaNo.substring(0,1).equals("C")){ |
| | | rcsParam.put("carrierDir", "90"); |
| | | } |
| | | else{ |
| | | rcsParam.put("carrierDir", "180"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | R r = R.ok(); |
| | | //防止有未下架的物料直接进行空板回库或者拣料回库 |
| | | WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", staNo).in("wrk_sts", 33)); |
| | | if (!Cools.isEmpty(wrkMast1)) { |
| | | return R.error("该托盘="+wrkMast1.getBarcode()+",没有下架,请下架后再回库!!!"); |
| | | } |
| | | |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", staNo).in("io_type", 103, 105, 107)); |
| | | if (wrkMast == null) { |
| | | r = FillEmptyPalletsStack(sourceStaNo, staNo); |
| | | } else { |
| | | if (wrkMast.getWrkSts() > 30) { |
| | | return R.error("该托盘={},没有下架,请下架后再回库!!!"); |
| | | if (wrkMast.getWrkSts() > 30&& 34< wrkMast.getWrkSts()) { |
| | | return R.error("该托盘="+wrkMast.getBarcode()+",没有下架,请下架后再回库!!!"); |
| | | } |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("sta_no", wrkMast.getStaNo()).in("io_type", 101, 103, 105, 107).lt("wrk_sts", 33)); |
| | | if (!Cools.isEmpty(wrkMasts)) { |
| | |
| | | if (barcode1 == null) { |
| | | return R.error("批次对应的验布数据不存在"); |
| | | } |
| | | return R.ok(barcode1); |
| | | Mat mat = matService.selectByMatnr(barcode1.getItemnumber()); |
| | | if(Cools.isEmpty(mat.getUuid())) { |
| | | ExdMaterial fnumber = exdMaterialMapper.getID(barcode1.getItemnumber()); |
| | | mat.setUuid(fnumber.getId()); |
| | | } |
| | | mat.setAnfme(barcode1.getQty()); |
| | | mat.setBc(barcode); |
| | | mat.setBatch(barcode); |
| | | matService.updateById(mat); |
| | | |
| | | return R.ok(mat); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getOrderNo/auth") |