| | |
| | | ApproveProcessVO approveProcessVO = new ApproveProcessVO(); |
| | | approveProcessVO.setApproveType(7); |
| | | approveProcessVO.setApproveDeptId(loginUser.getCurrentDeptId()); |
| | | approveProcessVO.setApproveReason(req.getType() + ":" +sh); |
| | | // 审批原因格式:发货单号:{发货类型}:{发货车牌号} |
| | | String approveReason = "发货单号:" + sh + "\n" + req.getType(); |
| | | if ("货车".equals(req.getType()) && req.getShippingCarNumber() != null) { |
| | | approveReason += ":" + req.getShippingCarNumber(); |
| | | } else if ("快递".equals(req.getType()) && req.getExpressCompany() != null) { |
| | | approveReason += ":" + req.getExpressCompany(); |
| | | } |
| | | approveProcessVO.setApproveReason(approveReason); |
| | | approveProcessVO.setApproveUserIds(req.getApproveUserIds()); |
| | | approveProcessVO.setApproveUser(loginUser.getUserId()); |
| | | approveProcessVO.setApproveTime(LocalDate.now().toString()); |
| | |
| | | public AjaxResult getByCustomerName(String customerName) { |
| | | return AjaxResult.success(shippingInfoService.getShippingInfoByCustomerName(customerName)); |
| | | } |
| | | |
| | | /** |
| | | * 一键发货 - 自动审批通过并出库 |
| | | */ |
| | | @PostMapping("/oneClickShipping") |
| | | @ApiOperation("一键发货") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "发货信息管理", businessType = BusinessType.INSERT) |
| | | public AjaxResult oneClickShipping(@RequestBody ShippingInfoDto req) throws IOException { |
| | | return shippingInfoService.oneClickShipping(req) ? AjaxResult.success("发货成功") : AjaxResult.error("发货失败"); |
| | | } |
| | | |
| | | /** |
| | | * 批量一键发货 - 将销售台账下所有未发货的产品全部发货 |
| | | */ |
| | | @PostMapping("/batchOneClickShipping") |
| | | @ApiOperation("批量一键发货") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "发货信息管理", businessType = BusinessType.INSERT) |
| | | public AjaxResult batchOneClickShipping(@RequestBody ShippingInfoDto req) throws IOException { |
| | | if (req.getSalesLedgerId() == null) { |
| | | return AjaxResult.error("销售台账ID不能为空"); |
| | | } |
| | | return shippingInfoService.batchOneClickShipping(req.getSalesLedgerId(), req) ? AjaxResult.success("批量发货成功") : AjaxResult.error("批量发货失败"); |
| | | } |
| | | } |