|  |  |  | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | wrapper.orderBy("io_time", false); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(agvWrkMastService.selectPage(new Page<>(curr, limit), wrapper)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @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)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | 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.containerMove(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("任务启动失败"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //    @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("任务启动失败"); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  | } | 
|---|