增加新版本下单接口调用
This commit is contained in:
@@ -3,9 +3,11 @@ package com.ruoyi.web.controller.api;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.ruoyi.common.core.domain.CTResponse;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ct.domain.Bill;
|
||||
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||
@@ -19,12 +21,10 @@ import com.ruoyi.system.service.ISysOssService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
@@ -47,11 +47,31 @@ public class APIController {
|
||||
return R.ok(ctService.selectNumber(personnelId, saleId, page, pageSize));
|
||||
}
|
||||
|
||||
@GetMapping("/saveOrder")
|
||||
public R<String> saveOrder() throws Exception {
|
||||
CTResponse<String> response = ctService.saveOrder("", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "", "",
|
||||
"", "", "", "");
|
||||
@PostMapping("/saveOrder")
|
||||
public R<String> saveOrder(HttpServletRequest request, @RequestBody JSONObject body) throws Exception {
|
||||
System.out.println("body = " + body);
|
||||
String ip = StringUtils.blankToDefault(request.getHeader("x-real-ip"), request.getRemoteAddr());
|
||||
CTResponse<String> response = ctService.saveOrder(
|
||||
body.getStr("name"),
|
||||
body.getStr("idCard"),
|
||||
body.getStr("contactMobile"),
|
||||
body.getStr("installedAddress"),
|
||||
body.getStr("saleId"),
|
||||
body.getStr("storeId"),
|
||||
body.getStr("personnelId"),
|
||||
body.getStr("province"),
|
||||
body.getStr("city"),
|
||||
body.getStr("county"),
|
||||
body.getStr("serialNumber"),
|
||||
body.getStr("number"),
|
||||
body.getStr("logiRemark"),
|
||||
body.getStr("pageUrl"),
|
||||
body.getStr("remark"),
|
||||
body.getStr("installAddress"),
|
||||
body.getStr("ynumber2"),
|
||||
body.getStr("images"),
|
||||
body.getStr("sn"),
|
||||
ip, true);
|
||||
return R.ok(response.getData());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user