From 7514563e6cbc86150dd0c77c862b5b8751eb84a3 Mon Sep 17 00:00:00 2001 From: ryoeiken <754264374@qq.com> Date: Tue, 5 Jan 2021 08:44:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=98=E5=B7=A5=E6=8A=A5=E9=A4=90=EF=BC=9A?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=A1=A5=E8=B4=B4=E4=BD=99=E9=A2=9D=EF=BC=8C?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=A1=A5=E8=B4=B4=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantang/controller/ClientController.java | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java index af2d13f0c..d3bbf5ed0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java @@ -1,9 +1,11 @@ package com.ruoyi.system.fantang.controller; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.fantang.domain.FtOrderDao; +import com.ruoyi.system.fantang.domain.FtStaffSubsidyDao; import com.ruoyi.system.fantang.service.*; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; @@ -39,6 +41,9 @@ public class ClientController extends BaseController { @Autowired private IFtReportMealsDaoService reportMealsDaoService; + @Autowired + private IFtStaffSubsidyDaoService staffSubsidyDaoService; + /** * 获取用餐时间信息 * 日期:2020年12月11日 @@ -293,11 +298,36 @@ public class ClientController extends BaseController { List orderList; if (orderType != 0) { - orderList = orderDaoService.listDetailedByDate(orderType, start, end); - }else { - orderList = orderDaoService.listAllDetailedByDate(start, end); + orderList = orderDaoService.listDetailedByDate(orderType, start, end); + } else { + orderList = orderDaoService.listAllDetailedByDate(start, end); } return AjaxResult.success(orderList); } + + /** + * 查看补贴记录 + */ + @GetMapping("/getStaffSubsidy/{staffId}") + public AjaxResult getStaffSubsidy(@PathVariable Long staffId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("staff_id",staffId); + + return AjaxResult.success(staffSubsidyDaoService.list(wrapper)); + } + + /** + * 查看补贴余额 + */ + @GetMapping("/getStaffSubsidyBalance/{staffId}") + public AjaxResult getStaffSubsidyBalance(@PathVariable Long staffId){ + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("staff_id",staffId); + wrapper.orderByDesc("price"); + wrapper.last("limit 1"); + FtStaffSubsidyDao staffSubsidyDao = staffSubsidyDaoService.getOne(wrapper); + + return AjaxResult.success(staffSubsidyDao.getPrice()); + } }