| | |
| | | |
| | | @RequestMapping(value = "/basDevp/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | public R list(@RequestParam(defaultValue = "1") Integer curr, |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(required = false) String orderByField, |
| | | @RequestParam(required = false) String orderByType, |
| | | @RequestParam Map<String, Object> param) { |
| | | excludeTrash(param); |
| | | EntityWrapper<AgvBasDevp> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | return R.ok(agvBasDevpService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<AgvBasDevp> wrapper = new EntityWrapper<AgvBasDevp>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != agvBasDevpService.selectOne(wrapper)){ |
| | | if (null != agvBasDevpService.selectOne(wrapper)) { |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasDevp.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | @RequestMapping(value = "/basDevp/update/auth") |
| | | @ManagerAuth(memo = "站点修改") |
| | | public R update(AgvBasDevp basDevp){ |
| | | if (Cools.isEmpty(basDevp) || null==basDevp.getDevNo()){ |
| | | public R update(AgvBasDevp basDevp) { |
| | | if (Cools.isEmpty(basDevp) || null == basDevp.getDevNo()) { |
| | | return R.error("参数缺失"); |
| | | } |
| | | basDevp.setModiUser(getUserId()); |
| | |
| | | |
| | | @RequestMapping(value = "/basDevp/delete/auth") |
| | | @ManagerAuth(memo = "站点删除") |
| | | public R delete(@RequestParam String param){ |
| | | public R delete(@RequestParam String param) { |
| | | List<AgvBasDevp> list = JSONArray.parseArray(param, AgvBasDevp.class); |
| | | if (Cools.isEmpty(list)){ |
| | | if (Cools.isEmpty(list)) { |
| | | return R.error("参数缺失"); |
| | | } |
| | | for (AgvBasDevp entity : list){ |
| | | for (AgvBasDevp entity : list) { |
| | | agvBasDevpService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | @RequestMapping(value = "/basDevp/unbind/auth") |
| | | @ManagerAuth(memo = "站点解绑") |
| | | public R unbind(@RequestParam String param){ |
| | | AgvBasDevp agvBasDevp = JSONArray.parseObject(param,AgvBasDevp.class); |
| | | if (agvBasDevp==null){ |
| | | public R unbind(@RequestParam String param) { |
| | | AgvBasDevp agvBasDevp = JSONArray.parseObject(param, AgvBasDevp.class); |
| | | if (agvBasDevp == null) { |
| | | return R.error("参数缺失"); |
| | | } |
| | | //若当前站点货位状态不为F.在库状态,则返回错误 |
| | | if(!agvBasDevp.getLocSts().equals("F")){ |
| | | if (!agvBasDevp.getLocSts().equals("F")) { |
| | | return R.error("当前站点货位状态不为在库,无法解除绑定"); |
| | | } |
| | | agvBasDevp.setLocSts("O"); |
| | | agvBasDevp.setBarcode(""); |
| | | agvBasDevp.setLocType2(null); |
| | | agvBasDevpService.update(agvBasDevp,new EntityWrapper<AgvBasDevp>().eq("dev_no",agvBasDevp.getDevNo())); |
| | | agvBasDevpService.update(agvBasDevp, new EntityWrapper<AgvBasDevp>().eq("dev_no", agvBasDevp.getDevNo())); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDevp/export/auth") |
| | | @ManagerAuth(memo = "站点导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | public R export(@RequestBody JSONObject param) { |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<AgvBasDevp> wrapper = new EntityWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basDevp")); |
| | |
| | | wrapper.like("dev_no", condition); |
| | | Page<AgvBasDevp> page = agvBasDevpService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (AgvBasDevp basDevp : page.getRecords()){ |
| | | for (AgvBasDevp basDevp : page.getRecords()) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", basDevp.getDevNo()); |
| | | map.put("value", basDevp.getDevNo()); |
| | |
| | | 站点明细 |
| | | */ |
| | | @RequestMapping(value = "/basDevp/detail/list/auth") |
| | | public R basDevpDetailList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | public R basDevpDetailList(@RequestParam(defaultValue = "1") Integer curr, |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam Map<String, Object> param) { |
| | | String devNo = param.get("devNo").toString(); |
| | | if (Cools.isEmpty(devNo) || !CodeDetectionUtil.carCodeDetection(devNo)){ |
| | | if (Cools.isEmpty(devNo) || !CodeDetectionUtil.carCodeDetection(devNo)) { |
| | | throw new CoolException(devNo + "小车地码有误,请正确扫码!!!"); |
| | | } |
| | | AgvBasDevp agvBasDevp = agvBasDevpService.selectById(devNo); |
| | | if("F".equals(agvBasDevp.getLocSts()) || "R".equals(agvBasDevp.getLocSts())){ |
| | | 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){ |
| | | if (agvWaitPakinPage.getRecords().size() > 0) { |
| | | return R.ok(agvWaitPakinPage); |
| | | }else { |
| | | } else { |
| | | //如果入库通档明细为空,则去工作档找明细 |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>() |
| | | .eq("loc_no", agvBasDevp.getDevNo()) |
| | | .or().eq("source_loc_no",agvBasDevp.getDevNo())); |
| | | .or().eq("source_loc_no", agvBasDevp.getDevNo())); |
| | | if (Cools.isEmpty(agvWrkMast)) { |
| | | Page<AgvLocDetl> agvLocDetlPage = agvLocDetlService.selectPage(new Page<>(curr, limit), new EntityWrapper<AgvLocDetl>() |
| | | .eq("supp_code", agvBasDevp.getBarcode())); |
| | |
| | | Page<AgvWrkDetl> agvWrkDetlPage = agvWrkDetlService.selectPage(new Page<>(curr, limit), new EntityWrapper<AgvWrkDetl>() |
| | | .eq("wrk_no", agvWrkMast.getWrkNo())); |
| | | |
| | | if(agvWrkDetlPage.getRecords().size()>0){ |
| | | if (agvWrkDetlPage.getRecords().size() > 0) { |
| | | return R.ok(agvWrkDetlPage); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDevp/visualized/list/auth") |
| | | public R visualizedList(@RequestBody JSONObject param){ |
| | | public R visualizedList(@RequestBody JSONObject param) { |
| | | |
| | | String stationCode = param.get("stationCode").toString(); |
| | | |
| | |
| | | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDevp/visualized/list/auth/v2") |
| | | public R visualizedList(@RequestParam String stationCode){ |
| | | public R visualizedList(@RequestParam String stationCode) { |
| | | |
| | | Map<String, Object> result = agvBasDevpService.getAgvBasDevpDtoByStationCode(stationCode); |
| | | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | /* |
| | | 任务完成 |
| | | */ |
| | | @RequestMapping(value = "/basDevp/visualized/container/moveOut") |
| | | @ManagerAuth(memo = "确认出库") |
| | | public R visualiZedContainerMoveOut(@RequestBody Map<String,Object> map) { |
| | | 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 == null){ |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", barcode).eq("wrk_sts", 205L)); |
| | | if (agvWrkMast == null) { |
| | | R.error("工作档不存在"); |
| | | } |
| | | if(agvWrkMast.getIoType() != 101 && agvWrkMast.getIoType() != 110){ |
| | | if (agvWrkMast.getIoType() != 101 && agvWrkMast.getIoType() != 110) { |
| | | throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型不为101.出库,无法执行货架离场任务,请重新选择站点。"); |
| | | } |
| | | |
| | |
| | | */ |
| | | @RequestMapping(value = "/basDevp/visualized/container/moveOut2") |
| | | @ManagerAuth(memo = "确认出库2") |
| | | public R visualiZedContainerMoveOut2(@RequestBody Map<String,Object> map) { |
| | | public R visualiZedContainerMoveOut2(@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 == null){ |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", barcode).eq("wrk_sts", 205L)); |
| | | if (agvWrkMast == null) { |
| | | return R.error("工作档不存在"); |
| | | } |
| | | if(agvWrkMast.getIoType() != 101 && agvWrkMast.getIoType() != 110){ |
| | | if (agvWrkMast.getIoType() != 101 && agvWrkMast.getIoType() != 110) { |
| | | throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型不为101.出库,无法执行货架离场任务,请重新选择站点。"); |
| | | } |
| | | |
| | |
| | | */ |
| | | @RequestMapping(value = "/basDevp/visualized/container/pickIn") |
| | | @ManagerAuth(memo = "已拣料回库") |
| | | public R visualiZedPickIn(@RequestBody Map<String,Object> map){ |
| | | public R visualiZedPickIn(@RequestBody Map<String, Object> map) { |
| | | if (Cools.isEmpty(map.get("devNo"))) { |
| | | return R.error("站点不能为空"); |
| | | } |
| | | if (Cools.isEmpty(map.get("barcode"))) { |
| | | return R.error("货架码不能为空"); |
| | | } |
| | | 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)); |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", barcode).eq("wrk_sts", 205L)); |
| | | if (agvWrkMast != null) { |
| | | if(agvWrkMast.getIoType() == 101){ |
| | | if (agvWrkMast.getIoType() == 101) { |
| | | throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型为101.出库,无法执行拣料入库任务,请重新选择站点。"); |
| | | } |
| | | agvWrkMast.setLocNo(devNo); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | return R.ok("生成拣料回库任务成功"); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | if (val.contains(RANGE_TIME_LINK)) { |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |