ZY
2024-09-25 adae16c35c9da4181647b9d815f7a6c9c6431ee8
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/WaveController.java
@@ -4,9 +4,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.wms.asrs.entity.TaskDetl;
import com.zy.asrs.wms.asrs.entity.WaveDetl;
import com.zy.asrs.wms.asrs.service.TaskDetlService;
import com.zy.asrs.wms.asrs.service.WaveDetlService;
import com.zy.asrs.wms.common.annotation.OperationLog;
import com.zy.asrs.wms.common.domain.BaseParam;
@@ -21,10 +19,7 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
@RestController
@RequestMapping("/api")
@@ -34,8 +29,6 @@
    private WaveService waveService;
    @Autowired
    private WaveDetlService waveDetlService;
    @Autowired
    private TaskDetlService taskDetlService;
    @PreAuthorize("hasAuthority('asrs:wave:list')")
    @PostMapping("/wave/page")
@@ -43,21 +36,6 @@
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<Wave, BaseParam> pageParam = new PageParam<>(baseParam, Wave.class);
        PageParam<Wave, BaseParam> page = waveService.page(pageParam, pageParam.buildWrapper(true));
        List<Wave> records = page.getRecords();
        for (Wave record : records) {
            ArrayList<Long> orderDetlIds = new ArrayList<>();
            for (WaveDetl waveDetl : record.getWaveDetlList()) {
                orderDetlIds.add(waveDetl.getOrderId());
            }
            List<TaskDetl> taskDetls = taskDetlService.list(new LambdaQueryWrapper<TaskDetl>().in(TaskDetl::getOrderId, orderDetlIds));
            if (taskDetls.isEmpty()) {
                record.setGenerateTask(false);
            }else {
                record.setGenerateTask(true);
            }
        }
        return R.ok().add(page);
    }