Explorar el Código

产品线申请——显示产品(添加分页返回)

wangyu hace 6 años
padre
commit
43b5bf130f

+ 3 - 0
diagbotman-service/src/main/java/com/diagbot/entity/wrapper/OrderDetailsWapper.java

@@ -48,7 +48,10 @@ public class OrderDetailsWapper {
     private Date endTime;//结束时间
 
     private Date orderTime; //下单时间
+
     private String username;// 用户名
+
     private Long orgId;//机构ID
+
     private String orgName;//机构名称
 }

+ 9 - 2
diagbotman-service/src/main/java/com/diagbot/facade/OrderDetailsFacade.java

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.UserServiceClient;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.UserOrgDTO;
@@ -126,7 +127,7 @@ public class OrderDetailsFacade extends OrderDetailsServiceImpl {
      * @param orderDetialsVO 需要提供参数(付款状态,页数,每页条数默认显示10条)
      * @return 所有订单明细
      */
-    public List<OrderDetailsWapper> getAllOrderDetials(OrderDetialsVO orderDetialsVO){
+    public Page getAllOrderDetials(OrderDetialsVO orderDetialsVO){
         OrderDetailsIndex orderDetailsIndex =new OrderDetailsIndex();
         Long curren = orderDetialsVO.getCurrent();
         Long size =orderDetialsVO.getSize();
@@ -163,6 +164,12 @@ public class OrderDetailsFacade extends OrderDetailsServiceImpl {
                 }
             }
         }
-        return list;
+        Page page =new Page();
+        page.setRecords(list);
+        orderDetailsIndex =new OrderDetailsIndex();
+        page.setCurrent(orderDetialsVO.getCurrent());
+        page.setSize(orderDetialsVO.getSize());
+        page.setTotal(this.seleAllOrderDetials(orderDetailsIndex).size());
+        return page;
     }
 }

+ 3 - 5
diagbotman-service/src/main/java/com/diagbot/web/DiagOrderDetailsController.java

@@ -1,9 +1,9 @@
 package com.diagbot.web;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.wrapper.OrderDetailsWapper;
 import com.diagbot.facade.OrderDetailsFacade;
 import com.diagbot.vo.AuditStatusVO;
 import com.diagbot.vo.OrderDetialsVO;
@@ -15,8 +15,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.List;
-
 /**
  * @Description: 订单明细 前端控制器
  * @Author: wangyu
@@ -36,8 +34,8 @@ public class DiagOrderDetailsController {
                     "status:订单状态(0.未付款1.已付款)" )
     @PostMapping("/getAllOrderDetials")
     @SysLogger("getAllOrderDetials")
-    public RespDTO<List<OrderDetailsWapper>> getAllOrderDetials(@RequestBody OrderDetialsVO orderDetialsVO) {
-        List<OrderDetailsWapper> list = orderDetailsFacade.getAllOrderDetials(orderDetialsVO);
+    public RespDTO<Page> getAllOrderDetials(@RequestBody OrderDetialsVO orderDetialsVO) {
+        Page list = orderDetailsFacade.getAllOrderDetials(orderDetialsVO);
         return RespDTO.onSuc(list);
     }
 

+ 5 - 3
diagbotman-service/src/main/resources/mapper/OrderDetailsMapper.xml

@@ -47,13 +47,15 @@
         LEFT JOIN diag_product_order b ON a.order_num = b.num
         LEFT JOIN diag_lantone_product c ON a.product_id =c.id
         WHERE a.is_deleted = 'N'
-        <if test="orderNum !=null and orderNum !=''">
+        <if test="orderNum != null and orderNum !=''">
             AND a.order_num = #{orderNum}
         </if>
-        <if test="productId !=null and productId !=''">
+        <if test="productId != null and productId !=''">
             AND product_id = #{productId}
         </if>
-        LIMIT #{index},#{size}
+        <if test=" size != null and size != ''">
+            LIMIT #{index},#{size}
+        </if>
     </select>
 
     <select id="selectAllOrderDetialsByOrderNum" resultType="com.diagbot.entity.OrderDetailStatus">