修复总计
This commit is contained in:
		| @@ -0,0 +1,21 @@ | ||||
| package com.ruoyi.custom.controller; | ||||
|  | ||||
| import com.github.pagehelper.PageInfo; | ||||
| import com.ruoyi.common.constant.HttpStatus; | ||||
| import com.ruoyi.common.core.controller.BaseController; | ||||
| import com.ruoyi.custom.page.OrderTableDataInfo; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| public class OrderBaseController extends BaseController { | ||||
|  | ||||
|     protected OrderTableDataInfo getOrderDataTable(List<?> list, long totalAmount) { | ||||
|         OrderTableDataInfo rspData = new OrderTableDataInfo(); | ||||
|         rspData.setCode(HttpStatus.SUCCESS); | ||||
|         rspData.setMsg("查询成功"); | ||||
|         rspData.setRows(list); | ||||
|         rspData.setTotalAmount(totalAmount); | ||||
|         rspData.setTotal(new PageInfo(list).getTotal()); | ||||
|         return rspData; | ||||
|     } | ||||
| } | ||||
| @@ -1,5 +1,6 @@ | ||||
| package com.ruoyi.custom.mapper; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.util.List; | ||||
| import com.ruoyi.custom.domain.SysOrder; | ||||
|  | ||||
| @@ -58,4 +59,11 @@ public interface SysOrderMapper | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSysOrderByIds(Long[] orderIds); | ||||
|  | ||||
|     /** | ||||
|      * 计算所有订单总额 | ||||
|      * @param sysOrder | ||||
|      * @return | ||||
|      */ | ||||
|     public BigDecimal selectAllOrderAmount(SysOrder sysOrder); | ||||
| } | ||||
| @@ -0,0 +1,91 @@ | ||||
| package com.ruoyi.custom.page; | ||||
|  | ||||
|  | ||||
| import java.io.Serializable; | ||||
| import java.util.List; | ||||
|  | ||||
| public class OrderTableDataInfo implements Serializable { | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|      * 总记录数 | ||||
|      */ | ||||
|     private long total; | ||||
|  | ||||
|     /** | ||||
|      * 列表数据 | ||||
|      */ | ||||
|     private List<?> rows; | ||||
|  | ||||
|     /** | ||||
|      * 消息状态码 | ||||
|      */ | ||||
|     private int code; | ||||
|  | ||||
|     /** | ||||
|      * 消息内容 | ||||
|      */ | ||||
|     private String msg; | ||||
|  | ||||
|     /** | ||||
|      * 金额总数 | ||||
|      */ | ||||
|     private long totalAmount; | ||||
|  | ||||
|     /** | ||||
|      * 表格数据对象 | ||||
|      */ | ||||
|     public OrderTableDataInfo() { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 分页 | ||||
|      * | ||||
|      * @param list  列表数据 | ||||
|      * @param total 总记录数 | ||||
|      */ | ||||
|     public OrderTableDataInfo(List<?> list, int total) { | ||||
|         this.rows = list; | ||||
|         this.total = total; | ||||
|     } | ||||
|  | ||||
|     public long getTotal() { | ||||
|         return total; | ||||
|     } | ||||
|  | ||||
|     public void setTotal(long total) { | ||||
|         this.total = total; | ||||
|     } | ||||
|  | ||||
|     public List<?> getRows() { | ||||
|         return rows; | ||||
|     } | ||||
|  | ||||
|     public void setRows(List<?> rows) { | ||||
|         this.rows = rows; | ||||
|     } | ||||
|  | ||||
|     public int getCode() { | ||||
|         return code; | ||||
|     } | ||||
|  | ||||
|     public void setCode(int code) { | ||||
|         this.code = code; | ||||
|     } | ||||
|  | ||||
|     public String getMsg() { | ||||
|         return msg; | ||||
|     } | ||||
|  | ||||
|     public void setMsg(String msg) { | ||||
|         this.msg = msg; | ||||
|     } | ||||
|  | ||||
|     public void setTotalAmount(long totalAmount) { | ||||
|         this.totalAmount = totalAmount; | ||||
|     } | ||||
|  | ||||
|     public long getTotalAmount() { | ||||
|         return totalAmount; | ||||
|     } | ||||
| } | ||||
| @@ -1,5 +1,6 @@ | ||||
| package com.ruoyi.custom.service; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.util.List; | ||||
| import com.ruoyi.custom.domain.SysOrder; | ||||
|  | ||||
| @@ -58,4 +59,11 @@ public interface ISysOrderService | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSysOrderById(Long orderId); | ||||
|  | ||||
|     /** | ||||
|      * 计算所有订单总额 | ||||
|      * @param sysOrder | ||||
|      * @return | ||||
|      */ | ||||
|     public BigDecimal selectAllOrderAmount(SysOrder sysOrder); | ||||
| } | ||||
| @@ -1,5 +1,6 @@ | ||||
| package com.ruoyi.custom.service.impl; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
|  | ||||
| @@ -91,4 +92,14 @@ public class SysOrderServiceImpl implements ISysOrderService { | ||||
|     public int deleteSysOrderById(Long orderId) { | ||||
|         return sysOrderMapper.deleteSysOrderById(orderId); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 计算所有订单总额 | ||||
|      * @param sysOrder | ||||
|      * @return | ||||
|      */ | ||||
|     @Override | ||||
|     public BigDecimal selectAllOrderAmount(SysOrder sysOrder) { | ||||
|         return sysOrderMapper.selectAllOrderAmount(sysOrder); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user