whycxzp
2025-04-07 3ff39eee0b43c9a29d2fcd34dffd4e47ec453582
src/main/java/com/whyc/service/WmsService.java
@@ -132,10 +132,16 @@
    }
    public Response sendTaskStatus(TaskDto taskDto) {
        String taskNo = taskDto.getTask_no();
        //通过taskNo从数据库查找对应的记录
        Task taskInDB = taskService.getByTaskNo(taskNo);
        if(taskInDB == null){
            return new Response<>().setII(1,"任务上报失败,无法定位到任务,任务可能不是通过监控平台下发");
        }
        Task task = new Task();
        task.setTaskNo(taskDto.getTask_no());
        task.setTaskNo(taskNo);
        task.setTaskType(taskDto.getTask_type());
        //TODO 这个地方起始点的定义,运行过程中需要关注,以及编码对应的具体位置,需要他们提供
        //这个地方起始点的定义,运行过程中需要关注,以及编码对应的具体位置,需要他们提供
        task.setStartLocationCode(taskDto.getStart_location_code());
        task.setEndLocationCode(taskDto.getEnd_location_code());
@@ -143,7 +149,7 @@
        task.setStatusTime(ThreadLocalUtil.parse(taskDto.getStatus_time(),1));
        //对接收到的任务进行逻辑判断和数据存储
        String taskNo = task.getTaskNo();
        //String taskNo = task.getTaskNo();
        //taskType=4,入库测压任务,这个为仓储自动触发的任务,非主动平台下达,
        // 需要手动添加任务类型,和电池组编号
        Integer taskType = task.getTaskType();
@@ -168,7 +174,7 @@
                if(pallet == null){
                    pallet = taskService.getByTaskNo(taskNo).getPallets();
                }*/
                String pallet = taskService.getByTaskNo(taskNo).getPallets();
                String pallet = taskInDB.getPallets();
                //更新电池单体编号和任务编号
                AbeInf abeInf = abeInfService.get();
                abeInf.setAbeMonId(Integer.valueOf(pallet));