员工报餐:查看补贴余额,查看补贴记录

This commit is contained in:
ryoeiken 2021-01-05 08:44:59 +08:00
parent 64e943b681
commit 7514563e6c

View File

@ -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<FtOrderDao> 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<FtStaffSubsidyDao> wrapper = new QueryWrapper<>();
wrapper.eq("staff_id",staffId);
return AjaxResult.success(staffSubsidyDaoService.list(wrapper));
}
/**
* 查看补贴余额
*/
@GetMapping("/getStaffSubsidyBalance/{staffId}")
public AjaxResult getStaffSubsidyBalance(@PathVariable Long staffId){
QueryWrapper<FtStaffSubsidyDao> 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());
}
}