| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.common.utils.TreeUtils; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | | import com.zy.asrs.common.wms.entity.OrderDetl; |
| | | import com.zy.asrs.common.wms.service.MatService; |
| | | import com.zy.asrs.framework.annotations.ManagerAuth; |
| | | import com.zy.asrs.framework.common.Cools; |
| | |
| | | LambdaQueryWrapper<Mat> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Mat::getHostId, getHostId()); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(Mat::getId, condition); |
| | | wrapper.like(Mat::getMatnr, condition); |
| | | } |
| | | matService.page(new Page<>(1, 30), wrapper).getRecords().forEach(item -> vos.add(new KeyValueVo(String.valueOf(item.getId()), item.getId()))); |
| | | matService.page(new Page<>(1, 30), wrapper).getRecords().forEach(item -> vos.add(new KeyValueVo(item.getMatnr(), item.getId()))); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/covert/{id}/auth") |
| | | @ManagerAuth |
| | | public R covert(@PathVariable("id") String id) { |
| | | Mat mat = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getId, id).eq(Mat::getHostId, getHostId())); |
| | | if (mat == null) { |
| | | return R.ok(); |
| | | } |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(mat); |
| | | orderDetl.setAnfme(0.0D); |
| | | return R.ok().add(orderDetl); |
| | | } |
| | | |
| | | } |