| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.AgvBasDevp; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.LocMastInitParam; |
| | | import com.zy.asrs.service.AgvBasDevpService; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | AgvBasDevpService agvBasDevpService; |
| | | @Autowired |
| | | AgvWrkMastService agvWrkMastService; |
| | | @Autowired |
| | | AgvWrkDetlService agvWrkDetlService; |
| | | @Autowired |
| | | AgvWaitPakinService agvWaitPakinService; |
| | | @Autowired |
| | | AgvWorkService agvWorkService; |
| | | |
| | | @RequestMapping(value = "/basDevp/list/auth") |
| | | @ManagerAuth |
| | |
| | | } |
| | | agvBasDevp.setLocSts("O"); |
| | | agvBasDevp.setBarcode(""); |
| | | agvBasDevp.setLocType2(null); |
| | | agvBasDevpService.update(agvBasDevp,new EntityWrapper<AgvBasDevp>().eq("dev_no",agvBasDevp.getDevNo())); |
| | | |
| | | return R.ok(); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /* |
| | | 站点明细 |
| | | */ |
| | | @RequestMapping(value = "/basDevp/detail/list/auth") |
| | | public R basDevpDetailList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | String devNo = param.get("devNo").toString(); |
| | | AgvBasDevp agvBasDevp = agvBasDevpService.selectById(devNo); |
| | | if("F".equals(agvBasDevp.getLocSts()) || "R".equals(agvBasDevp.getLocSts())){ |
| | | //先去入库通知档找明细 |
| | | Page<AgvWaitPakin> agvWaitPakinPage = agvWaitPakinService.selectPage(new Page<>(curr, limit), new EntityWrapper<AgvWaitPakin>() |
| | | .eq("supp_code", agvBasDevp.getBarcode())); |
| | | if(agvWaitPakinPage.getRecords().size()>0){ |
| | | return R.ok(agvWaitPakinPage); |
| | | }else { |
| | | //如果入库通档明细为空,则去工作档找明细 |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>() |
| | | .eq("loc_no", agvBasDevp.getDevNo()) |
| | | .or().eq("source_loc_no",agvBasDevp.getDevNo())); |
| | | |
| | | Page<AgvWrkDetl> agvWrkDetlPage = agvWrkDetlService.selectPage(new Page<>(curr, limit), new EntityWrapper<AgvWrkDetl>() |
| | | .eq("wrk_no", agvWrkMast.getWrkNo())); |
| | | |
| | | if(agvWrkDetlPage.getRecords().size()>0){ |
| | | return R.ok(agvWrkDetlPage); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDevp/visualized/list/auth") |
| | | public R visualizedList(@RequestBody JSONObject param){ |
| | | |
| | | String stationCode = param.get("stationCode").toString(); |
| | | |
| | | Map<String, Object> result = agvBasDevpService.getAgvBasDevpDtoByStationCode(stationCode); |
| | | |
| | | return R.ok(result); |
| | | } |
| | | @RequestMapping(value = "/basDevp/visualized/list/auth/v2") |
| | | public R visualizedList(@RequestParam String stationCode){ |
| | | |
| | | Map<String, Object> result = agvBasDevpService.getAgvBasDevpDtoByStationCode(stationCode); |
| | | |
| | | return R.ok(result); |
| | | } |
| | | /* |
| | | 任务完成 |
| | | */ |
| | | @RequestMapping(value = "/basDevp/visualized/container/moveOut") |
| | | public R visualiZedContainerMoveOut(@RequestBody Map<String,Object> map) { |
| | | |
| | | String barcode = map.get("barcode").toString(); |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", barcode).eq("wrk_sts",205L)); |
| | | if(agvWrkMast.getIoType() != 101 && agvWrkMast.getIoType() != 110){ |
| | | throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型不为101.出库,无法执行容器离场任务,请重新选择站点。"); |
| | | } |
| | | |
| | | agvWrkMast.setWrkSts(206L); |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | |
| | | return R.ok("容器离场成功"); |
| | | } |
| | | |
| | | /* |
| | | 拣料/盘点入库 |
| | | */ |
| | | @RequestMapping(value = "/basDevp/visualized/container/pickIn") |
| | | public R visualiZedPickIn(@RequestBody Map<String,Object> map){ |
| | | List<AgvWrkMast> agvWrkMastList = new ArrayList<>(); |
| | | String devNo = map.get("devNo").toString(); |
| | | String barcode = map.get("barcode").toString(); |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", barcode).eq("wrk_sts",205L)); |
| | | if (agvWrkMast != null) { |
| | | if(agvWrkMast.getIoType() == 101){ |
| | | throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型为101.出库,无法执行拣料入库任务,请重新选择站点。"); |
| | | } |
| | | agvWrkMast.setLocNo(devNo); |
| | | agvWrkMastList.add(agvWrkMast); |
| | | } |
| | | |
| | | agvWorkService.pickIn(agvWrkMastList); |
| | | |
| | | return R.ok("生成拣料出库任务成功"); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |