This commit is contained in:
GYJ
2025-02-26 10:02:22 +08:00
parent 87a18903b0
commit 08bb9aa48a
3 changed files with 17 additions and 9 deletions

View File

@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -262,9 +263,9 @@ public class UserController {
//查询指定日期下的短剧购买的 量
Map<String, Object> map = userService.queryPayAndExtractInfo();
homeMessageResponse.setTodayPayAmount(map.get("payAmount") == null ? BigDecimal.ZERO :new BigDecimal(map.get("payAmount").toString()));
homeMessageResponse.setTodayPayAmount(map.get("payAmount") == null ? BigDecimal.ZERO : new BigDecimal(map.get("payAmount").toString()).setScale(2, RoundingMode.HALF_UP));
homeMessageResponse.setTodayPayCount(map.get("payCount") == null ? 0 : Integer.parseInt(map.get("payCount").toString()));
homeMessageResponse.setTodayExtractAmount(map.get("extractAmount") == null ? BigDecimal.ZERO : new BigDecimal(map.get("extractAmount").toString()));
homeMessageResponse.setTodayExtractAmount(map.get("extractAmount") == null ? BigDecimal.ZERO : new BigDecimal(map.get("extractAmount").toString()).setScale(2, RoundingMode.HALF_UP));
homeMessageResponse.setTodayExtractCount(map.get("extractCount") == null ? 0 : Integer.parseInt(map.get("extractCount").toString()));
return Result.success().put("data", homeMessageResponse);

View File

@@ -321,16 +321,16 @@
</update>
<select id="queryPayInfo" resultType="map">
select SUM(pay_money) AS totalmoney,
COUNT(1) AS tocalCount
select SUM(pay_money) AS totalMoney,
COUNT(1) AS totalCount
from `orders`
where status=1 and pay_way=9
and create_time between #{start} and #{end}
</select>
<select id="queryExtractInfo" resultType="map">
select SUM(money) AS totalmoney,
COUNT(1) AS tocalCount
select SUM(money) AS totalMoney,
COUNT(1) AS totalCount
from `cash_out`
where state=1
and create_at between #{start} and #{end}