|
|
@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import com.trade.purchase.order.dto.OrderSubmitDto;
|
|
|
import com.trade.purchase.order.entity.Order;
|
|
|
-import com.trade.purchase.order.entity.OrderItems;
|
|
|
+import com.trade.purchase.order.entity.OrderFees;
|
|
|
+import com.trade.purchase.order.entity.OrderFiles;
|
|
|
import com.trade.purchase.order.enums.OrderTypeEnum;
|
|
|
+import com.trade.purchase.order.service.IOrderFeesService;
|
|
|
+import com.trade.purchase.order.service.IOrderFilesService;
|
|
|
import com.trade.purchase.order.service.IOrderItemsService;
|
|
|
import com.trade.purchase.order.service.IOrderService;
|
|
|
import com.trade.purchase.order.vo.OrderVO;
|
|
|
@@ -37,8 +40,15 @@ public class ImportOrderController extends BladeController {
|
|
|
|
|
|
private final IOrderService orderService;
|
|
|
|
|
|
+ private final IOrderFeesService orderFeesService;
|
|
|
+
|
|
|
+ private final IOrderFilesService orderFilesService;
|
|
|
+
|
|
|
private final IOrderItemsService orderItemsService;
|
|
|
|
|
|
+ private final String ERROR_MSG = "缺少查询信息";
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 详情
|
|
|
*/
|
|
|
@@ -54,7 +64,7 @@ public class ImportOrderController extends BladeController {
|
|
|
*/
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
- @ApiOperation(value = "分页", notes = "传入order")
|
|
|
+ @ApiOperation(value = "查询所有", notes = "传入order")
|
|
|
public R<IPage<Order>> list(Order order, Query query) {
|
|
|
order.setIsDeleted(0);
|
|
|
order.setTenantId(AuthUtil.getTenantId());
|
|
|
@@ -97,9 +107,9 @@ public class ImportOrderController extends BladeController {
|
|
|
@PostMapping("/update")
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation(value = "修改", notes = "传入order")
|
|
|
- public R update(@Valid @RequestBody Order order) {
|
|
|
+ public R<String> update(@Valid @RequestBody Order order) {
|
|
|
if (order.getId() == null) {
|
|
|
- return R.fail(500, "请选择要删除的数据");
|
|
|
+ return R.fail(ERROR_MSG);
|
|
|
}
|
|
|
order.setIsDeleted(1);
|
|
|
return R.status(orderService.updateById(order));
|
|
|
@@ -118,28 +128,44 @@ public class ImportOrderController extends BladeController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 采购订单表
|
|
|
+ * 删除 销售或采购订单表
|
|
|
*/
|
|
|
- @PostMapping("/removeByItem")
|
|
|
- @ApiOperationSupport(order = 5)
|
|
|
- @ApiOperation(value = "修改", notes = "传入order")
|
|
|
- public R update(@Valid @RequestBody OrderItems order) {
|
|
|
+ @PostMapping("/remove")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ @ApiOperation(value = "删除", notes = "传入ids")
|
|
|
+ public R<String> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
+ return R.status(orderService.removeByIds(Func.toLongList(ids)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除费用信息
|
|
|
+ */
|
|
|
+ @PostMapping("/removeByFees")
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
+ @ApiOperation(value = "删除费用信息", notes = "传入order")
|
|
|
+ public R<String> update(@Valid @RequestBody OrderFees order) {
|
|
|
if (order.getId() == null) {
|
|
|
- return R.fail(500, "请选择要删除的数据");
|
|
|
+ return R.fail(ERROR_MSG);
|
|
|
}
|
|
|
order.setIsDeleted(1);
|
|
|
- return R.status(orderItemsService.updateById(order));
|
|
|
+ return R.status(orderFeesService.updateById(order));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 删除 销售或采购订单表
|
|
|
+ * 删除订单文件信息
|
|
|
+ *
|
|
|
+ * @param order
|
|
|
+ * @return
|
|
|
*/
|
|
|
- @PostMapping("/remove")
|
|
|
- @ApiOperationSupport(order = 8)
|
|
|
- @ApiOperation(value = "删除", notes = "传入ids")
|
|
|
- public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
- return R.status(orderService.removeByIds(Func.toLongList(ids)));
|
|
|
+ @PostMapping("/removeByFiles")
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
+ @ApiOperation(value = "删除文件信息", notes = "传入order")
|
|
|
+ public R<String> update(@Valid @RequestBody OrderFiles order) {
|
|
|
+ if (order.getId() == null) {
|
|
|
+ return R.fail(ERROR_MSG);
|
|
|
+ }
|
|
|
+ order.setIsDeleted(1);
|
|
|
+ return R.status(orderFilesService.updateById(order));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|