|
|
|
@ -9,6 +9,7 @@ import java.util.Map;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
|
@ -90,6 +91,11 @@ public class OrderController {
|
|
|
|
|
@PostMapping(value = "/add")
|
|
|
|
|
public Result<String> add(@RequestBody OrderPage orderPage) {
|
|
|
|
|
Order order = new Order();
|
|
|
|
|
Long orderId = IdWorker.getId();
|
|
|
|
|
order.setId(orderId);
|
|
|
|
|
orderPage.getOrderDetailList().forEach(e ->{
|
|
|
|
|
e.setOrderId(orderId);
|
|
|
|
|
});
|
|
|
|
|
BeanUtils.copyProperties(orderPage, order);
|
|
|
|
|
orderService.saveMain(order, orderPage.getOrderDetailList());
|
|
|
|
|
return Result.OK("添加成功!");
|
|
|
|
|