From 60eb14c105dc7b981be3be87003a0411155d3cf7 Mon Sep 17 00:00:00 2001 From: guoyuji <guoyujie@ng.com> Date: 星期四, 01 二月 2024 10:46:02 +0800 Subject: [PATCH] 提交前后端订单保存实现方法 --- north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java b/north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java new file mode 100644 index 0000000..58b04fa --- /dev/null +++ b/north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java @@ -0,0 +1,33 @@ +package com.example.erp.controller.sd; + +import cn.hutool.json.JSON; +import com.alibaba.fastjson.JSONObject; +import com.example.erp.common.Constants; +import com.example.erp.common.Result; +import com.example.erp.entity.sd.Order; +import com.example.erp.exception.ServiceException; +import com.example.erp.service.sd.OrderService; +import org.apache.tomcat.Jar; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +@RestController +@RequestMapping("/order") +public class OrderController { + @Autowired + private OrderService orderService; + + @PostMapping("/saveOrder") + public Result saveOrder(@RequestBody Map<String, Object> orderMap) throws Exception { + if(orderService.saveOrder(orderMap)) { + return Result.seccess(true); + }else{ + throw new ServiceException(Constants.Code_500,Constants.Code_msg); + } + } +} -- Gitblit v1.8.0