From 5a3bb59bfafc2a38b4c0dd8c8906db35fff4c2fd Mon Sep 17 00:00:00 2001 From: xioayue Date: Sat, 2 Jul 2022 12:06:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../szwh/controller/api/OrderController.java | 59 ++++++++++++------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/src/main/java/cn/chjyj/szwh/controller/api/OrderController.java b/src/main/java/cn/chjyj/szwh/controller/api/OrderController.java index 56027d8..ac10d83 100644 --- a/src/main/java/cn/chjyj/szwh/controller/api/OrderController.java +++ b/src/main/java/cn/chjyj/szwh/controller/api/OrderController.java @@ -9,17 +9,22 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.HashMap; +import java.util.Map; + /** * 用户订单信息 * only POST method */ @RestController -@RequestMapping(name = "/api/Order",method = RequestMethod.POST) +@RequestMapping(name = "/api/Order", method = RequestMethod.POST) public class OrderController extends BaseController { @Autowired private OrderService orderService; + /** * 获取订单信息 + * * @param batchcode * @param userIsli * @param userRole @@ -33,55 +38,67 @@ public class OrderController extends BaseController { * @return */ @RequestMapping("/getOrder") - public JSONObject getOrder(@RequestParam("batchcode")String batchcode, + public JSONObject getOrder(@RequestParam("batchcode") String batchcode, @RequestParam("user_isli") String userIsli, - String userRole,String payStatus,String closeStatus, - String orderStatus,String creatime,String chargesType, - @RequestParam(name = "page",defaultValue = "1") String page, - @RequestParam(name = "limit",defaultValue = "20")String pagesize - ){ - -// $batchcode = $this->request->post('', ''); -// $user_isli = $this->request->post(); -// $user_role = $this->request->post('user_role'); -// $pay_status = $this->request->post('pay_status'); -// $close_status = $this->request->post('close_status'); -// $order_status = $this->request->post('order_status'); -// $createtime = $this->request->post('createtime'); -// $charges_type = $this->request->post('charges_type'); - + @RequestParam("user_role") String userRole, + @RequestParam("pay_status") String payStatus, + @RequestParam("close_status") String closeStatus, + @RequestParam("order_status") String orderStatus, + @RequestParam("createtime") String creatime, + @RequestParam("charges_type") String chargesType, + @RequestParam(name = "page", defaultValue = "1") String page, + @RequestParam(name = "limit", defaultValue = "20") String pagesize + ) { + // 拼装查询条件 + Map qmap = new HashMap<>(); + qmap.put("batchcode", batchcode); + qmap.put("user_isli", userIsli); + qmap.put("user_role", userRole); + qmap.put("pay_status", payStatus); + qmap.put("close_status", closeStatus); + qmap.put("order_status", orderStatus); + qmap.put("createtime", creatime); + qmap.put("charges_type", chargesType); + // + int ipage = Integer.valueOf(page); + int ips = Integer.valueOf(pagesize); + int startrs = ipage > 0 ? (ipage - 1) * ips : 0; + orderService.getOrderList(qmap, startrs, ips); return jsonObject; } /** * 创建订单 + * * @return */ @RequestMapping("/createOrder") - public JSONObject createOrder(){ + public JSONObject createOrder() { return jsonObject; } /** * 查询发票 + * * @return */ @RequestMapping("/getTicket") - public JSONObject getTicket(){ + public JSONObject getTicket() { return jsonObject; } /** * 订单结算 + * * @return */ @RequestMapping("/getBalance") - public JSONObject getBalance(){ + public JSONObject getBalance() { return jsonObject; } @RequestMapping("/orderCloseCallback") - public JSONObject orderCloseCallback(){ + public JSONObject orderCloseCallback() { // 请求转发到远程服务器 return jsonObject; }