Showing
53 changed files
with
2848 additions
and
93 deletions
This diff is collapsed. Click to expand it.
| 1 | +package com.apple.erp.controller; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.dto.DeliveryAddReq; | ||
| 4 | +import com.apple.erp.dto.DeliveryQueryReq; | ||
| 5 | +import com.apple.erp.dto.DeliveryRes; | ||
| 6 | +import com.apple.erp.dto.DeliveryUpdateReq; | ||
| 7 | +import com.apple.erp.service.DeliveryMainService; | ||
| 8 | +import com.apple.erp.dto.response.ApiRes; | ||
| 9 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 10 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 11 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 12 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 15 | +import org.springframework.validation.annotation.Validated; | ||
| 16 | +import org.springframework.web.bind.annotation.*; | ||
| 17 | + | ||
| 18 | +import javax.validation.Valid; | ||
| 19 | +import java.util.List; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * 出库管理Controller | ||
| 23 | + * | ||
| 24 | + * @author Apple ERP System | ||
| 25 | + * @since 2025-01-01 | ||
| 26 | + */ | ||
| 27 | +@Tag(name = "出库管理", description = "出库管理相关接口") | ||
| 28 | +@RestController | ||
| 29 | +@RequestMapping("/api/delivery") | ||
| 30 | +@Validated | ||
| 31 | +public class DeliveryMainController { | ||
| 32 | + | ||
| 33 | + @Autowired | ||
| 34 | + private DeliveryMainService deliveryMainService; | ||
| 35 | + | ||
| 36 | + @Operation(summary = "分页查询出库列表", description = "根据查询条件分页获取出库列表") | ||
| 37 | + @GetMapping("/list") | ||
| 38 | + @PreAuthorize("hasAuthority('delivery:list')") | ||
| 39 | + public ApiRes<Page<DeliveryRes>> getDeliveryList(@Valid DeliveryQueryReq queryReq) { | ||
| 40 | + Page<DeliveryRes> page = deliveryMainService.getDeliveryList(queryReq); | ||
| 41 | + return ApiRes.success(page); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + @Operation(summary = "获取出库详情", description = "根据出库单ID获取出库详细信息,包含出库明细") | ||
| 45 | + @GetMapping("/{deliveryId}") | ||
| 46 | + @PreAuthorize("hasAuthority('delivery:detail')") | ||
| 47 | + public ApiRes<DeliveryRes> getDeliveryDetail( | ||
| 48 | + @Parameter(description = "出库单ID", required = true) @PathVariable Long deliveryId) { | ||
| 49 | + DeliveryRes deliveryRes = deliveryMainService.getDeliveryDetail(deliveryId); | ||
| 50 | + if (deliveryRes != null) { | ||
| 51 | + return ApiRes.success(deliveryRes); | ||
| 52 | + } | ||
| 53 | + return ApiRes.error("出库单不存在或已删除"); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + @Operation(summary = "新增出库", description = "新增一个出库单,包含出库主表和明细") | ||
| 57 | + @PostMapping | ||
| 58 | + @PreAuthorize("hasAuthority('delivery:add')") | ||
| 59 | + public ApiRes<Void> addDelivery(@Valid @RequestBody DeliveryAddReq addReq) { | ||
| 60 | + try { | ||
| 61 | + boolean result = deliveryMainService.addDelivery(addReq); | ||
| 62 | + if (result) { | ||
| 63 | + return ApiRes.success("新增出库单成功", null); | ||
| 64 | + } else { | ||
| 65 | + return ApiRes.error("新增出库单失败"); | ||
| 66 | + } | ||
| 67 | + } catch (Exception e) { | ||
| 68 | + return ApiRes.error("新增出库单失败: " + e.getMessage()); | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + @Operation(summary = "修改出库", description = "修改现有出库单信息,包含出库主表和明细") | ||
| 73 | + @PostMapping("/update") | ||
| 74 | + @PreAuthorize("hasAuthority('delivery:edit')") | ||
| 75 | + public ApiRes<Void> updateDelivery(@Valid @RequestBody DeliveryUpdateReq updateReq) { | ||
| 76 | + try { | ||
| 77 | + boolean result = deliveryMainService.updateDelivery(updateReq); | ||
| 78 | + if (result) { | ||
| 79 | + return ApiRes.success("修改出库单成功", null); | ||
| 80 | + } else { | ||
| 81 | + return ApiRes.error("修改出库单失败"); | ||
| 82 | + } | ||
| 83 | + } catch (Exception e) { | ||
| 84 | + return ApiRes.error("修改出库单失败: " + e.getMessage()); | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + @Operation(summary = "删除出库", description = "根据出库单ID逻辑删除出库单") | ||
| 89 | + @DeleteMapping("/{deliveryId}") | ||
| 90 | + @PreAuthorize("hasAuthority('delivery:delete')") | ||
| 91 | + public ApiRes<Void> deleteDelivery( | ||
| 92 | + @Parameter(description = "出库单ID", required = true) @PathVariable Long deliveryId) { | ||
| 93 | + try { | ||
| 94 | + boolean result = deliveryMainService.deleteDelivery(deliveryId); | ||
| 95 | + if (result) { | ||
| 96 | + return ApiRes.success("删除出库单成功", null); | ||
| 97 | + } else { | ||
| 98 | + return ApiRes.error("删除出库单失败"); | ||
| 99 | + } | ||
| 100 | + } catch (Exception e) { | ||
| 101 | + return ApiRes.error("删除出库单失败: " + e.getMessage()); | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + @Operation(summary = "批量删除出库", description = "根据出库单ID列表批量逻辑删除出库单") | ||
| 106 | + @PostMapping("/batchDelete") | ||
| 107 | + @PreAuthorize("hasAuthority('delivery:delete')") | ||
| 108 | + public ApiRes<Void> batchDeleteDeliveries( | ||
| 109 | + @Parameter(description = "出库单ID列表", required = true) @RequestBody List<Long> deliveryIds) { | ||
| 110 | + try { | ||
| 111 | + if (deliveryIds == null || deliveryIds.isEmpty()) { | ||
| 112 | + return ApiRes.error("出库单ID列表不能为空"); | ||
| 113 | + } | ||
| 114 | + boolean result = deliveryMainService.batchDeleteDeliveries(deliveryIds); | ||
| 115 | + if (result) { | ||
| 116 | + return ApiRes.success("批量删除出库单成功", null); | ||
| 117 | + } else { | ||
| 118 | + return ApiRes.error("批量删除出库单失败"); | ||
| 119 | + } | ||
| 120 | + } catch (Exception e) { | ||
| 121 | + return ApiRes.error("批量删除出库单失败: " + e.getMessage()); | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + @Operation(summary = "修改出库状态", description = "修改指定出库单的出库状态") | ||
| 126 | + @PostMapping("/{deliveryId}/deliveryStatus") | ||
| 127 | + @PreAuthorize("hasAuthority('delivery:edit')") | ||
| 128 | + public ApiRes<Void> updateDeliveryStatus( | ||
| 129 | + @Parameter(description = "出库单ID", required = true) @PathVariable Long deliveryId, | ||
| 130 | + @Parameter(description = "出库状态", required = true) @RequestParam Integer deliveryStatus) { | ||
| 131 | + try { | ||
| 132 | + boolean result = deliveryMainService.updateDeliveryStatus(deliveryId, deliveryStatus); | ||
| 133 | + if (result) { | ||
| 134 | + return ApiRes.success("修改出库状态成功", null); | ||
| 135 | + } else { | ||
| 136 | + return ApiRes.error("修改出库状态失败"); | ||
| 137 | + } | ||
| 138 | + } catch (Exception e) { | ||
| 139 | + return ApiRes.error("修改出库状态失败: " + e.getMessage()); | ||
| 140 | + } | ||
| 141 | + } | ||
| 142 | +} | ||
| 143 | + |
| 1 | +package com.apple.erp.controller; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.dto.InvoiceAddReq; | ||
| 4 | +import com.apple.erp.dto.InvoiceQueryReq; | ||
| 5 | +import com.apple.erp.dto.InvoiceRes; | ||
| 6 | +import com.apple.erp.dto.InvoiceUpdateReq; | ||
| 7 | +import com.apple.erp.service.InvoiceMainService; | ||
| 8 | +import com.apple.erp.dto.response.ApiRes; | ||
| 9 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 10 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 11 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 12 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 15 | +import org.springframework.validation.annotation.Validated; | ||
| 16 | +import org.springframework.web.bind.annotation.*; | ||
| 17 | + | ||
| 18 | +import javax.validation.Valid; | ||
| 19 | +import java.util.List; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * 发票管理Controller | ||
| 23 | + * | ||
| 24 | + * @author Apple ERP System | ||
| 25 | + * @since 2025-01-01 | ||
| 26 | + */ | ||
| 27 | +@Tag(name = "发票管理", description = "发票管理相关接口") | ||
| 28 | +@RestController | ||
| 29 | +@RequestMapping("/api/invoice") | ||
| 30 | +@Validated | ||
| 31 | +public class InvoiceMainController { | ||
| 32 | + | ||
| 33 | + @Autowired | ||
| 34 | + private InvoiceMainService invoiceMainService; | ||
| 35 | + | ||
| 36 | + @Operation(summary = "分页查询发票列表", description = "根据查询条件分页获取发票列表") | ||
| 37 | + @GetMapping("/list") | ||
| 38 | + @PreAuthorize("hasAuthority('invoice:list')") | ||
| 39 | + public ApiRes<Page<InvoiceRes>> getInvoiceList(@Valid InvoiceQueryReq queryReq) { | ||
| 40 | + Page<InvoiceRes> page = invoiceMainService.getInvoiceList(queryReq); | ||
| 41 | + return ApiRes.success(page); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + @Operation(summary = "获取发票详情", description = "根据发票ID获取发票详细信息,包含发票明细") | ||
| 45 | + @GetMapping("/{invoiceId}") | ||
| 46 | + @PreAuthorize("hasAuthority('invoice:detail')") | ||
| 47 | + public ApiRes<InvoiceRes> getInvoiceDetail( | ||
| 48 | + @Parameter(description = "发票ID", required = true) @PathVariable Long invoiceId) { | ||
| 49 | + InvoiceRes invoiceRes = invoiceMainService.getInvoiceDetail(invoiceId); | ||
| 50 | + if (invoiceRes != null) { | ||
| 51 | + return ApiRes.success(invoiceRes); | ||
| 52 | + } | ||
| 53 | + return ApiRes.error("发票不存在或已删除"); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + @Operation(summary = "新增发票", description = "新增一个发票,包含发票主表和明细") | ||
| 57 | + @PostMapping | ||
| 58 | + @PreAuthorize("hasAuthority('invoice:add')") | ||
| 59 | + public ApiRes<Void> addInvoice(@Valid @RequestBody InvoiceAddReq addReq) { | ||
| 60 | + try { | ||
| 61 | + boolean result = invoiceMainService.addInvoice(addReq); | ||
| 62 | + if (result) { | ||
| 63 | + return ApiRes.success("新增发票成功", null); | ||
| 64 | + } else { | ||
| 65 | + return ApiRes.error("新增发票失败"); | ||
| 66 | + } | ||
| 67 | + } catch (Exception e) { | ||
| 68 | + return ApiRes.error("新增发票失败: " + e.getMessage()); | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + @Operation(summary = "修改发票", description = "修改现有发票信息,包含发票主表和明细") | ||
| 73 | + @PostMapping("/update") | ||
| 74 | + @PreAuthorize("hasAuthority('invoice:edit')") | ||
| 75 | + public ApiRes<Void> updateInvoice(@Valid @RequestBody InvoiceUpdateReq updateReq) { | ||
| 76 | + try { | ||
| 77 | + boolean result = invoiceMainService.updateInvoice(updateReq); | ||
| 78 | + if (result) { | ||
| 79 | + return ApiRes.success("修改发票成功", null); | ||
| 80 | + } else { | ||
| 81 | + return ApiRes.error("修改发票失败"); | ||
| 82 | + } | ||
| 83 | + } catch (Exception e) { | ||
| 84 | + return ApiRes.error("修改发票失败: " + e.getMessage()); | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + @Operation(summary = "删除发票", description = "根据发票ID逻辑删除发票") | ||
| 89 | + @DeleteMapping("/{invoiceId}") | ||
| 90 | + @PreAuthorize("hasAuthority('invoice:delete')") | ||
| 91 | + public ApiRes<Void> deleteInvoice( | ||
| 92 | + @Parameter(description = "发票ID", required = true) @PathVariable Long invoiceId) { | ||
| 93 | + try { | ||
| 94 | + boolean result = invoiceMainService.deleteInvoice(invoiceId); | ||
| 95 | + if (result) { | ||
| 96 | + return ApiRes.success("删除发票成功", null); | ||
| 97 | + } else { | ||
| 98 | + return ApiRes.error("删除发票失败"); | ||
| 99 | + } | ||
| 100 | + } catch (Exception e) { | ||
| 101 | + return ApiRes.error("删除发票失败: " + e.getMessage()); | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + @Operation(summary = "批量删除发票", description = "根据发票ID列表批量逻辑删除发票") | ||
| 106 | + @PostMapping("/batchDelete") | ||
| 107 | + @PreAuthorize("hasAuthority('invoice:delete')") | ||
| 108 | + public ApiRes<Void> batchDeleteInvoices( | ||
| 109 | + @Parameter(description = "发票ID列表", required = true) @RequestBody List<Long> invoiceIds) { | ||
| 110 | + try { | ||
| 111 | + if (invoiceIds == null || invoiceIds.isEmpty()) { | ||
| 112 | + return ApiRes.error("发票ID列表不能为空"); | ||
| 113 | + } | ||
| 114 | + boolean result = invoiceMainService.batchDeleteInvoices(invoiceIds); | ||
| 115 | + if (result) { | ||
| 116 | + return ApiRes.success("批量删除发票成功", null); | ||
| 117 | + } else { | ||
| 118 | + return ApiRes.error("批量删除发票失败"); | ||
| 119 | + } | ||
| 120 | + } catch (Exception e) { | ||
| 121 | + return ApiRes.error("批量删除发票失败: " + e.getMessage()); | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + @Operation(summary = "修改发票状态", description = "修改指定发票的发票状态") | ||
| 126 | + @PostMapping("/{invoiceId}/invoiceStatus") | ||
| 127 | + @PreAuthorize("hasAuthority('invoice:edit')") | ||
| 128 | + public ApiRes<Void> updateInvoiceStatus( | ||
| 129 | + @Parameter(description = "发票ID", required = true) @PathVariable Long invoiceId, | ||
| 130 | + @Parameter(description = "发票状态", required = true) @RequestParam Integer invoiceStatus) { | ||
| 131 | + try { | ||
| 132 | + boolean result = invoiceMainService.updateInvoiceStatus(invoiceId, invoiceStatus); | ||
| 133 | + if (result) { | ||
| 134 | + return ApiRes.success("修改发票状态成功", null); | ||
| 135 | + } else { | ||
| 136 | + return ApiRes.error("修改发票状态失败"); | ||
| 137 | + } | ||
| 138 | + } catch (Exception e) { | ||
| 139 | + return ApiRes.error("修改发票状态失败: " + e.getMessage()); | ||
| 140 | + } | ||
| 141 | + } | ||
| 142 | +} | ||
| 143 | + |
| 1 | +package com.apple.erp.controller; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.dto.OrderAddReq; | ||
| 4 | +import com.apple.erp.dto.OrderQueryReq; | ||
| 5 | +import com.apple.erp.dto.OrderRes; | ||
| 6 | +import com.apple.erp.dto.OrderUpdateReq; | ||
| 7 | +import com.apple.erp.service.OrderMainService; | ||
| 8 | +import com.apple.erp.dto.response.ApiRes; | ||
| 9 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 10 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 11 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 12 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 15 | +import org.springframework.validation.annotation.Validated; | ||
| 16 | +import org.springframework.web.bind.annotation.*; | ||
| 17 | + | ||
| 18 | +import javax.validation.Valid; | ||
| 19 | +import java.util.List; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * 订单管理Controller | ||
| 23 | + * | ||
| 24 | + * @author Apple ERP System | ||
| 25 | + * @since 2025-01-01 | ||
| 26 | + */ | ||
| 27 | +@Tag(name = "订单管理", description = "订单管理相关接口") | ||
| 28 | +@RestController | ||
| 29 | +@RequestMapping("/order") | ||
| 30 | +@Validated | ||
| 31 | +public class OrderMainController { | ||
| 32 | + | ||
| 33 | + @Autowired | ||
| 34 | + private OrderMainService orderMainService; | ||
| 35 | + | ||
| 36 | + @Operation(summary = "分页查询订单列表", description = "根据条件分页查询订单列表") | ||
| 37 | + @GetMapping("/list") | ||
| 38 | + @PreAuthorize("hasAuthority('order:list')") | ||
| 39 | + public ApiRes<Page<OrderRes>> getOrderList(@Valid OrderQueryReq queryReq) { | ||
| 40 | + try { | ||
| 41 | + Page<OrderRes> result = orderMainService.getOrderList(queryReq); | ||
| 42 | + return ApiRes.success(result); | ||
| 43 | + } catch (Exception e) { | ||
| 44 | + return ApiRes.error("查询订单列表失败: " + e.getMessage()); | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + @Operation(summary = "获取订单详情", description = "根据订单ID获取订单详情") | ||
| 49 | + @GetMapping("/{orderId}") | ||
| 50 | + @PreAuthorize("hasAuthority('order:detail')") | ||
| 51 | + public ApiRes<OrderRes> getOrderDetail( | ||
| 52 | + @Parameter(description = "订单ID", required = true) @PathVariable Long orderId) { | ||
| 53 | + try { | ||
| 54 | + OrderRes result = orderMainService.getOrderDetail(orderId); | ||
| 55 | + if (result == null) { | ||
| 56 | + return ApiRes.error("订单不存在"); | ||
| 57 | + } | ||
| 58 | + return ApiRes.success(result); | ||
| 59 | + } catch (Exception e) { | ||
| 60 | + return ApiRes.error("获取订单详情失败: " + e.getMessage()); | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + @Operation(summary = "新增订单", description = "新增订单信息") | ||
| 65 | + @PostMapping | ||
| 66 | + @PreAuthorize("hasAuthority('order:add')") | ||
| 67 | + public ApiRes<Void> addOrder(@Valid @RequestBody OrderAddReq addReq) { | ||
| 68 | + try { | ||
| 69 | + boolean result = orderMainService.addOrder(addReq); | ||
| 70 | + if (result) { | ||
| 71 | + return ApiRes.success("新增订单成功", null); | ||
| 72 | + } else { | ||
| 73 | + return ApiRes.error("新增订单失败"); | ||
| 74 | + } | ||
| 75 | + } catch (Exception e) { | ||
| 76 | + return ApiRes.error("新增订单失败: " + e.getMessage()); | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + @Operation(summary = "修改订单", description = "修改订单信息") | ||
| 81 | + @PostMapping("/update") | ||
| 82 | + @PreAuthorize("hasAuthority('order:edit')") | ||
| 83 | + public ApiRes<Void> updateOrder(@Valid @RequestBody OrderUpdateReq updateReq) { | ||
| 84 | + try { | ||
| 85 | + boolean result = orderMainService.updateOrder(updateReq); | ||
| 86 | + if (result) { | ||
| 87 | + return ApiRes.success("修改订单成功", null); | ||
| 88 | + } else { | ||
| 89 | + return ApiRes.error("修改订单失败"); | ||
| 90 | + } | ||
| 91 | + } catch (Exception e) { | ||
| 92 | + return ApiRes.error("修改订单失败: " + e.getMessage()); | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + @Operation(summary = "删除订单", description = "根据订单ID删除订单") | ||
| 97 | + @DeleteMapping("/{orderId}") | ||
| 98 | + @PreAuthorize("hasAuthority('order:delete')") | ||
| 99 | + public ApiRes<Void> deleteOrder( | ||
| 100 | + @Parameter(description = "订单ID", required = true) @PathVariable Long orderId) { | ||
| 101 | + try { | ||
| 102 | + boolean result = orderMainService.deleteOrder(orderId); | ||
| 103 | + if (result) { | ||
| 104 | + return ApiRes.success("删除订单成功", null); | ||
| 105 | + } else { | ||
| 106 | + return ApiRes.error("删除订单失败"); | ||
| 107 | + } | ||
| 108 | + } catch (Exception e) { | ||
| 109 | + return ApiRes.error("删除订单失败: " + e.getMessage()); | ||
| 110 | + } | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + @Operation(summary = "批量删除订单", description = "批量删除订单") | ||
| 114 | + @PostMapping("/batchDelete") | ||
| 115 | + @PreAuthorize("hasAuthority('order:delete')") | ||
| 116 | + public ApiRes<Void> batchDeleteOrders(@RequestBody List<Long> orderIds) { | ||
| 117 | + try { | ||
| 118 | + if (orderIds == null || orderIds.isEmpty()) { | ||
| 119 | + return ApiRes.error("订单ID列表不能为空"); | ||
| 120 | + } | ||
| 121 | + boolean result = orderMainService.batchDeleteOrders(orderIds); | ||
| 122 | + if (result) { | ||
| 123 | + return ApiRes.success("批量删除订单成功", null); | ||
| 124 | + } else { | ||
| 125 | + return ApiRes.error("批量删除订单失败"); | ||
| 126 | + } | ||
| 127 | + } catch (Exception e) { | ||
| 128 | + return ApiRes.error("批量删除订单失败: " + e.getMessage()); | ||
| 129 | + } | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + @Operation(summary = "修改订单出库状态", description = "修改订单出库状态") | ||
| 133 | + @PostMapping("/{orderId}/deliveryStatus") | ||
| 134 | + @PreAuthorize("hasAuthority('order:edit')") | ||
| 135 | + public ApiRes<Void> updateDeliveryStatus( | ||
| 136 | + @Parameter(description = "订单ID", required = true) @PathVariable Long orderId, | ||
| 137 | + @Parameter(description = "出库状态", required = true) @RequestParam Integer deliveryStatus) { | ||
| 138 | + try { | ||
| 139 | + boolean result = orderMainService.updateDeliveryStatus(orderId, deliveryStatus); | ||
| 140 | + if (result) { | ||
| 141 | + return ApiRes.success("修改出库状态成功", null); | ||
| 142 | + } else { | ||
| 143 | + return ApiRes.error("修改出库状态失败"); | ||
| 144 | + } | ||
| 145 | + } catch (Exception e) { | ||
| 146 | + return ApiRes.error("修改出库状态失败: " + e.getMessage()); | ||
| 147 | + } | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + @Operation(summary = "修改订单开票状态", description = "修改订单开票状态") | ||
| 151 | + @PostMapping("/{orderId}/invoiceStatus") | ||
| 152 | + @PreAuthorize("hasAuthority('order:edit')") | ||
| 153 | + public ApiRes<Void> updateInvoiceStatus( | ||
| 154 | + @Parameter(description = "订单ID", required = true) @PathVariable Long orderId, | ||
| 155 | + @Parameter(description = "开票状态", required = true) @RequestParam Integer invoiceStatus) { | ||
| 156 | + try { | ||
| 157 | + boolean result = orderMainService.updateInvoiceStatus(orderId, invoiceStatus); | ||
| 158 | + if (result) { | ||
| 159 | + return ApiRes.success("修改开票状态成功", null); | ||
| 160 | + } else { | ||
| 161 | + return ApiRes.error("修改开票状态失败"); | ||
| 162 | + } | ||
| 163 | + } catch (Exception e) { | ||
| 164 | + return ApiRes.error("修改开票状态失败: " + e.getMessage()); | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + @Operation(summary = "修改订单返利计算状态", description = "修改订单返利计算状态") | ||
| 169 | + @PostMapping("/{orderId}/rebateCalcFlag") | ||
| 170 | + @PreAuthorize("hasAuthority('order:edit')") | ||
| 171 | + public ApiRes<Void> updateRebateCalcFlag( | ||
| 172 | + @Parameter(description = "订单ID", required = true) @PathVariable Long orderId, | ||
| 173 | + @Parameter(description = "返利计算状态", required = true) @RequestParam Integer rebateCalcFlag) { | ||
| 174 | + try { | ||
| 175 | + boolean result = orderMainService.updateRebateCalcFlag(orderId, rebateCalcFlag); | ||
| 176 | + if (result) { | ||
| 177 | + return ApiRes.success("修改返利计算状态成功", null); | ||
| 178 | + } else { | ||
| 179 | + return ApiRes.error("修改返利计算状态失败"); | ||
| 180 | + } | ||
| 181 | + } catch (Exception e) { | ||
| 182 | + return ApiRes.error("修改返利计算状态失败: " + e.getMessage()); | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | +} |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import javax.validation.Valid; | ||
| 8 | +import javax.validation.constraints.NotBlank; | ||
| 9 | +import javax.validation.constraints.NotNull; | ||
| 10 | +import javax.validation.constraints.Size; | ||
| 11 | +import java.time.LocalDateTime; | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 出库新增请求DTO | ||
| 16 | + * | ||
| 17 | + * @author Apple ERP System | ||
| 18 | + * @since 2025-01-01 | ||
| 19 | + */ | ||
| 20 | +@Data | ||
| 21 | +@Schema(description = "出库新增请求DTO") | ||
| 22 | +public class DeliveryAddReq { | ||
| 23 | + | ||
| 24 | + @NotBlank(message = "出库单编号不能为空") | ||
| 25 | + @Schema(description = "出库单编号", required = true) | ||
| 26 | + private String deliveryNo; | ||
| 27 | + | ||
| 28 | + @NotBlank(message = "经销商编码不能为空") | ||
| 29 | + @Schema(description = "经销商编码", required = true) | ||
| 30 | + private String dealerCode; | ||
| 31 | + | ||
| 32 | + @NotBlank(message = "经销商名称不能为空") | ||
| 33 | + @Schema(description = "经销商名称", required = true) | ||
| 34 | + private String dealerName; | ||
| 35 | + | ||
| 36 | + @NotBlank(message = "关联订单编号不能为空") | ||
| 37 | + @Schema(description = "关联订单编号", required = true) | ||
| 38 | + private String orderNo; | ||
| 39 | + | ||
| 40 | + @NotNull(message = "出库日期不能为空") | ||
| 41 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 42 | + @Schema(description = "出库日期", required = true) | ||
| 43 | + private LocalDateTime deliveryDate; | ||
| 44 | + | ||
| 45 | + @Schema(description = "出库状态(0-未出库/1-已出库)") | ||
| 46 | + private Integer deliveryStatus; | ||
| 47 | + | ||
| 48 | + @Schema(description = "出库仓库编码") | ||
| 49 | + private String warehouseCode; | ||
| 50 | + | ||
| 51 | + @Schema(description = "数据来源") | ||
| 52 | + private String dataSource; | ||
| 53 | + | ||
| 54 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 55 | + @Schema(description = "数据上传时间") | ||
| 56 | + private LocalDateTime uploadTime; | ||
| 57 | + | ||
| 58 | + @Valid | ||
| 59 | + @Size(min = 1, message = "出库明细不能为空") | ||
| 60 | + @Schema(description = "出库明细列表", required = true) | ||
| 61 | + private List<DeliveryItemAddReq> deliveryItems; | ||
| 62 | +} | ||
| 63 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.constraints.NotBlank; | ||
| 7 | +import javax.validation.constraints.NotNull; | ||
| 8 | +import java.math.BigDecimal; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 出库明细新增请求DTO | ||
| 12 | + * | ||
| 13 | + * @author Apple ERP System | ||
| 14 | + * @since 2025-01-01 | ||
| 15 | + */ | ||
| 16 | +@Data | ||
| 17 | +@Schema(description = "出库明细新增请求DTO") | ||
| 18 | +public class DeliveryItemAddReq { | ||
| 19 | + | ||
| 20 | + @NotBlank(message = "产品编码不能为空") | ||
| 21 | + @Schema(description = "产品编码", required = true) | ||
| 22 | + private String productCode; | ||
| 23 | + | ||
| 24 | + @NotBlank(message = "产品名称不能为空") | ||
| 25 | + @Schema(description = "产品名称", required = true) | ||
| 26 | + private String productName; | ||
| 27 | + | ||
| 28 | + @NotNull(message = "出库数量不能为空") | ||
| 29 | + @Schema(description = "出库数量", required = true) | ||
| 30 | + private Integer deliveryQty; | ||
| 31 | + | ||
| 32 | + @NotNull(message = "出库单价不能为空") | ||
| 33 | + @Schema(description = "出库单价", required = true) | ||
| 34 | + private BigDecimal deliveryPrice; | ||
| 35 | + | ||
| 36 | + @Schema(description = "出库金额") | ||
| 37 | + private BigDecimal deliveryAmount; | ||
| 38 | +} | ||
| 39 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import java.math.BigDecimal; | ||
| 8 | +import java.time.LocalDateTime; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 出库明细响应DTO | ||
| 12 | + * | ||
| 13 | + * @author Apple ERP System | ||
| 14 | + * @since 2025-01-01 | ||
| 15 | + */ | ||
| 16 | +@Data | ||
| 17 | +@Schema(description = "出库明细响应DTO") | ||
| 18 | +public class DeliveryItemRes { | ||
| 19 | + | ||
| 20 | + @Schema(description = "出库明细ID") | ||
| 21 | + private Long deliveryItemId; | ||
| 22 | + | ||
| 23 | + @Schema(description = "关联出库单ID") | ||
| 24 | + private Long deliveryId; | ||
| 25 | + | ||
| 26 | + @Schema(description = "出库单编号") | ||
| 27 | + private String deliveryNo; | ||
| 28 | + | ||
| 29 | + @Schema(description = "关联订单编号") | ||
| 30 | + private String orderNo; | ||
| 31 | + | ||
| 32 | + @Schema(description = "产品编码") | ||
| 33 | + private String productCode; | ||
| 34 | + | ||
| 35 | + @Schema(description = "产品名称") | ||
| 36 | + private String productName; | ||
| 37 | + | ||
| 38 | + @Schema(description = "出库数量") | ||
| 39 | + private Integer deliveryQty; | ||
| 40 | + | ||
| 41 | + @Schema(description = "出库单价") | ||
| 42 | + private BigDecimal deliveryPrice; | ||
| 43 | + | ||
| 44 | + @Schema(description = "出库金额") | ||
| 45 | + private BigDecimal deliveryAmount; | ||
| 46 | + | ||
| 47 | + @Schema(description = "创建者") | ||
| 48 | + private String createBy; | ||
| 49 | + | ||
| 50 | + @Schema(description = "创建时间") | ||
| 51 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 52 | + private LocalDateTime createTime; | ||
| 53 | + | ||
| 54 | + @Schema(description = "更新者") | ||
| 55 | + private String updateBy; | ||
| 56 | + | ||
| 57 | + @Schema(description = "更新时间") | ||
| 58 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 59 | + private LocalDateTime updateTime; | ||
| 60 | +} | ||
| 61 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.constraints.NotBlank; | ||
| 7 | +import javax.validation.constraints.NotNull; | ||
| 8 | +import java.math.BigDecimal; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 出库明细修改请求DTO | ||
| 12 | + * | ||
| 13 | + * @author Apple ERP System | ||
| 14 | + * @since 2025-01-01 | ||
| 15 | + */ | ||
| 16 | +@Data | ||
| 17 | +@Schema(description = "出库明细修改请求DTO") | ||
| 18 | +public class DeliveryItemUpdateReq { | ||
| 19 | + | ||
| 20 | + @Schema(description = "出库明细ID") | ||
| 21 | + private Long deliveryItemId; // 修改时可能需要,新增时不需要 | ||
| 22 | + | ||
| 23 | + @NotBlank(message = "产品编码不能为空") | ||
| 24 | + @Schema(description = "产品编码", required = true) | ||
| 25 | + private String productCode; | ||
| 26 | + | ||
| 27 | + @NotBlank(message = "产品名称不能为空") | ||
| 28 | + @Schema(description = "产品名称", required = true) | ||
| 29 | + private String productName; | ||
| 30 | + | ||
| 31 | + @NotNull(message = "出库数量不能为空") | ||
| 32 | + @Schema(description = "出库数量", required = true) | ||
| 33 | + private Integer deliveryQty; | ||
| 34 | + | ||
| 35 | + @NotNull(message = "出库单价不能为空") | ||
| 36 | + @Schema(description = "出库单价", required = true) | ||
| 37 | + private BigDecimal deliveryPrice; | ||
| 38 | + | ||
| 39 | + @Schema(description = "出库金额") | ||
| 40 | + private BigDecimal deliveryAmount; | ||
| 41 | +} | ||
| 42 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 出库查询请求DTO | ||
| 8 | + * | ||
| 9 | + * @author Apple ERP System | ||
| 10 | + * @since 2025-01-01 | ||
| 11 | + */ | ||
| 12 | +@Data | ||
| 13 | +@Schema(description = "出库查询请求DTO") | ||
| 14 | +public class DeliveryQueryReq { | ||
| 15 | + | ||
| 16 | + @Schema(description = "出库单编号") | ||
| 17 | + private String deliveryNo; | ||
| 18 | + | ||
| 19 | + @Schema(description = "经销商编码") | ||
| 20 | + private String dealerCode; | ||
| 21 | + | ||
| 22 | + @Schema(description = "经销商名称") | ||
| 23 | + private String dealerName; | ||
| 24 | + | ||
| 25 | + @Schema(description = "关联订单编号") | ||
| 26 | + private String orderNo; | ||
| 27 | + | ||
| 28 | + @Schema(description = "出库状态(0-未出库/1-已出库)") | ||
| 29 | + private Integer deliveryStatus; | ||
| 30 | + | ||
| 31 | + @Schema(description = "出库仓库编码") | ||
| 32 | + private String warehouseCode; | ||
| 33 | + | ||
| 34 | + @Schema(description = "数据来源") | ||
| 35 | + private String dataSource; | ||
| 36 | + | ||
| 37 | + @Schema(description = "出库开始日期") | ||
| 38 | + private String deliveryStartDate; | ||
| 39 | + | ||
| 40 | + @Schema(description = "出库结束日期") | ||
| 41 | + private String deliveryEndDate; | ||
| 42 | + | ||
| 43 | + @Schema(description = "页码") | ||
| 44 | + private Integer pageNum = 1; | ||
| 45 | + | ||
| 46 | + @Schema(description = "每页大小") | ||
| 47 | + private Integer pageSize = 10; | ||
| 48 | +} |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import java.time.LocalDateTime; | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 出库响应DTO | ||
| 12 | + * | ||
| 13 | + * @author Apple ERP System | ||
| 14 | + * @since 2025-01-01 | ||
| 15 | + */ | ||
| 16 | +@Data | ||
| 17 | +@Schema(description = "出库响应DTO") | ||
| 18 | +public class DeliveryRes { | ||
| 19 | + | ||
| 20 | + @Schema(description = "出库单ID") | ||
| 21 | + private Long deliveryId; | ||
| 22 | + | ||
| 23 | + @Schema(description = "出库单编号") | ||
| 24 | + private String deliveryNo; | ||
| 25 | + | ||
| 26 | + @Schema(description = "经销商编码") | ||
| 27 | + private String dealerCode; | ||
| 28 | + | ||
| 29 | + @Schema(description = "经销商名称") | ||
| 30 | + private String dealerName; | ||
| 31 | + | ||
| 32 | + @Schema(description = "关联订单编号") | ||
| 33 | + private String orderNo; | ||
| 34 | + | ||
| 35 | + @Schema(description = "出库日期") | ||
| 36 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 37 | + private LocalDateTime deliveryDate; | ||
| 38 | + | ||
| 39 | + @Schema(description = "出库状态(0-未出库/1-已出库)") | ||
| 40 | + private Integer deliveryStatus; | ||
| 41 | + | ||
| 42 | + @Schema(description = "出库仓库编码") | ||
| 43 | + private String warehouseCode; | ||
| 44 | + | ||
| 45 | + @Schema(description = "数据来源") | ||
| 46 | + private String dataSource; | ||
| 47 | + | ||
| 48 | + @Schema(description = "数据上传时间") | ||
| 49 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 50 | + private LocalDateTime uploadTime; | ||
| 51 | + | ||
| 52 | + @Schema(description = "创建者") | ||
| 53 | + private String createBy; | ||
| 54 | + | ||
| 55 | + @Schema(description = "创建时间") | ||
| 56 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 57 | + private LocalDateTime createTime; | ||
| 58 | + | ||
| 59 | + @Schema(description = "更新者") | ||
| 60 | + private String updateBy; | ||
| 61 | + | ||
| 62 | + @Schema(description = "更新时间") | ||
| 63 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 64 | + private LocalDateTime updateTime; | ||
| 65 | + | ||
| 66 | + @Schema(description = "出库明细列表") | ||
| 67 | + private List<DeliveryItemRes> deliveryItems; | ||
| 68 | +} | ||
| 69 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import javax.validation.Valid; | ||
| 8 | +import javax.validation.constraints.NotBlank; | ||
| 9 | +import javax.validation.constraints.NotNull; | ||
| 10 | +import javax.validation.constraints.Size; | ||
| 11 | +import java.time.LocalDateTime; | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 出库修改请求DTO | ||
| 16 | + * | ||
| 17 | + * @author Apple ERP System | ||
| 18 | + * @since 2025-01-01 | ||
| 19 | + */ | ||
| 20 | +@Data | ||
| 21 | +@Schema(description = "出库修改请求DTO") | ||
| 22 | +public class DeliveryUpdateReq { | ||
| 23 | + | ||
| 24 | + @NotNull(message = "出库单ID不能为空") | ||
| 25 | + @Schema(description = "出库单ID", required = true) | ||
| 26 | + private Long deliveryId; | ||
| 27 | + | ||
| 28 | + @NotBlank(message = "出库单编号不能为空") | ||
| 29 | + @Schema(description = "出库单编号", required = true) | ||
| 30 | + private String deliveryNo; | ||
| 31 | + | ||
| 32 | + @NotBlank(message = "经销商编码不能为空") | ||
| 33 | + @Schema(description = "经销商编码", required = true) | ||
| 34 | + private String dealerCode; | ||
| 35 | + | ||
| 36 | + @NotBlank(message = "经销商名称不能为空") | ||
| 37 | + @Schema(description = "经销商名称", required = true) | ||
| 38 | + private String dealerName; | ||
| 39 | + | ||
| 40 | + @NotBlank(message = "关联订单编号不能为空") | ||
| 41 | + @Schema(description = "关联订单编号", required = true) | ||
| 42 | + private String orderNo; | ||
| 43 | + | ||
| 44 | + @NotNull(message = "出库日期不能为空") | ||
| 45 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 46 | + @Schema(description = "出库日期", required = true) | ||
| 47 | + private LocalDateTime deliveryDate; | ||
| 48 | + | ||
| 49 | + @Schema(description = "出库状态(0-未出库/1-已出库)") | ||
| 50 | + private Integer deliveryStatus; | ||
| 51 | + | ||
| 52 | + @Schema(description = "出库仓库编码") | ||
| 53 | + private String warehouseCode; | ||
| 54 | + | ||
| 55 | + @Schema(description = "数据来源") | ||
| 56 | + private String dataSource; | ||
| 57 | + | ||
| 58 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 59 | + @Schema(description = "数据上传时间") | ||
| 60 | + private LocalDateTime uploadTime; | ||
| 61 | + | ||
| 62 | + @Valid | ||
| 63 | + @Size(min = 1, message = "出库明细不能为空") | ||
| 64 | + @Schema(description = "出库明细列表", required = true) | ||
| 65 | + private List<DeliveryItemUpdateReq> deliveryItems; | ||
| 66 | +} | ||
| 67 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import javax.validation.Valid; | ||
| 8 | +import javax.validation.constraints.NotBlank; | ||
| 9 | +import javax.validation.constraints.NotNull; | ||
| 10 | +import javax.validation.constraints.Size; | ||
| 11 | +import java.math.BigDecimal; | ||
| 12 | +import java.time.LocalDate; | ||
| 13 | +import java.time.LocalDateTime; | ||
| 14 | +import java.util.List; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * 发票新增请求DTO | ||
| 18 | + * | ||
| 19 | + * @author Apple ERP System | ||
| 20 | + * @since 2025-01-01 | ||
| 21 | + */ | ||
| 22 | +@Data | ||
| 23 | +@Schema(description = "发票新增请求DTO") | ||
| 24 | +public class InvoiceAddReq { | ||
| 25 | + | ||
| 26 | + @NotBlank(message = "发票编号不能为空") | ||
| 27 | + @Schema(description = "发票编号", required = true) | ||
| 28 | + private String invoiceNo; | ||
| 29 | + | ||
| 30 | + @NotBlank(message = "关联订单编号不能为空") | ||
| 31 | + @Schema(description = "关联订单编号", required = true) | ||
| 32 | + private String orderNo; | ||
| 33 | + | ||
| 34 | + @Schema(description = "关联出库单编号") | ||
| 35 | + private String deliveryNo; | ||
| 36 | + | ||
| 37 | + @NotBlank(message = "经销商编码不能为空") | ||
| 38 | + @Schema(description = "经销商编码", required = true) | ||
| 39 | + private String dealerCode; | ||
| 40 | + | ||
| 41 | + @NotBlank(message = "经销商名称不能为空") | ||
| 42 | + @Schema(description = "经销商名称", required = true) | ||
| 43 | + private String dealerName; | ||
| 44 | + | ||
| 45 | + @NotNull(message = "发票总金额不能为空") | ||
| 46 | + @Schema(description = "发票总金额(含税)", required = true) | ||
| 47 | + private BigDecimal totalAmount; | ||
| 48 | + | ||
| 49 | + @NotNull(message = "开票日期不能为空") | ||
| 50 | + @JsonFormat(pattern = "yyyy-MM-dd") | ||
| 51 | + @Schema(description = "开票日期", required = true) | ||
| 52 | + private LocalDate invoiceDate; | ||
| 53 | + | ||
| 54 | + @Schema(description = "发票状态(0-未开票/1-已开票)") | ||
| 55 | + private Integer invoiceStatus; | ||
| 56 | + | ||
| 57 | + @Schema(description = "税率") | ||
| 58 | + private BigDecimal taxRate; | ||
| 59 | + | ||
| 60 | + @Schema(description = "数据来源") | ||
| 61 | + private String dataSource; | ||
| 62 | + | ||
| 63 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 64 | + @Schema(description = "数据上传时间") | ||
| 65 | + private LocalDateTime uploadTime; | ||
| 66 | + | ||
| 67 | + @Valid | ||
| 68 | + @Size(min = 1, message = "发票明细不能为空") | ||
| 69 | + @Schema(description = "发票明细列表", required = true) | ||
| 70 | + private List<InvoiceItemAddReq> invoiceItems; | ||
| 71 | +} | ||
| 72 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.constraints.NotBlank; | ||
| 7 | +import javax.validation.constraints.NotNull; | ||
| 8 | +import java.math.BigDecimal; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 发票明细新增请求DTO | ||
| 12 | + * | ||
| 13 | + * @author Apple ERP System | ||
| 14 | + * @since 2025-01-01 | ||
| 15 | + */ | ||
| 16 | +@Data | ||
| 17 | +@Schema(description = "发票明细新增请求DTO") | ||
| 18 | +public class InvoiceItemAddReq { | ||
| 19 | + | ||
| 20 | + @NotBlank(message = "产品编码不能为空") | ||
| 21 | + @Schema(description = "产品编码", required = true) | ||
| 22 | + private String productCode; | ||
| 23 | + | ||
| 24 | + @NotBlank(message = "产品名称不能为空") | ||
| 25 | + @Schema(description = "产品名称", required = true) | ||
| 26 | + private String productName; | ||
| 27 | + | ||
| 28 | + @NotNull(message = "开票数量不能为空") | ||
| 29 | + @Schema(description = "开票数量", required = true) | ||
| 30 | + private Integer invoiceQty; | ||
| 31 | + | ||
| 32 | + @NotNull(message = "不含税单价不能为空") | ||
| 33 | + @Schema(description = "不含税单价", required = true) | ||
| 34 | + private BigDecimal unitPriceNoTax; | ||
| 35 | + | ||
| 36 | + @NotNull(message = "不含税明细金额不能为空") | ||
| 37 | + @Schema(description = "不含税明细金额", required = true) | ||
| 38 | + private BigDecimal amountNoTax; | ||
| 39 | + | ||
| 40 | + @NotNull(message = "税额不能为空") | ||
| 41 | + @Schema(description = "税额", required = true) | ||
| 42 | + private BigDecimal taxAmount; | ||
| 43 | +} | ||
| 44 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import java.math.BigDecimal; | ||
| 8 | +import java.time.LocalDateTime; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 发票明细响应DTO | ||
| 12 | + * | ||
| 13 | + * @author Apple ERP System | ||
| 14 | + * @since 2025-01-01 | ||
| 15 | + */ | ||
| 16 | +@Data | ||
| 17 | +@Schema(description = "发票明细响应DTO") | ||
| 18 | +public class InvoiceItemRes { | ||
| 19 | + | ||
| 20 | + @Schema(description = "发票明细ID") | ||
| 21 | + private Long invoiceItemId; | ||
| 22 | + | ||
| 23 | + @Schema(description = "关联发票ID") | ||
| 24 | + private Long invoiceId; | ||
| 25 | + | ||
| 26 | + @Schema(description = "发票编号") | ||
| 27 | + private String invoiceNo; | ||
| 28 | + | ||
| 29 | + @Schema(description = "关联订单编号") | ||
| 30 | + private String orderNo; | ||
| 31 | + | ||
| 32 | + @Schema(description = "产品编码") | ||
| 33 | + private String productCode; | ||
| 34 | + | ||
| 35 | + @Schema(description = "产品名称") | ||
| 36 | + private String productName; | ||
| 37 | + | ||
| 38 | + @Schema(description = "开票数量") | ||
| 39 | + private Integer invoiceQty; | ||
| 40 | + | ||
| 41 | + @Schema(description = "不含税单价") | ||
| 42 | + private BigDecimal unitPriceNoTax; | ||
| 43 | + | ||
| 44 | + @Schema(description = "不含税明细金额") | ||
| 45 | + private BigDecimal amountNoTax; | ||
| 46 | + | ||
| 47 | + @Schema(description = "税额") | ||
| 48 | + private BigDecimal taxAmount; | ||
| 49 | + | ||
| 50 | + @Schema(description = "创建者") | ||
| 51 | + private String createBy; | ||
| 52 | + | ||
| 53 | + @Schema(description = "创建时间") | ||
| 54 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 55 | + private LocalDateTime createTime; | ||
| 56 | + | ||
| 57 | + @Schema(description = "更新者") | ||
| 58 | + private String updateBy; | ||
| 59 | + | ||
| 60 | + @Schema(description = "更新时间") | ||
| 61 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 62 | + private LocalDateTime updateTime; | ||
| 63 | +} | ||
| 64 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.constraints.NotBlank; | ||
| 7 | +import javax.validation.constraints.NotNull; | ||
| 8 | +import java.math.BigDecimal; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 发票明细修改请求DTO | ||
| 12 | + * | ||
| 13 | + * @author Apple ERP System | ||
| 14 | + * @since 2025-01-01 | ||
| 15 | + */ | ||
| 16 | +@Data | ||
| 17 | +@Schema(description = "发票明细修改请求DTO") | ||
| 18 | +public class InvoiceItemUpdateReq { | ||
| 19 | + | ||
| 20 | + @Schema(description = "发票明细ID") | ||
| 21 | + private Long invoiceItemId; // 修改时可能需要,新增时不需要 | ||
| 22 | + | ||
| 23 | + @NotBlank(message = "产品编码不能为空") | ||
| 24 | + @Schema(description = "产品编码", required = true) | ||
| 25 | + private String productCode; | ||
| 26 | + | ||
| 27 | + @NotBlank(message = "产品名称不能为空") | ||
| 28 | + @Schema(description = "产品名称", required = true) | ||
| 29 | + private String productName; | ||
| 30 | + | ||
| 31 | + @NotNull(message = "开票数量不能为空") | ||
| 32 | + @Schema(description = "开票数量", required = true) | ||
| 33 | + private Integer invoiceQty; | ||
| 34 | + | ||
| 35 | + @NotNull(message = "不含税单价不能为空") | ||
| 36 | + @Schema(description = "不含税单价", required = true) | ||
| 37 | + private BigDecimal unitPriceNoTax; | ||
| 38 | + | ||
| 39 | + @NotNull(message = "不含税明细金额不能为空") | ||
| 40 | + @Schema(description = "不含税明细金额", required = true) | ||
| 41 | + private BigDecimal amountNoTax; | ||
| 42 | + | ||
| 43 | + @NotNull(message = "税额不能为空") | ||
| 44 | + @Schema(description = "税额", required = true) | ||
| 45 | + private BigDecimal taxAmount; | ||
| 46 | +} | ||
| 47 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.math.BigDecimal; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 发票查询请求DTO | ||
| 10 | + * | ||
| 11 | + * @author Apple ERP System | ||
| 12 | + * @since 2025-01-01 | ||
| 13 | + */ | ||
| 14 | +@Data | ||
| 15 | +@Schema(description = "发票查询请求DTO") | ||
| 16 | +public class InvoiceQueryReq { | ||
| 17 | + | ||
| 18 | + @Schema(description = "发票编号") | ||
| 19 | + private String invoiceNo; | ||
| 20 | + | ||
| 21 | + @Schema(description = "关联订单编号") | ||
| 22 | + private String orderNo; | ||
| 23 | + | ||
| 24 | + @Schema(description = "关联出库单编号") | ||
| 25 | + private String deliveryNo; | ||
| 26 | + | ||
| 27 | + @Schema(description = "经销商编码") | ||
| 28 | + private String dealerCode; | ||
| 29 | + | ||
| 30 | + @Schema(description = "经销商名称") | ||
| 31 | + private String dealerName; | ||
| 32 | + | ||
| 33 | + @Schema(description = "发票状态(0-未开票/1-已开票)") | ||
| 34 | + private Integer invoiceStatus; | ||
| 35 | + | ||
| 36 | + @Schema(description = "数据来源") | ||
| 37 | + private String dataSource; | ||
| 38 | + | ||
| 39 | + @Schema(description = "开票开始日期") | ||
| 40 | + private String invoiceStartDate; | ||
| 41 | + | ||
| 42 | + @Schema(description = "开票结束日期") | ||
| 43 | + private String invoiceEndDate; | ||
| 44 | + | ||
| 45 | + @Schema(description = "金额最小值") | ||
| 46 | + private BigDecimal minAmount; | ||
| 47 | + | ||
| 48 | + @Schema(description = "金额最大值") | ||
| 49 | + private BigDecimal maxAmount; | ||
| 50 | + | ||
| 51 | + @Schema(description = "页码") | ||
| 52 | + private Integer pageNum = 1; | ||
| 53 | + | ||
| 54 | + @Schema(description = "每页大小") | ||
| 55 | + private Integer pageSize = 10; | ||
| 56 | +} | ||
| 57 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import java.math.BigDecimal; | ||
| 8 | +import java.time.LocalDate; | ||
| 9 | +import java.time.LocalDateTime; | ||
| 10 | +import java.util.List; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 发票响应DTO | ||
| 14 | + * | ||
| 15 | + * @author Apple ERP System | ||
| 16 | + * @since 2025-01-01 | ||
| 17 | + */ | ||
| 18 | +@Data | ||
| 19 | +@Schema(description = "发票响应DTO") | ||
| 20 | +public class InvoiceRes { | ||
| 21 | + | ||
| 22 | + @Schema(description = "发票ID") | ||
| 23 | + private Long invoiceId; | ||
| 24 | + | ||
| 25 | + @Schema(description = "发票编号") | ||
| 26 | + private String invoiceNo; | ||
| 27 | + | ||
| 28 | + @Schema(description = "关联订单编号") | ||
| 29 | + private String orderNo; | ||
| 30 | + | ||
| 31 | + @Schema(description = "关联出库单编号") | ||
| 32 | + private String deliveryNo; | ||
| 33 | + | ||
| 34 | + @Schema(description = "经销商编码") | ||
| 35 | + private String dealerCode; | ||
| 36 | + | ||
| 37 | + @Schema(description = "经销商名称") | ||
| 38 | + private String dealerName; | ||
| 39 | + | ||
| 40 | + @Schema(description = "发票总金额(含税)") | ||
| 41 | + private BigDecimal totalAmount; | ||
| 42 | + | ||
| 43 | + @Schema(description = "开票日期") | ||
| 44 | + @JsonFormat(pattern = "yyyy-MM-dd") | ||
| 45 | + private LocalDate invoiceDate; | ||
| 46 | + | ||
| 47 | + @Schema(description = "发票状态(0-未开票/1-已开票)") | ||
| 48 | + private Integer invoiceStatus; | ||
| 49 | + | ||
| 50 | + @Schema(description = "税率") | ||
| 51 | + private BigDecimal taxRate; | ||
| 52 | + | ||
| 53 | + @Schema(description = "数据来源") | ||
| 54 | + private String dataSource; | ||
| 55 | + | ||
| 56 | + @Schema(description = "数据上传时间") | ||
| 57 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 58 | + private LocalDateTime uploadTime; | ||
| 59 | + | ||
| 60 | + @Schema(description = "创建者") | ||
| 61 | + private String createBy; | ||
| 62 | + | ||
| 63 | + @Schema(description = "创建时间") | ||
| 64 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 65 | + private LocalDateTime createTime; | ||
| 66 | + | ||
| 67 | + @Schema(description = "更新者") | ||
| 68 | + private String updateBy; | ||
| 69 | + | ||
| 70 | + @Schema(description = "更新时间") | ||
| 71 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 72 | + private LocalDateTime updateTime; | ||
| 73 | + | ||
| 74 | + @Schema(description = "发票明细列表") | ||
| 75 | + private List<InvoiceItemRes> invoiceItems; | ||
| 76 | +} | ||
| 77 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import javax.validation.Valid; | ||
| 8 | +import javax.validation.constraints.NotBlank; | ||
| 9 | +import javax.validation.constraints.NotNull; | ||
| 10 | +import javax.validation.constraints.Size; | ||
| 11 | +import java.math.BigDecimal; | ||
| 12 | +import java.time.LocalDate; | ||
| 13 | +import java.time.LocalDateTime; | ||
| 14 | +import java.util.List; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * 发票修改请求DTO | ||
| 18 | + * | ||
| 19 | + * @author Apple ERP System | ||
| 20 | + * @since 2025-01-01 | ||
| 21 | + */ | ||
| 22 | +@Data | ||
| 23 | +@Schema(description = "发票修改请求DTO") | ||
| 24 | +public class InvoiceUpdateReq { | ||
| 25 | + | ||
| 26 | + @NotNull(message = "发票ID不能为空") | ||
| 27 | + @Schema(description = "发票ID", required = true) | ||
| 28 | + private Long invoiceId; | ||
| 29 | + | ||
| 30 | + @NotBlank(message = "发票编号不能为空") | ||
| 31 | + @Schema(description = "发票编号", required = true) | ||
| 32 | + private String invoiceNo; | ||
| 33 | + | ||
| 34 | + @NotBlank(message = "关联订单编号不能为空") | ||
| 35 | + @Schema(description = "关联订单编号", required = true) | ||
| 36 | + private String orderNo; | ||
| 37 | + | ||
| 38 | + @Schema(description = "关联出库单编号") | ||
| 39 | + private String deliveryNo; | ||
| 40 | + | ||
| 41 | + @NotBlank(message = "经销商编码不能为空") | ||
| 42 | + @Schema(description = "经销商编码", required = true) | ||
| 43 | + private String dealerCode; | ||
| 44 | + | ||
| 45 | + @NotBlank(message = "经销商名称不能为空") | ||
| 46 | + @Schema(description = "经销商名称", required = true) | ||
| 47 | + private String dealerName; | ||
| 48 | + | ||
| 49 | + @NotNull(message = "发票总金额不能为空") | ||
| 50 | + @Schema(description = "发票总金额(含税)", required = true) | ||
| 51 | + private BigDecimal totalAmount; | ||
| 52 | + | ||
| 53 | + @NotNull(message = "开票日期不能为空") | ||
| 54 | + @JsonFormat(pattern = "yyyy-MM-dd") | ||
| 55 | + @Schema(description = "开票日期", required = true) | ||
| 56 | + private LocalDate invoiceDate; | ||
| 57 | + | ||
| 58 | + @Schema(description = "发票状态(0-未开票/1-已开票)") | ||
| 59 | + private Integer invoiceStatus; | ||
| 60 | + | ||
| 61 | + @Schema(description = "税率") | ||
| 62 | + private BigDecimal taxRate; | ||
| 63 | + | ||
| 64 | + @Schema(description = "数据来源") | ||
| 65 | + private String dataSource; | ||
| 66 | + | ||
| 67 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 68 | + @Schema(description = "数据上传时间") | ||
| 69 | + private LocalDateTime uploadTime; | ||
| 70 | + | ||
| 71 | + @Valid | ||
| 72 | + @Size(min = 1, message = "发票明细不能为空") | ||
| 73 | + @Schema(description = "发票明细列表", required = true) | ||
| 74 | + private List<InvoiceItemUpdateReq> invoiceItems; | ||
| 75 | +} | ||
| 76 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.Valid; | ||
| 7 | +import javax.validation.constraints.NotBlank; | ||
| 8 | +import javax.validation.constraints.NotEmpty; | ||
| 9 | +import javax.validation.constraints.NotNull; | ||
| 10 | +import java.math.BigDecimal; | ||
| 11 | +import java.time.LocalDateTime; | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 订单新增请求DTO | ||
| 16 | + * | ||
| 17 | + * @author Apple ERP System | ||
| 18 | + * @since 2025-01-01 | ||
| 19 | + */ | ||
| 20 | +@Data | ||
| 21 | +@Schema(description = "订单新增请求DTO") | ||
| 22 | +public class OrderAddReq { | ||
| 23 | + | ||
| 24 | + @NotBlank(message = "订单编号不能为空") | ||
| 25 | + @Schema(description = "订单编号", required = true) | ||
| 26 | + private String orderNo; | ||
| 27 | + | ||
| 28 | + @NotBlank(message = "经销商编码不能为空") | ||
| 29 | + @Schema(description = "经销商编码", required = true) | ||
| 30 | + private String dealerCode; | ||
| 31 | + | ||
| 32 | + @NotBlank(message = "经销商名称不能为空") | ||
| 33 | + @Schema(description = "经销商名称", required = true) | ||
| 34 | + private String dealerName; | ||
| 35 | + | ||
| 36 | + @NotNull(message = "订单日期不能为空") | ||
| 37 | + @Schema(description = "订单创建日期", required = true) | ||
| 38 | + private LocalDateTime orderDate; | ||
| 39 | + | ||
| 40 | + @NotNull(message = "订单总金额不能为空") | ||
| 41 | + @Schema(description = "订单总金额", required = true) | ||
| 42 | + private BigDecimal totalAmount; | ||
| 43 | + | ||
| 44 | + @Schema(description = "订单返利金额") | ||
| 45 | + private BigDecimal rebateAmount; | ||
| 46 | + | ||
| 47 | + @Schema(description = "出库状态(0-未出库/1-已出库)") | ||
| 48 | + private Integer deliveryStatus = 0; | ||
| 49 | + | ||
| 50 | + @Schema(description = "开票状态(0-未开票/1-已开票)") | ||
| 51 | + private Integer invoiceStatus = 0; | ||
| 52 | + | ||
| 53 | + @Schema(description = "返利计算状态(0-未计算/1-已计算)") | ||
| 54 | + private Integer rebateCalcFlag = 0; | ||
| 55 | + | ||
| 56 | + @Schema(description = "数据来源") | ||
| 57 | + private String dataSource; | ||
| 58 | + | ||
| 59 | + @Schema(description = "数据验证状态(0-待验证/1-验证通过/2-验证失败)") | ||
| 60 | + private Integer verifyStatus = 0; | ||
| 61 | + | ||
| 62 | + @Schema(description = "数据上传时间") | ||
| 63 | + private LocalDateTime uploadTime; | ||
| 64 | + | ||
| 65 | + @NotEmpty(message = "订单明细不能为空") | ||
| 66 | + @Valid | ||
| 67 | + @Schema(description = "订单明细列表", required = true) | ||
| 68 | + private List<OrderItemAddReq> orderItems; | ||
| 69 | +} | ||
| 70 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.constraints.NotBlank; | ||
| 7 | +import javax.validation.constraints.NotNull; | ||
| 8 | +import javax.validation.constraints.Positive; | ||
| 9 | +import java.math.BigDecimal; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 订单明细新增请求DTO | ||
| 13 | + * | ||
| 14 | + * @author Apple ERP System | ||
| 15 | + * @since 2025-01-01 | ||
| 16 | + */ | ||
| 17 | +@Data | ||
| 18 | +@Schema(description = "订单明细新增请求DTO") | ||
| 19 | +public class OrderItemAddReq { | ||
| 20 | + | ||
| 21 | + @NotBlank(message = "产品编码不能为空") | ||
| 22 | + @Schema(description = "产品编码", required = true) | ||
| 23 | + private String productCode; | ||
| 24 | + | ||
| 25 | + @NotBlank(message = "产品名称不能为空") | ||
| 26 | + @Schema(description = "产品名称", required = true) | ||
| 27 | + private String productName; | ||
| 28 | + | ||
| 29 | + @NotNull(message = "产品单价不能为空") | ||
| 30 | + @Schema(description = "产品单价", required = true) | ||
| 31 | + private BigDecimal unitPrice; | ||
| 32 | + | ||
| 33 | + @NotNull(message = "商品数量不能为空") | ||
| 34 | + @Positive(message = "商品数量必须大于0") | ||
| 35 | + @Schema(description = "商品数量", required = true) | ||
| 36 | + private Integer productQty; | ||
| 37 | + | ||
| 38 | + @Schema(description = "商品明细金额") | ||
| 39 | + private BigDecimal itemAmount; | ||
| 40 | +} | ||
| 41 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.math.BigDecimal; | ||
| 7 | +import java.time.LocalDateTime; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 订单明细响应DTO | ||
| 11 | + * | ||
| 12 | + * @author Apple ERP System | ||
| 13 | + * @since 2025-01-01 | ||
| 14 | + */ | ||
| 15 | +@Data | ||
| 16 | +@Schema(description = "订单明细响应DTO") | ||
| 17 | +public class OrderItemRes { | ||
| 18 | + | ||
| 19 | + @Schema(description = "明细ID") | ||
| 20 | + private Long itemId; | ||
| 21 | + | ||
| 22 | + @Schema(description = "订单ID") | ||
| 23 | + private Long orderId; | ||
| 24 | + | ||
| 25 | + @Schema(description = "订单编号") | ||
| 26 | + private String orderNo; | ||
| 27 | + | ||
| 28 | + @Schema(description = "产品编码") | ||
| 29 | + private String productCode; | ||
| 30 | + | ||
| 31 | + @Schema(description = "产品名称") | ||
| 32 | + private String productName; | ||
| 33 | + | ||
| 34 | + @Schema(description = "产品单价") | ||
| 35 | + private BigDecimal unitPrice; | ||
| 36 | + | ||
| 37 | + @Schema(description = "商品数量") | ||
| 38 | + private Integer productQty; | ||
| 39 | + | ||
| 40 | + @Schema(description = "商品明细金额") | ||
| 41 | + private BigDecimal itemAmount; | ||
| 42 | + | ||
| 43 | + @Schema(description = "创建者") | ||
| 44 | + private String createBy; | ||
| 45 | + | ||
| 46 | + @Schema(description = "创建时间") | ||
| 47 | + private LocalDateTime createTime; | ||
| 48 | + | ||
| 49 | + @Schema(description = "更新者") | ||
| 50 | + private String updateBy; | ||
| 51 | + | ||
| 52 | + @Schema(description = "更新时间") | ||
| 53 | + private LocalDateTime updateTime; | ||
| 54 | +} | ||
| 55 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.constraints.NotBlank; | ||
| 7 | +import javax.validation.constraints.NotNull; | ||
| 8 | +import javax.validation.constraints.Positive; | ||
| 9 | +import java.math.BigDecimal; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 订单明细修改请求DTO | ||
| 13 | + * | ||
| 14 | + * @author Apple ERP System | ||
| 15 | + * @since 2025-01-01 | ||
| 16 | + */ | ||
| 17 | +@Data | ||
| 18 | +@Schema(description = "订单明细修改请求DTO") | ||
| 19 | +public class OrderItemUpdateReq { | ||
| 20 | + | ||
| 21 | + @Schema(description = "明细ID(新增时为空,修改时必填)") | ||
| 22 | + private Long itemId; | ||
| 23 | + | ||
| 24 | + @NotBlank(message = "产品编码不能为空") | ||
| 25 | + @Schema(description = "产品编码", required = true) | ||
| 26 | + private String productCode; | ||
| 27 | + | ||
| 28 | + @NotBlank(message = "产品名称不能为空") | ||
| 29 | + @Schema(description = "产品名称", required = true) | ||
| 30 | + private String productName; | ||
| 31 | + | ||
| 32 | + @NotNull(message = "产品单价不能为空") | ||
| 33 | + @Schema(description = "产品单价", required = true) | ||
| 34 | + private BigDecimal unitPrice; | ||
| 35 | + | ||
| 36 | + @NotNull(message = "商品数量不能为空") | ||
| 37 | + @Positive(message = "商品数量必须大于0") | ||
| 38 | + @Schema(description = "商品数量", required = true) | ||
| 39 | + private Integer productQty; | ||
| 40 | + | ||
| 41 | + @Schema(description = "商品明细金额") | ||
| 42 | + private BigDecimal itemAmount; | ||
| 43 | +} | ||
| 44 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.time.LocalDateTime; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 订单查询请求DTO | ||
| 10 | + * | ||
| 11 | + * @author Apple ERP System | ||
| 12 | + * @since 2025-01-01 | ||
| 13 | + */ | ||
| 14 | +@Data | ||
| 15 | +@Schema(description = "订单查询请求DTO") | ||
| 16 | +public class OrderQueryReq { | ||
| 17 | + | ||
| 18 | + @Schema(description = "订单编号") | ||
| 19 | + private String orderNo; | ||
| 20 | + | ||
| 21 | + @Schema(description = "经销商编码") | ||
| 22 | + private String dealerCode; | ||
| 23 | + | ||
| 24 | + @Schema(description = "经销商名称") | ||
| 25 | + private String dealerName; | ||
| 26 | + | ||
| 27 | + @Schema(description = "出库状态(0-未出库/1-已出库)") | ||
| 28 | + private Integer deliveryStatus; | ||
| 29 | + | ||
| 30 | + @Schema(description = "开票状态(0-未开票/1-已开票)") | ||
| 31 | + private Integer invoiceStatus; | ||
| 32 | + | ||
| 33 | + @Schema(description = "返利计算状态(0-未计算/1-已计算)") | ||
| 34 | + private Integer rebateCalcFlag; | ||
| 35 | + | ||
| 36 | + @Schema(description = "数据来源") | ||
| 37 | + private String dataSource; | ||
| 38 | + | ||
| 39 | + @Schema(description = "数据验证状态(0-待验证/1-验证通过/2-验证失败)") | ||
| 40 | + private Integer verifyStatus; | ||
| 41 | + | ||
| 42 | + @Schema(description = "订单开始日期") | ||
| 43 | + private LocalDateTime orderStartDate; | ||
| 44 | + | ||
| 45 | + @Schema(description = "订单结束日期") | ||
| 46 | + private LocalDateTime orderEndDate; | ||
| 47 | + | ||
| 48 | + @Schema(description = "金额最小值") | ||
| 49 | + private java.math.BigDecimal minAmount; | ||
| 50 | + | ||
| 51 | + @Schema(description = "金额最大值") | ||
| 52 | + private java.math.BigDecimal maxAmount; | ||
| 53 | + | ||
| 54 | + @Schema(description = "页码") | ||
| 55 | + private Integer pageNum = 1; | ||
| 56 | + | ||
| 57 | + @Schema(description = "每页大小") | ||
| 58 | + private Integer pageSize = 10; | ||
| 59 | +} | ||
| 60 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.math.BigDecimal; | ||
| 7 | +import java.time.LocalDateTime; | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 订单响应DTO | ||
| 12 | + * | ||
| 13 | + * @author Apple ERP System | ||
| 14 | + * @since 2025-01-01 | ||
| 15 | + */ | ||
| 16 | +@Data | ||
| 17 | +@Schema(description = "订单响应DTO") | ||
| 18 | +public class OrderRes { | ||
| 19 | + | ||
| 20 | + @Schema(description = "订单ID") | ||
| 21 | + private Long orderId; | ||
| 22 | + | ||
| 23 | + @Schema(description = "订单编号") | ||
| 24 | + private String orderNo; | ||
| 25 | + | ||
| 26 | + @Schema(description = "经销商编码") | ||
| 27 | + private String dealerCode; | ||
| 28 | + | ||
| 29 | + @Schema(description = "经销商名称") | ||
| 30 | + private String dealerName; | ||
| 31 | + | ||
| 32 | + @Schema(description = "订单创建日期") | ||
| 33 | + private LocalDateTime orderDate; | ||
| 34 | + | ||
| 35 | + @Schema(description = "订单总金额") | ||
| 36 | + private BigDecimal totalAmount; | ||
| 37 | + | ||
| 38 | + @Schema(description = "订单返利金额") | ||
| 39 | + private BigDecimal rebateAmount; | ||
| 40 | + | ||
| 41 | + @Schema(description = "出库状态(0-未出库/1-已出库)") | ||
| 42 | + private Integer deliveryStatus; | ||
| 43 | + | ||
| 44 | + @Schema(description = "开票状态(0-未开票/1-已开票)") | ||
| 45 | + private Integer invoiceStatus; | ||
| 46 | + | ||
| 47 | + @Schema(description = "返利计算状态(0-未计算/1-已计算)") | ||
| 48 | + private Integer rebateCalcFlag; | ||
| 49 | + | ||
| 50 | + @Schema(description = "数据来源") | ||
| 51 | + private String dataSource; | ||
| 52 | + | ||
| 53 | + @Schema(description = "数据验证状态(0-待验证/1-验证通过/2-验证失败)") | ||
| 54 | + private Integer verifyStatus; | ||
| 55 | + | ||
| 56 | + @Schema(description = "数据上传时间") | ||
| 57 | + private LocalDateTime uploadTime; | ||
| 58 | + | ||
| 59 | + @Schema(description = "创建者") | ||
| 60 | + private String createBy; | ||
| 61 | + | ||
| 62 | + @Schema(description = "创建时间") | ||
| 63 | + private LocalDateTime createTime; | ||
| 64 | + | ||
| 65 | + @Schema(description = "更新者") | ||
| 66 | + private String updateBy; | ||
| 67 | + | ||
| 68 | + @Schema(description = "更新时间") | ||
| 69 | + private LocalDateTime updateTime; | ||
| 70 | + | ||
| 71 | + @Schema(description = "订单明细列表") | ||
| 72 | + private List<OrderItemRes> orderItems; | ||
| 73 | +} | ||
| 74 | + |
| 1 | +package com.apple.erp.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.Valid; | ||
| 7 | +import javax.validation.constraints.NotBlank; | ||
| 8 | +import javax.validation.constraints.NotEmpty; | ||
| 9 | +import javax.validation.constraints.NotNull; | ||
| 10 | +import java.math.BigDecimal; | ||
| 11 | +import java.time.LocalDateTime; | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 订单修改请求DTO | ||
| 16 | + * | ||
| 17 | + * @author Apple ERP System | ||
| 18 | + * @since 2025-01-01 | ||
| 19 | + */ | ||
| 20 | +@Data | ||
| 21 | +@Schema(description = "订单修改请求DTO") | ||
| 22 | +public class OrderUpdateReq { | ||
| 23 | + | ||
| 24 | + @NotNull(message = "订单ID不能为空") | ||
| 25 | + @Schema(description = "订单ID", required = true) | ||
| 26 | + private Long orderId; | ||
| 27 | + | ||
| 28 | + @NotBlank(message = "订单编号不能为空") | ||
| 29 | + @Schema(description = "订单编号", required = true) | ||
| 30 | + private String orderNo; | ||
| 31 | + | ||
| 32 | + @NotBlank(message = "经销商编码不能为空") | ||
| 33 | + @Schema(description = "经销商编码", required = true) | ||
| 34 | + private String dealerCode; | ||
| 35 | + | ||
| 36 | + @NotBlank(message = "经销商名称不能为空") | ||
| 37 | + @Schema(description = "经销商名称", required = true) | ||
| 38 | + private String dealerName; | ||
| 39 | + | ||
| 40 | + @NotNull(message = "订单日期不能为空") | ||
| 41 | + @Schema(description = "订单创建日期", required = true) | ||
| 42 | + private LocalDateTime orderDate; | ||
| 43 | + | ||
| 44 | + @NotNull(message = "订单总金额不能为空") | ||
| 45 | + @Schema(description = "订单总金额", required = true) | ||
| 46 | + private BigDecimal totalAmount; | ||
| 47 | + | ||
| 48 | + @Schema(description = "订单返利金额") | ||
| 49 | + private BigDecimal rebateAmount; | ||
| 50 | + | ||
| 51 | + @Schema(description = "出库状态(0-未出库/1-已出库)") | ||
| 52 | + private Integer deliveryStatus; | ||
| 53 | + | ||
| 54 | + @Schema(description = "开票状态(0-未开票/1-已开票)") | ||
| 55 | + private Integer invoiceStatus; | ||
| 56 | + | ||
| 57 | + @Schema(description = "返利计算状态(0-未计算/1-已计算)") | ||
| 58 | + private Integer rebateCalcFlag; | ||
| 59 | + | ||
| 60 | + @Schema(description = "数据来源") | ||
| 61 | + private String dataSource; | ||
| 62 | + | ||
| 63 | + @Schema(description = "数据验证状态(0-待验证/1-验证通过/2-验证失败)") | ||
| 64 | + private Integer verifyStatus; | ||
| 65 | + | ||
| 66 | + @Schema(description = "数据上传时间") | ||
| 67 | + private LocalDateTime uploadTime; | ||
| 68 | + | ||
| 69 | + @NotEmpty(message = "订单明细不能为空") | ||
| 70 | + @Valid | ||
| 71 | + @Schema(description = "订单明细列表", required = true) | ||
| 72 | + private List<OrderItemUpdateReq> orderItems; | ||
| 73 | +} | ||
| 74 | + |
| 1 | +package com.apple.erp.entity; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 6 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 7 | +import lombok.Data; | ||
| 8 | +import lombok.EqualsAndHashCode; | ||
| 9 | + | ||
| 10 | +import java.math.BigDecimal; | ||
| 11 | +import java.time.LocalDateTime; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 出库商品明细表实体类 | ||
| 15 | + * | ||
| 16 | + * @author Apple ERP System | ||
| 17 | + * @since 2025-01-01 | ||
| 18 | + */ | ||
| 19 | +@Data | ||
| 20 | +@EqualsAndHashCode(callSuper = false) | ||
| 21 | +@TableName("t_delivery_item") | ||
| 22 | +@Schema(description = "出库商品明细表") | ||
| 23 | +public class DeliveryItem { | ||
| 24 | + | ||
| 25 | + @TableId(value = "delivery_item_id", type = IdType.AUTO) | ||
| 26 | + @Schema(description = "出库商品明细ID") | ||
| 27 | + private Long deliveryItemId; | ||
| 28 | + | ||
| 29 | + @Schema(description = "关联出库单ID") | ||
| 30 | + private Long deliveryId; | ||
| 31 | + | ||
| 32 | + @Schema(description = "出库单编号") | ||
| 33 | + private String deliveryNo; | ||
| 34 | + | ||
| 35 | + @Schema(description = "关联订单编号") | ||
| 36 | + private String orderNo; | ||
| 37 | + | ||
| 38 | + @Schema(description = "产品编码") | ||
| 39 | + private String productCode; | ||
| 40 | + | ||
| 41 | + @Schema(description = "产品名称") | ||
| 42 | + private String productName; | ||
| 43 | + | ||
| 44 | + @Schema(description = "出库数量") | ||
| 45 | + private Integer deliveryQty; | ||
| 46 | + | ||
| 47 | + @Schema(description = "出库单价") | ||
| 48 | + private BigDecimal deliveryPrice; | ||
| 49 | + | ||
| 50 | + @Schema(description = "出库金额") | ||
| 51 | + private BigDecimal deliveryAmount; | ||
| 52 | + | ||
| 53 | + @Schema(description = "创建者") | ||
| 54 | + private String createBy; | ||
| 55 | + | ||
| 56 | + @Schema(description = "创建时间") | ||
| 57 | + private LocalDateTime createTime; | ||
| 58 | + | ||
| 59 | + @Schema(description = "更新者") | ||
| 60 | + private String updateBy; | ||
| 61 | + | ||
| 62 | + @Schema(description = "更新时间") | ||
| 63 | + private LocalDateTime updateTime; | ||
| 64 | + | ||
| 65 | + @Schema(description = "删除标志(0代表存在 2代表删除)") | ||
| 66 | + private String delFlag; | ||
| 67 | +} | ||
| 68 | + |
| 1 | +package com.apple.erp.entity; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 6 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 7 | +import lombok.Data; | ||
| 8 | +import lombok.EqualsAndHashCode; | ||
| 9 | + | ||
| 10 | +import java.math.BigDecimal; | ||
| 11 | +import java.time.LocalDateTime; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 出库主表实体类 | ||
| 15 | + * | ||
| 16 | + * @author Apple ERP System | ||
| 17 | + * @since 2025-01-01 | ||
| 18 | + */ | ||
| 19 | +@Data | ||
| 20 | +@EqualsAndHashCode(callSuper = false) | ||
| 21 | +@TableName("t_delivery_main") | ||
| 22 | +@Schema(description = "出库主表") | ||
| 23 | +public class DeliveryMain { | ||
| 24 | + | ||
| 25 | + @TableId(value = "delivery_id", type = IdType.AUTO) | ||
| 26 | + @Schema(description = "出库单ID") | ||
| 27 | + private Long deliveryId; | ||
| 28 | + | ||
| 29 | + @Schema(description = "出库单编号") | ||
| 30 | + private String deliveryNo; | ||
| 31 | + | ||
| 32 | + @Schema(description = "经销商编码") | ||
| 33 | + private String dealerCode; | ||
| 34 | + | ||
| 35 | + @Schema(description = "经销商名称") | ||
| 36 | + private String dealerName; | ||
| 37 | + | ||
| 38 | + @Schema(description = "关联订单编号") | ||
| 39 | + private String orderNo; | ||
| 40 | + | ||
| 41 | + @Schema(description = "出库日期") | ||
| 42 | + private LocalDateTime deliveryDate; | ||
| 43 | + | ||
| 44 | + @Schema(description = "出库状态(0-未出库/1-已出库)") | ||
| 45 | + private Integer deliveryStatus; | ||
| 46 | + | ||
| 47 | + @Schema(description = "出库总金额") | ||
| 48 | + private BigDecimal totalAmount; | ||
| 49 | + | ||
| 50 | + @Schema(description = "仓库编码") | ||
| 51 | + private String warehouseCode; | ||
| 52 | + | ||
| 53 | + @Schema(description = "仓库名称") | ||
| 54 | + private String warehouseName; | ||
| 55 | + | ||
| 56 | + @Schema(description = "数据来源") | ||
| 57 | + private String dataSource; | ||
| 58 | + | ||
| 59 | + @Schema(description = "上传时间") | ||
| 60 | + private LocalDateTime uploadTime; | ||
| 61 | + | ||
| 62 | + @Schema(description = "创建者") | ||
| 63 | + private String createBy; | ||
| 64 | + | ||
| 65 | + @Schema(description = "创建时间") | ||
| 66 | + private LocalDateTime createTime; | ||
| 67 | + | ||
| 68 | + @Schema(description = "更新者") | ||
| 69 | + private String updateBy; | ||
| 70 | + | ||
| 71 | + @Schema(description = "更新时间") | ||
| 72 | + private LocalDateTime updateTime; | ||
| 73 | + | ||
| 74 | + @Schema(description = "删除标志(0代表存在 2代表删除)") | ||
| 75 | + private String delFlag; | ||
| 76 | +} |
| 1 | +package com.apple.erp.entity; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 7 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 8 | +import lombok.Data; | ||
| 9 | +import lombok.EqualsAndHashCode; | ||
| 10 | + | ||
| 11 | +import java.math.BigDecimal; | ||
| 12 | +import java.time.LocalDateTime; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 发票商品明细表实体类 | ||
| 16 | + * | ||
| 17 | + * @author Apple ERP System | ||
| 18 | + * @since 2025-01-01 | ||
| 19 | + */ | ||
| 20 | +@Data | ||
| 21 | +@EqualsAndHashCode(callSuper = false) | ||
| 22 | +@TableName("t_invoice_item") | ||
| 23 | +@Schema(description = "发票商品明细表") | ||
| 24 | +public class InvoiceItem { | ||
| 25 | + | ||
| 26 | + @TableId(value = "invoice_item_id", type = IdType.AUTO) | ||
| 27 | + @Schema(description = "发票商品明细ID") | ||
| 28 | + private Long invoiceItemId; | ||
| 29 | + | ||
| 30 | + @Schema(description = "关联发票ID") | ||
| 31 | + private Long invoiceId; | ||
| 32 | + | ||
| 33 | + @Schema(description = "发票编号") | ||
| 34 | + private String invoiceNo; | ||
| 35 | + | ||
| 36 | + @Schema(description = "关联订单编号") | ||
| 37 | + private String orderNo; | ||
| 38 | + | ||
| 39 | + @Schema(description = "产品编码") | ||
| 40 | + private String productCode; | ||
| 41 | + | ||
| 42 | + @Schema(description = "产品名称") | ||
| 43 | + private String productName; | ||
| 44 | + | ||
| 45 | + @Schema(description = "开票数量") | ||
| 46 | + private Integer invoiceQty; | ||
| 47 | + | ||
| 48 | + @Schema(description = "不含税单价") | ||
| 49 | + private BigDecimal unitPriceNoTax; | ||
| 50 | + | ||
| 51 | + @Schema(description = "不含税明细金额") | ||
| 52 | + private BigDecimal amountNoTax; | ||
| 53 | + | ||
| 54 | + @Schema(description = "税额") | ||
| 55 | + private BigDecimal taxAmount; | ||
| 56 | + | ||
| 57 | + @Schema(description = "创建者") | ||
| 58 | + private String createBy; | ||
| 59 | + | ||
| 60 | + @Schema(description = "创建时间") | ||
| 61 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 62 | + private LocalDateTime createTime; | ||
| 63 | + | ||
| 64 | + @Schema(description = "更新者") | ||
| 65 | + private String updateBy; | ||
| 66 | + | ||
| 67 | + @Schema(description = "更新时间") | ||
| 68 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 69 | + private LocalDateTime updateTime; | ||
| 70 | + | ||
| 71 | + @Schema(description = "删除标志(0代表存在 2代表删除)") | ||
| 72 | + private String delFlag; | ||
| 73 | +} | ||
| 74 | + |
| 1 | +package com.apple.erp.entity; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 6 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 7 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 8 | +import lombok.Data; | ||
| 9 | +import lombok.EqualsAndHashCode; | ||
| 10 | + | ||
| 11 | +import java.math.BigDecimal; | ||
| 12 | +import java.time.LocalDate; | ||
| 13 | +import java.time.LocalDateTime; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 发票主表实体类 | ||
| 17 | + * | ||
| 18 | + * @author Apple ERP System | ||
| 19 | + * @since 2025-01-01 | ||
| 20 | + */ | ||
| 21 | +@Data | ||
| 22 | +@EqualsAndHashCode(callSuper = false) | ||
| 23 | +@TableName("t_invoice_main") | ||
| 24 | +@Schema(description = "发票主表") | ||
| 25 | +public class InvoiceMain { | ||
| 26 | + | ||
| 27 | + @TableId(value = "invoice_id", type = IdType.AUTO) | ||
| 28 | + @Schema(description = "发票ID") | ||
| 29 | + private Long invoiceId; | ||
| 30 | + | ||
| 31 | + @Schema(description = "发票编号") | ||
| 32 | + private String invoiceNo; | ||
| 33 | + | ||
| 34 | + @Schema(description = "关联订单编号") | ||
| 35 | + private String orderNo; | ||
| 36 | + | ||
| 37 | + @Schema(description = "关联出库单编号") | ||
| 38 | + private String deliveryNo; | ||
| 39 | + | ||
| 40 | + @Schema(description = "经销商编码") | ||
| 41 | + private String dealerCode; | ||
| 42 | + | ||
| 43 | + @Schema(description = "经销商名称") | ||
| 44 | + private String dealerName; | ||
| 45 | + | ||
| 46 | + @Schema(description = "发票总金额(含税)") | ||
| 47 | + private BigDecimal totalAmount; | ||
| 48 | + | ||
| 49 | + @Schema(description = "开票日期") | ||
| 50 | + @JsonFormat(pattern = "yyyy-MM-dd") | ||
| 51 | + private LocalDate invoiceDate; | ||
| 52 | + | ||
| 53 | + @Schema(description = "发票状态(0-未开票/1-已开票)") | ||
| 54 | + private Integer invoiceStatus; | ||
| 55 | + | ||
| 56 | + @Schema(description = "税率") | ||
| 57 | + private BigDecimal taxRate; | ||
| 58 | + | ||
| 59 | + @Schema(description = "数据来源") | ||
| 60 | + private String dataSource; | ||
| 61 | + | ||
| 62 | + @Schema(description = "数据上传时间") | ||
| 63 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 64 | + private LocalDateTime uploadTime; | ||
| 65 | + | ||
| 66 | + @Schema(description = "创建者") | ||
| 67 | + private String createBy; | ||
| 68 | + | ||
| 69 | + @Schema(description = "创建时间") | ||
| 70 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 71 | + private LocalDateTime createTime; | ||
| 72 | + | ||
| 73 | + @Schema(description = "更新者") | ||
| 74 | + private String updateBy; | ||
| 75 | + | ||
| 76 | + @Schema(description = "更新时间") | ||
| 77 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 78 | + private LocalDateTime updateTime; | ||
| 79 | + | ||
| 80 | + @Schema(description = "删除标志(0代表存在 2代表删除)") | ||
| 81 | + private String delFlag; | ||
| 82 | +} | ||
| 83 | + |
| 1 | +package com.apple.erp.entity; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 6 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 7 | +import lombok.Data; | ||
| 8 | +import lombok.EqualsAndHashCode; | ||
| 9 | + | ||
| 10 | +import java.math.BigDecimal; | ||
| 11 | +import java.time.LocalDateTime; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 订单商品明细表实体类 | ||
| 15 | + * | ||
| 16 | + * @author Apple ERP System | ||
| 17 | + * @since 2025-01-01 | ||
| 18 | + */ | ||
| 19 | +@Data | ||
| 20 | +@EqualsAndHashCode(callSuper = false) | ||
| 21 | +@TableName("t_order_item") | ||
| 22 | +@Schema(description = "订单商品明细表") | ||
| 23 | +public class OrderItem { | ||
| 24 | + | ||
| 25 | + @TableId(value = "item_id", type = IdType.AUTO) | ||
| 26 | + @Schema(description = "明细ID") | ||
| 27 | + private Long itemId; | ||
| 28 | + | ||
| 29 | + @Schema(description = "订单ID") | ||
| 30 | + private Long orderId; | ||
| 31 | + | ||
| 32 | + @Schema(description = "订单编号") | ||
| 33 | + private String orderNo; | ||
| 34 | + | ||
| 35 | + @Schema(description = "产品编码") | ||
| 36 | + private String productCode; | ||
| 37 | + | ||
| 38 | + @Schema(description = "产品名称") | ||
| 39 | + private String productName; | ||
| 40 | + | ||
| 41 | + @Schema(description = "产品单价") | ||
| 42 | + private BigDecimal unitPrice; | ||
| 43 | + | ||
| 44 | + @Schema(description = "商品数量") | ||
| 45 | + private Integer productQty; | ||
| 46 | + | ||
| 47 | + @Schema(description = "商品明细金额") | ||
| 48 | + private BigDecimal itemAmount; | ||
| 49 | + | ||
| 50 | + @Schema(description = "创建者") | ||
| 51 | + private String createBy; | ||
| 52 | + | ||
| 53 | + @Schema(description = "创建时间") | ||
| 54 | + private LocalDateTime createTime; | ||
| 55 | + | ||
| 56 | + @Schema(description = "更新者") | ||
| 57 | + private String updateBy; | ||
| 58 | + | ||
| 59 | + @Schema(description = "更新时间") | ||
| 60 | + private LocalDateTime updateTime; | ||
| 61 | + | ||
| 62 | + @Schema(description = "删除标志(0代表存在 2代表删除)") | ||
| 63 | + private String delFlag; | ||
| 64 | +} | ||
| 65 | + |
| 1 | +package com.apple.erp.entity; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 6 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 7 | +import lombok.Data; | ||
| 8 | +import lombok.EqualsAndHashCode; | ||
| 9 | + | ||
| 10 | +import java.math.BigDecimal; | ||
| 11 | +import java.time.LocalDateTime; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 订单主表实体类 | ||
| 15 | + * | ||
| 16 | + * @author Apple ERP System | ||
| 17 | + * @since 2025-01-01 | ||
| 18 | + */ | ||
| 19 | +@Data | ||
| 20 | +@EqualsAndHashCode(callSuper = false) | ||
| 21 | +@TableName("t_order_main") | ||
| 22 | +@Schema(description = "订单主表") | ||
| 23 | +public class OrderMain { | ||
| 24 | + | ||
| 25 | + @TableId(value = "order_id", type = IdType.AUTO) | ||
| 26 | + @Schema(description = "订单ID") | ||
| 27 | + private Long orderId; | ||
| 28 | + | ||
| 29 | + @Schema(description = "订单编号") | ||
| 30 | + private String orderNo; | ||
| 31 | + | ||
| 32 | + @Schema(description = "经销商编码") | ||
| 33 | + private String dealerCode; | ||
| 34 | + | ||
| 35 | + @Schema(description = "经销商名称") | ||
| 36 | + private String dealerName; | ||
| 37 | + | ||
| 38 | + @Schema(description = "订单创建日期") | ||
| 39 | + private LocalDateTime orderDate; | ||
| 40 | + | ||
| 41 | + @Schema(description = "订单总金额") | ||
| 42 | + private BigDecimal totalAmount; | ||
| 43 | + | ||
| 44 | + @Schema(description = "订单返利金额") | ||
| 45 | + private BigDecimal rebateAmount; | ||
| 46 | + | ||
| 47 | + @Schema(description = "出库状态(0-未出库/1-已出库)") | ||
| 48 | + private Integer deliveryStatus; | ||
| 49 | + | ||
| 50 | + @Schema(description = "开票状态(0-未开票/1-已开票)") | ||
| 51 | + private Integer invoiceStatus; | ||
| 52 | + | ||
| 53 | + @Schema(description = "返利计算状态(0-未计算/1-已计算)") | ||
| 54 | + private Integer rebateCalcFlag; | ||
| 55 | + | ||
| 56 | + @Schema(description = "数据来源") | ||
| 57 | + private String dataSource; | ||
| 58 | + | ||
| 59 | + @Schema(description = "数据验证状态(0-待验证/1-验证通过/2-验证失败)") | ||
| 60 | + private Integer verifyStatus; | ||
| 61 | + | ||
| 62 | + @Schema(description = "数据上传时间") | ||
| 63 | + private LocalDateTime uploadTime; | ||
| 64 | + | ||
| 65 | + @Schema(description = "创建者") | ||
| 66 | + private String createBy; | ||
| 67 | + | ||
| 68 | + @Schema(description = "创建时间") | ||
| 69 | + private LocalDateTime createTime; | ||
| 70 | + | ||
| 71 | + @Schema(description = "更新者") | ||
| 72 | + private String updateBy; | ||
| 73 | + | ||
| 74 | + @Schema(description = "更新时间") | ||
| 75 | + private LocalDateTime updateTime; | ||
| 76 | + | ||
| 77 | + @Schema(description = "删除标志(0代表存在 2代表删除)") | ||
| 78 | + private String delFlag; | ||
| 79 | +} | ||
| 80 | + |
| 1 | +package com.apple.erp.mapper; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.entity.DeliveryItem; | ||
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | +import org.apache.ibatis.annotations.Mapper; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 出库明细表Mapper接口 | ||
| 9 | + * | ||
| 10 | + * @author Apple ERP System | ||
| 11 | + * @since 2025-01-01 | ||
| 12 | + */ | ||
| 13 | +@Mapper | ||
| 14 | +public interface DeliveryItemMapper extends BaseMapper<DeliveryItem> { | ||
| 15 | +} | ||
| 16 | + |
| 1 | +package com.apple.erp.mapper; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.entity.DeliveryMain; | ||
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | +import org.apache.ibatis.annotations.Mapper; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 出库主表Mapper接口 | ||
| 9 | + * | ||
| 10 | + * @author Apple ERP System | ||
| 11 | + * @since 2025-01-01 | ||
| 12 | + */ | ||
| 13 | +@Mapper | ||
| 14 | +public interface DeliveryMainMapper extends BaseMapper<DeliveryMain> { | ||
| 15 | +} | ||
| 16 | + |
| 1 | +package com.apple.erp.mapper; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.entity.InvoiceItem; | ||
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | +import org.apache.ibatis.annotations.Mapper; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 发票明细表Mapper接口 | ||
| 9 | + * | ||
| 10 | + * @author Apple ERP System | ||
| 11 | + * @since 2025-01-01 | ||
| 12 | + */ | ||
| 13 | +@Mapper | ||
| 14 | +public interface InvoiceItemMapper extends BaseMapper<InvoiceItem> { | ||
| 15 | +} | ||
| 16 | + |
| 1 | +package com.apple.erp.mapper; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.entity.InvoiceMain; | ||
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | +import org.apache.ibatis.annotations.Mapper; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 发票主表Mapper接口 | ||
| 9 | + * | ||
| 10 | + * @author Apple ERP System | ||
| 11 | + * @since 2025-01-01 | ||
| 12 | + */ | ||
| 13 | +@Mapper | ||
| 14 | +public interface InvoiceMainMapper extends BaseMapper<InvoiceMain> { | ||
| 15 | +} | ||
| 16 | + |
| 1 | +package com.apple.erp.mapper; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.entity.OrderItem; | ||
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | +import org.apache.ibatis.annotations.Mapper; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 订单明细表Mapper接口 | ||
| 9 | + * | ||
| 10 | + * @author Apple ERP System | ||
| 11 | + * @since 2025-01-01 | ||
| 12 | + */ | ||
| 13 | +@Mapper | ||
| 14 | +public interface OrderItemMapper extends BaseMapper<OrderItem> { | ||
| 15 | +} | ||
| 16 | + |
| 1 | +package com.apple.erp.mapper; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.entity.OrderMain; | ||
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | +import org.apache.ibatis.annotations.Mapper; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 订单主表Mapper接口 | ||
| 9 | + * | ||
| 10 | + * @author Apple ERP System | ||
| 11 | + * @since 2025-01-01 | ||
| 12 | + */ | ||
| 13 | +@Mapper | ||
| 14 | +public interface OrderMainMapper extends BaseMapper<OrderMain> { | ||
| 15 | +} | ||
| 16 | + |
| 1 | +package com.apple.erp.service; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.dto.DeliveryAddReq; | ||
| 4 | +import com.apple.erp.dto.DeliveryQueryReq; | ||
| 5 | +import com.apple.erp.dto.DeliveryRes; | ||
| 6 | +import com.apple.erp.dto.DeliveryUpdateReq; | ||
| 7 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 8 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
| 9 | +import com.apple.erp.entity.DeliveryMain; | ||
| 10 | + | ||
| 11 | +import java.util.List; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 出库主表Service接口 | ||
| 15 | + * | ||
| 16 | + * @author Apple ERP System | ||
| 17 | + * @since 2025-01-01 | ||
| 18 | + */ | ||
| 19 | +public interface DeliveryMainService extends IService<DeliveryMain> { | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 分页查询出库列表 | ||
| 23 | + * @param queryReq 查询条件 | ||
| 24 | + * @return 出库列表(带分页信息) | ||
| 25 | + */ | ||
| 26 | + Page<DeliveryRes> getDeliveryList(DeliveryQueryReq queryReq); | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 获取出库详情 | ||
| 30 | + * @param deliveryId 出库单ID | ||
| 31 | + * @return 出库详情(包含明细) | ||
| 32 | + */ | ||
| 33 | + DeliveryRes getDeliveryDetail(Long deliveryId); | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 新增出库 | ||
| 37 | + * @param addReq 出库新增请求 | ||
| 38 | + * @return 是否成功 | ||
| 39 | + */ | ||
| 40 | + boolean addDelivery(DeliveryAddReq addReq); | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 修改出库 | ||
| 44 | + * @param updateReq 出库修改请求 | ||
| 45 | + * @return 是否成功 | ||
| 46 | + */ | ||
| 47 | + boolean updateDelivery(DeliveryUpdateReq updateReq); | ||
| 48 | + | ||
| 49 | + /** | ||
| 50 | + * 删除出库(逻辑删除) | ||
| 51 | + * @param deliveryId 出库单ID | ||
| 52 | + * @return 是否成功 | ||
| 53 | + */ | ||
| 54 | + boolean deleteDelivery(Long deliveryId); | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 批量删除出库(逻辑删除) | ||
| 58 | + * @param deliveryIds 出库单ID列表 | ||
| 59 | + * @return 是否成功 | ||
| 60 | + */ | ||
| 61 | + boolean batchDeleteDeliveries(List<Long> deliveryIds); | ||
| 62 | + | ||
| 63 | + /** | ||
| 64 | + * 修改出库状态 | ||
| 65 | + * @param deliveryId 出库单ID | ||
| 66 | + * @param deliveryStatus 出库状态 | ||
| 67 | + * @return 是否成功 | ||
| 68 | + */ | ||
| 69 | + boolean updateDeliveryStatus(Long deliveryId, Integer deliveryStatus); | ||
| 70 | +} | ||
| 71 | + |
| 1 | +package com.apple.erp.service; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.dto.InvoiceAddReq; | ||
| 4 | +import com.apple.erp.dto.InvoiceQueryReq; | ||
| 5 | +import com.apple.erp.dto.InvoiceRes; | ||
| 6 | +import com.apple.erp.dto.InvoiceUpdateReq; | ||
| 7 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 8 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
| 9 | +import com.apple.erp.entity.InvoiceMain; | ||
| 10 | + | ||
| 11 | +import java.util.List; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 发票主表Service接口 | ||
| 15 | + * | ||
| 16 | + * @author Apple ERP System | ||
| 17 | + * @since 2025-01-01 | ||
| 18 | + */ | ||
| 19 | +public interface InvoiceMainService extends IService<InvoiceMain> { | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 分页查询发票列表 | ||
| 23 | + * @param queryReq 查询条件 | ||
| 24 | + * @return 发票列表(带分页信息) | ||
| 25 | + */ | ||
| 26 | + Page<InvoiceRes> getInvoiceList(InvoiceQueryReq queryReq); | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 获取发票详情 | ||
| 30 | + * @param invoiceId 发票ID | ||
| 31 | + * @return 发票详情(包含明细) | ||
| 32 | + */ | ||
| 33 | + InvoiceRes getInvoiceDetail(Long invoiceId); | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 新增发票 | ||
| 37 | + * @param addReq 发票新增请求 | ||
| 38 | + * @return 是否成功 | ||
| 39 | + */ | ||
| 40 | + boolean addInvoice(InvoiceAddReq addReq); | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 修改发票 | ||
| 44 | + * @param updateReq 发票修改请求 | ||
| 45 | + * @return 是否成功 | ||
| 46 | + */ | ||
| 47 | + boolean updateInvoice(InvoiceUpdateReq updateReq); | ||
| 48 | + | ||
| 49 | + /** | ||
| 50 | + * 删除发票(逻辑删除) | ||
| 51 | + * @param invoiceId 发票ID | ||
| 52 | + * @return 是否成功 | ||
| 53 | + */ | ||
| 54 | + boolean deleteInvoice(Long invoiceId); | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 批量删除发票(逻辑删除) | ||
| 58 | + * @param invoiceIds 发票ID列表 | ||
| 59 | + * @return 是否成功 | ||
| 60 | + */ | ||
| 61 | + boolean batchDeleteInvoices(List<Long> invoiceIds); | ||
| 62 | + | ||
| 63 | + /** | ||
| 64 | + * 修改发票状态 | ||
| 65 | + * @param invoiceId 发票ID | ||
| 66 | + * @param invoiceStatus 发票状态 | ||
| 67 | + * @return 是否成功 | ||
| 68 | + */ | ||
| 69 | + boolean updateInvoiceStatus(Long invoiceId, Integer invoiceStatus); | ||
| 70 | +} | ||
| 71 | + |
| 1 | +package com.apple.erp.service; | ||
| 2 | + | ||
| 3 | +import com.apple.erp.dto.OrderAddReq; | ||
| 4 | +import com.apple.erp.dto.OrderQueryReq; | ||
| 5 | +import com.apple.erp.dto.OrderRes; | ||
| 6 | +import com.apple.erp.dto.OrderUpdateReq; | ||
| 7 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 8 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
| 9 | +import com.apple.erp.entity.OrderMain; | ||
| 10 | + | ||
| 11 | +import java.util.List; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 订单主表Service接口 | ||
| 15 | + * | ||
| 16 | + * @author Apple ERP System | ||
| 17 | + * @since 2025-01-01 | ||
| 18 | + */ | ||
| 19 | +public interface OrderMainService extends IService<OrderMain> { | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 分页查询订单列表 | ||
| 23 | + * | ||
| 24 | + * @param queryReq 查询条件 | ||
| 25 | + * @return 订单分页数据 | ||
| 26 | + */ | ||
| 27 | + Page<OrderRes> getOrderList(OrderQueryReq queryReq); | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 获取订单详情 | ||
| 31 | + * | ||
| 32 | + * @param orderId 订单ID | ||
| 33 | + * @return 订单详情 | ||
| 34 | + */ | ||
| 35 | + OrderRes getOrderDetail(Long orderId); | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 新增订单 | ||
| 39 | + * | ||
| 40 | + * @param addReq 新增请求 | ||
| 41 | + * @return 是否成功 | ||
| 42 | + */ | ||
| 43 | + boolean addOrder(OrderAddReq addReq); | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 修改订单 | ||
| 47 | + * | ||
| 48 | + * @param updateReq 修改请求 | ||
| 49 | + * @return 是否成功 | ||
| 50 | + */ | ||
| 51 | + boolean updateOrder(OrderUpdateReq updateReq); | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * 删除订单 | ||
| 55 | + * | ||
| 56 | + * @param orderId 订单ID | ||
| 57 | + * @return 是否成功 | ||
| 58 | + */ | ||
| 59 | + boolean deleteOrder(Long orderId); | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 批量删除订单 | ||
| 63 | + * | ||
| 64 | + * @param orderIds 订单ID列表 | ||
| 65 | + * @return 是否成功 | ||
| 66 | + */ | ||
| 67 | + boolean batchDeleteOrders(List<Long> orderIds); | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * 修改订单出库状态 | ||
| 71 | + * | ||
| 72 | + * @param orderId 订单ID | ||
| 73 | + * @param deliveryStatus 出库状态 | ||
| 74 | + * @return 是否成功 | ||
| 75 | + */ | ||
| 76 | + boolean updateDeliveryStatus(Long orderId, Integer deliveryStatus); | ||
| 77 | + | ||
| 78 | + /** | ||
| 79 | + * 修改订单开票状态 | ||
| 80 | + * | ||
| 81 | + * @param orderId 订单ID | ||
| 82 | + * @param invoiceStatus 开票状态 | ||
| 83 | + * @return 是否成功 | ||
| 84 | + */ | ||
| 85 | + boolean updateInvoiceStatus(Long orderId, Integer invoiceStatus); | ||
| 86 | + | ||
| 87 | + /** | ||
| 88 | + * 修改订单返利计算状态 | ||
| 89 | + * | ||
| 90 | + * @param orderId 订单ID | ||
| 91 | + * @param rebateCalcFlag 返利计算状态 | ||
| 92 | + * @return 是否成功 | ||
| 93 | + */ | ||
| 94 | + boolean updateRebateCalcFlag(Long orderId, Integer rebateCalcFlag); | ||
| 95 | +} | ||
| 96 | + |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
| 1 | +-- Apple经销商ERP系统 - 订单管理、出库查询、发票管理按钮权限配置脚本 | ||
| 2 | +-- 创建时间: 2025-01-27 | ||
| 3 | +-- 版本: v1.0 | ||
| 4 | + | ||
| 5 | +-- 设置数据库和字符集 | ||
| 6 | +SET NAMES utf8mb4; | ||
| 7 | +SET FOREIGN_KEY_CHECKS = 0; | ||
| 8 | + | ||
| 9 | +-- 使用数据库 | ||
| 10 | +USE apple_erp; | ||
| 11 | + | ||
| 12 | +-- ========================================= | ||
| 13 | +-- 1. 插入订单管理相关按钮权限 | ||
| 14 | +-- ========================================= | ||
| 15 | + | ||
| 16 | +-- 订单管理按钮权限 (parent_id = 2) | ||
| 17 | +INSERT INTO t_sys_menu (menu_id, parent_id, menu_name, menu_type, path, icon, sort, status, perms, create_by, create_time, update_by, update_time, del_flag) | ||
| 18 | +VALUES | ||
| 19 | +(201, 2, '订单查询', '2', '', '', 1, '1', 'order:list', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 20 | +(202, 2, '订单新增', '2', '', '', 2, '1', 'order:add', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 21 | +(203, 2, '订单修改', '2', '', '', 3, '1', 'order:edit', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 22 | +(204, 2, '订单删除', '2', '', '', 4, '1', 'order:delete', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 23 | +(205, 2, '订单详情', '2', '', '', 5, '1', 'order:detail', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 24 | +(206, 2, '订单导出', '2', '', '', 6, '1', 'order:export', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 25 | +(207, 2, '订单导入', '2', '', '', 7, '1', 'order:import', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 26 | +(208, 2, '订单审核', '2', '', '', 8, '1', 'order:audit', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 27 | +(209, 2, '订单取消', '2', '', '', 9, '1', 'order:cancel', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 28 | +(210, 2, '订单完成', '2', '', '', 10, '1', 'order:complete', 'admin', NOW(), 'admin', NOW(), '0'); | ||
| 29 | + | ||
| 30 | +-- ========================================= | ||
| 31 | +-- 2. 插入出库查询相关按钮权限 | ||
| 32 | +-- ========================================= | ||
| 33 | + | ||
| 34 | +-- 出库查询按钮权限 (parent_id = 3) | ||
| 35 | +INSERT INTO t_sys_menu (menu_id, parent_id, menu_name, menu_type, path, icon, sort, status, perms, create_by, create_time, update_by, update_time, del_flag) | ||
| 36 | +VALUES | ||
| 37 | +(301, 3, '出库查询', '2', '', '', 1, '1', 'delivery:list', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 38 | +(302, 3, '出库详情', '2', '', '', 2, '1', 'delivery:query', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 39 | +(303, 3, '出库导出', '2', '', '', 3, '1', 'delivery:export', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 40 | +(304, 3, '出库统计', '2', '', '', 4, '1', 'delivery:statistics', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 41 | +(305, 3, '出库打印', '2', '', '', 5, '1', 'delivery:print', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 42 | +(306, 3, '出库确认', '2', '', '', 6, '1', 'delivery:confirm', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 43 | +(307, 3, '出库撤销', '2', '', '', 7, '1', 'delivery:cancel', 'admin', NOW(), 'admin', NOW(), '0'); | ||
| 44 | + | ||
| 45 | +-- ========================================= | ||
| 46 | +-- 3. 插入发票管理相关按钮权限 | ||
| 47 | +-- ========================================= | ||
| 48 | + | ||
| 49 | +-- 发票管理按钮权限 (parent_id = 4) | ||
| 50 | +INSERT INTO t_sys_menu (menu_id, parent_id, menu_name, menu_type, path, icon, sort, status, perms, create_by, create_time, update_by, update_time, del_flag) | ||
| 51 | +VALUES | ||
| 52 | +(401, 4, '发票查询', '2', '', '', 1, '1', 'invoice:list', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 53 | +(402, 4, '发票新增', '2', '', '', 2, '1', 'invoice:add', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 54 | +(403, 4, '发票修改', '2', '', '', 3, '1', 'invoice:edit', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 55 | +(404, 4, '发票删除', '2', '', '', 4, '1', 'invoice:remove', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 56 | +(405, 4, '发票详情', '2', '', '', 5, '1', 'invoice:query', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 57 | +(406, 4, '发票导出', '2', '', '', 6, '1', 'invoice:export', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 58 | +(407, 4, '发票打印', '2', '', '', 7, '1', 'invoice:print', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 59 | +(408, 4, '发票审核', '2', '', '', 8, '1', 'invoice:audit', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 60 | +(409, 4, '发票作废', '2', '', '', 9, '1', 'invoice:void', 'admin', NOW(), 'admin', NOW(), '0'), | ||
| 61 | +(410, 4, '发票红冲', '2', '', '', 10, '1', 'invoice:reverse', 'admin', NOW(), 'admin', NOW(), '0'); | ||
| 62 | + | ||
| 63 | +-- ========================================= | ||
| 64 | +-- 4. 为ADMIN角色分配新权限 | ||
| 65 | +-- ========================================= | ||
| 66 | + | ||
| 67 | +-- 获取ADMIN角色ID | ||
| 68 | +SET @admin_role_id = (SELECT role_id FROM t_sys_role WHERE role_code = 'ADMIN' AND del_flag = '0' LIMIT 1); | ||
| 69 | + | ||
| 70 | +-- 为ADMIN角色分配订单管理按钮权限 | ||
| 71 | +INSERT INTO t_sys_role_menu (role_id, menu_id, create_by, create_time, update_by, update_time, del_flag) | ||
| 72 | +SELECT @admin_role_id, menu_id, 'admin', NOW(), 'admin', NOW(), '0' | ||
| 73 | +FROM t_sys_menu | ||
| 74 | +WHERE menu_id IN (201, 202, 203, 204, 205, 206, 207, 208, 209, 210) | ||
| 75 | +AND del_flag = '0'; | ||
| 76 | + | ||
| 77 | +-- 为ADMIN角色分配出库查询按钮权限 | ||
| 78 | +INSERT INTO t_sys_role_menu (role_id, menu_id, create_by, create_time, update_by, update_time, del_flag) | ||
| 79 | +SELECT @admin_role_id, menu_id, 'admin', NOW(), 'admin', NOW(), '0' | ||
| 80 | +FROM t_sys_menu | ||
| 81 | +WHERE menu_id IN (301, 302, 303, 304, 305, 306, 307) | ||
| 82 | +AND del_flag = '0'; | ||
| 83 | + | ||
| 84 | +-- 为ADMIN角色分配发票管理按钮权限 | ||
| 85 | +INSERT INTO t_sys_role_menu (role_id, menu_id, create_by, create_time, update_by, update_time, del_flag) | ||
| 86 | +SELECT @admin_role_id, menu_id, 'admin', NOW(), 'admin', NOW(), '0' | ||
| 87 | +FROM t_sys_menu | ||
| 88 | +WHERE menu_id IN (401, 402, 403, 404, 405, 406, 407, 408, 409, 410) | ||
| 89 | +AND del_flag = '0'; | ||
| 90 | + | ||
| 91 | +-- ========================================= | ||
| 92 | +-- 5. 为OPERATOR角色分配权限 | ||
| 93 | +-- ========================================= | ||
| 94 | + | ||
| 95 | +-- 获取OPERATOR角色ID | ||
| 96 | +SET @operator_role_id = (SELECT role_id FROM t_sys_role WHERE role_code = 'OPERATOR' AND del_flag = '0' LIMIT 1); | ||
| 97 | + | ||
| 98 | +-- 为OPERATOR角色分配订单管理按钮权限(除删除外) | ||
| 99 | +INSERT INTO t_sys_role_menu (role_id, menu_id, create_by, create_time, update_by, update_time, del_flag) | ||
| 100 | +SELECT @operator_role_id, menu_id, 'admin', NOW(), 'admin', NOW(), '0' | ||
| 101 | +FROM t_sys_menu | ||
| 102 | +WHERE menu_id IN (201, 202, 203, 205, 206, 207, 208, 209, 210) | ||
| 103 | +AND del_flag = '0'; | ||
| 104 | + | ||
| 105 | +-- 为OPERATOR角色分配出库查询按钮权限 | ||
| 106 | +INSERT INTO t_sys_role_menu (role_id, menu_id, create_by, create_time, update_by, update_time, del_flag) | ||
| 107 | +SELECT @operator_role_id, menu_id, 'admin', NOW(), 'admin', NOW(), '0' | ||
| 108 | +FROM t_sys_menu | ||
| 109 | +WHERE menu_id IN (301, 302, 303, 304, 305, 306, 307) | ||
| 110 | +AND del_flag = '0'; | ||
| 111 | + | ||
| 112 | +-- 为OPERATOR角色分配发票管理按钮权限(除删除外) | ||
| 113 | +INSERT INTO t_sys_role_menu (role_id, menu_id, create_by, create_time, update_by, update_time, del_flag) | ||
| 114 | +SELECT @operator_role_id, menu_id, 'admin', NOW(), 'admin', NOW(), '0' | ||
| 115 | +FROM t_sys_menu | ||
| 116 | +WHERE menu_id IN (401, 402, 403, 405, 406, 407, 408, 409, 410) | ||
| 117 | +AND del_flag = '0'; | ||
| 118 | + | ||
| 119 | +-- ========================================= | ||
| 120 | +-- 6. 为DEALER_MANAGER角色分配权限 | ||
| 121 | +-- ========================================= | ||
| 122 | + | ||
| 123 | +-- 获取DEALER_MANAGER角色ID | ||
| 124 | +SET @dealer_manager_role_id = (SELECT role_id FROM t_sys_role WHERE role_code = 'DEALER_MANAGER' AND del_flag = '0' LIMIT 1); | ||
| 125 | + | ||
| 126 | +-- 为DEALER_MANAGER角色分配订单管理按钮权限(只读权限) | ||
| 127 | +INSERT INTO t_sys_role_menu (role_id, menu_id, create_by, create_time, update_by, update_time, del_flag) | ||
| 128 | +SELECT @dealer_manager_role_id, menu_id, 'admin', NOW(), 'admin', NOW(), '0' | ||
| 129 | +FROM t_sys_menu | ||
| 130 | +WHERE menu_id IN (201, 205, 206) | ||
| 131 | +AND del_flag = '0'; | ||
| 132 | + | ||
| 133 | +-- 为DEALER_MANAGER角色分配出库查询按钮权限 | ||
| 134 | +INSERT INTO t_sys_role_menu (role_id, menu_id, create_by, create_time, update_by, update_time, del_flag) | ||
| 135 | +SELECT @dealer_manager_role_id, menu_id, 'admin', NOW(), 'admin', NOW(), '0' | ||
| 136 | +FROM t_sys_menu | ||
| 137 | +WHERE menu_id IN (301, 302, 303, 304, 305) | ||
| 138 | +AND del_flag = '0'; | ||
| 139 | + | ||
| 140 | +-- 为DEALER_MANAGER角色分配发票管理按钮权限(只读权限) | ||
| 141 | +INSERT INTO t_sys_role_menu (role_id, menu_id, create_by, create_time, update_by, update_time, del_flag) | ||
| 142 | +SELECT @dealer_manager_role_id, menu_id, 'admin', NOW(), 'admin', NOW(), '0' | ||
| 143 | +FROM t_sys_menu | ||
| 144 | +WHERE menu_id IN (401, 405, 406, 407) | ||
| 145 | +AND del_flag = '0'; | ||
| 146 | + | ||
| 147 | +-- 重置外键检查 | ||
| 148 | +SET FOREIGN_KEY_CHECKS = 1; | ||
| 149 | + | ||
| 150 | +-- 输出完成信息 | ||
| 151 | +SELECT '订单管理、出库查询、发票管理按钮权限配置完成!' AS message; |
| ... | @@ -5,77 +5,5 @@ | ... | @@ -5,77 +5,5 @@ |
| 5 | // Generated by unplugin-auto-import | 5 | // Generated by unplugin-auto-import |
| 6 | export {} | 6 | export {} |
| 7 | declare global { | 7 | declare global { |
| 8 | - const EffectScope: typeof import('vue')['EffectScope'] | 8 | + |
| 9 | - const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] | ||
| 10 | - const computed: typeof import('vue')['computed'] | ||
| 11 | - const createApp: typeof import('vue')['createApp'] | ||
| 12 | - const createPinia: typeof import('pinia')['createPinia'] | ||
| 13 | - const customRef: typeof import('vue')['customRef'] | ||
| 14 | - const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] | ||
| 15 | - const defineComponent: typeof import('vue')['defineComponent'] | ||
| 16 | - const defineStore: typeof import('pinia')['defineStore'] | ||
| 17 | - const effectScope: typeof import('vue')['effectScope'] | ||
| 18 | - const getActivePinia: typeof import('pinia')['getActivePinia'] | ||
| 19 | - const getCurrentInstance: typeof import('vue')['getCurrentInstance'] | ||
| 20 | - const getCurrentScope: typeof import('vue')['getCurrentScope'] | ||
| 21 | - const h: typeof import('vue')['h'] | ||
| 22 | - const inject: typeof import('vue')['inject'] | ||
| 23 | - const isProxy: typeof import('vue')['isProxy'] | ||
| 24 | - const isReactive: typeof import('vue')['isReactive'] | ||
| 25 | - const isReadonly: typeof import('vue')['isReadonly'] | ||
| 26 | - const isRef: typeof import('vue')['isRef'] | ||
| 27 | - const mapActions: typeof import('pinia')['mapActions'] | ||
| 28 | - const mapGetters: typeof import('pinia')['mapGetters'] | ||
| 29 | - const mapState: typeof import('pinia')['mapState'] | ||
| 30 | - const mapStores: typeof import('pinia')['mapStores'] | ||
| 31 | - const mapWritableState: typeof import('pinia')['mapWritableState'] | ||
| 32 | - const markRaw: typeof import('vue')['markRaw'] | ||
| 33 | - const nextTick: typeof import('vue')['nextTick'] | ||
| 34 | - const onActivated: typeof import('vue')['onActivated'] | ||
| 35 | - const onBeforeMount: typeof import('vue')['onBeforeMount'] | ||
| 36 | - const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] | ||
| 37 | - const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] | ||
| 38 | - const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] | ||
| 39 | - const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] | ||
| 40 | - const onDeactivated: typeof import('vue')['onDeactivated'] | ||
| 41 | - const onErrorCaptured: typeof import('vue')['onErrorCaptured'] | ||
| 42 | - const onMounted: typeof import('vue')['onMounted'] | ||
| 43 | - const onRenderTracked: typeof import('vue')['onRenderTracked'] | ||
| 44 | - const onRenderTriggered: typeof import('vue')['onRenderTriggered'] | ||
| 45 | - const onScopeDispose: typeof import('vue')['onScopeDispose'] | ||
| 46 | - const onServerPrefetch: typeof import('vue')['onServerPrefetch'] | ||
| 47 | - const onUnmounted: typeof import('vue')['onUnmounted'] | ||
| 48 | - const onUpdated: typeof import('vue')['onUpdated'] | ||
| 49 | - const onWatcherCleanup: typeof import('vue')['onWatcherCleanup'] | ||
| 50 | - const provide: typeof import('vue')['provide'] | ||
| 51 | - const reactive: typeof import('vue')['reactive'] | ||
| 52 | - const readonly: typeof import('vue')['readonly'] | ||
| 53 | - const ref: typeof import('vue')['ref'] | ||
| 54 | - const resolveComponent: typeof import('vue')['resolveComponent'] | ||
| 55 | - const setActivePinia: typeof import('pinia')['setActivePinia'] | ||
| 56 | - const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'] | ||
| 57 | - const shallowReactive: typeof import('vue')['shallowReactive'] | ||
| 58 | - const shallowReadonly: typeof import('vue')['shallowReadonly'] | ||
| 59 | - const shallowRef: typeof import('vue')['shallowRef'] | ||
| 60 | - const storeToRefs: typeof import('pinia')['storeToRefs'] | ||
| 61 | - const toRaw: typeof import('vue')['toRaw'] | ||
| 62 | - const toRef: typeof import('vue')['toRef'] | ||
| 63 | - const toRefs: typeof import('vue')['toRefs'] | ||
| 64 | - const toValue: typeof import('vue')['toValue'] | ||
| 65 | - const triggerRef: typeof import('vue')['triggerRef'] | ||
| 66 | - const unref: typeof import('vue')['unref'] | ||
| 67 | - const useAttrs: typeof import('vue')['useAttrs'] | ||
| 68 | - const useCssModule: typeof import('vue')['useCssModule'] | ||
| 69 | - const useCssVars: typeof import('vue')['useCssVars'] | ||
| 70 | - const useId: typeof import('vue')['useId'] | ||
| 71 | - const useLink: typeof import('vue-router')['useLink'] | ||
| 72 | - const useModel: typeof import('vue')['useModel'] | ||
| 73 | - const useRoute: typeof import('vue-router')['useRoute'] | ||
| 74 | - const useRouter: typeof import('vue-router')['useRouter'] | ||
| 75 | - const useSlots: typeof import('vue')['useSlots'] | ||
| 76 | - const useTemplateRef: typeof import('vue')['useTemplateRef'] | ||
| 77 | - const watch: typeof import('vue')['watch'] | ||
| 78 | - const watchEffect: typeof import('vue')['watchEffect'] | ||
| 79 | - const watchPostEffect: typeof import('vue')['watchPostEffect'] | ||
| 80 | - const watchSyncEffect: typeof import('vue')['watchSyncEffect'] | ||
| 81 | } | 9 | } | ... | ... |
frontend/src/api/order.ts
0 → 100644
| 1 | +import { request } from '../utils/request' | ||
| 2 | + | ||
| 3 | +// 订单相关类型定义 | ||
| 4 | +export interface OrderInfo { | ||
| 5 | + orderId: number | ||
| 6 | + orderNo: string | ||
| 7 | + dealerCode: string | ||
| 8 | + dealerName: string | ||
| 9 | + orderDate: string | ||
| 10 | + totalAmount: number | ||
| 11 | + rebateAmount?: number | ||
| 12 | + deliveryStatus: number | ||
| 13 | + invoiceStatus: number | ||
| 14 | + rebateCalcFlag: number | ||
| 15 | + dataSource?: string | ||
| 16 | + verifyStatus: number | ||
| 17 | + uploadTime?: string | ||
| 18 | + createBy?: string | ||
| 19 | + createTime?: string | ||
| 20 | + updateBy?: string | ||
| 21 | + updateTime?: string | ||
| 22 | + orderItems?: OrderItemInfo[] | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +export interface OrderItemInfo { | ||
| 26 | + itemId?: number | ||
| 27 | + orderId?: number | ||
| 28 | + productCode: string | ||
| 29 | + productName: string | ||
| 30 | + productQty: number | ||
| 31 | + unitPrice: number | ||
| 32 | + itemAmount: number | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +export interface OrderQueryReq { | ||
| 36 | + orderNo?: string | ||
| 37 | + dealerCode?: string | ||
| 38 | + dealerName?: string | ||
| 39 | + deliveryStatus?: number | ||
| 40 | + invoiceStatus?: number | ||
| 41 | + rebateCalcFlag?: number | ||
| 42 | + dataSource?: string | ||
| 43 | + verifyStatus?: number | ||
| 44 | + orderStartDate?: string | ||
| 45 | + orderEndDate?: string | ||
| 46 | + minAmount?: number | ||
| 47 | + maxAmount?: number | ||
| 48 | + pageNum?: number | ||
| 49 | + pageSize?: number | ||
| 50 | +} | ||
| 51 | + | ||
| 52 | +export interface OrderAddReq { | ||
| 53 | + orderNo: string | ||
| 54 | + dealerCode: string | ||
| 55 | + dealerName: string | ||
| 56 | + orderDate: string | ||
| 57 | + totalAmount: number | ||
| 58 | + rebateAmount?: number | ||
| 59 | + deliveryStatus?: number | ||
| 60 | + invoiceStatus?: number | ||
| 61 | + rebateCalcFlag?: number | ||
| 62 | + dataSource?: string | ||
| 63 | + verifyStatus?: number | ||
| 64 | + uploadTime?: string | ||
| 65 | + orderItems: OrderItemAddReq[] | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +export interface OrderItemAddReq { | ||
| 69 | + productCode: string | ||
| 70 | + productName: string | ||
| 71 | + productQty: number | ||
| 72 | + unitPrice: number | ||
| 73 | + itemAmount: number | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +export interface OrderUpdateReq { | ||
| 77 | + orderId: number | ||
| 78 | + orderNo: string | ||
| 79 | + dealerCode: string | ||
| 80 | + dealerName: string | ||
| 81 | + orderDate: string | ||
| 82 | + totalAmount: number | ||
| 83 | + rebateAmount?: number | ||
| 84 | + deliveryStatus?: number | ||
| 85 | + invoiceStatus?: number | ||
| 86 | + rebateCalcFlag?: number | ||
| 87 | + dataSource?: string | ||
| 88 | + verifyStatus?: number | ||
| 89 | + uploadTime?: string | ||
| 90 | + orderItems: OrderItemUpdateReq[] | ||
| 91 | +} | ||
| 92 | + | ||
| 93 | +export interface OrderItemUpdateReq { | ||
| 94 | + itemId?: number | ||
| 95 | + productCode: string | ||
| 96 | + productName: string | ||
| 97 | + productQty: number | ||
| 98 | + unitPrice: number | ||
| 99 | + itemAmount: number | ||
| 100 | +} | ||
| 101 | + | ||
| 102 | +// 订单API接口 | ||
| 103 | +export const orderApi = { | ||
| 104 | + // 分页查询订单列表 | ||
| 105 | + getOrderList: (params: OrderQueryReq) => { | ||
| 106 | + return request.get('/order/list', { params }) | ||
| 107 | + }, | ||
| 108 | + | ||
| 109 | + // 获取订单详情 | ||
| 110 | + getOrderDetail: (orderId: number) => { | ||
| 111 | + return request.get(`/order/${orderId}`) | ||
| 112 | + }, | ||
| 113 | + | ||
| 114 | + // 新增订单 | ||
| 115 | + addOrder: (data: OrderAddReq) => { | ||
| 116 | + return request.post('/order', data) | ||
| 117 | + }, | ||
| 118 | + | ||
| 119 | + // 修改订单 | ||
| 120 | + updateOrder: (data: OrderUpdateReq) => { | ||
| 121 | + return request.post('/order/update', data) | ||
| 122 | + }, | ||
| 123 | + | ||
| 124 | + // 删除订单 | ||
| 125 | + deleteOrder: (orderId: number) => { | ||
| 126 | + return request.delete(`/order/${orderId}`) | ||
| 127 | + }, | ||
| 128 | + | ||
| 129 | + // 批量删除订单 | ||
| 130 | + batchDeleteOrders: (orderIds: number[]) => { | ||
| 131 | + return request.post('/order/batchDelete', orderIds) | ||
| 132 | + }, | ||
| 133 | + | ||
| 134 | + // 修改订单出库状态 | ||
| 135 | + updateDeliveryStatus: (orderId: number, deliveryStatus: number) => { | ||
| 136 | + return request.post(`/order/${orderId}/deliveryStatus`, null, { | ||
| 137 | + params: { deliveryStatus } | ||
| 138 | + }) | ||
| 139 | + }, | ||
| 140 | + | ||
| 141 | + // 修改订单开票状态 | ||
| 142 | + updateInvoiceStatus: (orderId: number, invoiceStatus: number) => { | ||
| 143 | + return request.post(`/order/${orderId}/invoiceStatus`, null, { | ||
| 144 | + params: { invoiceStatus } | ||
| 145 | + }) | ||
| 146 | + }, | ||
| 147 | + | ||
| 148 | + // 修改订单返利计算状态 | ||
| 149 | + updateRebateCalcFlag: (orderId: number, rebateCalcFlag: number) => { | ||
| 150 | + return request.post(`/order/${orderId}/rebateCalcFlag`, null, { | ||
| 151 | + params: { rebateCalcFlag } | ||
| 152 | + }) | ||
| 153 | + } | ||
| 154 | +} |
| ... | @@ -141,6 +141,9 @@ const tabContainer = ref<HTMLElement>() | ... | @@ -141,6 +141,9 @@ const tabContainer = ref<HTMLElement>() |
| 141 | // 菜单项配置 | 141 | // 菜单项配置 |
| 142 | const menuItems = ref([ | 142 | const menuItems = ref([ |
| 143 | { name: '首页', path: '/main/dashboard', icon: '🏠' }, | 143 | { name: '首页', path: '/main/dashboard', icon: '🏠' }, |
| 144 | + { name: '订单管理', path: '/main/order', icon: '📋' }, | ||
| 145 | + { name: '出库查询', path: '/main/delivery', icon: '📦' }, | ||
| 146 | + { name: '发票管理', path: '/main/invoice', icon: '🧾' }, | ||
| 144 | { name: '产品管理', path: '/main/product', icon: '📦' }, | 147 | { name: '产品管理', path: '/main/product', icon: '📦' }, |
| 145 | { name: '经销商管理', path: '/main/dealer', icon: '🏢' }, | 148 | { name: '经销商管理', path: '/main/dealer', icon: '🏢' }, |
| 146 | { | 149 | { | ... | ... |
| ... | @@ -135,6 +135,33 @@ const staticRoutes: RouteRecordRaw[] = [ | ... | @@ -135,6 +135,33 @@ const staticRoutes: RouteRecordRaw[] = [ |
| 135 | } | 135 | } |
| 136 | }, | 136 | }, |
| 137 | { | 137 | { |
| 138 | + path: 'order', | ||
| 139 | + name: 'Order', | ||
| 140 | + component: () => import('@/views/order/index.vue'), | ||
| 141 | + meta: { | ||
| 142 | + title: '订单管理', | ||
| 143 | + requiresAuth: true | ||
| 144 | + } | ||
| 145 | + }, | ||
| 146 | + { | ||
| 147 | + path: 'delivery', | ||
| 148 | + name: 'Delivery', | ||
| 149 | + component: () => import('@/views/delivery/index.vue'), | ||
| 150 | + meta: { | ||
| 151 | + title: '出库查询', | ||
| 152 | + requiresAuth: true | ||
| 153 | + } | ||
| 154 | + }, | ||
| 155 | + { | ||
| 156 | + path: 'invoice', | ||
| 157 | + name: 'Invoice', | ||
| 158 | + component: () => import('@/views/invoice/index.vue'), | ||
| 159 | + meta: { | ||
| 160 | + title: '发票管理', | ||
| 161 | + requiresAuth: true | ||
| 162 | + } | ||
| 163 | + }, | ||
| 164 | + { | ||
| 138 | path: 'settings', | 165 | path: 'settings', |
| 139 | name: 'Settings', | 166 | name: 'Settings', |
| 140 | component: () => import('@/views/settings/index.vue'), | 167 | component: () => import('@/views/settings/index.vue'), | ... | ... |
| ... | @@ -3,16 +3,19 @@ import { ElMessage, ElMessageBox } from 'element-plus' | ... | @@ -3,16 +3,19 @@ import { ElMessage, ElMessageBox } from 'element-plus' |
| 3 | import { useUserStore } from '@/stores/modules/user' | 3 | import { useUserStore } from '@/stores/modules/user' |
| 4 | import router from '@/router' | 4 | import router from '@/router' |
| 5 | 5 | ||
| 6 | +// API基础配置 | ||
| 7 | +const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:8083' | ||
| 8 | + | ||
| 6 | // 创建axios实例 | 9 | // 创建axios实例 |
| 7 | const service: AxiosInstance = axios.create({ | 10 | const service: AxiosInstance = axios.create({ |
| 8 | - baseURL: import.meta.env.VITE_API_BASE_URL, | 11 | + baseURL: API_BASE_URL, |
| 9 | timeout: 10000, | 12 | timeout: 10000, |
| 10 | headers: { | 13 | headers: { |
| 11 | 'Content-Type': 'application/json;charset=UTF-8' | 14 | 'Content-Type': 'application/json;charset=UTF-8' |
| 12 | } | 15 | } |
| 13 | }) | 16 | }) |
| 14 | 17 | ||
| 15 | -console.log('Axios实例创建,baseURL:', import.meta.env.VITE_API_BASE_URL) | 18 | +console.log('Request工具实例创建,baseURL:', API_BASE_URL) |
| 16 | 19 | ||
| 17 | // 请求拦截器 | 20 | // 请求拦截器 |
| 18 | service.interceptors.request.use( | 21 | service.interceptors.request.use( |
| ... | @@ -25,12 +28,11 @@ service.interceptors.request.use( | ... | @@ -25,12 +28,11 @@ service.interceptors.request.use( |
| 25 | headers: config.headers | 28 | headers: config.headers |
| 26 | }) | 29 | }) |
| 27 | 30 | ||
| 28 | - const userStore = useUserStore() | ||
| 29 | - | ||
| 30 | // 添加token到请求头 | 31 | // 添加token到请求头 |
| 31 | - if (userStore.token) { | 32 | + const token = localStorage.getItem('token') |
| 33 | + if (token) { | ||
| 32 | config.headers = config.headers || {} | 34 | config.headers = config.headers || {} |
| 33 | - config.headers['Authorization'] = `Bearer ${userStore.token}` | 35 | + config.headers['Authorization'] = `Bearer ${token}` |
| 34 | } | 36 | } |
| 35 | 37 | ||
| 36 | return config | 38 | return config | ... | ... |
frontend/src/views/delivery/index.vue
0 → 100644
This diff is collapsed. Click to expand it.
frontend/src/views/invoice/index.vue
0 → 100644
This diff is collapsed. Click to expand it.
frontend/src/views/order/index.vue
0 → 100644
This diff is collapsed. Click to expand it.
| ... | @@ -1026,8 +1026,9 @@ onMounted(() => { | ... | @@ -1026,8 +1026,9 @@ onMounted(() => { |
| 1026 | .dialog-content { | 1026 | .dialog-content { |
| 1027 | background: white; | 1027 | background: white; |
| 1028 | border-radius: 8px; | 1028 | border-radius: 8px; |
| 1029 | - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); | 1029 | + box-shadow: 0 4px 20px rgba(0,0,0,0.15); |
| 1030 | - width: 600px; | 1030 | + max-width: 600px; |
| 1031 | + width: 90%; | ||
| 1031 | max-height: 80vh; | 1032 | max-height: 80vh; |
| 1032 | overflow-y: auto; | 1033 | overflow-y: auto; |
| 1033 | } | 1034 | } |
| ... | @@ -1095,10 +1096,9 @@ onMounted(() => { | ... | @@ -1095,10 +1096,9 @@ onMounted(() => { |
| 1095 | 1096 | ||
| 1096 | .form-input, .form-select, .form-textarea { | 1097 | .form-input, .form-select, .form-textarea { |
| 1097 | padding: 8px 12px; | 1098 | padding: 8px 12px; |
| 1098 | - border: 1px solid #d9d9d9; | 1099 | + border: 1px solid #ddd; |
| 1099 | border-radius: 4px; | 1100 | border-radius: 4px; |
| 1100 | font-size: 14px; | 1101 | font-size: 14px; |
| 1101 | - transition: border-color 0.2s; | ||
| 1102 | } | 1102 | } |
| 1103 | 1103 | ||
| 1104 | .form-input:focus, .form-select:focus, .form-textarea:focus { | 1104 | .form-input:focus, .form-select:focus, .form-textarea:focus { |
| ... | @@ -1122,25 +1122,20 @@ onMounted(() => { | ... | @@ -1122,25 +1122,20 @@ onMounted(() => { |
| 1122 | } | 1122 | } |
| 1123 | 1123 | ||
| 1124 | .cancel-btn, .submit-btn { | 1124 | .cancel-btn, .submit-btn { |
| 1125 | - padding: 8px 16px; | 1125 | + padding: 10px 20px; |
| 1126 | border: none; | 1126 | border: none; |
| 1127 | border-radius: 4px; | 1127 | border-radius: 4px; |
| 1128 | - font-size: 14px; | ||
| 1129 | cursor: pointer; | 1128 | cursor: pointer; |
| 1130 | - transition: all 0.2s; | 1129 | + font-weight: 500; |
| 1131 | } | 1130 | } |
| 1132 | 1131 | ||
| 1133 | .cancel-btn { | 1132 | .cancel-btn { |
| 1134 | - background: #f5f5f5; | 1133 | + background: #6c757d; |
| 1135 | - color: #666; | 1134 | + color: white; |
| 1136 | -} | ||
| 1137 | - | ||
| 1138 | -.cancel-btn:hover { | ||
| 1139 | - background: #e6e6e6; | ||
| 1140 | } | 1135 | } |
| 1141 | 1136 | ||
| 1142 | .submit-btn { | 1137 | .submit-btn { |
| 1143 | - background: #1890ff; | 1138 | + background: #007bff; |
| 1144 | color: white; | 1139 | color: white; |
| 1145 | } | 1140 | } |
| 1146 | 1141 | ... | ... |
-
Please register or login to post a comment