自动化立体仓库 - WMS系统
zhangc
2025-03-09 dfc9552392f9f973ab52e55d58a7ae2acdaeb1f3
src/main/java/com/zy/asrs/controller/AgvWrkMastController.java
@@ -11,7 +11,7 @@
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;
@@ -25,6 +25,8 @@
    @Autowired
    AgvWrkMastService agvWrkMastService;
    @Autowired
    AgvWaitPakinService agvWaitPakinService;
    @RequestMapping(value = "/wrkMast/{id}/auth")
    @ManagerAuth
@@ -52,6 +54,31 @@
        }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));
    }
@@ -84,7 +111,7 @@
    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));
@@ -155,25 +182,30 @@
        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("任务启动失败");
//
//    }
}