| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.AgvWrkMast; |
| | | import com.zy.asrs.entity.param.AgvTaskCreateParam; |
| | | import com.zy.asrs.service.AgvWaitPakinService; |
| | | import com.zy.asrs.service.AgvWrkMastService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | AgvWrkMastService agvWrkMastService; |
| | | @Autowired |
| | | AgvWaitPakinService agvWaitPakinService; |
| | | |
| | | @RequestMapping(value = "/wrkMast/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | }else { |
| | | wrapper.orderBy("io_time", false); |
| | | } |
| | | Page<AgvWrkMast> agvWrkMastPage = agvWrkMastService.selectPage(new Page<>(curr, limit), wrapper); |
| | | return R.ok(agvWrkMastPage); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMast/list/auth/dbList") |
| | | @ManagerAuth |
| | | public R dbList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<AgvWrkMast> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | allLike(AgvWrkMast.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){ |
| | | if (orderByField.endsWith("$")){ |
| | | orderByField = orderByField.substring(0, orderByField.length()-1); |
| | | } |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | }else { |
| | | wrapper.orderBy("io_time", false); |
| | | } |
| | | wrapper.in("io_type",108,111,112); |
| | | return R.ok(agvWrkMastService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | public R delete(@RequestParam String param){ |
| | | List<AgvWrkMast> list = JSONArray.parseArray(param, AgvWrkMast.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | return R.error("工作档参数缺失"); |
| | | } |
| | | for (AgvWrkMast entity : list){ |
| | | agvWrkMastService.delete(new EntityWrapper<>(entity)); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMast/startWrk/auth") |
| | | @ManagerAuth(memo = "工作档开始任务") |
| | | public R startWrk(@RequestParam String param){ |
| | | List<AgvWrkMast> agvWrkMastList = JSONArray.parseArray(param, AgvWrkMast.class); |
| | | if (Cools.isEmpty(agvWrkMastList)){ |
| | | return R.error(); |
| | | } |
| | | |
| | | AgvTaskCreateParam agvTaskCreateParam = new AgvTaskCreateParam(); |
| | | |
| | | // agvWrkMastList.stream().map(agvWrkMast -> { |
| | | // AgvTaskParam agvTaskParam = new AgvTaskParam(); |
| | | // AgvTaskkDescribeParam agvTaskkDescribeParam = new AgvTaskkDescribeParam(); |
| | | // agvTaskParam.setTaskCode(agvWrkMast.getWrkNo().toString()); |
| | | // agvTaskParam.setTaskPriority(agvWrkMast.getIoPri().intValue()); |
| | | // agvTaskParam.setTaskkDescribe(agvTaskkDescribeParam); |
| | | // agvTaskkDescribeParam.setFromLocationCode(agvWrkMast.); |
| | | // }).collect(Collectors.toList()); |
| | | |
| | | return R.ok(); |
| | | } |
| | | // @RequestMapping(value = "/wrkMast/startWrk/auth") |
| | | // @ManagerAuth(memo = "工作档开始任务") |
| | | // public R startWrk(@RequestParam String param) throws IOException { |
| | | // List<AgvWrkMast> agvWrkMastList = JSONArray.parseArray(param, AgvWrkMast.class); |
| | | // if (Cools.isEmpty(agvWrkMastList)){ |
| | | // return R.error(); |
| | | // } |
| | | // int startWrkCode = agvWrkMastService.startWrk(agvWrkMastList,"putaway"); |
| | | // |
| | | // int code = agvWrkMastService.containerMoveIn(agvWrkMastList); |
| | | // |
| | | // if(code == 0){ |
| | | // agvWrkMastList.forEach(agvWrkMast -> { |
| | | // //202.RCS取货中 |
| | | // agvWrkMast.setWrkSts((long)202); |
| | | // //修改AGV入库通知档状态入出状态为Y |
| | | // agvWaitPakinService.updateIoStatus(agvWrkMast.getWrkNo(),"Y"); |
| | | // }); |
| | | // agvWrkMastService.updateBatchById(agvWrkMastList); |
| | | // |
| | | // return R.ok("任务启动成功"); |
| | | // } |
| | | // |
| | | // return R.error("任务启动失败"); |
| | | // |
| | | // } |
| | | } |