1
2 天以前 afd2cfd8d63a243405d49d889e4fe1084e455b3f
rsf-server/src/main/java/com/vincent/rsf/server/api/controller/pda/MobileController.java
@@ -20,6 +20,7 @@
import io.swagger.annotations.ApiOperation;
import org.apache.tika.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -171,7 +172,28 @@
        if (Objects.isNull(waitPakin.getItems()) || waitPakin.getItems().isEmpty()) {
            return R.error("跟踪码不能为空!!");
        }
        return R.ok(mobileService.mergeItems(waitPakin, userId));
//        return R.ok(mobileService.mergeItems(waitPakin, userId));
        try{
            mobileService.mergeItems(waitPakin, userId);
            if (waitPakin.getAgvSign()==1) {
                asyncProcessAfterValidation(waitPakin,userId);
            }
        } catch (Exception e){
            return R.error(e.getMessage());
        }
        return R.ok();
    }
    @Async
    public void asyncProcessAfterValidation(WaitPakinParam waitPakinPda,Long userId) {
        try {
            Thread.sleep(500);
            WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, waitPakinPda.getBarcode()));
            taskService.generateFlatWarehouseTasks(waitPakin, waitPakinPda.getStaNo(), userId);
//            mobileService.mergeItemsWcs(waitPakin,userId);
        } catch (Exception e) {
//            log.error("异步处理AGV后续逻辑失败", e);
        }
    }
    @PreAuthorize("hasAuthority('manager:waitPakin:update')")