自动化立体仓库 - WMS系统
#
zwl
2025-03-31 a936c187f9d7f389a711e001739384dcbd9278e2
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -8,6 +8,7 @@
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.entity.param.*;
import com.zy.asrs.service.OpenService;
import com.zy.asrs.service.WorkService;
import com.zy.asrs.service.WrkMastService;
import com.zy.common.model.DetlDto;
import com.zy.common.web.BaseController;
@@ -38,6 +39,8 @@
    private OpenService openService;
    @Autowired
    private WrkMastService wrkMastService;
    @Autowired
    private WorkService workService;
    @PostMapping("/order/matSync/default/v1")
    @AppAuth(memo = "商品信息同步接口")
@@ -259,15 +262,21 @@
            map1.put("ReturnStatus", "1");
            map1.put("ErrorMessage", "任务号为空");
        }else{
            //任务完成
            if (map.get("Result").equals(1)) {
            WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no",Integer.valueOf(taskNo)));
            if(wrkMast == null){
                map1.put("ReturnStatus", "1");
                map1.put("ErrorMessage", "没有找到该任务号:"+taskNo);
            }else{
                if(wrkMast.getIoType()==1){
                    if (wrkMast.getIoType() == 1 || wrkMast.getIoType() == 10) {
                    wrkMast.setWrkSts(4L);//任务结束
                }else if(wrkMast.getIoType()==11){
                    } else if (wrkMast.getIoType() == 101) {
                    wrkMast.setWrkSts(13L);//出库到站点上
                    } else if (wrkMast.getIoType() == 53 || wrkMast.getIoType() == 57) {
                        wrkMast.setWrkSts(4L);//4.任务结束
                    } else if (wrkMast.getIoType() == 103 || wrkMast.getIoType() == 107 || wrkMast.getIoType() == 110) {
                        wrkMast.setWrkSts(14L);
                }
                wrkMast.setModiTime(new Date());
                if(wrkMastService.updateById(wrkMast)){
@@ -278,12 +287,22 @@
                    map1.put("ErrorMessage", "更新任务状态失败"+wrkMast);
                }
            }
            } else {
                //任务取消
                WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", Integer.valueOf(taskNo)));
                if (wrkMast == null) {
                    map1.put("ReturnStatus", "1");
                    map1.put("ErrorMessage", "没有找到该任务号:" + taskNo);
                    return map1;
                }
                workService.cancelWrkMast(String.valueOf(wrkMast.getWrkNo()),9999L);
            }
        }
        return map1;
    }
    /**
     * 搬运到目的地
     * 出库---目的地搬离
     */
    @RequestMapping("/leave/task")
    public HashMap<String ,Object> leaveTask(@RequestBody HashMap<String,Object> map) {
@@ -293,10 +312,27 @@
            map1.put("ReturnStatus", "1");
            map1.put("ErrorMessage", "任务号为空");
        }else{
            WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no",Integer.valueOf(taskNo)));
            if(wrkMast == null){
                map1.put("ReturnStatus", "1");
                map1.put("ErrorMessage", "没有找到该任务号:"+taskNo);
                return map1;
            }
            if ((wrkMast.getIoType() == 103 || wrkMast.getIoType() == 107 || wrkMast.getIoType() == 110) && wrkMast.getWrkSts() != 14) {
                wrkMast.setWrkSts(14L);//出库到站点上
                wrkMast.setModiTime(new Date());
                if (wrkMastService.updateById(wrkMast)) {
                    map1.put("ReturnStatus", "0");
                    map1.put("ErrorMessage", "");
                } else {
                    map1.put("ReturnStatus", "1");
                    map1.put("ErrorMessage", "更新任务状态失败" + wrkMast);
                }
            } else if (wrkMast.getIoType() != 101) {
                map1.put("ReturnStatus", "0");
                map1.put("ErrorMessage", "");
                return map1;
            }else{
                wrkMast.setWrkSts(14L);//出库到站点上
                wrkMast.setModiTime(new Date());
@@ -308,6 +344,8 @@
                    map1.put("ErrorMessage", "更新任务状态失败"+wrkMast);
                }
            }
        }
        return map1;
    }