| | |
| | | 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; |
| | |
| | | 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") |
| | |
| | | private WaveService waveService; |
| | | @Autowired |
| | | private WaveDetlService waveDetlService; |
| | | @Autowired |
| | | private TaskDetlService taskDetlService; |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:wave:list')") |
| | | @PostMapping("/wave/page") |
| | |
| | | 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); |
| | | } |
| | | |