Merge remote-tracking branch 'origin/master'

This commit is contained in:
jjLv 2025-08-29 09:34:10 +08:00
commit 7eb3937bdb
11 changed files with 131 additions and 33 deletions

View File

@ -152,25 +152,25 @@ public class CookDishes extends BaseEntity {
/** 菜品基础单价(分) */ /** 菜品基础单价(分) */
@Excel(name = "菜品基础单价(分)") @Excel(name = "菜品基础单价(分)")
@ApiModelProperty(value = "菜品基础单价(分)") @ApiModelProperty(value = "菜品基础单价(分)")
@Max(value = 9999L, message = "菜品价格超过限制") @Max(value = 99999L, message = "菜品价格超过限制")
private Long price; private Long price;
/** 单位价格 */ /** 单位价格 */
@Excel(name = "单位价格") @Excel(name = "单位价格")
@ApiModelProperty(value = "单位价格") @ApiModelProperty(value = "单位价格")
@Max(value = 9999L, message = "菜品单价超过限制") @Max(value = 99999L, message = "菜品单价超过限制")
private Long unitPrice; private Long unitPrice;
/** 大份单价 */ /** 大份单价 */
@Excel(name = "大份单价") @Excel(name = "大份单价")
@ApiModelProperty(value = "大份单价") @ApiModelProperty(value = "大份单价")
@Max(value = 9999L, message = "菜品单价超过限制") @Max(value = 99999L, message = "菜品单价超过限制")
private Long largePrice; private Long largePrice;
/** 小份单价 */ /** 小份单价 */
@Excel(name = "小份单价") @Excel(name = "小份单价")
@ApiModelProperty(value = "小份单价") @ApiModelProperty(value = "小份单价")
@Max(value = 9999L, message = "菜品单价超过限制") @Max(value = 99999L, message = "菜品单价超过限制")
private Long littlePrice; private Long littlePrice;
/** 菜品图片url */ /** 菜品图片url */
@ -331,7 +331,7 @@ public class CookDishes extends BaseEntity {
/** 成本价 */ /** 成本价 */
@Excel(name = "成本价") @Excel(name = "成本价")
@ApiModelProperty(value = "成本价") @ApiModelProperty(value = "成本价")
@Max(value = 9999L, message = "菜品成本价超过限制") @Max(value = 99999L, message = "菜品成本价超过限制")
private Long materialCost; private Long materialCost;
/** 毛利 */ /** 毛利 */

View File

@ -37,7 +37,7 @@ public class CookRecipeDishesDTO extends BaseEntity {
/** 菜品单价 */ /** 菜品单价 */
@Excel(name = "菜品单价") @Excel(name = "菜品单价")
@ApiModelProperty(value = "菜品单价") @ApiModelProperty(value = "菜品单价")
@Max(value = 9999L, message = "菜品单价超过限制") @Max(value = 99999L, message = "菜品单价超过限制")
private Long price; private Long price;
/** 菜品售价(优惠价) */ /** 菜品售价(优惠价) */
@ -54,13 +54,13 @@ public class CookRecipeDishesDTO extends BaseEntity {
/** 供应数量 */ /** 供应数量 */
@Excel(name = "供应数量") @Excel(name = "供应数量")
@ApiModelProperty(value = "供应数量") @ApiModelProperty(value = "供应数量")
@Max(value = 9999L, message = "供应数量超过限制") @Max(value = 99999L, message = "供应数量超过限制")
private Long supplyNum; private Long supplyNum;
/** 销售数量 */ /** 销售数量 */
@Excel(name = "销售数量") @Excel(name = "销售数量")
@ApiModelProperty(value = "销售数量") @ApiModelProperty(value = "销售数量")
@Max(value = 9999L, message = "销售数量超过限制") @Max(value = 99999L, message = "销售数量超过限制")
private Long saleNum; private Long saleNum;
/** 剩余数量 */ /** 剩余数量 */
@ -71,7 +71,7 @@ public class CookRecipeDishesDTO extends BaseEntity {
/** 个人限购数量 */ /** 个人限购数量 */
@Excel(name = "个人限购数量") @Excel(name = "个人限购数量")
@ApiModelProperty(value = "个人限购数量") @ApiModelProperty(value = "个人限购数量")
@Max(value = 9999L, message = "个人限购数量超过限制") @Max(value = 99999L, message = "个人限购数量超过限制")
private Long limitNum; private Long limitNum;
/** 厨师id */ /** 厨师id */

View File

@ -2,6 +2,7 @@ package com.bonus.canteen.core.kitchen.domain;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.bonus.canteen.core.kitchen.dto.KitchenVideoDTO;
import com.bonus.common.core.annotation.Excel; import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -107,8 +108,9 @@ public class KitchenDeviceInfo extends Model<KitchenDeviceInfo> {
@JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime; private Date updateTime;
private String ip; private String ip;
private Integer channel; private Integer channel;
private KitchenVideoDTO kitchenVideoDTO;
} }

View File

@ -0,0 +1,35 @@
package com.bonus.canteen.core.kitchen.dto;
import lombok.Data;
/**
* @author xliu
* @date 2025/8/28 15:09
*/
@Data
public class KitchenVideoDTO {
private String channel;
private String deviceIp;
private Integer protocol;
private Integer ifControl;
private Integer channelNum;
private Integer manuFactor;
private String cameraMsUser;
private String localRtspUrl;
private String streamMethod;
private Integer smartListener;
private String cameraMsPassword;
private String cameraStreamMethod;
private String cameraStreamAddress;
}

View File

@ -66,4 +66,6 @@ public interface KitchenSampleDishesRecordMapper {
public int handleKitchenSampleDishesTimeOut(); public int handleKitchenSampleDishesTimeOut();
public List<KitchenSampleDishesRecord> getDishesByStallAndMealtimeType(KitchenSampleDishesRecord kitchenSampleDishesRecord); public List<KitchenSampleDishesRecord> getDishesByStallAndMealtimeType(KitchenSampleDishesRecord kitchenSampleDishesRecord);
List<KitchenSampleDishesRecord> getLeaveCabinetAbnormal(Integer hour);
} }

View File

@ -66,4 +66,6 @@ public interface IKitchenSampleDishesRecordService {
public int handleKitchenSampleDishesTimeOut(); public int handleKitchenSampleDishesTimeOut();
public List<KitchenSampleDishesRecord> getDishesByStallAndMealtimeType(KitchenSampleDishesRecord kitchenSampleDishesRecord); public List<KitchenSampleDishesRecord> getDishesByStallAndMealtimeType(KitchenSampleDishesRecord kitchenSampleDishesRecord);
List<KitchenSampleDishesRecord> getLeaveCabinetAbnormal(Integer hour);
} }

View File

@ -5,10 +5,12 @@ import java.net.InetAddress;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO; import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
import com.bonus.canteen.core.kitchen.dto.KitchenVideoDTO;
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO; import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO;
import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.DateUtils;
@ -141,6 +143,11 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpl<KitchenDeviceInfoM
if(bean !=null) { if(bean !=null) {
throw new ServiceException("改类型设备通道已存在,请检查后重新输入"); throw new ServiceException("改类型设备通道已存在,请检查后重新输入");
} }
KitchenVideoDTO videoDTO = kitchenDeviceInfo.getKitchenVideoDTO();
if(videoDTO !=null){
kitchenDeviceInfo.setDeviceExtendInfo(JSON.toJSONString(videoDTO));
}
} }
try { try {
return kitchenDeviceInfoMapper.insertKitchenDeviceInfo(kitchenDeviceInfo); return kitchenDeviceInfoMapper.insertKitchenDeviceInfo(kitchenDeviceInfo);
@ -215,6 +222,10 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpl<KitchenDeviceInfoM
throw new ServiceException("改设备类型 设备通道号已存在"); throw new ServiceException("改设备类型 设备通道号已存在");
} }
try { try {
KitchenVideoDTO videoDTO = kitchenDeviceInfo.getKitchenVideoDTO();
if(videoDTO !=null){
kitchenDeviceInfo.setDeviceExtendInfo(JSON.toJSONString(videoDTO));
}
return kitchenDeviceInfoMapper.update(kitchenDeviceInfo, return kitchenDeviceInfoMapper.update(kitchenDeviceInfo,
Wrappers.<KitchenDeviceInfo>lambdaUpdate() Wrappers.<KitchenDeviceInfo>lambdaUpdate()
.eq(KitchenDeviceInfo::getDeviceId, kitchenDeviceInfo.getDeviceId())); .eq(KitchenDeviceInfo::getDeviceId, kitchenDeviceInfo.getDeviceId()));

View File

@ -152,6 +152,11 @@ public class KitchenSampleDishesRecordServiceImpl implements IKitchenSampleDishe
return kitchenSampleDishesRecordMapper.handleKitchenSampleDishesTimeOut(); return kitchenSampleDishesRecordMapper.handleKitchenSampleDishesTimeOut();
} }
@Override
public List<KitchenSampleDishesRecord> getLeaveCabinetAbnormal(Integer hour) {
return kitchenSampleDishesRecordMapper.getLeaveCabinetAbnormal(hour);
}
public List<KitchenSampleDishesRecord> getDishesByStallAndMealtimeType(KitchenSampleDishesRecord kitchenSampleDishesRecord) { public List<KitchenSampleDishesRecord> getDishesByStallAndMealtimeType(KitchenSampleDishesRecord kitchenSampleDishesRecord) {
kitchenSampleDishesRecord.setApplyDate(LocalDate.now()); kitchenSampleDishesRecord.setApplyDate(LocalDate.now());
BasicStallMealtime basicStallMealtime = new BasicStallMealtime(); BasicStallMealtime basicStallMealtime = new BasicStallMealtime();

View File

@ -0,0 +1,35 @@
package com.bonus.canteen.core.kitchen.task;
import com.bonus.canteen.core.kitchen.domain.KitchenSampleDishesRecord;
import com.bonus.canteen.core.kitchen.service.IKitchenSampleDishesRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author xliu
* @date 2025/8/28 15:30
*/
@Component
public class KitchenSampleDishesTsak {
@Autowired
private IKitchenSampleDishesRecordService kitchenSampleDishesRecordService;
@Scheduled(fixedDelay = 12*60*60*1000)
private void sampleDishesStateHandler() {
//传入过期时间可根据数据字典设置查询过期时间
Integer hour = 24;
List<KitchenSampleDishesRecord> list = kitchenSampleDishesRecordService.getLeaveCabinetAbnormal(hour);
for (KitchenSampleDishesRecord record : list) {
//根据自己需要的逻辑处理 设置时间状态
kitchenSampleDishesRecordService.updateKitchenSampleDishesRecord(record);
}
}
}

View File

@ -80,12 +80,12 @@ public class SupermarketInfo extends BaseEntity {
/** 最少配送时间(分) */ /** 最少配送时间(分) */
@Excel(name = "最少配送时间", readConverterExp = "分=") @Excel(name = "最少配送时间", readConverterExp = "分=")
@Max(value = 9999L, message = "最少配送时间超过限制") @Max(value = 99999L, message = "最少配送时间超过限制")
private Long minDeliveryTime; private Long minDeliveryTime;
/** 选择时间间隔(分) */ /** 选择时间间隔(分) */
@Excel(name = "选择时间间隔", readConverterExp = "分=") @Excel(name = "选择时间间隔", readConverterExp = "分=")
@Max(value = 9999L, message = "时间间隔超过限制") @Max(value = 99999L, message = "时间间隔超过限制")
private Long selectTimeInterval; private Long selectTimeInterval;
/** 配送费(元) */ /** 配送费(元) */

View File

@ -268,4 +268,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where where
crd.detail_type = 2 and crd.apply_date = #{applyDate} and bs.stall_id = #{stallId} and crd.mealtime_type = #{mealtimeType} crd.detail_type = 2 and crd.apply_date = #{applyDate} and bs.stall_id = #{stallId} and crd.mealtime_type = #{mealtimeType}
</select> </select>
<select id="getLeaveCabinetAbnormal" resultMap="KitchenSampleDishesRecordResult">
<include refid="selectKitchenSampleDishesRecordVo"/>
where enter_cabinet_time is not null and leave_cabinet_time is null
and TIMESTAMPDIFF(HOUR, enter_cabinet_time, NOW()) > 12
</select>
</mapper> </mapper>