2 文件已重命名
9个文件已添加
31个文件已修改
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.OrderNumConstants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.TOrderSaleGoods; |
| | | import com.ruoyi.system.domain.TOrderStockGoods; |
| | | import com.ruoyi.system.dto.OrderMealGeneratorDTO; |
| | | import com.ruoyi.system.dto.OrderSaleGeneratorDTO; |
| | | import com.ruoyi.system.export.TOrderMealExportExcel; |
| | | import com.ruoyi.system.export.TOrderSaleAndGoodsExportExcel; |
| | | import com.ruoyi.system.export.TOrderStockExportExcel; |
| | | import com.ruoyi.system.query.TDataGeneratorMealQuery; |
| | | import com.ruoyi.system.query.TDataGeneratorQuery; |
| | | import com.ruoyi.system.query.TDataGeneratorSaleQuery; |
| | | import com.ruoyi.system.query.TDataGeneratorStockQuery; |
| | | import com.ruoyi.system.service.TDataGeneratorService; |
| | | import com.ruoyi.system.service.TOrderMealService; |
| | | import com.ruoyi.system.vo.TDataGeneratorVO; |
| | | import com.ruoyi.system.service.TOrderSaleService; |
| | | import com.ruoyi.system.service.TOrderStockService; |
| | | import com.ruoyi.system.vo.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class TDataGeneratorController { |
| | | |
| | | private final TOrderMealService orderMealService; |
| | | private final TOrderSaleService orderSaleService; |
| | | private final TOrderStockService orderStockService; |
| | | private final TDataGeneratorService dataGeneratorService; |
| | | private final TokenService tokenService; |
| | | private final RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | public TDataGeneratorController(TOrderMealService orderMealService, TDataGeneratorService dataGeneratorService, TokenService tokenService, RedisCache redisCache) { |
| | | public TDataGeneratorController(TOrderMealService orderMealService, TOrderSaleService orderSaleService, TOrderStockService orderStockService, TDataGeneratorService dataGeneratorService, TokenService tokenService, RedisCache redisCache) { |
| | | this.orderMealService = orderMealService; |
| | | this.orderSaleService = orderSaleService; |
| | | this.orderStockService = orderStockService; |
| | | this.dataGeneratorService = dataGeneratorService; |
| | | this.tokenService = tokenService; |
| | | this.redisCache = redisCache; |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation( value = "餐饮生成数据详情") |
| | | @PostMapping(value = "/mealGeneratorDataDetail") |
| | | public AjaxResult<TDataGeneratorMealDetailVO> mealGeneratorDataDetail(@Validated @RequestBody TDataGeneratorMealQuery query) { |
| | | return AjaxResult.success(dataGeneratorService.mealGeneratorDataDetail(query)); |
| | | } |
| | | |
| | | @ApiOperation( value = "销售生成数据详情") |
| | | @PostMapping(value = "/saleGeneratorDataDetail") |
| | | public AjaxResult<TDataGeneratorSaleDetailVO> saleGeneratorDataDetail(@Validated @RequestBody TDataGeneratorSaleQuery query) { |
| | | return AjaxResult.success(dataGeneratorService.saleGeneratorDataDetail(query)); |
| | | } |
| | | |
| | | @ApiOperation( value = "进货生成数据详情") |
| | | @PostMapping(value = "/stockGeneratorDataDetail") |
| | | public AjaxResult<TDataGeneratorStockDetailVO> stockGeneratorDataDetail(@Validated @RequestBody TDataGeneratorStockQuery query) { |
| | | return AjaxResult.success(dataGeneratorService.stockGeneratorDataDetail(query)); |
| | | } |
| | | |
| | | @ApiOperation( value = "餐饮生成数据详情导出") |
| | | @PostMapping(value = "/mealGeneratorExport") |
| | | public void mealGeneratorExport(@Validated @RequestBody TDataGeneratorMealQuery query) { |
| | | List<TOrderMealVO> list = orderMealService.mealGeneratorExport(query); |
| | | List<TOrderMealExportExcel> orderMeals = new ArrayList<>(); |
| | | for (TOrderMealVO orderMealVO : list) { |
| | | TOrderMealExportExcel tOrderMealExportExcel = new TOrderMealExportExcel(); |
| | | BeanUtils.copyProperties(orderMealVO, tOrderMealExportExcel); |
| | | tOrderMealExportExcel.setCreateStrTime(DateUtils.localDateTimeToString(orderMealVO.getCreateTime())); |
| | | tOrderMealExportExcel.setGoodsList(orderMealVO.getGoodsList().stream().collect(Collectors.joining("\n"))); |
| | | } |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TOrderMealExportExcel.class, orderMeals); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("餐饮生成列表.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @ApiOperation( value = "销售生成数据详情导出") |
| | | @PostMapping(value = "/saleGeneratorExport") |
| | | public void saleGeneratorExport(@Validated @RequestBody TDataGeneratorSaleQuery query) { |
| | | List<TOrderSaleVO> list = orderSaleService.saleGeneratorExport(query); |
| | | List<TOrderSaleAndGoodsExportExcel> orderMeals = new ArrayList<>(); |
| | | for (TOrderSaleVO orderSaleVO : list) { |
| | | TOrderSaleAndGoodsExportExcel orderSaleExportExcel = new TOrderSaleAndGoodsExportExcel(); |
| | | BeanUtils.copyProperties(orderSaleVO, orderSaleExportExcel); |
| | | orderSaleExportExcel.setCreateStrTime(DateUtils.localDateTimeToString(orderSaleVO.getCreateTime())); |
| | | orderSaleExportExcel.setGoodsAmount(orderSaleVO.getOrderSaleGoods().stream().map(TOrderSaleGoods::getSalePrice).reduce(BigDecimal::add).get()); |
| | | } |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TOrderSaleAndGoodsExportExcel.class, orderMeals); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("销售生成列表.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @ApiOperation( value = "进货生成数据详情导出") |
| | | @PostMapping(value = "/stockGeneratorExport") |
| | | public void stockGeneratorExport(@Validated @RequestBody TDataGeneratorStockQuery query) { |
| | | List<TOrderStockVO> list = orderStockService.stockGeneratorExport(query); |
| | | List<TOrderStockExportExcel> orderStockExportExcels = new ArrayList<>(); |
| | | for (TOrderStockVO orderStockVO : list) { |
| | | TOrderStockExportExcel orderStockExportExcel = new TOrderStockExportExcel(); |
| | | BeanUtils.copyProperties(orderStockVO, orderStockExportExcel); |
| | | orderStockExportExcel.setGoodsAmount(orderStockVO.getOrderStockGoods().stream().map(TOrderStockGoods::getSalePrice).reduce(BigDecimal::add).get()); |
| | | orderStockExportExcel.setStockTime(DateUtils.localDateToString(orderStockVO.getStockTime())); |
| | | } |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TOrderStockExportExcel.class, orderStockExportExcels); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("销售生成列表.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | |
| | | import com.ruoyi.system.dto.AddDishDTO; |
| | | import com.ruoyi.system.dto.CheckoutDTO; |
| | | import com.ruoyi.system.dto.TOrderMealDTO; |
| | | import com.ruoyi.system.importExcel.TOrderMealExportExcel; |
| | | import com.ruoyi.system.query.SysUserQuery; |
| | | import com.ruoyi.system.export.TOrderMealExportExcel; |
| | | import com.ruoyi.system.query.TOrderMealQuery; |
| | | import com.ruoyi.system.service.TOrderMealGoodsService; |
| | | import com.ruoyi.system.service.TOrderMealService; |
| | | import com.ruoyi.system.vo.AmountSumVO; |
| | | import com.ruoyi.system.vo.SysUserVO; |
| | | import com.ruoyi.system.vo.TOrderMealVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.TOrderMeal; |
| | | import com.ruoyi.system.domain.TOrderMealGoods; |
| | | import com.ruoyi.system.domain.TOrderSale; |
| | | import com.ruoyi.system.domain.TOrderSaleGoods; |
| | | import com.ruoyi.system.dto.TOrderSaleDTO; |
| | | import com.ruoyi.system.importExcel.TOrderMealExportExcel; |
| | | import com.ruoyi.system.importExcel.TOrderSaleExportExcel; |
| | | import com.ruoyi.system.export.TOrderMealExportExcel; |
| | | import com.ruoyi.system.export.TOrderSaleExportExcel; |
| | | import com.ruoyi.system.query.TOrderMealQuery; |
| | | import com.ruoyi.system.query.TOrderSaleQuery; |
| | | import com.ruoyi.system.service.TOrderSaleGoodsService; |
| | | import com.ruoyi.system.service.TOrderSaleService; |
| | | import com.ruoyi.system.vo.AmountSumVO; |
| | | import com.ruoyi.system.vo.TOrderMealVO; |
| | | import com.ruoyi.system.vo.TOrderSaleVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.TShop; |
| | | import com.ruoyi.system.dto.TShopDTO; |
| | | import com.ruoyi.system.query.TShopQuery; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | |
| | | private final TShopService shopService; |
| | | private final ISysUserService userService; |
| | | private final TokenService tokenService; |
| | | |
| | | @Autowired |
| | | public TShopController(TShopService shopService, ISysUserService userService) { |
| | | public TShopController(TShopService shopService, ISysUserService userService, TokenService tokenService) { |
| | | this.shopService = shopService; |
| | | this.userService = userService; |
| | | this.tokenService = tokenService; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 用户查看店铺信息详情 |
| | | */ |
| | | @ApiOperation( value = "用户查看店铺信息详情") |
| | | @GetMapping(value = "/getDetailByUserId") |
| | | public AjaxResult<TShop> getDetailByUserId() { |
| | | Integer roleType = tokenService.getLoginUser().getRoleType(); |
| | | if(roleType == 1){ |
| | | return AjaxResult.error("该用户不是商家账号"); |
| | | } |
| | | return AjaxResult.success(shopService.getOne(Wrappers.<TShop>lambdaQuery().eq(TShop::getUserId, tokenService.getLoginUser().getUserId()) |
| | | .last("LIMIT 1"))); |
| | | } |
| | | |
| | | /** |
| | | * 删除店铺信息 |
| | | */ |
| | | @ApiOperation( value = "删除店铺信息") |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.SysUserUpdateStatusDTO; |
| | | import com.ruoyi.system.dto.UpdatePwdDTO; |
| | | import com.ruoyi.system.query.SysUserQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.SysUserVO; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.BadCredentialsException; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 修改密码 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | @ApiOperation(value = "修改密码") |
| | | @Log(title = "用户信息-修改密码", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/updatePwd") |
| | | public AjaxResult updatePwd(@RequestBody UpdatePwdDTO dto) |
| | | { |
| | | SysUser user = userService.selectUserByUserName(dto.getAccount()); |
| | | if(Objects.isNull(user)){ |
| | | return AjaxResult.error("未查询到该账号"); |
| | | } |
| | | userService.checkUserAllowed(user); |
| | | // 校验密码跟原密码是否匹配 |
| | | if (!SecurityUtils.matchesPassword(dto.getOldPassword(), user.getPassword())) { |
| | | throw new BadCredentialsException("输入原密码不正确"); |
| | | } |
| | | if (dto.getPassword().equals(dto.getConfirmPassword())) { |
| | | throw new BadCredentialsException("两次输入密码不一致"); |
| | | } |
| | | // userService.checkUserDataScope(user.getUserId()); |
| | | user.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | user.setUpdateBy(getUsername()); |
| | | return AjaxResult.success(userService.resetPwd(user)); |
| | | } |
| | | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | @ApiOperation(value = "状态修改") |
| | |
| | | @ApiModelProperty(value = "店铺id") |
| | | @TableField("shopId") |
| | | private Long shopId; |
| | | @ApiModelProperty(value = "数据生成id") |
| | | @TableField("generatorId") |
| | | private Long generatorId; |
| | | |
| | | @ApiModelProperty(value = "销售订单商品") |
| | | @TableField(exist = false) |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | private String goodsNum; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @Excel(name = "进货商品", width = 15) |
| | | @TableField("goodsName") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty(value = "商品成本价") |
| | | @Excel(name = "商品进价", width = 15) |
| | | @TableField("goodsCostPrice") |
| | | private BigDecimal goodsCostPrice; |
| | | |
| | |
| | | private BigDecimal goodsSalePrice; |
| | | |
| | | @ApiModelProperty(value = "商品数量") |
| | | @Excel(name = "进货数量", width = 15) |
| | | @TableField("goodsCount") |
| | | private Integer goodsCount; |
| | | |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | private String goodsNum; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @Excel(name = "进货商品",width = 15) |
| | | @TableField("goodsName") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty(value = "成本价") |
| | | @Excel(name = "进货价格",width = 15) |
| | | @TableField("costPrice") |
| | | private BigDecimal costPrice; |
| | | |
| | |
| | | private String goodsPicture; |
| | | |
| | | @ApiModelProperty(value = "进货数量") |
| | | @Excel(name = "商品数量",width = 15) |
| | | @TableField("stockCount") |
| | | private Integer stockCount; |
| | | |
| | | @ApiModelProperty(value = "进货价格") |
| | | @TableField("stockPrice") |
| | | private BigDecimal stockPrice; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "修改密码DTO") |
| | | public class UpdatePwdDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "账号") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "原密码") |
| | | private String oldPassword; |
| | | |
| | | @ApiModelProperty(value = "新密码") |
| | | private String password; |
| | | |
| | | @ApiModelProperty(value = "确认密码") |
| | | private String confirmPassword; |
| | | |
| | | } |
File was renamed from ruoyi-system/src/main/java/com/ruoyi/system/importExcel/TOrderMealExportExcel.java |
| | |
| | | package com.ruoyi.system.importExcel; |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
New file |
| | |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import cn.afterturn.easypoi.excel.annotation.ExcelCollection; |
| | | import com.ruoyi.system.domain.TOrderSaleGoods; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "销售订单导出明细Excel") |
| | | public class TOrderSaleAndGoodsExportExcel implements Serializable { |
| | | |
| | | @Excel(width = 30,name = "订单编号",needMerge = true) |
| | | private String orderNum; |
| | | |
| | | @Excel(width = 30,name = "下单日期",needMerge = true) |
| | | private String createStrTime; |
| | | |
| | | @ExcelCollection(name = "菜品明细") |
| | | private List<TOrderSaleGoods> orderSaleGoods; |
| | | |
| | | @Excel(width = 30,name = "商品总价",needMerge = true) |
| | | private BigDecimal goodsAmount; |
| | | |
| | | @Excel(width = 30,name = "支付方式",replace = {"现金_1","支付宝_2","微信_3","银行卡_4","其他_5"},needMerge = true) |
| | | private Integer payType; |
| | | } |
File was renamed from ruoyi-system/src/main/java/com/ruoyi/system/importExcel/TOrderSaleExportExcel.java |
| | |
| | | package com.ruoyi.system.importExcel; |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
New file |
| | |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import cn.afterturn.easypoi.excel.annotation.ExcelCollection; |
| | | import com.ruoyi.system.domain.TOrderStockGoods; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "进货数据生成export") |
| | | public class TOrderStockExportExcel implements Serializable { |
| | | |
| | | @Excel(width = 30,name = "进货单号",needMerge = true) |
| | | private String stockNum; |
| | | |
| | | @Excel(width = 30,name = "进货日期",needMerge = true) |
| | | private String stockTime; |
| | | |
| | | @ExcelCollection(name = "菜品明细") |
| | | private List<TOrderStockGoods> orderStockGoods; |
| | | |
| | | @Excel(width = 30,name = "商品总价",needMerge = true) |
| | | private BigDecimal goodsAmount; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.domain.TOrderMeal; |
| | | import com.ruoyi.system.query.TDataGeneratorMealQuery; |
| | | import com.ruoyi.system.query.TDataStatisticsQuery; |
| | | import com.ruoyi.system.query.TOrderMealQuery; |
| | | import com.ruoyi.system.vo.*; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | List<PersonnelStatisticsVO> personnelStatistics(@Param("query")TDataStatisticsQuery query); |
| | | |
| | | /** |
| | | * 数据生成分页列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TOrderMealVO> pageListGenerator(@Param("query")TDataGeneratorMealQuery query, @Param("pageInfo")PageInfo<TOrderMealVO> pageInfo); |
| | | |
| | | /** |
| | | * 查询餐饮数据生成详情金额统计 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Map<String, BigDecimal> getDataGeneratorMealDetail(@Param("query")TDataGeneratorMealQuery query); |
| | | |
| | | /** |
| | | * 导出餐饮数据生成详情 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TOrderMealVO> mealGeneratorExport(@Param("query")TDataGeneratorMealQuery query); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.domain.TOrderSale; |
| | | import com.ruoyi.system.query.TDataGeneratorSaleQuery; |
| | | import com.ruoyi.system.query.TDataStatisticsQuery; |
| | | import com.ruoyi.system.query.TOrderMealQuery; |
| | | import com.ruoyi.system.query.TOrderSaleQuery; |
| | |
| | | import com.ruoyi.system.vo.TOrderSaleVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | List<OrderTrendsVO> orderingTrends(@Param("query")TDataStatisticsQuery query); |
| | | |
| | | /** |
| | | * 查询生成销售数据详情统计 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Map<String, BigDecimal> getDataGeneratorMealDetail(@Param("query")TDataGeneratorSaleQuery query); |
| | | |
| | | /** |
| | | * 销售生成数据详情导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TOrderSaleVO> saleGeneratorExport(@Param("query")TDataGeneratorSaleQuery query); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.TOrderStockGoods; |
| | | import com.ruoyi.system.query.TDataGeneratorStockQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.domain.TOrderStock; |
| | | import com.ruoyi.system.query.TDataGeneratorStockQuery; |
| | | import com.ruoyi.system.query.TOrderStockQuery; |
| | | import com.ruoyi.system.vo.TOrderStockVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | List<TOrderStockVO> pageList(@Param("query") TOrderStockQuery query, @Param("pageInfo")PageInfo<TOrderStockVO> pageInfo); |
| | | /** |
| | | * 统计支付金额 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Map<String, Object> getDataGeneratorStockDetail(@Param("query") TDataGeneratorStockQuery query); |
| | | |
| | | /** |
| | | * 进货生成数据详情导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TOrderStockVO> stockGeneratorExport(@Param("query")TDataGeneratorStockQuery query); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.model.TimeRangeQueryBody; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "餐饮数据生成详情Query") |
| | | public class TDataGeneratorMealQuery extends TimeRangeQueryBody { |
| | | |
| | | @ApiModelProperty(value = "数据生成id") |
| | | @NotNull(message = "数据生成id不能为空") |
| | | private Long generatorId; |
| | | |
| | | @ApiModelProperty(value = "支付方式") |
| | | private Integer payType; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.model.TimeRangeQueryBody; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "生成销售数据Query") |
| | | public class TDataGeneratorSaleQuery extends TimeRangeQueryBody { |
| | | |
| | | @ApiModelProperty(value = "支付方式 1=现金 2=支付宝 3=微信 4=银行卡 5=其他") |
| | | private Integer payType; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNum; |
| | | |
| | | @ApiModelProperty(value = "时间类型 1=今日 2=昨日 3=近7天 4=近30天") |
| | | private Integer timeType; |
| | | @ApiModelProperty(value = "数据生成id") |
| | | @NotNull(message = "数据生成id不能为空") |
| | | private Long generatorId; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.model.TimeRangeQueryBody; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "数据生成进货查询Query") |
| | | public class TDataGeneratorStockQuery extends TimeRangeQueryBody { |
| | | |
| | | @ApiModelProperty(value = "时间类型 1=今日 2=昨日 3=近7天 4=近30天") |
| | | private Integer timeType; |
| | | @ApiModelProperty(value = "数据生成id") |
| | | @NotNull(message = "数据生成id不能为空") |
| | | private Long generatorId; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNum; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.common.core.domain.model.TimeRangeQueryBody; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | private Long shopId; |
| | | @ApiModelProperty(value = "时间类型 1=今日 2=昨日 3=近7天 4=近30天") |
| | | private Integer timeType; |
| | | |
| | | @ApiModelProperty(value = "数据生成id") |
| | | private Long generatorId; |
| | | } |
| | |
| | | private String stockNum; |
| | | |
| | | @ApiModelProperty(value = "日期类型 1=今天 2=昨天 3=最近7天 4=最近30天") |
| | | private Integer type; |
| | | private Integer timeType; |
| | | |
| | | @ApiModelProperty(value = "店铺id") |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty(value = "数据生成id") |
| | | private Long generatorId; |
| | | } |
| | |
| | | import com.ruoyi.system.domain.TDataGenerator; |
| | | import com.ruoyi.system.dto.OrderMealGeneratorDTO; |
| | | import com.ruoyi.system.dto.OrderSaleGeneratorDTO; |
| | | import com.ruoyi.system.query.TDataGeneratorQuery; |
| | | import com.ruoyi.system.query.TDataStatisticsQuery; |
| | | import com.ruoyi.system.vo.SalesVolumeVO; |
| | | import com.ruoyi.system.vo.TDataGeneratorVO; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.vo.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | void dataCoverage(Long id); |
| | | /** |
| | | * 餐饮生成数据详情 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | TDataGeneratorMealDetailVO mealGeneratorDataDetail(TDataGeneratorMealQuery query); |
| | | |
| | | /** |
| | | * 销售生成数据详情 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | TDataGeneratorSaleDetailVO saleGeneratorDataDetail(TDataGeneratorSaleQuery query); |
| | | |
| | | /** |
| | | * 进货生成数据详情 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | TDataGeneratorStockDetailVO stockGeneratorDataDetail(TDataGeneratorStockQuery query); |
| | | |
| | | /** |
| | | * 餐饮生成数据详情导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TOrderSaleVO> mealGeneratorExport(TDataGeneratorMealQuery query); |
| | | } |
| | |
| | | import com.ruoyi.system.dto.CheckoutDTO; |
| | | import com.ruoyi.system.dto.OrderMealGeneratorDTO; |
| | | import com.ruoyi.system.dto.TOrderMealDTO; |
| | | import com.ruoyi.system.query.TDataGeneratorMealQuery; |
| | | import com.ruoyi.system.query.TDataStatisticsQuery; |
| | | import com.ruoyi.system.query.TOrderMealQuery; |
| | | import com.ruoyi.system.vo.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | List<PersonnelStatisticsVO> personnelStatistics(TDataStatisticsQuery query); |
| | | |
| | | /** |
| | | * 查询餐饮生成详情订单列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TOrderMealVO> pageListGenerator(TDataGeneratorMealQuery query); |
| | | |
| | | /** |
| | | * 查询餐饮数据生成统计金额 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Map<String, BigDecimal> getDataGeneratorMealDetail(TDataGeneratorMealQuery query); |
| | | |
| | | /** |
| | | * 餐饮生成数据详情导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TOrderMealVO> mealGeneratorExport(TDataGeneratorMealQuery query); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.domain.TOrderSale; |
| | | import com.ruoyi.system.dto.TOrderSaleDTO; |
| | | import com.ruoyi.system.query.TDataGeneratorSaleQuery; |
| | | import com.ruoyi.system.query.TDataStatisticsQuery; |
| | | import com.ruoyi.system.query.TOrderMealQuery; |
| | | import com.ruoyi.system.query.TOrderSaleQuery; |
| | | import com.ruoyi.system.vo.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | List<OrderTrendsVO> orderingTrends(TDataStatisticsQuery query); |
| | | |
| | | /** |
| | | * 销售生成数据详情 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Map<String, BigDecimal> getDataGeneratorMealDetail(TDataGeneratorSaleQuery query); |
| | | |
| | | /** |
| | | * 销售生成数据详情导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TOrderSaleVO> saleGeneratorExport(TDataGeneratorSaleQuery query); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.domain.TOrderStockGoods; |
| | | import com.ruoyi.system.query.TDataGeneratorStockQuery; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | import com.ruoyi.system.domain.TOrderStock; |
| | | import com.ruoyi.system.dto.TOrderSaleDTO; |
| | | import com.ruoyi.system.dto.TOrderStockDTO; |
| | | import com.ruoyi.system.query.TDataGeneratorStockQuery; |
| | | import com.ruoyi.system.query.TOrderStockQuery; |
| | | import com.ruoyi.system.vo.TOrderStockVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | PageInfo<TOrderStockVO> pageList(TOrderStockQuery query); |
| | | /** |
| | | * 统计支付金额 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Map<String, Object> getDataGeneratorStockDetail(TDataGeneratorStockQuery query); |
| | | |
| | | /** |
| | | * 进货生成数据详情导出 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TOrderStockVO> stockGeneratorExport(TDataGeneratorStockQuery query); |
| | | } |
| | |
| | | import com.ruoyi.system.dto.OrderMealGeneratorDTO; |
| | | import com.ruoyi.system.dto.OrderSaleGeneratorDTO; |
| | | import com.ruoyi.system.mapper.TDataGeneratorMapper; |
| | | import com.ruoyi.system.query.TDataGeneratorQuery; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TDataGeneratorVO; |
| | | import com.ruoyi.system.vo.TFoundationConfigVO; |
| | | import com.ruoyi.system.vo.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | // 添加销售订单数 |
| | | List<TOrderSale> orderSales = dto.getOrderSales(); |
| | | orderSales.forEach(e->e.setGeneratorId(dataGenerator.getId())); |
| | | List<TOrderSaleGoods> orderSaleGoods = orderSales.stream().map(TOrderSale::getOrderSaleGoods).flatMap(Collection::stream).collect(Collectors.toList()); |
| | | |
| | | // 生成进货数据 |
| | |
| | | tDataGeneratorVO.setTotalRevenue(money); |
| | | } |
| | | }else { |
| | | List<TOrderStock> orderStocks = orderStockService.list(Wrappers.lambdaQuery(TOrderStock.class) |
| | | .in(TOrderStock::getGeneratorId, ids)); |
| | | List<Long> stockIds = orderStocks.stream().map(TOrderStock::getId).collect(Collectors.toList()); |
| | | List<TOrderStockGoods> stockGoods = orderStockGoodsService.list(Wrappers.lambdaQuery(TOrderStockGoods.class) |
| | | .in(TOrderStockGoods::getOrderId, stockIds)); |
| | | List<TOrderSale> orderSales = orderSaleService.list(Wrappers.lambdaQuery(TOrderSale.class) |
| | | .in(TOrderSale::getGeneratorId, ids)); |
| | | List<Long> saleIds = orderSales.stream().map(TOrderSale::getId).collect(Collectors.toList()); |
| | | List<TOrderSaleGoods> orderSaleGoods = orderSaleGoodsService.list(Wrappers.lambdaQuery(TOrderSaleGoods.class) |
| | | .in(TOrderSaleGoods::getOrderId, saleIds)); |
| | | for (TDataGeneratorVO tDataGeneratorVO : list) { |
| | | List<Long> collect = orderStocks.stream().filter(e -> e.getGeneratorId().equals(tDataGeneratorVO.getId())).map(TOrderStock::getId).collect(Collectors.toList()); |
| | | BigDecimal money = stockGoods.stream().filter(e -> collect.contains(e.getOrderId())) |
| | | .reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getStockPrice().multiply(new BigDecimal(y.getStockCount()))), BigDecimal::add); |
| | | List<Long> collect = orderSales.stream().filter(e -> e.getGeneratorId().equals(tDataGeneratorVO.getId())).map(TOrderSale::getId).collect(Collectors.toList()); |
| | | BigDecimal money = orderSaleGoods.stream().filter(e -> collect.contains(e.getOrderId())) |
| | | .reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getGoodsCostPrice().multiply(new BigDecimal(y.getGoodsCount()))), BigDecimal::add); |
| | | tDataGeneratorVO.setTotalRevenue(money); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public TDataGeneratorMealDetailVO mealGeneratorDataDetail(TDataGeneratorMealQuery query) { |
| | | // 查询餐饮数据生成详情 |
| | | TDataGenerator dataGenerator = this.getById(query.getGeneratorId()); |
| | | TDataGeneratorMealDetailVO data = new TDataGeneratorMealDetailVO(); |
| | | BeanUtils.copyProperties(dataGenerator,data); |
| | | // 查询订单 |
| | | PageInfo<TOrderMealVO> pageInfo = orderMealService.pageListGenerator(query); |
| | | data.setOrderMealList(pageInfo); |
| | | // 统计支付金额 |
| | | Map<String, BigDecimal> map = orderMealService.getDataGeneratorMealDetail(query); |
| | | BigDecimal money = map.get("moneyPay"); |
| | | BigDecimal card = map.get("cardPay"); |
| | | BigDecimal weiXin = map.get("weiXinPay"); |
| | | BigDecimal ali = map.get("aliPay"); |
| | | BigDecimal other = map.get("otherPay"); |
| | | data.setMoneyPayAmount(money); |
| | | data.setCardPayAmount(card); |
| | | data.setWeiXinPayAmount(weiXin); |
| | | data.setAliPayAmount(ali); |
| | | data.setOtherPayAmount(other); |
| | | return data; |
| | | } |
| | | |
| | | @Override |
| | | public TDataGeneratorSaleDetailVO saleGeneratorDataDetail(TDataGeneratorSaleQuery query) { |
| | | // 查询餐饮数据生成详情 |
| | | TDataGeneratorSaleDetailVO data = new TDataGeneratorSaleDetailVO(); |
| | | // 查询订单 |
| | | TOrderSaleQuery orderSaleQuery = new TOrderSaleQuery(); |
| | | orderSaleQuery.setTimeType(query.getTimeType()); |
| | | orderSaleQuery.setPayType(query.getPayType()); |
| | | orderSaleQuery.setOrderNum(query.getOrderNum()); |
| | | orderSaleQuery.setGeneratorId(query.getGeneratorId()); |
| | | PageInfo<TOrderSaleVO> pageInfo = orderSaleService.pageList(orderSaleQuery); |
| | | data.setOrderMealList(pageInfo); |
| | | // 统计支付金额 |
| | | Map<String, BigDecimal> map = orderSaleService.getDataGeneratorMealDetail(query); |
| | | BigDecimal money = map.get("moneyPay"); |
| | | BigDecimal card = map.get("cardPay"); |
| | | BigDecimal weiXin = map.get("weiXinPay"); |
| | | BigDecimal ali = map.get("aliPay"); |
| | | BigDecimal other = map.get("otherPay"); |
| | | data.setMoneyPayAmount(money); |
| | | data.setCardPayAmount(card); |
| | | data.setWeiXinPayAmount(weiXin); |
| | | data.setAliPayAmount(ali); |
| | | data.setOtherPayAmount(other); |
| | | return data; |
| | | } |
| | | |
| | | @Override |
| | | public TDataGeneratorStockDetailVO stockGeneratorDataDetail(TDataGeneratorStockQuery query) { |
| | | // 查询餐饮数据生成详情 |
| | | TDataGeneratorStockDetailVO data = new TDataGeneratorStockDetailVO(); |
| | | // 查询订单 |
| | | TOrderStockQuery orderStockQuery = new TOrderStockQuery(); |
| | | orderStockQuery.setGeneratorId(query.getGeneratorId()); |
| | | orderStockQuery.setTimeType(query.getTimeType()); |
| | | orderStockQuery.setStockNum(query.getOrderNum()); |
| | | PageInfo<TOrderStockVO> pageInfo = orderStockService.pageList(orderStockQuery); |
| | | data.setOrderStockVOList(pageInfo); |
| | | // 统计支付金额 |
| | | Map<String, Object> map = orderStockService.getDataGeneratorStockDetail(query); |
| | | Integer totalStock = Integer.parseInt(map.get("totalStock").toString()); |
| | | BigDecimal stockAmountSum = new BigDecimal(map.get("stockAmountSum").toString()); |
| | | data.setTotalStock(totalStock); |
| | | data.setStockAmountSum(stockAmountSum); |
| | | return data; |
| | | } |
| | | |
| | | @Override |
| | | public List<TOrderSaleVO> mealGeneratorExport(TDataGeneratorMealQuery query) { |
| | | return null; |
| | | } |
| | | |
| | | private int getRandomPayType(Integer size,BigDecimal count) { |
| | | BigDecimal bigDecimal = new BigDecimal(size).multiply(count.divide(new BigDecimal(100))).setScale(0, RoundingMode.HALF_UP); |
| | | return Integer.parseInt(bigDecimal.toString()); |
| | |
| | | import com.ruoyi.system.dto.*; |
| | | import com.ruoyi.system.mapper.TOrderMealGoodsMapper; |
| | | import com.ruoyi.system.mapper.TOrderMealMapper; |
| | | import com.ruoyi.system.query.TDataGeneratorMealQuery; |
| | | import com.ruoyi.system.query.TDataStatisticsQuery; |
| | | import com.ruoyi.system.query.TOrderMealQuery; |
| | | import com.ruoyi.system.service.*; |
| | |
| | | return this.baseMapper.personnelStatistics(query); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TOrderMealVO> pageListGenerator(TDataGeneratorMealQuery query) { |
| | | PageInfo<TOrderMealVO> pageInfo = new PageInfo<>(query.getPageNum(),query.getPageSize()); |
| | | List<TOrderMealVO> list = this.baseMapper.pageListGenerator(query,pageInfo); |
| | | // 查询商品信息 |
| | | for (TOrderMealVO tOrderMealVO : list) { |
| | | List<TOrderMealGoods> list1 = orderMealGoodsService.list(Wrappers.lambdaQuery(TOrderMealGoods.class) |
| | | .eq(TOrderMealGoods::getOrderId, tOrderMealVO.getId())); |
| | | tOrderMealVO.setOrderMealGoods(list1); |
| | | Map<String, List<TOrderMealGoods>> map = list1.stream().collect(Collectors.groupingBy(TOrderMealGoods::getTypeName)); |
| | | List<String> goodsList = new ArrayList<>(); |
| | | map.forEach((k,v)->{ |
| | | goodsList.add(k+":"+v.stream().map(item->item.getGoodsName()+" "+(item.getGoodsSalePrice().multiply(new BigDecimal(item.getGoodsCount())))).collect(Collectors.joining(","))); |
| | | }); |
| | | tOrderMealVO.setGoodsList(goodsList); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, BigDecimal> getDataGeneratorMealDetail(TDataGeneratorMealQuery query) { |
| | | return this.baseMapper.getDataGeneratorMealDetail(query); |
| | | } |
| | | |
| | | @Override |
| | | public List<TOrderMealVO> mealGeneratorExport(TDataGeneratorMealQuery query) { |
| | | List<TOrderMealVO> list = this.baseMapper.mealGeneratorExport(query); |
| | | List<Long> ids = list.stream().map(TOrderMealVO::getId).collect(Collectors.toList()); |
| | | List<TOrderMealGoods> list1 = orderMealGoodsService.list(Wrappers.lambdaQuery(TOrderMealGoods.class) |
| | | .in(TOrderMealGoods::getOrderId,ids)); |
| | | // 查询商品信息 |
| | | for (TOrderMealVO tOrderMealVO : list) { |
| | | List<TOrderMealGoods> collect = list1.stream().filter(e -> e.getOrderId().equals(tOrderMealVO.getId())).collect(Collectors.toList()); |
| | | tOrderMealVO.setOrderMealGoods(collect); |
| | | Map<String, List<TOrderMealGoods>> map = collect.stream().collect(Collectors.groupingBy(TOrderMealGoods::getTypeName)); |
| | | List<String> goodsList = new ArrayList<>(); |
| | | map.forEach((k,v)->{ |
| | | goodsList.add(k+":"+v.stream().map(item->item.getGoodsName()+" "+(item.getGoodsSalePrice().multiply(new BigDecimal(item.getGoodsCount())))).collect(Collectors.joining(","))); |
| | | }); |
| | | tOrderMealVO.setGoodsList(goodsList); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.system.domain.*; |
| | | import com.ruoyi.system.dto.TOrderSaleDTO; |
| | | import com.ruoyi.system.mapper.TOrderSaleMapper; |
| | | import com.ruoyi.system.query.TDataGeneratorSaleQuery; |
| | | import com.ruoyi.system.query.TDataStatisticsQuery; |
| | | import com.ruoyi.system.query.TOrderMealQuery; |
| | | import com.ruoyi.system.query.TOrderSaleQuery; |
| | |
| | | } |
| | | PageInfo<TOrderSaleVO> pageInfo = new PageInfo<>(query.getPageNum(),query.getPageSize()); |
| | | List<TOrderSaleVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | List<Long> ids = list.stream().map(TOrderSaleVO::getId).collect(Collectors.toList()); |
| | | List<TOrderSaleGoods> list1 = orderSaleGoodsService.list(Wrappers.lambdaQuery(TOrderSaleGoods.class) |
| | | .in(TOrderSaleGoods::getOrderId, ids)); |
| | | list.forEach(e->{ |
| | | e.setGoodsAmount(list1.stream().filter(m->m.getOrderId().equals(e.getId())).map(TOrderSaleGoods::getGoodsSalePrice).reduce(BigDecimal::add).get()); |
| | | e.setOrderSaleGoods(list1.stream().filter(m->m.getOrderId().equals(e.getId())).collect(Collectors.toList())); |
| | | }); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | public List<OrderTrendsVO> orderingTrends(TDataStatisticsQuery query) { |
| | | return this.baseMapper.orderingTrends(query); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, BigDecimal> getDataGeneratorMealDetail(TDataGeneratorSaleQuery query) { |
| | | return this.baseMapper.getDataGeneratorMealDetail(query); |
| | | } |
| | | |
| | | @Override |
| | | public List<TOrderSaleVO> saleGeneratorExport(TDataGeneratorSaleQuery query) { |
| | | if(Objects.nonNull(query.getTimeType())){ |
| | | LocalDateTime startTime = null; |
| | | LocalDateTime endTime = null; |
| | | switch (query.getTimeType()){ |
| | | case 1: |
| | | // 今日 |
| | | startTime = LocalDateTime.MIN; |
| | | endTime = LocalDateTime.MAX; |
| | | break; |
| | | case 2: |
| | | // 昨日 |
| | | startTime = LocalDateTime.now().minusDays(1); |
| | | endTime = LocalDateTime.now().minusDays(1); |
| | | break; |
| | | case 3: |
| | | // 近7天 |
| | | startTime = LocalDateTime.now().minusDays(7); |
| | | endTime = LocalDateTime.now(); |
| | | break; |
| | | case 4: |
| | | // 近30天 |
| | | startTime = LocalDateTime.now().minusDays(30); |
| | | endTime = LocalDateTime.now(); |
| | | break; |
| | | } |
| | | query.setStartTime(startTime); |
| | | query.setEndTime(endTime); |
| | | } |
| | | List<TOrderSaleVO> list = this.baseMapper.saleGeneratorExport(query); |
| | | List<Long> ids = list.stream().map(TOrderSaleVO::getId).collect(Collectors.toList()); |
| | | List<TOrderSaleGoods> list1 = orderSaleGoodsService.list(Wrappers.lambdaQuery(TOrderSaleGoods.class) |
| | | .in(TOrderSaleGoods::getOrderId,ids)); |
| | | // 查询商品信息 |
| | | for (TOrderSaleVO orderSaleVO : list) { |
| | | List<TOrderSaleGoods> collect = list1.stream().filter(e -> e.getOrderId().equals(orderSaleVO.getId())).collect(Collectors.toList()); |
| | | orderSaleVO.setOrderSaleGoods(collect); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.domain.TOrderStockGoods; |
| | | import com.ruoyi.system.mapper.TOrderStockGoodsMapper; |
| | | import com.ruoyi.system.query.TDataGeneratorStockQuery; |
| | | import com.ruoyi.system.service.TOrderStockGoodsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 进货单商品 服务实现类 |
| | |
| | | import com.ruoyi.system.dto.TOrderSaleDTO; |
| | | import com.ruoyi.system.dto.TOrderStockDTO; |
| | | import com.ruoyi.system.mapper.TOrderStockMapper; |
| | | import com.ruoyi.system.query.TDataGeneratorStockQuery; |
| | | import com.ruoyi.system.query.TOrderStockQuery; |
| | | import com.ruoyi.system.service.TOrderStockGoodsService; |
| | | import com.ruoyi.system.service.TOrderStockService; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | public PageInfo<TOrderStockVO> pageList(TOrderStockQuery query) { |
| | | |
| | | // 判断时间 |
| | | if (query.getType() != null) { |
| | | if (query.getType() == 1) { |
| | | query.setStartTime(LocalDateTime.now()); |
| | | query.setEndTime(LocalDateTime.now()); |
| | | } else if (query.getType() == 2) { |
| | | query.setStartTime(LocalDateTime.now().minusDays(1)); |
| | | query.setEndTime(LocalDateTime.now().minusDays(1)); |
| | | } else if (query.getType() == 3) { |
| | | query.setStartTime(LocalDateTime.now().minusDays(7)); |
| | | query.setEndTime(LocalDateTime.now()); |
| | | }else { |
| | | query.setStartTime(LocalDateTime.now().minusDays(30)); |
| | | query.setEndTime(LocalDateTime.now()); |
| | | if(Objects.nonNull(query.getTimeType())){ |
| | | LocalDateTime startTime = null; |
| | | LocalDateTime endTime = null; |
| | | switch (query.getTimeType()){ |
| | | case 1: |
| | | // 今日 |
| | | startTime = LocalDateTime.MIN; |
| | | endTime = LocalDateTime.MAX; |
| | | break; |
| | | case 2: |
| | | // 昨日 |
| | | startTime = LocalDateTime.now().minusDays(1); |
| | | endTime = LocalDateTime.now().minusDays(1); |
| | | break; |
| | | case 3: |
| | | // 近7天 |
| | | startTime = LocalDateTime.now().minusDays(7); |
| | | endTime = LocalDateTime.now(); |
| | | break; |
| | | case 4: |
| | | // 近30天 |
| | | startTime = LocalDateTime.now().minusDays(30); |
| | | endTime = LocalDateTime.now(); |
| | | break; |
| | | } |
| | | query.setStartTime(startTime); |
| | | query.setEndTime(endTime); |
| | | } |
| | | PageInfo<TOrderStockVO> pageInfo = new PageInfo<>(query.getPageNum(),query.getPageSize()); |
| | | List<TOrderStockVO> list = this.baseMapper.pageList(query,pageInfo); |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getDataGeneratorStockDetail(TDataGeneratorStockQuery query) { |
| | | return this.baseMapper.getDataGeneratorStockDetail(query); |
| | | } |
| | | |
| | | @Override |
| | | public List<TOrderStockVO> stockGeneratorExport(TDataGeneratorStockQuery query) { |
| | | if(Objects.nonNull(query.getTimeType())){ |
| | | LocalDateTime startTime = null; |
| | | LocalDateTime endTime = null; |
| | | switch (query.getTimeType()){ |
| | | case 1: |
| | | // 今日 |
| | | startTime = LocalDateTime.MIN; |
| | | endTime = LocalDateTime.MAX; |
| | | break; |
| | | case 2: |
| | | // 昨日 |
| | | startTime = LocalDateTime.now().minusDays(1); |
| | | endTime = LocalDateTime.now().minusDays(1); |
| | | break; |
| | | case 3: |
| | | // 近7天 |
| | | startTime = LocalDateTime.now().minusDays(7); |
| | | endTime = LocalDateTime.now(); |
| | | break; |
| | | case 4: |
| | | // 近30天 |
| | | startTime = LocalDateTime.now().minusDays(30); |
| | | endTime = LocalDateTime.now(); |
| | | break; |
| | | } |
| | | query.setStartTime(startTime); |
| | | query.setEndTime(endTime); |
| | | } |
| | | List<TOrderStockVO> list = this.baseMapper.stockGeneratorExport(query); |
| | | // 查询商品 |
| | | List<Long> orderIds = list.stream().map(TOrderStockVO::getId).collect(Collectors.toList()); |
| | | List<TOrderStockGoods> orderStockGoods = tOrderStockGoodsService.list(Wrappers.lambdaQuery(TOrderStockGoods.class) |
| | | .in(TOrderStockGoods::getOrderId, orderIds)); |
| | | list.forEach(orderSale -> { |
| | | List<TOrderStockGoods> collect = orderStockGoods.stream().filter(orderSaleGoods -> orderSaleGoods.getOrderId().equals(orderSale.getId())).collect(Collectors.toList()); |
| | | orderSale.setOrderStockGoods(collect); |
| | | }); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.domain.TDataGenerator; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "餐饮数据生成详情VO") |
| | | public class TDataGeneratorMealDetailVO extends TDataGenerator { |
| | | |
| | | @ApiModelProperty(value = "现金支付金额") |
| | | private BigDecimal moneyPayAmount; |
| | | @ApiModelProperty(value = "微信支付金额") |
| | | private BigDecimal weiXinPayAmount; |
| | | @ApiModelProperty(value = "其他支付金额") |
| | | private BigDecimal otherPayAmount; |
| | | @ApiModelProperty(value = "支付宝支付金额") |
| | | private BigDecimal aliPayAmount; |
| | | @ApiModelProperty(value = "银行卡支付金额") |
| | | private BigDecimal cardPayAmount; |
| | | |
| | | @ApiModelProperty(value = "订单列表") |
| | | private PageInfo<TOrderMealVO> orderMealList; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "销售数据生成VO") |
| | | public class TDataGeneratorSaleDetailVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "现金支付金额") |
| | | private BigDecimal moneyPayAmount; |
| | | @ApiModelProperty(value = "微信支付金额") |
| | | private BigDecimal weiXinPayAmount; |
| | | @ApiModelProperty(value = "其他支付金额") |
| | | private BigDecimal otherPayAmount; |
| | | @ApiModelProperty(value = "支付宝支付金额") |
| | | private BigDecimal aliPayAmount; |
| | | @ApiModelProperty(value = "银行卡支付金额") |
| | | private BigDecimal cardPayAmount; |
| | | |
| | | @ApiModelProperty(value = "订单列表") |
| | | private PageInfo<TOrderSaleVO> orderMealList; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "进货数据生成返回VO") |
| | | public class TDataGeneratorStockDetailVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "进货总数量") |
| | | private Integer totalStock; |
| | | @ApiModelProperty(value = "进货总价") |
| | | private BigDecimal stockAmountSum; |
| | | |
| | | @ApiModelProperty(value = "订单列表") |
| | | private PageInfo<TOrderStockVO> orderStockVOList; |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "销售订单VO") |
| | | public class TOrderSaleVO extends TOrderSale { |
| | | |
| | | @ApiModelProperty(value = "货品总价") |
| | | private BigDecimal goodsAmount; |
| | | @ApiModelProperty(value = "菜品集合") |
| | | private List<TOrderSaleGoods> orderSaleGoods; |
| | | |
| | |
| | | |
| | | <sql id="selectRoleVo"> |
| | | select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, |
| | | r.status, r.del_flag, r.create_time, r.remark,r.postType,r.removeDays |
| | | r.status, r.del_flag, r.create_time, r.remark |
| | | from sys_role r |
| | | left join sys_user_role ur on ur.role_id = r.role_id |
| | | left join sys_user u on u.user_id = ur.user_id |
| | |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="ifBlack" column="ifBlack" /> |
| | | <result property="roleType" column="roleType" /> |
| | | <result property="objectId" column="objectId" /> |
| | | <association property="dept" javaType="SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | select u.user_id, u.dept_id, u.user_name , u.nick_name , u.email , u.avatar , |
| | | u.phonenumber , u.password , u.sex , u.status , u.del_flag , u.login_ip , |
| | | u.login_date , u.create_by , u.create_time , u.remark ,u.roleType , u.objectId , |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | |
| | | <result column="status" property="status" /> |
| | | <result column="isCover" property="isCover" /> |
| | | <result column="shopId" property="shopId" /> |
| | | <result column="shopId" property="shopId" /> |
| | | <result column="generatorId" property="generatorId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, boardId, mealType, mealPerson, orderMoney, payMoney, payType, createTime, updateTime, disabled, |
| | | createBy, updateBy, orderNum, status,isCover,shopId |
| | | createBy, updateBy, orderNum, status,isCover,shopId,generatorId |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TOrderMealVO"> |
| | | select |
| | | tom.id, tom.boardId, tom.mealType, tom.mealPerson, tom.orderMoney, tom.payMoney, tom.payType, tom.createTime, tom.updateTime, tom.disabled, |
| | | tom.createBy, tom.updateBy, tom.orderNum, tom.status,tom.isCover,tom.shopId,tb.boardName |
| | | tom.createBy, tom.updateBy, tom.orderNum, tom.status,tom.isCover,tom.shopId,tom.generatorId,tb.boardName |
| | | from t_order_meal tom |
| | | left join t_board tb on tb.id = tom.boardId |
| | | <where> |
| | |
| | | AND tom.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | </select> |
| | | <select id="pageListGenerator" resultType="com.ruoyi.system.vo.TOrderMealVO"> |
| | | select |
| | | tom.id, tom.boardId, tom.mealType, tom.mealPerson, tom.orderMoney, tom.payMoney, tom.payType, tom.createTime, tom.updateTime, tom.disabled, |
| | | tom.createBy, tom.updateBy, tom.orderNum, tom.status,tom.isCover,tom.shopId,tom.generatorId,tb.boardName |
| | | from t_order_meal tom |
| | | left join t_board tb on tb.id = tom.boardId |
| | | <where> |
| | | <if test="query.generatorId != null"> |
| | | and tom.generatorId = #{query.generatorId} |
| | | </if> |
| | | <if test="query.payType != null"> |
| | | and tom.payType = #{query.payType} |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND (tom.createTime BETWEEN #{query.startTime} AND #{query.endTime}) |
| | | </if> |
| | | AND tom.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tom.createTime DESC |
| | | </select> |
| | | <select id="getDataGeneratorMealDetail" resultType="java.util.Map"> |
| | | SELECT |
| | | SUM(CASE WHEN payType = 1 THEN payMoney ELSE 0 END) AS moneyPay, |
| | | SUM(CASE WHEN payType = 2 THEN payMoney ELSE 0 END) AS aliPay, |
| | | SUM(CASE WHEN payType = 3 THEN payMoney ELSE 0 END) AS weiXinPay, |
| | | SUM(CASE WHEN payType = 4 THEN payMoney ELSE 0 END) AS cardPay, |
| | | SUM(CASE WHEN payType = 5 THEN payMoney ELSE 0 END) AS otherPay |
| | | from t_order_meal |
| | | <where> |
| | | <if test="query.dataId != null"> |
| | | and generatorId = #{query.dataId} |
| | | </if> |
| | | <if test="query.payType != null"> |
| | | and payType = #{query.payType} |
| | | </if> |
| | | <if test="query.generatorId != null"> |
| | | and generatorId = #{query.generatorId} |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND (createTime BETWEEN #{query.startTime} AND #{query.endTime}) |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | </select> |
| | | <select id="mealGeneratorExport" resultType="com.ruoyi.system.vo.TOrderMealVO"> |
| | | select |
| | | tom.id, tom.boardId, tom.mealType, tom.mealPerson, tom.orderMoney, tom.payMoney, tom.payType, tom.createTime, tom.updateTime, tom.disabled, |
| | | tom.createBy, tom.updateBy, tom.orderNum, tom.status,tom.isCover,tom.shopId,tb.boardName |
| | | from t_order_meal tom |
| | | left join t_board tb on tb.id = tom.boardId |
| | | <where> |
| | | <if test="query.payType != null"> |
| | | and tom.payType = #{query.payType} |
| | | </if> |
| | | <if test="query.generatorId != null"> |
| | | and tom.generatorId = #{query.generatorId} |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND (tom.createTime BETWEEN #{query.startTime} AND #{query.endTime}) |
| | | </if> |
| | | AND tom.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tom.createTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="orderMoney" property="orderMoney" /> |
| | | <result column="payMoney" property="payMoney" /> |
| | | <result column="shopId" property="shopId" /> |
| | | <result column="generatorId" property="generatorId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, orderTime, remark, createTime, updateTime, disabled, createBy, updateBy, orderNum, status,orderMoney,payMoney,shopId |
| | | id, orderTime, remark, createTime, updateTime, disabled, createBy, updateBy, orderNum, status,orderMoney,payMoney,shopId,generatorId |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TOrderSaleVO"> |
| | | select id, orderTime, remark, createTime, updateTime, disabled, createBy, updateBy, orderNum, status,orderMoney,payMoney,shopId |
| | | select id, orderTime, remark, createTime, updateTime, disabled, createBy, updateBy, orderNum, status,orderMoney,payMoney,shopId,generatorId |
| | | from t_order_sale |
| | | <where> |
| | | <if test="query.orderNum != null and query.orderNum != ''"> |
| | |
| | | </if> |
| | | <if test="query.shopId != null"> |
| | | and shopId = #{query.shopId} |
| | | </if> |
| | | <if test="query.generatorId != null"> |
| | | and generatorId = #{query.generatorId} |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND (createTime BETWEEN #{query.startTime} AND #{query.endTime}) |
| | |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | </select> |
| | | <select id="getDataGeneratorMealDetail" resultType="java.util.Map"> |
| | | SELECT |
| | | SUM(CASE WHEN payType = 1 THEN payMoney ELSE 0 END) AS moneyPay, |
| | | SUM(CASE WHEN payType = 2 THEN payMoney ELSE 0 END) AS aliPay, |
| | | SUM(CASE WHEN payType = 3 THEN payMoney ELSE 0 END) AS weiXinPay, |
| | | SUM(CASE WHEN payType = 4 THEN payMoney ELSE 0 END) AS cardPay, |
| | | SUM(CASE WHEN payType = 5 THEN payMoney ELSE 0 END) AS otherPay |
| | | from t_order_sale |
| | | <where> |
| | | <if test="query.generatorId != null"> |
| | | and generatorId = #{query.generatorId} |
| | | </if> |
| | | <if test="query.orderNum != null and query.orderNum != ''"> |
| | | AND orderNum LIKE concat('%', #{query.orderNum}, '%') |
| | | </if> |
| | | <if test="query.payType != null"> |
| | | and payType = #{query.payType} |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND (createTime BETWEEN #{query.startTime} AND #{query.endTime}) |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | </select> |
| | | <select id="saleGeneratorExport" resultType="com.ruoyi.system.vo.TOrderSaleVO"> |
| | | select id, orderTime, remark, createTime, updateTime, disabled, createBy, updateBy, orderNum, status,orderMoney,payMoney,shopId |
| | | from t_order_sale |
| | | <where> |
| | | <if test="query.generatorId != null"> |
| | | and generatorId = #{query.generatorId} |
| | | </if> |
| | | <if test="query.orderNum != null and query.orderNum != ''"> |
| | | AND orderNum LIKE concat('%', #{query.orderNum}, '%') |
| | | </if> |
| | | <if test="query.payType != null"> |
| | | and payType = #{query.payType} |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND (createTime BETWEEN #{query.startTime} AND #{query.endTime}) |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY orderTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="salePrice" property="salePrice" /> |
| | | <result column="goodsPicture" property="goodsPicture" /> |
| | | <result column="stockCount" property="stockCount" /> |
| | | <result column="stockPrice" property="stockPrice" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, orderId, goodsNum, goodsName, costPrice, salePrice, goodsPicture, stockCount, stockPrice |
| | | id, orderId, goodsNum, goodsName, costPrice, salePrice, goodsPicture, stockCount |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | <result column="updateBy" property="updateBy" /> |
| | | <result column="isCover" property="isCover" /> |
| | | <result column="shopId" property="shopId" /> |
| | | <result column="generatorId" property="generatorId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, stockNum, stockTime, createTime, updateTime, disabled, createBy, updateBy,isCover,shopId |
| | | id, stockNum, stockTime, createTime, updateTime, disabled, createBy, updateBy,isCover,shopId,generatorId |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TOrderStockVO"> |
| | | SELECT <include refid="Base_Column_List"></include> |
| | |
| | | <if test="query.shopId != null"> |
| | | AND shopId = #{query.shopId} |
| | | </if> |
| | | <if test="query.generatorId != null"> |
| | | AND generatorId = #{query.generatorId} |
| | | </if> |
| | | <if test="query.endTime != null and query.startTime != null"> |
| | | AND (stockTime BETWEEN #{query.startTime} and #{query.endTime}) |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY createTime DESC |
| | | </select> |
| | | <select id="getDataGeneratorStockDetail" resultType="java.util.Map"> |
| | | SELECT |
| | | SUM(payMoney) AS stockAmountSum, |
| | | COUNT(id) AS totalStock |
| | | from t_order_stock |
| | | <where> |
| | | <if test="query.stockNum != null and query.stockNum != ''"> |
| | | AND stockNum LIKE concat('%',#{query.stockNum},'%') |
| | | </if> |
| | | <if test="query.generatorId != null"> |
| | | AND generatorId = #{query.generatorId} |
| | | </if> |
| | | <if test="query.endTime != null and query.startTime != null"> |
| | | AND (stockTime BETWEEN #{query.startTime} and #{query.endTime}) |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | </select> |
| | | <select id="stockGeneratorExport" resultType="com.ruoyi.system.vo.TOrderStockVO"> |
| | | SELECT <include refid="Base_Column_List"></include> |
| | | FROM t_order_stock |
| | | <where> |
| | | <if test="query.stockNum != null and query.stockNum != ''"> |
| | | AND stockNum LIKE concat('%',#{query.stockNum},'%') |
| | | </if> |
| | | <if test="query.generatorId != null"> |
| | | AND generatorId = #{query.generatorId} |
| | | </if> |
| | | <if test="query.endTime != null and query.startTime != null"> |
| | | AND (stockTime BETWEEN #{query.startTime} and #{query.endTime}) |
| | | </if> |