#
zwl
2025-07-19 6193eddf242c4b879402367704b8b5b2e8df84a4
src/main/java/com/zy/asrs/task/TaskLogScheduler.java
@@ -65,7 +65,13 @@
    @Scheduled(cron = "0/3 * * * * ? ")
    public void execute() throws IOException {
        //入库7转历史档,移库7转历史档,出库18转
        List<TaskWrk> taskWrkList = taskWrkService.selectList(new EntityWrapper<TaskWrk>().in("wrk_sts", 7,18));
        List<TaskWrk> taskWrkList = taskWrkService.selectList(new EntityWrapper<TaskWrk>()
                .in("wrk_sts", 7,17)
                .or()
                .in("status",5,7));//取消或者完结
        if(taskWrkList.size() == 0){
            return;
        }
        for (TaskWrk taskWrk : taskWrkList) {
            TaskWrkLog taskWrkLog = new TaskWrkLog(taskWrk);
            if(taskWrkLog.getIoType().equals(1)){
@@ -79,6 +85,16 @@
                }
            }else if(taskWrkLog.getIoType().equals(2)){
                BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("wrk_no",taskWrk.getWrkNo()));
                if(taskWrk.getWrkNo()>=3001&&taskWrk.getWrkNo()<=6000){
                    taskWrkLog.setWrkSts(18);
                    taskWrkLog.setModiTime(new Date());
                    if (!wrkLogService.insert(taskWrkLog)) {
                        throw new CoolException("转历史档失败" + taskWrkLog);
                    }
                    if (!taskWrkService.deleteById(taskWrk)) {
                        throw new CoolException("任务档删除失败" + taskWrkLog);
                    }
                }
                if(basDevp==null){
                    HashMap<Object, Object> headParam = new HashMap<>();
                    String response = "";
@@ -95,6 +111,14 @@
                                .doPost();
                        JSONObject jsonObject = JSON.parseObject(response);
                        if(jsonObject.get("ReturnStatus").equals(0)){
                            taskWrkLog.setWrkSts(18);
                            taskWrkLog.setModiTime(new Date());
                            if (!wrkLogService.insert(taskWrkLog)) {
                                throw new CoolException("转历史档失败" + taskWrkLog);
                            }
                            if (!taskWrkService.deleteById(taskWrk)) {
                                throw new CoolException("任务档删除失败" + taskWrkLog);
                            }
                        }
                    } catch (Exception e){
                        log.error("wcs搬离出库给wms失败{},返回值={}", taskWrk, response);