每道菜的价格
This commit is contained in:
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.system.api.DeviceMoney;
|
||||
|
||||
import cn.iocoder.yudao.module.system.api.DeviceMoney.dto.DeviceMoneyDto;
|
||||
|
||||
/**
|
||||
* @Author:qjq
|
||||
* @Date:2024/4/15 上午11:21
|
||||
*/
|
||||
public interface DeviceMoneyApi {
|
||||
|
||||
int insertDeviceMoney(DeviceMoneyDto createReqVO);
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.system.api.DeviceMoney.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author:qjq
|
||||
* @Date:2024/4/15 上午11:22
|
||||
*/
|
||||
@Data
|
||||
public class DeviceMoneyDto {
|
||||
/**
|
||||
* 设备ip
|
||||
*/
|
||||
private String deviceIp;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
/**
|
||||
* 设备sn
|
||||
*/
|
||||
private String deviceSn;
|
||||
/**
|
||||
* 门店编号
|
||||
*/
|
||||
private Long carteenId;
|
||||
/**
|
||||
* 设备流水
|
||||
*/
|
||||
private BigDecimal money;
|
||||
/**
|
||||
* 时间段
|
||||
*/
|
||||
private String timePeriod;
|
||||
/**
|
||||
* 热门菜品ids,如[1,2,3,4,5,]
|
||||
*/
|
||||
private String dishesIds;
|
||||
}
|
@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.system.api.carteen;
|
||||
|
||||
import cn.iocoder.yudao.module.system.api.carteen.dto.CarteenRespDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜品营养 Service 接口
|
||||
*
|
||||
@ -14,4 +16,18 @@ public interface CarteenApi {
|
||||
* 获得门店信息
|
||||
*/
|
||||
public CarteenRespDto getCarteen(Long id);
|
||||
/**
|
||||
* @Description: 根据id获取门店信息
|
||||
* @Author: qjq
|
||||
* @Date: 2024/4/12 下午3:31
|
||||
* @return
|
||||
*/
|
||||
CarteenRespDto getCarteenById(Long id);
|
||||
/**
|
||||
* @Description: 获取门店列表
|
||||
* @Author: qjq
|
||||
* @Date: 2024/4/15 上午10:18
|
||||
* @return
|
||||
*/
|
||||
List<CarteenRespDto> getCarteenList();
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.system.api.deviceInfo;
|
||||
|
||||
import cn.iocoder.yudao.module.system.api.deviceInfo.dto.DeviceInfoDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:qjq 设备信息api
|
||||
* @Date:2024/4/12 下午3:53
|
||||
*/
|
||||
public interface DeviceInfoApi {
|
||||
List<DeviceInfoDto> getDeviceInfoList(Long carteenId);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.system.api.deviceInfo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:qjq
|
||||
* @Date:2024/4/10 下午4:37
|
||||
*/
|
||||
@Data
|
||||
public class DeviceInfoDto {
|
||||
|
||||
|
||||
/**
|
||||
* 设备sn码
|
||||
*/
|
||||
private String deviceSn;
|
||||
/**
|
||||
* 门店编号
|
||||
*/
|
||||
private Long carteenId;
|
||||
/**
|
||||
* 设备ip
|
||||
*/
|
||||
private String deviceIp;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 门店名称
|
||||
*/
|
||||
private String carteenName;
|
||||
}
|
@ -183,7 +183,11 @@ public interface ErrorCodeConstants {
|
||||
// ========== 门店 流水 1_002_035_002 ==========
|
||||
ErrorCode DISHES_RAW_NOT_EXISTS = new ErrorCode(1_002_035_002, "菜品原材料不存在");
|
||||
// ========== 门店 流水 1_002_036_002 ==========
|
||||
ErrorCode BUSINESS_NOT_EXISTS = new ErrorCode(1_002_035_002, "营业统计不存在");
|
||||
ErrorCode BUSINESS_NOT_EXISTS = new ErrorCode(1_002_036_002, "营业统计不存在");
|
||||
// ========== 门店 流水 1_002_037_002 ==========
|
||||
ErrorCode DEVUCE_NOT_EXISTS = new ErrorCode(1_002_035_002, "设备不存在");
|
||||
ErrorCode DEVUCE_NOT_EXISTS = new ErrorCode(1_002_037_002, "设备不存在");
|
||||
// ========== 门店 设备日流水 1_002_038_002 ==========
|
||||
ErrorCode DEVICE_MONEY_NOT_EXISTS = new ErrorCode(1_002_038_002, "门店设备流水不存在");
|
||||
// ========== 门店 设备日流水 1_002_039_002 ==========
|
||||
ErrorCode MATERIAL_NOT_EXISTS = new ErrorCode(1_002_039_002, "门店材料库存不存在");
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.system.api.DeviceMoney;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.iocoder.yudao.module.system.api.DeviceMoney.dto.DeviceMoneyDto;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.devicemoney.DeviceMoneyDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.devicemoney.DeviceMoneyMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author:qjq
|
||||
* @Date:2024/4/15 上午11:19
|
||||
*/
|
||||
@Service
|
||||
public class DeviceMoneyApiImpl implements DeviceMoneyApi{
|
||||
@Resource
|
||||
private DeviceMoneyMapper deviceMoneyMapper;
|
||||
@Override
|
||||
public int insertDeviceMoney(DeviceMoneyDto createReqVO) {
|
||||
return deviceMoneyMapper.insert(BeanUtil.toBean(createReqVO, DeviceMoneyDO.class));
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门店管理 Service 实现类
|
||||
@ -33,6 +34,26 @@ public class CarteenApiImpl implements CarteenApi {
|
||||
return BeanUtils.toBean(carteenDO, CarteenRespDto.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return
|
||||
* @Description: 根据id获取门店信息
|
||||
* @Author: qjq
|
||||
* @Date: 2024/4/12 下午3:30
|
||||
*/
|
||||
@Override
|
||||
public CarteenRespDto getCarteenById(Long id) {
|
||||
return BeanUtils.toBean(carteenMapper.selectById(id), CarteenRespDto.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @Description: 获取门店列表
|
||||
* @Author: qjq
|
||||
* @Date: 2024/4/15 上午10:18
|
||||
*/
|
||||
@Override
|
||||
public List<CarteenRespDto> getCarteenList() {
|
||||
return BeanUtils.toBean(carteenMapper.selectList(null), CarteenRespDto.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.system.api.deviceInfo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.api.deviceInfo.dto.DeviceInfoDto;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.deviceInfo.DeviceInfoDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.deviceInfo.DeviceInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:qjq
|
||||
* @Date:2024/4/12 下午3:55
|
||||
*/
|
||||
@Service
|
||||
public class DeviceInfoApiImpl implements DeviceInfoApi {
|
||||
@Resource
|
||||
private DeviceInfoMapper deviceInfoMapper;
|
||||
@Override
|
||||
public List<DeviceInfoDto> getDeviceInfoList(Long carteenId) {
|
||||
return BeanUtils.toBean(deviceInfoMapper.selectList(new LambdaQueryWrapperX<DeviceInfoDO>()
|
||||
.eqIfPresent(DeviceInfoDO::getCarteenId, carteenId)), DeviceInfoDto.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.deviceinfo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo.DeviceInfoPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo.DeviceInfoRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo.DeviceInfoSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.deviceInfo.DeviceInfoDO;
|
||||
import cn.iocoder.yudao.module.system.service.deviceinfo.DeviceInfoService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 设备信息关联门店")
|
||||
@RestController
|
||||
@RequestMapping("/t/device-info")
|
||||
@Validated
|
||||
public class DeviceInfoController {
|
||||
|
||||
@Resource
|
||||
private DeviceInfoService deviceInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备信息关联门店")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-info:create')")
|
||||
public CommonResult<Long> createDeviceInfo(@Valid @RequestBody DeviceInfoSaveReqVO createReqVO) {
|
||||
return success(deviceInfoService.createDeviceInfo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备信息关联门店")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-info:update')")
|
||||
public CommonResult<Boolean> updateDeviceInfo(@Valid @RequestBody DeviceInfoSaveReqVO updateReqVO) {
|
||||
deviceInfoService.updateDeviceInfo(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备信息关联门店")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('t:device-info:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceInfo(@RequestParam("id") Long id) {
|
||||
deviceInfoService.deleteDeviceInfo(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备信息关联门店")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-info:query')")
|
||||
public CommonResult<DeviceInfoRespVO> getDeviceInfo(@RequestParam("id") Long id) {
|
||||
DeviceInfoDO deviceInfo = deviceInfoService.getDeviceInfo(id);
|
||||
return success(BeanUtils.toBean(deviceInfo, DeviceInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得设备信息关联门店分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-info:query')")
|
||||
public CommonResult<PageResult<DeviceInfoRespVO>> getDeviceInfoPage(@Valid DeviceInfoPageReqVO pageReqVO) {
|
||||
PageResult<DeviceInfoDO> pageResult = deviceInfoService.getDeviceInfoPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备信息关联门店 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-info:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportDeviceInfoExcel(@Valid DeviceInfoPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DeviceInfoDO> list = deviceInfoService.getDeviceInfoPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "设备信息关联门店.xls", "数据", DeviceInfoRespVO.class,
|
||||
BeanUtils.toBean(list, DeviceInfoRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 设备信息关联门店分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeviceInfoPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "设备sn码")
|
||||
private String deviceSn;
|
||||
|
||||
@Schema(description = "门店编号", example = "29361")
|
||||
private Long carteenId;
|
||||
|
||||
@Schema(description = "设备ip")
|
||||
private String deviceIp;
|
||||
|
||||
@Schema(description = "设备名称", example = "张三")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "门店名称", example = "张三")
|
||||
private String carteenName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备信息关联门店 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceInfoRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "557")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "设备sn码")
|
||||
@ExcelProperty("设备sn码")
|
||||
private String deviceSn;
|
||||
|
||||
@Schema(description = "门店编号", example = "29361")
|
||||
@ExcelProperty("门店编号")
|
||||
private Long carteenId;
|
||||
|
||||
@Schema(description = "设备ip")
|
||||
@ExcelProperty("设备ip")
|
||||
private String deviceIp;
|
||||
|
||||
@Schema(description = "设备名称", example = "张三")
|
||||
@ExcelProperty("设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "门店名称", example = "张三")
|
||||
@ExcelProperty("门店名称")
|
||||
private String carteenName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备信息关联门店新增/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceInfoSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "557")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "设备sn码")
|
||||
private String deviceSn;
|
||||
|
||||
@Schema(description = "门店编号", example = "29361")
|
||||
private Long carteenId;
|
||||
|
||||
@Schema(description = "设备ip")
|
||||
private String deviceIp;
|
||||
|
||||
@Schema(description = "设备名称", example = "张三")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "门店名称", example = "张三")
|
||||
private String carteenName;
|
||||
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.devicemoney;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.devicemoney.DeviceMoneyDO;
|
||||
import cn.iocoder.yudao.module.system.service.devicemoney.DeviceMoneyService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.devicemoney.vo.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 门店设备日流水")
|
||||
@RestController
|
||||
@RequestMapping("/t/device-money")
|
||||
@Validated
|
||||
public class DeviceMoneyController {
|
||||
|
||||
@Resource
|
||||
private DeviceMoneyService deviceMoneyService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建门店设备日流水")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-money:create')")
|
||||
public CommonResult<Long> createDeviceMoney(@Valid @RequestBody DeviceMoneySaveReqVO createReqVO) {
|
||||
return success(deviceMoneyService.createDeviceMoney(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新门店设备日流水")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-money:update')")
|
||||
public CommonResult<Boolean> updateDeviceMoney(@Valid @RequestBody DeviceMoneySaveReqVO updateReqVO) {
|
||||
deviceMoneyService.updateDeviceMoney(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除门店设备日流水")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('t:device-money:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceMoney(@RequestParam("id") Long id) {
|
||||
deviceMoneyService.deleteDeviceMoney(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得门店设备日流水")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-money:query')")
|
||||
public CommonResult<DeviceMoneyRespVO> getDeviceMoney(@RequestParam("id") Long id) {
|
||||
DeviceMoneyDO deviceMoney = deviceMoneyService.getDeviceMoney(id);
|
||||
return success(BeanUtils.toBean(deviceMoney, DeviceMoneyRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得门店设备日流水分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-money:query')")
|
||||
public CommonResult<PageResult<DeviceMoneyRespVO>> getDeviceMoneyPage(@Valid DeviceMoneyPageReqVO pageReqVO) {
|
||||
PageResult<DeviceMoneyDO> pageResult = deviceMoneyService.getDeviceMoneyPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceMoneyRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出门店设备日流水 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-money:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportDeviceMoneyExcel(@Valid DeviceMoneyPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DeviceMoneyDO> list = deviceMoneyService.getDeviceMoneyPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "门店设备日流水.xls", "数据", DeviceMoneyRespVO.class,
|
||||
BeanUtils.toBean(list, DeviceMoneyRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.devicemoney.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 门店设备日流水分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeviceMoneyPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "设备ip")
|
||||
private String deviceIp;
|
||||
|
||||
@Schema(description = "设备名称", example = "张三")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "设备sn")
|
||||
private String deviceSn;
|
||||
|
||||
@Schema(description = "门店编号", example = "30417")
|
||||
private Long carteenId;
|
||||
|
||||
@Schema(description = "设备流水")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "时间段")
|
||||
private String timePeriod;
|
||||
|
||||
@Schema(description = "热门菜品ids,如[1,2,3,4,5,]")
|
||||
private String dishesIds;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.devicemoney.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 门店设备日流水 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceMoneyRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "9854")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "设备ip")
|
||||
@ExcelProperty("设备ip")
|
||||
private String deviceIp;
|
||||
|
||||
@Schema(description = "设备名称", example = "张三")
|
||||
@ExcelProperty("设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "设备sn")
|
||||
@ExcelProperty("设备sn")
|
||||
private String deviceSn;
|
||||
|
||||
@Schema(description = "门店编号", example = "30417")
|
||||
@ExcelProperty("门店编号")
|
||||
private Long carteenId;
|
||||
|
||||
@Schema(description = "设备流水", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("设备流水")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "时间段")
|
||||
@ExcelProperty("时间段")
|
||||
private String timePeriod;
|
||||
|
||||
@Schema(description = "热门菜品ids,如[1,2,3,4,5,]")
|
||||
@ExcelProperty("热门菜品ids,如[1,2,3,4,5,]")
|
||||
private String dishesIds;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.devicemoney.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 门店设备日流水新增/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceMoneySaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "9854")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "设备ip")
|
||||
private String deviceIp;
|
||||
|
||||
@Schema(description = "设备名称", example = "张三")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "设备sn")
|
||||
private String deviceSn;
|
||||
|
||||
@Schema(description = "门店编号", example = "30417")
|
||||
private Long carteenId;
|
||||
|
||||
@Schema(description = "设备流水", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "设备流水不能为空")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "时间段")
|
||||
private String timePeriod;
|
||||
|
||||
@Schema(description = "热门菜品ids,如[1,2,3,4,5,]")
|
||||
private String dishesIds;
|
||||
|
||||
}
|
@ -1,33 +1,34 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dishestype;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypeListRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypeRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dishestype.DishesTypeDO;
|
||||
import cn.iocoder.yudao.module.system.service.dishestype.DishesTypeService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 菜品分类")
|
||||
@ -72,6 +73,21 @@ public class DishesTypeController {
|
||||
return success(BeanUtils.toBean(dishesType, DishesTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得菜品分类")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-type:query')")
|
||||
public CommonResult<List<DishesTypeListRespVO>> getDishesTypeList(@RequestParam("carteenId") Long carteenId,
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@RequestParam("startTime") LocalDateTime startTime,
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@RequestParam("endTime")LocalDateTime endTime){
|
||||
List<DishesTypeListRespVO> dishesTypeList = dishesTypeService.getDishesTypeList(carteenId, startTime, endTime);
|
||||
return success(dishesTypeList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得菜品分类分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:dishes-type:query')")
|
||||
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dishestype.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:qjq
|
||||
* @Date:2024/4/15 下午2:46
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "管理后台 - 大屏早中晚菜谱 Request VO")
|
||||
public class DishesTypeListRespVO {
|
||||
@Schema(description = "时间段", example = "早餐")
|
||||
private String time;
|
||||
@Schema(description = "菜品分类名称", example = "主食")
|
||||
private List<Map<String,String>> dishesTypeName=new ArrayList<>();
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.material;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.material.vo.MaterialPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.material.vo.MaterialRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.material.vo.MaterialSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.material.MaterialDO;
|
||||
import cn.iocoder.yudao.module.system.service.material.MaterialService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 门店材料库存")
|
||||
@RestController
|
||||
@RequestMapping("/t/material")
|
||||
@Validated
|
||||
public class MaterialController {
|
||||
|
||||
@Resource
|
||||
private MaterialService materialService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建门店材料库存")
|
||||
@PreAuthorize("@ss.hasPermission('t:material:create')")
|
||||
public CommonResult<Long> createMaterial(@Valid @RequestBody MaterialSaveReqVO createReqVO) {
|
||||
return success(materialService.createMaterial(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新门店材料库存")
|
||||
@PreAuthorize("@ss.hasPermission('t:material:update')")
|
||||
public CommonResult<Boolean> updateMaterial(@Valid @RequestBody MaterialSaveReqVO updateReqVO) {
|
||||
materialService.updateMaterial(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除门店材料库存")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('t:material:delete')")
|
||||
public CommonResult<Boolean> deleteMaterial(@RequestParam("id") Long id) {
|
||||
materialService.deleteMaterial(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得门店材料库存")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('t:material:query')")
|
||||
public CommonResult<MaterialRespVO> getMaterial(@RequestParam("id") Long id) {
|
||||
MaterialDO material = materialService.getMaterial(id);
|
||||
return success(BeanUtils.toBean(material, MaterialRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得门店材料库存分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:material:query')")
|
||||
public CommonResult<PageResult<MaterialRespVO>> getMaterialPage(@Valid MaterialPageReqVO pageReqVO) {
|
||||
PageResult<MaterialDO> pageResult = materialService.getMaterialPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialRespVO.class));
|
||||
}
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得门店材料库存")
|
||||
@PreAuthorize("@ss.hasPermission('t:material:query')")
|
||||
public CommonResult<List<MaterialRespVO>> getMaterialList(@RequestParam("carteenId") Long carteenId) {
|
||||
List<MaterialDO> list = materialService.getMaterialList(carteenId);
|
||||
return success(BeanUtils.toBean(list,MaterialRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出门店材料库存 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('t:material:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportMaterialExcel(@Valid MaterialPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaterialDO> list = materialService.getMaterialPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "门店材料库存.xls", "数据", MaterialRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialRespVO.class));
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.material.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 门店材料库存分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MaterialPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "库存材料名称", example = "赵六")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "库存材料重量")
|
||||
private BigDecimal materialWeight;
|
||||
|
||||
@Schema(description = "库存材料重量单位")
|
||||
private String meterialUnit;
|
||||
@Schema(description = "门店编号")
|
||||
private Long carteenId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.material.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 门店材料库存 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaterialRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3954")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "库存材料名称", example = "赵六")
|
||||
@ExcelProperty("库存材料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "库存材料重量")
|
||||
@ExcelProperty("库存材料重量")
|
||||
private BigDecimal materialWeight;
|
||||
|
||||
@Schema(description = "库存材料重量单位")
|
||||
@ExcelProperty("库存材料重量单位")
|
||||
private String meterialUnit;
|
||||
@Schema(description = "门店编号")
|
||||
private Long carteenId;
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.material.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 门店材料库存新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaterialSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3954")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "库存材料名称", example = "赵六")
|
||||
@NotEmpty(message = "库存材料名称不能为空")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "库存材料重量")
|
||||
@NotNull(message = "库存材料重量不能为空")
|
||||
private BigDecimal materialWeight;
|
||||
|
||||
@Schema(description = "门店编号")
|
||||
@NotNull(message = "门店编号不能为空")
|
||||
private Long carteenId;
|
||||
|
||||
@Schema(description = "库存材料重量单位")
|
||||
@NotEmpty(message = "库存材料重量单位不能为空")
|
||||
private String meterialUnit;
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.devicemoney;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 门店设备日流水 DO
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@TableName("t_device_money")
|
||||
@KeySequence("t_device_money_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceMoneyDO extends BaseDO {
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 设备ip
|
||||
*/
|
||||
private String deviceIp;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
/**
|
||||
* 设备sn
|
||||
*/
|
||||
private String deviceSn;
|
||||
/**
|
||||
* 门店编号
|
||||
*/
|
||||
private Long carteenId;
|
||||
/**
|
||||
* 设备流水
|
||||
*/
|
||||
private BigDecimal money;
|
||||
/**
|
||||
* 时间段
|
||||
*/
|
||||
private String timePeriod;
|
||||
/**
|
||||
* 热门菜品ids,如[1,2,3,4,5,]
|
||||
*/
|
||||
private String dishesIds;
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.material;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 门店材料库存 DO
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@TableName("t_material")
|
||||
@KeySequence("t_material_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MaterialDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 库存材料名称
|
||||
*/
|
||||
private String materialName;
|
||||
/**
|
||||
* 库存材料重量
|
||||
*/
|
||||
private BigDecimal materialWeight;
|
||||
/**
|
||||
* 库存材料重量单位
|
||||
*/
|
||||
private String meterialUnit;
|
||||
/**
|
||||
* 门店编号
|
||||
*/
|
||||
private Long carteenId;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.orderdetail;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 订单明细 DO
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
//@TableName("member_order_detail")
|
||||
//@KeySequence("member_order_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
|
||||
public class OrderDetail {
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private String creator;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 菜品ID
|
||||
*/
|
||||
private Long dishesId;
|
||||
/**
|
||||
* 菜品
|
||||
*/
|
||||
private String dishesName;
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
/**
|
||||
* 热量
|
||||
*/
|
||||
private Double heat;
|
||||
|
||||
/**
|
||||
* 菜品图片
|
||||
*/
|
||||
private String dishUrl;
|
||||
/**
|
||||
* 设备ip
|
||||
*/
|
||||
private String sn;
|
||||
/**
|
||||
* 菜品价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
}
|
@ -1,13 +1,29 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.deviceInfo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo.DeviceInfoPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.deviceInfo.DeviceInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author:qjq
|
||||
* @Date:2024/4/10 下午4:37
|
||||
* 设备信息关联门店 Mapper
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceInfoMapper extends BaseMapperX<DeviceInfoDO> {
|
||||
}
|
||||
|
||||
default PageResult<DeviceInfoDO> selectPage(DeviceInfoPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceInfoDO>()
|
||||
.eqIfPresent(DeviceInfoDO::getDeviceSn, reqVO.getDeviceSn())
|
||||
.eqIfPresent(DeviceInfoDO::getCarteenId, reqVO.getCarteenId())
|
||||
.eqIfPresent(DeviceInfoDO::getDeviceIp, reqVO.getDeviceIp())
|
||||
.likeIfPresent(DeviceInfoDO::getDeviceName, reqVO.getDeviceName())
|
||||
.likeIfPresent(DeviceInfoDO::getCarteenName, reqVO.getCarteenName())
|
||||
.betweenIfPresent(DeviceInfoDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceInfoDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.devicemoney;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.devicemoney.vo.DeviceMoneyPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.devicemoney.DeviceMoneyDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
/**
|
||||
* 门店设备日流水 Mapper
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceMoneyMapper extends BaseMapperX<DeviceMoneyDO> {
|
||||
|
||||
default PageResult<DeviceMoneyDO> selectPage(DeviceMoneyPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceMoneyDO>()
|
||||
.eqIfPresent(DeviceMoneyDO::getDeviceIp, reqVO.getDeviceIp())
|
||||
.likeIfPresent(DeviceMoneyDO::getDeviceName, reqVO.getDeviceName())
|
||||
.eqIfPresent(DeviceMoneyDO::getDeviceSn, reqVO.getDeviceSn())
|
||||
.eqIfPresent(DeviceMoneyDO::getCarteenId, reqVO.getCarteenId())
|
||||
.eqIfPresent(DeviceMoneyDO::getMoney, reqVO.getMoney())
|
||||
.eqIfPresent(DeviceMoneyDO::getTimePeriod, reqVO.getTimePeriod())
|
||||
.eqIfPresent(DeviceMoneyDO::getDishesIds, reqVO.getDishesIds())
|
||||
.betweenIfPresent(DeviceMoneyDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceMoneyDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -1,13 +1,18 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.dishestype;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dishestype.DishesTypeDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.orderdetail.OrderDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 菜品分类 Mapper
|
||||
@ -24,5 +29,10 @@ public interface DishesTypeMapper extends BaseMapperX<DishesTypeDO> {
|
||||
.betweenIfPresent(DishesTypeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DishesTypeDO::getId));
|
||||
}
|
||||
|
||||
@Select("<script>"+"SELECT a.dishes_name AS dishesName,a.id,b.dishes_type_name AS dishUrl,c.create_time as createTime FROM t_dishes AS a INNER JOIN t_dishes_type AS b ON a.dishec_type = b.id INNER JOIN member_order_detail AS c ON c.dishes_id = a.id where c.deleted=0 and a.deleted=0 and b.deleted=0 and c.order_id in "+"<foreach collection='ids' index='index' item='item' open='(' separator=',' close=')'>#{item}</foreach> "+ "</script>")
|
||||
List<OrderDetail> selectByIdAmdTypeName(@Param("ids") List<Long> ids);
|
||||
@Select("select id from member_dish_order where deleted=0 and store_id = #{carteenId} and create_time between #{startTime} and #{endTime}")
|
||||
List<Long> selectOrderIds(@Param("carteenId")Long carteenId,
|
||||
@Param("startTime")LocalDateTime startTime,
|
||||
@Param("endTime")LocalDateTime endTime);
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.material;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.material.MaterialDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.material.vo.*;
|
||||
/**
|
||||
* 门店材料库存 Mapper
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaterialMapper extends BaseMapperX<MaterialDO> {
|
||||
|
||||
default PageResult<MaterialDO> selectPage(MaterialPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialDO>()
|
||||
.likeIfPresent(MaterialDO::getMaterialName, reqVO.getMaterialName())
|
||||
.eqIfPresent(MaterialDO::getMaterialWeight, reqVO.getMaterialWeight())
|
||||
.eqIfPresent(MaterialDO::getMeterialUnit, reqVO.getMeterialUnit())
|
||||
.betweenIfPresent(MaterialDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MaterialDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.system.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 代码生成的场景枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum CostTypeEnum {
|
||||
|
||||
WX_PAY("1", "微信充值"),
|
||||
MORNING("2", "早餐"),
|
||||
NOON("3", "午餐"),
|
||||
NIGHT("4", "晚餐"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final String name;
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.system.enums;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:qjq 订单管理 时间段 时间枚举
|
||||
* @Date:2024/4/1 10:54
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum TimePeriodEnum {
|
||||
/**
|
||||
* 早上时间段
|
||||
*/
|
||||
MORNING("05:00:00","10:59:59","2",5,10),
|
||||
/**
|
||||
* 中午时间段
|
||||
*/
|
||||
MIDDAY("11:00:00","15:59:59","3",11,15),
|
||||
/**
|
||||
* 晚上时间段
|
||||
*/
|
||||
NIGHT("16:00:00","23:59:59","4",16,23);
|
||||
private final String startTime;
|
||||
private final String endTime;
|
||||
private final String code;
|
||||
private final Integer startInt;
|
||||
private final Integer endInt;
|
||||
public LocalDateTime getStart(){
|
||||
LocalDateTime now = LocalDateTimeUtil.now();
|
||||
String format = LocalDateTimeUtil.format(now, DatePattern.NORM_DATE_PATTERN);
|
||||
format+="T"+startTime;
|
||||
return LocalDateTimeUtil.parse(format);
|
||||
}
|
||||
public LocalDateTime getEnd(){
|
||||
LocalDateTime now = LocalDateTimeUtil.now();
|
||||
String format = LocalDateTimeUtil.format(now, DatePattern.NORM_DATE_PATTERN);
|
||||
format+="T"+endTime;
|
||||
return LocalDateTimeUtil.parse(format);
|
||||
}
|
||||
public Map<String,LocalDateTime> getStartToEnd(){
|
||||
LocalDateTime start = this.getStart();
|
||||
LocalDateTime end = this.getEnd();
|
||||
return MapUtil.builder(new HashMap<String,LocalDateTime>())
|
||||
.put("start", start)
|
||||
.put("end", end).build();
|
||||
}
|
||||
|
||||
public static String getTimePeriod(LocalDateTime localDateTime){
|
||||
int hour = localDateTime.getHour();
|
||||
if(TimePeriodEnum.MORNING.startInt<=hour && hour<=TimePeriodEnum.MORNING.endInt){
|
||||
return CostTypeEnum.MORNING.getCode();
|
||||
} else if (TimePeriodEnum.MIDDAY.startInt<=hour && hour<=TimePeriodEnum.MIDDAY.endInt){
|
||||
return CostTypeEnum.NOON.getCode();
|
||||
}else{
|
||||
return CostTypeEnum.NIGHT.getCode();
|
||||
}
|
||||
}
|
||||
public static String getTimeName(LocalDateTime localDateTime){
|
||||
int hour = localDateTime.getHour();
|
||||
if(TimePeriodEnum.MORNING.startInt<=hour && hour<=TimePeriodEnum.MORNING.endInt){
|
||||
return CostTypeEnum.MORNING.getName();
|
||||
} else if (TimePeriodEnum.MIDDAY.startInt<=hour && hour<=TimePeriodEnum.MIDDAY.endInt){
|
||||
return CostTypeEnum.NOON.getName();
|
||||
}else{
|
||||
return CostTypeEnum.NIGHT.getName();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,17 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.service.carteen;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.carteen.vo.CarteenPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.carteen.vo.CarteenSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.carteen.CarteenDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.carteen.CarteenMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.ErrorCodeConstants;
|
||||
import com.xingyuv.jushauth.utils.UuidUtils;
|
||||
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
@ -25,7 +29,8 @@ public class CarteenServiceImpl implements CarteenService {
|
||||
|
||||
@Resource
|
||||
private CarteenMapper carteenMapper;
|
||||
|
||||
@Resource
|
||||
private PermissionService permissionService;
|
||||
@Override
|
||||
public Long createCarteen(CarteenSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@ -34,12 +39,12 @@ public class CarteenServiceImpl implements CarteenService {
|
||||
carteen.setMultipleManage(Boolean.FALSE);
|
||||
carteen.setAccountOrder(Boolean.FALSE);
|
||||
carteen.setDeleted(Boolean.FALSE);
|
||||
carteen.setSerialNumber(UuidUtils.getUUID());
|
||||
Set<Long> set = permissionService.getUserRoleIdListByUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
carteen.setSerialNumber(Arrays.toString(set.toArray()));
|
||||
carteenMapper.insert(carteen);
|
||||
// 返回
|
||||
return carteen.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCarteen(CarteenSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.system.service.deviceinfo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo.DeviceInfoPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo.DeviceInfoSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.deviceInfo.DeviceInfoDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 设备信息关联门店 Service 接口
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
public interface DeviceInfoService {
|
||||
|
||||
/**
|
||||
* 创建设备信息关联门店
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createDeviceInfo(@Valid DeviceInfoSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新设备信息关联门店
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDeviceInfo(@Valid DeviceInfoSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除设备信息关联门店
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDeviceInfo(Long id);
|
||||
|
||||
/**
|
||||
* 获得设备信息关联门店
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 设备信息关联门店
|
||||
*/
|
||||
DeviceInfoDO getDeviceInfo(Long id);
|
||||
|
||||
/**
|
||||
* 获得设备信息关联门店分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 设备信息关联门店分页
|
||||
*/
|
||||
PageResult<DeviceInfoDO> getDeviceInfoPage(DeviceInfoPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.system.service.deviceinfo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo.DeviceInfoPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo.DeviceInfoSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.deviceInfo.DeviceInfoDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.deviceInfo.DeviceInfoMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.ErrorCodeConstants;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 设备信息关联门店 Service 实现类
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DeviceInfoServiceImpl implements DeviceInfoService {
|
||||
|
||||
@Resource
|
||||
private DeviceInfoMapper deviceInfoMapper;
|
||||
|
||||
@Override
|
||||
public Long createDeviceInfo(DeviceInfoSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DeviceInfoDO deviceInfo = BeanUtils.toBean(createReqVO, DeviceInfoDO.class);
|
||||
deviceInfoMapper.insert(deviceInfo);
|
||||
// 返回
|
||||
return deviceInfo.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceInfo(DeviceInfoSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDeviceInfoExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DeviceInfoDO updateObj = BeanUtils.toBean(updateReqVO, DeviceInfoDO.class);
|
||||
deviceInfoMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDeviceInfo(Long id) {
|
||||
// 校验存在
|
||||
validateDeviceInfoExists(id);
|
||||
// 删除
|
||||
deviceInfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateDeviceInfoExists(Long id) {
|
||||
if (deviceInfoMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.DEVUCE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceInfoDO getDeviceInfo(Long id) {
|
||||
return deviceInfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DeviceInfoDO> getDeviceInfoPage(DeviceInfoPageReqVO pageReqVO) {
|
||||
return deviceInfoMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.system.service.devicemoney;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.devicemoney.DeviceMoneyDO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.devicemoney.vo.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 门店设备日流水 Service 接口
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
public interface DeviceMoneyService {
|
||||
|
||||
/**
|
||||
* 创建门店设备日流水
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createDeviceMoney(@Valid DeviceMoneySaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新门店设备日流水
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDeviceMoney(@Valid DeviceMoneySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除门店设备日流水
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDeviceMoney(Long id);
|
||||
|
||||
/**
|
||||
* 获得门店设备日流水
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 门店设备日流水
|
||||
*/
|
||||
DeviceMoneyDO getDeviceMoney(Long id);
|
||||
|
||||
/**
|
||||
* 获得门店设备日流水分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 门店设备日流水分页
|
||||
*/
|
||||
PageResult<DeviceMoneyDO> getDeviceMoneyPage(DeviceMoneyPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.system.service.devicemoney;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.devicemoney.vo.DeviceMoneyPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.devicemoney.vo.DeviceMoneySaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.devicemoney.DeviceMoneyDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.devicemoney.DeviceMoneyMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.ErrorCodeConstants;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 门店设备日流水 Service 实现类
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DeviceMoneyServiceImpl implements DeviceMoneyService {
|
||||
|
||||
@Resource
|
||||
private DeviceMoneyMapper deviceMoneyMapper;
|
||||
|
||||
@Override
|
||||
public Long createDeviceMoney(DeviceMoneySaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DeviceMoneyDO deviceMoney = BeanUtils.toBean(createReqVO, DeviceMoneyDO.class);
|
||||
deviceMoneyMapper.insert(deviceMoney);
|
||||
// 返回
|
||||
return deviceMoney.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceMoney(DeviceMoneySaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDeviceMoneyExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DeviceMoneyDO updateObj = BeanUtils.toBean(updateReqVO, DeviceMoneyDO.class);
|
||||
deviceMoneyMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDeviceMoney(Long id) {
|
||||
// 校验存在
|
||||
validateDeviceMoneyExists(id);
|
||||
// 删除
|
||||
deviceMoneyMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateDeviceMoneyExists(Long id) {
|
||||
if (deviceMoneyMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.DEVICE_MONEY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceMoneyDO getDeviceMoney(Long id) {
|
||||
return deviceMoneyMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DeviceMoneyDO> getDeviceMoneyPage(DeviceMoneyPageReqVO pageReqVO) {
|
||||
return deviceMoneyMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -1,12 +1,14 @@
|
||||
package cn.iocoder.yudao.module.system.service.dishestype;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypeListRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dishestype.DishesTypeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜品分类 Service 接口
|
||||
@ -52,5 +54,14 @@ public interface DishesTypeService {
|
||||
* @return 菜品分类分页
|
||||
*/
|
||||
PageResult<DishesTypeDO> getDishesTypePage(DishesTypePageReqVO pageReqVO);
|
||||
/**
|
||||
* @Description: 通过门店编号 获得菜品分类以及菜品名称
|
||||
* @Author: qjq
|
||||
* @Date: 2024/4/15 下午3:13
|
||||
* @return
|
||||
*/
|
||||
List<DishesTypeListRespVO> getDishesTypeList(Long carteenId, LocalDateTime startTime,LocalDateTime endTime);
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,17 +1,24 @@
|
||||
package cn.iocoder.yudao.module.system.service.dishestype;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypeListRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dishestype.vo.DishesTypeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dishestype.DishesTypeDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.orderdetail.OrderDetail;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.dishes.DishesMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.dishestype.DishesTypeMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.ErrorCodeConstants;
|
||||
import cn.iocoder.yudao.module.system.enums.TimePeriodEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
@ -26,7 +33,8 @@ public class DishesTypeServiceImpl implements DishesTypeService {
|
||||
|
||||
@Resource
|
||||
private DishesTypeMapper dishesTypeMapper;
|
||||
|
||||
@Resource
|
||||
private DishesMapper dishesMapper;
|
||||
@Override
|
||||
public Long createDishesType(DishesTypeSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@ -70,4 +78,49 @@ public class DishesTypeServiceImpl implements DishesTypeService {
|
||||
return dishesTypeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param carteenId
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
* @Description: 通过门店编号 获得菜品分类以及菜品名称
|
||||
* @Author: qjq
|
||||
* @Date: 2024/4/15 下午3:13
|
||||
*/
|
||||
@Override
|
||||
public List<DishesTypeListRespVO> getDishesTypeList(Long carteenId, LocalDateTime startTime, LocalDateTime endTime) {
|
||||
List<DishesTypeListRespVO> list=new ArrayList<>();
|
||||
//获取订单id
|
||||
List<Long> collect = dishesTypeMapper.selectOrderIds(carteenId, startTime, endTime);
|
||||
List<OrderDetail> orderDetailDOS = dishesTypeMapper.selectByIdAmdTypeName(collect);
|
||||
orderDetailDOS.forEach(f-> f.setCreator(TimePeriodEnum.getTimePeriod(f.getCreateTime())));
|
||||
// 根据时间进行分组
|
||||
Map<String, List<OrderDetail>> map = orderDetailDOS.stream()
|
||||
.collect(Collectors.groupingBy(OrderDetail::getCreator));
|
||||
for (Map.Entry<String, List<OrderDetail>> en : map.entrySet()) {
|
||||
DishesTypeListRespVO vo=new DishesTypeListRespVO();
|
||||
vo.setTime(en.getKey());
|
||||
//集合根据菜品名称去重
|
||||
List<OrderDetail> collect1 = new ArrayList<>(en.getValue().stream().collect(Collectors.toMap(
|
||||
OrderDetail::getDishesName,
|
||||
m -> m,
|
||||
(oldValue, newValue) -> newValue
|
||||
)).values());
|
||||
//根据类型进行分组
|
||||
collect1.stream()
|
||||
.collect(Collectors.groupingBy(OrderDetail::getDishUrl))
|
||||
.forEach((v,k)-> {
|
||||
Map<String, String> map1 = MapUtil.builder(new HashMap<String, String>())
|
||||
.put("dishesName", k.stream()
|
||||
.map(OrderDetail::getDishesName)
|
||||
.collect(Collectors.toList()).toString())
|
||||
.put("typeName", v)
|
||||
.map();
|
||||
vo.getDishesTypeName().add(map1);
|
||||
});
|
||||
list.add(vo);
|
||||
}
|
||||
list.sort(Comparator.comparing(DishesTypeListRespVO::getTime));
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.system.service.material;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.material.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.material.MaterialDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门店材料库存 Service 接口
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
public interface MaterialService {
|
||||
|
||||
/**
|
||||
* 创建门店材料库存
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createMaterial(@Valid MaterialSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新门店材料库存
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMaterial(@Valid MaterialSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除门店材料库存
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMaterial(Long id);
|
||||
|
||||
/**
|
||||
* 获得门店材料库存
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 门店材料库存
|
||||
*/
|
||||
MaterialDO getMaterial(Long id);
|
||||
|
||||
/**
|
||||
* 获得门店材料库存分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 门店材料库存分页
|
||||
*/
|
||||
PageResult<MaterialDO> getMaterialPage(MaterialPageReqVO pageReqVO);
|
||||
/**
|
||||
* @Description: 获取门店材料库存列表
|
||||
* @Author: qjq
|
||||
* @Date: 2024/4/15 下午2:11
|
||||
* @return
|
||||
*/
|
||||
List<MaterialDO> getMaterialList(Long carteenId);
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.system.service.material;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.material.vo.MaterialPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.material.vo.MaterialSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.material.MaterialDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.material.MaterialMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.ErrorCodeConstants;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 门店材料库存 Service 实现类
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaterialServiceImpl implements MaterialService {
|
||||
|
||||
@Resource
|
||||
private MaterialMapper materialMapper;
|
||||
|
||||
@Override
|
||||
public Long createMaterial(MaterialSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaterialDO material = BeanUtils.toBean(createReqVO, MaterialDO.class);
|
||||
materialMapper.insert(material);
|
||||
// 返回
|
||||
return material.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMaterial(MaterialSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMaterialExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MaterialDO updateObj = BeanUtils.toBean(updateReqVO, MaterialDO.class);
|
||||
materialMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMaterial(Long id) {
|
||||
// 校验存在
|
||||
validateMaterialExists(id);
|
||||
// 删除
|
||||
materialMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateMaterialExists(Long id) {
|
||||
if (materialMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.MATERIAL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialDO getMaterial(Long id) {
|
||||
return materialMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaterialDO> getMaterialPage(MaterialPageReqVO pageReqVO) {
|
||||
return materialMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param carteenId
|
||||
* @return
|
||||
* @Description: 获取门店材料库存列表
|
||||
* @Author: qjq
|
||||
* @Date: 2024/4/15 下午2:11
|
||||
*/
|
||||
@Override
|
||||
public List<MaterialDO> getMaterialList(Long carteenId) {
|
||||
return materialMapper.selectList(new LambdaQueryWrapperX<MaterialDO>()
|
||||
.eqIfPresent(MaterialDO::getCarteenId,carteenId));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user