| | |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import com.vincent.rsf.server.manager.service.OutStockItemService; |
| | | import com.vincent.rsf.server.manager.service.OutStockService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | asnOrder.setType(OrderType.ORDER_OUT.type) |
| | | .setUpdateBy(getLoginUserId()) |
| | | .setUpdateTime(new Date()); |
| | | if (Objects.isNull(asnOrder.getCode())) { |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_OUT_STOCK_CODE, asnOrder); |
| | | asnOrder.setCode(ruleCode); |
| | | } |
| | | if (!outStockService.updateById(asnOrder)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | |
| | | } |
| | | ExcelUtil.build(ExcelUtil.create(orderTemplates, AsnOrderTemplate.class), response); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStock:update')") |
| | | @ApiOperation("通过DO单生成出库单") |
| | | @PostMapping("/outStock/generate/orders") |
| | | public R genOutStock(@RequestBody Map<String, Object> params) { |
| | | if (Objects.isNull(params.get("ids"))) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | List<Long> ids = (List<Long>) params.get("ids"); |
| | | return outStockService.genOutStock(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStock:update')") |
| | | @ApiOperation("出库单生成波次") |
| | | @PostMapping("/outStock/generate/wave") |
| | | public R generateWave(@RequestBody Map<String, Object> params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | List<Long> ids = (List<Long>) params.get("ids"); |
| | | return outStockService.generateWaves(ids); |
| | | } |
| | | |
| | | |
| | | } |