|
|
@@ -25,11 +25,13 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
+import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
@@ -45,8 +47,8 @@ import java.util.Map;
|
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
|
@RequestMapping("/purchase-order")
|
|
|
-@Api(value = "采购订单表", tags = "采购订单表接口")
|
|
|
-public class ImportOrderController extends BladeController {
|
|
|
+@Api(value = "进口、出口、内贸采购订单", tags = "进口、出口、内贸采购订单")
|
|
|
+public class PurchaseOrderController extends BladeController {
|
|
|
|
|
|
private final IOrderService orderService;
|
|
|
|
|
|
@@ -64,7 +66,7 @@ public class ImportOrderController extends BladeController {
|
|
|
*/
|
|
|
@GetMapping("/{id}")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
- @ApiOperation(value = "详情", notes = "传入order")
|
|
|
+ @ApiOperation(value = "采购订单查看详情", notes = "传入order")
|
|
|
public R<OrderVO> detail(@PathVariable(value = "id") String id) {
|
|
|
return orderService.getOrderMessage(id);
|
|
|
}
|
|
|
@@ -74,16 +76,16 @@ public class ImportOrderController extends BladeController {
|
|
|
*/
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
- @ApiOperation(value = "查询所有", notes = "传入order")
|
|
|
+ @ApiOperation(value = "采购订单表列表(内贸 外贸 出口)", notes = "传入order")
|
|
|
public R<IPage<Order>> list(@RequestParam(name = "current", defaultValue = "1") Integer current,
|
|
|
@RequestParam(name = "size", defaultValue = "10") Integer size,
|
|
|
- @RequestParam(name = "businesStartDate", required = false) String businesStartDate,
|
|
|
- @RequestParam(name = "businesEndDate", required = false) String businesEndDate,
|
|
|
- @RequestParam(name = "accountsCollectionStartDate", required = false) String accountsCollectionStartDate,
|
|
|
- @RequestParam(name = "accountsCollectionEndDate", required = false) String accountsCollectionEndDate,
|
|
|
- @RequestParam(name = "dateOfStartArrival", required = false) String dateOfStartArrival,
|
|
|
- @RequestParam(name = "dateOfEndArrival", required = false) String dateOfEndArrival,
|
|
|
- @RequestParam(name = "tradeType", required = true) String tradeType
|
|
|
+ @RequestParam(value = "businesStartDate",required = false) String businesStartDate,//订单开始时间
|
|
|
+ @RequestParam(value = "businesEndDate",required = false) String businesEndDate,//订单结束时间
|
|
|
+ @RequestParam(value = "accountsCollectionStartDate",required = false) String accountsCollectionStartDate,//付款开始时间
|
|
|
+ @RequestParam(value = "accountsCollectionEndDate",required = false) String accountsCollectionEndDate,//付款结束时间
|
|
|
+ @RequestParam(value = "dateOfStartArrival",required = false) String dateOfStartArrival,//付款开始时间
|
|
|
+ @RequestParam(value = "dateOfEndArrival",required = false) String dateOfEndArrival,//付款开始时间
|
|
|
+ @RequestParam(value = "tradeType",required = false) String tradeType//采购订单类型 GN JK CK
|
|
|
)
|
|
|
{
|
|
|
|
|
|
@@ -107,9 +109,9 @@ public class ImportOrderController extends BladeController {
|
|
|
return R.data(pages);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
+/* *//**
|
|
|
* 自定义分页 销售或采购订单表
|
|
|
- */
|
|
|
+ *//*
|
|
|
@GetMapping("/page")
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
@ApiOperation(value = "分页", notes = "传入order")
|
|
|
@@ -120,24 +122,22 @@ public class ImportOrderController extends BladeController {
|
|
|
order.setTradeType(OrderTypeEnum.IMPORT.getType());
|
|
|
IPage<OrderVO> pages = orderService.selectOrderPage(Condition.getPage(query), order);
|
|
|
return R.data(pages);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
/**
|
|
|
* 新增 销售或采购订单表
|
|
|
*/
|
|
|
- @PostMapping("/save")
|
|
|
+ /*@PostMapping("/save")
|
|
|
@ApiOperationSupport(order = 4)
|
|
|
@ApiOperation(value = "新增", notes = "传入order")
|
|
|
public R<String> save(@Valid @RequestBody OrderSubmitDto submitDto) {
|
|
|
- submitDto.setOrderTypeEnum(OrderTypeEnum.PURCHASE);
|
|
|
- submitDto.setTradeTypeEnum(OrderTypeEnum.IMPORT);
|
|
|
return orderService.saveOrderMessage(submitDto);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
/**
|
|
|
* 修改 销售或采购订单表
|
|
|
*/
|
|
|
- @PostMapping("/update")
|
|
|
+ /*@PostMapping("/update")
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation(value = "修改", notes = "传入order")
|
|
|
public R<String> update(@Valid @RequestBody Order order) {
|
|
|
@@ -146,7 +146,7 @@ public class ImportOrderController extends BladeController {
|
|
|
}
|
|
|
order.setIsDeleted(1);
|
|
|
return R.status(orderService.updateById(order));
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
/**
|
|
|
* 新增或修改 销售或采购订单表
|
|
|
@@ -154,7 +154,12 @@ public class ImportOrderController extends BladeController {
|
|
|
@PostMapping("/submit")
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入order")
|
|
|
- public R<String> submit(@Valid @RequestBody OrderSubmitDto submitDto) {
|
|
|
+ public R<String> submit(@Valid @RequestBody OrderSubmitDto submitDto)
|
|
|
+ {
|
|
|
+ if(ObjectUtil.isEmpty(submitDto.getBillType())||ObjectUtil.isEmpty(submitDto.getSrcId())||ObjectUtil.isEmpty(submitDto.getBusinesDate()))
|
|
|
+ {
|
|
|
+ throw new ServiceException("来源、合同日期、贸易类型不能为空!");
|
|
|
+ }
|
|
|
submitDto.setOrderTypeEnum(OrderTypeEnum.PURCHASE);
|
|
|
return orderService.submitOrderMessage(submitDto);
|
|
|
}
|
|
|
@@ -215,6 +220,7 @@ public class ImportOrderController extends BladeController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("getItemByPid")
|
|
|
+ @ApiOperation(value = "查询采购订单的子明细", notes = "通过采购订单的id查询")
|
|
|
public R getItemByPid(@RequestParam(value = "id",required = true)Long id)
|
|
|
{
|
|
|
LambdaQueryWrapper<OrderItems> lambdaQueryWrapper=new LambdaQueryWrapper<>();
|