| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.OrderOutTaskParam; |
| | | import com.vincent.rsf.server.manager.controller.params.OutStockToTaskParams; |
| | | import com.vincent.rsf.server.manager.entity.DeliveryItem; |
| | | import com.vincent.rsf.server.manager.entity.excel.OutStockTemplate; |
| | | import com.vincent.rsf.server.manager.enums.OrderType; |
| | | import com.vincent.rsf.server.manager.enums.OrderWorkType; |
| | |
| | | @RestController |
| | | @Api(tags = "出库单据") |
| | | public class OutStockController extends BaseController { |
| | | |
| | | Logger logger = LoggerFactory.getLogger(OutStockController.class); |
| | | |
| | | @Autowired |
| | |
| | | return outStockService.cancelOutOrder(id); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStock:update')") |
| | | @ApiOperation("删除已生成明细") |
| | | @GetMapping("/outStock/items/cancel/{ids}") |
| | | public R cancel(@PathVariable Long[] ids) { |
| | | List<Long> list = Arrays.asList(ids); |
| | | if (list.isEmpty()) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | List<AsnOrderItem> orderItems = outStockItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getId, list)); |
| | | if (orderItems.isEmpty()) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | return outStockService.cancelOutOrderByItems(orderItems); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStock:list')") |
| | | @PostMapping("/outStock/export") |
| | |
| | | if (Objects.isNull(params.get("ids"))) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | List<Long> ids = (List<Long>) params.get("ids"); |
| | | return outStockService.genOutStock(ids, getLoginUserId()); |
| | | List<DeliveryItem> items = JSON.parseArray(JSONObject.toJSONString(params.get("ids")), DeliveryItem.class); |
| | | return outStockService.genOutStock(items, getLoginUserId()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStock:update')") |