fix:财务-餐饮管理导出统计报表

This commit is contained in:
lhb 2025-05-09 09:22:38 +08:00
parent fe7c87816a
commit ae29664710
3 changed files with 38 additions and 15 deletions

View File

@ -44,13 +44,22 @@ public class RzRestaurantStatisticsController extends BaseController
return getDataTable(list);
}
@PostMapping("/export")
public void export(HttpServletResponse response,RzRestaurantStatistics rzRestaurantStatistics){
// List<RzRestaurantStatistics> list = rzRestaurantStatisticsService.selectRzRestaurantStatisticsListBySxs(rzRestaurantStatistics);
List<RzRestaurantStatistics> res_list = rzRestaurantStatisticsService.selectRzRestaurantStatisticsList(rzRestaurantStatistics);
ExcelUtil<RzRestaurantStatistics> util = new ExcelUtil<RzRestaurantStatistics>(RzRestaurantStatistics.class);
util.exportExcel(response, res_list, "餐费明细表");
}
/**
* 导出餐饮统计列表
*/
@PreAuthorize("@ss.hasPermi('restaurant:statistics:export')")
@Log(title = "餐饮统计", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(RzRestaurantStatistics rzRestaurantStatistics)
@GetMapping("/export0")
public AjaxResult export0(RzRestaurantStatistics rzRestaurantStatistics)
{
ExcelUtilCy<RzRestaurantStatistics> util = new ExcelUtilCy<RzRestaurantStatistics>(RzRestaurantStatistics.class);
//创建总表
@ -80,7 +89,7 @@ public class RzRestaurantStatisticsController extends BaseController
vo_obj = new RzRestaurantStatistics();
res_obj = new RzRestaurantStatistics();
for (RzRestaurantStatistics restaurantStatistics : res_list) {
if(s.equals(restaurantStatistics.getCompanyName())){
if(null!=restaurantStatistics && null!=restaurantStatistics.getCompanyName() && s.equals(restaurantStatistics.getCompanyName())){
if(null == vo_obj.getBreakfastNumber()){
vo_obj.setBreakfastNumber(0l);
}
@ -214,7 +223,7 @@ public class RzRestaurantStatisticsController extends BaseController
return util.exportExcel(list,lists,"总表",sheetNameList);
}
@GetMapping("/exportkd")
@PostMapping("/exportkd")
public void exportkd(HttpServletResponse response,RzRestaurantStatistics rzRestaurantStatistics){
List<RzRestaurantStatistics> list = rzRestaurantStatisticsService.selectRzRestaurantStatisticsListBySxs(rzRestaurantStatistics);
ExcelUtil<RzRestaurantStatistics> util = new ExcelUtil<RzRestaurantStatistics>(RzRestaurantStatistics.class);

View File

@ -2,6 +2,7 @@ package com.evo.restaurant.service.impl;
import com.evo.common.constant.Constants;
import com.evo.common.core.domain.AjaxResult;
import com.evo.common.core.domain.entity.SysDept;
import com.evo.common.core.domain.entity.SysDictData;
import com.evo.common.utils.DateUtils;
import com.evo.common.utils.StringUtils;
@ -65,7 +66,12 @@ public class RzRestaurantStatisticsServiceImpl implements IRzRestaurantStatistic
{
List<RzRestaurantStatistics> res_list = rzRestaurantStatisticsMapper.selectRzRestaurantStatisticsList(rzRestaurantStatistics);
for (RzRestaurantStatistics restaurantStatistics : res_list) {
restaurantStatistics.setCompanyName(deptMapper.selectDeptById(restaurantStatistics.getDeptId()).getDeptName());
SysDept sysDept = deptMapper.selectDeptById(restaurantStatistics.getDeptId());
if(null !=sysDept){
restaurantStatistics.setCompanyName(sysDept.getDeptName());
}else{
restaurantStatistics.setCompanyName("实习生");
}
}
return res_list;
}
@ -124,11 +130,11 @@ public class RzRestaurantStatisticsServiceImpl implements IRzRestaurantStatistic
return AjaxResult.error("请输入校正日期!!");
}
//根据日期查询统计日期内的统计信息
List<RzRestaurantStatistics> rt_list = rzRestaurantStatisticsMapper.selectRzRestaurantStatisticsList(rzRestaurantStatistics);
List<RzRestaurantStatistics> rt_list = rzRestaurantStatisticsMapper.selectRzRestaurantStatisticsList(rzRestaurantStatistics);//临时查询一条数据
//根据月份统计打卡信息
RzRestaurantDetail rzRestaurantDetail = new RzRestaurantDetail();
rzRestaurantDetail.setMonth(rzRestaurantStatistics.getMonth());
List<RzRestaurantDetail> rd_list = rzRestaurantDetailMapper.selectRzRestaurantDetailList(rzRestaurantDetail);
List<RzRestaurantDetail> rd_list = rzRestaurantDetailMapper.selectRzRestaurantDetailList(rzRestaurantDetail);//临时查询一条数据
//查询消费情况
List<SysDictData> dic_list = sysDictDataMapper.selectDictDataByType(Constants.SYS_RESTAUTANT);
//循环统计信息
@ -139,7 +145,15 @@ public class RzRestaurantStatisticsServiceImpl implements IRzRestaurantStatistic
Long supper = 0l;
//循环打卡详情
for (RzRestaurantDetail restaurantDetail : rd_list) {
if(restaurantStatistics.getStaffId() == restaurantDetail.getStaffId()){
if(restaurantStatistics.getStaffId().equals(restaurantDetail.getStaffId())){
SysStaffDetail sysStaffDetail = new SysStaffDetail();
sysStaffDetail.setStaffId(restaurantDetail.getStaffId());
List<SysStaffDetail> staffDetailList = sysStaffDetailMapper.selectSysStaffDetailList(sysStaffDetail);
if(null!=staffDetailList && staffDetailList.size()>0){
restaurantStatistics.setBreakfastExpend(staffDetailList.get(0).getBreakfastExpend());
restaurantStatistics.setLunchExpend(staffDetailList.get(0).getLunchExpend());
restaurantStatistics.setSupperExpend(staffDetailList.get(0).getSupperExpend());
}
if("早餐".equals(restaurantDetail.getSign())){
breakfast += 1;
continue;
@ -157,17 +171,17 @@ public class RzRestaurantStatisticsServiceImpl implements IRzRestaurantStatistic
restaurantStatistics.setLunchNumber(lunch);
restaurantStatistics.setSupperNumber(supper);
//计算费用
restaurantStatistics.setBreakfastPreSumExpend(restaurantStatistics.getBreakfastExpend().multiply(new BigDecimal(restaurantStatistics.getBreakfastNumber())));
restaurantStatistics.setBreakfastPreSumExpend(restaurantStatistics.getBreakfastExpend().multiply(new BigDecimal(restaurantStatistics.getBreakfastNumber())));//个人消费
restaurantStatistics.setLunchPreSumExpend(restaurantStatistics.getLunchExpend().multiply(new BigDecimal(restaurantStatistics.getLunchNumber())));
restaurantStatistics.setSupperPreSumExpend(restaurantStatistics.getSupperExpend().multiply(new BigDecimal(restaurantStatistics.getSupperNumber())));
for (SysDictData sysDictData : dic_list) {
if(sysDictData.getDictLabel().indexOf("早餐") != -1){
restaurantStatistics.setBreakfastSumExpend(new BigDecimal(sysDictData.getDictValue()).multiply(new BigDecimal(restaurantStatistics.getBreakfastNumber())));
if(sysDictData.getDictLabel().indexOf("早餐消费") != -1){
restaurantStatistics.setBreakfastSumExpend(new BigDecimal(sysDictData.getDictValue()).multiply(new BigDecimal(restaurantStatistics.getBreakfastNumber())));//总消费
}
if(sysDictData.getDictLabel().indexOf("午餐") != -1){
if(sysDictData.getDictLabel().indexOf("午餐消费") != -1){
restaurantStatistics.setLunchSumExpend(new BigDecimal(sysDictData.getDictValue()).multiply(new BigDecimal(restaurantStatistics.getLunchNumber())));
}
if(sysDictData.getDictLabel().indexOf("晚餐") != -1){
if(sysDictData.getDictLabel().indexOf("晚餐消费") != -1){
restaurantStatistics.setSupperSumExpend(new BigDecimal(sysDictData.getDictValue()).multiply(new BigDecimal(restaurantStatistics.getSupperNumber())));
}
}

View File

@ -88,7 +88,7 @@ public class SysStaffDetailServiceImpl implements ISysStaffDetailService
}
}
}else {
//非住宿月工资
//非住宿月工资==4,3,3
if(StringUtils.isNotNull(sysStaffDetail.getBasicSalary())){
for (SysDictData sysDictData : cy_list) {
if("早餐消费".equals(sysDictData.getDictLabel())){
@ -101,7 +101,7 @@ public class SysStaffDetailServiceImpl implements ISysStaffDetailService
sysStaffDetail.setSupperExpend(new BigDecimal(sysDictData.getDictValue()));
}
}
}else{
}else{//非住宿日工资==4,3,8
for (SysDictData sysDictData : cy_list) {
if("早餐消费".equals(sysDictData.getDictLabel())){
sysStaffDetail.setBreakfastExpend(new BigDecimal(sysDictData.getDictValue()));