|
|
@@ -0,0 +1,140 @@
|
|
|
+/*
|
|
|
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
|
|
|
+ *
|
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
|
+ * modification, are permitted provided that the following conditions are met:
|
|
|
+ *
|
|
|
+ * Redistributions of source code must retain the above copyright notice,
|
|
|
+ * this list of conditions and the following disclaimer.
|
|
|
+ * Redistributions in binary form must reproduce the above copyright
|
|
|
+ * notice, this list of conditions and the following disclaimer in the
|
|
|
+ * documentation and/or other materials provided with the distribution.
|
|
|
+ * Neither the name of the dreamlu.net developer nor the names of its
|
|
|
+ * contributors may be used to endorse or promote products derived from
|
|
|
+ * this software without specific prior written permission.
|
|
|
+ * Author: Chill 庄骞 (smallchill@163.com)
|
|
|
+ */
|
|
|
+package org.springblade.deliver.goods.receiving;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
+import com.trade.purchase.order.enums.OrderTypeEnum;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.core.boot.ctrl.BladeController;
|
|
|
+import org.springblade.core.mp.support.Condition;
|
|
|
+import org.springblade.core.mp.support.Query;
|
|
|
+import org.springblade.core.secure.utils.SecureUtil;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.deliver.goods.entity.Delivery;
|
|
|
+import org.springblade.deliver.goods.service.IDeliveryService;
|
|
|
+import org.springblade.deliver.goods.vo.DeliveryVO;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 出口收货通知单 控制器
|
|
|
+ *
|
|
|
+ * @author BladeX
|
|
|
+ * @since 2021-09-26
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/exportReCeVing")
|
|
|
+@Api(value = "出口收货通知单", tags = "出口收货通知单接口")
|
|
|
+public class ExportReCeVingController extends BladeController {
|
|
|
+
|
|
|
+ private final IDeliveryService deliveryService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 详情
|
|
|
+ */
|
|
|
+ @GetMapping("/detail")
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
+ @ApiOperation(value = "详情", notes = "传入delivery")
|
|
|
+ public R<Delivery> detail(Delivery delivery) {
|
|
|
+ Delivery detail = deliveryService.getDeliveryMessage(delivery);
|
|
|
+ return R.data(detail);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 出口收货通知单
|
|
|
+ */
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation(value = "分页", notes = "传入delivery")
|
|
|
+ public R<IPage<Delivery>> list(Delivery delivery, Query query) {
|
|
|
+ delivery.setIsDeleted(0);
|
|
|
+ delivery.setTenantId(SecureUtil.getTenantId());
|
|
|
+ delivery.setBillType(OrderTypeEnum.RECEIPT.getType());
|
|
|
+ delivery.setTradeType(OrderTypeEnum.EXPORT.getType());
|
|
|
+ IPage<Delivery> pages = deliveryService.page(Condition.getPage(query), Condition.getQueryWrapper(delivery));
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 自定义分页 出口收货通知单
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperation(value = "分页", notes = "传入delivery")
|
|
|
+ public R<IPage<DeliveryVO>> page(DeliveryVO delivery, Query query) {
|
|
|
+ delivery.setIsDeleted(0);
|
|
|
+ delivery.setTenantId(SecureUtil.getTenantId());
|
|
|
+ delivery.setBillType(OrderTypeEnum.RECEIPT.getType());
|
|
|
+ delivery.setTradeType(OrderTypeEnum.EXPORT.getType());
|
|
|
+ IPage<DeliveryVO> pages = deliveryService.selectDeliveryPage(Condition.getPage(query), delivery);
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增 出口收货通知单
|
|
|
+ */
|
|
|
+ @PostMapping("/save")
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperation(value = "新增", notes = "传入delivery")
|
|
|
+ public R save(@Valid @RequestBody Delivery delivery) {
|
|
|
+ return R.status(deliveryService.save(delivery));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改 出口收货通知单
|
|
|
+ */
|
|
|
+ @PostMapping("/update")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperation(value = "修改", notes = "传入delivery")
|
|
|
+ public R update(@Valid @RequestBody Delivery delivery) {
|
|
|
+ if (delivery.getId() == null){
|
|
|
+ return R.fail(500,"请选择要删除的数据");
|
|
|
+ }
|
|
|
+ delivery.setIsDeleted(1);
|
|
|
+ return R.status(deliveryService.updateById(delivery));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增或修改 出口收货通知单
|
|
|
+ * billType FH 发货通知 SH 收货通知
|
|
|
+ */
|
|
|
+ @PostMapping("/submit")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperation(value = "新增或修改", notes = "传入delivery")
|
|
|
+ public R submit(@Valid @RequestBody Delivery delivery) {
|
|
|
+ delivery.setBillType(OrderTypeEnum.RECEIPT.getType());
|
|
|
+ delivery.setTradeType(OrderTypeEnum.EXPORT.getType());
|
|
|
+ return deliveryService.submitDelivery(delivery);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 删除 出口收货通知单
|
|
|
+ */
|
|
|
+ @PostMapping("/remove")
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
+ @ApiOperation(value = "删除", notes = "传入ids")
|
|
|
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
+ return R.status(deliveryService.removeByIds(Func.toLongList(ids)));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|