Procházet zdrojové kódy

当日, 昨日,总收益查询

小么熊🐻 před 2 roky
rodič
revize
a43368ff5d

+ 39 - 4
sdjk-admin/src/main/java/com/miaxis/app/controller/order/OrderInfoController.java

@@ -1,21 +1,26 @@
 package com.miaxis.app.controller.order;
 
+import com.miaxis.common.annotation.Log;
 import com.miaxis.common.constant.Constants;
 import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
 import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.common.exception.CustomException;
 import com.miaxis.common.utils.SecurityUtils;
 import com.miaxis.order.domain.OrderInfo;
 import com.miaxis.order.dto.OrderInfoDto;
 import com.miaxis.order.service.IOrderInfoService;
+import com.miaxis.question.domain.QuestionCollection;
+import com.miaxis.question.dto.QuestionCollectionDTO;
+import com.miaxis.question.dto.QuestionCollectionListDTO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -48,6 +53,36 @@ public class OrderInfoController extends BaseController{
         return toResponsePageInfo(list);
     }
 
+    /**
+     *昨日预估收益
+     */
+    @GetMapping("/yesterdayTotal")
+    @ApiOperation("昨日预估收益")
+    public Response<Integer> yesterdayTotal(OrderInfoDto orderInfoDto) {
+        orderInfoDto.setReferralUserId(SecurityUtils.getLoginUser().getStudent().getId());
+        return Response.success(orderInfoService.selectYesterdayTotal(orderInfoDto));
+    }
 
 
+    /**
+     *今日预估收益
+     */
+    @GetMapping("/todayTotal")
+    @ApiOperation("今日预估收益")
+    public Response<Integer> todayTotal(OrderInfoDto orderInfoDto) {
+        orderInfoDto.setReferralUserId(SecurityUtils.getLoginUser().getStudent().getId());
+        return Response.success(orderInfoService.selectTodayTotal(orderInfoDto));
+    }
+
+
+    /**
+     * 总收益
+     */
+    @GetMapping("/total")
+    @ApiOperation("总收益")
+    public Response<Integer> total(OrderInfoDto orderInfoDto) {
+        orderInfoDto.setReferralUserId(SecurityUtils.getLoginUser().getStudent().getId());
+        return Response.success(orderInfoService.selectTotal(orderInfoDto));
+    }
+
 }

+ 10 - 1
sdjk-service/src/main/java/com/miaxis/order/service/IOrderInfoService.java

@@ -1,7 +1,6 @@
 package com.miaxis.order.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.miaxis.ad.domain.AdInfo;
 import com.miaxis.order.domain.OrderInfo;
 import com.miaxis.order.dto.OrderInfoDto;
 
@@ -21,4 +20,14 @@ public interface IOrderInfoService extends IService<OrderInfo>{
      * @return order集合
      */
     public List<OrderInfo> selectOrderInfoList(OrderInfoDto orderInfoDto);
+
+
+
+    public Integer selectTotal(OrderInfoDto orderInfoDto);
+
+
+    public Integer selectYesterdayTotal(OrderInfoDto orderInfoDto);
+
+    public Integer selectTodayTotal(OrderInfoDto orderInfoDto);
+
 }

+ 15 - 0
sdjk-service/src/main/java/com/miaxis/order/service/impl/OrderInfoServiceImpl.java

@@ -39,6 +39,21 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
         return orderInfoMapper.selectOrderInfoList(orderInfoDto);
     }
 
+    @Override
+    public Integer selectTotal(OrderInfoDto orderInfoDto) {
+        return orderInfoMapper.selectTotal(orderInfoDto);
+    }
+
+    @Override
+    public Integer selectYesterdayTotal(OrderInfoDto orderInfoDto) {
+        return orderInfoMapper.selectYesterdayTotal(orderInfoDto);
+    }
+
+    @Override
+    public Integer selectTodayTotal(OrderInfoDto orderInfoDto) {
+        return orderInfoMapper.selectTodayTotal(orderInfoDto);
+    }
+
 
 }
 

+ 3 - 3
sdjk-service/src/main/resources/mapper/order/OrderInfoMapper.xml

@@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectTodayTotal" parameterType="OrderInfoDto" resultType="Integer">
-        select sum(total) FROM v_wx_order
+        select ifnull(sum(total),0) FROM v_wx_order
         <where>
             <if test="goodsName != null  and goodsName != ''"> and goods_name = #{goodsName}</if>
             <if test="outTradeNo != null  and outTradeNo != ''"> and out_trade_no = #{outTradeNo}</if>
@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectYesterdayTotal" parameterType="OrderInfoDto" resultType="Integer">
-        select sum(total) FROM v_wx_order
+        select ifnull(sum(total),0) FROM v_wx_order
         <where>
             <if test="goodsName != null  and goodsName != ''"> and goods_name = #{goodsName}</if>
             <if test="outTradeNo != null  and outTradeNo != ''"> and out_trade_no = #{outTradeNo}</if>
@@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectTotal" parameterType="OrderInfoDto" resultType="Integer">
-        select sum(total) FROM v_wx_order
+        select ifnull(sum(total),0) FROM v_wx_order
         <where>
             <if test="referralUserId != null and referralUserId != ''  "> and referral_user_id = #{referralUserId}</if>
         </where>